def __init__(self, parent): ListboxPlugin.__init__(self, parent) self.titles = ["Video"] root = path('/Users/snoe/media/video') self.current = root self.items = self.get_items(root) self.listbox.Bind(wx.EVT_LEFT_UP, self.on_click) self.listbox.set_items(self.items)
def __init__(self, parent): ListboxPlugin.__init__(self, parent) self.artcache = covers.cache_covers(API.config.mp3path, [80, 80]) # Top level lists as we hit escape self.levelorder = ( ("Albums", API.library.get_album_names), ("Artists", API.library.get_artist_names), ("Songs", API.library.get_song_names), ("Genres", API.library.get_genres), ("Playlists", API.library.get_playlists), ) # start on levelindex + 1 (songs) # start on songs because otherwise # you'll see horizontal scrollbars self.levelindex = 1 # initially populate with our list self.history = [] # get our items self.all = (("All", None, None),) title, items = self.get_next_level() self.update_titles(title) # sets up a scrolling list of items self.listbox.Bind(wx.EVT_LEFT_UP, self.on_click) self.listbox.set_items(items) self.Bind(wx.EVT_SET_FOCUS, self.on_focus) mg = MouseGestures(self, Auto=False, MouseButton=wx.MOUSE_BTN_LEFT) mg.SetGesturesVisible(True) mg.AddGesture("D", API.media.change_volume, -0.5) mg.AddGesture("U", API.media.change_volume, 0.5) mg.AddGesture("R", API.media.next) mg.AddGesture("L", API.media.previous) # self.attach_gestures(self.content, mg) API.media.attach("current", self.check_current)