forked from suyu/suyu
Merge pull request #2200 from lioncash/audio
hle/service/audio: Extract audio error codes to a header
This commit is contained in:
commit
5a57b1a09b
4 changed files with 21 additions and 10 deletions
|
@ -217,6 +217,7 @@ add_library(core STATIC
|
||||||
hle/service/audio/audren_u.h
|
hle/service/audio/audren_u.h
|
||||||
hle/service/audio/codecctl.cpp
|
hle/service/audio/codecctl.cpp
|
||||||
hle/service/audio/codecctl.h
|
hle/service/audio/codecctl.h
|
||||||
|
hle/service/audio/errors.h
|
||||||
hle/service/audio/hwopus.cpp
|
hle/service/audio/hwopus.cpp
|
||||||
hle/service/audio/hwopus.h
|
hle/service/audio/hwopus.h
|
||||||
hle/service/bcat/bcat.cpp
|
hle/service/bcat/bcat.cpp
|
||||||
|
|
|
@ -18,17 +18,11 @@
|
||||||
#include "core/hle/kernel/readable_event.h"
|
#include "core/hle/kernel/readable_event.h"
|
||||||
#include "core/hle/kernel/writable_event.h"
|
#include "core/hle/kernel/writable_event.h"
|
||||||
#include "core/hle/service/audio/audout_u.h"
|
#include "core/hle/service/audio/audout_u.h"
|
||||||
|
#include "core/hle/service/audio/errors.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
|
|
||||||
namespace Service::Audio {
|
namespace Service::Audio {
|
||||||
|
|
||||||
namespace ErrCodes {
|
|
||||||
enum {
|
|
||||||
ErrorUnknown = 2,
|
|
||||||
BufferCountExceeded = 8,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr std::array<char, 10> DefaultDevice{{"DeviceOut"}};
|
constexpr std::array<char, 10> DefaultDevice{{"DeviceOut"}};
|
||||||
constexpr int DefaultSampleRate{48000};
|
constexpr int DefaultSampleRate{48000};
|
||||||
|
|
||||||
|
@ -100,7 +94,7 @@ private:
|
||||||
|
|
||||||
if (stream->IsPlaying()) {
|
if (stream->IsPlaying()) {
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(ResultCode(ErrorModule::Audio, ErrCodes::ErrorUnknown));
|
rb.Push(ERR_OPERATION_FAILED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +137,7 @@ private:
|
||||||
|
|
||||||
if (!audio_core.QueueBuffer(stream, tag, std::move(samples))) {
|
if (!audio_core.QueueBuffer(stream, tag, std::move(samples))) {
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(ResultCode(ErrorModule::Audio, ErrCodes::BufferCountExceeded));
|
rb.Push(ERR_BUFFER_COUNT_EXCEEDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "core/hle/kernel/readable_event.h"
|
#include "core/hle/kernel/readable_event.h"
|
||||||
#include "core/hle/kernel/writable_event.h"
|
#include "core/hle/kernel/writable_event.h"
|
||||||
#include "core/hle/service/audio/audren_u.h"
|
#include "core/hle/service/audio/audren_u.h"
|
||||||
|
#include "core/hle/service/audio/errors.h"
|
||||||
|
|
||||||
namespace Service::Audio {
|
namespace Service::Audio {
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ private:
|
||||||
// code in this case.
|
// code in this case.
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(ResultCode{ErrorModule::Audio, 201});
|
rb.Push(ERR_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
Kernel::EventPair system_event;
|
Kernel::EventPair system_event;
|
||||||
|
|
15
src/core/hle/service/audio/errors.h
Normal file
15
src/core/hle/service/audio/errors.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2019 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/result.h"
|
||||||
|
|
||||||
|
namespace Service::Audio {
|
||||||
|
|
||||||
|
constexpr ResultCode ERR_OPERATION_FAILED{ErrorModule::Audio, 2};
|
||||||
|
constexpr ResultCode ERR_BUFFER_COUNT_EXCEEDED{ErrorModule::Audio, 8};
|
||||||
|
constexpr ResultCode ERR_NOT_SUPPORTED{ErrorModule::Audio, 513};
|
||||||
|
|
||||||
|
} // namespace Service::Audio
|
Loading…
Reference in a new issue