wavelength 1.0.0
Loading...
Searching...
No Matches
remixtutorial.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/remixlogic.h"
4#include "game/streamqueue.h"
5#include "os/serialtasks.h"
6#include "os/task.h"
8#include "script/dataarray.h"
9
20public:
29 explicit RemixTutorial(RemixLogic *pLogic);
30
38 ~RemixTutorial() override;
39
48 void NotifyWhenDone([[maybe_unused]] Task *pTask,
49 [[maybe_unused]] const char *pszName) override {
50 }
51
58 void Start();
59
67 bool Poll();
68
76 void SetPaused(bool bPaused);
77
85
95 void NotifyLoop(bool bLooping);
96
104 void NotifySectionChange(int nSection);
105
114 void NotifyRotate(bool bRight, int nRotation);
115
124 void QueueStream(const char *pszName, bool bSkipIfBusy);
125
132 void ClearGems();
133
141 void EnableMenu(bool bEnable);
142
150 void OpenTempo(bool bOpen);
151
159 void AdjustTempo(int nSteps);
160
167 void PlaySound();
168
176 void AllowPatternCancel(bool bAllow);
177
186 static void OnStream(DataArray *pCommand, void *pUserData);
187
196 static void OnEnableLooping(DataArray *pCommand, void *pUserData);
197
206 static void OnPrint(DataArray *pCommand, void *pUserData);
207
216 static void OnDisableRot(DataArray *pCommand, void *pUserData);
217
226 static void OnDisablePitching(DataArray *pCommand, void *pUserData);
227
237 static void OnDisableSectionChange(DataArray *pCommand, void *pUserData);
238
247 static void OnDisableHud(DataArray *pCommand, void *pUserData);
248
257 static void OnDisableErasing(DataArray *pCommand, void *pUserData);
258
267 static void OnAllowLooping(DataArray *pCommand, void *pUserData);
268
277 static void OnClearGems(DataArray *pCommand, void *pUserData);
278
287 static void OnShowPatterns(DataArray *pCommand, void *pUserData);
288
297 static void OnBurnPatterns(DataArray *pCommand, void *pUserData);
298
307 static void OnEnableMenu(DataArray *pCommand, void *pUserData);
308
317 static void OnAllowTempoChange(DataArray *pCommand, void *pUserData);
318
327 static void OnTempoOpen(DataArray *pCommand, void *pUserData);
328
337 static void OnAdjustTempo(DataArray *pCommand, void *pUserData);
338
348 static void OnAllowPatternCancel(DataArray *pCommand, void *pUserData);
349
359 static void OnAllowRotationLeft(DataArray *pCommand, void *pUserData);
360
363 return mTempoChangeAllowed;
364 }
365
367 int GetStick6Enabled() const {
368 return mStick6Enabled;
369 }
370
372 int GetStick2Enabled() const {
373 return mStick2Enabled;
374 }
375
378 return mSectionChangeEnabled;
379 }
380
383 return mRotationLeftAllowed;
384 }
385
387 int GetRotationEnabled() const {
388 return mRotationEnabled;
389 }
390
392 int GetPreviewEnabled() const {
393 return mPreviewEnabled;
394 }
395
397 int GetPitchingEnabled() const {
398 return mPitchingEnabled;
399 }
400
402 int GetLoopingAllowed() const {
403 return mLoopingAllowed;
404 }
405
407 int GetHudEnabled() const {
408 return mHudEnabled;
409 }
410
412 int GetErasingEnabled() const {
413 return mErasingEnabled;
414 }
415
417 int GetButton10Enabled() const {
418 return mButton10Enabled;
419 }
420
421private:
433 Task *CreateTask(DataArray *pStep);
434
435 SerialTasks mScript;
436 StreamQueue mStreams;
437 int mPitchingEnabled;
438 int mRotationEnabled;
439 int mSectionChangeEnabled;
440 int mHudEnabled;
441 int mErasingEnabled;
442 int mPreviewEnabled;
443 int mStick2Enabled;
444 int mStick6Enabled;
445 int mButton10Enabled;
446 int mBurnPatterns;
447 int mShowPatterns;
448 int mTempoChangeAllowed;
449 int mLoopingAllowed;
450 int mPaused;
451 int mLastRotation;
452 int mRotationLeftAllowed;
453 RemixLogic *mLogic;
454};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Game rules of a remix session.
Definition remixlogic.h:55
void ClearGems()
Clear the gems of every section.
static void OnPrint(DataArray *pCommand, void *pUserData)
Run the "print" script command, which does nothing.
int GetRotationEnabled() const
Definition remixtutorial.h:387
void EnableMenu(bool bEnable)
Focus or release the remix menu of the first controller.
static void OnAllowRotationLeft(DataArray *pCommand, void *pUserData)
Run the "allow_rotation_left" script command, which sets whether rotation to the left is allowed.
static void OnClearGems(DataArray *pCommand, void *pUserData)
Run the "clear_gems" script command, which clears the gems.
static void OnDisableErasing(DataArray *pCommand, void *pUserData)
Run the "disable_erasing" script command, which disables or enables erasing.
int GetPreviewEnabled() const
Definition remixtutorial.h:392
void NotifyRotate(bool bRight, int nRotation)
Report a rotation to TheGameCallback when it differs from the last one, and record it.
static void OnAllowPatternCancel(DataArray *pCommand, void *pUserData)
Run the "allow_pattern_cancel" script command, which passes its argument to AllowPatternCancel().
int GetRotationLeftAllowed() const
Definition remixtutorial.h:382
static void OnEnableLooping(DataArray *pCommand, void *pUserData)
Run the "enable_looping" script command, which turns looping of the first lane on or off.
int GetSectionChangeEnabled() const
Definition remixtutorial.h:377
static void OnDisableHud(DataArray *pCommand, void *pUserData)
Run the "disable_hud" script command, which hides or shows the display.
static void OnStream(DataArray *pCommand, void *pUserData)
Run the "stream" script command, which queues the narration stream it identifies.
void Start()
Start the first step.
static void OnDisablePitching(DataArray *pCommand, void *pUserData)
Run the "disable_pitching" script command, which disables or enables pitching.
void OpenTempo(bool bOpen)
Open or close the tempo control.
static void OnShowPatterns(DataArray *pCommand, void *pUserData)
Run the "show_patterns" script command, which sets whether the patterns are shown.
int GetButton10Enabled() const
Definition remixtutorial.h:417
static void OnAdjustTempo(DataArray *pCommand, void *pUserData)
Run the "adjust_tempo" script command, which adjusts the tempo by its argument.
static void OnDisableRot(DataArray *pCommand, void *pUserData)
Run the "disable_rot" script command, which disables or enables rotation.
static void OnBurnPatterns(DataArray *pCommand, void *pUserData)
Run the "burn_patterns" script command, which sets whether the patterns are burnt.
void AllowPatternCancel(bool bAllow)
Ignore the request.
void NotifySectionChange(int nSection)
Report a section change to TheGameCallback.
static void OnDisableSectionChange(DataArray *pCommand, void *pUserData)
Run the "disable_section_change" script command, which disables or enables section changes.
int GetPitchingEnabled() const
Definition remixtutorial.h:397
int GetLoopingAllowed() const
Definition remixtutorial.h:402
int GetStick2Enabled() const
Definition remixtutorial.h:372
bool Poll()
Advance the steps and the narration, unless the tutorial is paused.
static void OnAllowLooping(DataArray *pCommand, void *pUserData)
Run the "allow_looping" script command, which sets whether looping is allowed.
void PlaySound()
Play the second sound of the interface sound bank.
void AdjustTempo(int nSteps)
Raise or lower the tempo.
static void OnEnableMenu(DataArray *pCommand, void *pUserData)
Run the "enable_menu" script command, which enables or disables the menu.
~RemixTutorial() override
Remove the script commands, stop the steps and the narration, and restore the first player's controll...
void NotifyPitch()
Report a pitch change to TheGameCallback.
void QueueStream(const char *pszName, bool bSkipIfBusy)
Queue a narration stream.
int GetErasingEnabled() const
Definition remixtutorial.h:412
RemixTutorial(RemixLogic *pLogic)
Register the tutorial's script commands, build the steps of the song's script, and switch the first p...
int GetTempoChangeAllowed() const
Definition remixtutorial.h:362
void SetPaused(bool bPaused)
Pause or resume the steps and the narration.
void NotifyLoop(bool bLooping)
Report to TheGameCallback that looping was switched on or off.
static void OnTempoOpen(DataArray *pCommand, void *pUserData)
Run the "tempo_open" script command, which opens or closes the tempo menu.
void NotifyWhenDone(Task *pTask, const char *pszName) override
Ignore the request.
Definition remixtutorial.h:48
int GetStick6Enabled() const
Definition remixtutorial.h:367
static void OnAllowTempoChange(DataArray *pCommand, void *pUserData)
Run the "allow_tempo_change" script command, which sets whether tempo changes are allowed.
int GetHudEnabled() const
Definition remixtutorial.h:407
Task that runs a list of tasks one after another.
Definition serialtasks.h:14
Queue of narration streams that plays one stream at a time.
Definition streamqueue.h:16
Object a task can ask to report when a named piece of work is done.
Definition taskdonenotifier.h:10
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9