pub struct Transaction<'a, T: EngineCommandIssuer + ?Sized> { /* private fields */ }Expand description
An in-progress transaction. Create one by calling begin_transaction on
any type that can receive commands.
You can send commands to a transaction, exactly like you can to an
Engine. When you commit a transaction, all of the commands will be sent
at once, atomically, with neither a gap nor any interleaving with any other
commands. You can instead abort a transaction, in which case none of the
commands will be sent.
It is perfectly legal to call begin_transaction on a transaction. You can
go as deep as you like. If you do B = A.begin_transaction(), queue a
bunch of commands, and then do B.commit(), all of those commands will be
sent to A at once. If A is a transaction, then you still need to do
A.commit() if you want the commands to be carried out, or you can do
A.abort() to make it so that none of them happened at all.
Implementations§
Trait Implementations§
Source§impl<'a, T: EngineCommandIssuer + ?Sized> EngineCommands for Transaction<'a, T>
impl<'a, T: EngineCommandIssuer + ?Sized> EngineCommands for Transaction<'a, T>
Source§fn begin_transaction(&mut self, length: Option<usize>) -> Transaction<'_, Self>
fn begin_transaction(&mut self, length: Option<usize>) -> Transaction<'_, Self>
Source§fn replace_soundtrack(&mut self, new_soundtrack: Soundtrack)
fn replace_soundtrack(&mut self, new_soundtrack: Soundtrack)
Source§fn precache(&mut self, flow_name: CompactString)
fn precache(&mut self, flow_name: CompactString)
is_flow_ready to determine when the loading is
complete. Read moreSource§fn unprecache(&mut self, flow_name: CompactString)
fn unprecache(&mut self, flow_name: CompactString)
Source§fn unprecache_all(&mut self)
fn unprecache_all(&mut self)
Source§fn is_flow_ready(&mut self, flow_name: CompactString) -> Response<bool> ⓘ
fn is_flow_ready(&mut self, flow_name: CompactString) -> Response<bool> ⓘ
query::Response that will
answer the question “Is this flow I precached now ready for instant
playback?”Source§fn is_flow_active(&mut self, flow_name: CompactString) -> Response<bool> ⓘ
fn is_flow_active(&mut self, flow_name: CompactString) -> Response<bool> ⓘ
query::Response that will
answer the question “Is this flow either currently playing or waiting
to start playing?” (After a flow reaches a natural end without looping,
this will return false.)Source§fn set_flow_control(
&mut self,
control_name: CompactString,
new_value: StringOrNumber,
)
fn set_flow_control( &mut self, control_name: CompactString, new_value: StringOrNumber, )
Source§fn get_flow_control(
&mut self,
control_name: CompactString,
) -> Response<Option<StringOrNumber>> ⓘ
fn get_flow_control( &mut self, control_name: CompactString, ) -> Response<Option<StringOrNumber>> ⓘ
query::Response that will
answer the question “What value does this flow control currently have?”
(Flows can set flow control values themselves, and in doing so,
communicate in a very limited way back to the calling program.)Source§fn get_all_flow_controls(
&mut self,
) -> Response<Vec<(CompactString, StringOrNumber)>> ⓘ
fn get_all_flow_controls( &mut self, ) -> Response<Vec<(CompactString, StringOrNumber)>> ⓘ
query::Response that will
give you a complete list of flow controls, and the values they are
currently set to.Source§fn get_active_flows(&mut self) -> Response<Vec<CompactString>> ⓘ
fn get_active_flows(&mut self) -> Response<Vec<CompactString>> ⓘ
query::Response that will
give you a complete list of flows that are playing.Source§fn get_active_nodes(&mut self) -> Response<Vec<ActiveNodeReport>> ⓘ
fn get_active_nodes(&mut self) -> Response<Vec<ActiveNodeReport>> ⓘ
query::Response that will
give you a complete list of flow nodes that are playing.Source§fn get_mix_control(
&mut self,
control_name: CompactString,
) -> Response<Option<f32>> ⓘ
fn get_mix_control( &mut self, control_name: CompactString, ) -> Response<Option<f32>> ⓘ
query::Response that will
answer the question “What volume level is this mix control currently
operating at?” If there is a fade in progress, the volume reported
will reflect the current moment within the fade.Source§fn get_all_mix_controls(&mut self) -> Response<Vec<(CompactString, f32)>> ⓘ
fn get_all_mix_controls(&mut self) -> Response<Vec<(CompactString, f32)>> ⓘ
query::Response that will
give you a complete list of mix controls, and the volumes they are
currently operating at. If there is a fade in progress, the volumes
reported will reflect the current moment within the fade.Source§fn get_mix_flows(&mut self) -> Response<Vec<MixFlowReport>> ⓘ
fn get_mix_flows(&mut self) -> Response<Vec<MixFlowReport>> ⓘ
query::Response that will
give you a complete list of flows that are playing, and the volumes
they’re playing at.Source§fn clear_flow_control(&mut self, control_name: CompactString)
fn clear_flow_control(&mut self, control_name: CompactString)
Source§fn clear_prefixed_flow_controls(&mut self, control_prefix: CompactString)
fn clear_prefixed_flow_controls(&mut self, control_prefix: CompactString)
Source§fn clear_all_flow_controls(&mut self)
fn clear_all_flow_controls(&mut self)
Source§fn fade_mix_control_to(
&mut self,
control_name: CompactString,
target_volume: PosFloat,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_mix_control_to( &mut self, control_name: CompactString, target_volume: PosFloat, fade_length: PosFloat, fade_type: FadeType, )
Source§fn fade_prefixed_mix_controls_to(
&mut self,
control_prefix: CompactString,
target_volume: PosFloat,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_prefixed_mix_controls_to( &mut self, control_prefix: CompactString, target_volume: PosFloat, fade_length: PosFloat, fade_type: FadeType, )
Source§fn fade_all_mix_controls_to(
&mut self,
target_volume: PosFloat,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_all_mix_controls_to( &mut self, target_volume: PosFloat, fade_length: PosFloat, fade_type: FadeType, )
main, to
the given volume (0.0 to 1.0), using the given fading curve, over the
given time period (in seconds). Read moreSource§fn fade_all_mix_controls_except_main_to(
&mut self,
target_volume: PosFloat,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_all_mix_controls_except_main_to( &mut self, target_volume: PosFloat, fade_length: PosFloat, fade_type: FadeType, )
main, to the
given volume (0.0 to 1.0), using the given fading curve, over the given
time period (in seconds). Read moreSource§fn fade_mix_control_out(
&mut self,
control_name: CompactString,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_mix_control_out( &mut self, control_name: CompactString, fade_length: PosFloat, fade_type: FadeType, )
Source§fn fade_prefixed_mix_controls_out(
&mut self,
control_prefix: CompactString,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_prefixed_mix_controls_out( &mut self, control_prefix: CompactString, fade_length: PosFloat, fade_type: FadeType, )
Source§fn fade_all_mix_controls_out(
&mut self,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_all_mix_controls_out( &mut self, fade_length: PosFloat, fade_type: FadeType, )
main,
to zero volume, using the given fading curve, over the given time
period (in seconds). When the fade is complete, the MixControl will be
removed from existence rather than simply zeroed; future commands to
“prefixed” and “all” will not resuscitate it (unless it is the target
of a future, specific command). Read moreSource§fn fade_all_mix_controls_except_main_out(
&mut self,
fade_length: PosFloat,
fade_type: FadeType,
)
fn fade_all_mix_controls_except_main_out( &mut self, fade_length: PosFloat, fade_type: FadeType, )
main,
to zero volume, using the given fading curve, over the given time
period (in seconds). When the fade is complete, the MixControl will be
removed from existence rather than simply zeroed; future commands to
“prefixed” and “all” will not resuscitate it (unless it is the target
of a future, specific command). Read moreSource§fn kill_mix_control(&mut self, control_name: CompactString)
fn kill_mix_control(&mut self, control_name: CompactString)
Source§fn kill_prefixed_mix_controls(&mut self, control_prefix: CompactString)
fn kill_prefixed_mix_controls(&mut self, control_prefix: CompactString)
Source§fn kill_all_mix_controls(&mut self)
fn kill_all_mix_controls(&mut self)
main, as if you yanked an audio
cable. Read moreSource§fn kill_all_mix_controls_except_main(&mut self)
fn kill_all_mix_controls_except_main(&mut self)
main, as if you yanked an audio
cable. Read moreSource§fn start_flow(
&mut self,
flow_name: CompactString,
target_volume: PosFloat,
fade_length: PosFloat,
fade_type: FadeType,
)
fn start_flow( &mut self, flow_name: CompactString, target_volume: PosFloat, fade_length: PosFloat, fade_type: FadeType, )
fade_flow_to. Read more