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
ebd6d41f
Commit
ebd6d41f
authored
Sep 05, 2009
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: replace polling with callbacks
parent
6ce54993
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
425 additions
and
225 deletions
+425
-225
modules/gui/skins2/commands/cmd_audio.cpp
modules/gui/skins2/commands/cmd_audio.cpp
+0
-6
modules/gui/skins2/commands/cmd_audio.hpp
modules/gui/skins2/commands/cmd_audio.hpp
+0
-17
modules/gui/skins2/commands/cmd_callbacks.hpp
modules/gui/skins2/commands/cmd_callbacks.hpp
+83
-0
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+323
-188
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+19
-14
No files found.
modules/gui/skins2/commands/cmd_audio.cpp
View file @
ebd6d41f
...
...
@@ -33,10 +33,4 @@ void CmdSetEqualizer::execute()
aout_EnableFilter
(
getIntf
(),
"equalizer"
,
m_enable
);
}
void
CmdVolumeChanged
::
execute
()
{
VlcProc
*
p_VlcProc
=
getIntf
()
->
p_sys
->
p_vlcProc
;
p_VlcProc
->
refreshVolume
();
}
modules/gui/skins2/commands/cmd_audio.hpp
View file @
ebd6d41f
...
...
@@ -46,21 +46,4 @@ class CmdSetEqualizer: public CmdGeneric
};
/// Command to enable/disable the equalizer
class
CmdVolumeChanged
:
public
CmdGeneric
{
public:
CmdVolumeChanged
(
intf_thread_t
*
pIntf
)
:
CmdGeneric
(
pIntf
)
{}
virtual
~
CmdVolumeChanged
()
{}
/// This method does the real job of the command
virtual
void
execute
();
/// Return the type of the command
virtual
string
getType
()
const
{
return
"set volume"
;
}
private:
};
#endif
modules/gui/skins2/commands/cmd_callbacks.hpp
0 → 100644
View file @
ebd6d41f
/*****************************************************************************
* cmd_callbacks.hpp
*****************************************************************************
* Copyright (C) 2009 the VideoLAN team
* $Id$
*
* Author: Erwan Tulou <erwan10 aT videolan doT org >
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_CALLBACKS_HPP
#define CMD_CALLBACKS_HPP
#include "cmd_generic.hpp"
#include "../src/vlcproc.hpp"
#define ADD_COMMAND( label ) \
class Cmd_##label : public CmdGeneric \
{ \
public: \
Cmd_##label( intf_thread_t *pIntf, \
vlc_object_t *pObj, vlc_value_t newVal ) \
: CmdGeneric( pIntf ), m_pObj( pObj ), m_newVal( newVal ) \
{ \
if( m_pObj ) \
vlc_object_hold( m_pObj ); \
} \
virtual ~Cmd_##label() \
{ \
if( m_pObj ) \
vlc_object_release( m_pObj ); \
} \
\
virtual void execute() \
{ \
if( !m_pObj ) \
return; \
\
VlcProc* p_VlcProc = VlcProc::instance( getIntf() ); \
p_VlcProc->on_##label( m_pObj, m_newVal ); \
\
vlc_object_release( m_pObj ); \
m_pObj = NULL; \
} \
\
virtual string getType() const { return #label ; } \
\
private: \
vlc_object_t* m_pObj; \
vlc_value_t m_newVal; \
};
ADD_COMMAND
(
item_current_changed
)
ADD_COMMAND
(
intf_event_changed
)
ADD_COMMAND
(
bit_rate_changed
)
ADD_COMMAND
(
sample_rate_changed
)
ADD_COMMAND
(
random_changed
)
ADD_COMMAND
(
loop_changed
)
ADD_COMMAND
(
repeat_changed
)
ADD_COMMAND
(
volume_changed
)
ADD_COMMAND
(
audio_filter_changed
)
#undef ADD_COMMAND
#endif
modules/gui/skins2/src/vlcproc.cpp
View file @
ebd6d41f
This diff is collapsed.
Click to expand it.
modules/gui/skins2/src/vlcproc.hpp
View file @
ebd6d41f
...
...
@@ -27,6 +27,8 @@
#include <set>
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_vout.h>
#include "../vars/equalizer.hpp"
#include "../vars/playtree.hpp"
...
...
@@ -85,8 +87,17 @@ class VlcProc: public SkinObject
/// Indicate whether the embedded video output is currently used
bool
isVoutUsed
()
const
{
return
m_pVout
!=
NULL
;
}
/// Refresh Volume
void
refreshVolume
();
void
on_item_current_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_intf_event_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_bit_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_sample_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_random_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_loop_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_repeat_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_volume_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_audio_filter_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
protected:
// Protected because it is a singleton
...
...
@@ -147,21 +158,9 @@ class VlcProc: public SkinObject
/// Define the command that calls manage()
DEFINE_CALLBACK
(
VlcProc
,
Manage
);
/// Refresh audio variables
void
refreshAudio
();
/// Refresh playlist variables
void
refreshPlaylist
();
/// Refresh input variables
void
refreshInput
();
/// Update the stream name variable
void
updateStreamName
();
/// Callback for volume variable
static
int
onVolumeChanged
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
/// Callback for intf-change variable
static
int
onIntfChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
...
...
@@ -212,6 +211,12 @@ class VlcProc: public SkinObject
static
int
onEqPreampChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
/// Generic Callback
static
int
onGenericCallback
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
};
...
...
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