resonance 1.0.1
Loading...
Searching...
No Matches
phrase.h File Reference
#include <cstddef>
#include <iostream>
#include <vector>
#include "app/attachment.h"
#include "mid/tick.h"
#include "mid/tickobj.h"
Include dependency graph for phrase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Phrase
 One phrase of a track, with its gems, its player, and the messages and values scheduled across it. More...
class  Phrase::Gem
 One gem of the phrase at one song position. More...

Functions

OBStream & operator<< (OBStream &stream, const Phrase::Gem &gem)
 Write one gem as a two-byte position and two single bytes.
IBStream & operator>> (IBStream &stream, Phrase::Gem &gem)
 Read one gem back.
std::ostream & operator<< (std::ostream &stream, Phrase::Gem &gem)
 Write one gem to a diagnostic stream as [position gem trans].
OBStream & operator<< (OBStream &stream, Phrase &phrase)
 Write a phrase behind the presence byte 1.
IBStream & operator>> (IBStream &stream, Phrase &phrase)
 Read a phrase written by operator<<(OBStream &, Phrase &), discarding its presence byte.
OBStream & operator<< (OBStream &stream, Phrase *pPhrase)
 Write an optional phrase as the byte 0 for none or the byte 1 followed by the phrase.
IBStream & operator>> (IBStream &stream, Phrase *&pPhrase)
 Read an optional phrase, allocating a new one unless the presence byte is 0.
std::ostream & operator<< (std::ostream &stream, Phrase &phrase)
 Write a phrase to a diagnostic stream through Phrase::Print().

Function Documentation

◆ operator<<() [1/5]

OBStream & operator<< ( OBStream & stream,
const Phrase::Gem & gem )

Write one gem as a two-byte position and two single bytes.

Save() expands the same transfer inline, and no caller of this copy exists.

Parameters
streamThe stream to write to.
gemThe gem.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6ba0
Ghidra address:
PAL: 0x001bc978

◆ operator>>() [1/3]

IBStream & operator>> ( IBStream & stream,
Phrase::Gem & gem )

Read one gem back.

Parameters
streamThe stream to read from.
gemThe gem to fill.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6c48
Ghidra address:
PAL: 0x001bca20

◆ operator<<() [2/5]

std::ostream & operator<< ( std::ostream & stream,
Phrase::Gem & gem )

Write one gem to a diagnostic stream as [position gem trans].

Parameters
streamThe stream to write to.
gemThe gem.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6cf8
Ghidra address:
PAL: 0x001bcad0

◆ operator<<() [3/5]

OBStream & operator<< ( OBStream & stream,
Phrase & phrase )

Write a phrase behind the presence byte 1.

Parameters
streamThe stream to write to.
phraseThe phrase.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6e28
Ghidra address:
PAL: 0x001bcc00

◆ operator>>() [2/3]

IBStream & operator>> ( IBStream & stream,
Phrase & phrase )

Read a phrase written by operator<<(OBStream &, Phrase &), discarding its presence byte.

Parameters
streamThe stream to read from.
phraseThe phrase to fill.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6e88
Ghidra address:
PAL: 0x001bcc60

◆ operator<<() [4/5]

OBStream & operator<< ( OBStream & stream,
Phrase * pPhrase )

Write an optional phrase as the byte 0 for none or the byte 1 followed by the phrase.

PhrasePacket::saveGuts() and PhraseDatabase use this form.

Parameters
streamThe stream to write to.
pPhraseThe phrase, or null.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6ee0
Ghidra address:
PAL: 0x001bccb8

◆ operator>>() [3/3]

IBStream & operator>> ( IBStream & stream,
Phrase *& pPhrase )

Read an optional phrase, allocating a new one unless the presence byte is 0.

Parameters
streamThe stream to read from.
pPhraseReceives the new phrase, or null.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b6f70
Ghidra address:
PAL: 0x001bcd48

◆ operator<<() [5/5]

std::ostream & operator<< ( std::ostream & stream,
Phrase & phrase )

Write a phrase to a diagnostic stream through Phrase::Print().

Parameters
streamThe stream to write to.
phraseThe phrase.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x001b7038
Ghidra address:
PAL: 0x001bce10