]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_vars.hpp
9a30fe11b04d06667b9373327e0d1ad7cc53ff81
[vlc] / modules / gui / skins2 / commands / cmd_vars.hpp
1 /*****************************************************************************
2  * cmd_vars.hpp
3  *****************************************************************************
4  * Copyright (C) 2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef CMD_VARS_HPP
25 #define CMD_VARS_HPP
26
27 #include "cmd_generic.hpp"
28 #include "../utils/ustring.hpp"
29
30 class EqualizerBands;
31 class EqualizerPreamp;
32 class VarText;
33
34 /// Command to notify the playlist of a change
35 DEFINE_COMMAND( NotifyPlaylist, "notify playlist" )
36
37 /// Command to notify the playlist of a change
38 DEFINE_COMMAND( PlaytreeChanged, "playtree changed" )
39
40 /// Command to notify the playtree of an item update
41 class CmdPlaytreeUpdate: public CmdGeneric
42 {
43     public:
44         CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ):
45             CmdGeneric( pIntf ), m_id( id ) {}
46         virtual ~CmdPlaytreeUpdate() {}
47
48         /// This method does the real job of the command
49         virtual void execute();
50
51         /// Return the type of the command
52         virtual string getType() const { return "playtree update"; }
53
54         /// Only accept removal of command if they concern the same item
55         virtual bool checkRemove( CmdGeneric * ) const;
56
57     private:
58         /// Playlist item ID
59         int m_id;
60 };
61
62
63 /// Command to set a text variable
64 class CmdSetText: public CmdGeneric
65 {
66     public:
67         CmdSetText( intf_thread_t *pIntf, VarText &rText,
68                     const UString &rValue ):
69             CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {}
70         virtual ~CmdSetText() {}
71
72         /// This method does the real job of the command
73         virtual void execute();
74
75         /// Return the type of the command
76         virtual string getType() const { return "set text"; }
77
78     private:
79         /// Text variable to set
80         VarText &m_rText;
81         /// Value to set
82         const UString m_value;
83 };
84
85
86 /// Command to set the equalizer preamp
87 class CmdSetEqPreamp: public CmdGeneric
88 {
89     public:
90         CmdSetEqPreamp( intf_thread_t *pIntf, EqualizerPreamp &rPreamp,
91                        float value ):
92             CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {}
93         virtual ~CmdSetEqPreamp() {}
94
95         /// This method does the real job of the command
96         virtual void execute();
97
98         /// Return the type of the command
99         virtual string getType() const { return "set equalizer preamp"; }
100
101     private:
102         /// Preamp variable to set
103         EqualizerPreamp &m_rPreamp;
104         /// Value to set
105         float m_value;
106 };
107
108
109 /// Command to set the equalizerbands
110 class CmdSetEqBands: public CmdGeneric
111 {
112     public:
113         CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands,
114                        const string &rValue ):
115             CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {}
116         virtual ~CmdSetEqBands() {}
117
118         /// This method does the real job of the command
119         virtual void execute();
120
121         /// Return the type of the command
122         virtual string getType() const { return "set equalizer bands"; }
123
124     private:
125         /// Equalizer variable to set
126         EqualizerBands &m_rEqBands;
127         /// Value to set
128         const string m_value;
129 };
130
131
132 #endif