cplay-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cplay-dev] Re: cplay-1.49 queue patch


From: Ulf Betlehem
Subject: [cplay-dev] Re: cplay-1.49 queue patch
Date: 04 Feb 2005 15:45:41 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Hello,

This is a feature that I have been missing myself and I would very
much like to include it in cplay-1.50.

Thank you,

ulf

Aaron Ash <address@hidden> writes:

| Hello Ulf,
| I have added a queue feature that is similiar to xmms "q" feature. 
| You can use '&' to add the currently selected song to the queue. 
| Pressing '&' on a song that is already in the queue will remove it. 
| Pressing '*' will add (or remove) the currently tagged songs to the
| queue.  Songs in the queue "override" the random setting and are
| played in the order they are queued in.  Once the queued songs have
| been played, random play is then resumed.  The next command ("n") will
| skip to the next song in the queue if there is any.  The previous
| command ("p") has not been changed and will simply go back one in the
| playlist.
| I have included the full file aswell as the diff file incase there is
| something wrong with the diff file.  It works fine for me though.
| cya.
| Aaron.
| 
| 541a542
| >                                        &, *  : toggle queued current/tagged
| 579a581
| >         self.queued = 0
| 586a589,600
| >     def set_queued(self, value):
| >     self.queued = value
| > 
| >     def is_queued(self):
| >     return self.queued
| >     
| >     def __str__(self):
| >     mark = self.is_tagged() and "#" or " "
| >     num = self.is_queued() or " "
| >     return "%s %s %s%s" % (num, mark, self.vp(), self.slash)
| > 
| > 
| 891a906
| >     self.queue = []
| 905a921,957
| >     self.keymap.bind('&', self.command_toggle_queue, ())
| >     self.keymap.bind('*', self.command_toggle_queue_tagged, ())
| > 
| >     def command_toggle_queue_tagged(self):
| >     if not self.buffer: return
| >     for i in self.buffer:
| >             if i.is_tagged():
| >                     self.enqueue(i)
| >                     i.set_tagged(not i.is_tagged())
| >                     self.update()
| > 
| >     def command_toggle_queue(self):
| >     self.enqueue(self.buffer[self.bufptr])
| > 
| >     def enqueue(self, entry):
| >     if not self.buffer: return
| >     if(entry.is_queued() == 0):
| >             entry.set_queued(len(self.queue) + 1)
| >             self.queue.append(entry)
| >             self.update()
| >     else:
| >             self.dequeue(entry)
| > 
| >     def dequeue(self, entry):
| >     for i in self.queue:
| >             if( i == entry):
| >                     entry.set_queued(0)
| >                     self.queue.remove(i)
| >                     self.refresh_queue()
| >                     break
| > 
| >     def refresh_queue(self):
| >     x = 1
| >     for i in self.queue:
| >             i.set_queued(x)
| >             x = x + 1
| >     self.update()
| 988a1041,1048
| >     if self.queue and direction > 0:
| >             new = self.queue[0]
| >             self.dequeue(new)
| >             new.set_active(1)
| >             old.set_active(0)
| >             self.update()
| >             return new
| > 
| 

-- 
 ulf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]