Planeshift

control.h

Go to the documentation of this file.
00001 /*
00002  * control.h
00003  *
00004  * Copyright (C) 2001-2010 Atomic Blue ([email protected], http://www.planeshift.it)
00005  *
00006  * Credits : Saul Leite <[email protected]>
00007  *           Mathias 'AgY' Voeroes <[email protected]>
00008  *           and all past and present planeshift coders
00009  *
00010  * This program is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU General Public License
00012  * as published by the Free Software Foundation (version 2 of the License.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021  *
00022  */
00023 
00024 
00025 #ifndef _SOUND_CONTROL_H_
00026 #define _SOUND_CONTROL_H_
00027 
00040 class SoundControl
00041 {
00042     public:
00043     int     id;                         
00044 
00051     void SetCallback(void (*object), void (*function) (void *));
00055     void RemoveCallback();
00060     SoundControl ();
00064     ~SoundControl ();
00068     float GetVolume ();
00073     void SetVolume (float vol);
00077     void Unmute ();
00081     void Mute ();
00082 
00087     bool GetToggle ();
00092     void SetToggle (bool value);
00097     void DeactivateToggle ();
00102     void ActivateToggle (); 
00103 
00104     private:
00105     bool    isEnabled;                  
00106     float   volume;                     
00107     bool    isMuted;                    
00108 
00109     void (*callbackobject);             
00110     void (*callbackfunction) (void *);  
00111     bool hasCallback;                   
00112 
00117     void Callback ();
00118 
00123     int GetID ();
00124 };
00125 
00126 #endif /*_SOUND_CONTROL_H_*/