Skip to content

Commit

Permalink
python3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongyihui committed Jul 10, 2018
1 parent df794f1 commit d8b3568
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions avs/player/mpg123_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,26 @@ def play(self, uri):
self.event.set()

if self.process and self.process.poll() == None:
os.write(self.tty, 'q')
os.write(self.tty, b'q')

self.state = 'PLAYING'

def stop(self):
if self.process and self.process.poll() == None:
os.write(self.tty, 'q')
os.write(self.tty, b'q')
self.state = 'NULL'

def pause(self):
if self.state == 'PLAYING':
self.state = 'PAUSED'
os.write(self.tty, 's')
os.write(self.tty, b's')

print('pause()')

def resume(self):
if self.state == 'PAUSED':
self.state = 'PLAYING'
os.write(self.tty, 's')
os.write(self.tty, b's')

# name: {eos, ...}
def add_callback(self, name, callback):
Expand Down
6 changes: 3 additions & 3 deletions avs/player/mpv_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def play(self, uri):
self.event.set()

if self.process and self.process.poll() == None:
os.write(self.tty, 'q')
os.write(self.tty, b'q')

self.state = 'PLAYING'

def stop(self):
if self.process and self.process.poll() == None:
os.write(self.tty, 'q')
os.write(self.tty, b'q')
self.state = 'NULL'

def pause(self):
Expand All @@ -63,7 +63,7 @@ def pause(self):
def resume(self):
if self.state == 'PAUSED':
self.state = 'PLAYING'
os.write(self.tty, ' ')
os.write(self.tty, b' ')

# name: {eos, ...}
def add_callback(self, name, callback):
Expand Down

0 comments on commit d8b3568

Please sign in to comment.