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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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;
62 /// Command to notify the playtree of an item append
63 class CmdPlaytreeAppend: public CmdGeneric
66 CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ) :
67 CmdGeneric( pIntf ), m_pAdd( p_add ) {}
68 virtual ~CmdPlaytreeAppend() {}
70 /// This method does the real job of the command
71 virtual void execute();
73 /// Return the type of the command
74 virtual string getType() const { return "playtree append"; }
77 playlist_add_t * m_pAdd;
81 /// Command to set a text variable
82 class CmdSetText: public CmdGeneric
85 CmdSetText( intf_thread_t *pIntf, VarText &rText,
86 const UString &rValue ):
87 CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {}
88 virtual ~CmdSetText() {}
90 /// This method does the real job of the command
91 virtual void execute();
93 /// Return the type of the command
94 virtual string getType() const { return "set text"; }
97 /// Text variable to set
100 const UString m_value;
104 /// Command to set the equalizer preamp
105 class CmdSetEqPreamp: public CmdGeneric
108 CmdSetEqPreamp( intf_thread_t *pIntf, EqualizerPreamp &rPreamp,
110 CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {}
111 virtual ~CmdSetEqPreamp() {}
113 /// This method does the real job of the command
114 virtual void execute();
116 /// Return the type of the command
117 virtual string getType() const { return "set equalizer preamp"; }
120 /// Preamp variable to set
121 EqualizerPreamp &m_rPreamp;
127 /// Command to set the equalizerbands
128 class CmdSetEqBands: public CmdGeneric
131 CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands,
132 const string &rValue ):
133 CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {}
134 virtual ~CmdSetEqBands() {}
136 /// This method does the real job of the command
137 virtual void execute();
139 /// Return the type of the command
140 virtual string getType() const { return "set equalizer bands"; }
143 /// Equalizer variable to set
144 EqualizerBands &m_rEqBands;
146 const string m_value;