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;
80 /// Command to notify the playtree of an item deletion
81 class CmdPlaytreeDelete: public CmdGeneric
84 CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ) :
85 CmdGeneric( pIntf ), m_id( i_id ) {}
86 virtual ~CmdPlaytreeDelete() {}
88 /// This method does the real job of the command
89 virtual void execute();
91 /// Return the type of the command
92 virtual string getType() const { return "playtree append"; }
101 /// Command to set a text variable
102 class CmdSetText: public CmdGeneric
105 CmdSetText( intf_thread_t *pIntf, VarText &rText,
106 const UString &rValue ):
107 CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {}
108 virtual ~CmdSetText() {}
110 /// This method does the real job of the command
111 virtual void execute();
113 /// Return the type of the command
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 *pIntf, EqualizerPreamp &rPreamp,
130 CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {}
131 virtual ~CmdSetEqPreamp() {}
133 /// This method does the real job of the command
134 virtual void execute();
136 /// Return the type of the command
137 virtual string getType() const { return "set equalizer preamp"; }
140 /// Preamp variable to set
141 EqualizerPreamp &m_rPreamp;
147 /// Command to set the equalizerbands
148 class CmdSetEqBands: public CmdGeneric
151 CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands,
152 const string &rValue ):
153 CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {}
154 virtual ~CmdSetEqBands() {}
156 /// This method does the real job of the command
157 virtual void execute();
159 /// Return the type of the command
160 virtual string getType() const { return "set equalizer bands"; }
163 /// Equalizer variable to set
164 EqualizerBands &m_rEqBands;
166 const string m_value;