2008-04-09 04:17:13 +00:00
|
|
|
#include "critsec.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "muslib.h"
|
|
|
|
#include "files.h"
|
|
|
|
|
|
|
|
class OPLmusicBlock : public musicBlock
|
|
|
|
{
|
|
|
|
public:
|
2008-03-28 03:19:18 +00:00
|
|
|
OPLmusicBlock();
|
2008-04-03 22:34:52 +00:00
|
|
|
virtual ~OPLmusicBlock();
|
2008-03-28 03:19:18 +00:00
|
|
|
|
|
|
|
bool ServiceStream(void *buff, int numbytes);
|
|
|
|
void ResetChips();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-03-28 03:19:18 +00:00
|
|
|
virtual void Restart();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
protected:
|
2008-03-28 03:19:18 +00:00
|
|
|
virtual int PlayTick() = 0;
|
|
|
|
|
|
|
|
double NextTickIn;
|
|
|
|
double SamplesPerTick;
|
2006-02-24 04:48:15 +00:00
|
|
|
bool TwoChips;
|
|
|
|
bool Looping;
|
|
|
|
|
2008-04-09 04:17:13 +00:00
|
|
|
FCriticalSection ChipAccess;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
2008-03-28 03:19:18 +00:00
|
|
|
|
|
|
|
class OPLmusicFile : public OPLmusicBlock
|
|
|
|
{
|
|
|
|
public:
|
2008-04-03 02:31:39 +00:00
|
|
|
OPLmusicFile(FILE *file, char *musiccache, int len);
|
|
|
|
OPLmusicFile(const OPLmusicFile *source, const char *filename);
|
2008-04-03 22:34:52 +00:00
|
|
|
virtual ~OPLmusicFile();
|
2008-03-28 03:19:18 +00:00
|
|
|
|
|
|
|
bool IsValid() const;
|
|
|
|
void SetLooping(bool loop);
|
|
|
|
void Restart();
|
2008-04-03 02:31:39 +00:00
|
|
|
void Dump();
|
2008-03-28 03:19:18 +00:00
|
|
|
|
|
|
|
protected:
|
2008-04-03 02:31:39 +00:00
|
|
|
OPLmusicFile() {}
|
2008-03-28 03:19:18 +00:00
|
|
|
int PlayTick();
|
|
|
|
|
2008-04-03 02:31:39 +00:00
|
|
|
enum { RDosPlay, IMF, DosBox } RawPlayer;
|
2008-03-28 03:19:18 +00:00
|
|
|
int ScoreLen;
|
2008-04-03 02:31:39 +00:00
|
|
|
int WhichChip;
|
2008-03-28 03:19:18 +00:00
|
|
|
};
|