[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/traverso Interface.cpp Interface.h...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/traverso Interface.cpp Interface.h... |
Date: |
Mon, 15 Oct 2007 11:28:30 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/10/15 11:28:30
Modified files:
src/traverso : Interface.cpp Interface.h traverso.pro
Added files:
src/traverso/dialogs: CDWritingDialog.cpp CDWritingDialog.h
Removed files:
src/traverso : ExportWidget.cpp ExportWidget.h
src/traverso/ui: ExportWidget.ui
Log message:
* Moved CD Writing part of ExportWidget to dedicated CDWritingDialog,
ExportWidget has been obsoleted now due this
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/CDWritingDialog.cpp?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/CDWritingDialog.h?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.cpp?cvsroot=traverso&r1=1.102&r2=1.103
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.h?cvsroot=traverso&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/traverso.pro?cvsroot=traverso&r1=1.75&r2=1.76
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ExportWidget.cpp?cvsroot=traverso&r1=1.61&r2=0
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ExportWidget.h?cvsroot=traverso&r1=1.16&r2=0
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/ExportWidget.ui?cvsroot=traverso&r1=1.18&r2=0
Patches:
Index: Interface.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Interface.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -b -r1.102 -r1.103
--- Interface.cpp 15 Oct 2007 10:00:13 -0000 1.102
+++ Interface.cpp 15 Oct 2007 11:28:29 -0000 1.103
@@ -66,6 +66,7 @@
#include "dialogs/RestoreProjectBackupDialog.h"
#include "dialogs/ProjectConverterDialog.h"
#include "dialogs/ExportDialog.h"
+#include "dialogs/CDWritingDialog.h"
// Always put me below _all_ includes, this is needed
// in case we run with memory leak detection enabled!
@@ -168,6 +169,7 @@
// Some default values.
currentSongWidget = 0;
m_exportDialog = 0;
+ m_cdWritingDialog = 0;
m_settingsdialog = 0;
m_projectManagerDialog = 0;
m_openProjectDialog = 0;
@@ -364,6 +366,18 @@
return (Command*) 0;
}
+Command * Interface::show_cd_writing_dialog( )
+{
+ if (! m_cdWritingDialog) {
+ m_cdWritingDialog = new CDWritingDialog(this);
+ }
+ if (m_cdWritingDialog->isHidden()) {
+// m_exportDialog->set_was_closed();
+ m_cdWritingDialog->show();
+ }
+ return (Command*) 0;
+}
+
void Interface::create_menus( )
{
QMenu* menu;
@@ -405,6 +419,13 @@
m_projectExportAction = action;
connect(action, SIGNAL(triggered(bool)), this,
SLOT(show_export_widget()));
+ action = menu->addAction(tr("&CD Writing..."));
+ list.clear();
+ list.append(QKeySequence("F8"));
+ action->setShortcuts(list);
+ action->setIcon(style()->standardIcon(QStyle::SP_DialogApplyButton));
+ connect(action, SIGNAL(triggered(bool)), this,
SLOT(show_cd_writing_dialog()));
+
action = menu->addAction(tr("&Restore Backup..."));
list.clear();
list.append(QKeySequence("F10"));
Index: Interface.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Interface.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- Interface.h 15 Oct 2007 10:00:13 -0000 1.44
+++ Interface.h 15 Oct 2007 11:28:29 -0000 1.45
@@ -37,6 +37,7 @@
class QLabel;
class ExportDialog;
+class CDWritingDialog;
class QStackedWidget;
class QHBoxLayout;
class QVBoxLayout;
@@ -101,6 +102,7 @@
QList<ViewPort* > currentProjectViewPortList;
QHash<QString, QMenu*> m_contextMenus;
ExportDialog* m_exportDialog;
+ CDWritingDialog* m_cdWritingDialog;
QUndoView* historyWidget;
QDockWidget* historyDW;
QDockWidget* busMonitorDW;
@@ -161,6 +163,7 @@
Command* quick_start();
Command* export_keymap();
Command* show_export_widget();
+ Command* show_cd_writing_dialog();
Command* show_context_menu();
Command* show_open_project_dialog();
Command* show_project_manager_dialog();
Index: traverso.pro
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/traverso.pro,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- traverso.pro 15 Oct 2007 10:00:13 -0000 1.75
+++ traverso.pro 15 Oct 2007 11:28:29 -0000 1.76
@@ -29,7 +29,6 @@
ContextDialog.h \
FadeContextDialog.h \
Main.h \
- ExportWidget.h \
PluginSelectorDialog.h \
Traverso.h \
Interface.h \
@@ -56,14 +55,14 @@
dialogs/AudioClipEditDialog.h \
dialogs/RestoreProjectBackupDialog.h \
dialogs/ProjectConverterDialog.h \
- dialogs/ExportDialog.h
+ dialogs/ExportDialog.h \
+ dialogs/CDWritingDialog.h
SOURCES += \
Traverso.cpp \
BusMonitor.cpp \
ContextDialog.cpp \
FadeContextDialog.cpp \
Main.cpp \
- ExportWidget.cpp \
PluginSelectorDialog.cpp \
Interface.cpp \
VUMeter.cpp \
@@ -88,7 +87,8 @@
dialogs/AudioClipEditDialog.cpp \
dialogs/RestoreProjectBackupDialog.cpp \
dialogs/ProjectConverterDialog.cpp \
- dialogs/ExportDialog.cpp
+ dialogs/ExportDialog.cpp \
+ dialogs/CDWritingDialog.cpp
FORMS += ui/ExportWidget.ui \
ui/AudioSourcesManagerWidget.ui \
ui/SpectralMeterConfigWidget.ui \
@@ -115,7 +115,9 @@
ui/AudioClipEditWidget.ui \
ui/RestoreProjectBackupDialog.ui \
ui/ProjectConverterDialog.ui \
- ui/ExportDialog.ui
+ ui/ExportDialog.ui \
+ ui/CDWritingDialog.ui
+
INCLUDEPATH += ../core \
../commands \
Index: dialogs/CDWritingDialog.cpp
===================================================================
RCS file: dialogs/CDWritingDialog.cpp
diff -N dialogs/CDWritingDialog.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dialogs/CDWritingDialog.cpp 15 Oct 2007 11:28:28 -0000 1.1
@@ -0,0 +1,615 @@
+/*
+ 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 "CDWritingDialog.h"
+
+#include <QMessageBox>
+#include <QProcess>
+
+#include "Export.h"
+#include "Config.h"
+#include "AudioDevice.h"
+#include "Project.h"
+#include "ProjectManager.h"
+#include "Information.h"
+#include "Utils.h"
+
+
+#if defined (Q_WS_WIN)
+#define CDRDAO_BIN "cdrdao.exe"
+#else
+#define CDRDAO_BIN "cdrdao"
+#endif
+
+// Always put me below _all_ includes, this is needed
+// in case we run with memory leak detection enabled!
+#include "Debugger.h"
+
+CDWritingDialog::CDWritingDialog( QWidget * parent )
+ : QDialog(parent)
+ , m_burnprocess(0)
+ , m_exportSpec(0)
+{
+ setupUi(this);
+
+ stopButton->hide();
+ set_project(pm().get_project());
+
+ connect(closeButton, SIGNAL(clicked()), this, SLOT(hide()));
+ connect(&pm(), SIGNAL(projectLoaded(Project*)), this,
SLOT(set_project(Project*)));
+
+ m_burnprocess = new QProcess(this);
+ m_burnprocess->setProcessChannelMode(QProcess::MergedChannels);
+ QStringList env = QProcess::systemEnvironment();
+ env << "LC_ALL=C";
+ m_burnprocess->setEnvironment(env);
+ m_writingState = NO_STATE;
+ m_lastSheetExported = -1;
+
+ refreshButton->setIcon(QIcon(find_pixmap(":/refresh-16")));
+ refreshButton->setMaximumHeight(26);
+ refreshButton->setMaximumWidth(30);
+
+ connect(m_burnprocess, SIGNAL(readyReadStandardOutput()), this,
SLOT(read_standard_output()));
+ connect(m_burnprocess, SIGNAL(started()), this,
SLOT(cdrdao_process_started()));
+ connect(m_burnprocess, SIGNAL(finished(int, QProcess::ExitStatus)),
+ this, SLOT(cdrdao_process_finished(int, QProcess::ExitStatus)));
+ connect(startButton, SIGNAL(clicked()), this,
SLOT(start_burn_process()));
+ connect(stopButton, SIGNAL(clicked()), this, SLOT(stop_burn_process()));
+ connect(refreshButton, SIGNAL(clicked()), this, SLOT(query_devices()));
+ connect(cdDiskExportOnlyCheckBox, SIGNAL(stateChanged(int)), this,
SLOT(export_only_changed(int)));
+
+ query_devices();
+}
+
+CDWritingDialog::~ CDWritingDialog( )
+{}
+
+
+bool CDWritingDialog::is_safe_to_export()
+{
+ PENTER;
+ if (m_project->is_recording()) {
+ info().warning(tr("CD Writing during recording is not
supported!"));
+ return false;
+ }
+
+ return true;
+}
+
+
+void CDWritingDialog::on_stopButton_clicked( )
+{
+ m_exportSpec->stop = true;
+ m_exportSpec->breakout = true;
+}
+
+
+void CDWritingDialog::set_project(Project * project)
+{
+ m_project = project;
+ if (! m_project) {
+ info().information(tr("No project loaded, to write a project to
CD, load it first!"));
+ setEnabled(false);
+ if (m_exportSpec) {
+ delete m_exportSpec;
+ m_exportSpec = 0;
+ }
+ } else {
+ setEnabled(true);
+ if (m_exportSpec) {
+ delete m_exportSpec;
+ m_exportSpec = 0;
+ }
+ m_exportSpec = new ExportSpecification;
+ m_exportSpec->exportdir = m_project->get_root_dir() +
"/Export/";
+ m_exportSpec->renderfinished = false;
+ }
+}
+
+
+/****************************************************************/
+/* CD EXPORT */
+/****************************************************************/
+
+
+void CDWritingDialog::query_devices()
+{
+ if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
+ printf("query_devices: burnprocess still running!\n");
+ return;
+ }
+
+ m_writingState = QUERY_DEVICE;
+ cdDeviceComboBox->clear();
+
+#if defined (Q_WS_WIN)
+ m_burnprocess->start(CDRDAO_BIN, QStringList() << "scanbus");
+#elif defined (Q_WS_MAC)
+ cdDeviceComboBox->clear();
+ cdDeviceComboBox->addItem("IODVDServices");
+ cdDeviceComboBox->addItem("IODVDServices/2");
+ cdDeviceComboBox->addItem("IOCompactDiscServices");
+ cdDeviceComboBox->addItem("IOCompactDiscServices/2");
+#else
+ m_burnprocess->start(CDRDAO_BIN, QStringList() << "drive-info");
+#endif
+}
+
+void CDWritingDialog::unlock_device()
+{
+ if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
+ return;
+ }
+
+ m_writingState = UNLOCK_DEVICE;
+ int index = cdDeviceComboBox->currentIndex();
+ if (index == -1) {
+ return;
+ }
+
+ QString device = get_device(index);
+
+ QStringList args;
+ args << "unlock" << "--device" << device;
+#if defined (Q_WS_MAC)
+ m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", args);
+#else
+ m_burnprocess->start(CDRDAO_BIN, args);
+#endif
+}
+
+
+void CDWritingDialog::stop_burn_process()
+{
+ PENTER;
+
+ if (m_writingState == RENDER) {
+ update_cdburn_status(tr("Aborting Render process ..."),
NORMAL_MESSAGE);
+ m_exportSpec->stop = true;
+ m_exportSpec->breakout = true;
+ m_exportSpec->renderfinished = false;
+ }
+ if (m_writingState == BURNING) {
+ update_cdburn_status(tr("Aborting CD Burn process ..."),
NORMAL_MESSAGE);
+ m_burnprocess->terminate();
+ m_writingState = ABORT_BURN;
+ }
+
+ stopButton->setEnabled(false);
+}
+
+
+void CDWritingDialog::start_burn_process()
+{
+ PENTER;
+
+ if(!is_safe_to_export()) {
+ return;
+ }
+
+ m_copyNumber = 0;
+ cd_render();
+
+ int index = cdDeviceComboBox->currentIndex();
+ if (index != -1 && cdDeviceComboBox->itemData(index) !=
QVariant::Invalid) {
+ config().set_property("Cdrdao", "drive",
cdDeviceComboBox->itemData(index));
+ }
+}
+
+
+void CDWritingDialog::cdrdao_process_started()
+{
+ PENTER;
+
+ if (m_writingState == BURNING) {
+ update_cdburn_status(tr("Waiting for CD-Writer..."),
NORMAL_MESSAGE);
+ progressBar->setMaximum(0);
+ }
+
+}
+
+void CDWritingDialog::cdrdao_process_finished(int exitcode, int exitstatus)
+{
+ if (exitstatus == QProcess::CrashExit) {
+ update_cdburn_status(tr("CD Burn process failed!"),
ERROR_MESSAGE);
+ }
+
+ if (m_writingState == ABORT_BURN) {
+ update_cdburn_status(tr("CD Burn process stopped on user
request."), NORMAL_MESSAGE);
+ }
+
+ if (m_writingState == BURNING) {
+ update_cdburn_status(tr("CD Writing process finished!"),
NORMAL_MESSAGE);
+ }
+
+ if (exitstatus == QProcess::CrashExit || m_writingState == ABORT_BURN) {
+ unlock_device();
+ }
+
+ progressBar->setMaximum(100);
+ progressBar->setValue(0);
+
+ if (m_writingState == BURNING) {
+ // check if we have to write another CD
+ bool writeAnotherCd = false;
+ if (m_copyNumber < spinBoxNumCopies->value()) {
+ if (QMessageBox::information(this, tr("Writing CD %1 of
%2").arg(m_copyNumber+1).arg(spinBoxNumCopies->value()), tr("Please insert an
empty CD and press OK to continue."), QMessageBox::Ok | QMessageBox::Cancel) ==
QMessageBox::Ok) {
+ writeAnotherCd = true;
+ }
+ }
+
+ if (writeAnotherCd) {
+ write_to_cd();
+ return;
+ }
+ }
+
+ enable_ui_interaction();
+}
+
+void CDWritingDialog::cd_render()
+{
+ PENTER;
+
+ if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
+ info().critical(tr("Burn process is still running, cannot start
it twice!!"));
+ return;
+ }
+
+ // FIXME: We should instead check export wav file timestamps/revision
numbers as a dirty test
+ if (! cdAllSongsButton->isChecked() && m_lastSheetExported !=
m_project->get_current_song_id()) {
+ m_exportSpec->renderfinished = false;
+ }
+
+ if (m_wasClosed && m_exportSpec->renderfinished &&
(m_exportSpec->allSongs == cdAllSongsButton->isChecked()) ) {
+
+ if (QMessageBox::question(this, tr("Rerender CD content"),
+ tr("There is already a CD render
available.\nShould I re-render the CD content?"),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::No) == QMessageBox::Yes)
+ {
+ m_exportSpec->renderfinished = false;
+ }
+ }
+
+ m_wasClosed = false;
+
+ if ( ! (m_exportSpec->renderfinished &&
+ (m_exportSpec->allSongs == cdAllSongsButton->isChecked()) &&
+ (m_exportSpec->normalize == cdNormalizeCheckBox->isChecked()))
) {
+
+ m_exportSpec->data_width = 16;
+ m_exportSpec->writerType = "sndfile";
+ m_exportSpec->extraFormat["filetype"] = "wav";
+ m_exportSpec->channels = 2;
+ m_exportSpec->sample_rate = 44100;
+ m_exportSpec->writeToc = true;
+ m_exportSpec->dither_type = GDitherTri;
+ m_exportSpec->src_quality = SRC_SINC_MEDIUM_QUALITY; //
SRC_SINC_BEST_QUALITY SRC_SINC_FASTEST SRC_ZERO_ORDER_HOLD SRC_LINEAR
+ if (cdAllSongsButton->isChecked()) {
+ m_exportSpec->allSongs = true;
+ } else {
+ m_exportSpec->allSongs = false;
+ }
+ m_exportSpec->normalize = cdNormalizeCheckBox->isChecked();
+ m_exportSpec->isRecording = false;
+ m_exportSpec->stop = false;
+ m_exportSpec->breakout = false;
+ m_exportSpec->isCdExport = true;
+
+ if (m_project->create_cdrdao_toc(m_exportSpec) < 0) {
+ info().warning(tr("Creating CDROM table of contents
failed, unable to write CD"));
+ return;
+ }
+
+ m_writingState = RENDER;
+
+ connect(m_project, SIGNAL(overallExportProgressChanged(int)),
this, SLOT(cd_export_progress(int)));
+ connect(m_project, SIGNAL(exportFinished()), this,
SLOT(cd_export_finished()));
+
+ update_cdburn_status(tr("Rendering Sheet(s)"), NORMAL_MESSAGE);
+
+ disable_ui_interaction();
+ m_project->export_project(m_exportSpec);
+ m_lastSheetExported = m_project->get_current_song_id();
+ } else {
+ if (cdDiskExportOnlyCheckBox->isChecked()) {
+ return;
+ }
+ disable_ui_interaction();
+ write_to_cd();
+ }
+}
+
+void CDWritingDialog::write_to_cd()
+{
+ PENTER;
+
+ m_copyNumber++;
+
+ if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
+ info().critical(tr("Burn process is still running, cannot start
it twice!!"));
+ return;
+ }
+
+ m_writingState = BURNING;
+ progressBar->setValue(0);
+
+ int index = cdDeviceComboBox->currentIndex();
+ if (index == -1) {
+ QMessageBox::information( 0, tr("No Burn Device"),
+ tr("No burn Device selected or
available!"),
+ QMessageBox::Ok);
+ enable_ui_interaction();
+ return;
+ }
+
+ QString device = get_device(index);
+ QStringList arguments;
+ arguments << "write" << "--device" << device << "-n" << "--eject" <<
"--driver" << "generic-mmc";
+
+ if (speedComboBox->currentIndex() != 0) {
+ arguments << "--speed" <<
speedComboBox->currentText().remove("x");
+ }
+
+ if (simulateCheckBox->isChecked()) {
+ arguments << "--simulate";
+ }
+
+ arguments << m_exportSpec->tocFileName;
+#if defined (Q_WS_MAC)
+ m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", arguments);
+#else
+ m_burnprocess->start(CDRDAO_BIN, arguments);
+#endif
+}
+
+void CDWritingDialog::cd_export_finished()
+{
+ PENTER;
+ disconnect(m_project, SIGNAL(overallExportProgressChanged(int)), this,
SLOT(cd_export_progress(int)));
+ disconnect(m_project, SIGNAL(exportFinished()), this,
SLOT(cd_export_finished()));
+
+ if (m_exportSpec->breakout) {
+ m_exportSpec->renderfinished = false;
+ update_cdburn_status(tr("Render process stopped on user
request."), NORMAL_MESSAGE);
+ enable_ui_interaction();
+ return;
+ }
+
+ if (cdDiskExportOnlyCheckBox->isChecked()) {
+ update_cdburn_status(tr("Export to disk finished!"),
NORMAL_MESSAGE);
+ enable_ui_interaction();
+ return;
+ }
+
+ m_exportSpec->renderfinished = true;
+ write_to_cd();
+}
+
+void CDWritingDialog::cd_export_progress(int progress)
+{
+ progressBar->setValue(progress);
+}
+
+void CDWritingDialog::update_cdburn_status(const QString& message, int type)
+{
+ if (type == NORMAL_MESSAGE) {
+ QPalette palette;
+ palette.setColor(QPalette::WindowText, QColor(Qt::black));
+ cdExportInformationLabel->setPalette(palette);
+ cdExportInformationLabel->setText(message);
+ }
+
+ if (type == ERROR_MESSAGE) {
+ QPalette palette;
+ palette.setColor(QPalette::WindowText, QColor(Qt::red));
+ cdExportInformationLabel->setPalette(palette);
+ cdExportInformationLabel->setText(message);
+ }
+}
+
+void CDWritingDialog::read_standard_output()
+{
+ Q_ASSERT(m_burnprocess);
+
+ if (m_writingState == QUERY_DEVICE) {
+ char buf[1024];
+
+ while(m_burnprocess->readLine(buf, sizeof(buf)) != -1) {
+ QString data = QString(buf);
+ //printf("%s\n", QS_C(data));
+ if (data.contains("trying to open")) {
+ update_cdburn_status(tr("Trying to access CD
Writer ..."), NORMAL_MESSAGE);
+ return;
+ }
+ if (data.contains("Cannot open") ||
data.contains("Cannot setup")) {
+ update_cdburn_status(tr("Cannot access CD
Writer, is it in use ?"), ERROR_MESSAGE);
+ return;
+ }
+#if defined (Q_WS_WIN)
+ if (data.contains(QRegExp("[0-9],[0-9],[0-9]"))) {
+#else
+ if (data.contains("/dev/")) {
+#endif
+ QString deviceName;
+ QStringList strlist =
QString(data).split(QRegExp("\\s+"));
+ for (int i=1; i<strlist.size(); ++i) {
+ QString token = strlist.at(i);
+ if (token.contains("Rev:")) {
+ break;
+ } else if (token != ":") {
+ deviceName += token + " ";
+ }
+ }
+ QString device = strlist.at(0);
+ device = device.remove(":");
+ deviceName += "(" + device + ")";
+ cdDeviceComboBox->addItem(deviceName, device);
+ }
+ }
+
+ QString cdrdaoDrive = config().get_property("Cdrdao", "drive",
"").toString();
+ if (cdrdaoDrive != "") {
+ int index = cdDeviceComboBox->findData(cdrdaoDrive);
+ if (index != -1) {
+ cdDeviceComboBox->setCurrentIndex(index);
+ }
+ }
+
+ update_cdburn_status(tr("Information"), NORMAL_MESSAGE);
+
+ return;
+ }
+
+
+ QString sout = m_burnprocess->readAllStandardOutput();
+
+ if (sout.simplified().isEmpty()) {
+ return;
+ }
+
+ if (sout.contains("Disk seems to be written")) {
+ int index = cdDeviceComboBox->currentIndex();
+ if (index != -1) {
+#if defined (Q_WS_WIN)
+ // No idea if this works.....
+ QProcess::execute("rsm.exe", QStringList() << "eject"
<< "/n0");
+#else
+ QProcess::execute("eject", QStringList() <<
cdDeviceComboBox->itemData(index).toString());
+#endif
+ }
+ QMessageBox::information( 0, tr("Disc not empty"),
+ tr("Please, insert an empty disc and
hit enter"),
+ QMessageBox::Ok);
+ m_burnprocess->write("enter");
+ return;
+ }
+
+ if (sout.contains("Inserted disk is not empty and not appendable.")) {
+ QMessageBox::information( 0, tr("Disc not empty"),
+ tr("Inserted disk is not empty, and
cannot append data to it!"),
+ QMessageBox::Ok);
+ return;
+ }
+
+
+ if (sout.contains("Unit not ready")) {
+ update_cdburn_status(tr("Waiting for CD Writer... (no disk
inserted?)"), NORMAL_MESSAGE);
+ progressBar->setMaximum(0);
+ return;
+ }
+
+
+ if (sout.contains("Turning BURN-Proof on")) {
+ update_cdburn_status(tr("Turning BURN-Proof on"),
NORMAL_MESSAGE);
+ return;
+ }
+
+ if (sout.contains("Writing track")) {
+ QStringList strlist = sout.split(QRegExp("\\s+"));
+ if (strlist.size() > 3) {
+ QString text = strlist.at(0) + " " + strlist.at(1) + "
" + strlist.at(2);
+ update_cdburn_status(text, NORMAL_MESSAGE);
+ }
+ return;
+ }
+
+ if (sout.contains("%") && sout.contains("(") && sout.contains(")")) {
+ QStringList strlist = sout.split(QRegExp("\\s+"));
+ if (strlist.size() > 7) {
+ int written = strlist.at(1).toInt();
+ int total = strlist.at(3).toInt();
+ if (total == 0) {
+ progressBar->setValue(0);
+ } else {
+ if (progressBar->maximum() == 0) {
+ progressBar->setMaximum(100);
+ }
+ int progress = (100 * written) / total;
+ progressBar->setValue(progress);
+ }
+ }
+ return;
+ }
+
+ // Write out only the unhandled cdrdao lines
+ printf("CD Writing: %s\n", QS_C(sout.trimmed()));
+}
+
+void CDWritingDialog::closeEvent(QCloseEvent * event)
+{
+ if (m_writingState != NO_STATE) {
+ event->setAccepted(false);
+ return;
+ }
+ QDialog::closeEvent(event);
+}
+
+void CDWritingDialog::reject()
+{
+ if (m_writingState == NO_STATE) {
+ hide();
+ }
+}
+
+void CDWritingDialog::export_only_changed(int state)
+{
+ if (state == Qt::Checked) {
+ burnGroupBox->setEnabled(false);
+ } else {
+ burnGroupBox->setEnabled(true);
+ }
+}
+
+void CDWritingDialog::disable_ui_interaction()
+{
+ closeButton->setEnabled(false);
+ burnGroupBox->setEnabled(false);
+ startButton->hide();
+ stopButton->show();
+}
+
+void CDWritingDialog::enable_ui_interaction()
+{
+ m_writingState = NO_STATE;
+ burnGroupBox->setDisabled(cdDiskExportOnlyCheckBox->isChecked());
+ closeButton->setEnabled(true);
+ startButton->show();
+ stopButton->hide();
+ stopButton->setEnabled(true);
+ progressBar->setValue(0);
+}
+
+void CDWritingDialog::set_was_closed()
+{
+ m_wasClosed = true;
+}
+
+QString CDWritingDialog::get_device(int index)
+{
+ #if defined (Q_WS_MAC)
+ return cdDeviceComboBox->currentText();
+ #else
+ return cdDeviceComboBox->itemData(index).toString();
+ #endif
+}
Index: dialogs/CDWritingDialog.h
===================================================================
RCS file: dialogs/CDWritingDialog.h
diff -N dialogs/CDWritingDialog.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ dialogs/CDWritingDialog.h 15 Oct 2007 11:28:28 -0000 1.1
@@ -0,0 +1,100 @@
+/*
+ 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 CD_WRITING_DIALOG_H
+#define CD_WRITING_DIALOG_H
+
+#include "ui_CDWritingDialog.h"
+
+#include <QDialog>
+
+class Project;
+class Song;
+struct ExportSpecification;
+class QProcess;
+
+class CDWritingDialog : public QDialog, protected Ui::CDWritingDialog
+{
+ Q_OBJECT
+
+public:
+ CDWritingDialog(QWidget* parent = 0);
+ ~CDWritingDialog();
+
+ void set_was_closed();
+
+protected:
+ void closeEvent(QCloseEvent* event);
+
+private:
+ Project* m_project;
+ QProcess* m_burnprocess;
+ ExportSpecification* m_exportSpec;
+
+ void show_progress_view();
+
+ bool is_safe_to_export();
+ void cd_render();
+ void write_to_cd();
+ void disable_ui_interaction();
+ void enable_ui_interaction();
+
+ void update_cdburn_status(const QString& message, int type);
+ void unlock_device();
+
+ enum {
+ NO_STATE,
+ RENDER,
+ BURNING,
+ ABORT_BURN,
+ QUERY_DEVICE,
+ UNLOCK_DEVICE,
+ NORMAL_MESSAGE,
+ ERROR_MESSAGE
+ };
+
+ int m_writingState;
+ int m_lastSheetExported;
+ bool m_wasClosed;
+ int m_copyNumber;
+ QString get_device(int index);
+
+private slots:
+ void set_project(Project* project);
+ void on_stopButton_clicked();
+ void export_only_changed(int state);
+ void start_burn_process();
+ void stop_burn_process();
+ void read_standard_output();
+ void cdrdao_process_started();
+ void cdrdao_process_finished(int exitcode, int exitstatus);
+ void cd_export_finished();
+ void cd_export_progress(int progress);
+ void query_devices();
+
+ void reject();
+};
+
+#endif
+
+//eof
+
+
Index: ExportWidget.cpp
===================================================================
RCS file: ExportWidget.cpp
diff -N ExportWidget.cpp
--- ExportWidget.cpp 24 Sep 2007 17:39:07 -0000 1.61
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,964 +0,0 @@
-/*
- Copyright (C) 2005-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 "ExportWidget.h"
-#include "ui_ExportWidget.h"
-
-#include "libtraversocore.h"
-
-#include <QFileDialog>
-#include <QByteArray>
-#include <QMessageBox>
-#include <QDebug>
-
-#include "Export.h"
-#include "Config.h"
-#include <AudioDevice.h>
-
-
-#if defined (Q_WS_WIN)
-#define CDRDAO_BIN "cdrdao.exe"
-#else
-#define CDRDAO_BIN "cdrdao"
-#endif
-
-RELAYTOOL_WAVPACK
-RELAYTOOL_FLAC
-RELAYTOOL_MP3LAME
-RELAYTOOL_VORBISENC
-
-// Always put me below _all_ includes, this is needed
-// in case we run with memory leak detection enabled!
-#include "Debugger.h"
-
-
-
-ExportWidget::ExportWidget( QWidget * parent )
- : QDialog(parent)
- , m_burnprocess(0)
- , m_exportSpec(0)
-{
- setupUi(this);
-
- stopButton->hide();
- QIcon icon =
QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
- fileSelectButton->setIcon(icon);
-
- set_project(pm().get_project());
-
- //bitdepthComboBox->addItem("8", 8);
- bitdepthComboBox->addItem("16", 16);
- bitdepthComboBox->addItem("24", 24);
- bitdepthComboBox->addItem("32", 32);
- bitdepthComboBox->addItem("32 (float)", 1);
-
- channelComboBox->addItem("Mono", 1);
- channelComboBox->addItem("Stereo", 2);
-
- sampleRateComboBox->addItem("8.000 Hz", 8000);
- sampleRateComboBox->addItem("11.025 Hz", 11025);
- sampleRateComboBox->addItem("22.050 Hz", 22050);
- sampleRateComboBox->addItem("44.100 Hz", 44100);
- sampleRateComboBox->addItem("48.000 Hz", 48000);
- sampleRateComboBox->addItem("88.200 Hz", 88200);
- sampleRateComboBox->addItem("96.000 Hz", 96000);
-
- audioTypeComboBox->addItem("WAV", "wav");
- audioTypeComboBox->addItem("AIFF", "aiff");
- if (libFLAC_is_present) {
- audioTypeComboBox->addItem("FLAC", "flac");
- }
- if (libwavpack_is_present) {
- audioTypeComboBox->addItem("WAVPACK", "wavpack");
- }
- if (libmp3lame_is_present) {
- audioTypeComboBox->addItem("MP3", "mp3");
- }
- if (libvorbisenc_is_present) {
- audioTypeComboBox->addItem("OGG", "ogg");
- }
-
- bitdepthComboBox->setCurrentIndex(bitdepthComboBox->findData(16));
- channelComboBox->setCurrentIndex(channelComboBox->findData(2));
-
- int rateIndex =
sampleRateComboBox->findData(audiodevice().get_sample_rate());
- if (rateIndex == -1) {
- rateIndex = 0;
- }
- sampleRateComboBox->setCurrentIndex(rateIndex);
-
- show_settings_view();
-
- connect(buttonBox, SIGNAL(accepted()), this,
SLOT(on_exportStartButton_clicked()));
- connect(buttonBox, SIGNAL(rejected()), this,
SLOT(on_cancelButton_clicked()));
- connect(closeButton, SIGNAL(clicked()), this, SLOT(hide()));
- connect(&pm(), SIGNAL(projectLoaded(Project*)), this,
SLOT(set_project(Project*)));
- connect(audioTypeComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(audio_type_changed(int)));
-
-
- // Mp3 Options Setup
- mp3MethodComboBox->addItem("Constant Bitrate", "cbr");
- mp3MethodComboBox->addItem("Average Bitrate", "abr");
- mp3MethodComboBox->addItem("Variable Bitrate", "vbr-new");
-
- mp3MinBitrateComboBox->addItem("32 - recommended", "32");
- mp3MinBitrateComboBox->addItem("64", "64");
- mp3MinBitrateComboBox->addItem("96", "96");
- mp3MinBitrateComboBox->addItem("128", "128");
- mp3MinBitrateComboBox->addItem("160", "160");
- mp3MinBitrateComboBox->addItem("192", "192");
- mp3MinBitrateComboBox->addItem("256", "256");
- mp3MinBitrateComboBox->addItem("320", "320");
-
- mp3MaxBitrateComboBox->addItem("32", "32");
- mp3MaxBitrateComboBox->addItem("64", "64");
- mp3MaxBitrateComboBox->addItem("96", "96");
- mp3MaxBitrateComboBox->addItem("128", "128");
- mp3MaxBitrateComboBox->addItem("160", "160");
- mp3MaxBitrateComboBox->addItem("192", "192");
- mp3MaxBitrateComboBox->addItem("256", "256");
- mp3MaxBitrateComboBox->addItem("320", "320");
-
-
mp3MethodComboBox->setCurrentIndex(mp3MethodComboBox->findData("vbr-new"));
-
mp3MinBitrateComboBox->setCurrentIndex(mp3MinBitrateComboBox->findData("32"));
-
mp3MaxBitrateComboBox->setCurrentIndex(mp3MaxBitrateComboBox->findData("192"));
-
- mp3OptionsGroupBox->hide();
- connect(mp3MethodComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(mp3_method_changed(int)));
-
-
- // Ogg Options Setup
- oggMethodComboBox->addItem("Constant Bitrate", "manual");
- oggMethodComboBox->addItem("Variable Bitrate", "vbr");
-
- oggBitrateComboBox->addItem("45", "45");
- oggBitrateComboBox->addItem("64", "64");
- oggBitrateComboBox->addItem("96", "96");
- oggBitrateComboBox->addItem("112", "112");
- oggBitrateComboBox->addItem("128", "128");
- oggBitrateComboBox->addItem("160", "160");
- oggBitrateComboBox->addItem("192", "192");
- oggBitrateComboBox->addItem("224", "224");
- oggBitrateComboBox->addItem("256", "256");
- oggBitrateComboBox->addItem("320", "320");
- oggBitrateComboBox->addItem("400", "400");
-
- oggMethodComboBox->setCurrentIndex(oggMethodComboBox->findData("vbr"));
-
oggBitrateComboBox->setCurrentIndex(oggBitrateComboBox->findData("160"));
- ogg_method_changed(oggMethodComboBox->findData("vbr"));
-
- oggOptionsGroupBox->hide();
- connect(oggMethodComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(ogg_method_changed(int)));
-
-
- // CD Burning stuff....
-
- m_burnprocess = new QProcess(this);
- m_burnprocess->setProcessChannelMode(QProcess::MergedChannels);
- QStringList env = QProcess::systemEnvironment();
- env << "LC_ALL=C";
- m_burnprocess->setEnvironment(env);
- m_writingState = NO_STATE;
- m_lastSheetExported = -1;
-
- refreshButton->setIcon(QIcon(find_pixmap(":/refresh-16")));
- refreshButton->setMaximumHeight(26);
- refreshButton->setMaximumWidth(30);
-
- connect(m_burnprocess, SIGNAL(readyReadStandardOutput()), this,
SLOT(read_standard_output()));
- connect(m_burnprocess, SIGNAL(started()), this,
SLOT(cdrdao_process_started()));
- connect(m_burnprocess, SIGNAL(finished(int, QProcess::ExitStatus)),
- this, SLOT(cdrdao_process_finished(int, QProcess::ExitStatus)));
- connect(startButton, SIGNAL(clicked()), this,
SLOT(start_burn_process()));
- connect(stopButton, SIGNAL(clicked()), this, SLOT(stop_burn_process()));
- connect(refreshButton, SIGNAL(clicked()), this, SLOT(query_devices()));
- connect(cdDiskExportOnlyCheckBox, SIGNAL(stateChanged(int)), this,
SLOT(export_only_changed(int)));
-
- query_devices();
-}
-
-ExportWidget::~ ExportWidget( )
-{}
-
-
-bool ExportWidget::is_safe_to_export()
-{
- PENTER;
- if (m_project->is_recording()) {
- info().warning(tr("Export during recording is not supported!"));
- return false;
- }
-
- QDir exportDir;
- QString dirName = exportDirName->text();
-
- if (!dirName.isEmpty() && !exportDir.exists(dirName)) {
- if (!exportDir.mkpath(dirName)) {
- info().warning(tr("Unable to create export directory!
Please check permissions for this directory: %1").arg(dirName));
- return false;
- }
- }
-
- return true;
-}
-
-
-void ExportWidget::audio_type_changed(int index)
-{
- QString newType = audioTypeComboBox->itemData(index).toString();
-
- if (newType == "mp3") {
- oggOptionsGroupBox->hide();
- mp3OptionsGroupBox->show();
- }
- else if (newType == "ogg") {
- mp3OptionsGroupBox->hide();
- oggOptionsGroupBox->show();
- }
- else {
- mp3OptionsGroupBox->hide();
- oggOptionsGroupBox->hide();
- }
-
- if (newType == "mp3" || newType == "ogg" || newType == "flac") {
-
bitdepthComboBox->setCurrentIndex(bitdepthComboBox->findData(16));
- bitdepthComboBox->setDisabled(true);
- }
- else {
- bitdepthComboBox->setEnabled(true);
- }
-}
-
-
-void ExportWidget::mp3_method_changed(int index)
-{
- QString method = mp3MethodComboBox->itemData(index).toString();
-
- if (method == "cbr") {
- mp3MinBitrateComboBox->hide();
- mp3MinBitrateLabel->hide();
- mp3MaxBitrateLabel->setText(tr("Bitrate"));
- }
- else if (method == "abr") {
- mp3MinBitrateComboBox->hide();
- mp3MinBitrateLabel->hide();
- mp3MaxBitrateLabel->setText(tr("Average Bitrate"));
- }
- else {
- // VBR new or VBR old
- mp3MinBitrateComboBox->show();
- mp3MinBitrateLabel->show();
- mp3MaxBitrateLabel->setText(tr("Maximum Bitrate"));
- }
-}
-
-
-void ExportWidget::ogg_method_changed(int index)
-{
- QString method = oggMethodComboBox->itemData(index).toString();
-
- if (method == "manual") {
- oggBitrateComboBox->show();
- oggBitrateLabel->show();
- oggQualitySlider->hide();
- oggQualityLabel->hide();
- }
- else {
- // VBR
- oggQualitySlider->show();
- oggQualityLabel->show();
- oggBitrateComboBox->hide();
- oggBitrateLabel->hide();
- }
-}
-
-
-void ExportWidget::on_exportStartButton_clicked( )
-{
- if (!is_safe_to_export()) {
- return;
- }
-
- cdburningWidget->setEnabled(false);
-
- show_progress_view();
-
- // clear extraformats, it might be different now from previous runs!
- m_exportSpec->extraFormat.clear();
-
-
- QString audioType =
audioTypeComboBox->itemData(audioTypeComboBox->currentIndex()).toString();
- if (audioType == "wav") {
- m_exportSpec->writerType = "sndfile";
- m_exportSpec->extraFormat["filetype"] = "wav";
- }
- else if (audioType == "aiff") {
- m_exportSpec->writerType = "sndfile";
- m_exportSpec->extraFormat["filetype"] = "aiff";
- }
- else if (audioType == "flac") {
- m_exportSpec->writerType = "flac";
- }
- else if (audioType == "wavpack") {
- m_exportSpec->writerType = "wavpack";
- m_exportSpec->extraFormat["quality"] = "high";
- m_exportSpec->extraFormat["skip_wvx"] = "true";
- }
- else if (audioType == "mp3") {
- m_exportSpec->writerType = "lame";
- m_exportSpec->extraFormat["method"] =
mp3MethodComboBox->itemData(mp3MethodComboBox->currentIndex()).toString();
- m_exportSpec->extraFormat["minBitrate"] =
mp3MinBitrateComboBox->itemData(mp3MinBitrateComboBox->currentIndex()).toString();
- m_exportSpec->extraFormat["maxBitrate"] =
mp3MaxBitrateComboBox->itemData(mp3MaxBitrateComboBox->currentIndex()).toString();
- m_exportSpec->extraFormat["quality"] =
QString::number(mp3QualitySlider->value());
- }
- else if (audioType == "ogg") {
- m_exportSpec->writerType = "vorbis";
- m_exportSpec->extraFormat["mode"] =
oggMethodComboBox->itemData(oggMethodComboBox->currentIndex()).toString();
- if (m_exportSpec->extraFormat["mode"] == "manual") {
- m_exportSpec->extraFormat["bitrateNominal"] =
oggBitrateComboBox->itemData(oggBitrateComboBox->currentIndex()).toString();
- m_exportSpec->extraFormat["bitrateUpper"] =
oggBitrateComboBox->itemData(oggBitrateComboBox->currentIndex()).toString();
- }
- else {
- m_exportSpec->extraFormat["vbrQuality"] =
QString::number(oggQualitySlider->value());
- }
- }
-
- m_exportSpec->data_width =
bitdepthComboBox->itemData(bitdepthComboBox->currentIndex()).toInt();
- m_exportSpec->channels =
channelComboBox->itemData(channelComboBox->currentIndex()).toInt();
- m_exportSpec->sample_rate =
sampleRateComboBox->itemData(sampleRateComboBox->currentIndex()).toInt();
-
- //TODO Make a ComboBox for this one too!
- m_exportSpec->dither_type = GDitherTri;
-
- //TODO Make a ComboBox for this one too!
- m_exportSpec->src_quality = SRC_SINC_MEDIUM_QUALITY; //
SRC_SINC_BEST_QUALITY SRC_SINC_FASTEST SRC_ZERO_ORDER_HOLD SRC_LINEAR
-
- if (allSongsButton->isChecked()) {
- m_exportSpec->allSongs = true;
- } else {
- m_exportSpec->allSongs = false;
- }
-
- QString name = m_exportSpec->exportdir + "/";
- QFileInfo fi(m_exportSpec->name);
- name += fi.completeBaseName() + ".toc";
- m_exportSpec->tocFileName = name;
-
- m_exportSpec->normalize = normalizeCheckBox->isChecked();
- m_exportSpec->isRecording = false;
- m_project->export_project(m_exportSpec);
-}
-
-
-void ExportWidget::on_cancelButton_clicked()
-{
- hide();
-}
-
-
-void ExportWidget::on_exportStopButton_clicked( )
-{
- show_settings_view();
- m_exportSpec->stop = true;
- m_exportSpec->breakout = true;
-}
-
-
-void ExportWidget::on_fileSelectButton_clicked( )
-{
- if (!m_project) {
- info().information(tr("No project loaded, to export a project,
load it first!"));
- return;
- }
-
- QString dirName = QFileDialog::getExistingDirectory(this,
tr("Choose/create an export directory"), m_exportSpec->exportdir);
-
- if (!dirName.isEmpty()) {
- exportDirName->setText(dirName);
- }
-}
-
-
-void ExportWidget::update_song_progress( int progress )
-{
- songProgressBar->setValue(progress);
-}
-
-void ExportWidget::update_overall_progress( int progress )
-{
- overalProgressBar->setValue(progress);
-}
-
-void ExportWidget::render_finished( )
-{
- songProgressBar->setValue(0);
- overalProgressBar->setValue(0);
-
- show_settings_view();
-
- cdburningWidget->setEnabled(true);
-
- on_cancelButton_clicked();
-}
-
-void ExportWidget::set_exporting_song( Song * song )
-{
- QString name = tr("Progress of Sheet ") +
- QString::number(m_project->get_song_index(song->get_id())) + ":
" +
- song->get_title();
-
- currentProcessingSongName->setText(name);
-}
-
-void ExportWidget::show_progress_view( )
-{
- buttonBox->setEnabled(false);
- stackedWidget->setCurrentIndex(1);
-}
-
-void ExportWidget::show_settings_view( )
-{
- stackedWidget->setCurrentIndex(0);
- buttonBox->setEnabled(true);
-}
-
-void ExportWidget::set_project(Project * project)
-{
- m_project = project;
- if (! m_project) {
- info().information(tr("No project loaded, to export a project,
load it first!"));
- setEnabled(false);
- if (m_exportSpec) {
- delete m_exportSpec;
- m_exportSpec = 0;
- }
- } else {
- setEnabled(true);
- if (m_exportSpec) {
- delete m_exportSpec;
- m_exportSpec = 0;
- }
- m_exportSpec = new ExportSpecification;
- m_exportSpec->exportdir = m_project->get_root_dir() +
"/Export/";
- m_exportSpec->renderfinished = false;
- exportDirName->setText(m_exportSpec->exportdir);
-
- connect(m_project, SIGNAL(songExportProgressChanged(int)),
this, SLOT(update_song_progress(int)));
- connect(m_project, SIGNAL(overallExportProgressChanged(int)),
this, SLOT(update_overall_progress(int)));
- connect(m_project, SIGNAL(exportFinished()), this,
SLOT(render_finished()));
- connect(m_project, SIGNAL(exportStartedForSong(Song*)), this,
SLOT (set_exporting_song(Song*)));
- }
-}
-
-
-
-
-/****************************************************************/
-/* CD EXPORT */
-/****************************************************************/
-
-
-void ExportWidget::query_devices()
-{
- if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
- printf("query_devices: burnprocess still running!\n");
- return;
- }
-
- m_writingState = QUERY_DEVICE;
- cdDeviceComboBox->clear();
-
-#if defined (Q_WS_WIN)
- m_burnprocess->start(CDRDAO_BIN, QStringList() << "scanbus");
-#elif defined (Q_WS_MAC)
- cdDeviceComboBox->clear();
- cdDeviceComboBox->addItem("IODVDServices");
- cdDeviceComboBox->addItem("IODVDServices/2");
- cdDeviceComboBox->addItem("IOCompactDiscServices");
- cdDeviceComboBox->addItem("IOCompactDiscServices/2");
-#else
- m_burnprocess->start(CDRDAO_BIN, QStringList() << "drive-info");
-#endif
-}
-
-void ExportWidget::unlock_device()
-{
- if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
- return;
- }
-
- m_writingState = UNLOCK_DEVICE;
- int index = cdDeviceComboBox->currentIndex();
- if (index == -1) {
- return;
- }
-
- QString device = get_device(index);
-
- QStringList args;
- args << "unlock" << "--device" << device;
-#if defined (Q_WS_MAC)
- m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", args);
-#else
- m_burnprocess->start(CDRDAO_BIN, args);
-#endif
-}
-
-
-void ExportWidget::stop_burn_process()
-{
- PENTER;
-
- if (m_writingState == RENDER) {
- update_cdburn_status(tr("Aborting Render process ..."),
NORMAL_MESSAGE);
- m_exportSpec->stop = true;
- m_exportSpec->breakout = true;
- m_exportSpec->renderfinished = false;
- }
- if (m_writingState == BURNING) {
- update_cdburn_status(tr("Aborting CD Burn process ..."),
NORMAL_MESSAGE);
- m_burnprocess->terminate();
- m_writingState = ABORT_BURN;
- }
-
- stopButton->setEnabled(false);
-}
-
-
-void ExportWidget::start_burn_process()
-{
- PENTER;
-
- if(!is_safe_to_export()) {
- return;
- }
-
- m_copyNumber = 0;
- cd_render();
-
- int index = cdDeviceComboBox->currentIndex();
- if (index != -1 && cdDeviceComboBox->itemData(index) !=
QVariant::Invalid) {
- config().set_property("Cdrdao", "drive",
cdDeviceComboBox->itemData(index));
- }
-}
-
-
-void ExportWidget::cdrdao_process_started()
-{
- PENTER;
-
- if (m_writingState == BURNING) {
- update_cdburn_status(tr("Waiting for CD-Writer..."),
NORMAL_MESSAGE);
- progressBar->setMaximum(0);
- }
-
-}
-
-void ExportWidget::cdrdao_process_finished(int exitcode, QProcess::ExitStatus
exitstatus)
-{
- if (exitstatus == QProcess::CrashExit) {
- update_cdburn_status(tr("CD Burn process failed!"),
ERROR_MESSAGE);
- }
-
- if (m_writingState == ABORT_BURN) {
- update_cdburn_status(tr("CD Burn process stopped on user
request."), NORMAL_MESSAGE);
- }
-
- if (m_writingState == BURNING) {
- update_cdburn_status(tr("CD Writing process finished!"),
NORMAL_MESSAGE);
- }
-
- if (exitstatus == QProcess::CrashExit || m_writingState == ABORT_BURN) {
- unlock_device();
- }
-
- progressBar->setMaximum(100);
- progressBar->setValue(0);
-
- if (m_writingState == BURNING) {
- // check if we have to write another CD
- bool writeAnotherCd = false;
- if (m_copyNumber < spinBoxNumCopies->value()) {
- if (QMessageBox::information(this, tr("Writing CD %1 of
%2").arg(m_copyNumber+1).arg(spinBoxNumCopies->value()), tr("Please insert an
empty CD and press OK to continue."), QMessageBox::Ok | QMessageBox::Cancel) ==
QMessageBox::Ok) {
- writeAnotherCd = true;
- }
- }
-
- if (writeAnotherCd) {
- write_to_cd();
- return;
- }
- }
-
- enable_ui_interaction();
-}
-
-void ExportWidget::cd_render()
-{
- PENTER;
-
- if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
- info().critical(tr("Burn process is still running, cannot start
it twice!!"));
- return;
- }
-
- // FIXME: We should instead check export wav file timestamps/revision
numbers as a dirty test
- if (! cdAllSongsButton->isChecked() && m_lastSheetExported !=
m_project->get_current_song_id()) {
- m_exportSpec->renderfinished = false;
- }
-
- if (m_wasClosed && m_exportSpec->renderfinished &&
(m_exportSpec->allSongs == cdAllSongsButton->isChecked()) ) {
-
- if (QMessageBox::question(this, tr("Rerender CD content"),
- tr("There is already a CD render
available.\nShould I re-render the CD content?"),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No) == QMessageBox::Yes)
- {
- m_exportSpec->renderfinished = false;
- }
- }
-
- m_wasClosed = false;
-
- if ( ! (m_exportSpec->renderfinished &&
- (m_exportSpec->allSongs == cdAllSongsButton->isChecked()) &&
- (m_exportSpec->normalize == cdNormalizeCheckBox->isChecked()))
) {
-
- m_exportSpec->data_width = 16;
- m_exportSpec->writerType = "sndfile";
- m_exportSpec->extraFormat["filetype"] = "wav";
- m_exportSpec->channels = 2;
- m_exportSpec->sample_rate = 44100;
- m_exportSpec->writeToc = true;
- m_exportSpec->dither_type = GDitherTri;
- m_exportSpec->src_quality = SRC_SINC_MEDIUM_QUALITY; //
SRC_SINC_BEST_QUALITY SRC_SINC_FASTEST SRC_ZERO_ORDER_HOLD SRC_LINEAR
- if (cdAllSongsButton->isChecked()) {
- m_exportSpec->allSongs = true;
- } else {
- m_exportSpec->allSongs = false;
- }
- m_exportSpec->normalize = cdNormalizeCheckBox->isChecked();
- m_exportSpec->isRecording = false;
- m_exportSpec->stop = false;
- m_exportSpec->breakout = false;
- m_exportSpec->isCdExport = true;
-
- if (m_project->create_cdrdao_toc(m_exportSpec) < 0) {
- info().warning(tr("Creating CDROM table of contents
failed, unable to write CD"));
- return;
- }
-
- m_writingState = RENDER;
-
- connect(m_project, SIGNAL(overallExportProgressChanged(int)),
this, SLOT(cd_export_progress(int)));
- connect(m_project, SIGNAL(exportFinished()), this,
SLOT(cd_export_finished()));
-
- update_cdburn_status(tr("Rendering Sheet(s)"), NORMAL_MESSAGE);
-
- disable_ui_interaction();
- m_project->export_project(m_exportSpec);
- m_lastSheetExported = m_project->get_current_song_id();
- } else {
- if (cdDiskExportOnlyCheckBox->isChecked()) {
- return;
- }
- disable_ui_interaction();
- write_to_cd();
- }
-}
-
-void ExportWidget::write_to_cd()
-{
- PENTER;
-
- m_copyNumber++;
-
- if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
- info().critical(tr("Burn process is still running, cannot start
it twice!!"));
- return;
- }
-
- m_writingState = BURNING;
- progressBar->setValue(0);
-
- int index = cdDeviceComboBox->currentIndex();
- if (index == -1) {
- QMessageBox::information( 0, tr("No Burn Device"),
- tr("No burn Device selected or
available!"),
- QMessageBox::Ok);
- enable_ui_interaction();
- return;
- }
-
- QString device = get_device(index);
- QStringList arguments;
- arguments << "write" << "--device" << device << "-n" << "--eject" <<
"--driver" << "generic-mmc";
-
- if (speedComboBox->currentIndex() != 0) {
- arguments << "--speed" <<
speedComboBox->currentText().remove("x");
- }
-
- if (simulateCheckBox->isChecked()) {
- arguments << "--simulate";
- }
-
- arguments << m_exportSpec->tocFileName;
-#if defined (Q_WS_MAC)
- m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", arguments);
-#else
- m_burnprocess->start(CDRDAO_BIN, arguments);
-#endif
-}
-
-void ExportWidget::cd_export_finished()
-{
- PENTER;
- disconnect(m_project, SIGNAL(overallExportProgressChanged(int)), this,
SLOT(cd_export_progress(int)));
- disconnect(m_project, SIGNAL(exportFinished()), this,
SLOT(cd_export_finished()));
-
- if (m_exportSpec->breakout) {
- m_exportSpec->renderfinished = false;
- update_cdburn_status(tr("Render process stopped on user
request."), NORMAL_MESSAGE);
- enable_ui_interaction();
- return;
- }
-
- if (cdDiskExportOnlyCheckBox->isChecked()) {
- update_cdburn_status(tr("Export to disk finished!"),
NORMAL_MESSAGE);
- enable_ui_interaction();
- return;
- }
-
- m_exportSpec->renderfinished = true;
- write_to_cd();
-}
-
-void ExportWidget::cd_export_progress(int progress)
-{
- progressBar->setValue(progress);
-}
-
-void ExportWidget::update_cdburn_status(const QString& message, int type)
-{
- if (type == NORMAL_MESSAGE) {
- QPalette palette;
- palette.setColor(QPalette::WindowText, QColor(Qt::black));
- cdExportInformationLabel->setPalette(palette);
- cdExportInformationLabel->setText(message);
- }
-
- if (type == ERROR_MESSAGE) {
- QPalette palette;
- palette.setColor(QPalette::WindowText, QColor(Qt::red));
- cdExportInformationLabel->setPalette(palette);
- cdExportInformationLabel->setText(message);
- }
-}
-
-void ExportWidget::read_standard_output()
-{
- Q_ASSERT(m_burnprocess);
-
- if (m_writingState == QUERY_DEVICE) {
- char buf[1024];
-
- while(m_burnprocess->readLine(buf, sizeof(buf)) != -1) {
- QString data = QString(buf);
- //printf("%s\n", QS_C(data));
- if (data.contains("trying to open")) {
- update_cdburn_status(tr("Trying to access CD
Writer ..."), NORMAL_MESSAGE);
- return;
- }
- if (data.contains("Cannot open") ||
data.contains("Cannot setup")) {
- update_cdburn_status(tr("Cannot access CD
Writer, is it in use ?"), ERROR_MESSAGE);
- return;
- }
-#if defined (Q_WS_WIN)
- if (data.contains(QRegExp("[0-9],[0-9],[0-9]"))) {
-#else
- if (data.contains("/dev/")) {
-#endif
- QString deviceName;
- QStringList strlist =
QString(data).split(QRegExp("\\s+"));
- for (int i=1; i<strlist.size(); ++i) {
- QString token = strlist.at(i);
- if (token.contains("Rev:")) {
- break;
- } else if (token != ":") {
- deviceName += token + " ";
- }
- }
- QString device = strlist.at(0);
- device = device.remove(":");
- deviceName += "(" + device + ")";
- cdDeviceComboBox->addItem(deviceName, device);
- }
- }
-
- QString cdrdaoDrive = config().get_property("Cdrdao", "drive",
"").toString();
- if (cdrdaoDrive != "") {
- int index = cdDeviceComboBox->findData(cdrdaoDrive);
- if (index != -1) {
- cdDeviceComboBox->setCurrentIndex(index);
- }
- }
-
- update_cdburn_status(tr("Information"), NORMAL_MESSAGE);
-
- return;
- }
-
-
- QString sout = m_burnprocess->readAllStandardOutput();
-
- if (sout.simplified().isEmpty()) {
- return;
- }
-
- if (sout.contains("Disk seems to be written")) {
- int index = cdDeviceComboBox->currentIndex();
- if (index != -1) {
-#if defined (Q_WS_WIN)
- // No idea if this works.....
- QProcess::execute("rsm.exe", QStringList() << "eject"
<< "/n0");
-#else
- QProcess::execute("eject", QStringList() <<
cdDeviceComboBox->itemData(index).toString());
-#endif
- }
- QMessageBox::information( 0, tr("Disc not empty"),
- tr("Please, insert an empty disc and
hit enter"),
- QMessageBox::Ok);
- m_burnprocess->write("enter");
- return;
- }
-
- if (sout.contains("Inserted disk is not empty and not appendable.")) {
- QMessageBox::information( 0, tr("Disc not empty"),
- tr("Inserted disk is not empty, and
cannot append data to it!"),
- QMessageBox::Ok);
- return;
- }
-
-
- if (sout.contains("Unit not ready")) {
- update_cdburn_status(tr("Waiting for CD Writer... (no disk
inserted?)"), NORMAL_MESSAGE);
- progressBar->setMaximum(0);
- return;
- }
-
-
- if (sout.contains("Turning BURN-Proof on")) {
- update_cdburn_status(tr("Turning BURN-Proof on"),
NORMAL_MESSAGE);
- return;
- }
-
- if (sout.contains("Writing track")) {
- QStringList strlist = sout.split(QRegExp("\\s+"));
- if (strlist.size() > 3) {
- QString text = strlist.at(0) + " " + strlist.at(1) + "
" + strlist.at(2);
- update_cdburn_status(text, NORMAL_MESSAGE);
- }
- return;
- }
-
- if (sout.contains("%") && sout.contains("(") && sout.contains(")")) {
- QStringList strlist = sout.split(QRegExp("\\s+"));
- if (strlist.size() > 7) {
- int written = strlist.at(1).toInt();
- int total = strlist.at(3).toInt();
- if (total == 0) {
- progressBar->setValue(0);
- } else {
- if (progressBar->maximum() == 0) {
- progressBar->setMaximum(100);
- }
- int progress = (100 * written) / total;
- progressBar->setValue(progress);
- }
- }
- return;
- }
-
- // Write out only the unhandled cdrdao lines
- printf("CD Writing: %s\n", QS_C(sout.trimmed()));
-}
-
-void ExportWidget::closeEvent(QCloseEvent * event)
-{
- if (m_writingState != NO_STATE || !buttonBox->isEnabled()) {
- event->setAccepted(false);
- return;
- }
- QDialog::closeEvent(event);
-}
-
-void ExportWidget::reject()
-{
- if (m_writingState == NO_STATE && buttonBox->isEnabled()) {
- hide();
- }
-}
-
-void ExportWidget::export_only_changed(int state)
-{
- if (state == Qt::Checked) {
- burnGroupBox->setEnabled(false);
- } else {
- burnGroupBox->setEnabled(true);
- }
-}
-
-void ExportWidget::disable_ui_interaction()
-{
- closeButton->setEnabled(false);
- exportWidget->setEnabled(false);
- optionsGroupBox->setEnabled(false);
- burnGroupBox->setEnabled(false);
- startButton->hide();
- stopButton->show();
-}
-
-void ExportWidget::enable_ui_interaction()
-{
- m_writingState = NO_STATE;
- exportWidget->setEnabled(true);
- optionsGroupBox->setEnabled(true);
- burnGroupBox->setDisabled(cdDiskExportOnlyCheckBox->isChecked());
- closeButton->setEnabled(true);
- startButton->show();
- stopButton->hide();
- stopButton->setEnabled(true);
- progressBar->setValue(0);
-}
-
-void ExportWidget::set_was_closed()
-{
- m_wasClosed = true;
-}
-
-QString ExportWidget::get_device(int index)
-{
- #if defined (Q_WS_MAC)
- return cdDeviceComboBox->currentText();
- #else
- return cdDeviceComboBox->itemData(index).toString();
- #endif
-}
Index: ExportWidget.h
===================================================================
RCS file: ExportWidget.h
diff -N ExportWidget.h
--- ExportWidget.h 21 Sep 2007 17:01:07 -0000 1.16
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,114 +0,0 @@
-/*
- Copyright (C) 2005-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 EXPORTWIDGET_H
-#define EXPORTWIDGET_H
-
-#include "ui_ExportWidget.h"
-
-#include <QDialog>
-#include <QProcess>
-
-class Project;
-class Song;
-struct ExportSpecification;
-
-class ExportWidget : public QDialog, protected Ui::ExportWidget
-{
- Q_OBJECT
-
-public:
- ExportWidget(QWidget* parent = 0);
- ~ExportWidget();
-
- void set_was_closed();
-
-protected:
- void closeEvent(QCloseEvent* event);
-
-private:
- Project* m_project;
- QProcess* m_burnprocess;
- ExportSpecification* m_exportSpec;
-
- void show_progress_view();
- void show_settings_view();
-
- bool is_safe_to_export();
- void cd_render();
- void write_to_cd();
- void disable_ui_interaction();
- void enable_ui_interaction();
-
- void update_cdburn_status(const QString& message, int type);
- void unlock_device();
-
- enum {
- NO_STATE,
- RENDER,
- BURNING,
- ABORT_BURN,
- QUERY_DEVICE,
- UNLOCK_DEVICE,
- NORMAL_MESSAGE,
- ERROR_MESSAGE
- };
-
- int m_writingState;
- int m_lastSheetExported;
- bool m_wasClosed;
- int m_copyNumber;
- QString get_device(int index);
-
-private slots:
- void set_project(Project* project);
- void update_song_progress(int progress);
- void update_overall_progress(int progress);
- void render_finished();
- void set_exporting_song(Song* song);
-
- void on_fileSelectButton_clicked();
- void on_exportStartButton_clicked();
- void on_exportStopButton_clicked();
- void on_cancelButton_clicked();
- void export_only_changed(int state);
-
- void audio_type_changed(int index);
- void mp3_method_changed(int index);
- void ogg_method_changed(int index);
-
- void start_burn_process();
- void stop_burn_process();
- void read_standard_output();
- void cdrdao_process_started();
- void cdrdao_process_finished(int exitcode, QProcess::ExitStatus
exitstatus);
- void cd_export_finished();
- void cd_export_progress(int progress);
- void query_devices();
-
- void reject();
-};
-
-#endif
-
-//eof
-
-
Index: ui/ExportWidget.ui
===================================================================
RCS file: ui/ExportWidget.ui
diff -N ui/ExportWidget.ui
--- ui/ExportWidget.ui 21 Sep 2007 17:01:07 -0000 1.18
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,1101 +0,0 @@
-<ui version="4.0" >
- <class>ExportWidget</class>
- <widget class="QDialog" name="ExportWidget" >
- <property name="windowModality" >
- <enum>Qt::ApplicationModal</enum>
- </property>
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>410</width>
- <height>456</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Export</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="exportWidget" >
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <attribute name="title" >
- <string>Export to Harddisk</string>
- </attribute>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QStackedWidget" name="stackedWidget" >
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="page" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>12</number>
- </property>
- <item>
- <widget class="QGroupBox" name="generalOptionsGroupBox" >
- <property name="title" >
- <string>General Options</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>
- <widget class="QLabel" name="label_6" >
- <property name="text" >
- <string>Sheet(s) to render</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="currentSongButton" >
- <property name="text" >
- <string>Current</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="allSongsButton" >
- <property name="text" >
- <string>All</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Export directory</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </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="exportDirName" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="fileSelectButton" >
- <property name="text" >
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="normalizeCheckBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Calculate and apply normalization</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="exportSpecificationsGroupBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>Format Options</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_2" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Audio type</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="audioTypeComboBox" />
- </item>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>Channels</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="channelComboBox" />
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label_3" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Bitdepth</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="bitdepthComboBox" />
- </item>
- <item>
- <widget class="QLabel" name="label_8" >
- <property name="text" >
- <string>Sample rate</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="sampleRateComboBox" />
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="mp3OptionsGroupBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>MP3 Options</string>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QLabel" name="label_15" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Encoding Method</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="mp3MaxBitrateLabel" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Maximum Bitrate</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="mp3MinBitrateLabel" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Minimum Bitrate</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_16" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Quality (Fastest <-> Best)</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="mp3MaxBitrateComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="mp3MinBitrateComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="mp3MethodComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QSlider" name="mp3QualitySlider" >
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="autoFillBackground" >
- <bool>false</bool>
- </property>
- <property name="minimum" >
- <number>1</number>
- </property>
- <property name="maximum" >
- <number>9</number>
- </property>
- <property name="pageStep" >
- <number>1</number>
- </property>
- <property name="value" >
- <number>3</number>
- </property>
- <property name="tracking" >
- <bool>true</bool>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="invertedAppearance" >
- <bool>true</bool>
- </property>
- <property name="invertedControls" >
- <bool>false</bool>
- </property>
- <property name="tickPosition" >
- <enum>QSlider::TicksAbove</enum>
- </property>
- <property name="tickInterval" >
- <number>1</number>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="oggOptionsGroupBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>Ogg Options</string>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="2" column="0" >
- <widget class="QLabel" name="oggBitrateLabel" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Bitrate</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="oggBitrateComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QSlider" name="oggQualitySlider" >
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="autoFillBackground" >
- <bool>false</bool>
- </property>
- <property name="minimum" >
- <number>0</number>
- </property>
- <property name="maximum" >
- <number>10</number>
- </property>
- <property name="pageStep" >
- <number>1</number>
- </property>
- <property name="value" >
- <number>7</number>
- </property>
- <property name="tracking" >
- <bool>true</bool>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="invertedAppearance" >
- <bool>false</bool>
- </property>
- <property name="invertedControls" >
- <bool>false</bool>
- </property>
- <property name="tickPosition" >
- <enum>QSlider::TicksAbove</enum>
- </property>
- <property name="tickInterval" >
- <number>1</number>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="oggMethodComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="oggQualityLabel" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Quality (Smallest <-> Best)</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="label_17" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Encoding Method</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="page_2" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QGroupBox" name="ExportStateGroupBox" >
- <property name="title" >
- <string>Export status</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>
- <widget class="QLabel" name="currentProcessingSongName" >
- <property name="text" >
- <string>-</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QProgressBar" name="songProgressBar" >
- <property name="value" >
- <number>0</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_5" >
- <property name="text" >
- <string>Overall Progress</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QProgressBar" name="overalProgressBar" >
- <property name="value" >
- <number>0</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </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="exportStopButton" >
- <property name="text" >
- <string>Stop</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>61</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="cdburningWidget" >
- <attribute name="title" >
- <string>Burn to CD</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QGroupBox" name="optionsGroupBox" >
- <property name="title" >
- <string>General Options</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>
- <widget class="QLabel" name="label_7" >
- <property name="text" >
- <string>Sheet(s) to render</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="cdCurrentSongButton" >
- <property name="text" >
- <string>Current</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="cdAllSongsButton" >
- <property name="text" >
- <string>All</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="cdNormalizeCheckBox" >
- <property name="text" >
- <string>Calculate and apply normalization</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="cdDiskExportOnlyCheckBox" >
- <property name="text" >
- <string>Export to disk only (don't burn)</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="QLabel" name="label_10" >
- <property name="text" >
- <string>Number of copies</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="spinBoxNumCopies" >
- <property name="minimum" >
- <number>1</number>
- </property>
- <property name="value" >
- <number>1</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="burnGroupBox" >
- <property name="title" >
- <string>Burning Device</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>
- <widget class="QComboBox" name="cdDeviceComboBox" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>5</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="refreshButton" >
- <property name="text" >
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="simulateCheckBox" >
- <property name="text" >
- <string>Simulate</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_9" >
- <property name="text" >
- <string>Speed</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="speedComboBox" >
- <item>
- <property name="text" >
- <string>auto</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>1x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>2x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>4x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>8x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>12x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>16x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>20x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>24x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>28x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>32x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>36x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>40x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>44x</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>48x</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_3" >
- <property name="title" >
- <string>Status</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="cdExportInformationLabel" >
- <property name="text" >
- <string>Information</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QProgressBar" name="progressBar" >
- <property name="value" >
- <number>0</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </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="stopButton" >
- <property name="text" >
- <string>Abort</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton" >
- <property name="text" >
- <string>Close</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src/traverso Interface.cpp Interface.h...,
Remon Sijrier <=