Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracks: Remove box around TrackState #84

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tracks/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub enum TrackCommand {
AddEvent(EventData),
/// Run some closure on this track, with direct access to the core object.
Do(Box<dyn FnOnce(&mut Track) + Send + Sync + 'static>),
/// Request a read-only view of this track's state.
Request(Sender<Box<TrackState>>),
/// Request a copy of this track's state.
Request(Sender<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.
Expand Down
2 changes: 1 addition & 1 deletion src/tracks/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl TrackHandle {
}

/// Request playback information and state from the audio context.
pub async fn get_info(&self) -> TrackResult<Box<TrackState>> {
pub async fn get_info(&self) -> TrackResult<TrackState> {
let (tx, rx) = flume::bounded(1);
self.send(TrackCommand::Request(tx))?;

Expand Down
2 changes: 1 addition & 1 deletion src/tracks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl Track {
));
},
Request(tx) => {
let _ = tx.send(Box::new(self.state()));
let _ = tx.send(self.state());
},
Loop(loops) =>
if self.set_loops(loops).is_ok() {
Expand Down