mirror of https://github.com/PCSX2/pcsx2.git
SPU2: Remove unused methods from output modules
This commit is contained in:
parent
7f0f153ebd
commit
ab4b7b8ee6
|
@ -49,10 +49,8 @@ StereoOut32 StereoOut16::UpSample() const
|
|||
class NullOutModule : public SndOutModule
|
||||
{
|
||||
public:
|
||||
s32 Init() override { return 0; }
|
||||
bool Init() override { return true; }
|
||||
void Close() override {}
|
||||
s32 Test() const override { return 0; }
|
||||
void Configure(uptr parent) override {}
|
||||
int GetEmptySampleCount() override { return 0; }
|
||||
|
||||
const wchar_t* GetIdent() const override
|
||||
|
@ -64,19 +62,6 @@ public:
|
|||
{
|
||||
return L"No Sound (Emulate SPU2 only)";
|
||||
}
|
||||
|
||||
void ReadSettings() override
|
||||
{
|
||||
}
|
||||
|
||||
void SetApiSettings(wxString api) override
|
||||
{
|
||||
}
|
||||
|
||||
void WriteSettings() const override
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static NullOutModule s_NullOut;
|
||||
|
@ -410,7 +395,7 @@ void SndBuffer::Init()
|
|||
soundtouchInit(); // initializes the timestretching
|
||||
|
||||
// initialize module
|
||||
if (mods[OutputModule]->Init() == -1)
|
||||
if (!mods[OutputModule]->Init())
|
||||
_InitFail();
|
||||
}
|
||||
|
||||
|
@ -506,11 +491,3 @@ void SndBuffer::Write(const StereoOut32& Sample)
|
|||
_WriteSamples(sndTempBuffer, SndOutPacketSize);
|
||||
}
|
||||
}
|
||||
|
||||
s32 SndBuffer::Test()
|
||||
{
|
||||
if (mods[OutputModule] == nullptr)
|
||||
return -1;
|
||||
|
||||
return mods[OutputModule]->Test();
|
||||
}
|
||||
|
|
|
@ -617,7 +617,6 @@ public:
|
|||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Write(const StereoOut32& Sample);
|
||||
static s32 Test();
|
||||
static void ClearContents();
|
||||
|
||||
// Note: When using with 32 bit output buffers, the user of this function is responsible
|
||||
|
@ -642,21 +641,8 @@ public:
|
|||
// (for use in configuration screen)
|
||||
virtual const wchar_t* GetLongName() const = 0;
|
||||
|
||||
virtual s32 Init() = 0;
|
||||
virtual bool Init() = 0;
|
||||
virtual void Close() = 0;
|
||||
virtual s32 Test() const = 0;
|
||||
|
||||
// Gui function: Used to open the configuration box for this driver.
|
||||
virtual void Configure(uptr parent) = 0;
|
||||
|
||||
// Loads settings from the INI file for this driver
|
||||
virtual void ReadSettings() = 0;
|
||||
|
||||
// Set output API for this driver
|
||||
virtual void SetApiSettings(wxString api) = 0;
|
||||
|
||||
// Saves settings to the INI file for this driver
|
||||
virtual void WriteSettings() const = 0;
|
||||
|
||||
// Returns the number of empty samples in the output buffer.
|
||||
// (which is effectively the amount of data played since the last update)
|
||||
|
|
|
@ -134,7 +134,7 @@ public:
|
|||
DestroyContextAndStream();
|
||||
}
|
||||
|
||||
s32 Init() override
|
||||
bool Init() override
|
||||
{
|
||||
ReadSettings();
|
||||
|
||||
|
@ -145,8 +145,8 @@ public:
|
|||
m_COMInitializedByUs = SUCCEEDED(hr);
|
||||
if (FAILED(hr) && hr != RPC_E_CHANGED_MODE)
|
||||
{
|
||||
Console.Error("Failed to initialize COM");
|
||||
return -1;
|
||||
Console.Error("(Cubeb) Failed to initialize COM");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -157,8 +157,8 @@ public:
|
|||
int rv = cubeb_init(&m_context, "PCSX2", m_Backend.empty() ? nullptr : m_Backend.c_str());
|
||||
if (rv != CUBEB_OK)
|
||||
{
|
||||
Console.Error("Could not initialize cubeb context: %d", rv);
|
||||
return -1;
|
||||
Console.Error("(Cubeb) Could not initialize cubeb context: %d", rv);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (numSpeakers) // speakers = (numSpeakers + 1) *2; ?
|
||||
|
@ -255,9 +255,9 @@ public:
|
|||
{
|
||||
if (rv != CUBEB_OK)
|
||||
{
|
||||
Console.Error("Could not get minimum latency: %d", rv);
|
||||
Console.Error("(Cubeb) Could not get minimum latency: %d", rv);
|
||||
DestroyContextAndStream();
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
const float minimum_latency_ms = static_cast<float>(latency_frames * 1000u) / static_cast<float>(SampleRate);
|
||||
|
@ -283,20 +283,20 @@ public:
|
|||
latency_frames, &Cubeb::DataCallback, &Cubeb::StateCallback, this);
|
||||
if (rv != CUBEB_OK)
|
||||
{
|
||||
Console.Error("Could not create stream: %d", rv);
|
||||
Console.Error("(Cubeb) Could not create stream: %d", rv);
|
||||
DestroyContextAndStream();
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
rv = cubeb_stream_start(stream);
|
||||
if (rv != CUBEB_OK)
|
||||
{
|
||||
Console.Error("Could not start stream: %d", rv);
|
||||
Console.Error("(Cubeb) Could not start stream: %d", rv);
|
||||
DestroyContextAndStream();
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Close() override
|
||||
|
@ -314,16 +314,6 @@ public:
|
|||
return nframes;
|
||||
}
|
||||
|
||||
|
||||
void Configure(uptr parent) override
|
||||
{
|
||||
}
|
||||
|
||||
s32 Test() const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetEmptySampleCount() override
|
||||
{
|
||||
u64 pos;
|
||||
|
@ -346,7 +336,7 @@ public:
|
|||
return L"Cubeb (Cross-platform)";
|
||||
}
|
||||
|
||||
void ReadSettings() override
|
||||
void ReadSettings()
|
||||
{
|
||||
m_SuggestedLatencyMinimal = CfgReadBool(L"Cubeb", L"MinimalSuggestedLatency", false);
|
||||
m_SuggestedLatencyMS = std::clamp(CfgReadInt(L"Cubeb", L"ManualSuggestedLatencyMS", MINIMUM_LATENCY_MS), MINIMUM_LATENCY_MS, MAXIMUM_LATENCY_MS);
|
||||
|
@ -356,14 +346,6 @@ public:
|
|||
CfgReadStr(L"Cubeb", L"BackendName", backend, L"");
|
||||
m_Backend = StringUtil::wxStringToUTF8String(backend);
|
||||
}
|
||||
|
||||
void SetApiSettings(wxString api) override
|
||||
{
|
||||
}
|
||||
|
||||
void WriteSettings() const override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static Cubeb s_Cubeb;
|
||||
|
|
|
@ -218,7 +218,7 @@ private:
|
|||
std::unique_ptr<BaseStreamingVoice> m_voiceContext;
|
||||
|
||||
public:
|
||||
s32 Init() override
|
||||
bool Init() override
|
||||
{
|
||||
xaudio2CoInitialize = wil::CoInitializeEx_failfast(COINIT_MULTITHREADED);
|
||||
|
||||
|
@ -321,10 +321,10 @@ public:
|
|||
{
|
||||
SysMessage(ex.what());
|
||||
Close();
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Close() override
|
||||
|
@ -342,15 +342,6 @@ public:
|
|||
xaudio2CoInitialize.reset();
|
||||
}
|
||||
|
||||
void Configure(uptr parent) override
|
||||
{
|
||||
}
|
||||
|
||||
s32 Test() const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetEmptySampleCount() override
|
||||
{
|
||||
if (m_voiceContext == nullptr)
|
||||
|
@ -368,18 +359,6 @@ public:
|
|||
return L"XAudio 2 (Recommended)";
|
||||
}
|
||||
|
||||
void ReadSettings() override
|
||||
{
|
||||
}
|
||||
|
||||
void SetApiSettings(wxString api) override
|
||||
{
|
||||
}
|
||||
|
||||
void WriteSettings() const override
|
||||
{
|
||||
}
|
||||
|
||||
} static XA2;
|
||||
|
||||
SndOutModule* XAudio2Out = &XA2;
|
||||
|
|
Loading…
Reference in New Issue