Skip to content

Commit e55bd80

Browse files
committed
make projectM cloneable, fix playlist create
1 parent c7d338a commit e55bd80

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "projectm"
3-
version = "2.0.0-alpha"
3+
version = "2.0.1-alpha"
44
edition = "2021"
55
rust-version = "1.65"
66
authors = ["AnomieVision <[email protected]>"]
@@ -18,4 +18,4 @@ rand = "0.8.5"
1818

1919
[features]
2020
default = ["playlist"]
21-
playlist = []
21+
playlist = []

src/core.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,12 @@ impl ProjectM {
801801

802802
unsafe impl Send for ProjectM {}
803803
unsafe impl Sync for ProjectM {}
804+
805+
// allow cloning the handle
806+
impl Clone for ProjectM {
807+
fn clone(&self) -> Self {
808+
ProjectM {
809+
instance: self.instance.clone(),
810+
}
811+
}
812+
}

src/playlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Playlist {
1313

1414
impl Playlist {
1515
/// Create a new playlist for [Projectm](ProjectMHandle)
16-
pub fn create(projectm: ProjectM) -> Playlist {
16+
pub fn create(projectm: &ProjectM) -> Playlist {
1717
let projectm = projectm.get_instance();
1818
let instance = projectm.borrow_mut();
1919

0 commit comments

Comments
 (0)