def request_file(self, obj):
"""
Called upon when the user requests a file by clicking "Request" on a recording.
:param obj: ToggleButton object
:return: None
"""
role = self.app.config.get('ChatSettings', 'role')
if role == 'ARTIST':
# Get filename of the high quality clip associated with this play button
filename = self.app.get_own_state()['audio_files'][obj.clip_no]
_, tail = os.path.split(filename)
# Get base name
# root, _ = os.path.splitext(tail)
# Get filename of the session high quality audio stream
hq_audio = self.app.config.get_file_name(self.app.session_name, tail)
print "Requesting {}".format(tail)
# Send a sync message to request a file.
self.app.chat_client.send_sync(constants.SYNC_REQUEST_FILE,
filename=tail)
elif role == 'PRODUCER':
self.app.chat_client.send_sync(constants.SYNC_REQUEST_FILE, filename=obj.filename)
评论列表
文章目录