Tracks: Add TypeMap to Handles.

Adds a shared TypeMap per TrackHandle. This should greatly simplify the user experience for attaching additional per-track state which the driver does not care for.
This commit is contained in:
Kyle Simpson
2021-01-02 23:43:28 +00:00
parent 873458d288
commit d42e09f72b
4 changed files with 47 additions and 9 deletions

View File

@@ -382,9 +382,12 @@ pub fn create_player(source: Input) -> (Track, TrackHandle) {
create_player_with_uuid(source, Uuid::new_v4())
}
/// Refer to the documentation for [`create_player`] however, allows for a custom uuid to be inserted into the Track and Handle
/// Creates a [`Track`] and [`TrackHandle`] as in [`create_player`], allowing
/// a custom UUID to be set.
///
/// [`create_player`]: create_player
/// [`Track`]: Track
/// [`TrackHandle`]: TrackHandle
pub fn create_player_with_uuid(source: Input, uuid: Uuid) -> (Track, TrackHandle) {
let (tx, rx) = mpsc::unbounded_channel();
let can_seek = source.is_seekable();