From cc25424dae4b0accad45cc40280f99cca384a15d Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 2 Nov 2015 21:16:07 +0100 Subject: AUDIO: (FM-TOWNS) - add error codes --- audio/softsynth/fmtowns_pc98/towns_audio.cpp | 4 ++-- audio/softsynth/fmtowns_pc98/towns_audio.h | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'audio/softsynth/fmtowns_pc98') diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp index 42824d8423..2506e02c2b 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp @@ -1940,14 +1940,14 @@ bool TownsAudioInterface::init() { return _intf->init(); } -int TownsAudioInterface::callback(int command, ...) { +TownsAudioInterface::ErrorCode TownsAudioInterface::callback(int command, ...) { va_list args; va_start(args, command); int res = _intf->processCommand(command, args); va_end(args); - return res; + return (TownsAudioInterface::ErrorCode)res; } void TownsAudioInterface::setMusicVolume(int volume) { diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.h b/audio/softsynth/fmtowns_pc98/towns_audio.h index 0003f02777..ba13bd10f6 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.h +++ b/audio/softsynth/fmtowns_pc98/towns_audio.h @@ -40,9 +40,23 @@ public: TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false); ~TownsAudioInterface(); + enum ErrorCode { + kSuccess = 0, + kInvalidChannel, + kUnavailable, + kArgumentOutOfRange, + kNotImplemented, + kOutOfWaveMemory, + kInvalidWaveTable, + kChannelNotReserved, + kNoteOutOfRangeForInstrument, + kNoMatchingWaveTable, + kDuplicateWaveTable + }; + bool init(); - int callback(int command, ...); + ErrorCode callback(int command, ...); void setMusicVolume(int volume); void setSoundEffectVolume(int volume); -- cgit v1.2.3