Changeset 7305 in orxonox.OLD for trunk/src/lib/sound/ogg_player.h
- Timestamp:
- Apr 16, 2006, 8:46:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/ogg_player.h
r7304 r7305 27 27 { 28 28 public: 29 OggPlayer(const std::string& fileName = ""); 30 virtual ~OggPlayer(); 31 32 bool open(const std::string& fileName); 33 void release(); 34 bool play(); 35 bool playing(); 36 bool update(); 37 38 void jumpTo(float timeCode); 39 40 void debug(); 41 void printState(); 42 43 static int createAudioThread(void* oggPlayer); 44 45 46 protected: 47 bool stream(ALuint buffer); 48 void empty(); 49 const char* errorString(int code); 50 51 private: 52 bool playback(); 53 54 55 public: 29 /** 30 * An enumerator defining in what State the OggPlayer is. 31 * The OggPlayer can be in multiple States listed here. 32 * It can as an example be in FileOpened and Stopped. 33 */ 56 34 typedef enum { 57 35 None = 0x000, … … 65 43 } State; 66 44 45 OggPlayer(const std::string& fileName = ""); 46 virtual ~OggPlayer(); 47 /** @param state compare this State with the internal State */ 48 bool operator==(OggPlayer::State state) { return this->state & state; }; 49 50 bool open(const std::string& fileName = ""); 51 52 bool play(); 53 void stop(); 54 void pause(); 55 void rewind(); // convenience 56 void jumpTo(float timeCode); 57 58 bool isPlaying(); 59 bool getState() { return this->state; }; 60 61 void debug() const; 62 void printState() const; 63 const char* getVorbisError(int code); 64 65 66 private: 67 static int createAudioThread(void* oggPlayer); 68 bool playback(); 69 bool update(); 70 71 void release(); 72 73 bool stream(ALuint buffer); 74 void empty(); 75 76 public: 77 67 78 private: 68 79 FILE* oggFile; //!< general file-handler, to open the sound-file … … 74 85 ALuint source; //!< The source we play back on 75 86 ALenum format; //!< The format we play back 76 unsigned int state; 87 unsigned int state; //!< The States the OggPlayer is in (this can be multiple entries from OggPlayer::State). 77 88 78 89 SDL_Thread* musicThread; //!< The Thread in which music is Played back.
Note: See TracChangeset
for help on using the changeset viewer.