Skip to content

Commit 2c57788

Browse files
committed
Implement toggle pause command, by sending pause without argument
1 parent 1f81b55 commit 2c57788

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ impl<S: Read + Write> Client<S> {
166166
self.run_command("stop", ()).and_then(|_| self.expect_ok())
167167
}
168168

169+
/// Toggle pause state
170+
pub fn toggle_pause(&mut self) -> Result<()> {
171+
self.run_command("pause", ()).and_then(|_| self.expect_ok())
172+
}
173+
169174
/// Set pause state
170175
pub fn pause(&mut self, value: bool) -> Result<()> {
171176
self.run_command("pause", value as u8).and_then(|_| self.expect_ok())

0 commit comments

Comments
 (0)