Planeshift
|
00001 /* 00002 * psmusic.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 #ifndef _PSMUSIC_H_ 00025 #define _PSMUSIC_H_ 00026 00027 //------------------------------------------------------------------------------------ 00028 // Forward Declarations 00029 //------------------------------------------------------------------------------------ 00030 class SoundHandle; 00031 00032 00039 class psMusic 00040 { 00041 public: 00042 csString resource; 00043 int type; 00044 float minvol; 00045 float maxvol; 00046 int fadedelay; 00047 int timeofday; 00048 int timeofdayrange; 00049 size_t loopstart; 00050 size_t loopend; 00051 bool active; 00052 SoundHandle* handle; 00053 00058 psMusic(); 00063 ~psMusic(); 00070 bool CheckTimeOfDay(int time); 00076 bool CheckType(const int _type); 00080 void FadeDownAndStop(); 00084 void FadeDown(); 00088 void FadeUp(); 00094 bool Play(bool loopToggle, SoundControl* &ctrl); 00098 void Stop(); 00104 void SetUnManaged(); 00109 void SetManaged(); 00113 void Loop(); 00117 void DontLoop(); 00121 void UpdateHandleCallback(); 00127 static void StopCallback(void* object); 00128 }; 00129 00130 #endif /*_PSMUSIC_H_*/