Removing the last of XEDECLARECLASS.

This commit is contained in:
Ben Vanik
2014-08-20 22:50:10 -07:00
parent 06f5b8cbbf
commit 244e8a8745
15 changed files with 108 additions and 144 deletions

View File

@@ -12,14 +12,13 @@
#include <xenia/apu/audio_system.h>
XEDECLARECLASS1(xe, Emulator);
namespace xe {
class Emulator;
} // namespace xe
namespace xe {
namespace apu {
AudioSystem* Create(Emulator* emulator);
AudioSystem* CreateNop(Emulator* emulator);
@@ -31,5 +30,4 @@ AudioSystem* CreateXAudio2(Emulator* emulator);
} // namespace apu
} // namespace xe
#endif // XENIA_APU_APU_H_

View File

@@ -11,34 +11,26 @@
#define XENIA_APU_AUDIO_DRIVER_H_
#include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
XEDECLARECLASS2(xe, cpu, XenonThreadState);
namespace xe {
namespace apu {
class AudioDriver {
public:
public:
AudioDriver(Emulator* emulator);
virtual ~AudioDriver();
virtual void SubmitFrame(uint32_t samples_ptr) = 0;
protected:
Emulator* emulator_;
Memory* memory_;
cpu::Processor* processor_;
protected:
Emulator* emulator_;
Memory* memory_;
cpu::Processor* processor_;
};
} // namespace apu
} // namespace xe
#endif // XENIA_APU_AUDIO_DRIVER_H_

View File

@@ -16,19 +16,16 @@
#include <thread>
#include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
XEDECLARECLASS2(xe, cpu, XenonThreadState);
XEDECLARECLASS2(xe, apu, AudioDriver);
namespace xe {
namespace apu {
class AudioDriver;
class AudioSystem {
public:
public:
virtual ~AudioSystem();
Emulator* emulator() const { return emulator_; }
@@ -38,20 +35,22 @@ public:
virtual X_STATUS Setup();
virtual void Shutdown();
X_STATUS RegisterClient(uint32_t callback, uint32_t callback_arg, size_t* out_index);
X_STATUS RegisterClient(uint32_t callback, uint32_t callback_arg,
size_t* out_index);
void UnregisterClient(size_t index);
void SubmitFrame(size_t index, uint32_t samples_ptr);
virtual X_STATUS CreateDriver(size_t index, HANDLE wait_handle, AudioDriver** out_driver) = 0;
virtual X_STATUS CreateDriver(size_t index, HANDLE wait_handle,
AudioDriver** out_driver) = 0;
virtual void DestroyDriver(AudioDriver* driver) = 0;
virtual uint64_t ReadRegister(uint64_t addr);
virtual void WriteRegister(uint64_t addr, uint64_t value);
protected:
protected:
virtual void Initialize();
private:
private:
void ThreadStart();
static uint64_t MMIOReadRegisterThunk(AudioSystem* as, uint64_t addr) {
@@ -62,19 +61,19 @@ private:
as->WriteRegister(addr, value);
}
protected:
protected:
AudioSystem(Emulator* emulator);
Emulator* emulator_;
Memory* memory_;
cpu::Processor* processor_;
Emulator* emulator_;
Memory* memory_;
cpu::Processor* processor_;
std::thread thread_;
std::thread thread_;
cpu::XenonThreadState* thread_state_;
uint32_t thread_block_;
uint32_t thread_block_;
std::atomic<bool> running_;
std::mutex lock_;
std::mutex lock_;
static const size_t maximum_client_count_ = 8;
@@ -88,9 +87,7 @@ protected:
std::queue<size_t> unused_clients_;
};
} // namespace apu
} // namespace xe
#endif // XENIA_APU_AUDIO_SYSTEM_H_

View File

@@ -12,22 +12,19 @@
#include <xenia/core.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, apu, AudioSystem);
namespace xe {
class Emulator;
} // namespace xe
namespace xe {
namespace apu {
class AudioSystem;
namespace nop {
AudioSystem* Create(Emulator* emulator);
} // namespace nop
} // namespace apu
} // namespace xe
#endif // XENIA_APU_NOP_NOP_APU_H_