mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
more general handling of this
This commit is contained in:
parent
d9730bb878
commit
98cf3c80b1
47
panda/src/audio/audio_sound.cxx
Normal file
47
panda/src/audio/audio_sound.cxx
Normal file
@ -0,0 +1,47 @@
|
||||
// Filename: audio_sound.cxx
|
||||
// Created by: cary (17Oct00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "audio_sound.h"
|
||||
#include "config_audio.h"
|
||||
|
||||
TypeHandle AudioSound::_type_handle;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AudioSound::destructor
|
||||
// Access: Public
|
||||
// Description: deletes the sound data and then lets the system
|
||||
// destroy this structure
|
||||
////////////////////////////////////////////////////////////////////
|
||||
AudioSound::~AudioSound(void) {
|
||||
(*_delstate)(_state);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AudioSound::length
|
||||
// Access: Public
|
||||
// Description: return the length (in seconds) of the sound
|
||||
////////////////////////////////////////////////////////////////////
|
||||
float AudioSound::length(void) const {
|
||||
return _sound->length();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AudioSound::status
|
||||
// Access: Public
|
||||
// Description: return the current play status of this sound
|
||||
////////////////////////////////////////////////////////////////////
|
||||
AudioSound::SoundStatus AudioSound::status(void) {
|
||||
AudioTraits::PlayingClass::PlayingStatus stat = _state->status();
|
||||
switch (stat) {
|
||||
case AudioTraits::PlayingClass::BAD:
|
||||
return BAD;
|
||||
case AudioTraits::PlayingClass::READY:
|
||||
return READY;
|
||||
case AudioTraits::PlayingClass::PLAYING:
|
||||
return PLAYING;
|
||||
}
|
||||
audio_cat->error() << "unknown status for sound" << endl;
|
||||
return BAD;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user