From b7a5fd491136623af1a76426002d5822e4fbc052 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Thu, 12 Jul 2001 20:54:10 +0000 Subject: [PATCH] moved miles audio to ../audiotraits --- panda/src/audio/milesAudioManager.cxx | 270 -------------------------- panda/src/audio/milesAudioManager.h | 68 ------- panda/src/audio/milesAudioSound.I | 24 --- panda/src/audio/milesAudioSound.cxx | 227 ---------------------- panda/src/audio/milesAudioSound.h | 102 ---------- panda/src/audio/test_audio.cxx | 5 - 6 files changed, 696 deletions(-) delete mode 100644 panda/src/audio/milesAudioManager.cxx delete mode 100644 panda/src/audio/milesAudioManager.h delete mode 100644 panda/src/audio/milesAudioSound.I delete mode 100644 panda/src/audio/milesAudioSound.cxx delete mode 100644 panda/src/audio/milesAudioSound.h diff --git a/panda/src/audio/milesAudioManager.cxx b/panda/src/audio/milesAudioManager.cxx deleted file mode 100644 index cb1cb172a7..0000000000 --- a/panda/src/audio/milesAudioManager.cxx +++ /dev/null @@ -1,270 +0,0 @@ -// Filename: milesAudioManager.cxx -// Created by: skyler (June 6, 2001) -// Prior system by: cary -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - -#include -#ifdef HAVE_RAD_MSS //[ - -#include "milesAudioManager.h" -#include "config_audio.h" -#include "config_util.h" - -int MilesAudioManager::_active_managers; -HDLSFILEID MilesAudioManager::_dls_field; - - -//////////////////////////////////////////////////////////////////// -// Function: MilesAudioManager::MilesAudioManager -// Access: Public -// Description: set the overall volume of SFX -//////////////////////////////////////////////////////////////////// -MilesAudioManager:: -MilesAudioManager() { - audio_debug("MilesAudioManager::MilesAudioManager()"); - audio_debug(" audio_active="<second); - } - _sounds.clear(); - --_active_managers; - if (!_active_managers) { - if (audio_software_midi) { - HDLSDEVICE dls; - AIL_quick_handles(0, 0, &dls); - AIL_DLS_unload(dls, _dls_field); - #ifndef NDEBUG //[ - // Clear _dls_field in debug version (for assert in ctor): - _dls_field=0; - #endif //] - } - AIL_quick_shutdown(); - audio_debug(" AIL_quick_shutdown()"); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: MilesAudioManager::load -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -HAUDIO MilesAudioManager:: -load(Filename file_name) { - string stmp = file_name.to_os_specific(); - audio_debug(" \"" << stmp << "\""); - HAUDIO audio = AIL_quick_load(stmp.c_str()); - if (!audio) { - audio_debug(" MilesAudioManager::load failed "< ib - =_sounds.insert(pair(path, audio)); - if (!ib.second) { - // The insert failed. - audio_debug(" failed map insert of "<set_active(_active); - _soundsOnLoan.insert(milesAudioSound); - audioSound=milesAudioSound; - } - audio_debug(" returning 0x" << (void*)audioSound); - return audioSound; -} - -//////////////////////////////////////////////////////////////////// -// Function: MilesAudioManager::drop_sound -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void MilesAudioManager:: -drop_sound(const string& file_name) { - audio_debug("MilesAudioManager::drop_sound(file_name=\"" - <second); - _sounds.erase(i); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: MilesAudioManager::release_sound -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void MilesAudioManager:: -release_sound(MilesAudioSound* audioSound) { - audio_debug("MilesAudioManager::release_sound(audioSound=\"" - <get_name()<<"\""); - _soundsOnLoan.erase(audioSound); -} - -//////////////////////////////////////////////////////////////////// -// Function: MilesAudioManager::set_volume -// Access: Public -// Description: set the overall volume -//////////////////////////////////////////////////////////////////// -void MilesAudioManager:: -set_volume(float volume) { - audio_debug("MilesAudioManager::set_volume(volume="< -#ifdef HAVE_RAD_MSS //[ - -#include "audioManager.h" -#include "milesAudioSound.h" - -#define NAME_MACRO_FOR_AUDIO_MANAGER() MilesAudioManager - - -class MilesAudioManager: public AudioManager { -public: - MilesAudioManager(); - ~MilesAudioManager(); - - AudioSound* get_sound(const string& file_name); - void drop_sound(const string& file_name); - - void set_volume(float volume); - float get_volume(); - - void set_active(bool active); - bool get_active(); - -private: - typedef pmap SoundMap; - SoundMap _sounds; - typedef pset AudioSet; - AudioSet _soundsOnLoan; - float _volume; - bool _active; - // keep a count for startup and shutdown: - static int _active_managers; - static HDLSFILEID _dls_field; - - HAUDIO load(Filename file_name); - // Tell the manager that the sound dtor was called. - void release_sound(MilesAudioSound* audioSound); - - friend MilesAudioSound; -}; - -#endif //] - -#endif //] - - diff --git a/panda/src/audio/milesAudioSound.I b/panda/src/audio/milesAudioSound.I deleted file mode 100644 index 97356eefc4..0000000000 --- a/panda/src/audio/milesAudioSound.I +++ /dev/null @@ -1,24 +0,0 @@ -// Filename: milesAudioSound.I -// Created by: skyler (June 6, 2001) -// Prior system by: cary -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - - - - - - diff --git a/panda/src/audio/milesAudioSound.cxx b/panda/src/audio/milesAudioSound.cxx deleted file mode 100644 index 7b2ecab5bb..0000000000 --- a/panda/src/audio/milesAudioSound.cxx +++ /dev/null @@ -1,227 +0,0 @@ -// Filename: milesAudioSound.cxx -// Created by: skyler (June 6, 2001) -// Prior system by: cary -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://www.panda3d.org/license.txt . -// -// To contact the maintainers of this program write to -// panda3d@yahoogroups.com . -// -//////////////////////////////////////////////////////////////////// - -#include -#ifdef HAVE_RAD_MSS //[ - -#include "milesAudioSound.h" -#include "milesAudioManager.h" - - -MilesAudioSound:: -MilesAudioSound(MilesAudioManager& manager, - HAUDIO audio, string file_name) - : _manager(manager), _file_name(file_name), - _start_time(0), _volume(1.0), _balance(0), - _loop_count(1), - _active(true), _paused(false) { - nassertv(audio); - nassertv(!file_name.empty()); - audio_debug("MilesAudioSound::MilesAudioSound(manager=0x"<<(void*)&manager - <<", audio=0x"<<(void*)audio<<", file_name="< -#ifdef HAVE_RAD_MSS //[ - -#include "audioSound.h" -#include "mss.h" - - -class MilesAudioManager; - -class EXPCL_PANDA MilesAudioSound : public AudioSound { -public: - ~MilesAudioSound(); - - // For best compatability, set the loop_count, start_time, - // volume, and balance, prior to calling play(). You may - // set them while they're playing, but it's implementation - // specific whether you get the results. - void play(); - void stop(); - - // loop: 0 = play once; 1 = play forever. - // inits to false. - void set_loop(bool loop=false); - bool get_loop() const; - - // loop_count: 0 = forever; 1 = play once; n = play n times. - // inits to 1. - void set_loop_count(unsigned long loop_count=1); - unsigned long get_loop_count() const; - - // 0 = begining; length() = end. - // inits to 0.0. - void set_time(float start_time=0.0); - float get_time() const; - - // 0 = minimum; 1.0 = maximum. - // inits to 1.0. - void set_volume(float volume=1.0); - float get_volume() const; - - // -1.0 is hard left - // 0.0 is centered - // 1.0 is hard right - // inits to 0.0. - void set_balance(float balance_right=0.0); - float get_balance() const; - - // inits to manager's state. - void set_active(bool active=true); - bool get_active() const; - - const string& get_name() const; - - // return: playing time in seconds. - float length() const; - - AudioSound::SoundStatus status() const; - -private: - HAUDIO _audio; - MilesAudioManager& _manager; - float _start_time; // 0..length() - float _volume; // 0..1.0 - float _balance; // -1..1 - unsigned long _loop_count; - string _file_name; - bool _active; - bool _paused; - - MilesAudioSound(MilesAudioManager& manager, - HAUDIO audio, string file_name); - - friend class MilesAudioManager; -}; - -#include "milesAudioSound.I" - -#endif //] - -#endif /* __MILES_AUDIO_SOUND_H__ */ diff --git a/panda/src/audio/test_audio.cxx b/panda/src/audio/test_audio.cxx index 73614bad20..76caeac87e 100644 --- a/panda/src/audio/test_audio.cxx +++ b/panda/src/audio/test_audio.cxx @@ -24,11 +24,6 @@ int main(int argc, char* argv[]) { - for (int i=1; ifatal() << "could not locate '" << argv[i] << "'" << endl; - exit(-1); - } AudioManager::spawn_update(); {