Input: Allow Restartable sources to be lazy
This change is made with queue users in mind. Since sources of this kind *know* how to (re)create themselves, they can avoid being created at all until needed. This also adds machinery to preload tracks *before* they are needed, for gapless playback on queues and so on. Queues make use of the event system to do this.
This commit is contained in:
@@ -30,6 +30,8 @@ pub enum TrackCommand {
|
||||
Request(OneshotSender<Box<TrackState>>),
|
||||
/// Change the loop count/strategy of this track.
|
||||
Loop(LoopState),
|
||||
/// Prompts a track's input to become live and usable, if it is not already.
|
||||
MakePlayable,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for TrackCommand {
|
||||
@@ -48,6 +50,7 @@ impl std::fmt::Debug for TrackCommand {
|
||||
Do(_f) => "Do([function])".to_string(),
|
||||
Request(tx) => format!("Request({:?})", tx),
|
||||
Loop(loops) => format!("Loop({:?})", loops),
|
||||
MakePlayable => "MakePlayable".to_string(),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user