wavelength 1.0.0
Loading...
Searching...
No Matches
mutablenotemuse.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5#include "gs/notemusebase.h"
6#include "os/mem.h"
7
16public:
27 MutableNoteMuse(unsigned char nNote,
28 unsigned char nVelocity,
29 int nDuration,
30 unsigned char nChannel);
31
38 static void *operator new(size_t nSize) {
39 return PoolAlloc(static_cast<int>(nSize), sizeof(MutableNoteMuse), "MuteNoteMuse", 0);
40 }
41
47 static void operator delete(void *pBlock) {
48 PoolFree(sizeof(MutableNoteMuse), pBlock);
49 }
50
57 ~MutableNoteMuse() override;
58
66 void Play(Scheduler *pScheduler) override;
67
76 void PlayFrom(Scheduler *pScheduler, int nOffset) override;
77
87 void PlayWindow(Scheduler *pScheduler, int nStart, int nEnd) override;
88
96 Muse *Clone() override;
97
105 void SetNote(unsigned char nNote);
106
107private:
108 unsigned char mNextNote;
109};
Piece of MIDI performance that a Scheduler plays.
Definition muse.h:12
void PlayWindow(Scheduler *pScheduler, int nStart, int nEnd) override
Play the note when it falls in a window.
void SetNote(unsigned char nNote)
Set the note the muse plays from now on.
void PlayFrom(Scheduler *pScheduler, int nOffset) override
Play with the note moved by an offset.
MutableNoteMuse(unsigned char nNote, unsigned char nVelocity, int nDuration, unsigned char nChannel)
Construct a note.
void Play(Scheduler *pScheduler) override
Play from the start.
~MutableNoteMuse() override
Release the note.
Muse * Clone() override
Produce a copy of the note on the heap.
NoteMuseBase(unsigned char nNote, unsigned char nVelocity, int nDuration, unsigned char nChannel)
Construct a note.
Queue of commands that run when the song clock reaches their tick.
Definition scheduler.h:20
void * PoolAlloc(int nSize, int nBlockSize, const char *pszTag, int nUnused)
Allocate a block from the small-block pool and bill it to a tag.
void PoolFree(int nSize, void *pBlock)
Return a block to the small-block pool.