mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Remove glue drivers, use Gp drivers instead
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ClientAudioChannelContext
|
||||
{
|
||||
public:
|
||||
virtual void NotifyBufferFinished() = 0;
|
||||
};
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
#include "DialogManager.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
#include "IconLoader.h"
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "PLArrayView.h"
|
||||
#include "PLBigEndian.h"
|
||||
|
@@ -19,9 +19,10 @@
|
||||
|
||||
#endif
|
||||
|
||||
struct IGpAudioDriver;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class HostAudioDriver;
|
||||
class HostFileSystem;
|
||||
class HostDisplayDriver;
|
||||
class HostSystemServices;
|
||||
@@ -38,12 +39,13 @@ public:
|
||||
virtual void PL_IncrementTickCounter(uint32_t count) = 0;
|
||||
virtual void PL_Render(IGpDisplayDriver *displayDriver) = 0;
|
||||
virtual void PL_HostFileSystem_SetInstance(PortabilityLayer::HostFileSystem *instance) = 0;
|
||||
virtual void PL_HostDisplayDriver_SetInstance(PortabilityLayer::HostDisplayDriver *instance) = 0;
|
||||
virtual void PL_HostDisplayDriver_SetInstance(IGpDisplayDriver *instance) = 0;
|
||||
virtual void PL_HostSystemServices_SetInstance(PortabilityLayer::HostSystemServices *instance) = 0;
|
||||
virtual void PL_HostAudioDriver_SetInstance(PortabilityLayer::HostAudioDriver *instance) = 0;
|
||||
virtual void PL_HostFontHandler_SetInstance(PortabilityLayer::HostFontHandler *instance) = 0;
|
||||
virtual void PL_HostVOSEventQueue_SetInstance(PortabilityLayer::HostVOSEventQueue *instance) = 0;
|
||||
virtual void PL_InstallHostSuspendHook(PortabilityLayer::HostSuspendHook_t hook, void *context) = 0;
|
||||
|
||||
virtual void PL_HostAudioDriver_SetInstance(IGpAudioDriver *instance) = 0;
|
||||
};
|
||||
|
||||
GP_APP_DLL_EXPORT_API GpAppInterface *GpAppInterface_Get();
|
||||
|
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ClientAudioChannelContext;
|
||||
|
||||
class HostAudioChannel
|
||||
{
|
||||
public:
|
||||
virtual void SetClientAudioChannelContext(ClientAudioChannelContext *context) = 0;
|
||||
virtual void PostBuffer(const void *buffer, size_t bufferSize) = 0;
|
||||
virtual void Stop() = 0;
|
||||
virtual void Destroy() = 0;
|
||||
};
|
||||
}
|
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
HostAudioDriver *HostAudioDriver::GetInstance()
|
||||
IGpAudioDriver *HostAudioDriver::GetInstance()
|
||||
{
|
||||
return ms_instance;
|
||||
}
|
||||
|
||||
void HostAudioDriver::SetInstance(HostAudioDriver *instance)
|
||||
void HostAudioDriver::SetInstance(IGpAudioDriver *instance)
|
||||
{
|
||||
ms_instance = instance;
|
||||
}
|
||||
|
||||
HostAudioDriver *HostAudioDriver::ms_instance;
|
||||
IGpAudioDriver *HostAudioDriver::ms_instance;
|
||||
}
|
||||
|
@@ -1,21 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
struct IGpAudioDriver;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class HostAudioChannel;
|
||||
|
||||
class HostAudioDriver
|
||||
{
|
||||
public:
|
||||
virtual HostAudioChannel *CreateChannel() = 0;
|
||||
virtual void SetMasterVolume(uint32_t vol, uint32_t maxVolume) = 0;
|
||||
|
||||
static HostAudioDriver *GetInstance();
|
||||
static void SetInstance(HostAudioDriver *instance);
|
||||
static IGpAudioDriver *GetInstance();
|
||||
static void SetInstance(IGpAudioDriver *instance);
|
||||
|
||||
private:
|
||||
static HostAudioDriver *ms_instance;
|
||||
static IGpAudioDriver *ms_instance;
|
||||
};
|
||||
}
|
||||
|
@@ -2,15 +2,15 @@
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
HostDisplayDriver *HostDisplayDriver::GetInstance()
|
||||
IGpDisplayDriver *HostDisplayDriver::GetInstance()
|
||||
{
|
||||
return ms_instance;
|
||||
}
|
||||
|
||||
void HostDisplayDriver::SetInstance(HostDisplayDriver *instance)
|
||||
void HostDisplayDriver::SetInstance(IGpDisplayDriver *instance)
|
||||
{
|
||||
ms_instance = instance;
|
||||
}
|
||||
|
||||
HostDisplayDriver *HostDisplayDriver::ms_instance;
|
||||
IGpDisplayDriver *HostDisplayDriver::ms_instance;
|
||||
}
|
||||
|
@@ -6,22 +6,18 @@
|
||||
#include "EGpStandardCursor.h"
|
||||
|
||||
struct IGpColorCursor;
|
||||
struct IGpDisplayDriver;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class HostDisplayDriver
|
||||
{
|
||||
public:
|
||||
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height, GpPixelFormat_t *pixelFormat) = 0;
|
||||
virtual IGpColorCursor *LoadColorCursor(int id) = 0;
|
||||
virtual void SetColorCursor(IGpColorCursor *colorCursor) = 0;
|
||||
virtual void SetStandardCursor(EGpStandardCursor_t standardCursor) = 0;
|
||||
|
||||
static void SetInstance(HostDisplayDriver *instance);
|
||||
static HostDisplayDriver *GetInstance();
|
||||
static void SetInstance(IGpDisplayDriver *instance);
|
||||
static IGpDisplayDriver *GetInstance();
|
||||
|
||||
private:
|
||||
static HostDisplayDriver *ms_instance;
|
||||
static IGpDisplayDriver *ms_instance;
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include "HostSystemServices.h"
|
||||
#include "HostVOSEventQueue.h"
|
||||
#include "IGpColorCursor.h"
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "InputManager.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "MacFileInfo.h"
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#include "PLSound.h"
|
||||
|
||||
#include "ClientAudioChannelContext.h"
|
||||
#include "HostAudioChannel.h"
|
||||
#include "HostAudioDriver.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "HostMutex.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "HostThreadEvent.h"
|
||||
#include "IGpAudioChannel.h"
|
||||
#include "IGpAudioChannelCallbacks.h"
|
||||
#include "IGpAudioDriver.h"
|
||||
#include "WaveFormat.h"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -36,10 +37,10 @@ namespace PortabilityLayer
|
||||
AudioCommandParam m_param;
|
||||
};
|
||||
|
||||
class AudioChannelImpl final : public AudioChannel, public ClientAudioChannelContext
|
||||
class AudioChannelImpl final : public AudioChannel, public IGpAudioChannelCallbacks
|
||||
{
|
||||
public:
|
||||
explicit AudioChannelImpl(PortabilityLayer::HostAudioChannel *channel, HostThreadEvent *threadEvent, HostMutex *mutex);
|
||||
explicit AudioChannelImpl(IGpAudioChannel *channel, HostThreadEvent *threadEvent, HostMutex *mutex);
|
||||
~AudioChannelImpl();
|
||||
|
||||
void Destroy(bool wait) override;
|
||||
@@ -70,7 +71,7 @@ namespace PortabilityLayer
|
||||
void DigestQueueItems();
|
||||
void DigestBufferCommand(const void *dataPointer);
|
||||
|
||||
PortabilityLayer::HostAudioChannel *m_audioChannel;
|
||||
IGpAudioChannel *m_audioChannel;
|
||||
|
||||
HostMutex *m_mutex;
|
||||
HostThreadEvent *m_threadEvent;
|
||||
@@ -83,7 +84,7 @@ namespace PortabilityLayer
|
||||
bool m_isIdle;
|
||||
};
|
||||
|
||||
AudioChannelImpl::AudioChannelImpl(PortabilityLayer::HostAudioChannel *channel, HostThreadEvent *threadEvent, HostMutex *mutex)
|
||||
AudioChannelImpl::AudioChannelImpl(IGpAudioChannel *channel, HostThreadEvent *threadEvent, HostMutex *mutex)
|
||||
: m_audioChannel(channel)
|
||||
, m_threadEvent(threadEvent)
|
||||
, m_mutex(mutex)
|
||||
@@ -93,7 +94,7 @@ namespace PortabilityLayer
|
||||
, m_state(State_Idle)
|
||||
, m_isIdle(false)
|
||||
{
|
||||
m_audioChannel->SetClientAudioChannelContext(this);
|
||||
m_audioChannel->SetAudioChannelContext(this);
|
||||
}
|
||||
|
||||
AudioChannelImpl::~AudioChannelImpl()
|
||||
@@ -357,8 +358,8 @@ namespace PortabilityLayer
|
||||
if (!storage)
|
||||
return nullptr;
|
||||
|
||||
PortabilityLayer::HostAudioDriver *audioDriver = PortabilityLayer::HostAudioDriver::GetInstance();
|
||||
PortabilityLayer::HostAudioChannel *audioChannel = audioDriver->CreateChannel();
|
||||
IGpAudioDriver *audioDriver = PortabilityLayer::HostAudioDriver::GetInstance();
|
||||
IGpAudioChannel *audioChannel = audioDriver->CreateChannel();
|
||||
if (!audioChannel)
|
||||
{
|
||||
mm->Release(storage);
|
||||
|
@@ -147,7 +147,6 @@
|
||||
<ClInclude Include="ByteSwap.h" />
|
||||
<ClInclude Include="ByteUnpack.h" />
|
||||
<ClInclude Include="CFileStream.h" />
|
||||
<ClInclude Include="ClientAudioChannelContext.h" />
|
||||
<ClInclude Include="DataTypes.h" />
|
||||
<ClInclude Include="DeflateCodec.h" />
|
||||
<ClInclude Include="DialogManager.h" />
|
||||
@@ -161,7 +160,6 @@
|
||||
<ClInclude Include="FontRenderer.h" />
|
||||
<ClInclude Include="GpAppInterface.h" />
|
||||
<ClInclude Include="GPArchive.h" />
|
||||
<ClInclude Include="HostAudioChannel.h" />
|
||||
<ClInclude Include="HostAudioDriver.h" />
|
||||
<ClInclude Include="HostDirectoryCursor.h" />
|
||||
<ClInclude Include="HostFont.h" />
|
||||
|
@@ -285,15 +285,9 @@
|
||||
<ClInclude Include="HostAudioDriver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ClientAudioChannelContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HostMutex.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HostAudioChannel.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HostThreadEvent.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
Reference in New Issue
Block a user