Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client|Audio: Added audio::System (stub) for the client
All audio subsystem functionality should be moved here.
- Loading branch information
1 parent
48c60c2
commit 47053fa
Showing
5 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @file audio/system.h Audio subsystem. | ||
* | ||
* @authors Copyright © 2015 Daniel Swanson <danij@dengine.net> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef CLIENT_AUDIO_SYSTEM_H | ||
#define CLIENT_AUDIO_SYSTEM_H | ||
|
||
#include <de/System> | ||
|
||
namespace audio { | ||
|
||
/** | ||
* Client audio subsystem. | ||
* | ||
* Singleton: there can only be one instance of the audio system at a time. | ||
* | ||
* @ingroup audio | ||
*/ | ||
class System : public de::System | ||
{ | ||
public: | ||
static System &get(); | ||
|
||
public: | ||
System(); | ||
|
||
// Systems observe the passage of time. | ||
void timeChanged(de::Clock const &) override; | ||
|
||
private: | ||
DENG2_PRIVATE(d) | ||
}; | ||
|
||
} // namespace audio | ||
|
||
#endif // CLIENT_AUDIO_SYSTEM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** @file system.cpp Audio subsystem module. | ||
* | ||
* @authors Copyright © 2015 Daniel Swanson <danij@dengine.net> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#include "audio/system.h" | ||
|
||
#include <de/App> | ||
|
||
using namespace de; | ||
|
||
namespace audio { | ||
|
||
static audio::System *theAudioSystem = nullptr; | ||
|
||
DENG2_PIMPL(System) | ||
{ | ||
Instance(Public *i) : Base(i) | ||
{ | ||
theAudioSystem = thisPublic; | ||
} | ||
~Instance() | ||
{ | ||
theAudioSystem = nullptr; | ||
} | ||
}; | ||
|
||
System::System() : d(new Instance(this)) | ||
{} | ||
|
||
void System::timeChanged(Clock const &) | ||
{ | ||
// Nothing to do. | ||
} | ||
|
||
audio::System &System::get() | ||
{ | ||
DENG2_ASSERT(theAudioSystem); | ||
return *theAudioSystem; | ||
} | ||
|
||
} // namespace audio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters