Changeset 571
- Timestamp:
- 02/25/07 19:55:43 (2 years ago)
- Files:
-
- trunk/configure.ac (modified) (3 diffs)
- trunk/src/devices.py (modified) (3 diffs)
- trunk/src/main.py (modified) (3 diffs)
- trunk/src/main_window.py (modified) (3 diffs)
- trunk/src/mesk/info.py.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/configure.ac
r566 r571 83 83 if $GST_INSPECT ${element} > /dev/null 2>&1; then 84 84 have_gst_audio_format=yes 85 eval have_ ${element}=yes86 AC_MSG_RESULT([yes]) 87 else 88 eval have_ ${element}=no85 eval have_gst_${element}=yes 86 AC_MSG_RESULT([yes]) 87 else 88 eval have_gst_${element}=no 89 89 AC_MSG_RESULT([no]) 90 90 fi … … 97 97 AC_MSG_CHECKING([checking for gstreamer ${element} plugin]) 98 98 if $GST_INSPECT ${element} > /dev/null 2>&1; then 99 eval have_ ${element}=yes100 AC_MSG_RESULT([yes]) 101 else 102 eval have_ ${element}=no99 eval have_gst_${element}=yes 100 AC_MSG_RESULT([yes]) 101 else 102 eval have_gst_${element}=no 103 103 AC_MSG_RESULT([no]) 104 104 fi 105 105 done 106 106 # mp3 support 107 if test "$have_mad" = "yes"; then 108 ACX_CHECK_EYED3([0.6.11]) 107 HAVE_MP3_SUPPORT="no" 108 if test "$have_gst_mad" = "yes"; then 109 AC_ARG_ENABLE([mp3], 110 AC_HELP_STRING([--disable-mp3], 111 [disable mp3 support (default auto)]), 112 enable_mp3="$enableval", enable_mp3="yes") 113 if test "$enable_mp3" = "yes"; then 114 ACX_CHECK_EYED3([0.6.11]) 115 HAVE_MP3_SUPPORT="yes" 116 fi 117 fi 118 # vorbis support 119 HAVE_OGGVORBIS_SUPPORT="no" 120 if test "$have_gst_ogg" = "yes" && test "$have_gst_vorbisdec" = "yes"; then 121 AC_ARG_ENABLE([oggvorbis], 122 AC_HELP_STRING([--disable-oggvorbis], 123 [disable ogg vorbis support (default auto)]), 124 enable_oggvorbis="$enableval", enable_oggvorbis="yes") 125 if test "$enable_oggvorbis" = "yes"; then 126 # XXX: ogg.vorbis.__version__ (1.2) does not match my install (1.4), 127 # and I don't see a member, no version checking going on 128 ACX_CHECK_PYVORBIS 129 HAVE_OGGVORBIS_SUPPORT="yes" 130 fi 131 fi 132 # CD audio support 133 HAVE_CDROM_SUPPORT="no" 134 if test "$have_gst_cdio" = "yes"; then 135 AC_ARG_ENABLE([cdrom], 136 AC_HELP_STRING([--disable-cdrom], 137 [disable CDROM support (default auto)]), 138 enable_cdrom="$enableval", enable_cdrom="yes") 139 if test "$enable_cdrom" = "yes"; then 140 PKG_CHECK_MODULES([hal], [hal >= 0.5.7]) 141 ACX_CHECK_CDDB_PY([1.4]) 142 AC_CHECK_PROG([have_eject], [eject], [yes], [no]) 143 if test "$have_eject" = "no"; then 144 AC_MSG_ERROR( 145 [The command line util 'eject' is required for CDROM support.]) 146 fi 147 HAVE_CDROM_SUPPORT="yes" 148 fi 149 fi 150 151 # Dbus 152 HAVE_DBUS_SUPPORT="no" 153 AC_ARG_WITH([dbus], 154 AC_HELP_STRING([--disable-dbus], 155 [Disable DBus support. Note that CD audio support requires DBus. (default auto)]), 156 enable_dbus="$enableval", enable_dbus="yes") 157 if test "$enable_dbus" = "yes"; then 158 PKG_CHECK_MODULES([dbus], [dbus-1 >= 0.80]) 159 PKG_CHECK_MODULES([dbusglib], [dbus-glib-1 >= 0.72]) 160 ACX_CHECK_DBUS_PYTHON([0.80]) 161 HAVE_DBUS_SUPPORT="yes" 162 fi 163 # Without DBus we have not CD support 164 if test "$HAVE_DBUS_SUPPORT" = "no" -a "$HAVE_CDROM_SUPPORT" = "yes"; then 165 AC_MSG_WARN([Disabling CDROM support due to lac of DBus]) 166 HAVE_CDROM_SUPPORT="no" 167 fi 168 169 # Although the audio formats can cope with not being supported, DBus and CD 170 # support can be disabled entirely 171 if test "$HAVE_DBUS_SUPPORT" = "yes"; then 172 AC_SUBST([DISABLE_DBUS_SUPPORT], [False]) 109 173 else 110 # FIXME 111 AC_MSG_WARN([TODO]) 112 fi 113 # vorbis support 114 if test "$have_ogg" = "yes" && test "$have_vorbisdec" = "yes"; then 115 # XXX: ogg.vorbis.__version__ (1.2) does not match my install (1.4), 116 # and I don't see a member, no version checking going on 117 ACX_CHECK_PYVORBIS 174 AC_SUBST([DISABLE_DBUS_SUPPORT], [True]) 175 fi 176 if test "$HAVE_CDROM_SUPPORT" = "yes" -a "$HAVE_DBUS_SUPPORT" = "yes"; then 177 AC_SUBST([DISABLE_CDROM_SUPPORT], [False]) 118 178 else 119 # FIXME 120 AC_MSG_WARN([TODO]) 121 fi 122 # CD audio support 123 if test "$have_cdio" = "yes"; then 124 PKG_CHECK_MODULES([hal], [hal >= 0.5.7]) 125 ACX_CHECK_CDDB_PY([1.4]) 126 AC_CHECK_PROG([have_eject], [eject], [yes], [no]) 127 if test "$have_eject" = "no"; then 128 AC_MSG_ERROR( 129 [The command line utility 'eject' is required for CDROM support.]) 130 fi 131 else 132 # FIXME 133 AC_MSG_WARN([TODO]) 134 fi 135 136 # Dbus 137 PKG_CHECK_MODULES([dbus], [dbus-1 >= 0.80]) 138 PKG_CHECK_MODULES([dbusglib], [dbus-glib-1 >= 0.72]) 139 ACX_CHECK_DBUS_PYTHON([0.80]) 179 AC_SUBST([DISABLE_CDROM_SUPPORT], [True]) 180 fi 140 181 141 182 # Done with tests, output files … … 150 191 fi 151 192 AC_OUTPUT 193 194 echo " 195 196 Mesk Configuration: 197 mp3: $HAVE_MP3_SUPPORT 198 ogg vorbis: $HAVE_OGGVORBIS_SUPPORT 199 CD audio: $HAVE_CDROM_SUPPORT 200 DBus: $HAVE_DBUS_SUPPORT 201 " trunk/src/devices.py
r522 r571 21 21 import os 22 22 import gobject 23 import dbus24 23 import mesk, mesk.audio.cdaudio 25 24 … … 36 35 def __init__(self): 37 36 gobject.GObject.__init__(self) 37 self._optical_devices = {} 38 self._device_mon = None 39 40 if mesk.info.DISABLE_DBUS_SUPPORT: 41 mesk.log.info('DeviceMgr is a stub due to DBus being disabled.') 42 return 43 else: 44 import dbus 38 45 39 46 # Init device manager … … 44 51 'org.freedesktop.Hal.Manager') 45 52 46 # Detect optical drives47 self._optical_devices = {}48 for dev_udi in self.hal_manager.FindDeviceByCapability('storage.cdrom'):49 dev_obj = self.bus.get_object('org.freedesktop.Hal', dev_udi)50 dev = dbus.Interface(dev_obj, 'org.freedesktop.Hal.Device')51 52 self._optical_devices[dev_udi] = dev 53 54 self._device_mon = None 53 if not mesk.info.DISABLE_CDROM_SUPPORT: 54 cdroms = self.hal_manager.FindDeviceByCapability('storage.cdrom') 55 # Detect optical drives 56 for dev_udi in cdroms: 57 dev_obj = self.bus.get_object('org.freedesktop.Hal', dev_udi) 58 dev = dbus.Interface(dev_obj, 'org.freedesktop.Hal.Device') 59 60 self._optical_devices[dev_udi] = dev 61 55 62 if self._optical_devices: 56 63 self._device_mon = DeviceMonitor(self._optical_devices.values()) trunk/src/main.py
r568 r571 61 61 for a in args: 62 62 self.remote_opts.append(('--enqueue', a)) 63 # The profile is used for the GUI and to select a dbus service instance63 # The profile is used for the GUI and to select a DBus service instance 64 64 self.profile = self.opts.profile 65 65 … … 71 71 import mesk 72 72 self._init() 73 mesk.log.debug('Testing for existing instance; profile \'%s\'' % 74 self.profile) 75 import dbus_service 76 mesk_running = dbus_service.is_service_running(self.profile) 77 if mesk_running and not self.remote_opts: 78 mesk.log.debug('mesk is running but no remote commands') 79 raise mesk.MeskException(_('Mesk is already running'), 80 _('Another instance of Mesk is using ' 81 'the profile \'%s\'. Try again with ' 82 'a different profile name ' 83 '(-p/--profile)') % self.profile) 84 elif mesk_running: 85 mesk.log.debug('mesk is running, execting remote commands') 86 # Mesk is running and we have some remote control options, 87 # so execute the commands on the remote service and exit 88 import dbus 89 import dbus_service # This is a local module 90 obj_path = dbus_service.get_object_path(self.profile) 91 service = dbus_service.get_service_name(self.profile) 92 session_bus = dbus.SessionBus() 93 obj = session_bus.get_object(service, obj_path) 94 95 mesk_dbus = dbus.Interface(obj, dbus_service.INTERFACE) 96 self._run_remote_commands(mesk_dbus) 97 return 73 74 if not mesk.info.DISABLE_DBUS_SUPPORT: 75 mesk.log.debug('Testing for existing instance; profile \'%s\'' % 76 self.profile) 77 import dbus_service 78 mesk_running = dbus_service.is_service_running(self.profile) 79 if mesk_running and not self.remote_opts: 80 mesk.log.debug('mesk is running but no remote commands') 81 raise mesk.MeskException( 82 _('Mesk is already running'), 83 _('Another instance of Mesk is using the profile \'%s\'. ' 84 'Try again with a different profile name ' 85 '(-p/--profile)') % self.profile) 86 elif mesk_running: 87 mesk.log.debug('mesk is running, execting remote commands') 88 # Mesk is running and we have some remote control options, 89 # so execute the commands on the remote service and exit 90 import dbus 91 import dbus_service # This is a local module 92 obj_path = dbus_service.get_object_path(self.profile) 93 service = dbus_service.get_service_name(self.profile) 94 session_bus = dbus.SessionBus() 95 obj = session_bus.get_object(service, obj_path) 96 97 mesk_dbus = dbus.Interface(obj, dbus_service.INTERFACE) 98 self._run_remote_commands(mesk_dbus) 99 return 100 elif self.remote_opts: 101 raise RemoteControlException('Remote control disabled') 102 98 103 99 104 # Gnome session management … … 118 123 119 124 # Main window 120 import dbus121 125 from main_window import MainWindow 122 126 self.main_window = MainWindow(self.profile) trunk/src/main_window.py
r570 r571 33 33 from about_dialog import AboutDialog 34 34 from playlist_control import PlaylistControl, PlaylistPropertiesDialog 35 from cdrom_control import CDROMControl36 35 from album_cover_control import AlbumCoverControl 37 36 from preference_window import PreferenceWindow 38 37 from dialogs import ErrorDialog, ConfirmationWithDisableOptionDialog 39 38 from status_bar import StatusBar 39 40 40 import devices 41 if mesk.info.DISABLE_CDROM_SUPPORT or mesk.info.DISABLE_DBUS_SUPPORT: 42 class CDROMControl: 43 pass # A stub for type checks 44 else: 45 from cdrom_control import CDROMControl 41 46 42 47 class MainWindow(mesk.window.Window): … … 69 74 self._on_audio_source_tag_update) 70 75 71 # Initialize Dbus service 72 import dbus, dbus_service 73 name = dbus.service.BusName(dbus_service.get_service_name(self.profile), 74 bus=dbus.SessionBus()) 75 self.mesk_dbus = dbus_service.MeskDbusService(name, self.profile, 76 self) 77 mesk.log.verbose("DBus service activated") 76 if not mesk.info.DISABLE_DBUS_SUPPORT: 77 # Initialize Dbus service 78 import dbus, dbus_service 79 service_name = dbus_service.get_service_name(self.profile) 80 bus_name = dbus.service.BusName(service_name, bus=dbus.SessionBus()) 81 self.mesk_dbus = dbus_service.MeskDbusService(bus_name, 82 self.profile, 83 self) 84 mesk.log.verbose("DBus service activated") 85 else: 86 self.mesk_dbus = None 87 mesk.log.info('DBus disabled') 78 88 79 89 self._album_cover_control = AlbumCoverControl(self.xml, … … 126 136 # Register for device changes 127 137 dev_mon = devices.get_mgr().get_device_monitor() 128 dev_mon.connect('media-changed', self._media_changed) 138 if dev_mon: 139 dev_mon.connect('media-changed', self._media_changed) 129 140 130 141 # Initialize plugins trunk/src/mesk/info.py.in
r563 r571 25 25 26 26 INSTALL_PREFIX = '@INSTALL_PREFIX@' 27 DISABLE_CDROM_SUPPORT = @DISABLE_CDROM_SUPPORT@ 28 DISABLE_DBUS_SUPPORT = @DISABLE_DBUS_SUPPORT@ 27 29 28 30 GPLV2_LICENCE = \
