wavelength 1.0.0
Loading...
Searching...
No Matches
NoteMuseBase Class Reference

Muse that plays one note. More...

#include <notemusebase.h>

Inheritance diagram for NoteMuseBase:
Collaboration diagram for NoteMuseBase:

Classes

class  NoteCommand
 Command that sends the note on and, the second time it runs, the note off. More...

Public Member Functions

 NoteMuseBase (unsigned char nNote, unsigned char nVelocity, int nDuration, unsigned char nChannel)
 Construct a note.
 ~NoteMuseBase () override
 Silence the note and release the command.
void Play (Scheduler *pScheduler) override
 Play the note at once.
void PlayFrom (Scheduler *pScheduler, int nOffset) override
 Play the note after the ticks a negative offset delays it.
void PlayWindow (Scheduler *pScheduler, int nStart, int nEnd) override
 Play the note like PlayFrom() when the window is not empty.
void Stop () override
 Withdraw the queued note and silence it.
bool IsPlaying () override
 Report whether the note waits to sound or sounds.
int GetLength () override
 Report the length of the note.
void SetNoteCB (NoteCB *pNoteCB) override
 Set the receiver of the note.
Public Member Functions inherited from Muse
 ~Muse () override
 Release the muse.
virtual Muse * Clone ()=0
 Produce a copy of the muse on the heap.
Public Member Functions inherited from Attachment
 Attachment ()
 Construct an object with no reference.
virtual ~Attachment ()
 Release the object.
void AddRef ()
 Take one reference.
void Release ()
 Give back one reference and delete the object once the last one is gone.

Protected Attributes

unsigned char mNote
unsigned char mVelocity
unsigned char mChannel
unsigned char mSounding
int mDuration
Ptr< NoteCommand > mCmd
NoteCB * mNoteCB

Additional Inherited Members

Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.

Detailed Description

Muse that plays one note.

The RTTI includes the class name and records Muse as the base, and the nested NoteMuseBase::NoteCommand. Clone() is pure in this class. Playing posts the command twice, once for the note on and once for the note off after the length of the note.

Constructor & Destructor Documentation

◆ NoteMuseBase()

NoteMuseBase::NoteMuseBase ( unsigned char nNote,
unsigned char nVelocity,
int nDuration,
unsigned char nChannel )

Construct a note.

Parameters
nNoteThe MIDI note number.
nVelocityThe MIDI velocity.
nDurationThe length in ticks.
nChannelThe MIDI channel.
Ghidra address:
NTSC-U/C: 0x0015b778
Ghidra address:
PAL: 0x0015cf68

◆ ~NoteMuseBase()

NoteMuseBase::~NoteMuseBase ( )
override

Silence the note and release the command.

Ghidra address:
NTSC-U/C: 0x0015b810
Ghidra address:
PAL: 0x0015d000

Member Function Documentation

◆ Play()

void NoteMuseBase::Play ( Scheduler * pScheduler)
overridevirtual

Play the note at once.

Parameters
pSchedulerThe scheduler that plays the note.
Ghidra address:
NTSC-U/C: 0x0015b8c0
Ghidra address:
PAL: 0x0015d0b0

Implements Muse.

◆ PlayFrom()

void NoteMuseBase::PlayFrom ( Scheduler * pScheduler,
int nOffset )
overridevirtual

Play the note after the ticks a negative offset delays it.

A positive offset plays nothing.

Parameters
pSchedulerThe scheduler that plays the note.
nOffsetThe offset in ticks.
Ghidra address:
NTSC-U/C: 0x0015b938
Ghidra address:
PAL: 0x0015d128

Implements Muse.

◆ PlayWindow()

void NoteMuseBase::PlayWindow ( Scheduler * pScheduler,
int nStart,
int nEnd )
overridevirtual

Play the note like PlayFrom() when the window is not empty.

Parameters
pSchedulerThe scheduler that plays the note.
nStartThe first tick of the window.
nEndThe tick after the window.
Ghidra address:
NTSC-U/C: 0x0015b9d8
Ghidra address:
PAL: 0x0015d1c8

Implements Muse.

◆ Stop()

void NoteMuseBase::Stop ( )
overridevirtual

Withdraw the queued note and silence it.

Ghidra address:
NTSC-U/C: 0x0015ba80
Ghidra address:
PAL: 0x0015d270

Implements Muse.

◆ IsPlaying()

bool NoteMuseBase::IsPlaying ( )
overridevirtual

Report whether the note waits to sound or sounds.

Returns
Whether the note plays.
Ghidra address:
NTSC-U/C: 0x0015bad8
Ghidra address:
PAL: 0x0015d2c8

Implements Muse.

◆ GetLength()

int NoteMuseBase::GetLength ( )
inlineoverridevirtual

Report the length of the note.

Returns
The length in ticks.
Ghidra address:
NTSC-U/C: 0x0034ea60
Ghidra address:
PAL: 0x003bbe88

Implements Muse.

◆ SetNoteCB()

void NoteMuseBase::SetNoteCB ( NoteCB * pNoteCB)
overridevirtual

Set the receiver of the note.

Parameters
pNoteCBThe receiver, or null.
Ghidra address:
NTSC-U/C: 0x0015bb00
Ghidra address:
PAL: 0x0015d2f0

Implements Muse.

Member Data Documentation

◆ mNote

unsigned char NoteMuseBase::mNote
protected

The MIDI note number.

◆ mVelocity

unsigned char NoteMuseBase::mVelocity
protected

The MIDI velocity.

◆ mChannel

unsigned char NoteMuseBase::mChannel
protected

The MIDI channel.

◆ mSounding

unsigned char NoteMuseBase::mSounding
protected

Whether the note on was sent and the note off was not.

◆ mDuration

int NoteMuseBase::mDuration
protected

The length in ticks.

◆ mCmd

Ptr<NoteCommand> NoteMuseBase::mCmd
protected

The command that sends the note.

◆ mNoteCB

NoteCB* NoteMuseBase::mNoteCB
protected

The receiver of the note, or null.


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