wavelength 1.0.0
Loading...
Searching...
No Matches
musebuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include "gs/muse.h"
4#include "gs/musefactory.h"
5#include "mid/midivalidator.h"
6#include "mid/trackbuilder.h"
7#include "os/ptr.h"
8
15class MuseBuilder : public TrackBuilder {
16public:
27 MuseBuilder(int nTrack, bool bValidate, ErrorHandler pfnError, Ptr<Muse> *pMuse);
28
35 ~MuseBuilder() override;
36
44 void OnNewTrack([[maybe_unused]] unsigned char nTrack) override {
45 }
46
53 void OnEndTrack() override;
54
61 void OnAllDone() override {
62 }
63
74 void
75 OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override;
76
85 void OnTempo([[maybe_unused]] int nTick, [[maybe_unused]] int nMicrosecondsPerBeat) override {
86 }
87
97 void OnText([[maybe_unused]] int nTick,
98 [[maybe_unused]] const char *pszText,
99 [[maybe_unused]] unsigned char nType) override {
100 }
101
111 void OnTimeSignature([[maybe_unused]] int nTick,
112 [[maybe_unused]] int nNumerator,
113 [[maybe_unused]] int nDenominator) override {
114 }
115
116private:
117 Ptr<Muse> *mMuse;
118 MidiValidator mValidator;
119 MuseFactory mPieces;
120};
Checker of the channel messages of one MIDI track for authoring errors.
Definition midivalidator.h:15
void OnTimeSignature(int nTick, int nNumerator, int nDenominator) override
Ignore a time signature.
Definition musebuilder.h:111
void OnTempo(int nTick, int nMicrosecondsPerBeat) override
Ignore a tempo change.
Definition musebuilder.h:85
void OnMidi(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2) override
Check and collect a channel message.
void OnEndTrack() override
Build the piece from the collected messages and store it through the owner.
MuseBuilder(int nTrack, bool bValidate, ErrorHandler pfnError, Ptr< Muse > *pMuse)
Construct a builder.
void OnText(int nTick, const char *pszText, unsigned char nType) override
Ignore a text meta event.
Definition musebuilder.h:97
~MuseBuilder() override
Release the builder.
void OnAllDone() override
Ignore the end of the file.
Definition musebuilder.h:61
void OnNewTrack(unsigned char nTrack) override
Ignore the start of the track.
Definition musebuilder.h:44
Collector of the channel messages of one MIDI channel that cuts MultiMuse pieces out of them.
Definition musefactory.h:17
Owner of one reference to an Attachment.
Definition ptr.h:16
TrackBuilder(int nTrack, bool bValidate, ErrorHandler pfnError)
Construct a builder.
void(* ErrorHandler)(String &message)
Routine that reports a build error.
Definition trackbuilder.h:19