Planeshift
control.h
Go to the documentation of this file.
1 /*
2  * control.h
3  *
4  * Copyright (C) 2001-2010 Atomic Blue (info@planeshift.it, http://www.planeshift.it)
5  *
6  * Credits : Saul Leite <leite@engineer.com>
7  * Mathias 'AgY' Voeroes <agy@operswithoutlife.net>
8  * and all past and present planeshift coders
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation (version 2 of the License.
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  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 
25 #ifndef _SOUND_CONTROL_H_
26 #define _SOUND_CONTROL_H_
27 
41 {
42  public:
43  int id;
44 
51  void SetCallback(void (*object), void (*function) (void *));
55  void RemoveCallback();
60  SoundControl ();
64  ~SoundControl ();
68  float GetVolume ();
73  void SetVolume (float vol);
77  void Unmute ();
81  void Mute ();
82 
87  bool GetToggle ();
92  void SetToggle (bool value);
97  void DeactivateToggle ();
102  void ActivateToggle ();
103 
104  private:
105  bool isEnabled;
106  float volume;
107  bool isMuted;
108 
109  void (*callbackobject);
110  void (*callbackfunction) (void *);
111  bool hasCallback;
112 
117  void Callback ();
118 
123  int GetID ();
124 };
125 
126 #endif /*_SOUND_CONTROL_H_*/
bool GetToggle()
Get current Toggle state.
void ActivateToggle()
activates Toggle.
void Mute()
Mute this.
void SetVolume(float vol)
Sets volume to the given float.
void RemoveCallback()
Removes Callback.
void DeactivateToggle()
deactivates Toggle.
void Unmute()
Unmute this.
~SoundControl()
Destructor.
void SetToggle(bool value)
Sets Toggle.
A Volume and Sound control class.
Definition: control.h:40
float GetVolume()
Returns current Volume as float.
int id
id of this control
Definition: control.h:43
SoundControl()
Constructor.
void SetCallback(void(*object), void(*function)(void *))
Sets internal callbackpointers.