LMMS
Loading...
Searching...
No Matches
CrolPlayer Class Reference

#include <rol.h>

Inheritance diagram for CrolPlayer:
CPlayer

Classes

struct  SRolHeader
struct  STempoEvent
struct  SNoteEvent
struct  SInstrumentEvent
struct  SVolumeEvent
struct  SPitchEvent
class  CVoiceData
struct  SInstrumentName
struct  SBnkHeader
struct  SFMOperator
struct  SOPL2Op
struct  SRolInstrument
struct  SInstrument
class  StringCompare

Public Member Functions

 CrolPlayer (Copl *const pNewOpl)
virtual ~CrolPlayer ()
virtual bool load (const std::string &filename, const CFileProvider &fp)
virtual bool update ()
virtual void rewind (int subsong)
virtual float getrefresh ()
virtual std::string gettype ()
virtual unsigned int getinstruments ()
virtual std::string getinstrument (unsigned int n)
virtual std::string getdesc ()
Public Member Functions inherited from CPlayer
 CPlayer (Copl *newopl)
virtual ~CPlayer ()
void seek (unsigned long ms)
unsigned long songlength (int subsong=-1)
virtual std::string gettitle ()
virtual std::string getauthor ()
virtual unsigned int getpatterns ()
virtual unsigned int getpattern ()
virtual unsigned int getorders ()
virtual unsigned int getorder ()
virtual unsigned int getrow ()
virtual unsigned int getspeed ()
virtual unsigned int getsubsongs ()
virtual unsigned int getsubsong ()

Static Public Member Functions

static CPlayerfactory (Copl *pNewOpl)

Private Types

typedef signed char int8_t
typedef short int16_t
typedef int int32_t
typedef unsigned char uint8_t
typedef unsigned short uint16_t
typedef unsigned int uint32_t
typedef signed long int int32
typedef std::vector< SNoteEventTNoteEvents
typedef std::vector< SInstrumentEventTInstrumentEvents
typedef std::vector< SVolumeEventTVolumeEvents
typedef std::vector< SPitchEventTPitchEvents
typedef std::vector< SInstrumentNameTInstrumentNames
typedef uint16_t constTUint16ConstPtr
typedef std::vector< STempoEventTTempoEvents
typedef std::vector< CVoiceDataTVoiceData
typedef std::vector< SInstrumentTInstrumentList
typedef std::vector< TUint16ConstPtrTUint16PtrVector
typedef std::vector< int16_tTInt16Vector
typedef std::vector< uint8_tTUInt8Vector
typedef std::vector< bool > TBoolVector
typedef std::vector< std::string > TStringVector

Private Member Functions

void load_tempo_events (binistream *f)
bool load_voice_data (binistream *f, std::string const &bnk_filename, CFileProvider const &fp)
void load_note_events (binistream *f, CVoiceData &voice)
void load_instrument_events (binistream *f, CVoiceData &voice, binistream *bnk_file, SBnkHeader const &bnk_header)
void load_volume_events (binistream *f, CVoiceData &voice)
void load_pitch_events (binistream *f, CVoiceData &voice)
bool load_bnk_info (binistream *f, SBnkHeader &header)
int load_rol_instrument (binistream *f, SBnkHeader const &header, std::string const &name)
void read_rol_instrument (binistream *f, SRolInstrument &ins)
void read_fm_operator (binistream *f, SOPL2Op &opl2_op)
int get_ins_index (std::string const &name) const
void UpdateVoice (int const voice, CVoiceData &voiceData)
void SetNote (int const voice, int const note)
void SetNoteMelodic (int const voice, int const note)
void SetNotePercussive (int const voice, int const note)
void SetFreq (int const voice, int const note, bool const keyOn=false)
void ChangePitch (int voice, uint16_t const pitchBend)
void SetPitch (int const voice, float const variation)
void SetVolume (int const voice, uint8_t const volume)
void SetRefresh (float const multiplier)
uint8_t GetKSLTL (int const voice) const
void send_ins_data_to_chip (int const voice, int const ins_index)
void send_operator (int const voice, SOPL2Op const &modulator, SOPL2Op const &carrier)

Private Attributes

SRolHeadermpROLHeader
TUint16ConstPtr mpOldFNumFreqPtr
TTempoEvents mTempoEvents
TVoiceData mVoiceData
TInstrumentList mInstrumentList
TUint16PtrVector mFNumFreqPtrList
TInt16Vector mHalfToneOffset
TUInt8Vector mVolumeCache
TUInt8Vector mKSLTLCache
TUInt8Vector mNoteCache
TUInt8Vector mKOnOctFNumCache
TBoolVector mKeyOnCache
float mRefresh
int32_t mOldPitchBendLength
uint16_t mPitchRangeStep
uint16_t mNextTempoEvent
int16_t mCurrTick
int16_t mTimeOfLastNote
int16_t mOldHalfToneOffset
uint8_t mAMVibRhythmCache
TStringVector usedInstruments

Static Private Attributes

static int const kSizeofDataRecord = 30
static int const kMaxTickBeat = 60
static int const kSilenceNote = -12
static int const kNumMelodicVoices = 9
static int const kNumPercussiveVoices = 11
static int const kBassDrumChannel = 6
static int const kSnareDrumChannel = 7
static int const kTomtomChannel = 8
static int const kTomTomNote = 24
static int const kTomTomToSnare = 7
static int const kSnareNote = CrolPlayer::kTomTomNote + CrolPlayer::kTomTomToSnare
static float const kDefaultUpdateTme = 18.2f

Additional Inherited Members

Protected Attributes inherited from CPlayer
Coplopl
CAdPlugDatabasedb
Static Protected Attributes inherited from CPlayer
static const unsigned short note_table [12]
static const unsigned char op_table [9]

Member Typedef Documentation

◆ int16_t

typedef short CrolPlayer::int16_t
private

◆ int32

typedef signed long int CrolPlayer::int32
private

◆ int32_t

typedef int CrolPlayer::int32_t
private

◆ int8_t

typedef signed char CrolPlayer::int8_t
private

◆ TBoolVector

typedef std::vector<bool> CrolPlayer::TBoolVector
private

◆ TInstrumentEvents

typedef std::vector<SInstrumentEvent> CrolPlayer::TInstrumentEvents
private

◆ TInstrumentList

typedef std::vector<SInstrument> CrolPlayer::TInstrumentList
private

◆ TInstrumentNames

typedef std::vector<SInstrumentName> CrolPlayer::TInstrumentNames
private

◆ TInt16Vector

typedef std::vector<int16_t> CrolPlayer::TInt16Vector
private

◆ TNoteEvents

typedef std::vector<SNoteEvent> CrolPlayer::TNoteEvents
private

◆ TPitchEvents

typedef std::vector<SPitchEvent> CrolPlayer::TPitchEvents
private

◆ TStringVector

typedef std::vector<std::string> CrolPlayer::TStringVector
private

◆ TTempoEvents

typedef std::vector<STempoEvent> CrolPlayer::TTempoEvents
private

◆ TUint16ConstPtr

◆ TUint16PtrVector

typedef std::vector<TUint16ConstPtr> CrolPlayer::TUint16PtrVector
private

◆ TUInt8Vector

typedef std::vector<uint8_t> CrolPlayer::TUInt8Vector
private

◆ TVoiceData

typedef std::vector<CVoiceData> CrolPlayer::TVoiceData
private

◆ TVolumeEvents

typedef std::vector<SVolumeEvent> CrolPlayer::TVolumeEvents
private

◆ uint16_t

typedef unsigned short CrolPlayer::uint16_t
private

◆ uint32_t

typedef unsigned int CrolPlayer::uint32_t
private

◆ uint8_t

typedef unsigned char CrolPlayer::uint8_t
private

Constructor & Destructor Documentation

◆ CrolPlayer()

CrolPlayer::CrolPlayer ( Copl *const pNewOpl)
explicit

◆ ~CrolPlayer()

CrolPlayer::~CrolPlayer ( )
virtual

Member Function Documentation

◆ ChangePitch()

void CrolPlayer::ChangePitch ( int voice,
uint16_t const pitchBend )
private

◆ factory()

CPlayer * CrolPlayer::factory ( Copl * pNewOpl)
static

◆ get_ins_index()

int CrolPlayer::get_ins_index ( std::string const & name) const
private

◆ getdesc()

virtual std::string CrolPlayer::getdesc ( )
inlinevirtual

Reimplemented from CPlayer.

◆ getinstrument()

virtual std::string CrolPlayer::getinstrument ( unsigned int n)
inlinevirtual

Reimplemented from CPlayer.

◆ getinstruments()

virtual unsigned int CrolPlayer::getinstruments ( )
inlinevirtual

Reimplemented from CPlayer.

◆ GetKSLTL()

uint8_t CrolPlayer::GetKSLTL ( int const voice) const
private

◆ getrefresh()

float CrolPlayer::getrefresh ( )
virtual

Implements CPlayer.

◆ gettype()

virtual std::string CrolPlayer::gettype ( )
inlinevirtual

Implements CPlayer.

◆ load()

bool CrolPlayer::load ( const std::string & filename,
const CFileProvider & fp )
virtual

Implements CPlayer.

◆ load_bnk_info()

bool CrolPlayer::load_bnk_info ( binistream * f,
SBnkHeader & header )
private

◆ load_instrument_events()

void CrolPlayer::load_instrument_events ( binistream * f,
CVoiceData & voice,
binistream * bnk_file,
SBnkHeader const & bnk_header )
private

◆ load_note_events()

void CrolPlayer::load_note_events ( binistream * f,
CVoiceData & voice )
private

◆ load_pitch_events()

void CrolPlayer::load_pitch_events ( binistream * f,
CVoiceData & voice )
private

◆ load_rol_instrument()

int CrolPlayer::load_rol_instrument ( binistream * f,
SBnkHeader const & header,
std::string const & name )
private

◆ load_tempo_events()

void CrolPlayer::load_tempo_events ( binistream * f)
private

◆ load_voice_data()

bool CrolPlayer::load_voice_data ( binistream * f,
std::string const & bnk_filename,
CFileProvider const & fp )
private

◆ load_volume_events()

void CrolPlayer::load_volume_events ( binistream * f,
CVoiceData & voice )
private

◆ read_fm_operator()

void CrolPlayer::read_fm_operator ( binistream * f,
SOPL2Op & opl2_op )
private

◆ read_rol_instrument()

void CrolPlayer::read_rol_instrument ( binistream * f,
SRolInstrument & ins )
private

◆ rewind()

void CrolPlayer::rewind ( int subsong)
virtual

Implements CPlayer.

◆ send_ins_data_to_chip()

void CrolPlayer::send_ins_data_to_chip ( int const voice,
int const ins_index )
private

◆ send_operator()

void CrolPlayer::send_operator ( int const voice,
SOPL2Op const & modulator,
SOPL2Op const & carrier )
private

◆ SetFreq()

void CrolPlayer::SetFreq ( int const voice,
int const note,
bool const keyOn = false )
private

◆ SetNote()

void CrolPlayer::SetNote ( int const voice,
int const note )
private

◆ SetNoteMelodic()

void CrolPlayer::SetNoteMelodic ( int const voice,
int const note )
private

◆ SetNotePercussive()

void CrolPlayer::SetNotePercussive ( int const voice,
int const note )
private

◆ SetPitch()

void CrolPlayer::SetPitch ( int const voice,
float const variation )
private

◆ SetRefresh()

void CrolPlayer::SetRefresh ( float const multiplier)
private

◆ SetVolume()

void CrolPlayer::SetVolume ( int const voice,
uint8_t const volume )
private

◆ update()

bool CrolPlayer::update ( )
virtual

Implements CPlayer.

◆ UpdateVoice()

void CrolPlayer::UpdateVoice ( int const voice,
CVoiceData & voiceData )
private

Member Data Documentation

◆ kBassDrumChannel

int const CrolPlayer::kBassDrumChannel = 6
staticprivate

◆ kDefaultUpdateTme

float const CrolPlayer::kDefaultUpdateTme = 18.2f
staticprivate

◆ kMaxTickBeat

int const CrolPlayer::kMaxTickBeat = 60
staticprivate

◆ kNumMelodicVoices

int const CrolPlayer::kNumMelodicVoices = 9
staticprivate

◆ kNumPercussiveVoices

int const CrolPlayer::kNumPercussiveVoices = 11
staticprivate

◆ kSilenceNote

int const CrolPlayer::kSilenceNote = -12
staticprivate

◆ kSizeofDataRecord

int const CrolPlayer::kSizeofDataRecord = 30
staticprivate

◆ kSnareDrumChannel

int const CrolPlayer::kSnareDrumChannel = 7
staticprivate

◆ kSnareNote

int const CrolPlayer::kSnareNote = CrolPlayer::kTomTomNote + CrolPlayer::kTomTomToSnare
staticprivate

◆ kTomtomChannel

int const CrolPlayer::kTomtomChannel = 8
staticprivate

◆ kTomTomNote

int const CrolPlayer::kTomTomNote = 24
staticprivate

◆ kTomTomToSnare

int const CrolPlayer::kTomTomToSnare = 7
staticprivate

◆ mAMVibRhythmCache

uint8_t CrolPlayer::mAMVibRhythmCache
private

◆ mCurrTick

int16_t CrolPlayer::mCurrTick
private

◆ mFNumFreqPtrList

TUint16PtrVector CrolPlayer::mFNumFreqPtrList
private

◆ mHalfToneOffset

TInt16Vector CrolPlayer::mHalfToneOffset
private

◆ mInstrumentList

TInstrumentList CrolPlayer::mInstrumentList
private

◆ mKeyOnCache

TBoolVector CrolPlayer::mKeyOnCache
private

◆ mKOnOctFNumCache

TUInt8Vector CrolPlayer::mKOnOctFNumCache
private

◆ mKSLTLCache

TUInt8Vector CrolPlayer::mKSLTLCache
private

◆ mNextTempoEvent

uint16_t CrolPlayer::mNextTempoEvent
private

◆ mNoteCache

TUInt8Vector CrolPlayer::mNoteCache
private

◆ mOldHalfToneOffset

int16_t CrolPlayer::mOldHalfToneOffset
private

◆ mOldPitchBendLength

int32_t CrolPlayer::mOldPitchBendLength
private

◆ mPitchRangeStep

uint16_t CrolPlayer::mPitchRangeStep
private

◆ mpOldFNumFreqPtr

TUint16ConstPtr CrolPlayer::mpOldFNumFreqPtr
private

◆ mpROLHeader

SRolHeader* CrolPlayer::mpROLHeader
private

◆ mRefresh

float CrolPlayer::mRefresh
private

◆ mTempoEvents

TTempoEvents CrolPlayer::mTempoEvents
private

◆ mTimeOfLastNote

int16_t CrolPlayer::mTimeOfLastNote
private

◆ mVoiceData

TVoiceData CrolPlayer::mVoiceData
private

◆ mVolumeCache

TUInt8Vector CrolPlayer::mVolumeCache
private

◆ usedInstruments

TStringVector CrolPlayer::usedInstruments
private

The documentation for this class was generated from the following files: