15 #ifdef HAVE_RAD_MSS //[ 23 #undef miles_audio_debug 26 #define miles_audio_debug(x) \ 27 audio_debug("MilesAudioSound \""<<get_name()<<"\" "<< x ) 29 #define miles_audio_debug(x) ((void)0) 36 MilesAudioSound(MilesAudioManager *manager,
37 const string &file_name) :
39 _file_name(file_name),
40 _volume(1.0f), _balance(0), _play_rate(1.0f),
45 _got_start_time(false)
47 nassertv(!file_name.empty());
53 void MilesAudioSound::
56 set_loop_count((loop)?0:1);
62 bool MilesAudioSound::
64 return (_loop_count == 0);
70 void MilesAudioSound::
71 set_loop_count(
unsigned long loop_count) {
72 if (_loop_count != loop_count) {
73 _loop_count = loop_count;
74 if (status() == PLAYING) {
89 unsigned long MilesAudioSound::
90 get_loop_count()
const {
97 PN_stdfloat MilesAudioSound::
105 PN_stdfloat MilesAudioSound::
106 get_balance()
const {
113 PN_stdfloat MilesAudioSound::
114 get_play_rate()
const {
121 void MilesAudioSound::
122 set_time(PN_stdfloat time) {
123 miles_audio_debug(
"set_time(time="<<time<<
")");
127 _got_start_time =
true;
133 void MilesAudioSound::
134 set_active(
bool active) {
135 if (_manager ==
nullptr) {
139 miles_audio_debug(
"set_active(active="<<active<<
")");
140 if (_active != active) {
144 if (_paused && _loop_count==0) {
152 if (status() == PLAYING) {
153 if (_loop_count == 0) {
157 _start_time = get_time();
158 _got_start_time =
true;
168 bool MilesAudioSound::
176 void MilesAudioSound::
177 set_finished_event(
const string &event) {
178 _finished_event = event;
184 const string &MilesAudioSound::
185 get_finished_event()
const {
186 return _finished_event;
192 const string &MilesAudioSound::
201 void MilesAudioSound::
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.