wavelength 1.0.0
Loading...
Searching...
No Matches
muse.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/attachment.h"
4#include "os/scheduler.h"
5
12class Muse : public Attachment {
13public:
20 class NoteCB {
21 public:
28 virtual ~NoteCB() {
29 }
30
37 virtual void OnNote(unsigned char nNote, int nDuration) = 0;
38 };
39
46 ~Muse() override {
47 }
48
54 virtual void Play(Scheduler *pScheduler) = 0;
55
62 virtual void PlayFrom(Scheduler *pScheduler, int nOffset) = 0;
63
71 virtual void PlayWindow(Scheduler *pScheduler, int nStart, int nEnd) = 0;
72
74 virtual void Stop() = 0;
75
81 virtual bool IsPlaying() = 0;
82
88 virtual int GetLength() = 0;
89
95 virtual Muse *Clone() = 0;
96
102 virtual void SetNoteCB(NoteCB *pNoteCB) = 0;
103};
Attachment()
Construct an object with no reference.
Definition attachment.h:23
Receiver of each note a muse starts.
Definition muse.h:20
virtual ~NoteCB()
Release the receiver.
Definition muse.h:28
virtual void OnNote(unsigned char nNote, int nDuration)=0
Receive a note as it starts.
Piece of MIDI performance that a Scheduler plays.
Definition muse.h:12
~Muse() override
Release the muse.
Definition muse.h:46
virtual void SetNoteCB(NoteCB *pNoteCB)=0
Set the receiver of the notes the muse starts.
virtual void Stop()=0
Withdraw every event still queued and silence the notes that sound.
virtual bool IsPlaying()=0
Report whether a note of the muse still sounds or waits to sound.
virtual void Play(Scheduler *pScheduler)=0
Play from the start.
virtual void PlayWindow(Scheduler *pScheduler, int nStart, int nEnd)=0
Play the events that fall in a window.
virtual int GetLength()=0
Report the length of the muse.
virtual Muse * Clone()=0
Produce a copy of the muse on the heap.
virtual void PlayFrom(Scheduler *pScheduler, int nOffset)=0
Play with every event moved by an offset.
Queue of commands that run when the song clock reaches their tick.
Definition scheduler.h:20