def __init__(self, app): self.app = app self.xs = xmms.get() self.on_display = False self.info = None self.fetcher_thread = None self.results_fetcher_thread = None self.lock = threading.RLock() self.input = widgets.InputEdit(caption='search lyricwiki.org > ') urwid.connect_signal(self.input, 'done', self.search) self.info_w = urwid.Text('') self.llb = LyricsListBox([]) self.llbw = urwid.Padding(self.llb, 'center', ('relative', 95)) self.rlb = ResultsListBox(self, []) blank = urwid.Text('') self.__super.__init__([('flow', self.input), ('flow', self.info_w), ('flow', blank), self.llbw], 3) signals.connect('xmms-playback-current-info', self.on_xmms_playback_current_info)
def __init__(self, pls_name, fields, size=100): self.xs = xmms.get() self.name = pls_name c = self.xs.coll_get(pls_name, 'Playlists') super(PlaylistFeeder, self).__init__(c, fields, size) signals.connect('xmms-playlist-changed', self._on_playlist_changed)
def __init__(self, app): self.__super.__init__(PlaylistSwitcherWalker()) self.xs = xmms.get() self.app = app self.cur_active = self.xs.playlist_current_active() self.active_pos = 0 self._set_active_attr(None, self.cur_active) signals.connect('xmms-playlist-loaded', self.on_xmms_playlist_loaded) signals.connect('xmms-collection-changed', self.on_xmms_collection_changed)
def __init__(self): self.xs = xmms.get() self.focus = 0 self.rows = {} self.playlists = [] self.nplaylists = 0 signals.connect('xmms-collection-changed', self.on_xmms_collection_changed) signals.connect('xmms-playlist-changed', self.on_xmms_playlist_changed) self._load()
def __init__(self, collection, fields, size=100): super(CollectionFeeder, self).__init__() self.xs = xmms.get() self._collection = collection self.fields = fields self.infos = {} self.size = size self.window = [0, 0] self.ids = None self.len = 0 self.reload_ids() signals.connect('xmms-medialib-entry-changed', self.on_medialib_entry_changed)
def __init__(self, app): self.app = app self.xs = xmms.get() self.info = {} self.ctx = {} self.time = 0 self.status = self.xs.playback_status() self.parser = mif.FormatParser(self.app.config.format('header')) self.text = urwid.Text('') self.__super.__init__(self.text) signals.connect('xmms-playback-status', self.on_xmms_playback_status) signals.connect('xmms-playback-current-info', self.on_xmms_playback_current_info) signals.connect('xmms-playback-playtime', self.on_xmms_playback_playtime) self.xs.playback_current_info(self.on_xmms_playback_current_info, sync=False)
def __init__(self, app, show_cover=True, formatname='nowplaying'): self.xs = xmms.get() self.app = app self.show_cover = show_cover self.format = formatname self.parser = mif.FormatParser(self.app.config.format(formatname)) self.ctx = self.info = {} self.cur_hash = None self.status = self.xs.playback_status() self.time = 0 self.progress = urwid.ProgressBar('progress-normal', 'progress-complete', 0, 100, 'progress-smooth') self.song = urwid.Text('', align='right') if self.show_cover: self.cover = AlbumCoverWidget(maxcols=65, align='center', valign='top') cover_w = self.cover else: cover_w = urwid.SolidFill(' ') fill = urwid.SolidFill(' ') w = urwid.Columns([ ('fixed', 1, fill), cover_w, ('fixed', 2, fill), urwid.Filler( urwid.Pile([('flow', self.song), ('fixed', 1, urwid.SolidFill(' ')), ('flow', self.progress)]), 'top'), ('fixed', 1, fill), ]) self.__super.__init__(w) signals.connect('xmms-playback-status', self.on_xmms_playback_status) signals.connect('xmms-playback-current-info', self.on_xmms_playback_current_info) signals.connect('xmms-playback-playtime', self.on_xmms_playback_playtime) self.xs.playback_current_info(self.on_xmms_playback_current_info, sync=False)
def __init__(self, app): self.xs = xmms.get() self.app = app self.lb = SearchListBox('simple', self.app) self.input = widgets.InputEdit(caption='quick search: ') if self.app.config.search_find_as_you_type: urwid.connect_signal(self.input, 'change', self._on_query_change) urwid.connect_signal(self.input, 'done', self._on_done) urwid.connect_signal(self.input, 'abort', lambda w: self.set_focus(self.lb)) urwid.connect_signal(self.input, 'abort', lambda w: self.input.set_edit_text('')) self.prev_q = '' self.lock = threading.RLock() self._timer = None self.__super.__init__([('flow', urwid.AttrWrap(self.input, 'searchinput')), self.lb], 0)
def __init__(self, config_path=None): self.xs = xmms.get() self.config = config.Config(config_path) self.cm = commands.CommandManager(self.config) self.colors = 8 self.show_key = False self._pipe = os.pipe() self.need_redraw = True def _need_redraw(): self.need_redraw = True signals.connect('need-redraw', _need_redraw) if not self.xs.connected: if self.config.autostart_server: os.system('xmms2-launcher') if not self.xs.connect(): print >> sys.stderr, "error: couldn't connect to server" sys.exit(0)
def __init__(self, app): self.xs = xmms.get() self.app = app self.lb = SearchListBox('simple', self.app) self.input = widgets.InputEdit(caption='quick search: ') if self.app.config.search_find_as_you_type: urwid.connect_signal(self.input, 'change', self._on_query_change) urwid.connect_signal(self.input, 'done', self._on_done) urwid.connect_signal(self.input, 'abort', lambda w: self.set_focus(self.lb)) urwid.connect_signal(self.input, 'abort', lambda w: self.input.set_edit_text('')) self.prev_q = '' self.lock = threading.RLock() self._timer = None self.__super.__init__( [('flow', urwid.AttrWrap(self.input, 'searchinput')), self.lb], 0)
def __init__(self, app, show_cover=True, formatname='nowplaying'): self.xs = xmms.get() self.app = app self.show_cover = show_cover self.format = formatname self.parser = mif.FormatParser(self.app.config.format(formatname)) self.ctx = self.info = {} self.cur_hash = None self.status = self.xs.playback_status() self.time = 0 self.progress = urwid.ProgressBar('progress-normal', 'progress-complete', 0, 100, 'progress-smooth') self.song = urwid.Text('', align='right') if self.show_cover: self.cover = AlbumCoverWidget(maxcols=65, align='center', valign='top') cover_w = self.cover else: cover_w = urwid.SolidFill(' ') fill = urwid.SolidFill(' ') w = urwid.Columns([('fixed', 1, fill), cover_w, ('fixed', 2, fill), urwid.Filler(urwid.Pile([('flow', self.song), ('fixed', 1, urwid.SolidFill(' ')), ('flow', self.progress)]), 'top'), ('fixed', 1, fill), ]) self.__super.__init__(w) signals.connect('xmms-playback-status', self.on_xmms_playback_status) signals.connect('xmms-playback-current-info', self.on_xmms_playback_current_info) signals.connect('xmms-playback-playtime', self.on_xmms_playback_playtime) self.xs.playback_current_info(self.on_xmms_playback_current_info, sync=False)
def __init__(self, app, body): self.xs = xmms.get() self.app = app self.__super.__init__(body)