| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
import os, gtk, util, qltk |
|---|
| 9 |
from plugins.songsmenu import SongsMenuPlugin |
|---|
| 10 |
|
|---|
| 11 |
class SoundConverter(SongsMenuPlugin): |
|---|
| 12 |
PLUGIN_ID = 'Convert Files' |
|---|
| 13 |
PLUGIN_NAME = _('Convert Files') |
|---|
| 14 |
PLUGIN_DESC = 'Convert Files with Soundconverter.' |
|---|
| 15 |
PLUGIN_VERSION = '0.1' |
|---|
| 16 |
PLUGIN_ICON = gtk.STOCK_CONVERT |
|---|
| 17 |
|
|---|
| 18 |
def plugin_songs(self, songs): |
|---|
| 19 |
if not util.iscommand("soundconverter"): |
|---|
| 20 |
ErrorMessage( |
|---|
| 21 |
None, "SoundConverter not found", |
|---|
| 22 |
"The SoundConverter tool was not found. " |
|---|
| 23 |
"You can get SoundConverter at http://soundconverter.berlios.de.").run() |
|---|
| 24 |
else: |
|---|
| 25 |
files = [song['~filename'] for song in songs] |
|---|
| 26 |
try: util.spawn |
|---|
| 27 |
except: |
|---|
| 28 |
if len(files) == 1: filelist = "%r" % files(0) |
|---|
| 29 |
else: filelist = ("%r " * len(files)) % list(reversed(files)) |
|---|
| 30 |
os.system('soundconverter %s &' % filelist) |
|---|
| 31 |
else: |
|---|
| 32 |
util.spawn(["soundconverter", " "] + list(reversed(files))) |
|---|