20#include "hid/display/display.h"
21#include "modulation/params/param.h"
22#include "modulation/params/param_manager.h"
145 inline bool timelineCounterIsSet()
const {
return timelineCounter; }
148 if (!timelineCounter) {
149 FREEZE_WITH_ERROR(
"E369");
151 return timelineCounter;
154 inline TimelineCounter* getTimelineCounterAllowNull()
const {
return timelineCounter; }
156 inline void setTimelineCounter(
TimelineCounter* newTimelineCounter) { timelineCounter = newTimelineCounter; }
171 inline TimelineCounter* getTimelineCounter()
const {
return toWithTimelineCounter()->getTimelineCounter(); }
174 return toWithTimelineCounter()->getTimelineCounterAllowNull();
178 toWithTimelineCounter()->setTimelineCounter(newTimelineCounter);
181 inline bool timelineCounterIsSet()
const {
return toWithTimelineCounter()->timelineCounterIsSet(); }
189 inline void setNoteRow(
NoteRow* newNoteRow, int32_t newNoteRowId) {
190 noteRow = newNoteRow;
191 noteRowId = newNoteRowId;
194 inline NoteRow* getNoteRow()
const {
196 FREEZE_WITH_ERROR(
"E379");
201 inline NoteRow* getNoteRowAllowNull()
const {
return noteRow; }
203 inline void setNoteRow(
NoteRow* newNoteRow) { noteRow = newNoteRow; }
210 int32_t getLoopLength()
const;
211 int32_t getRepeatCount()
const;
212 int32_t getLastProcessedPos()
const;
213 int32_t getLivePos()
const;
214 bool isCurrentlyPlayingReversed()
const;
215 int32_t getPosAtWhichPlaybackWillCut()
const;
237 int32_t newParamId,
AutoParam* newAutoParam)
const;
271#define SOUND_FLAG_SOURCE_0_ACTIVE_DISREGARDING_MISSING_SAMPLE 0
272#define SOUND_FLAG_SOURCE_1_ACTIVE_DISREGARDING_MISSING_SAMPLE 1
273#define SOUND_FLAG_SOURCE_0_ACTIVE 2
274#define SOUND_FLAG_SOURCE_1_ACTIVE 3
275#define NUM_SOUND_FLAGS 4
280#define FLAG_SHOULDNT_BE_NEEDED 3
284 uint8_t soundFlags[NUM_SOUND_FLAGS];
286 bool checkSourceEverActiveDisregardingMissingSample(int32_t s);
287 bool checkSourceEverActive(int32_t s);
290#define MODEL_STACK_MAX_SIZE sizeof(ModelStackWithAutoParam)
294inline ModelStack* setupModelStackWithSong(
void* memory,
Song* newSong) {
296 modelStack->song = newSong;
304 modelStack->song = newSong;
305 modelStack->setTimelineCounter(newTimelineCounter);
314 return setupModelStackWithSong(memory, newSong)
315 ->addTimelineCounter(newTimelineCounter)
316 ->addNoteRow(0,
nullptr)
317 ->addModControllable(newModControllable);
321setupModelStackWithThreeMainThingsButNoNoteRow(
void* memory,
Song* newSong,
ModControllable* newModControllable,
324 return setupModelStackWithSong(memory, newSong)
325 ->addTimelineCounter(newTimelineCounter)
326 ->addNoteRow(0,
nullptr)
334 return setupModelStackWithSong(memory, newSong)
335 ->addTimelineCounter(newTimelineCounter)
336 ->addNoteRow(noteRowId, noteRow)
341 ModelStackWithTimelineCounter* toReturn = (ModelStackWithTimelineCounter*)
this;
342 toReturn->setTimelineCounter(newTimelineCounter);
347 ModelStackWithNoteRowId* toReturn = (ModelStackWithNoteRowId*)
this;
348 toReturn->noteRowId = noteRowId;
353 ModelStackWithNoteRow* toReturn = (ModelStackWithNoteRow*)
this;
354 toReturn->noteRowId = noteRowId;
355 toReturn->setNoteRow(noteRow);
360ModelStackWithTimelineCounter::addModControllableButNoNoteRow(
ModControllable* newModControllable)
const {
361 return addNoteRow(0,
nullptr)->addModControllable(newModControllable);
365ModelStackWithTimelineCounter::addOtherTwoThingsButNoNoteRow(
ModControllable* newModControllable,
367 return addNoteRow(0,
nullptr)->
addOtherTwoThings(newModControllable, newParamManager);
371ModelStackWithNoteRow::addModControllable(
ModControllable* newModControllable)
const {
372 ModelStackWithModControllable* toReturn = (ModelStackWithModControllable*)
this;
373 toReturn->modControllable = newModControllable;
383 toReturn->modControllable = newModControllable;
384 toReturn->paramManager = newParamManager;
391 toReturn->paramManager = newParamManager;
398ModelStackWithThreeMainThings::addParamCollection(
ParamCollection* newParamCollection,
400 ModelStackWithParamCollection* toReturn = (ModelStackWithParamCollection*)
this;
401 toReturn->paramCollection = newParamCollection;
402 toReturn->summary = newSummary;
409 ModelStackWithParamCollection* toReturn = (ModelStackWithParamCollection*)
this;
410 toReturn->summary = newSummary;
411 toReturn->paramCollection = newSummary->paramCollection;
416ModelStackWithThreeMainThings::addParamCollectionAndId(
ParamCollection* newParamCollection,
418 ModelStackWithParamId* toReturn = (ModelStackWithParamId*)
this;
419 toReturn->paramCollection = newParamCollection;
420 toReturn->summary = newSummary;
421 toReturn->paramId = newParamId;
429 ModelStackWithAutoParam* toReturn = (ModelStackWithAutoParam*)
this;
430 toReturn->paramCollection = newParamCollection;
431 toReturn->summary = newSummary;
432 toReturn->paramId = newParamId;
438 ModelStackWithParamId* toReturn = (ModelStackWithParamId*)
this;
439 toReturn->paramId = newParamId;
445 ModelStackWithAutoParam* toReturn = (ModelStackWithAutoParam*)
this;
446 toReturn->paramId = newParamId;
452 ModelStackWithAutoParam* toReturn = (ModelStackWithAutoParam*)
this;
458 ModelStackWithSoundFlags* toReturn = (ModelStackWithSoundFlags*)
this;
459 for (int32_t i = 0; i < NUM_SOUND_FLAGS; i++) {
460 toReturn->soundFlags[i] = FLAG_TBD;
465void copyModelStack(
void* newMemory,
void const* oldMemory, int32_t size);
Definition auto_param.h:44
Definition mod_controllable.h:40
Definition model_stack.h:264
AutoParam * autoParam
Definition model_stack.h:268
Definition model_stack.h:221
Definition model_stack.h:162
Definition model_stack.h:187
ModelStackWithThreeMainThings * addOtherTwoThings(ModControllable *newModControllable, ParamManager *newParamManager) const
Definition model_stack.h:380
Definition model_stack.h:246
Definition model_stack.h:255
Definition model_stack.h:282
Definition model_stack.h:227
Definition model_stack.h:129
Definition model_stack.h:123
Definition param_collection_summary.h:24
Definition param_collection.h:39
Definition param_manager.h:155
Definition param_manager.h:45
Definition sound_drum.h:28
Definition timeline_counter.h:28
uint8_t ParamType
Definition param.h:65
Kind
Definition param.h:42