[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/commands AudioClipExternalProcessi...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/commands AudioClipExternalProcessi... |
Date: |
Thu, 31 Jul 2008 19:11:01 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 08/07/31 19:11:00
Modified files:
src/commands : AudioClipExternalProcessing.cpp
AudioClipExternalProcessing.h CMakeLists.txt
Added files:
src/commands : ExternalProcessingDialog.cpp
ExternalProcessingDialog.h
src/commands/ui: ExternalProcessingDialog.ui
Removed files:
src/commands/ui: ExternalProcessing.ui
Log message:
* move audioclip external dialog class code to it's own file to avoid
build dependency problems
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/AudioClipExternalProcessing.cpp?cvsroot=traverso&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/AudioClipExternalProcessing.h?cvsroot=traverso&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/CMakeLists.txt?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ExternalProcessingDialog.cpp?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ExternalProcessingDialog.h?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ui/ExternalProcessingDialog.ui?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ui/ExternalProcessing.ui?cvsroot=traverso&r1=1.2&r2=0
Patches:
Index: AudioClipExternalProcessing.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/commands/AudioClipExternalProcessing.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- AudioClipExternalProcessing.cpp 21 Jan 2008 16:22:11 -0000 1.37
+++ AudioClipExternalProcessing.cpp 31 Jul 2008 19:10:59 -0000 1.38
@@ -21,6 +21,8 @@
#include "AudioClipExternalProcessing.h"
+#include "ExternalProcessingDialog.cpp"
+
#include <AudioClip.h>
#include <AudioClipView.h>
#include <Track.h>
@@ -32,8 +34,6 @@
#include <Utils.h>
#include "Interface.h"
-#include <QFile>
-#include <QCompleter>
// Always put me below _all_ includes, this is needed
// in case we run with memory leak detection enabled!
@@ -89,222 +89,3 @@
-/************************************************************************/
-/* DIALOG */
-/************************************************************************/
-
-
-ExternalProcessingDialog::ExternalProcessingDialog(QWidget * parent,
AudioClipExternalProcessing* acep)
- : QDialog(parent)
-{
- setupUi(this);
- m_acep = acep;
- m_queryOptions = false;
-
- m_processor = new QProcess(this);
- m_processor->setProcessChannelMode(QProcess::MergedChannels);
-
- m_completer = 0;
-
- command_lineedit_text_changed("sox");
-
- connect(m_processor, SIGNAL(readyReadStandardOutput()), this,
SLOT(read_standard_output()));
- connect(m_processor, SIGNAL(started()), this, SLOT(process_started()));
- connect(m_processor, SIGNAL(finished(int, QProcess::ExitStatus)), this,
SLOT(process_finished(int, QProcess::ExitStatus)));
- connect(m_processor, SIGNAL(error( QProcess::ProcessError)), this,
SLOT(process_error(QProcess::ProcessError)));
- connect(argsComboBox, SIGNAL(activated(const QString&)), this,
SLOT(arg_combo_index_changed(const QString&)));
- connect(programLineEdit, SIGNAL(textChanged(const QString&)), this,
SLOT(command_lineedit_text_changed(const QString&)));
- connect(startButton, SIGNAL(clicked()), this,
SLOT(prepare_for_external_processing()));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-ExternalProcessingDialog::~ ExternalProcessingDialog()
-{
- delete m_processor;
-}
-
-
-void ExternalProcessingDialog::prepare_for_external_processing()
-{
- m_commandargs = argumentsLineEdit->text();
-
- if (m_commandargs.isEmpty()) {
- statusText->setText(tr("You have to supply an argument before
starting the external process!"));
- return;
- }
-
- ReadSource* rs =
resources_manager()->get_readsource(m_acep->m_clip->get_readsource_id());
-
- //This should NOT be possible, but just in case....
- if (! rs) {
- printf("ExternalProcessing:: resources manager did NOT return a
resource for the to be processed audioclip (%lld) !!!!\n",
m_acep->m_clip->get_id());
- return;
- }
-
- m_filename = rs->get_name();
- m_newClipName= rs->get_short_name().remove(".wav") + "-" +
m_commandargs.simplified();
-
- m_infilename = rs->get_filename();
- // remove the extension and any dots that might confuse the external
program, append the
- // new name and again the extension.
- m_outfilename = pm().get_project()->get_audiosources_dir() +
-
m_filename.remove(".wav").remove(".").append("-").append(m_commandargs.simplified()).append(".wav");
-
-
- start_external_processing();
-}
-
-void ExternalProcessingDialog::start_external_processing()
-{
- m_arguments.clear();
-
- // On mac os x (and perhaps windows) the full path is given, so we
check if the path contains sox!
- if (m_program.contains("sox")) {
- m_arguments.append("-S");
- }
-
- m_arguments.append(m_infilename);
- m_arguments.append(m_outfilename);
- m_arguments += m_commandargs.split(QRegExp("\\s+"));
-
- m_processor->start(m_program, m_arguments);
-}
-
-void ExternalProcessingDialog::read_standard_output()
-{
- if (m_queryOptions) {
- QString result = m_processor->readAllStandardOutput();
- // This list is used to collect the availabe arguments for the
- // arugment lineedit completer.
- QStringList completionlist;
-
- // On mac os x (and perhaps windows) the full path is given, so
we check if the path contains sox!
- if (m_program.contains("sox")) {
- QStringList list = result.split("\n");
- foreach(QString string, list) {
- if (string.contains("Supported effects:") ||
string.contains("effect:") || string.contains("SUPPORTED EFFECTS:")) {
- result = string.remove("Supported
effects:").remove("effect:").remove("SUPPORTED EFFECTS:");
- QStringList options =
string.split(QRegExp("\\s+"));
- foreach(QString string, options) {
- if (!string.isEmpty()) {
-
argsComboBox->addItem(string);
- completionlist <<
string;
- }
- }
- }
- }
- }
- // If there was allready a completer, delete it.
- if (m_completer) {
- delete m_completer;
- }
-
- // Set the completer for the arguments line edit.
- m_completer = new QCompleter(completionlist, this);
- argumentsLineEdit->setCompleter(m_completer);
-
- return;
- }
-
- QString result = m_processor->readAllStandardOutput();
-
- if (result.contains("%")) {
- QStringList tokens = result.split(QRegExp("\\s+"));
- foreach(QString token, tokens) {
- if (token.contains("%")) {
- token = token.remove("%)");
- bool ok;
- int number = (int)token.toDouble(&ok);
- if (ok && number > progressBar->value()) {
- progressBar->setValue(number);
- }
- return;
- }
- }
- }
-
- statusText->append(result);
-}
-
-void ExternalProcessingDialog::process_started()
-{
- statusText->clear();
-}
-
-void ExternalProcessingDialog::process_finished(int exitcode,
QProcess::ExitStatus exitstatus)
-{
- Q_UNUSED(exitcode);
- Q_UNUSED(exitstatus);
-
- if (m_queryOptions) {
- m_queryOptions = false;
- return;
- }
-
- if (exitstatus == QProcess::CrashExit) {
- statusText->setHtml(tr("Program <b>%1</b>
crashed!").arg(m_program));
- return;
- }
-
- QString dir = pm().get_project()->get_audiosources_dir();
-
- // In case we used the merger, remove the file...
- QFile::remove(dir + "/merged.wav");
-
-
- QString result = m_processor->readAllStandardOutput();
- // print anything on command line we didn't catch
- printf("output: \n %s", QS_C(result));
-
- ReadSource* source = resources_manager()->import_source(dir,
m_filename);
- if (!source) {
- printf("ResourcesManager didn't return a ReadSource, most
likely sox didn't understand your command\n");
- return rejected();
- }
-
- m_acep->m_resultingclip =
resources_manager()->new_audio_clip(m_newClipName);
- resources_manager()->set_source_for_clip(m_acep->m_resultingclip,
source);
- // Clips live at project level, we have to set its Sheet, Track and
ReadSource explicitely!!
- m_acep->m_resultingclip->set_sheet(m_acep->m_clip->get_sheet());
- m_acep->m_resultingclip->set_track(m_acep->m_clip->get_track());
-
m_acep->m_resultingclip->set_track_start_location(m_acep->m_clip->get_track_start_location());
-
- close();
-}
-
-void ExternalProcessingDialog::query_options()
-{
- m_queryOptions = true;
- argsComboBox->clear();
- m_processor->start(m_program, QStringList() << "-h");
-}
-
-void ExternalProcessingDialog::arg_combo_index_changed(const QString & text)
-{
- argumentsLineEdit->setText(text);
-}
-
-void ExternalProcessingDialog::command_lineedit_text_changed(const QString &
text)
-{
- m_program = text.simplified();
- if (m_program == "sox") {
- #if defined (Q_WS_MAC)
- m_program = qApp->applicationDirPath() + "/sox";
- #endif
-
- query_options();
- argsComboBox->show();
- argsComboBox->setToolTip(tr("Available arguments for the sox
program"));
- return;
- }
-
- argsComboBox->hide();
-}
-
-void ExternalProcessingDialog::process_error(QProcess::ProcessError error)
-{
- if (error == QProcess::FailedToStart) {
- statusText->setHtml(tr("Program <b>%1</b> not installed, or
insufficient permissions to run!").arg(m_program));
- }
-}
-
Index: AudioClipExternalProcessing.h
===================================================================
RCS file:
/sources/traverso/traverso/src/commands/AudioClipExternalProcessing.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- AudioClipExternalProcessing.h 22 Nov 2007 16:17:56 -0000 1.7
+++ AudioClipExternalProcessing.h 31 Jul 2008 19:10:59 -0000 1.8
@@ -22,51 +22,10 @@
#ifndef AUDIOCLIP_EXTERNAL_PROCESSING_H
#define AUDIOCLIP_EXTERNAL_PROCESSING_H
-#include <QProcess>
#include <Command.h>
-#include "ui_ExternalProcessing.h"
-#include <QDialog>
class AudioClip;
class Track;
-class AudioClipExternalProcessing;
-class QCompleter;
-
-class ExternalProcessingDialog : public QDialog, protected
Ui::ExternalProcessing
-{
- Q_OBJECT
-
-public:
- ExternalProcessingDialog(QWidget* parent, AudioClipExternalProcessing*
acep);
- ~ExternalProcessingDialog();
-
-
-private:
- AudioClipExternalProcessing* m_acep;
- QProcess* m_processor;
- QCompleter* m_completer;
- QString m_filename;
- QString m_program;
- bool m_queryOptions;
- QStringList m_arguments;
- QString m_commandargs;
- QString m_infilename;
- QString m_outfilename;
- QString m_newClipName;
-
- void query_options();
-
-private slots:
- void read_standard_output();
- void prepare_for_external_processing();
- void process_started();
- void process_finished(int exitcode, QProcess::ExitStatus exitstatus);
- void arg_combo_index_changed ( const QString & text );
- void start_external_processing();
- void command_lineedit_text_changed(const QString & text);
- void process_error(QProcess::ProcessError error);
-};
-
class AudioClipExternalProcessing : public Command
{
@@ -78,12 +37,12 @@
int do_action();
int undo_action();
-private :
+// private :
Track* m_track;
AudioClip* m_clip;
AudioClip* m_resultingclip;
- friend class ExternalProcessingDialog;
+// friend class ExternalProcessingDialog;
};
Index: CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/src/commands/CMakeLists.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- CMakeLists.txt 13 Feb 2008 23:20:59 -0000 1.10
+++ CMakeLists.txt 31 Jul 2008 19:10:59 -0000 1.11
@@ -13,9 +13,11 @@
)
SET(TRAVERSO_COMMANDS_SOURCES
+AudioClipExternalProcessing.cpp
AddRemove.cpp
ClipSelection.cpp
CommandGroup.cpp
+ExternalProcessingDialog.cpp
Fade.cpp
Gain.cpp
Import.cpp
@@ -26,7 +28,6 @@
TrackPan.cpp
Zoom.cpp
Scroll.cpp
-AudioClipExternalProcessing.cpp
ArmTracks.cpp
PlayHeadMove.cpp
WorkCursorMove.cpp
@@ -34,7 +35,7 @@
)
SET(TRAVERSO_COMMANDS_MOC_CLASSES
-AudioClipExternalProcessing.h
+ExternalProcessingDialog.h
Gain.h
MoveClip.h
TrackPan.h
@@ -42,7 +43,7 @@
)
SET(TRAVERSO_COMMANDS_UI_FILES
-ui/ExternalProcessing.ui
+ui/ExternalProcessingDialog.ui
)
QT4_WRAP_CPP(TRAVERSO_COMMANDS_MOC_SOURCES ${TRAVERSO_COMMANDS_MOC_CLASSES})
Index: ExternalProcessingDialog.cpp
===================================================================
RCS file: ExternalProcessingDialog.cpp
diff -N ExternalProcessingDialog.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ExternalProcessingDialog.cpp 31 Jul 2008 19:10:59 -0000 1.1
@@ -0,0 +1,260 @@
+/*
+Copyright (C) 2007 Remon Sijrier
+
+This file is part of Traverso
+
+Traverso is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#include "ExternalProcessingDialog.h"
+
+#include "AudioClipExternalProcessing.h"
+
+#include <AudioClip.h>
+#include <AudioClipView.h>
+#include <Track.h>
+#include <InputEngine.h>
+#include <ReadSource.h>
+#include <ProjectManager.h>
+#include <Project.h>
+#include <ResourcesManager.h>
+#include <Utils.h>
+#include "Interface.h"
+
+#include <QFile>
+#include <QCompleter>
+
+// Always put me below _all_ includes, this is needed
+// in case we run with memory leak detection enabled!
+#include "Debugger.h"
+
+
+
+ExternalProcessingDialog::ExternalProcessingDialog(QWidget * parent,
AudioClipExternalProcessing* acep)
+ : QDialog(parent)
+{
+ setupUi(this);
+ m_acep = acep;
+ m_queryOptions = false;
+
+ m_processor = new QProcess(this);
+ m_processor->setProcessChannelMode(QProcess::MergedChannels);
+
+ m_completer = 0;
+
+ command_lineedit_text_changed("sox");
+
+ connect(m_processor, SIGNAL(readyReadStandardOutput()), this,
SLOT(read_standard_output()));
+ connect(m_processor, SIGNAL(started()), this, SLOT(process_started()));
+ connect(m_processor, SIGNAL(finished(int, QProcess::ExitStatus)), this,
SLOT(process_finished(int, QProcess::ExitStatus)));
+ connect(m_processor, SIGNAL(error( QProcess::ProcessError)), this,
SLOT(process_error(QProcess::ProcessError)));
+ connect(argsComboBox, SIGNAL(activated(const QString&)), this,
SLOT(arg_combo_index_changed(const QString&)));
+ connect(programLineEdit, SIGNAL(textChanged(const QString&)), this,
SLOT(command_lineedit_text_changed(const QString&)));
+ connect(startButton, SIGNAL(clicked()), this,
SLOT(prepare_for_external_processing()));
+ connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
+}
+
+ExternalProcessingDialog::~ ExternalProcessingDialog()
+{
+ delete m_processor;
+}
+
+
+void ExternalProcessingDialog::prepare_for_external_processing()
+{
+ m_commandargs = argumentsLineEdit->text();
+
+ if (m_commandargs.isEmpty()) {
+ statusText->setText(tr("You have to supply an argument before
starting the external process!"));
+ return;
+ }
+
+ ReadSource* rs =
resources_manager()->get_readsource(m_acep->m_clip->get_readsource_id());
+
+ //This should NOT be possible, but just in case....
+ if (! rs) {
+ printf("ExternalProcessing:: resources manager did NOT return a
resource for the to be processed audioclip (%lld) !!!!\n",
m_acep->m_clip->get_id());
+ return;
+ }
+
+ m_filename = rs->get_name();
+ m_newClipName= rs->get_short_name().remove(".wav") + "-" +
m_commandargs.simplified();
+
+ m_infilename = rs->get_filename();
+ // remove the extension and any dots that might confuse the external
program, append the
+ // new name and again the extension.
+ m_outfilename = pm().get_project()->get_audiosources_dir() +
+
m_filename.remove(".wav").remove(".").append("-").append(m_commandargs.simplified()).append(".wav");
+
+
+ start_external_processing();
+}
+
+void ExternalProcessingDialog::start_external_processing()
+{
+ m_arguments.clear();
+
+ // On mac os x (and perhaps windows) the full path is given, so we
check if the path contains sox!
+ if (m_program.contains("sox")) {
+ m_arguments.append("-S");
+ }
+
+ m_arguments.append(m_infilename);
+ m_arguments.append(m_outfilename);
+ m_arguments += m_commandargs.split(QRegExp("\\s+"));
+
+ m_processor->start(m_program, m_arguments);
+}
+
+void ExternalProcessingDialog::read_standard_output()
+{
+ if (m_queryOptions) {
+ QString result = m_processor->readAllStandardOutput();
+ // This list is used to collect the availabe arguments for the
+ // arugment lineedit completer.
+ QStringList completionlist;
+
+ // On mac os x (and perhaps windows) the full path is given, so
we check if the path contains sox!
+ if (m_program.contains("sox")) {
+ QStringList list = result.split("\n");
+ foreach(QString string, list) {
+ if (string.contains("Supported effects:") ||
string.contains("effect:") || string.contains("SUPPORTED EFFECTS:")) {
+ result = string.remove("Supported
effects:").remove("effect:").remove("SUPPORTED EFFECTS:");
+ QStringList options =
string.split(QRegExp("\\s+"));
+ foreach(QString string, options) {
+ if (!string.isEmpty()) {
+
argsComboBox->addItem(string);
+ completionlist <<
string;
+ }
+ }
+ }
+ }
+ }
+ // If there was allready a completer, delete it.
+ if (m_completer) {
+ delete m_completer;
+ }
+
+ // Set the completer for the arguments line edit.
+ m_completer = new QCompleter(completionlist, this);
+ argumentsLineEdit->setCompleter(m_completer);
+
+ return;
+ }
+
+ QString result = m_processor->readAllStandardOutput();
+
+ if (result.contains("%")) {
+ QStringList tokens = result.split(QRegExp("\\s+"));
+ foreach(QString token, tokens) {
+ if (token.contains("%")) {
+ token = token.remove("%)");
+ bool ok;
+ int number = (int)token.toDouble(&ok);
+ if (ok && number > progressBar->value()) {
+ progressBar->setValue(number);
+ }
+ return;
+ }
+ }
+ }
+
+ statusText->append(result);
+}
+
+void ExternalProcessingDialog::process_started()
+{
+ statusText->clear();
+}
+
+void ExternalProcessingDialog::process_finished(int exitcode,
QProcess::ExitStatus exitstatus)
+{
+ Q_UNUSED(exitcode);
+ Q_UNUSED(exitstatus);
+
+ if (m_queryOptions) {
+ m_queryOptions = false;
+ return;
+ }
+
+ if (exitstatus == QProcess::CrashExit) {
+ statusText->setHtml(tr("Program <b>%1</b>
crashed!").arg(m_program));
+ return;
+ }
+
+ QString dir = pm().get_project()->get_audiosources_dir();
+
+ // In case we used the merger, remove the file...
+ QFile::remove(dir + "/merged.wav");
+
+
+ QString result = m_processor->readAllStandardOutput();
+ // print anything on command line we didn't catch
+ printf("output: \n %s", QS_C(result));
+
+ ReadSource* source = resources_manager()->import_source(dir,
m_filename);
+ if (!source) {
+ printf("ResourcesManager didn't return a ReadSource, most
likely sox didn't understand your command\n");
+ return rejected();
+ }
+
+ m_acep->m_resultingclip =
resources_manager()->new_audio_clip(m_newClipName);
+ resources_manager()->set_source_for_clip(m_acep->m_resultingclip,
source);
+ // Clips live at project level, we have to set its Sheet, Track and
ReadSource explicitely!!
+ m_acep->m_resultingclip->set_sheet(m_acep->m_clip->get_sheet());
+ m_acep->m_resultingclip->set_track(m_acep->m_clip->get_track());
+
m_acep->m_resultingclip->set_track_start_location(m_acep->m_clip->get_track_start_location());
+
+ close();
+}
+
+void ExternalProcessingDialog::query_options()
+{
+ m_queryOptions = true;
+ argsComboBox->clear();
+ m_processor->start(m_program, QStringList() << "-h");
+}
+
+void ExternalProcessingDialog::arg_combo_index_changed(const QString & text)
+{
+ argumentsLineEdit->setText(text);
+}
+
+void ExternalProcessingDialog::command_lineedit_text_changed(const QString &
text)
+{
+ m_program = text.simplified();
+ if (m_program == "sox") {
+ #if defined (Q_WS_MAC)
+ m_program = qApp->applicationDirPath() + "/sox";
+ #endif
+
+ query_options();
+ argsComboBox->show();
+ argsComboBox->setToolTip(tr("Available arguments for the sox
program"));
+ return;
+ }
+
+ argsComboBox->hide();
+}
+
+void ExternalProcessingDialog::process_error(QProcess::ProcessError error)
+{
+ if (error == QProcess::FailedToStart) {
+ statusText->setHtml(tr("Program <b>%1</b> not installed, or
insufficient permissions to run!").arg(m_program));
+ }
+}
+
+
Index: ExternalProcessingDialog.h
===================================================================
RCS file: ExternalProcessingDialog.h
diff -N ExternalProcessingDialog.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ExternalProcessingDialog.h 31 Jul 2008 19:10:59 -0000 1.1
@@ -0,0 +1,72 @@
+/*
+Copyright (C) 2007 Remon Sijrier
+
+This file is part of Traverso
+
+Traverso is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#ifndef AUDIOCLIP_EXTERNAL_PROCESSING_DIALOG_H
+#define AUDIOCLIP_EXTERNAL_PROCESSING_DIALOG_H
+
+#include <QProcess>
+#include "ui_ExternalProcessingDialog.h"
+#include <QDialog>
+
+class AudioClip;
+class Track;
+class AudioClipExternalProcessing;
+class QCompleter;
+
+class ExternalProcessingDialog : public QDialog, protected
Ui::ExternalProcessingDialog
+{
+ Q_OBJECT
+
+public:
+ ExternalProcessingDialog(QWidget* parent, AudioClipExternalProcessing*
acep);
+ ~ExternalProcessingDialog();
+
+
+private:
+ AudioClipExternalProcessing* m_acep;
+ QProcess* m_processor;
+ QCompleter* m_completer;
+ QString m_filename;
+ QString m_program;
+ bool m_queryOptions;
+ QStringList m_arguments;
+ QString m_commandargs;
+ QString m_infilename;
+ QString m_outfilename;
+ QString m_newClipName;
+
+ void query_options();
+
+private slots:
+ void read_standard_output();
+ void prepare_for_external_processing();
+ void process_started();
+ void process_finished(int exitcode, QProcess::ExitStatus exitstatus);
+ void arg_combo_index_changed ( const QString & text );
+ void start_external_processing();
+ void command_lineedit_text_changed(const QString & text);
+ void process_error(QProcess::ProcessError error);
+};
+
+
+#endif
+
+//eof
Index: ui/ExternalProcessingDialog.ui
===================================================================
RCS file: ui/ExternalProcessingDialog.ui
diff -N ui/ExternalProcessingDialog.ui
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ui/ExternalProcessingDialog.ui 31 Jul 2008 19:11:00 -0000 1.1
@@ -0,0 +1,186 @@
+<ui version="4.0" >
+ <class>ExternalProcessingDialog</class>
+ <widget class="QDialog" name="ExternalProcessingDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>430</width>
+ <height>316</height>
+ </rect>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>380</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>460</width>
+ <height>400</height>
+ </size>
+ </property>
+ <property name="windowTitle" >
+ <string>External Processing</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Program</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Arguments</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Progress</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="programLineEdit" >
+ <property name="text" >
+ <string>sox</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="argumentsLineEdit" />
+ </item>
+ <item>
+ <widget class="QComboBox" name="argsComboBox" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar" >
+ <property name="value" >
+ <number>0</number>
+ </property>
+ <property name="textVisible" >
+ <bool>true</bool>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="startButton" >
+ <property name="text" >
+ <string>Start</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Program output</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="statusText" >
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <enum>Qt::TextSelectableByMouse</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: ui/ExternalProcessing.ui
===================================================================
RCS file: ui/ExternalProcessing.ui
diff -N ui/ExternalProcessing.ui
--- ui/ExternalProcessing.ui 21 Jun 2007 14:28:06 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,186 +0,0 @@
-<ui version="4.0" >
- <class>ExternalProcessing</class>
- <widget class="QDialog" name="ExternalProcessing" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>430</width>
- <height>316</height>
- </rect>
- </property>
- <property name="minimumSize" >
- <size>
- <width>380</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize" >
- <size>
- <width>460</width>
- <height>400</height>
- </size>
- </property>
- <property name="windowTitle" >
- <string>External Processing</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Program</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Arguments</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>Progress</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLineEdit" name="programLineEdit" >
- <property name="text" >
- <string>sox</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLineEdit" name="argumentsLineEdit" />
- </item>
- <item>
- <widget class="QComboBox" name="argsComboBox" >
- <property name="minimumSize" >
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QProgressBar" name="progressBar" >
- <property name="value" >
- <number>0</number>
- </property>
- <property name="textVisible" >
- <bool>true</bool>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="startButton" >
- <property name="text" >
- <string>Start</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="cancelButton" >
- <property name="text" >
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label_3" >
- <property name="text" >
- <string>Program output</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="statusText" >
- <property name="acceptDrops" >
- <bool>false</bool>
- </property>
- <property name="textInteractionFlags" >
- <enum>Qt::TextSelectableByMouse</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
- [Traverso-commit] traverso/src/commands AudioClipExternalProcessi...,
Remon Sijrier <=