1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2009 the VideoLAN team
7 * Author: Erwan Tulou <erwan10 aT videolan doT org >
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef CMD_CALLBACKS_HPP
25 #define CMD_CALLBACKS_HPP
27 #include "cmd_generic.hpp"
28 #include "../src/vlcproc.hpp"
31 #define ADD_COMMAND( label ) \
32 class Cmd_##label : public CmdGeneric \
35 Cmd_##label( intf_thread_t *pIntf, \
36 vlc_object_t *pObj, vlc_value_t newVal ) \
37 : CmdGeneric( pIntf ), m_pObj( pObj ), m_newVal( newVal ) \
40 vlc_object_hold( m_pObj ); \
42 virtual ~Cmd_##label() \
45 vlc_object_release( m_pObj ); \
48 virtual void execute() \
53 VlcProc* p_VlcProc = VlcProc::instance( getIntf() ); \
54 p_VlcProc->on_##label( m_pObj, m_newVal ); \
56 vlc_object_release( m_pObj ); \
60 virtual string getType() const { return #label ; } \
63 vlc_object_t* m_pObj; \
64 vlc_value_t m_newVal; \
68 ADD_COMMAND( item_current_changed )
69 ADD_COMMAND( intf_event_changed )
70 ADD_COMMAND( bit_rate_changed )
71 ADD_COMMAND( sample_rate_changed )
73 ADD_COMMAND( random_changed )
74 ADD_COMMAND( loop_changed )
75 ADD_COMMAND( repeat_changed )
77 ADD_COMMAND( volume_changed )
79 ADD_COMMAND( audio_filter_changed )