|
resonance 1.0.1
|
Pitcher that drives a note track. More...
#include <notepitcher.h>


Public Member Functions | |
| NotePitcher (PhraseMgr *pPhraseMgr, Quantizer *pQuantizer, Sch::TickClock *pClock, const TrackData *pTrackData, int bPlayModeOne, int bAllowOwnedBars, int nUnreadOption) | |
| Construct a note pitcher for one track. | |
| virtual | ~NotePitcher () |
| virtual int | Tick (int nElapsedTicks) |
| Advance to the bar the elapsed tick count falls in. | |
| Public Member Functions inherited from Pitcher | |
| Pitcher (Sch::TickClock *pClock) | |
| Construct the three bases, the TickTask one to run every bar. | |
| virtual | ~Pitcher () |
| Inline. | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the tagged heap under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Release a sink to the tagged heap. | |
| virtual | ~MsgSink () |
| virtual void | Dispatch (Message *pMsg) |
| Accept a message. | |
| Public Member Functions inherited from MsgSource | |
| virtual | ~MsgSource () |
| virtual void | AddSink (MsgSink *pSink) |
| Register a sink, ignoring a sink that is already registered. | |
| virtual void | RemoveSink (MsgSink *pSink) |
| Unregister the first occurrence of a sink. | |
| void | Send (Message *pMsg) const |
| Deliver a message to every registered sink, in registration order. | |
| void | ClearSinks () |
| Unregister every sink. | |
| Public Member Functions inherited from TickTask | |
| TickTask (Sch::TickClock *pClock, int nPeriod, int bAligned) | |
| virtual | ~TickTask () |
| Withdraw the queued command. | |
| virtual void | Print (std::ostream &stream) |
| Write the task to a diagnostic stream. | |
| void | Start (int nEpochOffset) |
| Post the task on its clock. | |
| void | Run () |
| Run Tick() for the run now due and post the next one. | |
| void | Stop () |
| Withdraw the queued command and forget its handle. | |
| 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. | |
Protected Member Functions | |
| void | PostPitchMsg (PitchRiffMsg *pMsg) |
| React to a PitchRiffMsg for this track and player. | |
| void | PostAllNotesOffMsg (EraseMsg *pMsg) |
| Erase this player's phrases at an EraseMsg's position, outside play mode 1. | |
| void | PostSeekerMsg (TrackSelectMsg *pMsg) |
| Install the player a TrackSelectMsg for this track selects. | |
| void | PostPhraseCapturedMsg (int nGem, int nTick) |
| Record a caught gem. | |
| void | PostSeekerMsgSecond (int nBar, int bForce) |
| Post the seeker for mPlayer at the first playable bar of the eight from nBar. | |
| virtual void | DispatchPriv (Message *pMsg) |
| Act on a message. | |
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 MsgSource | |
| int | mGraphBuilt |
| A word no member of this class reads. | |
| Public Attributes inherited from Attachment | |
| int | mRefs |
| Static Public Attributes inherited from Pitcher | |
| static constexpr int | kBarPeriod = 1920 |
| The TickTask period, one bar of 1920 ticks. | |
Pitcher that drives a note track.
Its RTTI descriptor is at 0x008eef68. It has Pitcher as its one base. Its three tables are at 0x007e14a0, 0x007e1478, and 0x007e1448, and it overrides exactly the two slots Pitcher declares pure. PitchingSTG's tagged allocation measures the object at 0x70 bytes, and PitchingSTG builds one of these when the track's kind word is 2 and a Scratcher when it is 3.
It ignores an EraseOffMsg rather than forwarding it, which is the one message the three Pitcher subclasses treat differently from each other.
The names of the routines DispatchPriv() and Tick() dispatch to come from the message each routine posts rather than from the message it receives.
| NotePitcher::NotePitcher | ( | PhraseMgr * | pPhraseMgr, |
| Quantizer * | pQuantizer, | ||
| Sch::TickClock * | pClock, | ||
| const TrackData * | pTrackData, | ||
| int | bPlayModeOne, | ||
| int | bAllowOwnedBars, | ||
| int | nUnreadOption ) |
Construct a note pitcher for one track.
The seven arguments arrive in a1 through a3 and t0 through t3, which is the register convention this target uses for arguments five through eight.
| pPhraseMgr | The phrase manager for the track. |
| pQuantizer | The quantiser for the track. |
| pClock | The clock the producer schedules against. |
| pTrackData | The track description. |
| bPlayModeOne | Non-zero when the game manager reports play mode 1. |
| bAllowOwnedBars | Non-zero to let the player replay a bar it is already the owner of. PitchingSTG passes 1. |
| nUnreadOption | Stored and never read. PitchingSTG passes zero. |
|
virtual |
|
virtual |
Advance to the bar the elapsed tick count falls in.
Divides the elapsed count by mBarDivisor and hands the result to PostSeekerMsgSecond() with a second argument of zero.
| nElapsedTicks | Ticks since the epoch. |
Implements TickTask.
|
protected |
React to a PitchRiffMsg for this track and player.
The message's position is quantised. A bar CanPlayBar() rejects plays SND_INACTIVE. Otherwise, at a new position, the riff TrackData::GetRiff() reports goes out as a MultiMuseMsg, PostPhraseCapturedMsg() records the gem, a PitchMsg follows, and the position is stored in mLastPitchPosition.
| pMsg | The message. |
|
protected |
Erase this player's phrases at an EraseMsg's position, outside play mode 1.
The bar, or with the message's last word set every bar of its step, is cleared wherever mPlayer is its owner, and clearing the message's bar also sends an AllNotesOffMsg. When anything was cleared, SND_ERASE_SECTION or SND_ERASE plays, a ShowEraseEffectMsg goes out, and the seeker is posted again. The position is stored in mLastErasePosition in both cases.
| pMsg | The message. |
|
protected |
Install the player a TrackSelectMsg for this track selects.
A null player first turns the previous player's seeker off. A real player has its seeker posted at the message's bar with the force flag set.
| pMsg | The message. |
|
protected |
Record a caught gem.
A new bar becomes mCapturedBar and is announced with a PhraseCapturedMsg worth the bar's points. In play mode 1 a phrase another player owns there is cleared first. Unless Player::IsLooping() reports non-zero, the gem goes to PhraseMgr::AddGem() for mCapturedBar alone. Otherwise it goes to every bar of the step that CanPlayBar() accepts and whose phrase PhraseMgr::PhrasesMatch() pairs with mCapturedBar, and then to mCapturedBar itself. The bar is then replayed from one tick after the gem.
| nGem | The gem, the PitchRiffMsg's first word. |
| nTick | The quantised song position. |
|
protected |
Post the seeker for mPlayer at the first playable bar of the eight from nBar.
The routine does not send a message for the stand-in player. Without bForce, a player whose Player::GetPlace() reports non-zero has its seeker turned off. Outside play mode 1, a player whose Player::IsLooping() reports zero, or a search that does not find a bar CanPlayBar() accepts, also turns the seeker off. A found bar posts a seeker over the mStepBars bars of its step.
| nBar | The bar to search from, clamped to zero. |
| bForce | Non-zero to skip the Player::GetPlace() test. |
|
protectedvirtual |
Act on a message.
Primary table slot 3.
| pMsg | The message. |
Implements MsgSink.