gzdoom/src/oplsynth/opl_mus_player.h
Chris Robinson 0017e1e6e8 Use a FileReader to handle music resources and audio decoding
Instead of the previous method where there'd be a filename and offset, and/or a
memory pointer, this uses a class to access resource data regardless of its
underlying form.
2014-06-25 04:25:36 -07:00

48 lines
908 B
C++

#include "critsec.h"
#include "muslib.h"
class OPLmusicBlock : public musicBlock
{
public:
OPLmusicBlock();
virtual ~OPLmusicBlock();
bool ServiceStream(void *buff, int numbytes);
void ResetChips();
virtual void Restart();
protected:
virtual int PlayTick() = 0;
void OffsetSamples(float *buff, int count);
double NextTickIn;
double SamplesPerTick;
int NumChips;
bool Looping;
double LastOffset;
bool FullPan;
FCriticalSection ChipAccess;
};
class OPLmusicFile : public OPLmusicBlock
{
public:
OPLmusicFile(FileReader *reader);
OPLmusicFile(const OPLmusicFile *source, const char *filename);
virtual ~OPLmusicFile();
bool IsValid() const;
void SetLooping(bool loop);
void Restart();
void Dump();
protected:
OPLmusicFile() {}
int PlayTick();
enum { RDosPlay, IMF, DosBox1, DosBox2 } RawPlayer;
int ScoreLen;
int WhichChip;
};