Skip to content

Commit

Permalink
[Audio] Start to add OpenSLES Driver
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed Sep 12, 2017
1 parent 138cb76 commit 78d89cd
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/Project64-audio/AudioMain.cpp
Expand Up @@ -17,6 +17,7 @@
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
#endif
#include <Project64-audio/Driver/OpenSLES.h>
#include "audio_1.1.h"
#include "Version.h"
#include <stdio.h>
Expand Down Expand Up @@ -104,6 +105,8 @@ SLAndroidSimpleBufferQueueItf g_bufferQueue = NULL;

bool g_PluginInit = false;

OpenSLESDriver * g_SoundDriver = NULL;

void PluginInit(void)
{
if (g_PluginInit)
Expand Down Expand Up @@ -771,7 +774,14 @@ EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo)
EXPORT int32_t CALL InitiateAudio(AUDIO_INFO Audio_Info)
{
WriteTrace(TraceAudioInterface, TraceDebug, "Start");
if (g_SoundDriver != NULL)
{
delete g_SoundDriver;
}
g_AudioInfo = Audio_Info;
#ifdef ANDROID
g_SoundDriver = new OpenSLESDriver;
#endif
WriteTrace(TraceAudioInterface, TraceDebug, "Done (res: true)");
return true;
}
Expand Down
15 changes: 15 additions & 0 deletions Source/Project64-audio/Driver/OpenSLES.cpp
@@ -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 *
* *
****************************************************************************/
24 changes: 24 additions & 0 deletions Source/Project64-audio/Driver/OpenSLES.h
@@ -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
{
};
12 changes: 12 additions & 0 deletions Source/Project64-audio/Driver/SoundBase.cpp
@@ -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"
17 changes: 17 additions & 0 deletions Source/Project64-audio/Driver/SoundBase.h
@@ -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:
};
4 changes: 4 additions & 0 deletions Source/Project64-audio/Project64-audio.vcxproj
Expand Up @@ -38,12 +38,16 @@
<ItemGroup>
<ClCompile Include="AudioMain.cpp" />
<ClCompile Include="AudioSettings.cpp" />
<ClCompile Include="Driver\OpenSLES.cpp" />
<ClCompile Include="Driver\SoundBase.cpp" />
<ClCompile Include="trace.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AudioMain.h" />
<ClInclude Include="Audio_1.1.h" />
<ClInclude Include="AudioSettings.h" />
<ClInclude Include="Driver\OpenSLES.h" />
<ClInclude Include="Driver\SoundBase.h" />
<ClInclude Include="SettingsID.h" />
<ClInclude Include="trace.h" />
<ClInclude Include="Version.h" />
Expand Down
18 changes: 18 additions & 0 deletions Source/Project64-audio/Project64-audio.vcxproj.filters
Expand Up @@ -13,6 +13,12 @@
<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>
</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>
<ClCompile Include="trace.cpp">
Expand All @@ -24,6 +30,12 @@
<ClCompile Include="AudioMain.cpp">
<Filter>Source Files</Filter>
</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>
<ClInclude Include="Audio_1.1.h">
Expand All @@ -44,5 +56,11 @@
<ClInclude Include="SettingsID.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Driver\SoundBase.h">
<Filter>Header Files\Driver</Filter>
</ClInclude>
<ClInclude Include="Driver\OpenSLES.h">
<Filter>Header Files\Driver</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit 78d89cd

Please sign in to comment.