resonance 1.0.1
Loading...
Searching...
No Matches
Phrase Class Reference

One phrase of a track, with its gems, its player, and the messages and values scheduled across it. More...

#include <phrase.h>

Inheritance diagram for Phrase:
Collaboration diagram for Phrase:

Classes

class  Gem
 One gem of the phrase at one song position. More...

Public Member Functions

void * operator new (size_t nSize)
 Allocate a phrase from the tagged heap under the tag Phrase.
void operator delete (void *pBlock)
 Release a phrase to the tagged heap.
 Phrase ()
 Construct an empty phrase owned by the stand-in player.
virtual ~Phrase ()
 Release the message sequence, when one exists, and both vectors.
int AddGem (int nTick, int nGem, int nTrans)
 Place a gem at a song position, replacing any gem already there.
void AddMuseMsg (int nTick, MuseMsg *pMsg)
 Schedule a copy of a message at a song position, creating the sequence on first use.
void Print (std::ostream &stream)
 Write the phrase to a diagnostic stream.
void Save (OBStream &stream)
 Write the phrase behind a version byte of 2.
void Load (IBStream &stream)
 Read the phrase back.
void AddXLocal (int nTick, float flValue)
 Add a value at a song position, keeping the values sorted by position.
float GetValue (int nTick)
 Report the value in force at a song position.
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.

Friends

class AxeOldGemMaker
class AxePhraseMaker
class PhraseDatabase
class PhraseMgr
class PhrasePlayer
class TrackData
class Voxer

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.
Public Attributes inherited from Attachment
int mRefs

Detailed Description

One phrase of a track, with its gems, its player, and the messages and values scheduled across it.

It has Attachment as its one base. The allocation in operator>>(IBStream &, Phrase *&) measures the object at 0x2c bytes. Its vtable at 0x007e1b68 runs three entries (the type function, the destructor, and the retained Attachment::Destroy()). The destructor is the only virtual the class declares.

The constructor and the destructor together account for every byte of the member map. Print() labels three of the members gems: , pl: , and X: , and Save() and Load() transfer the same three in the same order behind a version byte of 2.

Every member is private. AxePhraseMaker::StartPhrase() and Voxer::StartPhrase() write mPlayer at 0x0019bd7c and 0x001d8aa8, and AxeOldGemMaker reads mPlayer and mMuse at 0x001a3420 and 0x001a3698. PhraseDatabase writes mPlayer and reads and writes mScore directly, PhraseMgr::GetOwner() reads mPlayer, TrackData::AddPhrases() walks mGems directly, PhrasePlayer reads mPlayer, mGems, and mMuse when it plays a bar, the image exposes no accessor, and friend declarations model that access. Promoting the members to public fits the image equally well.

Constructor & Destructor Documentation

◆ Phrase()

Phrase::Phrase ( )

Construct an empty phrase owned by the stand-in player.

Ghidra address:
NTSC-U/C: 0x001b4940
Ghidra address:
PAL: 0x001ba718

◆ ~Phrase()

virtual Phrase::~Phrase ( )
virtual

Release the message sequence, when one exists, and both vectors.

Ghidra address:
NTSC-U/C: 0x001b4998
Ghidra address:
PAL: 0x001ba770

Member Function Documentation

◆ operator new()

void * Phrase::operator new ( size_t nSize)

Allocate a phrase from the tagged heap under the tag Phrase.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x001b6a28
Ghidra address:
PAL: 0x001bc800

◆ operator delete()

void Phrase::operator delete ( void * pBlock)

Release a phrase to the tagged heap.

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x001b6a48
Ghidra address:
PAL: 0x001bc820

◆ AddGem()

int Phrase::AddGem ( int nTick,
int nGem,
int nTrans )

Place a gem at a song position, replacing any gem already there.

A gem after the last one is appended. Otherwise the gem is inserted at its sorted position, and an existing gem at the same position is removed first.

Parameters
nTickThe song position, in MIDI ticks.
nGemThe gem.
nTransThe transposition.
Returns
The replaced gem's mGem, or -1 when no gem was replaced.
Ghidra address:
NTSC-U/C: 0x001b4b30
Ghidra address:
PAL: 0x001ba908

◆ AddMuseMsg()

void Phrase::AddMuseMsg ( int nTick,
MuseMsg * pMsg )

Schedule a copy of a message at a song position, creating the sequence on first use.

Parameters
nTickThe song position, in MIDI ticks.
pMsgThe message. The sequence stores a clone of it.
Ghidra address:
NTSC-U/C: 0x001b4cd8
Ghidra address:
PAL: 0x001baab0

◆ Print()

void Phrase::Print ( std::ostream & stream)

Write the phrase to a diagnostic stream.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001b4d68
Ghidra address:
PAL: 0x001bab40

◆ Save()

void Phrase::Save ( OBStream & stream)

Write the phrase behind a version byte of 2.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001b5018
Ghidra address:
PAL: 0x001badf0

◆ Load()

void Phrase::Load ( IBStream & stream)

Read the phrase back.

Version 1 and any version below 2 are reported through Fatal(). The player arrives as its identifier, and an identifier the table does not resolve falls back to the table's first player.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x001b51f8
Ghidra address:
PAL: 0x001bafd0

◆ AddXLocal()

void Phrase::AddXLocal ( int nTick,
float flValue )

Add a value at a song position, keeping the values sorted by position.

Parameters
nTickThe song position, in MIDI ticks.
flValueThe value.
Ghidra address:
NTSC-U/C: 0x001b6d88
Ghidra address:
PAL: 0x001bcb60

◆ GetValue()

float Phrase::GetValue ( int nTick)

Report the value in force at a song position.

Parameters
nTickThe song position, in MIDI ticks.
Returns
The value of the last entry at or before nTick, or 0.5 when none exists.
Ghidra address:
NTSC-U/C: 0x001b6db0
Ghidra address:
PAL: 0x001bcb88

◆ AxeOldGemMaker

friend class AxeOldGemMaker
friend

◆ AxePhraseMaker

friend class AxePhraseMaker
friend

◆ PhraseDatabase

friend class PhraseDatabase
friend

◆ PhraseMgr

friend class PhraseMgr
friend

◆ PhrasePlayer

friend class PhrasePlayer
friend

◆ TrackData

friend class TrackData
friend

◆ Voxer

friend class Voxer
friend

The documentation for this class was generated from the following file: