Commit 71cbcef6 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Update

parent 5de4db03
......@@ -28,7 +28,9 @@
#include <mednafen/mednafen.h>
#include "CDAFReader.h"
#include "CDAFReader_Vorbis.h"
#ifdef HAVE_MPC
#include "CDAFReader_MPC.h"
#endif
CDAFReader::CDAFReader() : LastReadPos(0)
{
......@@ -40,19 +42,32 @@ CDAFReader::~CDAFReader()
}
CDAFReader *CDAFR_Open(Stream *fp)
enum
{
static CDAFReader* (* const OpenFuncs[])(Stream* fp) =
{
AUDIO_VORBIS = 0,
#ifdef HAVE_MPC
CDAFR_MPC_Open,
AUDIO_MPC,
#endif
CDAFR_Vorbis_Open
};
AUDIO_LAST
};
for(auto const& f : OpenFuncs)
CDAFReader *CDAFR_Open(Stream *fp)
{
unsigned i;
for (i = 0; i < AUDIO_LAST; i++)
{
return f(fp);
switch (i)
{
case AUDIO_VORBIS:
return CDAFR_Vorbis_Open(fp);
#ifdef HAVE_MPC
case AUDIO_MPC:
return CDAFR_MPC_Open(fp);
#endif
default:
break;
}
}
return(NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment