[Audio] Start to add OpenSLES Driver

This commit is contained in:
zilmar 2017-09-12 17:58:35 +10:00
parent 138cb762cd
commit 78d89cde5a
7 changed files with 100 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include <SLES/OpenSLES.h> #include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h> #include <SLES/OpenSLES_Android.h>
#endif #endif
#include <Project64-audio/Driver/OpenSLES.h>
#include "audio_1.1.h" #include "audio_1.1.h"
#include "Version.h" #include "Version.h"
#include <stdio.h> #include <stdio.h>
@ -104,6 +105,8 @@ SLAndroidSimpleBufferQueueItf g_bufferQueue = NULL;
bool g_PluginInit = false; bool g_PluginInit = false;
OpenSLESDriver * g_SoundDriver = NULL;
void PluginInit(void) void PluginInit(void)
{ {
if (g_PluginInit) if (g_PluginInit)
@ -771,7 +774,14 @@ EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo)
EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info) EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info)
{ {
WriteTrace(TraceAudioInterface, TraceDebug, "Start"); WriteTrace(TraceAudioInterface, TraceDebug, "Start");
if (g_SoundDriver != NULL)
{
delete g_SoundDriver;
}
g_AudioInfo = Audio_Info; g_AudioInfo = Audio_Info;
#ifdef ANDROID
g_SoundDriver = new OpenSLESDriver;
#endif
WriteTrace(TraceAudioInterface, TraceDebug, "Done (res: true)"); WriteTrace(TraceAudioInterface, TraceDebug, "Done (res: true)");
return true; return true;
} }

View File

@ -0,0 +1,15 @@
/****************************************************************************
* *
* Project64-audio - A Nintendo 64 audio plugin. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2017 Project64. All rights reserved. *
* Copyright (C) 2015 Gilles Siberlin *
* Copyright (C) 2007-2009 Richard Goedeken *
* Copyright (C) 2007-2008 Ebenblues *
* Copyright (C) 2003 JttL *
* Copyright (C) 2002 Hacktarux *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/

View File

@ -0,0 +1,24 @@
/****************************************************************************
* *
* Project64-audio - A Nintendo 64 audio plugin. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2017 Project64. All rights reserved. *
* Copyright (C) 2015 Gilles Siberlin *
* Copyright (C) 2007-2009 Richard Goedeken *
* Copyright (C) 2007-2008 Ebenblues *
* Copyright (C) 2003 JttL *
* Copyright (C) 2002 Hacktarux *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
#pragma once
#include "SoundBase.h"
class OpenSLESDriver :
public SoundDriverBase
{
};

View File

@ -0,0 +1,12 @@
/****************************************************************************
* *
* Project64-audio - A Nintendo 64 audio plugin. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2017 Project64. All rights reserved. *
* Copyright (C) 2000-2015 Azimer. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#include "SoundBase.h"

View File

@ -0,0 +1,17 @@
/****************************************************************************
* *
* Project64-audio - A Nintendo 64 audio plugin. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2017 Project64. All rights reserved. *
* Copyright (C) 2000-2015 Azimer. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
class SoundDriverBase
{
public:
};

View File

@ -38,12 +38,16 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="AudioMain.cpp" /> <ClCompile Include="AudioMain.cpp" />
<ClCompile Include="AudioSettings.cpp" /> <ClCompile Include="AudioSettings.cpp" />
<ClCompile Include="Driver\OpenSLES.cpp" />
<ClCompile Include="Driver\SoundBase.cpp" />
<ClCompile Include="trace.cpp" /> <ClCompile Include="trace.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="AudioMain.h" /> <ClInclude Include="AudioMain.h" />
<ClInclude Include="Audio_1.1.h" /> <ClInclude Include="Audio_1.1.h" />
<ClInclude Include="AudioSettings.h" /> <ClInclude Include="AudioSettings.h" />
<ClInclude Include="Driver\OpenSLES.h" />
<ClInclude Include="Driver\SoundBase.h" />
<ClInclude Include="SettingsID.h" /> <ClInclude Include="SettingsID.h" />
<ClInclude Include="trace.h" /> <ClInclude Include="trace.h" />
<ClInclude Include="Version.h" /> <ClInclude Include="Version.h" />

View File

@ -13,6 +13,12 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
<Filter Include="Header Files\Driver">
<UniqueIdentifier>{a8636856-b6fa-4994-9cf4-13df7c70948e}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Driver">
<UniqueIdentifier>{32a059b2-0de1-4ec7-b798-75b3e7ed19be}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="trace.cpp"> <ClCompile Include="trace.cpp">
@ -24,6 +30,12 @@
<ClCompile Include="AudioMain.cpp"> <ClCompile Include="AudioMain.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Driver\SoundBase.cpp">
<Filter>Source Files\Driver</Filter>
</ClCompile>
<ClCompile Include="Driver\OpenSLES.cpp">
<Filter>Source Files\Driver</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Audio_1.1.h"> <ClInclude Include="Audio_1.1.h">
@ -44,5 +56,11 @@
<ClInclude Include="SettingsID.h"> <ClInclude Include="SettingsID.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Driver\SoundBase.h">
<Filter>Header Files\Driver</Filter>
</ClInclude>
<ClInclude Include="Driver\OpenSLES.h">
<Filter>Header Files\Driver</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>