Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4bc1d553
Commit
4bc1d553
authored
Apr 15, 2006
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* backport [15240] to get a functional winamp2 skin for 0.8.5
parent
c64b6382
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
5 deletions
+38
-5
doc/skins/skins2-howto.xml
doc/skins/skins2-howto.xml
+4
-1
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+8
-4
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+5
-0
modules/gui/skins2/utils/var_text.cpp
modules/gui/skins2/utils/var_text.cpp
+11
-0
share/skins2/winamp2.xml
share/skins2/winamp2.xml
+1
-0
src/input/es_out.c
src/input/es_out.c
+6
-0
src/input/input.c
src/input/input.c
+3
-0
No files found.
doc/skins/skins2-howto.xml
View file @
4bc1d553
...
@@ -921,7 +921,7 @@ difficulty to understand how VLC skins work.</para>
...
@@ -921,7 +921,7 @@ difficulty to understand how VLC skins work.</para>
<itemizedlist>
<itemizedlist>
<listitem><para>
<listitem><para>
<emphasis>
$B
</emphasis>
: Get the stream bitrate (in kb/s).
<emphasis>
$B
</emphasis>
: Get the
audio
stream bitrate (in kb/s).
</para></listitem>
</para></listitem>
<listitem><para>
<listitem><para>
<emphasis>
$V
</emphasis>
: Value of the volume (from 0 to 100 --> useful for a percentage).
<emphasis>
$V
</emphasis>
: Value of the volume (from 0 to 100 --> useful for a percentage).
...
@@ -948,6 +948,9 @@ difficulty to understand how VLC skins work.</para>
...
@@ -948,6 +948,9 @@ difficulty to understand how VLC skins work.</para>
<listitem><para>
<listitem><para>
<emphasis>
$F
</emphasis>
: Full name (with path) of the stream that is being played.
<emphasis>
$F
</emphasis>
: Full name (with path) of the stream that is being played.
</para></listitem>
</para></listitem>
<listitem><para>
<emphasis>
$S
</emphasis>
: Get the audio sample rate (in kHz).
</para></listitem>
</itemizedlist>
</itemizedlist>
<para>
Example of
<link
linkend=
"slidertooltiptext"
>
tooltiptext
</link>
value for a slider controlling the volume: "Volume: $V%".
</para>
<para>
Example of
<link
linkend=
"slidertooltiptext"
>
tooltiptext
</link>
value for a slider controlling the volume: "Volume: $V%".
</para>
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
4bc1d553
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include <vlc/vout.h>
#include <vlc/vout.h>
#include <aout_internal.h>
#include <aout_internal.h>
#include <math.h>
#include "vlcproc.hpp"
#include "vlcproc.hpp"
#include "os_factory.hpp"
#include "os_factory.hpp"
#include "os_timer.hpp"
#include "os_timer.hpp"
...
@@ -111,6 +110,8 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
...
@@ -111,6 +110,8 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
pVarManager
->
registerVar
(
m_cVarStreamURI
,
"streamURI"
);
pVarManager
->
registerVar
(
m_cVarStreamURI
,
"streamURI"
);
m_cVarStreamBitRate
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
m_cVarStreamBitRate
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
pVarManager
->
registerVar
(
m_cVarStreamBitRate
,
"bitrate"
);
pVarManager
->
registerVar
(
m_cVarStreamBitRate
,
"bitrate"
);
m_cVarStreamSampleRate
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
pVarManager
->
registerVar
(
m_cVarStreamSampleRate
,
"samplerate"
);
// Register the equalizer bands
// Register the equalizer bands
for
(
int
i
=
0
;
i
<
EqualizerBands
::
kNbBands
;
i
++
)
for
(
int
i
=
0
;
i
<
EqualizerBands
::
kNbBands
;
i
++
)
...
@@ -243,6 +244,7 @@ void VlcProc::manage()
...
@@ -243,6 +244,7 @@ void VlcProc::manage()
VarBoolImpl
*
pVarFullscreen
=
(
VarBoolImpl
*
)
m_cVarFullscreen
.
get
();
VarBoolImpl
*
pVarFullscreen
=
(
VarBoolImpl
*
)
m_cVarFullscreen
.
get
();
VarBoolImpl
*
pVarHasVout
=
(
VarBoolImpl
*
)
m_cVarHasVout
.
get
();
VarBoolImpl
*
pVarHasVout
=
(
VarBoolImpl
*
)
m_cVarHasVout
.
get
();
VarText
*
pBitrate
=
(
VarText
*
)
m_cVarStreamBitRate
.
get
();
VarText
*
pBitrate
=
(
VarText
*
)
m_cVarStreamBitRate
.
get
();
VarText
*
pSampleRate
=
(
VarText
*
)
m_cVarStreamSampleRate
.
get
();
// Refresh audio variables
// Refresh audio variables
refreshAudio
();
refreshAudio
();
...
@@ -295,11 +297,13 @@ void VlcProc::manage()
...
@@ -295,11 +297,13 @@ void VlcProc::manage()
vlc_object_release
(
pVout
);
vlc_object_release
(
pVout
);
}
}
// Get information on the current playlist item
input_item_t
*
pItem
=
pInput
->
input
.
p_item
;
// Get the input bitrate
// Get the input bitrate
int
bitrate
=
(
int
)(
roundf
(
pItem
->
p_stats
->
f_demux_bitrate
*
8000
))
;
int
bitrate
=
var_GetInteger
(
pInput
,
"bit-rate"
)
/
1000
;
pBitrate
->
set
(
UString
::
fromInt
(
getIntf
(),
bitrate
)
);
pBitrate
->
set
(
UString
::
fromInt
(
getIntf
(),
bitrate
)
);
// Get the audio sample rate
int
sampleRate
=
var_GetInteger
(
pInput
,
"sample-rate"
)
/
1000
;
pSampleRate
->
set
(
UString
::
fromInt
(
getIntf
(),
sampleRate
)
);
}
}
else
else
{
{
...
...
modules/gui/skins2/src/vlcproc.hpp
View file @
4bc1d553
...
@@ -76,6 +76,10 @@ class VlcProc: public SkinObject
...
@@ -76,6 +76,10 @@ class VlcProc: public SkinObject
VarText
&
getStreamBitRateVar
()
VarText
&
getStreamBitRateVar
()
{
return
*
((
VarText
*
)(
m_cVarStreamBitRate
.
get
()));
}
{
return
*
((
VarText
*
)(
m_cVarStreamBitRate
.
get
()));
}
/// Getter for the stream sample rate variable
VarText
&
getStreamSampleRateVar
()
{
return
*
((
VarText
*
)(
m_cVarStreamSampleRate
.
get
()));
}
/// Getter for the vout size variable
/// Getter for the vout size variable
VarBox
&
getVoutSizeVar
()
{
return
m_varVoutSize
;
}
VarBox
&
getVoutSizeVar
()
{
return
m_varVoutSize
;
}
...
@@ -115,6 +119,7 @@ class VlcProc: public SkinObject
...
@@ -115,6 +119,7 @@ class VlcProc: public SkinObject
VariablePtr
m_cVarStreamName
;
VariablePtr
m_cVarStreamName
;
VariablePtr
m_cVarStreamURI
;
VariablePtr
m_cVarStreamURI
;
VariablePtr
m_cVarStreamBitRate
;
VariablePtr
m_cVarStreamBitRate
;
VariablePtr
m_cVarStreamSampleRate
;
/// Variable for the "mute" state
/// Variable for the "mute" state
VariablePtr
m_cVarMute
;
VariablePtr
m_cVarMute
;
/// Variables related to the input
/// Variables related to the input
...
...
modules/gui/skins2/utils/var_text.cpp
View file @
4bc1d553
...
@@ -49,6 +49,7 @@ VarText::~VarText()
...
@@ -49,6 +49,7 @@ VarText::~VarText()
pVlcProc
->
getStreamURIVar
().
delObserver
(
this
);
pVlcProc
->
getStreamURIVar
().
delObserver
(
this
);
pVlcProc
->
getStreamNameVar
().
delObserver
(
this
);
pVlcProc
->
getStreamNameVar
().
delObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
delObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
delObserver
(
this
);
pVlcProc
->
getStreamSampleRateVar
().
delObserver
(
this
);
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
pVarManager
->
getHelpText
().
delObserver
(
this
);
pVarManager
->
getHelpText
().
delObserver
(
this
);
}
}
...
@@ -126,6 +127,10 @@ const UString VarText::get() const
...
@@ -126,6 +127,10 @@ const UString VarText::get() const
{
{
temp
.
replace
(
pos
,
2
,
pVlcProc
->
getStreamBitRateVar
().
get
()
);
temp
.
replace
(
pos
,
2
,
pVlcProc
->
getStreamBitRateVar
().
get
()
);
}
}
while
(
(
pos
=
temp
.
find
(
"$S"
))
!=
UString
::
npos
)
{
temp
.
replace
(
pos
,
2
,
pVlcProc
->
getStreamSampleRateVar
().
get
()
);
}
return
temp
;
return
temp
;
}
}
...
@@ -150,6 +155,7 @@ void VarText::set( const UString &rText )
...
@@ -150,6 +155,7 @@ void VarText::set( const UString &rText )
pVlcProc
->
getStreamNameVar
().
delObserver
(
this
);
pVlcProc
->
getStreamNameVar
().
delObserver
(
this
);
pVlcProc
->
getStreamURIVar
().
delObserver
(
this
);
pVlcProc
->
getStreamURIVar
().
delObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
delObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
delObserver
(
this
);
pVlcProc
->
getStreamSampleRateVar
().
delObserver
(
this
);
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
pVarManager
->
getHelpText
().
delObserver
(
this
);
pVarManager
->
getHelpText
().
delObserver
(
this
);
...
@@ -189,6 +195,10 @@ void VarText::set( const UString &rText )
...
@@ -189,6 +195,10 @@ void VarText::set( const UString &rText )
{
{
pVlcProc
->
getStreamBitRateVar
().
addObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
addObserver
(
this
);
}
}
if
(
m_text
.
find
(
"$S"
)
!=
UString
::
npos
)
{
pVlcProc
->
getStreamSampleRateVar
().
addObserver
(
this
);
}
}
}
notify
();
notify
();
...
@@ -217,3 +227,4 @@ void VarText::onUpdate( Subject<VarText,void*> &rVariable, void *arg )
...
@@ -217,3 +227,4 @@ void VarText::onUpdate( Subject<VarText,void*> &rVariable, void *arg )
notify
();
notify
();
}
}
}
}
share/skins2/winamp2.xml
View file @
4bc1d553
...
@@ -195,6 +195,7 @@
...
@@ -195,6 +195,7 @@
<Text
font=
"digits_font;digits_font_2"
x=
"30"
y=
"26"
width=
"72"
text=
"$t"
visible=
"not vlc.isStopped"
scrolling=
"none"
alignment=
"right"
/>
<Text
font=
"digits_font;digits_font_2"
x=
"30"
y=
"26"
width=
"72"
text=
"$t"
visible=
"not vlc.isStopped"
scrolling=
"none"
alignment=
"right"
/>
<Text
font=
"text_font"
x=
"111"
y=
"27"
width=
"155"
text=
"$N"
/>
<Text
font=
"text_font"
x=
"111"
y=
"27"
width=
"155"
text=
"$N"
/>
<Text
font=
"text_font"
x=
"111"
y=
"43"
width=
"15"
text=
"$B"
scrolling=
"none"
alignment=
"right"
/>
<Text
font=
"text_font"
x=
"111"
y=
"43"
width=
"15"
text=
"$B"
scrolling=
"none"
alignment=
"right"
/>
<Text
font=
"text_font"
x=
"151"
y=
"43"
width=
"15"
text=
"$S"
scrolling=
"none"
alignment=
"right"
/>
<Slider
value=
"volume"
x=
"107"
y=
"57"
up=
"volume_up"
down=
"volume_down"
points=
"(7,6),(58,6)"
tooltiptext=
"Volume: $V%"
>
<Slider
value=
"volume"
x=
"107"
y=
"57"
up=
"volume_up"
down=
"volume_down"
points=
"(7,6),(58,6)"
tooltiptext=
"Volume: $V%"
>
<SliderBackground
image=
"volume_bg;volume_bg_2"
nbvert=
"28"
padvert=
"2"
/>
<SliderBackground
image=
"volume_bg;volume_bg_2"
nbvert=
"28"
padvert=
"2"
/>
</Slider>
</Slider>
...
...
src/input/es_out.c
View file @
4bc1d553
...
@@ -1596,8 +1596,11 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es )
...
@@ -1596,8 +1596,11 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es )
"%d"
,
fmt
->
audio
.
i_channels
);
"%d"
,
fmt
->
audio
.
i_channels
);
if
(
fmt
->
audio
.
i_rate
>
0
)
if
(
fmt
->
audio
.
i_rate
>
0
)
{
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Sample rate"
),
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Sample rate"
),
_
(
"%d Hz"
),
fmt
->
audio
.
i_rate
);
_
(
"%d Hz"
),
fmt
->
audio
.
i_rate
);
var_SetInteger
(
p_input
,
"sample-rate"
,
fmt
->
audio
.
i_rate
);
}
if
(
fmt
->
audio
.
i_bitspersample
>
0
)
if
(
fmt
->
audio
.
i_bitspersample
>
0
)
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
...
@@ -1605,8 +1608,11 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es )
...
@@ -1605,8 +1608,11 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es )
fmt
->
audio
.
i_bitspersample
);
fmt
->
audio
.
i_bitspersample
);
if
(
fmt
->
i_bitrate
>
0
)
if
(
fmt
->
i_bitrate
>
0
)
{
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Bitrate"
),
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Bitrate"
),
_
(
"%d kb/s"
),
fmt
->
i_bitrate
/
1000
);
_
(
"%d kb/s"
),
fmt
->
i_bitrate
/
1000
);
var_SetInteger
(
p_input
,
"bit-rate"
,
fmt
->
i_bitrate
);
}
break
;
break
;
case
VIDEO_ES
:
case
VIDEO_ES
:
...
...
src/input/input.c
View file @
4bc1d553
...
@@ -726,6 +726,9 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
...
@@ -726,6 +726,9 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
es_out_Control
(
p_input
->
p_es_out
,
ES_OUT_SET_ACTIVE
,
VLC_FALSE
);
es_out_Control
(
p_input
->
p_es_out
,
ES_OUT_SET_ACTIVE
,
VLC_FALSE
);
es_out_Control
(
p_input
->
p_es_out
,
ES_OUT_SET_MODE
,
ES_OUT_MODE_NONE
);
es_out_Control
(
p_input
->
p_es_out
,
ES_OUT_SET_MODE
,
ES_OUT_MODE_NONE
);
var_Create
(
p_input
,
"bit-rate"
,
VLC_VAR_INTEGER
);
var_Create
(
p_input
,
"sample-rate"
,
VLC_VAR_INTEGER
);
if
(
InputSourceInit
(
p_input
,
&
p_input
->
input
,
if
(
InputSourceInit
(
p_input
,
&
p_input
->
input
,
p_input
->
input
.
p_item
->
psz_uri
,
NULL
,
b_quick
)
)
p_input
->
input
.
p_item
->
psz_uri
,
NULL
,
b_quick
)
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment