本文整理汇总了Python中playlist.Playlist.update方法的典型用法代码示例。如果您正苦于以下问题:Python Playlist.update方法的具体用法?Python Playlist.update怎么用?Python Playlist.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Mpd_factory
# 需要导入模块: from playlist import Playlist [as 别名]
# 或者: from playlist.Playlist import update [as 别名]
class Mpd_factory(ReconnectingClientFactory, Client):
'''
Twisted Reconnecting client factory for mpd server
convert all UPnP and OpenHome service function to mpd remote calls
'''
_mtlist = ''
_muted = True
_rate = "1"
_state = "pending"
_track_duration = '0:00:00.000'
ohduration = 0
_track_URI = ''
_volume = 100
active_source = 0
attributes = 'Info Time Volume'
balance = 0
balancemax = 10
bitdepth = 0
bitrate = 0
cancelplay = False
codecname = 'MP3'
counter = 0
detailscount = 0
fade = 0
fademax = 10
idArray = ''
lossless = False
maxid = 0
max_volume = 100
metadata = {}
metadata_str = 'NOT_IMPLEMENTED'
metatext = ''
metatextcount = 0
mimetypes = ['audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/mpegurl',
'audio/vnd.rn-realaudio', 'audio/vorbis', 'audio/x-flac',
'audio/x-mp3', 'audio/x-mpegurl', 'audio/x-ms-wma',
'audio/x-musepack', 'audio/x-oggflac', 'audio/x-pn-realaudio',
'audio/x-scpls', 'audio/x-speex', 'audio/x-vorbis',
'audio/x-wav', 'application/x-ogm-audio',
'audio/x-vorbis+ogg', 'audio/ogg']
mtlist = ''
name = "MpdPlayer"
oh_state = 'Buffering'
old_vol = 0
parent = None
reltime = '0:00:00.000'
repeat = False
room = 'Home'
samplerate = 0
seconds = 0
shuffle = False
songid = 0
sources = ['Playlist']
sourceindex = 0
upnp_state = "TRANSITIONNING"
volumeunity = 3
volumemillidbperstep = 600
timer = None
token = 0
trackcount = 0
tracksmax = 0
transport_actions = ['PLAY']
# ohduration = 0
def __init__(self, cover_dir, net_type='lan'):
self.connected = False
self.net_type = net_type
self.proto = MpdProtocol()
self.proto._event = self.dispatch_event
self.status = {'state': 'stop'}
self.playlist = Playlist(self)
self.waiting = False
self.calls = []
self.cover_dir = cover_dir
self._sources = [OrderedDict(sorted(
{'Name': '_'.join((self.name, n)),
'Type': n,
'Visible': True}.
items(), key=lambda t: t[0])) for n in self.sources]
self.sourcexml = dict2xml(
{'SourceList': [{'Source': n} for n in self._sources]})
self.protocolinfo = self.mtlist = 'http-get:*:' + ''\
.join([':*,http-get:*:'.join(self.mimetypes)]) + ':*'
def buildProtocol(self, addr):
return self.proto
'''
Internal functions
'''
def dispatch_event(self, events=None):
def set_connected():
self.connected = True
p = self.call('plchanges', self.playlist.plsversion)
p.addCallback(self.playlist.update)
d = None
#.........这里部分代码省略.........