resonance 1.0.1
Loading...
Searching...
No Matches
multimuse.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <iostream>
5#include <vector>
6
7#include "app/attachment.h"
8#include "mid/tickobj.h"
9#include "msg/musemsg.h"
10#include "stream/ibstream.h"
11#include "stream/obstream.h"
12
30class MultiMuse : public Attachment {
31public:
42 void *operator new(size_t nSize);
43
51 void operator delete(void *pBlock);
52
59 virtual ~MultiMuse();
60
73 virtual void Print(std::ostream &stream);
74
86 void SaveFields(OBStream &stream);
87
99 void LoadFields(IBStream &stream);
100
115 void Add(MuseMsg *pMsg, int nTick, int bCheckLast);
116
127 MuseMsg *Find(int nTick);
128
140 void Append(const MultiMuse &other);
141
149 std::vector<TickObj<MuseMsg *> > mEntries;
150};
151
166std::ostream &PrintMuseMsgTickObj(std::ostream &stream, Sch::Tick position, MuseMsg *pMsg);
Attachment()
Definition attachment.h:26
Input half of the byte stream interface.
Definition ibstream.h:36
Sequence of messages, each at a song position.
Definition multimuse.h:30
virtual void Print(std::ostream &stream)
Write the sequence to a diagnostic stream.
void Add(MuseMsg *pMsg, int nTick, int bCheckLast)
Schedule a copy of a message at a song position.
void LoadFields(IBStream &stream)
Read the sequence back from an input stream.
void Append(const MultiMuse &other)
Append a Clone() of every message of another sequence, at the same song positions.
virtual ~MultiMuse()
Delete every stored message, then release the vector.
MuseMsg * Find(int nTick)
Find the message scheduled at exactly a song position.
void SaveFields(OBStream &stream)
Write the sequence to an output stream.
std::vector< TickObj< MuseMsg * > > mEntries
Every message of the sequence, in ascending song position.
Definition multimuse.h:149
Abstract base shared by a family of messages.
Definition musemsg.h:28
Output half of the byte stream interface.
Definition obstream.h:25
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
std::ostream & PrintMuseMsgTickObj(std::ostream &stream, Sch::Tick position, MuseMsg *pMsg)
Write one scheduled message to a diagnostic stream as [position: message].