comparison vixm/ui.py @ 16:447b47ab396f

Implemented dequeue the proper way; Cleaned up stupidity in enqueue code
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sun, 20 Aug 2006 00:05:14 -0400
parents ae3451bedeb6
children 1c769ae67af4
comparison
equal deleted inserted replaced
15:ae3451bedeb6 16:447b47ab396f
88 # enqueue 'a songid' 88 # enqueue 'a songid'
89 # enqueue a song songid from LIST_DEFAULT onto 89 # enqueue a song songid from LIST_DEFAULT onto
90 # LIST_PRIO. The enqueued song is added to the 90 # LIST_PRIO. The enqueued song is added to the
91 # end of LIST_PRIO 91 # end of LIST_PRIO
92 # 92 #
93 # dequeue 'd songid' 93 # dequeue '[range]d'
94 # remove songid from LIST_PRIO. The songid is 94 # remove songs in range from LIST_PRIO. The
95 # the id in LIST_PRIO, NOT LIST_DEFAULT 95 # range is in LIST_PRIO, NOT LIST_DEFAULT
96 # 96 #
97 # range: 97 # range:
98 # '' first entry; shortcut for '1' 98 # '' first entry; shortcut for '1'
99 # '%' entire list; shortcut for '1,$' 99 # '%' entire list; shortcut for '1,$'
100 # '$' last entry 100 # '$' last entry
126 "a ([0-9]+)": 126 "a ([0-9]+)":
127 (control.cmd_enqueue, 127 (control.cmd_enqueue,
128 False, 128 False,
129 "a [songid]", 129 "a [songid]",
130 "add songid from default to priority"), 130 "add songid from default to priority"),
131 "d ([0-9]+)": 131 "d":
132 (control.cmd_dequeue, 132 (control.cmd_dequeue,
133 False, 133 True,
134 "d [songid]", 134 "[range]d",
135 "remove songid from priority"), 135 "remove songs in range from priority"),
136 "h": 136 "h":
137 (control.cmd_help, 137 (control.cmd_help,
138 False, 138 False,
139 "h", 139 "h",
140 "this help list"), 140 "this help list"),
141 } 141 }
142
143 def enqueue(self, id):
144 s = self.lists[playlist.LIST_DEFAULT][id]
145 print "Enqueuing song: %s (%s)" % (s["title"],
146 util.strtime(s["time"]))
147 self.lists[playlist.LIST_PRIO].enqueue(s)
148 142
149 def __cmd(self, txt): 143 def __cmd(self, txt):
150 range_str = "(%|\\$|(\\$|[0-9]+){,1}(,(\\$|[0-9]+)){,1}){,1}" 144 range_str = "(%|\\$|(\\$|[0-9]+){,1}(,(\\$|[0-9]+)){,1}){,1}"
151 145
152 cmdtable = self.cmdtable 146 cmdtable = self.cmdtable