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
c90fcbb3
Commit
c90fcbb3
authored
Jul 21, 2012
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: update following volume change from Integer to float
parent
5ad71b5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+3
-5
modules/gui/skins2/vars/volume.cpp
modules/gui/skins2/vars/volume.cpp
+8
-7
modules/gui/skins2/vars/volume.hpp
modules/gui/skins2/vars/volume.hpp
+1
-3
No files found.
modules/gui/skins2/src/vlcproc.cpp
View file @
c90fcbb3
...
...
@@ -79,7 +79,7 @@ void VlcProc::destroy( intf_thread_t *pIntf )
#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)
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->set
Volume
(v,b)
VlcProc
::
VlcProc
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_varEqBands
(
pIntf
),
m_pVout
(
NULL
),
m_pAout
(
NULL
),
...
...
@@ -693,8 +693,7 @@ void VlcProc::on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal )
(
void
)
p_obj
;
(
void
)
newVal
;
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
int
volume
=
var_GetInteger
(
pPlaylist
,
"volume"
);
SET_VOLUME
(
m_cVarVolume
,
volume
,
false
);
SET_VOLUME
(
m_cVarVolume
,
var_GetFloat
(
pPlaylist
,
"volume"
),
false
);
bool
b_is_muted
=
aout_MuteGet
(
pPlaylist
)
>
0
;
SET_BOOL
(
m_cVarMute
,
b_is_muted
);
}
...
...
@@ -798,8 +797,7 @@ void VlcProc::init_variables()
SET_BOOL
(
m_cVarLoop
,
var_GetBool
(
pPlaylist
,
"loop"
)
);
SET_BOOL
(
m_cVarRepeat
,
var_GetBool
(
pPlaylist
,
"repeat"
)
);
int
volume
=
var_GetInteger
(
pPlaylist
,
"volume"
);
SET_VOLUME
(
m_cVarVolume
,
volume
,
false
);
SET_VOLUME
(
m_cVarVolume
,
var_GetFloat
(
pPlaylist
,
"volume"
),
false
);
bool
b_is_muted
=
aout_MuteGet
(
pPlaylist
)
>
0
;
SET_BOOL
(
m_cVarMute
,
b_is_muted
);
...
...
modules/gui/skins2/vars/volume.cpp
View file @
c90fcbb3
...
...
@@ -41,8 +41,7 @@ Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf )
// set current volume from the playlist
playlist_t
*
pPlaylist
=
pIntf
->
p_sys
->
p_playlist
;
int
volume
=
var_GetInteger
(
pPlaylist
,
"volume"
);
set
(
volume
,
false
);
setVolume
(
var_GetFloat
(
pPlaylist
,
"volume"
),
false
);
}
...
...
@@ -57,18 +56,20 @@ void Volume::set( float percentage, bool updateVLC )
}
void
Volume
::
set
(
in
t
volume
,
bool
updateVLC
)
void
Volume
::
set
Volume
(
floa
t
volume
,
bool
updateVLC
)
{
// volume is kept by the playlist in [0,AOUT_VOLUME_MAX] range
// this class keeps it in [0.,1.] range
set
(
(
float
)
volume
/
(
float
)
AOUT_VOLUME_MAX
,
updateVLC
);
// translate from [0.,AOUT_VOLUME_MAX/AOUT_VOLUME_DEFAULT] into [0.,1.]
float
percentage
=
(
volume
>
0.
f
)
?
volume
*
AOUT_VOLUME_DEFAULT
/
AOUT_VOLUME_MAX
:
0.
f
;
set
(
percentage
,
updateVLC
);
}
float
Volume
::
getVolume
()
const
{
// translate from [0.,1.] into [0.,AOUT_VOLUME_MAX/AOUT_VOLUME_DEFAULT]
return
get
()
*
AOUT_VOLUME_MAX
/
AOUT_VOLUME_DEFAULT
;
return
get
()
*
AOUT_VOLUME_MAX
/
AOUT_VOLUME_DEFAULT
;
}
...
...
modules/gui/skins2/vars/volume.hpp
View file @
c90fcbb3
...
...
@@ -38,12 +38,10 @@ public:
virtual
~
Volume
()
{
}
virtual
void
set
(
float
percentage
,
bool
updateVLC
);
virtual
void
set
(
int
volume
,
bool
updateVLC
);
virtual
void
set
(
float
percentage
)
{
set
(
percentage
,
true
);
}
virtual
float
getVolume
()
const
;
virtual
void
setVolume
(
float
volume
,
bool
updateVLC
);
virtual
float
getStep
()
const
{
return
m_step
;
}
...
...
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