Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
98 changed files
with
4,633 additions
and
1,201 deletions.
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
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
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
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,75 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
|
||
#include "backends/mixer/nullmixer/nullsdl-mixer.h" | ||
#include "common/savefile.h" | ||
|
||
NullSdlMixerManager::NullSdlMixerManager() : SdlMixerManager() { | ||
_outputRate = 22050; | ||
_callsCounter = 0; | ||
_callbackPeriod = 10; | ||
_samples = 8192; | ||
while (_samples * 16 > _outputRate * 2) | ||
_samples >>= 1; | ||
_samplesBuf = new uint8[_samples * 4]; | ||
} | ||
|
||
NullSdlMixerManager::~NullSdlMixerManager() { | ||
delete _samplesBuf; | ||
} | ||
|
||
void NullSdlMixerManager::init() { | ||
_mixer = new Audio::MixerImpl(g_system, _outputRate); | ||
assert(_mixer); | ||
_mixer->setReady(true); | ||
} | ||
|
||
void NullSdlMixerManager::suspendAudio() { | ||
_audioSuspended = true; | ||
} | ||
|
||
int NullSdlMixerManager::resumeAudio() { | ||
if (!_audioSuspended) { | ||
return -2; | ||
} | ||
_audioSuspended = false; | ||
return 0; | ||
} | ||
|
||
|
||
void NullSdlMixerManager::startAudio() { | ||
} | ||
|
||
void NullSdlMixerManager::callbackHandler(byte *samples, int len) { | ||
assert(_mixer); | ||
_mixer->mixCallback(samples, len); | ||
} | ||
|
||
void NullSdlMixerManager::update() { | ||
if (_audioSuspended) { | ||
return; | ||
} | ||
_callsCounter++; | ||
if ((_callsCounter % _callbackPeriod) == 0) { | ||
callbackHandler(_samplesBuf, _samples); | ||
} | ||
} |
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,62 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
|
||
#ifndef BACKENDS_MIXER_NULLSDL_H | ||
#define BACKENDS_MIXER_NULLSDL_H | ||
|
||
#include "backends/mixer/sdl/sdl-mixer.h" | ||
#include "common/str.h" | ||
|
||
/** Audio mixer which in fact does not output audio. | ||
* | ||
* It is used by events recorder since the recorder is intentionally | ||
* turning sound off to avoid stuttering. | ||
* | ||
* It returns correct output and shoots callbacks, so all OSystem | ||
* users could work without modifications. | ||
*/ | ||
|
||
class NullSdlMixerManager : public SdlMixerManager { | ||
public: | ||
NullSdlMixerManager(); | ||
virtual ~NullSdlMixerManager(); | ||
|
||
virtual void init(); | ||
void update(); | ||
|
||
virtual void suspendAudio(); | ||
virtual int resumeAudio(); | ||
|
||
protected: | ||
|
||
virtual void startAudio(); | ||
virtual void callbackHandler(byte *samples, int len); | ||
|
||
private: | ||
uint32 _outputRate; | ||
uint32 _callsCounter; | ||
uint8 _callbackPeriod; | ||
uint32 _samples; | ||
uint8 *_samplesBuf; | ||
}; | ||
|
||
#endif |
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
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
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
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
Oops, something went wrong.