1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
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 along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
31 #include <vlc_common.h>
32 #include <vlc_playlist.h>
34 #include "cmd_generic.hpp"
35 #include "../utils/ustring.hpp"
38 class EqualizerPreamp;
41 /// Command to notify the playtree of an item update
42 class CmdItemUpdate: public CmdGeneric
45 CmdItemUpdate( intf_thread_t *pIntf, input_item_t* pItem ):
46 CmdGeneric( pIntf ), m_pItem( pItem )
49 vlc_gc_incref( pItem );
51 virtual ~CmdItemUpdate()
54 vlc_gc_decref( m_pItem );
56 virtual void execute();
57 virtual string getType() const { return "playtree update"; }
59 /// Only accept removal of command if they concern the same item
60 virtual bool checkRemove( CmdGeneric * ) const;
63 /// input item changed
64 input_item_t* m_pItem;
67 /// Command to notify the playtree of an item append
68 class CmdPlaytreeAppend: public CmdGeneric
71 CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ):
72 CmdGeneric( pIntf ), m_pAdd( NULL )
76 m_pAdd = new playlist_add_t;
80 virtual ~CmdPlaytreeAppend()
84 virtual void execute();
85 virtual string getType() const { return "playtree append"; }
88 playlist_add_t * m_pAdd;
91 /// Command to notify the playtree of an item deletion
92 class CmdPlaytreeDelete: public CmdGeneric
95 CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ):
96 CmdGeneric( pIntf ), m_id( i_id ) { }
97 virtual ~CmdPlaytreeDelete() { }
98 virtual void execute();
99 virtual string getType() const { return "playtree append"; }
106 /// Command to set a text variable
107 class CmdSetText: public CmdGeneric
110 CmdSetText( intf_thread_t *pIntf, VarText &rText, const UString &rValue ):
111 CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) { }
112 virtual ~CmdSetText() { }
113 virtual void execute();
114 virtual string getType() const { return "set text"; }
117 /// Text variable to set
120 const UString m_value;
124 /// Command to set the equalizer preamp
125 class CmdSetEqPreamp: public CmdGeneric
128 CmdSetEqPreamp( intf_thread_t *I, EqualizerPreamp &P, float v )
129 : CmdGeneric( I ), m_rPreamp( P ), m_value( v ) { }
130 virtual ~CmdSetEqPreamp() { }
131 virtual void execute();
132 virtual string getType() const { return "set equalizer preamp"; }
135 /// Preamp variable to set
136 EqualizerPreamp &m_rPreamp;
142 /// Command to set the equalizerbands
143 class CmdSetEqBands: public CmdGeneric
146 CmdSetEqBands( intf_thread_t *I, EqualizerBands &B, const string &V )
147 : CmdGeneric( I ), m_rEqBands( B ), m_value( V ) { }
148 virtual ~CmdSetEqBands() { }
149 virtual void execute();
150 virtual string getType() const { return "set equalizer bands"; }
153 /// Equalizer variable to set
154 EqualizerBands &m_rEqBands;
156 const string m_value;