//===========================================================================// // File: AudioRenderer.cpp // // Project: MUNGA Brick: Video Renderer // // Contents: Abstracted Base Video Renderer // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 03/04/97 JTR Initial coding. // //---------------------------------------------------------------------------// // Copyright (C) 1997, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include "AdeptHeaders.hpp" #include "VOChannel.hpp" #include "AudioRenderer.hpp" #include "AudioCommand.hpp" //########################################################################## //############################ VOChannel ########################## //########################################################################## //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // VOChannel::VOChannel(int channel, int type): AudioChannel(DefaultData, channel, type, gosAudio_Volume) { Check_Object(this); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // VOChannel::~VOChannel() { Check_Object(this); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void VOChannel::Activate(AudioCommand *command) { Check_Object(this); Check_Object(command); Verify(m_playMode == gosAudio_Stop); // //----------------------------------------------------------------------- // Set all the other types to 50% volume if we weren't playing before now //----------------------------------------------------------------------- // Check_Object(AudioRenderer::Instance); if (AudioRenderer::Instance->m_channelTypes[m_type].GetVolume() == 0.0f) { for (int i=0; im_channelTypes[i].SetVolume(0.5f); else AudioRenderer::Instance->m_channelTypes[i].SetVolume(1.0f); } } } BaseClass::Activate(command); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void VOChannel::Deactivate() { Check_Object(this); BaseClass::Deactivate(); Verify(m_playMode == gosAudio_Stop); // //------------------------------------------------------ // Undo the channel change if no other voiceovers are up //------------------------------------------------------ // Check_Object(AudioRenderer::Instance); if (AudioRenderer::Instance->m_channelTypes[m_type].m_queuedCommands.IsEmpty()) { for (int i=0; im_channelTypes[i].SetVolume(1.0f); else AudioRenderer::Instance->m_channelTypes[i].SetVolume(0.0f); } } } }