Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
56d4e908
Commit
56d4e908
authored
Apr 25, 2013
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: simplify equalizer initialization
parent
6d2b8a0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
71 deletions
+48
-71
modules/gui/skins2/commands/cmd_audio.cpp
modules/gui/skins2/commands/cmd_audio.cpp
+0
-1
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+46
-66
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+2
-4
No files found.
modules/gui/skins2/commands/cmd_audio.cpp
View file @
56d4e908
...
...
@@ -32,7 +32,6 @@ void CmdSetEqualizer::execute()
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
playlist_EnableAudioFilter
(
pPlaylist
,
"equalizer"
,
m_enable
);
VlcProc
::
instance
(
getIntf
()
)
->
update_equalizer
();
}
modules/gui/skins2/src/vlcproc.cpp
View file @
56d4e908
...
...
@@ -82,7 +82,7 @@ void VlcProc::destroy( intf_thread_t *pIntf )
#define SET_VOLUME(m,v,b) ((Volume*)(m).get())->setVolume(v,b)
VlcProc
::
VlcProc
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_varEqBands
(
pIntf
),
m_pVout
(
NULL
)
,
m_pAout
(
NULL
)
m_varEqBands
(
pIntf
),
m_pVout
(
NULL
)
{
// Create and register VLC variables
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
...
...
@@ -189,11 +189,6 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
VlcProc
::~
VlcProc
()
{
if
(
m_pAout
)
{
vlc_object_release
(
m_pAout
);
m_pAout
=
NULL
;
}
if
(
m_pVout
)
{
vlc_object_release
(
m_pVout
);
...
...
@@ -533,57 +528,6 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
break
;
}
case
INPUT_EVENT_AOUT
:
{
audio_output_t
*
pAout
=
input_GetAout
(
pInput
);
// end of input or aout reuse (nothing to do)
if
(
!
pAout
||
pAout
==
m_pAout
)
{
if
(
pAout
)
vlc_object_release
(
pAout
);
break
;
}
// remove previous Aout if any
if
(
m_pAout
)
{
var_DelCallback
(
m_pAout
,
"audio-filter"
,
onGenericCallback
,
this
);
var_DelCallback
(
m_pAout
,
"equalizer-bands"
,
onEqBandsChange
,
this
);
var_DelCallback
(
m_pAout
,
"equalizer-preamp"
,
onEqPreampChange
,
this
);
vlc_object_release
(
m_pAout
);
m_pAout
=
NULL
;
}
m_pAout
=
pAout
;
// make sure some key variables exist !
// yes, this is a ugly but needed hack
if
(
!
var_Type
(
pAout
,
"equalizer-bands"
)
)
var_Create
(
pAout
,
"equalizer-bands"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
if
(
!
var_Type
(
pAout
,
"equalizer-preamp"
)
)
var_Create
(
pAout
,
"equalizer-preamp"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
// New Aout (addCallbacks)
var_AddCallback
(
pAout
,
"audio-filter"
,
onGenericCallback
,
this
);
var_AddCallback
(
pAout
,
"equalizer-bands"
,
onEqBandsChange
,
this
);
var_AddCallback
(
pAout
,
"equalizer-preamp"
,
onEqPreampChange
,
this
);
char
*
pFilters
=
var_GetNonEmptyString
(
pAout
,
"audio-filter"
);
bool
b_equalizer
=
pFilters
&&
strstr
(
pFilters
,
"equalizer"
);
free
(
pFilters
);
SET_BOOL
(
m_cVarEqualizer
,
b_equalizer
);
break
;
}
case
INPUT_EVENT_CHAPTER
:
{
vlc_value_t
chapters_count
;
...
...
@@ -779,7 +723,7 @@ void VlcProc::init_variables()
SET_BOOL
(
m_cVarStopped
,
true
);
update
_equalizer
();
init
_equalizer
();
}
...
...
@@ -815,19 +759,55 @@ void VlcProc::update_current_input()
}
}
void
VlcProc
::
update
_equalizer
()
void
VlcProc
::
init
_equalizer
()
{
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
audio_output_t
*
pAout
=
playlist_GetAout
(
pPlaylist
);
if
(
pAout
)
{
if
(
!
var_Type
(
pAout
,
"equalizer-bands"
)
)
var_Create
(
pAout
,
"equalizer-bands"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
if
(
!
var_Type
(
pAout
,
"equalizer-preamp"
)
)
var_Create
(
pAout
,
"equalizer-preamp"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
// New Aout (addCallbacks)
var_AddCallback
(
pAout
,
"audio-filter"
,
onGenericCallback
,
this
);
var_AddCallback
(
pAout
,
"equalizer-bands"
,
onEqBandsChange
,
this
);
var_AddCallback
(
pAout
,
"equalizer-preamp"
,
onEqPreampChange
,
this
);
}
char
*
pFilters
;
if
(
m_pAout
)
pFilters
=
var_GetNonEmptyString
(
m_pAout
,
"audio-filter"
);
else
pFilters
=
var_InheritString
(
getIntf
(),
"audio-filter"
);
// is equalizer enabled ?
char
*
pFilters
=
pAout
?
var_GetNonEmptyString
(
pAout
,
"audio-filter"
)
:
var_InheritString
(
getIntf
(),
"audio-filter"
);
bool
b_equalizer
=
pFilters
&&
strstr
(
pFilters
,
"equalizer"
);
free
(
pFilters
);
SET_BOOL
(
m_cVarEqualizer
,
b_equalizer
);
// retrieve initial bands
char
*
bands
=
pAout
?
var_GetString
(
pAout
,
"equalizer-bands"
)
:
var_InheritString
(
getIntf
(),
"equalizer-bands"
);
if
(
bands
)
{
m_varEqBands
.
set
(
bands
);
free
(
bands
);
}
// retrieve initial preamp
float
preamp
=
pAout
?
var_GetFloat
(
pAout
,
"equalizer-preamp"
)
:
var_InheritFloat
(
getIntf
(),
"equalizer-preamp"
);
EqualizerPreamp
*
pVarPreamp
=
(
EqualizerPreamp
*
)
m_cVarEqPreamp
.
get
();
pVarPreamp
->
set
(
(
preamp
+
20.0
)
/
40.0
);
if
(
pAout
)
vlc_object_release
(
pAout
);
}
void
VlcProc
::
setFullscreenVar
(
bool
b_fullscreen
)
...
...
modules/gui/skins2/src/vlcproc.hpp
View file @
56d4e908
...
...
@@ -95,8 +95,8 @@ public:
/// Indicate whether the embedded video output is currently used
bool
isVoutUsed
()
const
{
return
m_pVout
!=
NULL
;
}
///
updat
e equalizer
void
update
_equalizer
(
);
///
initializ
e equalizer
void
init
_equalizer
(
);
/// update global variables for the current input
void
update_current_input
(
);
...
...
@@ -164,8 +164,6 @@ private:
/// Vout thread
vout_thread_t
*
m_pVout
;
/// Audio output
audio_output_t
*
m_pAout
;
// reset variables when input is over
void
reset_input
();
...
...
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