41template <
class Intent>
66 program_ = std::make_unique<ScriptedProgram>(program);
82 const std::vector<AuditionRecord>&
auditions()
const {
return auditions_; }
84 const std::vector<Intent>&
intents()
const {
return intents_; }
111 result.
status = audition_status_;
119 ended_.push_back(handle);
123 intents_.push_back(intent);
125 result.
status = intent_status_;
127 result.
sequence = ++next_intent_sequence_;
132 std::unique_ptr<ScriptedProgram> program_;
133 std::uint64_t generation_ = 1;
134 std::uint64_t sequence_ = 1;
135 std::uint64_t next_handle_ = 0;
136 std::uint64_t next_intent_sequence_ = 0;
140 std::vector<AuditionRecord> auditions_;
141 std::vector<AuditionHandle> ended_;
142 std::vector<Intent> intents_;
void set_program(const ScriptedProgram &program)
Update the current program in place.
Definition scripted_ui_host.hpp:56
void swap_program(const ScriptedProgram &program)
Adopt a different compiled program, as an engine does when a recompile lands.
Definition scripted_ui_host.hpp:64
ScriptedUiHost()
Definition scripted_ui_host.hpp:50
void set_audition_status(AuditionStatus status)
What the host does with the next audition request.
Definition scripted_ui_host.hpp:75
AuditionResult begin_audition(const AuditionRequest &request) noexcept override
Ask to hear something.
Definition scripted_ui_host.hpp:107
void clear_emissions()
Definition scripted_ui_host.hpp:86
void set_intent_status(IntentStatus status)
What the host does with the next intent.
Definition scripted_ui_host.hpp:78
const std::vector< Intent > & intents() const
Definition scripted_ui_host.hpp:84
const std::vector< AuditionRecord > & auditions() const
Definition scripted_ui_host.hpp:82
IntentResult submit_intent(const Intent &intent) noexcept override
Hand over one intent a gesture produced.
Definition scripted_ui_host.hpp:122
void end_audition(AuditionHandle handle) noexcept override
End a sustained audition.
Definition scripted_ui_host.hpp:118
std::uint64_t program_generation() const
Definition scripted_ui_host.hpp:71
UiPlayhead playhead() const noexcept override
The latest playhead reading, by value.
Definition scripted_ui_host.hpp:94
const std::vector< AuditionHandle > & ended_auditions() const
Definition scripted_ui_host.hpp:83
Adds intent submission for one intent vocabulary.
Definition sequencer_ui_host.hpp:213
ScriptedUiHost is a SequencerUiHost whose playhead is written by the caller instead of an engine,...
Definition edit_intent.hpp:14
UiTransportState
Whether the playhead is moving, and why.
Definition sequencer_ui_host.hpp:49
@ Stopped
Definition sequencer_ui_host.hpp:50
AuditionStatus
Definition sequencer_ui_host.hpp:144
@ Started
The host is sounding it. A sustained request also yields a valid handle.
Definition sequencer_ui_host.hpp:146
IntentStatus
Definition sequencer_ui_host.hpp:165
@ Accepted
The host took the intent and will apply it.
Definition sequencer_ui_host.hpp:167
The loop bounds a transport honours, in document ticks.
Definition loop_region.hpp:20
Names a sustained audition so it can be ended.
Definition sequencer_ui_host.hpp:137
What a view asks to hear, in document terms only.
Definition sequencer_ui_host.hpp:109
Returned by value so a view driven by a host that cannot audition is observable in a test without a m...
Definition sequencer_ui_host.hpp:158
AuditionHandle handle
Definition sequencer_ui_host.hpp:160
AuditionStatus status
Definition sequencer_ui_host.hpp:159
Definition sequencer_ui_host.hpp:175
std::uint64_t sequence
Host-assigned identity of an accepted intent, so a view can correlate what it emitted with what later...
Definition sequencer_ui_host.hpp:180
IntentStatus status
Definition sequencer_ui_host.hpp:176
What the caller scripts. Held by value inside the host's current program.
Definition scripted_ui_host.hpp:29
UiTransportState state
Definition scripted_ui_host.hpp:37
std::uint64_t continuity_epoch
Scripted rather than counted by the host, because only whoever moves the position knows when it stopp...
Definition scripted_ui_host.hpp:35
double tempo_bpm
Definition scripted_ui_host.hpp:38
timebase::TickPosition position
Definition scripted_ui_host.hpp:30
timebase::LoopRegion loop
Definition scripted_ui_host.hpp:36
One audition the host was asked for, with the outcome it gave back.
Definition scripted_ui_host.hpp:45
AuditionRequest request
Definition scripted_ui_host.hpp:46
AuditionResult result
Definition scripted_ui_host.hpp:47
One complete reading of where playback is.
Definition sequencer_ui_host.hpp:70
double tempo_bpm
Definition sequencer_ui_host.hpp:88
std::uint64_t sequence
Monotonic per publish.
Definition sequencer_ui_host.hpp:76
std::uint64_t continuity_epoch
Identity of the continuous interval this reading's position belongs to.
Definition sequencer_ui_host.hpp:83
timebase::LoopRegion loop
Definition sequencer_ui_host.hpp:86
std::uint64_t program_generation
Identity of the compiled program this reading came from.
Definition sequencer_ui_host.hpp:73
UiTransportState state
Definition sequencer_ui_host.hpp:87
timebase::TickPosition position
Document position. This is the value a ruler and a playhead line draw.
Definition sequencer_ui_host.hpp:85