1
# Copyright (C) 2006 Aren Olson
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 1, or (at your option)
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
import time, os, gtk, subprocess, xl.media
19
from gettext import gettext as _
20
import xl.plugins as plugins
22
PLUGIN_NAME = _("Sound Juicer")
23
PLUGIN_AUTHORS = ['Aren Olson <reacocard@gmail.com>']
24
PLUGIN_VERSION = '0.1.3'
25
PLUGIN_DESCRIPTION = _(r"""Allows importing of cds with sound-juicer.""")
27
PLUGIN_ENABLED = False
29
PLUGIN_ICON = w.render_icon('gtk-cdrom', gtk.ICON_SIZE_MENU)
36
def launch_sound_juicer(widget):
37
args = ['sound-juicer']
38
subprocess.Popen(args, stdout=-1, stderr=-1)
42
Adds the 'Import CD' menuitem.
44
global SETTINGS, APP, MENU_ITEM
47
ret = subprocess.call(['sound-juicer', '--help'], stdout=-1, stderr=-1)
49
raise plugins.PluginInitException(_("Sound Juicer was not found in your $PATH. "
50
"Disabling the Sound Juicer plugin."))
53
menu = APP.xml.get_widget('file_menu_menu')
54
MENU_ITEM = gtk.ImageMenuItem(_('Import Disc'))
55
MENU_ITEM.label = gtk.Label(_('Import Disc'))
56
MENU_ITEM.connect('activate',launch_sound_juicer)
58
image.set_from_stock('gtk-cdrom', gtk.ICON_SIZE_MENU)
59
MENU_ITEM.set_image(image)
60
menu.append(MENU_ITEM)
61
menu.reorder_child(MENU_ITEM,5)
67
Removes the 'Import CD' menuitem.