2008-04-09 04:17:13 +00:00
|
|
|
#include "critsec.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "muslib.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;
|
2008-04-29 04:33:43 +00:00
|
|
|
void OffsetSamples(float *buff, int count);
|
2008-03-28 03:19:18 +00:00
|
|
|
|
|
|
|
double NextTickIn;
|
|
|
|
double SamplesPerTick;
|
2012-11-06 06:10:04 +00:00
|
|
|
int NumChips;
|
2006-02-24 04:48:15 +00:00
|
|
|
bool Looping;
|
2008-04-29 04:33:43 +00:00
|
|
|
double LastOffset;
|
2012-11-08 05:45:58 +00:00
|
|
|
bool FullPan;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
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:
|
2014-06-25 11:25:36 +00:00
|
|
|
OPLmusicFile(FileReader *reader);
|
2008-04-03 02:31:39 +00:00
|
|
|
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();
|
|
|
|
|
2010-05-30 19:23:53 +00:00
|
|
|
enum { RDosPlay, IMF, DosBox1, DosBox2 } 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
|
|
|
};
|