Skip to content

Commit

Permalink
Merge pull request #42 from Sinono3/refactor
Browse files Browse the repository at this point in the history
`dbus` module refactor + Volume implementation
  • Loading branch information
Sinono3 committed Jan 5, 2024
2 parents 384539f + dc01a9d commit 2b1e31a
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 474 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dbus-crossroads = { version = "0.5.0", optional = true }
zbus = { version = "3.9", optional = true }
zvariant = { version = "3.10", optional = true }
pollster = { version = "0.3", optional = true }
thiserror = "1.0"

[features]
default = ["use_dbus"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A cross-platform library for handling OS media controls and metadata. One abstra
```shell
# In one shell
$ cd souvlaki
$ cargo run --example example
$ cargo run --example window

# In another shell
$ playerctl metadata
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct MediaMetadata<'a> {
}

/// Events sent by the OS media controls.
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, PartialEq, Debug)]
pub enum MediaControlEvent {
Play,
Pause,
Expand All @@ -42,6 +42,8 @@ pub enum MediaControlEvent {
SeekBy(SeekDirection, Duration),
/// Set the position/progress of the currently playing media item.
SetPosition(MediaPosition),
/// Sets the volume from 0.0 to 1.0.
SetVolume(f64),
/// Open the URI in the media player.
OpenUri(String),

Expand Down
Loading

0 comments on commit 2b1e31a

Please sign in to comment.