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
5c277fc5
Commit
5c277fc5
authored
Oct 04, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: add $R to display current playback speed
parent
863692af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+21
-6
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+6
-0
modules/gui/skins2/utils/var_text.cpp
modules/gui/skins2/utils/var_text.cpp
+9
-0
No files found.
modules/gui/skins2/src/vlcproc.cpp
View file @
5c277fc5
...
...
@@ -75,6 +75,11 @@ void VlcProc::destroy( intf_thread_t *pIntf )
pIntf
->
p_sys
->
p_vlcProc
=
NULL
;
}
#define SET_BOOL(m,v) ((VarBoolImpl*)(m).get())->set(v)
#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b)
#define SET_TEXT(m,v) ((VarText*)(m).get())->set(v)
#define SET_STRING(m,v) ((VarString*)(m).get())->set(v)
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->set(v,b)
VlcProc
::
VlcProc
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_varEqBands
(
pIntf
),
m_pVout
(
NULL
),
m_pAout
(
NULL
),
...
...
@@ -125,6 +130,9 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
REGISTER_VAR
(
m_cVarEqPreamp
,
EqualizerPreamp
,
"equalizer.preamp"
)
#undef REGISTER_VAR
m_cVarSpeed
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
pVarManager
->
registerVar
(
m_cVarSpeed
,
"speed"
);
SET_TEXT
(
m_cVarSpeed
,
UString
(
getIntf
(),
"1"
)
);
m_cVarStreamName
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
pVarManager
->
registerVar
(
m_cVarStreamName
,
"streamName"
);
m_cVarStreamURI
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
...
...
@@ -440,6 +448,7 @@ int VlcProc::onGenericCallback2( vlc_object_t *pObj, const char *pVariable,
{
case
INPUT_EVENT_STATE
:
case
INPUT_EVENT_POSITION
:
case
INPUT_EVENT_RATE
:
case
INPUT_EVENT_ES
:
case
INPUT_EVENT_CHAPTER
:
case
INPUT_EVENT_RECORD
:
...
...
@@ -468,12 +477,6 @@ int VlcProc::onGenericCallback2( vlc_object_t *pObj, const char *pVariable,
}
#define SET_BOOL(m,v) ((VarBoolImpl*)(m).get())->set(v)
#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b)
#define SET_TEXT(m,v) ((VarText*)(m).get())->set(v)
#define SET_STRING(m,v) ((VarString*)(m).get())->set(v)
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->set(v,b)
void
VlcProc
::
on_item_current_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
)
{
(
void
)
p_obj
;
...
...
@@ -534,6 +537,18 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
break
;
}
case
INPUT_EVENT_RATE
:
{
float
rate
=
var_GetFloat
(
pInput
,
"rate"
);
char
*
buffer
;
if
(
asprintf
(
&
buffer
,
"%.3g"
,
rate
)
!=
-
1
)
{
SET_TEXT
(
m_cVarSpeed
,
UString
(
getIntf
(),
buffer
)
);
free
(
buffer
);
}
break
;
}
case
INPUT_EVENT_ES
:
{
// Do we have audio
...
...
modules/gui/skins2/src/vlcproc.hpp
View file @
5c277fc5
...
...
@@ -65,6 +65,10 @@ public:
/// Getter for the volume variable
Volume
&
getVolumeVar
()
{
return
*
((
Volume
*
)(
m_cVarVolume
.
get
()));
}
/// Getter for the current playback speed
VarText
&
getSpeedVar
()
{
return
*
((
VarText
*
)(
m_cVarSpeed
.
get
()));
}
/// Getter for the stream name variable
VarText
&
getStreamNameVar
()
{
return
*
((
VarText
*
)(
m_cVarStreamName
.
get
()));
}
...
...
@@ -129,6 +133,8 @@ private:
VariablePtr
m_cVarTime
;
/// Variable for audio volume
VariablePtr
m_cVarVolume
;
/// Variable for speed playback
VariablePtr
m_cVarSpeed
;
/// Variable for current stream properties
VariablePtr
m_cVarStreamName
;
VariablePtr
m_cVarStreamURI
;
...
...
modules/gui/skins2/utils/var_text.cpp
View file @
5c277fc5
...
...
@@ -123,6 +123,10 @@ const UString VarText::get() const
{
temp
.
replace
(
pos
,
2
,
pVlcProc
->
getStreamSampleRateVar
().
get
()
);
}
while
(
(
pos
=
temp
.
find
(
"$R"
))
!=
UString
::
npos
)
{
temp
.
replace
(
pos
,
2
,
pVlcProc
->
getSpeedVar
().
get
()
);
}
return
temp
;
}
...
...
@@ -180,6 +184,10 @@ void VarText::set( const UString &rText )
{
pVlcProc
->
getStreamSampleRateVar
().
addObserver
(
this
);
}
if
(
m_text
.
find
(
"$R"
)
!=
UString
::
npos
)
{
pVlcProc
->
getSpeedVar
().
addObserver
(
this
);
}
}
notify
();
...
...
@@ -223,6 +231,7 @@ void VarText::delObservers()
{
pVlcProc
->
getTimeVar
().
delObserver
(
this
);
pVlcProc
->
getVolumeVar
().
delObserver
(
this
);
pVlcProc
->
getSpeedVar
().
delObserver
(
this
);
pVlcProc
->
getStreamNameVar
().
delObserver
(
this
);
pVlcProc
->
getStreamURIVar
().
delObserver
(
this
);
pVlcProc
->
getStreamBitRateVar
().
delObserver
(
this
);
...
...
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