diff --git a/src/kits/game/GameSound.cpp b/src/kits/game/GameSound.cpp index 935121674f..10309c43af 100644 --- a/src/kits/game/GameSound.cpp +++ b/src/kits/game/GameSound.cpp @@ -4,7 +4,6 @@ * * Authors: * Christopher ML Zumwalt May (zummy@users.sf.net) - * */ @@ -30,7 +29,7 @@ BGameSound::BGameSound(BGameSoundDevice *device) // TODO: device is ignored! // NOTE: BeBook documents that BGameSoundDevice must currently always // be NULL... - fDevice = GetDefaultDevice(); + fDevice = BGameSoundDevice::GetDefaultDevice(); fInitError = fDevice->InitCheck(); } @@ -41,7 +40,7 @@ BGameSound::BGameSound(const BGameSound &other) { memcpy(&fFormat, &other.fFormat, sizeof(gs_audio_format)); // TODO: device from other is ignored! - fDevice = GetDefaultDevice(); + fDevice = BGameSoundDevice::GetDefaultDevice(); fInitError = fDevice->InitCheck(); } @@ -52,7 +51,7 @@ BGameSound::~BGameSound() if (fSound >= 0) fDevice->ReleaseBuffer(fSound); - ReleaseDevice(); + BGameSoundDevice::ReleaseDevice(); } diff --git a/src/kits/game/GameSoundDevice.cpp b/src/kits/game/GameSoundDevice.cpp index 451766f458..99c9fe5222 100644 --- a/src/kits/game/GameSoundDevice.cpp +++ b/src/kits/game/GameSoundDevice.cpp @@ -1,31 +1,17 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, Haiku -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: BGameSoundDevice.cpp -// Author: Christopher ML Zumwalt May (zummy@users.sf.net) -// Description: Manages the game producer. The class may change with out -// notice and was only inteneded for use by the GameKit at -// this time. Use at your own risk. -//------------------------------------------------------------------------------ +/* + * Copyright 2001-2002, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Stefano Ceccherini (stefano.ceccherini@gmail.com) + * Adrien Destugues (pulkomandy) + * Jérôme Duval (korli) + * Christopher ML Zumwalt May (zummy@users.sf.net) + */ +// Description: Manages the game producer. The class may change without +// notice and was only intended for use by the GameKit at +// this time. Use at your own risk. #include "GameSoundDevice.h" @@ -42,13 +28,10 @@ #include #include "GameSoundBuffer.h" -#include "GameProducer.h" -#include "GSUtility.h" -// BGameSoundDevice definitions ------------------------------------ -const int32 kInitSoundCount = 32; -const int32 kGrowth = 16; +static const int32 kInitSoundCount = 32; +static const int32 kGrowth = 16; static int32 sDeviceCount = 0; static BGameSoundDevice* sDevice = NULL; @@ -56,7 +39,7 @@ static BLocker sDeviceRefCountLock("GameSound device lock"); BGameSoundDevice* -GetDefaultDevice() +BGameSoundDevice::GetDefaultDevice() { BAutolock _(sDeviceRefCountLock); @@ -69,7 +52,7 @@ GetDefaultDevice() void -ReleaseDevice() +BGameSoundDevice::ReleaseDevice() { BAutolock _(sDeviceRefCountLock); @@ -82,7 +65,6 @@ ReleaseDevice() } -// BGameSoundDevice ------------------------------------------------------- BGameSoundDevice::BGameSoundDevice() : fIsConnected(false), diff --git a/src/kits/game/GameSoundDevice.h b/src/kits/game/GameSoundDevice.h index eb378bc30e..76e3723816 100644 --- a/src/kits/game/GameSoundDevice.h +++ b/src/kits/game/GameSoundDevice.h @@ -1,34 +1,11 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, Haiku -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: GameSoundDevice.h -// Author: Christopher ML Zumwalt May (zummy@users.sf.net) -// Description: Manages the game producer. The class may change with out -// notice and was only inteneded for use by the GameKit at -// this time. Use at your own risk. -//------------------------------------------------------------------------------ - +/* + * Copyright 2001-2002, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _GAMESOUNDDEVICE_H #define _GAMESOUNDDEVICE_H + #include @@ -36,7 +13,12 @@ class BMediaNode; class GameSoundBuffer; struct Connection; -class BGameSoundDevice { + +class BGameSoundDevice { +public: + static BGameSoundDevice* GetDefaultDevice(); + static void ReleaseDevice(); + public: BGameSoundDevice(); virtual ~BGameSoundDevice(); @@ -87,7 +69,5 @@ private: GameSoundBuffer ** fSounds; }; -BGameSoundDevice* GetDefaultDevice(); -void ReleaseDevice(); #endif