AUDIO: (FM-TOWNS) - add error codes

This commit is contained in:
athrxx 2015-11-02 21:16:07 +01:00
parent a39377724f
commit cc25424dae
2 changed files with 17 additions and 3 deletions

View File

@ -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) {

View File

@ -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);