483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
|
#--------------------------- actions ---------------------------------
# Invoke action.play() for current station.
# Can be overridden to provide channel-specific "play" alternative
def play(self):
row = self.row()
if row:
# playlist and audio type
audioformat = row.get("format", self.audioformat)
listformat = row.get("listformat", self.listformat)
# invoke audio player
action.play(row["url"], audioformat, listformat, row)
else:
self.status("No station selected for playing.")
return row
# Start streamripper/youtube-dl/etc
def record(self):
row = self.row()
if row:
audioformat = row.get("format", self.audioformat)
listformat = row.get("listformat", self.listformat)
action.record(row.get("url"), audioformat, listformat, row=row)
return row
#--------------------------- utility functions -----------------------
|
|
|
|
|
|
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
|
#--------------------------- actions ---------------------------------
# Invoke action.play() for current station.
# Can be overridden to provide channel-specific "play" alternative
def play(self):
row = self.row()
if row and "url" in row:
# playlist and audio type
audioformat = row.get("format", self.audioformat)
listformat = row.get("listformat", self.listformat)
# invoke audio player
action.play(row, audioformat, listformat)
else:
self.status("No station selected for playing.")
return row
# Start streamripper/youtube-dl/etc
def record(self):
row = self.row()
if row and "url" in row:
audioformat = row.get("format", self.audioformat)
listformat = row.get("listformat", self.listformat)
action.record(row, audioformat, listformat)
return row
#--------------------------- utility functions -----------------------
|