Changeset 55

Show
Ignore:
Timestamp:
02/25/06 23:55:42 (3 years ago)
Author:
nicfit
Message:

More queueing infastructure

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/mesk/playlist.py

    r51 r55  
    5555        self._sources = [] 
    5656        self._history = [] 
     57        # Queued indexes where the beginning of the list is the next source 
    5758        self._queue = [] 
    5859        self._curr_idx = -1 
     
    231232        return prev 
    232233 
     234    def get_queue_size(self): 
     235        return len(self._queue) 
     236 
     237    def enqueue(self, idx): 
     238        # Test idx 
     239        self._sources[idx] 
     240        # FIXME: Need to keep queue in sync and make sure model is updated 
     241        if idx in self._queue: 
     242            self._queue.remove(idx) 
     243        self._queue.append(idx) 
     244 
    233245    def get_length(self): 
    234246        return len(self._sources) 
  • trunk/src/playlist_control.py

    r54 r55  
    260260        elif event.keyval == gtk.keysyms.q: 
    261261            selected_rows = self.get_selected_rows() 
    262             print "queue", selected_rows 
     262            queue_pos = self._playlist.get_queue_size() + 1 
     263            # FIXME: BEGIN HERE 
     264            for row, iter in selected_rows: 
     265                self._playlist.enqueue(row) 
     266                self._pl_model.set_value(iter, COL_STATUS_TEXT, 
     267                                         '[%d]' % queue_pos) 
     268                queue_pos += 1 
    263269        elif event.keyval == gtk.keysyms.slash: 
    264270            print "search"