aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMatthew Hoops2011-06-14 16:18:33 -0400
committerMatthew Hoops2011-06-14 16:21:39 -0400
commit4926c41e01a46735747930b09cc924ecd826a215 (patch)
tree8832a663ade5b4baed0e3b426d5f72e482a12c30 /backends
parent5e7acc83b7ad363014e2a6681bcba22c9bbd9c07 (diff)
parente826aaab39f02360c5fa8f249ec6b788a903b948 (diff)
downloadscummvm-rg350-4926c41e01a46735747930b09cc924ecd826a215.tar.gz
scummvm-rg350-4926c41e01a46735747930b09cc924ecd826a215.tar.bz2
scummvm-rg350-4926c41e01a46735747930b09cc924ecd826a215.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'backends')
-rw-r--r--backends/events/default/default-events.cpp5
-rw-r--r--backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp2
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp26
-rw-r--r--backends/mixer/sdl/sdl-mixer.h2
-rw-r--r--backends/mixer/symbiansdl/symbiansdl-mixer.cpp6
-rw-r--r--backends/platform/iphone/osys_events.cpp4
6 files changed, 31 insertions, 14 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index bb74933596..78072b0021 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -26,6 +26,7 @@
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/translation.h"
#include "backends/events/default/default-events.h"
#include "backends/keymapper/keymapper.h"
#include "backends/keymapper/remap-dialog.h"
@@ -218,7 +219,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
if (ConfMan.getBool("confirm_exit")) {
if (g_engine)
g_engine->pauseEngine(true);
- GUI::MessageDialog alert("Do you really want to return to the Launcher?", "Launcher", "Cancel");
+ GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel"));
result = _shouldRTL = (alert.runModal() == GUI::kMessageOK);
if (g_engine)
g_engine->pauseEngine(false);
@@ -240,7 +241,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_confirmExitDialogActive = true;
if (g_engine)
g_engine->pauseEngine(true);
- GUI::MessageDialog alert("Do you really want to quit?", "Quit", "Cancel");
+ GUI::MessageDialog alert(_("Do you really want to quit?"), _("Quit"), _("Cancel"));
result = _shouldQuit = (alert.runModal() == GUI::kMessageOK);
if (g_engine)
g_engine->pauseEngine(false);
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
index 526a01d1bf..001389b1c0 100644
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
+++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
@@ -45,7 +45,7 @@ void DoubleBufferSDLMixerManager::startAudio() {
// Create two sound buffers
_activeSoundBuf = 0;
- uint bufSize = _obtainedRate.samples * 4;
+ uint bufSize = _obtained.samples * 4;
_soundBufSize = bufSize;
_soundBuffers[0] = (byte *)calloc(1, bufSize);
_soundBuffers[1] = (byte *)calloc(1, bufSize);
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index 16e7f22db5..f0b0885dd7 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -61,18 +61,34 @@ void SdlMixerManager::init() {
// Get the desired audio specs
SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC);
+ // Needed as SDL_OpenAudio as of SDL-1.2.14 mutates fields in
+ // "desired" if used directly.
+ SDL_AudioSpec fmt = desired;
+
// Start SDL audio with the desired specs
- if (SDL_OpenAudio(&desired, &_obtainedRate) != 0) {
+ if (SDL_OpenAudio(&fmt, &_obtained) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
_mixer = new Audio::MixerImpl(g_system, desired.freq);
assert(_mixer);
_mixer->setReady(false);
} else {
- debug(1, "Output sample rate: %d Hz", _obtainedRate.freq);
+ debug(1, "Output sample rate: %d Hz", _obtained.freq);
+ if (_obtained.freq != desired.freq)
+ warning("SDL mixer output sample rate: %d differs from desired: %d", _obtained.freq, desired.freq);
- _mixer = new Audio::MixerImpl(g_system, _obtainedRate.freq);
- assert(_mixer);
+ debug(1, "Output buffer size: %d samples", _obtained.samples);
+ if (_obtained.samples != desired.samples)
+ warning("SDL mixer output buffer size: %d differs from desired: %d", _obtained.samples, desired.samples);
+
+ if (_obtained.format != desired.format)
+ warning("SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format);
+
+ if (_obtained.channels != 2)
+ error("SDL mixer output requires stereo output device");
+
+ _mixer = new Audio::MixerImpl(g_system, _obtained.freq);
+ assert(_mixer);
_mixer->setReady(true);
startAudio();
@@ -133,7 +149,7 @@ void SdlMixerManager::suspendAudio() {
int SdlMixerManager::resumeAudio() {
if (!_audioSuspended)
return -2;
- if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
+ if (SDL_OpenAudio(&_obtained, NULL) < 0){
return -1;
}
SDL_PauseAudio(0);
diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h
index 5590c90ab3..82ffa4f901 100644
--- a/backends/mixer/sdl/sdl-mixer.h
+++ b/backends/mixer/sdl/sdl-mixer.h
@@ -67,7 +67,7 @@ protected:
* The obtained audio specification after opening the
* audio system.
*/
- SDL_AudioSpec _obtainedRate;
+ SDL_AudioSpec _obtained;
/** State of the audio system */
bool _audioSuspended;
diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
index b2462a1cdf..c911a99b61 100644
--- a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
+++ b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp
@@ -43,8 +43,8 @@ SymbianSdlMixerManager::~SymbianSdlMixerManager() {
void SymbianSdlMixerManager::startAudio() {
// Need to create mixbuffer for stereo mix to downmix
- if (_obtainedRate.channels != 2) {
- _stereoMixBuffer = new byte [_obtainedRate.size * 2]; // * 2 for stereo values
+ if (_obtained.channels != 2) {
+ _stereoMixBuffer = new byte [_obtained.size * 2]; // * 2 for stereo values
}
SdlMixerManager::startAudio();
@@ -54,7 +54,7 @@ void SymbianSdlMixerManager::callbackHandler(byte *samples, int len) {
assert(_mixer);
#if defined (S60) && !defined(S60V3)
// If not stereo then we need to downmix
- if (_obtainedRate.channels != 2) {
+ if (_obtained.channels != 2) {
_mixer->mixCallback(_stereoMixBuffer, len * 2);
int16 *bitmixDst = (int16 *)samples;
diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp
index 6e2a4b7e1e..1ab1db0f27 100644
--- a/backends/platform/iphone/osys_events.cpp
+++ b/backends/platform/iphone/osys_events.cpp
@@ -335,9 +335,9 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
const char *dialogMsg;
if (_mouseClickAndDragEnabled) {
_touchpadModeEnabled = false;
- dialogMsg = "Mouse-click-and-drag mode enabled.";
+ dialogMsg = _("Mouse-click-and-drag mode enabled.");
} else
- dialogMsg = "Mouse-click-and-drag mode disabled.";
+ dialogMsg = _("Mouse-click-and-drag mode disabled.");
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return false;