Changeset 522
- Timestamp:
- 12/17/06 22:00:28 (2 years ago)
- Files:
-
- trunk/Makefile.in (modified) (3 diffs)
- trunk/etc/mesk-0.3.0.ebuild (modified) (1 diff)
- trunk/src/audio_control.py (modified) (5 diffs)
- trunk/src/cdrom_control.py (modified) (3 diffs)
- trunk/src/devices.py (modified) (1 diff)
- trunk/src/mesk/audio/cdaudio.py (modified) (1 diff)
- trunk/src/mesk/uri.py (modified) (1 diff)
- trunk/src/playlist_control.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Makefile.in
r500 r522 35 35 36 36 .PHONY: all install uninstall clean distclean maintainer-clean dist changelog \ 37 tags TAGS release \ 38 www push-www 37 tags TAGS release www push-www 39 38 40 39 all: module etc/mesk.desktop README … … 47 46 ./po etc/mesk.desktop.in etc/mesk.desktop 48 47 49 install: all 48 # Install does not depend on 'all', since install may be run as root doing 49 # build files would be created in the local dir owned as root. 50 install: 51 test -d build 50 52 ${PYTHON} setup.py install --prefix=${prefix} 51 53 … … 77 79 install -m 755 -d ${mandir} 78 80 install -m 755 -d ${mandir}/man1 79 cat etc/mesk.1 | gzip - > etc/mesk.1.gz80 install -m 644 etc/mesk.1.gz ${mandir}/man181 install -m 644 etc/mesk.1 ${mandir}/man1 82 gzip -f -9 ${mandir}/man1/mesk.1 81 83 82 84 # Desktop file trunk/etc/mesk-0.3.0.ebuild
r517 r522 25 25 =>sys-apps/eject-2.1.5 26 26 =dev-python/cddb-py-1.4* 27 =media-plugins/gst-plugins-cdio-0.10* 27 28 mad? (=media-plugins/gst-plugins-mad-0.10* 28 29 >=dev-python/eyeD3-0.6.10) trunk/src/audio_control.py
r513 r522 369 369 args = keywords 370 370 371 mesk.log.debug('AudioControl.enqueue_source: %s' % str(args)) 371 372 def arg_value(key): 372 373 try: … … 417 418 self._set_source(src) 418 419 except Exception, ex: 420 mesk.log.error('enqueue_source error: %s' % str(ex)) 419 421 self.emit('error', ex, src) 420 422 return … … 429 431 430 432 def _set_source(self, src): 433 mesk.log.debug("AudioControl._set_source %s %s" % (str(src), 434 str(src.uri))) 431 435 if src and src.uri.scheme.startswith('http'): 432 436 base_uri = os.path.dirname(str(src.uri)) … … 506 510 msg = 'Unable to locate a valid Gstreamer sync' 507 511 mesk.log.error(msg) 508 raise Exception(msg)512 raise mesk.MeskException(msg) 509 513 510 514 if self._gst_bin: 515 # Cleanup existing bin 511 516 self._gst_bin.set_state(gst.STATE_NULL) 512 517 del self._gst_bin … … 520 525 bus.connect('message', self._on_gst_message) 521 526 527 self._gst_bin.connect('notify::source', self._on_gst_source_notify) 522 528 self._gst_bin.set_state(gst.STATE_READY) 529 530 def _on_gst_source_notify(self, bin, pspec): 531 from mesk.audio.cdaudio import CDAudioSource 532 src_elem = bin.get_property('source') 533 # If the source is CD audio, make sure to select the proper device 534 if (src_elem and ('device' in dir(src_elem.props)) and 535 isinstance(self._current_audio_src, CDAudioSource)): 536 src_elem.set_property('device', 537 self._current_audio_src.block_device) 523 538 524 539 ### Gstreamer Sink Creation ### trunk/src/cdrom_control.py
r521 r522 40 40 self.device = self.device_manager.get_optical_devices()[self.hal_udi] 41 41 self.block_device = self.device.GetProperty('block.device') 42 display_name = self.device_manager.get_device_display_name(self.device) 43 self.name = display_name 42 44 43 45 # Check capabilities … … 49 51 # Setup tab label 50 52 tab_label = self.tab_label_xml.get_widget('playlist_tab_label') 51 display_name = self.device_manager.get_device_display_name(self.device)52 53 tab_label.set_text(display_name) 53 54 tab_label_img = self.tab_label_xml.get_widget('playlist_tab_image') … … 147 148 metadata.time_secs = length 148 149 metadata.track_num = i + 1 149 pl.append(CDAudioSource(metadata.track_num, metadata)) 150 pl.append(CDAudioSource(self.block_device, metadata.track_num, 151 metadata)) 150 152 151 153 minus = disc_info[i + 3] / 75 trunk/src/devices.py
r521 r522 72 72 73 73 dev_file = os.path.basename(device.GetProperty('block.device')) 74 return '%s (%s)' % (capability, dev_file)74 return '%s(%s)' % (capability, dev_file) 75 75 76 76 def get_device_monitor(self): trunk/src/mesk/audio/cdaudio.py
r517 r522 27 27 28 28 class CDAudioSource(AudioSource): 29 def __init__(self, track_num, meta_data=None):29 def __init__(self, device, track_num, meta_data=None): 30 30 # gnomevfs does not like cdda:// uris, workaround 31 31 AudioSource.__init__(self, "file://dummy", meta_data) 32 32 self.uri = mesk.uri.CddaURI(track_num) 33 33 34 self.block_device = device 34 35 if not meta_data: 35 36 self.meta_data = AudioMetaData() trunk/src/mesk/uri.py
r517 r522 23 23 24 24 class CddaURI(object): 25 '''This is here because gnomevfs.URI is not extensible and does not like 26 cdda:// schemes.''' 25 27 def __init__(self, track_num): 26 self.uri = 'cdda://%d' % track_num 28 self.scheme = 'cdda' 29 self.path = '%d' % track_num 30 self.uri = '%s://%s' % (self.scheme, self.path) 31 def __str__(self): 32 return self.uri 27 33 28 34 def is_uri(uri): trunk/src/playlist_control.py
r520 r522 88 88 self.tab_widget.connect('button-press-event', 89 89 self._on_playlist_tab_ebox_button_press_event) 90 self.tab_widget.connect('key-press-event',91 self._on_playlist_tab_key_press_event)92 90 self.tab_label_label = \ 93 91 self.tab_label_xml.get_widget('playlist_tab_label') … … 186 184 append_text_column(_('Time'), MODEL_TIME, expand = False) 187 185 188 # Load playlist189 186 if mesk.log.getLogger().isEnabledFor(mesk.log.DEBUG): 190 187 # Debugging load time 191 188 import time 192 189 t1 = time.time() 190 # Load playlist 193 191 pl = mesk.playlist.load(self._pl_config.uri, name=self._pl_config.name) 194 # FIXME: Is this what's fucking up the restart position?195 pl.set_curr_index(-1)196 192 if mesk.log.getLogger().isEnabledFor(mesk.log.DEBUG): 197 193 # Debugging load time … … 291 287 ] 292 288 293 def set_active(self, active = True, audio_ctrl =None):289 def set_active(self, active=True, audio_ctrl=None): 294 290 295 291 if not active: … … 794 790 except ValueError: 795 791 mesk.log.warn("Invalid queue index: %d" % old) 796 797 def _on_playlist_tab_key_press_event(self, widget, event):798 # XXX: I don't see this getting called799 sys.stderr.write("_on_playlist_tab_key_press_even called!!\n")800 return self._on_playlist_control_key_press_event(widget, event)801 792 802 793 def _on_playlist_view_key_press_event(self, widget, event):
