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
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
27 #include "cmd_generic.hpp"
28 #include "../utils/ustring.hpp"
31 class EqualizerPreamp;
34 /// Command to notify the playlist of a change
35 DEFINE_COMMAND( NotifyPlaylist, "notify playlist" )
37 /// Command to notify the playlist of a change
38 DEFINE_COMMAND( PlaytreeChanged, "playtree changed" )
40 /// Command to notify the playtree of an item update
41 class CmdPlaytreeUpdate: public CmdGeneric
44 CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ):
45 CmdGeneric( pIntf ), m_id( id ) {}
46 virtual ~CmdPlaytreeUpdate() {}
48 /// This method does the real job of the command
49 virtual void execute();
51 /// Return the type of the command
52 virtual string getType() const { return "playtree update"; }
54 /// Only accept removal of command if they concern the same item
55 virtual bool checkRemove( CmdGeneric * ) const;
63 /// Command to set a text variable
64 class CmdSetText: public CmdGeneric
67 CmdSetText( intf_thread_t *pIntf, VarText &rText,
68 const UString &rValue ):
69 CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {}
70 virtual ~CmdSetText() {}
72 /// This method does the real job of the command
73 virtual void execute();
75 /// Return the type of the command
76 virtual string getType() const { return "set text"; }
79 /// Text variable to set
82 const UString m_value;
86 /// Command to set the equalizer preamp
87 class CmdSetEqPreamp: public CmdGeneric
90 CmdSetEqPreamp( intf_thread_t *pIntf, EqualizerPreamp &rPreamp,
92 CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {}
93 virtual ~CmdSetEqPreamp() {}
95 /// This method does the real job of the command
96 virtual void execute();
98 /// Return the type of the command
99 virtual string getType() const { return "set equalizer preamp"; }
102 /// Preamp variable to set
103 EqualizerPreamp &m_rPreamp;
109 /// Command to set the equalizerbands
110 class CmdSetEqBands: public CmdGeneric
113 CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands,
114 const string &rValue ):
115 CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {}
116 virtual ~CmdSetEqBands() {}
118 /// This method does the real job of the command
119 virtual void execute();
121 /// Return the type of the command
122 virtual string getType() const { return "set equalizer bands"; }
125 /// Equalizer variable to set
126 EqualizerBands &m_rEqBands;
128 const string m_value;