Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
5fd6cb5a
Commit
5fd6cb5a
authored
Aug 25, 2009
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: replace all remaining FIND_ANYWHERE with more appropriate functions
parent
25c59e90
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
36 deletions
+74
-36
modules/gui/skins2/commands/cmd_audio.cpp
modules/gui/skins2/commands/cmd_audio.cpp
+13
-4
modules/gui/skins2/commands/cmd_dvd.cpp
modules/gui/skins2/commands/cmd_dvd.cpp
+16
-15
modules/gui/skins2/commands/cmd_input.cpp
modules/gui/skins2/commands/cmd_input.cpp
+6
-6
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+12
-4
modules/gui/skins2/vars/equalizer.cpp
modules/gui/skins2/vars/equalizer.cpp
+27
-7
No files found.
modules/gui/skins2/commands/cmd_audio.cpp
View file @
5fd6cb5a
...
...
@@ -23,14 +23,19 @@
#include "cmd_audio.hpp"
#include "../src/vlcproc.hpp"
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_aout.h>
#include <string>
void
CmdSetEqualizer
::
execute
()
{
// Get the audio output
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
aout_instance_t
*
pAout
=
NULL
;
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
pAout
=
input_GetAout
(
pInput
);
// XXX
string
filters
;
...
...
@@ -46,12 +51,16 @@ void CmdSetEqualizer::execute()
{
pAout
->
pp_inputs
[
i
]
->
b_restart
=
true
;
}
vlc_object_release
(
pAout
);
}
else
{
config_PutPsz
(
getIntf
(),
"audio-filter"
,
filters
.
c_str
()
);
}
if
(
pAout
)
vlc_object_release
(
pAout
);
if
(
pInput
)
vlc_object_release
(
pInput
);
}
void
CmdVolumeChanged
::
execute
()
...
...
modules/gui/skins2/commands/cmd_dvd.cpp
View file @
5fd6cb5a
...
...
@@ -23,12 +23,13 @@
#include "cmd_dvd.hpp"
#include <vlc_input.h>
#include <vlc_playlist.h>
void
CmdDvdNextTitle
::
execute
()
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
pPlaylist
);
if
(
p_input
)
{
var_TriggerCallback
(
p_input
,
"next-title"
);
...
...
@@ -39,9 +40,9 @@ void CmdDvdNextTitle::execute()
void
CmdDvdPreviousTitle
::
execute
()
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
pPlaylist
);
if
(
p_input
)
{
var_TriggerCallback
(
p_input
,
"prev-title"
);
...
...
@@ -52,9 +53,9 @@ void CmdDvdPreviousTitle::execute()
void
CmdDvdNextChapter
::
execute
()
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
pPlaylist
);
if
(
p_input
)
{
var_TriggerCallback
(
p_input
,
"next-chapter"
);
...
...
@@ -65,9 +66,9 @@ void CmdDvdNextChapter::execute()
void
CmdDvdPreviousChapter
::
execute
()
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
pPlaylist
);
if
(
p_input
)
{
var_TriggerCallback
(
p_input
,
"prev-chapter"
);
...
...
@@ -78,9 +79,9 @@ void CmdDvdPreviousChapter::execute()
void
CmdDvdRootMenu
::
execute
()
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
p_input
=
playlist_CurrentInput
(
pPlaylist
);
if
(
p_input
)
{
vlc_value_t
val
;
...
...
modules/gui/skins2/commands/cmd_input.cpp
View file @
5fd6cb5a
...
...
@@ -79,9 +79,9 @@ void CmdStop::execute()
void
CmdSlower
::
execute
()
{
input_thread_t
*
pInput
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
{
vlc_value_t
val
;
...
...
@@ -95,9 +95,9 @@ void CmdSlower::execute()
void
CmdFaster
::
execute
()
{
input_thread_t
*
pInput
=
(
input_thread_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
{
vlc_value_t
val
;
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
5fd6cb5a
...
...
@@ -230,12 +230,16 @@ void VlcProc::CmdManage::execute()
void
VlcProc
::
refreshAudio
()
{
char
*
pFilters
;
aout_instance_t
*
pAout
=
NULL
;
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
pAout
=
input_GetAout
(
pInput
);
// Check if the audio output has changed
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
if
(
pAout
)
{
// Check if the audio output has changed
if
(
pAout
!=
m_pAout
)
{
// Register the equalizer callbacks
...
...
@@ -250,7 +254,6 @@ void VlcProc::refreshAudio()
}
// Get the audio filters
pFilters
=
var_GetNonEmptyString
(
pAout
,
"audio-filter"
);
vlc_object_release
(
pAout
);
}
else
{
...
...
@@ -262,6 +265,11 @@ void VlcProc::refreshAudio()
VarBoolImpl
*
pVarEqualizer
=
(
VarBoolImpl
*
)
m_cVarEqualizer
.
get
();
pVarEqualizer
->
set
(
pFilters
&&
strstr
(
pFilters
,
"equalizer"
)
);
free
(
pFilters
);
if
(
pAout
)
vlc_object_release
(
pAout
);
if
(
pInput
)
vlc_object_release
(
pInput
);
}
void
VlcProc
::
refreshVolume
()
...
...
modules/gui/skins2/vars/equalizer.cpp
View file @
5fd6cb5a
...
...
@@ -26,6 +26,8 @@
#endif
#include <vlc_common.h>
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_aout.h>
#include "equalizer.hpp"
#include "../utils/var_percent.hpp"
...
...
@@ -81,6 +83,13 @@ VariablePtr EqualizerBands::getBand( int band )
void
EqualizerBands
::
onUpdate
(
Subject
<
VarPercent
>
&
rBand
,
void
*
arg
)
{
aout_instance_t
*
pAout
=
NULL
;
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
pAout
=
input_GetAout
(
pInput
);
// Make sure we are not called from set()
if
(
!
m_isUpdating
)
{
...
...
@@ -98,18 +107,20 @@ void EqualizerBands::onUpdate( Subject<VarPercent> &rBand, void *arg )
ss
<<
" "
<<
val
;
}
string
bands
=
ss
.
str
();
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
config_PutPsz
(
getIntf
(),
"equalizer-bands"
,
bands
.
c_str
()
);
if
(
pAout
)
{
// Update the audio output
var_SetString
(
pAout
,
"equalizer-bands"
,
(
char
*
)
bands
.
c_str
()
);
vlc_object_release
(
pAout
);
}
}
if
(
pAout
)
vlc_object_release
(
pAout
);
if
(
pInput
)
vlc_object_release
(
pInput
);
}
...
...
@@ -122,6 +133,13 @@ EqualizerPreamp::EqualizerPreamp( intf_thread_t *pIntf ): VarPercent( pIntf )
void
EqualizerPreamp
::
set
(
float
percentage
,
bool
updateVLC
)
{
aout_instance_t
*
pAout
=
NULL
;
playlist_t
*
pPlaylist
=
getIntf
()
->
p_sys
->
p_playlist
;
input_thread_t
*
pInput
=
playlist_CurrentInput
(
pPlaylist
);
if
(
pInput
)
pAout
=
input_GetAout
(
pInput
);
VarPercent
::
set
(
percentage
);
// Avoid infinite loop
...
...
@@ -129,14 +147,16 @@ void EqualizerPreamp::set( float percentage, bool updateVLC )
{
float
val
=
40
*
percentage
-
20
;
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
config_PutFloat
(
getIntf
(),
"equalizer-preamp"
,
val
);
if
(
pAout
)
{
// Update the audio output
var_SetFloat
(
pAout
,
"equalizer-preamp"
,
val
);
vlc_object_release
(
pAout
);
}
}
if
(
pAout
)
vlc_object_release
(
pAout
);
if
(
pInput
)
vlc_object_release
(
pInput
);
}
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