1 //------------------------------------------------------------------------------ 2 // Copyright (c) 2001-2002, OpenBeOS 3 // 4 // Permission is hereby granted, free of charge, to any person obtaining a 5 // copy of this software and associated documentation files (the "Software"), 6 // to deal in the Software without restriction, including without limitation 7 // the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 // and/or sell copies of the Software, and to permit persons to whom the 9 // Software is furnished to do so, subject to the following conditions: 10 // 11 // The above copyright notice and this permission notice shall be included in 12 // all copies or substantial portions of the Software. 13 // 14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 // DEALINGS IN THE SOFTWARE. 21 // 22 // File Name: SimpleGameSound.h 23 // Author: Christopher ML Zumwalt May (zummy@users.sf.net) 24 // Description: BSimpleGameSound is a class for sound effects that are 25 // short, and consists of non-changing samples in memory. 26 //------------------------------------------------------------------------------ 27 28 29 #ifndef _SIMPLEGAMESOUND_H 30 #define _SIMPLEGAMESOUND_H 31 32 // Standard Includes ----------------------------------------------------------- 33 34 // System Includes ------------------------------------------------------------- 35 #include <GameSoundDefs.h> 36 #include <GameSound.h> 37 38 // Project Includes ------------------------------------------------------------ 39 40 // Local Includes -------------------------------------------------------------- 41 42 // Local Defines --------------------------------------------------------------- 43 44 // Globals --------------------------------------------------------------------- 45 46 // BGameSound class ------------------------------------------------------------- 47 class BSimpleGameSound : public BGameSound 48 { 49 public: 50 BSimpleGameSound(const entry_ref * inFile, 51 BGameSoundDevice * device = NULL); 52 BSimpleGameSound(const char * inFile, 53 BGameSoundDevice * device = NULL); 54 BSimpleGameSound(const void * inData, 55 size_t inFrameCount, 56 const gs_audio_format * format, 57 BGameSoundDevice * device = NULL); 58 59 BSimpleGameSound(const BSimpleGameSound & other); 60 61 virtual ~BSimpleGameSound(); 62 63 virtual BGameSound * Clone() const; 64 65 virtual status_t Perform(int32 selector, void * data); 66 67 status_t SetIsLooping(bool looping); 68 bool IsLooping() const; 69 70 private: 71 status_t Init(const entry_ref * inFile); 72 status_t Init(const void* inData, 73 int64 inFrameCount, 74 const gs_audio_format* format); 75 76 /* leave these declarations private unless you plan on actually implementing and using them. */ 77 BSimpleGameSound(); 78 BSimpleGameSound& operator=(const BSimpleGameSound&); 79 80 /* fbc data and virtuals */ 81 82 uint32 _reserved_BSimpleGameSound_[12]; 83 84 virtual status_t _Reserved_BSimpleGameSound_0(int32 arg, ...); 85 virtual status_t _Reserved_BSimpleGameSound_1(int32 arg, ...); 86 virtual status_t _Reserved_BSimpleGameSound_2(int32 arg, ...); 87 virtual status_t _Reserved_BSimpleGameSound_3(int32 arg, ...); 88 virtual status_t _Reserved_BSimpleGameSound_4(int32 arg, ...); 89 virtual status_t _Reserved_BSimpleGameSound_5(int32 arg, ...); 90 virtual status_t _Reserved_BSimpleGameSound_6(int32 arg, ...); 91 virtual status_t _Reserved_BSimpleGameSound_7(int32 arg, ...); 92 virtual status_t _Reserved_BSimpleGameSound_8(int32 arg, ...); 93 virtual status_t _Reserved_BSimpleGameSound_9(int32 arg, ...); 94 virtual status_t _Reserved_BSimpleGameSound_10(int32 arg, ...); 95 virtual status_t _Reserved_BSimpleGameSound_11(int32 arg, ...); 96 virtual status_t _Reserved_BSimpleGameSound_12(int32 arg, ...); 97 virtual status_t _Reserved_BSimpleGameSound_13(int32 arg, ...); 98 virtual status_t _Reserved_BSimpleGameSound_14(int32 arg, ...); 99 virtual status_t _Reserved_BSimpleGameSound_15(int32 arg, ...); 100 virtual status_t _Reserved_BSimpleGameSound_16(int32 arg, ...); 101 virtual status_t _Reserved_BSimpleGameSound_17(int32 arg, ...); 102 virtual status_t _Reserved_BSimpleGameSound_18(int32 arg, ...); 103 virtual status_t _Reserved_BSimpleGameSound_19(int32 arg, ...); 104 virtual status_t _Reserved_BSimpleGameSound_20(int32 arg, ...); 105 virtual status_t _Reserved_BSimpleGameSound_21(int32 arg, ...); 106 virtual status_t _Reserved_BSimpleGameSound_22(int32 arg, ...); 107 virtual status_t _Reserved_BSimpleGameSound_23(int32 arg, ...); 108 109 }; 110 111 #endif // _SIMPLE_GAME_SOUND_H 112