mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
make .command() behave the same way for mplayer and mpv
This commit is contained in:
parent
be3393fcb4
commit
6af7933084
1 changed files with 4 additions and 3 deletions
|
@ -390,15 +390,16 @@ class SimpleMplayerSlaveModePlayer(SimpleMplayerPlayer):
|
||||||
)
|
)
|
||||||
self._wait_for_termination()
|
self._wait_for_termination()
|
||||||
|
|
||||||
def command(self, text: str) -> None:
|
def command(self, *args) -> None:
|
||||||
"""Send a command over the slave interface.
|
"""Send a command over the slave interface.
|
||||||
|
|
||||||
The trailing newline is automatically added."""
|
The trailing newline is automatically added."""
|
||||||
self._process.stdin.write(text.encode("utf8") + b"\n")
|
str_args = [str(x) for x in args]
|
||||||
|
self._process.stdin.write(" ".join(str_args).encode("utf8") + b"\n")
|
||||||
self._process.stdin.flush()
|
self._process.stdin.flush()
|
||||||
|
|
||||||
def seek_relative(self, secs: int) -> None:
|
def seek_relative(self, secs: int) -> None:
|
||||||
self.command(f"seek {secs} 0")
|
self.command("seek", secs, 0)
|
||||||
|
|
||||||
def toggle_pause(self):
|
def toggle_pause(self):
|
||||||
self.command("pause")
|
self.command("pause")
|
||||||
|
|
Loading…
Reference in a new issue