From 0067c3fe9dacaaa07c4cbddb51a516e943ebd940 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:13:40 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- src/Makefile.am | 8 +- src/amarokscript/Makefile.am | 3 - src/amarokscript/README | 43 ----- src/amarokscript/soundKonverter.rb | 296 ----------------------------------- src/amarotdescript/Makefile.am | 3 + src/amarotdescript/README | 43 +++++ src/amarotdescript/soundKonverter.rb | 296 +++++++++++++++++++++++++++++++++++ src/config.cpp | 4 +- src/cuesheeteditor.cpp | 2 +- src/paranoia.cpp | 2 +- 10 files changed, 350 insertions(+), 350 deletions(-) delete mode 100755 src/amarokscript/Makefile.am delete mode 100644 src/amarokscript/README delete mode 100755 src/amarokscript/soundKonverter.rb create mode 100755 src/amarotdescript/Makefile.am create mode 100644 src/amarotdescript/README create mode 100755 src/amarotdescript/soundKonverter.rb (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 61820f7..afbee85 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,7 +36,7 @@ soundkonverter_SOURCES = cddb.cpp cdmanager.cpp cdopener.cpp combobutton.cpp \ optionseditor.cpp optionsrequester.cpp optionssimple.cpp outputdirectory.cpp paranoia.cpp \ progressindicator.cpp replaygain.cpp replaygainfilelist.cpp replaygainscanner.cpp \ soundkonverter.cpp soundkonverterapp.cpp -soundkonverter_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor +soundkonverter_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor soundkonverter_LDADD = $(LIB_TDEUI) $(LIB_KFILE) metadata/libmetadata.la \ pluginloader/libpluginloader.la -lcdda_interface -lcdda_paranoia @@ -46,13 +46,13 @@ xdg_apps_DATA = soundkonverter.desktop shellrcdir = $(kde_datadir)/soundkonverter shellrc_DATA = soundkonverterui.rc -SUBDIRS = amarokscript metadata pics pluginloader plugins +SUBDIRS = amarotdescript metadata pics pluginloader plugins soundkonverter_DEPENDENCIES = metadata/libmetadata.la \ pluginloader/libpluginloader.la -amarokscriptsdir = $(kde_datadir)/amarok/scripts +amarotdescriptsdir = $(kde_datadir)/amarok/scripts servicemenusdir = $(kde_datadir)/konqueror/servicemenus servicemenus_DATA = audiocd_extract_with_soundkonverter.desktop -amarokscriptdir = $(kde_datadir)/soundkonverter/amarokscript +amarotdescriptdir = $(kde_datadir)/soundkonverter/amarotdescript bin_SCRIPTS = userscript.sh userscriptdir = $(kde_datadir)/soundkonverter userscript_SCRIPTS = userscript.sh diff --git a/src/amarokscript/Makefile.am b/src/amarokscript/Makefile.am deleted file mode 100755 index b8049a7..0000000 --- a/src/amarokscript/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -amarokscriptdir = $(kde_datadir)/soundkonverter/amarokscript -amarokscript_DATA = README \ - soundKonverter.rb diff --git a/src/amarokscript/README b/src/amarokscript/README deleted file mode 100644 index 1186231..0000000 --- a/src/amarokscript/README +++ /dev/null @@ -1,43 +0,0 @@ -
soundKonverter amaroK-Script (v0.3.8)
- -

-About:
-This script only adds a context menu for easily accesssing the soundKonverter tool.
This version was designed to work with soundKonverter 0.2.80+
With soundKonverter you can convert audio files into another audio format. And you can add/remove the ReplayGain tag to/from audio files. -

- -

-Usage:
-Just run this script and click on one or multiple files in your playlist with the right mouse button. Select soundKonverter and your desired action. After that soundKonverter should start (if you have installed it). Look into the handbook of soundKonverter for further information. -

- -

-Dependencies:
-

-

- -

-ChangeLog:
-Version 0.1:
-

-Version 0.2.80:
- -

- -

-License:
-GNU General Public License V2 -

- -

-Author:
-Daniel Faust (daniel@kaligames.de) -

- diff --git a/src/amarokscript/soundKonverter.rb b/src/amarokscript/soundKonverter.rb deleted file mode 100755 index 144c0c8..0000000 --- a/src/amarokscript/soundKonverter.rb +++ /dev/null @@ -1,296 +0,0 @@ -#!/usr/bin/env ruby -# -# amaroK-Script for integrating soundKonverter into amaroK -# -# (c) 2005 Daniel Faust -# License: GNU General Public License V2 - - -# FIXME after adding some files to soundkonverter, it is impossible to repeat that, until soundkonverter gets closed. - -# FIXME don't open files on every request. load options on startup and save on exit! - -#`dcop amarok playlist addMedia KURL` -#`dcop amarok playlist addMediaList KURL::List` -#`dcop amarok collection scanCollectionChanges` - - -require "uri" - -begin - require "Qt" -rescue LoadError - error = 'Qt Ruby bindings are required for this script.' - `dcop amarok playlist popupMessage "soundKonverter: #{error}"` - exit -end - -class MainWidget < Qt::Dialog - -slots 'accept()' - -def initialize(parent = nil, name = nil) - super - - box = Qt::VBoxLayout.new( self, 11, 6 ); - - lTitle = Qt::Label.new('soundKonverter plugin settings', self) - box.addWidget( lTitle ) - lTitle.setAlignment(Qt::AlignCenter) - font = Qt::Font.new() - font.setPixelSize(18) - font.setBold(true) - lTitle.setFont(font) - - box.addSpacing( 5 ) - - mediaDeviceBox = Qt::GroupBox.new( 1, Qt::Vertical, "Options for transfering to media devices", self ) - box.addWidget( mediaDeviceBox ) - mediaDeviceBox.layout().setSpacing( 6 ) - mediaDeviceBox.layout().setMargin( 6 ) - Qt::Label.new('Profile for lossy conversion:', mediaDeviceBox) - @cTranscodeProfile = Qt::ComboBox.new(mediaDeviceBox) - @cTranscodeProfile.insertItem("Very low") - @cTranscodeProfile.insertItem("Low") - @cTranscodeProfile.insertItem("Medium") - @cTranscodeProfile.insertItem("High") - @cTranscodeProfile.insertItem("Very high") - @cTranscodeProfile.setCurrentItem( 1 ) - -# box.addSpacing( 5 ) -# -# rippingBox = Qt::GroupBox.new( 2, Qt::Horizontal, "Use pre-defined options for CD ripping", self ) -# box.addWidget( rippingBox ) -# rippingBox.layout().setSpacing( 6 ) -# rippingBox.layout().setMargin( 6 ) -# rippingBox.setCheckable( true ) -# rippingBox.setEnabled( false ) -# -# profileBox = Qt::HBoxLayout.new( rippingBox, 6 ); -# lRippingProfile = Qt::Label.new('Profile:', rippingBox) -# profileBox.addWidget( lRippingProfile ) -# @cRippingProfile = Qt::ComboBox.new(rippingBox) -# profileBox.addWidget( @cRippingProfile ) -# @cRippingProfile.insertItem("Very low") -# @cRippingProfile.insertItem("Low") -# @cRippingProfile.insertItem("Medium") -# @cRippingProfile.insertItem("High") -# @cRippingProfile.insertItem("Very high") -# @cRippingProfile.insertItem("Lossless") -# @cRippingProfile.insertItem("Last used") -# @cRippingProfile.setCurrentItem(3) -# lRippingFormat = Qt::Label.new('Format:', rippingBox) -# profileBox.addWidget( lRippingFormat ) -# @cRippingFormat = Qt::ComboBox.new(rippingBox) -# profileBox.addWidget( @cRippingFormat ) -# @cRippingFormat.insertItem("ogg") -# @cRippingFormat.insertItem("mp3") -# @cRippingFormat.insertItem("flac") -# directoryBox = Qt::HBoxLayout.new( rippingBox, 6 ); -# lRippingDirectory = Qt::Label.new('Directory:', rippingBox) -# directoryBox.addWidget( lRippingDirectory ) -# @cRippingDirectory = Qt::ComboBox.new(rippingBox) -# directoryBox.addWidget( @cRippingDirectory ) -# @cRippingDirectory.setEditable(true) -# @cRippingDirectory.insertItem("/home/daniel/soundKonverter/%b/%d - %n - %t") -# @cRippingDirectory.insertItem("Last used") - - box.addSpacing( 5 ) - - buttonsBox = Qt::HBoxLayout.new(box) - buttonsBox.setSpacing(6) - buttonsBox.addStretch() - okPushButton = Qt::PushButton.new( self, "ok" ) - buttonsBox.addWidget( okPushButton ) - okPushButton.setText( "OK" ) - okPushButton.setDefault( true ) - - connect( okPushButton, SIGNAL( 'clicked()' ), - self, SLOT( 'accept()' ) - ) - - cancelPushButton = Qt::PushButton.new( self, "cancel" ) - buttonsBox.addWidget( cancelPushButton ) - cancelPushButton.setText( "Cancel" ) - cancelPushButton.setAccel( Qt::KeySequence.new(Key_Escape) ) - - connect( cancelPushButton, SIGNAL( 'clicked()' ), - self, SLOT( 'reject()' ) - ) - - file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) - if file.open( Qt::IO_ReadOnly ) - ts = Qt::TextStream.new( file ) - content = '' - ts >> content - if content == 'Very_low' - @cTranscodeProfile.setCurrentItem( 0 ) - elsif content == 'Low' - @cTranscodeProfile.setCurrentItem( 1 ) - elsif content == 'Medium' - @cTranscodeProfile.setCurrentItem( 2 ) - elsif content == 'High' - @cTranscodeProfile.setCurrentItem( 3 ) - elsif content == 'Very_high' - @cTranscodeProfile.setCurrentItem( 4 ) - end - file.close() - end - -# file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/profiles" ) -# if file.open( Qt::IO_ReadOnly ) -# ts = Qt::TextStream.new( file ) -# while !ts.eof() -# content = '' -# ts >> content -# @cProfile.insertItem( content ) -# ts >> content -# end -# -# file.close() -# end -end - - -def accept() - file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) - if file.open( Qt::IO_WriteOnly ) - ts = Qt::TextStream.new( file ) - if @cTranscodeProfile.currentText() == 'Very low' - content = 'Very_low' - elsif @cTranscodeProfile.currentText() == 'Low' - content = 'Low' - elsif @cTranscodeProfile.currentText() == 'Medium' - content = 'Medium' - elsif @cTranscodeProfile.currentText() == 'High' - content = 'High' - elsif @cTranscodeProfile.currentText() == 'Very high' - content = 'Very_high' - end - ts << content + "\n" - file.close() - end - - super -end - -end - - -MenuItemName1 = "soundKonverter \"Convert selected files\"" -MenuItemName2 = "soundKonverter \"Add Replay Gain to selected files\"" -MenuItemName3 = "soundKonverter \"Rip and play audio CD\"" - - -def cleanup() - `dcop amarok script removeCustomMenuItem #{MenuItemName1}` - `dcop amarok script removeCustomMenuItem #{MenuItemName2}` - `dcop amarok script removeCustomMenuItem #{MenuItemName3}` -end - - -trap( "SIGTERM" ) { cleanup() } - -`dcop amarok script addCustomMenuItem #{MenuItemName1}` -`dcop amarok script addCustomMenuItem #{MenuItemName2}` -`dcop amarok script addCustomMenuItem #{MenuItemName3}` - -loop do - message = gets().chomp() - command = /[A-Za-z]*/.match( message ).to_s() - - case command - when "configure" - app = Qt::Application.new(ARGV) - widget = MainWidget.new - app.setMainWidget(widget) - widget.show() - app.exec() - - when "transcode" - args = message.split() - filename = args[1] - #uri = URI.parse( args[1] ) - #filename = URI.unescape( uri.path() ) - filetype = args[2] - profile = '' - - file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/formats" ) - if file.open( Qt::IO_ReadOnly ) - ts = Qt::TextStream.new( file ) - while !ts.eof() - mode = '' - formats = '' - ts >> mode - ts >> formats - if formats.split(',').include?( filetype ) - profile = mode - end - end - file.close() - end - - if profile == '' - file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) - if file.open( Qt::IO_ReadOnly ) - ts = Qt::TextStream.new( file ) - content = '' - ts >> content - if content == 'Very_low' - profile = 'Very low' - elsif content == 'Low' - profile = 'Low' - elsif content == 'Medium' - profile = 'Medium' - elsif content == 'High' - profile = 'High' - elsif content == 'Very_high' - profile = 'Very high' - end - file.close() - else - profile = 'Low' - end - end - - `dcop amarok playlist shortStatusMessage "starting soundKonverter in background"` - `soundkonverter --invisible --profile '#{profile}' --format '#{filetype}' --output '/tmp' --command "dcop amarok mediabrowser transcodingFinished %u file://%o" '#{filename}'` - - when "customMenuClicked" - if message.include?( "Convert selected files" ) - args = message.split() - # Remove the command args - 5.times() { args.delete_at( 0 ) } - - # Iterate over all selected files - files = '' - args.each() do |arg| - uri = URI.parse( arg ) - file = URI.unescape( uri.path() ) - files += ' "'+file+'"' - end - `dcop amarok playlist shortStatusMessage "starting soundKonverter"` - `soundkonverter #{files}` - end - if message.include?( "Add Replay Gain to selected files" ) - args = message.split() - # Remove the command args - 8.times() { args.delete_at( 0 ) } - - files = '' - args.each() do |arg| - uri = URI.parse( arg ) - file = URI.unescape( uri.path() ) - files += ' "'+file+'"' - end - `dcop amarok playlist shortStatusMessage "starting soundKonverter"` - `soundkonverter --replaygain #{files}` - end - if message.include?( "Rip and play audio CD" ) - `dcop amarok playlist popupMessage "Select all tracks to rip and press 'Start' in order to start ripping.\nThe tracks will be added to the playlist, when they are ready."` - #`dcop amarok playlist shortStatusMessage "starting soundKonverter"` - `soundkonverter --invisible --rip auto --command "dcop amarok playlist addMedia %o"` - end - end -end - diff --git a/src/amarotdescript/Makefile.am b/src/amarotdescript/Makefile.am new file mode 100755 index 0000000..7797a6e --- /dev/null +++ b/src/amarotdescript/Makefile.am @@ -0,0 +1,3 @@ +amarotdescriptdir = $(kde_datadir)/soundkonverter/amarotdescript +amarotdescript_DATA = README \ + soundKonverter.rb diff --git a/src/amarotdescript/README b/src/amarotdescript/README new file mode 100644 index 0000000..1186231 --- /dev/null +++ b/src/amarotdescript/README @@ -0,0 +1,43 @@ +
soundKonverter amaroK-Script (v0.3.8)
+ +

+About:
+This script only adds a context menu for easily accesssing the soundKonverter tool.
This version was designed to work with soundKonverter 0.2.80+
With soundKonverter you can convert audio files into another audio format. And you can add/remove the ReplayGain tag to/from audio files. +

+ +

+Usage:
+Just run this script and click on one or multiple files in your playlist with the right mouse button. Select soundKonverter and your desired action. After that soundKonverter should start (if you have installed it). Look into the handbook of soundKonverter for further information. +

+ +

+Dependencies:
+

+

+ +

+ChangeLog:
+Version 0.1:
+

+Version 0.2.80:
+ +

+ +

+License:
+GNU General Public License V2 +

+ +

+Author:
+Daniel Faust (daniel@kaligames.de) +

+ diff --git a/src/amarotdescript/soundKonverter.rb b/src/amarotdescript/soundKonverter.rb new file mode 100755 index 0000000..144c0c8 --- /dev/null +++ b/src/amarotdescript/soundKonverter.rb @@ -0,0 +1,296 @@ +#!/usr/bin/env ruby +# +# amaroK-Script for integrating soundKonverter into amaroK +# +# (c) 2005 Daniel Faust +# License: GNU General Public License V2 + + +# FIXME after adding some files to soundkonverter, it is impossible to repeat that, until soundkonverter gets closed. + +# FIXME don't open files on every request. load options on startup and save on exit! + +#`dcop amarok playlist addMedia KURL` +#`dcop amarok playlist addMediaList KURL::List` +#`dcop amarok collection scanCollectionChanges` + + +require "uri" + +begin + require "Qt" +rescue LoadError + error = 'Qt Ruby bindings are required for this script.' + `dcop amarok playlist popupMessage "soundKonverter: #{error}"` + exit +end + +class MainWidget < Qt::Dialog + +slots 'accept()' + +def initialize(parent = nil, name = nil) + super + + box = Qt::VBoxLayout.new( self, 11, 6 ); + + lTitle = Qt::Label.new('soundKonverter plugin settings', self) + box.addWidget( lTitle ) + lTitle.setAlignment(Qt::AlignCenter) + font = Qt::Font.new() + font.setPixelSize(18) + font.setBold(true) + lTitle.setFont(font) + + box.addSpacing( 5 ) + + mediaDeviceBox = Qt::GroupBox.new( 1, Qt::Vertical, "Options for transfering to media devices", self ) + box.addWidget( mediaDeviceBox ) + mediaDeviceBox.layout().setSpacing( 6 ) + mediaDeviceBox.layout().setMargin( 6 ) + Qt::Label.new('Profile for lossy conversion:', mediaDeviceBox) + @cTranscodeProfile = Qt::ComboBox.new(mediaDeviceBox) + @cTranscodeProfile.insertItem("Very low") + @cTranscodeProfile.insertItem("Low") + @cTranscodeProfile.insertItem("Medium") + @cTranscodeProfile.insertItem("High") + @cTranscodeProfile.insertItem("Very high") + @cTranscodeProfile.setCurrentItem( 1 ) + +# box.addSpacing( 5 ) +# +# rippingBox = Qt::GroupBox.new( 2, Qt::Horizontal, "Use pre-defined options for CD ripping", self ) +# box.addWidget( rippingBox ) +# rippingBox.layout().setSpacing( 6 ) +# rippingBox.layout().setMargin( 6 ) +# rippingBox.setCheckable( true ) +# rippingBox.setEnabled( false ) +# +# profileBox = Qt::HBoxLayout.new( rippingBox, 6 ); +# lRippingProfile = Qt::Label.new('Profile:', rippingBox) +# profileBox.addWidget( lRippingProfile ) +# @cRippingProfile = Qt::ComboBox.new(rippingBox) +# profileBox.addWidget( @cRippingProfile ) +# @cRippingProfile.insertItem("Very low") +# @cRippingProfile.insertItem("Low") +# @cRippingProfile.insertItem("Medium") +# @cRippingProfile.insertItem("High") +# @cRippingProfile.insertItem("Very high") +# @cRippingProfile.insertItem("Lossless") +# @cRippingProfile.insertItem("Last used") +# @cRippingProfile.setCurrentItem(3) +# lRippingFormat = Qt::Label.new('Format:', rippingBox) +# profileBox.addWidget( lRippingFormat ) +# @cRippingFormat = Qt::ComboBox.new(rippingBox) +# profileBox.addWidget( @cRippingFormat ) +# @cRippingFormat.insertItem("ogg") +# @cRippingFormat.insertItem("mp3") +# @cRippingFormat.insertItem("flac") +# directoryBox = Qt::HBoxLayout.new( rippingBox, 6 ); +# lRippingDirectory = Qt::Label.new('Directory:', rippingBox) +# directoryBox.addWidget( lRippingDirectory ) +# @cRippingDirectory = Qt::ComboBox.new(rippingBox) +# directoryBox.addWidget( @cRippingDirectory ) +# @cRippingDirectory.setEditable(true) +# @cRippingDirectory.insertItem("/home/daniel/soundKonverter/%b/%d - %n - %t") +# @cRippingDirectory.insertItem("Last used") + + box.addSpacing( 5 ) + + buttonsBox = Qt::HBoxLayout.new(box) + buttonsBox.setSpacing(6) + buttonsBox.addStretch() + okPushButton = Qt::PushButton.new( self, "ok" ) + buttonsBox.addWidget( okPushButton ) + okPushButton.setText( "OK" ) + okPushButton.setDefault( true ) + + connect( okPushButton, SIGNAL( 'clicked()' ), + self, SLOT( 'accept()' ) + ) + + cancelPushButton = Qt::PushButton.new( self, "cancel" ) + buttonsBox.addWidget( cancelPushButton ) + cancelPushButton.setText( "Cancel" ) + cancelPushButton.setAccel( Qt::KeySequence.new(Key_Escape) ) + + connect( cancelPushButton, SIGNAL( 'clicked()' ), + self, SLOT( 'reject()' ) + ) + + file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) + if file.open( Qt::IO_ReadOnly ) + ts = Qt::TextStream.new( file ) + content = '' + ts >> content + if content == 'Very_low' + @cTranscodeProfile.setCurrentItem( 0 ) + elsif content == 'Low' + @cTranscodeProfile.setCurrentItem( 1 ) + elsif content == 'Medium' + @cTranscodeProfile.setCurrentItem( 2 ) + elsif content == 'High' + @cTranscodeProfile.setCurrentItem( 3 ) + elsif content == 'Very_high' + @cTranscodeProfile.setCurrentItem( 4 ) + end + file.close() + end + +# file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/profiles" ) +# if file.open( Qt::IO_ReadOnly ) +# ts = Qt::TextStream.new( file ) +# while !ts.eof() +# content = '' +# ts >> content +# @cProfile.insertItem( content ) +# ts >> content +# end +# +# file.close() +# end +end + + +def accept() + file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) + if file.open( Qt::IO_WriteOnly ) + ts = Qt::TextStream.new( file ) + if @cTranscodeProfile.currentText() == 'Very low' + content = 'Very_low' + elsif @cTranscodeProfile.currentText() == 'Low' + content = 'Low' + elsif @cTranscodeProfile.currentText() == 'Medium' + content = 'Medium' + elsif @cTranscodeProfile.currentText() == 'High' + content = 'High' + elsif @cTranscodeProfile.currentText() == 'Very high' + content = 'Very_high' + end + ts << content + "\n" + file.close() + end + + super +end + +end + + +MenuItemName1 = "soundKonverter \"Convert selected files\"" +MenuItemName2 = "soundKonverter \"Add Replay Gain to selected files\"" +MenuItemName3 = "soundKonverter \"Rip and play audio CD\"" + + +def cleanup() + `dcop amarok script removeCustomMenuItem #{MenuItemName1}` + `dcop amarok script removeCustomMenuItem #{MenuItemName2}` + `dcop amarok script removeCustomMenuItem #{MenuItemName3}` +end + + +trap( "SIGTERM" ) { cleanup() } + +`dcop amarok script addCustomMenuItem #{MenuItemName1}` +`dcop amarok script addCustomMenuItem #{MenuItemName2}` +`dcop amarok script addCustomMenuItem #{MenuItemName3}` + +loop do + message = gets().chomp() + command = /[A-Za-z]*/.match( message ).to_s() + + case command + when "configure" + app = Qt::Application.new(ARGV) + widget = MainWidget.new + app.setMainWidget(widget) + widget.show() + app.exec() + + when "transcode" + args = message.split() + filename = args[1] + #uri = URI.parse( args[1] ) + #filename = URI.unescape( uri.path() ) + filetype = args[2] + profile = '' + + file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/formats" ) + if file.open( Qt::IO_ReadOnly ) + ts = Qt::TextStream.new( file ) + while !ts.eof() + mode = '' + formats = '' + ts >> mode + ts >> formats + if formats.split(',').include?( filetype ) + profile = mode + end + end + file.close() + end + + if profile == '' + file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" ) + if file.open( Qt::IO_ReadOnly ) + ts = Qt::TextStream.new( file ) + content = '' + ts >> content + if content == 'Very_low' + profile = 'Very low' + elsif content == 'Low' + profile = 'Low' + elsif content == 'Medium' + profile = 'Medium' + elsif content == 'High' + profile = 'High' + elsif content == 'Very_high' + profile = 'Very high' + end + file.close() + else + profile = 'Low' + end + end + + `dcop amarok playlist shortStatusMessage "starting soundKonverter in background"` + `soundkonverter --invisible --profile '#{profile}' --format '#{filetype}' --output '/tmp' --command "dcop amarok mediabrowser transcodingFinished %u file://%o" '#{filename}'` + + when "customMenuClicked" + if message.include?( "Convert selected files" ) + args = message.split() + # Remove the command args + 5.times() { args.delete_at( 0 ) } + + # Iterate over all selected files + files = '' + args.each() do |arg| + uri = URI.parse( arg ) + file = URI.unescape( uri.path() ) + files += ' "'+file+'"' + end + `dcop amarok playlist shortStatusMessage "starting soundKonverter"` + `soundkonverter #{files}` + end + if message.include?( "Add Replay Gain to selected files" ) + args = message.split() + # Remove the command args + 8.times() { args.delete_at( 0 ) } + + files = '' + args.each() do |arg| + uri = URI.parse( arg ) + file = URI.unescape( uri.path() ) + files += ' "'+file+'"' + end + `dcop amarok playlist shortStatusMessage "starting soundKonverter"` + `soundkonverter --replaygain #{files}` + end + if message.include?( "Rip and play audio CD" ) + `dcop amarok playlist popupMessage "Select all tracks to rip and press 'Start' in order to start ripping.\nThe tracks will be added to the playlist, when they are ready."` + #`dcop amarok playlist shortStatusMessage "starting soundKonverter"` + `soundkonverter --invisible --rip auto --command "dcop amarok playlist addMedia %o"` + end + end +end + diff --git a/src/config.cpp b/src/config.cpp index 4ec463b..bc635b8 100755 --- a/src/config.cpp +++ b/src/config.cpp @@ -640,10 +640,10 @@ void Config::writeAmarokScript() KStandardDirs* stdDirs = new KStandardDirs(); if( !TQFile::exists(locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb")) ) { - TDEIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarokscript/soundKonverter.rb"), locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb"), 0755, true ); + TDEIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarotdescript/soundKonverter.rb"), locateLocal("data","amarok/scripts/soundKonverter/soundKonverter.rb"), 0755, true ); } if( !TQFile::exists(locateLocal("data","amarok/scripts/soundKonverter/README")) ) { - TDEIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarokscript/README"), locateLocal("data","amarok/scripts/soundKonverter/README"), -1, true ); + TDEIO::NetAccess::file_copy( stdDirs->findResource("data","soundkonverter/amarotdescript/README"), locateLocal("data","amarok/scripts/soundKonverter/README"), -1, true ); } delete stdDirs; } diff --git a/src/cuesheeteditor.cpp b/src/cuesheeteditor.cpp index 812e916..bb07fa6 100755 --- a/src/cuesheeteditor.cpp +++ b/src/cuesheeteditor.cpp @@ -10,7 +10,7 @@ #include //#include -/*#include // KPart Factory +/*#include // KPart Factory #include // LibLoader, contains factories #include // Katepart document #include // Katepart view diff --git a/src/paranoia.cpp b/src/paranoia.cpp index fba3d83..6031e84 100755 --- a/src/paranoia.cpp +++ b/src/paranoia.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "paranoia.h" -- cgit v1.2.3