[Ap-python-commits] python/examples/aptk playlist.xpm,NONE,1.1 Makefile.am,1.5,1.6 panel.py,1.6,1.7
Status: Beta
Brought to you by:
sjah
From: <sj...@us...> - 2002-07-23 09:03:27
|
Update of /cvsroot/ap-python/python/examples/aptk In directory usw-pr-cvs1:/tmp/cvs-serv797 Modified Files: Makefile.am panel.py playlist.py Added Files: playlist.xpm Log Message: Add playlist support in panel example. --- NEW FILE: playlist.xpm --- /* XPM */ static char * playlist_xpm[] = { "18 18 12 1", " c None", ". c #000000", "+ c #CBCBFF", "@ c #980098", "# c #CB98FF", "$ c #FF9898", "% c #FF3300", "& c #FF9800", "* c #FFCB66", "= c #E68600", "- c #FFCB00", "; c #A0A0A0", " ", " . ", " .+@. ", " .+#+#@. ", " .+++#+##@. ", " .+++#+#####@. ", " .+++++#+#####. ", " .@++++#+#####. ", " ...@+++#+###. ", " ..$%.@#+###.&. ", " .*.$$%.@+#.&%.. ", " =*.$$&%..%.. ", " .**.$$&%.=--. ", " =**.&.=---=.. ", " .**-.--=.. ", " =**=..; ", " ... ", " "}; Index: Makefile.am =================================================================== RCS file: /cvsroot/ap-python/python/examples/aptk/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 19 Jul 2002 07:36:08 -0000 1.5 --- Makefile.am 23 Jul 2002 09:03:25 -0000 1.6 *************** *** 2,4 **** pause.xpm play.xpm prev.xpm r_pan.xpm r_play.xpm stop.xpm panel.py\ play-sm.xpm stop-sm.xpm prev-sm.xpm next-sm.xpm playlist.py current_play.xpm\ ! playtime.xpm track.xpm --- 2,4 ---- pause.xpm play.xpm prev.xpm r_pan.xpm r_play.xpm stop.xpm panel.py\ play-sm.xpm stop-sm.xpm prev-sm.xpm next-sm.xpm playlist.py current_play.xpm\ ! playtime.xpm track.xpm playlist.xpm Index: panel.py =================================================================== RCS file: /cvsroot/ap-python/python/examples/aptk/panel.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** panel.py 22 Jul 2002 16:26:28 -0000 1.6 --- panel.py 23 Jul 2002 09:03:25 -0000 1.7 *************** *** 35,38 **** --- 35,61 ---- pl = alsaplayer.get_playlist () + # Properties + properties = aptk.misc.WidgetProperties ([ + ('.tagsinfo.format', '%a - %t (%y - %l)'), + ('.control.play.button.file', 'play-sm.xpm'), + ('.control.next.button.file', 'next-sm.xpm'), + ('.control.stop.button.file', 'stop-sm.xpm'), + ('.control.prev.button.file', 'prev-sm.xpm'), + ('.control.playlist.button.file', 'playlist.xpm'), + ('*.button.relief', gtk.RELIEF_NONE), + ('.speed.backward.button.file', 'r_play.xpm'), + ('.speed.pause.button.file', 'pause.xpm'), + ('.speed.forward.button.file', 'f_play.xpm'), + ('.pan.left.button.file', 'l_pan.xpm'), + ('.pan.center.button.file', 'c_pan.xpm'), + ('.pan.right.button.file', 'r_pan.xpm'), + ('.control.playlist.list.columns', ('playtime', 'track', 'title', + 'album', 'artist', 'year', + 'genre', 'filename')), + ('.control.playlist.list.playtime.file', 'playtime.xpm'), + ('.control.playlist.list.track.file', 'track.xpm') + ]) + + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Main window win = gtk.Window () *************** *** 48,66 **** win.set_type_hint ("toolbar") ! # Properties ! properties = aptk.misc.WidgetProperties ([ ! ('.tagsinfo.format', '%a - %t (%y - %l)'), ! ('.control.play.button.file', 'play-sm.xpm'), ! ('.control.next.button.file', 'next-sm.xpm'), ! ('.control.stop.button.file', 'stop-sm.xpm'), ! ('.control.prev.button.file', 'prev-sm.xpm'), ! ('.*.*.button.relief', gtk.RELIEF_NONE), ! ('.speed.backward.button.file', 'r_play.xpm'), ! ('.speed.pause.button.file', 'pause.xpm'), ! ('.speed.forward.button.file', 'f_play.xpm'), ! ('.pan.left.button.file', 'l_pan.xpm'), ! ('.pan.center.button.file', 'c_pan.xpm'), ! ('.pan.right.button.file', 'r_pan.xpm') ! ]) ########################################################################## --- 71,90 ---- win.set_type_hint ("toolbar") ! # Create base widgets (always showing) ! hbox = gtk.HBox () ! win.add (hbox) ! ! control = aptk.control.HControl (pl, properties) ! ! shadow_type = gtk.SHADOW_OUT ! control_frame = gtk.Frame () ! control_frame.set_shadow_type (shadow_type) ! ! hbox.pack_start (control_frame, expand = gtk.FALSE) ! control_frame.add (control) ! ! control.show () ! control_frame.show () ! hbox.show () ########################################################################## *************** *** 74,78 **** # - - - - - APTK widgets - control = aptk.control.HControl (pl, properties) tagslabel = aptk.info.TagsLabel (pl, properties) --- 98,101 ---- *************** *** 81,109 **** # - - - - - Frames - control_frame = gtk.Frame () status_frame = gtk.Frame () - shadow_type = gtk.SHADOW_OUT - control_frame.set_shadow_type (shadow_type) status_frame.set_shadow_type (shadow_type) - self.pack_start (control_frame, expand = gtk.FALSE) self.pack_start (tagslabel, expand = gtk.TRUE) self.pack_end (status_frame, expand = gtk.FALSE) # - - - - pack to frames - control_frame.add (control) status_frame.add (status) # - - - - Show widgets - control.show () tagslabel.show () status.show () - control_frame.show () status_frame.show () - # Remember - self.control_widget = control - ############################################################################## class ControlPage (gtk.HBox): --- 104,122 ---- *************** *** 115,119 **** # - - - - - aptk widgets - control = aptk.control.HControl (pl, properties) position = aptk.position.HScale (pl) time_label = aptk.info.TimeLabel (pl, position) --- 128,131 ---- *************** *** 123,127 **** # - - - - Frames - control_frame = gtk.Frame () position_frame = gtk.Frame () speed_frame = gtk.Frame () --- 135,138 ---- *************** *** 129,134 **** volume_frame = gtk.Frame () - shadow_type = gtk.SHADOW_OUT - control_frame.set_shadow_type (shadow_type) position_frame.set_shadow_type (shadow_type) speed_frame.set_shadow_type (shadow_type) --- 140,143 ---- *************** *** 136,140 **** volume_frame.set_shadow_type (shadow_type) - self.pack_start (control_frame, expand = gtk.FALSE) self.add (position_frame) self.add (speed_frame) --- 145,148 ---- *************** *** 143,150 **** # - - - - pack to frames - control_hbox = gtk.HBox () - control_hbox.add (control) - control_frame.add (control_hbox) - position_hbox = gtk.HBox () position_hbox.set_spacing (2) --- 151,154 ---- *************** *** 158,162 **** # - - - - Show all these widgets - control.show () position.show () time_label.show () --- 162,165 ---- *************** *** 164,178 **** pan.show () volume.show () - control_frame.show () position_frame.show () speed_frame.show () pan_frame.show () volume_frame.show () - control_hbox.show () position_hbox.show () - # Remember - self.control_widget = control - ########################################################################### # Create two pages --- 167,176 ---- *************** *** 188,192 **** timeout_id = 0 newmode = 1 ! win.add (info_page) ########################################################## --- 186,190 ---- timeout_id = 0 newmode = 1 ! hbox.add (info_page) ########################################################## *************** *** 204,211 **** # Check if we aren't in control widget - w = mode and info_page or control_page ! alloc = w.control_widget.get_allocation () ! x, y = w.control_widget.get_pointer () if x < 0 or x >= alloc.width or y < 0 or y >= alloc.height: --- 202,208 ---- # Check if we aren't in control widget ! alloc = control.get_allocation () ! x, y = control.get_pointer () if x < 0 or x >= alloc.width or y < 0 or y >= alloc.height: *************** *** 222,230 **** if newmode == 0: ! win.remove (info_page) ! win.add (control_page) else: ! win.remove (control_page) ! win.add (info_page) gdk.threads_leave () --- 219,227 ---- if newmode == 0: ! hbox.remove (info_page) ! hbox.add (control_page) else: ! hbox.remove (control_page) ! hbox.add (info_page) gdk.threads_leave () Index: playlist.py =================================================================== RCS file: /cvsroot/ap-python/python/examples/aptk/playlist.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** playlist.py 22 Jul 2002 16:26:28 -0000 1.5 --- playlist.py 23 Jul 2002 09:03:25 -0000 1.6 *************** *** 37,44 **** 'genre', 'filename')), ('.playlist.list.playtime.file', 'playtime.xpm'), ! ('.playlist.list.track.file', 'track.xpm'), ! ('.playlist.list.title.label', 'îÁÚ×ÁÎÉÅ ÐÅÓÎÉ'.decode ('koi8-r')), ! ('.playlist.list.album.label', 'áÌØÂÏÍ'.decode ('koi8-r')), ! ('.playlist.list.artist.label', 'éÓÐÏÌÎÉÔÅÌØ'.decode ('koi8-r')) ]) --- 37,41 ---- 'genre', 'filename')), ('.playlist.list.playtime.file', 'playtime.xpm'), ! ('.playlist.list.track.file', 'track.xpm') ]) |