|
resonance 1.0.1
|
Sequence of messages, each at a song position. More...
#include <multimuse.h>


Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate a sequence from the tagged heap under the tag "MultiMuse". | |
| void | operator delete (void *pBlock) |
| Release a sequence to the tagged heap. | |
| virtual | ~MultiMuse () |
| Delete every stored message, then release the vector. | |
| virtual void | Print (std::ostream &stream) |
| Write the sequence to a diagnostic stream. | |
| void | SaveFields (OBStream &stream) |
| Write the sequence to an output stream. | |
| void | LoadFields (IBStream &stream) |
| Read the sequence back from an input stream. | |
| void | Add (MuseMsg *pMsg, int nTick, int bCheckLast) |
| Schedule a copy of a message at a song position. | |
| MuseMsg * | Find (int nTick) |
| Find the message scheduled at exactly a song position. | |
| void | Append (const MultiMuse &other) |
| Append a Clone() of every message of another sequence, at the same song positions. | |
| Public Member Functions inherited from Attachment | |
| Attachment () | |
| virtual | ~Attachment () |
| int | Release () |
| Give back one reference and destroy the object once the last one is gone. | |
| virtual void | Destroy () |
| Destroy the object. | |
Public Attributes | |
| std::vector< TickObj< MuseMsg * > > | mEntries |
| Every message of the sequence, in ascending song position. | |
| Public Attributes inherited from Attachment | |
| int | mRefs |
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. | |
Sequence of messages, each at a song position.
Its RTTI descriptor is at 0x008ef088. It has Attachment as its one base. The allocation in MultiMuseMsg::restoreGuts() measures the object at 0x14 bytes. Its layout is the reference count at +0x00, the vptr at +0x04, and the vector over +0x08 through +0x13. Its vtable is at 0x007dfb78 and runs four entries, slot 2 retaining Attachment::Destroy().
The element type is attested. The one Sequencer instantiation in the image is Sequencer<TickObj<MuseMsg *> const *> at 0x008eec48, and MultiMusePlayer::Start() posts one of those over this vector's start and finish. SaveFields() agrees with that shape independently: it advances eight bytes per element and writes the first word through Sch::Tick::saveGuts() and the second through operator<<(OBStream &, Message *).
MultiMuseMsg carries one of these and is how a sequence moves between a MsgSource and a MsgSink, and MultiMusePlayer is what turns one into messages over time.
|
virtual |
Delete every stored message, then release the vector.
| void * MultiMuse::operator new | ( | size_t | nSize | ) |
Allocate a sequence from the tagged heap under the tag "MultiMuse".
MultiMuseMsg::restoreGuts() and Phrase inline the call.
| nSize | The object size the compiler supplies. |
| void MultiMuse::operator delete | ( | void * | pBlock | ) |
Release a sequence to the tagged heap.
| pBlock | The block. |
|
virtual |
Write the sequence to a diagnostic stream.
Table slot 3. MultiMuseMsg::PrintExtra() is the one recovered caller. An empty sequence prints [empty]. Otherwise the entries print through PrintMuseMsgTickObj() inside one pair of brackets, one per line. When the stream's buffer is an nlfilebuf, each continuation line is padded with spaces to the column at which the previous entry began.
| stream | The stream to write to. |
Reimplemented in Riff.
| void MultiMuse::SaveFields | ( | OBStream & | stream | ) |
Write the sequence to an output stream.
Writes the entry count as one four-byte transfer and then each entry as a position followed by a message pointer. The loop reloads the vector's start on every iteration and its finish as the loop condition, which is faithful and not a reconstruction artefact.
| stream | The stream to write to. |
| void MultiMuse::LoadFields | ( | IBStream & | stream | ) |
Read the sequence back from an input stream.
Empties the sequence, reads the entry count as one four-byte transfer, and reads each entry as a position and a message pointer. MultiMuseMsg::restoreGuts() is the one recovered caller, and it creates a fresh sequence for every read.
| stream | The stream to read from. |
| void MultiMuse::Add | ( | MuseMsg * | pMsg, |
| int | nTick, | ||
| int | bCheckLast ) |
Schedule a copy of a message at a song position.
The sequence stores the message's Clone() rather than the message itself. Both insertion paths keep the entries sorted by position; a non-zero bCheckLast first compares against the last entry and appends when the new position does not precede it, and zero always searches. The two insertion paths are InsertSorted() and InsertAtLowerBound().
| pMsg | The message to copy. |
| nTick | The song position, in MIDI ticks. |
| bCheckLast | Whether to try appending before searching. |
| MuseMsg * MultiMuse::Find | ( | int | nTick | ) |
Find the message scheduled at exactly a song position.
The search is std::lower_bound() through TickObjAfter(), called out of line at 0x001a9aa0.
| nTick | The song position, in MIDI ticks. |
| void MultiMuse::Append | ( | const MultiMuse & | other | ) |
Append a Clone() of every message of another sequence, at the same song positions.
mEntries is first grown to hold at least as many entries as the other sequence has. The existing entries are kept and the new ones are appended without sorting. The image has no caller, and the name is inferred.
| other | The sequence to copy from. |
Every message of the sequence, in ascending song position.
Public because MultiMusePlayer::Start() reads the start and the finish directly, through a MultiMuse pointer from outside the hierarchy, and the image exposes no accessor. A friend declaration fits equally well. +0x08