diff --git a/CMakeLists.txt b/CMakeLists.txt index f46c8b342..9673c200e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -447,7 +447,7 @@ SET(CMAKE_CXX_FLAGS "-O2 -g -fno-exceptions -Wall -ftree-vectorize ${CMAKE_CXX_F FILE(GLOB_RECURSE lmms_INCLUDES ${CMAKE_SOURCE_DIR}/include/*.h) -FILE(GLOB lmms_UI ${CMAKE_SOURCE_DIR}/src/gui/dialogs/*.ui) +FILE(GLOB lmms_UI ${CMAKE_SOURCE_DIR}/src/gui/Forms/*.ui) FILE(GLOB_RECURSE lmms_SOURCES ${CMAKE_SOURCE_DIR}/src/*.cpp) SET(lmms_MOC ${lmms_INCLUDES}) diff --git a/include/about_dialog.h b/include/AboutDialog.h similarity index 79% rename from include/about_dialog.h rename to include/AboutDialog.h index b2621ba52..c68857108 100644 --- a/include/about_dialog.h +++ b/include/AboutDialog.h @@ -1,8 +1,8 @@ /* - * about_dialog.h - declaration of class aboutDialog + * AboutDialog.h - declaration of class AboutDialog + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,22 +22,22 @@ * */ - #ifndef _ABOUT_DIALOG_H #define _ABOUT_DIALOG_H #include -#include "ui_about_dialog.h" +namespace Ui { class AboutDialog; } - -class aboutDialog : public QDialog, public Ui::AboutDialog +class AboutDialog : public QDialog { public: - aboutDialog( void ); + AboutDialog(); + +private: + Ui::AboutDialog * ui; } ; - #endif diff --git a/include/export_project_dialog.h b/include/ExportProjectDialog.h similarity index 71% rename from include/export_project_dialog.h rename to include/ExportProjectDialog.h index 266b9f93d..fc1ddfe1e 100644 --- a/include/export_project_dialog.h +++ b/include/ExportProjectDialog.h @@ -1,9 +1,9 @@ /* - * export_project_dialog.h - declaration of class exportProjectDialog which is - * responsible for exporting project + * ExportProjectDialog.h - declaration of class ExportProjectDialog which + * offers options for exporting project + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,36 +23,34 @@ * */ - #ifndef _EXPORT_PROJECT_DIALOG_H #define _EXPORT_PROJECT_DIALOG_H #include -#include "ui_export_project.h" - +namespace Ui { class ExportProjectDialog; } class ProjectRenderer; - -class exportProjectDialog : public QDialog, public Ui::ExportProjectDialog +class ExportProjectDialog : public QDialog { Q_OBJECT public: - exportProjectDialog( const QString & _file_name, QWidget * _parent ); - virtual ~exportProjectDialog(); + ExportProjectDialog( const QString & _file_name, QWidget * _parent ); + virtual ~ExportProjectDialog(); protected: - virtual void reject( void ); + virtual void reject(); virtual void closeEvent( QCloseEvent * _ce ); private slots: - void startBtnClicked( void ); + void startBtnClicked(); void updateTitleBar( int ); private: + Ui::ExportProjectDialog * ui; QString m_fileName; ProjectRenderer * m_renderer; diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index 0e388335d..e57c2a883 100644 --- a/src/core/audio/AudioFileDevice.cpp +++ b/src/core/audio/AudioFileDevice.cpp @@ -27,7 +27,7 @@ #include #include "AudioFileDevice.h" -#include "export_project_dialog.h" +#include "ExportProjectDialog.h" #include "engine.h" @@ -52,7 +52,7 @@ AudioFileDevice::AudioFileDevice( const sample_rate_t _sample_rate, if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == false ) { - QString warningMessage = exportProjectDialog::tr( + QString warningMessage = ExportProjectDialog::tr( "Could not open file %1 " "for writing.\nPlease make " "sure you have write-" @@ -61,7 +61,7 @@ AudioFileDevice::AudioFileDevice( const sample_rate_t _sample_rate, "file and try again!" ).arg( _file ); if( engine::hasGUI() ){ QMessageBox::critical( NULL, - exportProjectDialog::tr( "Could not open file" ), + ExportProjectDialog::tr( "Could not open file" ), warningMessage, QMessageBox::Ok, QMessageBox::NoButton ); diff --git a/src/core/song.cpp b/src/core/song.cpp index 16080fd45..a40c276fa 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -22,7 +22,7 @@ * */ - +#include #include #include #include @@ -42,7 +42,7 @@ #include "ControllerConnection.h" #include "embed.h" #include "envelope_and_lfo_parameters.h" -#include "export_project_dialog.h" +#include "ExportProjectDialog.h" #include "fx_mixer.h" #include "fx_mixer_view.h" #include "import_filter.h" @@ -1164,7 +1164,7 @@ void song::exportProject() !efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() ) { const QString export_file_name = efd.selectedFiles()[0]; - exportProjectDialog epd( export_file_name, + ExportProjectDialog epd( export_file_name, engine::mainWindow() ); epd.exec(); } diff --git a/src/gui/about_dialog.cpp b/src/gui/AboutDialog.cpp similarity index 69% rename from src/gui/about_dialog.cpp rename to src/gui/AboutDialog.cpp index 41a502696..9b8a07782 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -1,8 +1,8 @@ /* - * about_dialog.cpp - implementation of about-dialog + * AboutDialog.cpp - implementation of about-dialog + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,13 +22,12 @@ * */ - #include "lmmsversion.h" -#include "about_dialog.h" +#include "AboutDialog.h" #include "embed.h" #include "engine.h" #include "MainWindow.h" - +#include "ui_AboutDialog.h" #ifdef __GNUC__ #define GCC_VERSION "GCC "__VERSION__ @@ -61,24 +60,24 @@ #endif -aboutDialog::aboutDialog() : +AboutDialog::AboutDialog() : QDialog( engine::mainWindow() ), - Ui::AboutDialog() + ui( new Ui::AboutDialog ) { - setupUi( this ); + ui->setupUi( this ); - iconLabel->setPixmap( embed::getIconPixmap( "icon" ) ); + ui->iconLabel->setPixmap( embed::getIconPixmap( "icon" ) ); - versionLabel->setText( versionLabel->text(). - arg( LMMS_VERSION ). - arg( PLATFORM ). - arg( MACHINE ). - arg( QT_VERSION_STR ). - arg( GCC_VERSION ) ); + ui->versionLabel->setText( ui->versionLabel->text(). + arg( LMMS_VERSION ). + arg( PLATFORM ). + arg( MACHINE ). + arg( QT_VERSION_STR ). + arg( GCC_VERSION ) ); - authorLabel->setPlainText( embed::getText( "AUTHORS" ) ); + ui->authorLabel->setPlainText( embed::getText( "AUTHORS" ) ); - licenseLabel->setPlainText( embed::getText( "COPYING" ) ); + ui->licenseLabel->setPlainText( embed::getText( "COPYING" ) ); } diff --git a/src/gui/export_project_dialog.cpp b/src/gui/ExportProjectDialog.cpp similarity index 67% rename from src/gui/export_project_dialog.cpp rename to src/gui/ExportProjectDialog.cpp index a3a4ff0a8..6ac5f6d7f 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/ExportProjectDialog.cpp @@ -1,5 +1,5 @@ /* - * export_project_dialog.cpp - implementation of dialog for exporting project + * ExportProjectDialog.cpp - implementation of dialog for exporting project * * Copyright (c) 2004-2009 Tobias Doerffel * @@ -25,29 +25,31 @@ #include #include -#include "export_project_dialog.h" +#include "ExportProjectDialog.h" #include "engine.h" #include "MainWindow.h" #include "ProjectRenderer.h" +#include "ui_ExportProjectDialog.h" -exportProjectDialog::exportProjectDialog( const QString & _file_name, +ExportProjectDialog::ExportProjectDialog( const QString & _file_name, QWidget * _parent ) : QDialog( _parent ), - Ui::ExportProjectDialog(), + ui( new Ui::ExportProjectDialog ), m_fileName( _file_name ), m_renderer( NULL ) { - setupUi( this ); - setWindowTitle( tr( "Export project to %1" ).arg( + ui->setupUi( this ); + + setWindowTitle( tr( "Export project to %1" ).arg( QFileInfo( _file_name ).fileName() ) ); // get the extension of the chosen file QStringList parts = _file_name.split( '.' ); - QString file_ext; + QString fileExt; if( parts.size() > 0 ) { - file_ext = parts[parts.size()-1]; + fileExt = parts[parts.size()-1]; } int cbIndex = 0; @@ -56,32 +58,32 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, if( __fileEncodeDevices[i].m_getDevInst != NULL ) { // get the extension of this format - QString render_ext = ProjectRenderer::EFF_ext[i]; + QString renderExt = ProjectRenderer::EFF_ext[i]; // add to combo box - fileFormatCB->addItem( ProjectRenderer::tr( + ui->fileFormatCB->addItem( ProjectRenderer::tr( __fileEncodeDevices[i].m_description ) ); // if this is our extension, select it - if( QString::compare(render_ext, file_ext, - Qt::CaseInsensitive ) == 0 ) + if( QString::compare( renderExt, fileExt, + Qt::CaseInsensitive ) == 0 ) { - fileFormatCB->setCurrentIndex(cbIndex); + ui->fileFormatCB->setCurrentIndex(cbIndex); } - + cbIndex++; } } - connect( startButton, SIGNAL( clicked() ), - this, SLOT( startBtnClicked() ) ); + connect( ui->startButton, SIGNAL( clicked() ), + this, SLOT( startBtnClicked() ) ); } -exportProjectDialog::~exportProjectDialog() +ExportProjectDialog::~ExportProjectDialog() { delete m_renderer; } @@ -89,7 +91,7 @@ exportProjectDialog::~exportProjectDialog() -void exportProjectDialog::reject() +void ExportProjectDialog::reject() { if( m_renderer == NULL ) { @@ -104,7 +106,7 @@ void exportProjectDialog::reject() -void exportProjectDialog::closeEvent( QCloseEvent * _ce ) +void ExportProjectDialog::closeEvent( QCloseEvent * _ce ) { if( m_renderer != NULL && m_renderer->isRunning() ) { @@ -116,15 +118,14 @@ void exportProjectDialog::closeEvent( QCloseEvent * _ce ) -void exportProjectDialog::startBtnClicked() +void ExportProjectDialog::startBtnClicked() { ProjectRenderer::ExportFileFormats ft = ProjectRenderer::NumFileFormats; for( int i = 0; i < ProjectRenderer::NumFileFormats; ++i ) { - if( fileFormatCB->currentText() == - ProjectRenderer::tr( - __fileEncodeDevices[i].m_description ) ) + if( ui->fileFormatCB->currentText() == + ProjectRenderer::tr( __fileEncodeDevices[i].m_description ) ) { ft = __fileEncodeDevices[i].m_fileFormat; break; @@ -141,31 +142,30 @@ void exportProjectDialog::startBtnClicked() return; } - startButton->setEnabled( false ); - progressBar->setEnabled( true ); + ui->startButton->setEnabled( false ); + ui->progressBar->setEnabled( true ); mixer::qualitySettings qs = mixer::qualitySettings( static_cast( - interpolationCB->currentIndex() ), + ui->interpolationCB->currentIndex() ), static_cast( - oversamplingCB->currentIndex() ), - sampleExactControllersCB->isChecked(), - aliasFreeOscillatorsCB->isChecked() ); + ui->oversamplingCB->currentIndex() ), + ui->sampleExactControllersCB->isChecked(), + ui->aliasFreeOscillatorsCB->isChecked() ); ProjectRenderer::OutputSettings os = ProjectRenderer::OutputSettings( - samplerateCB->currentText().section( " ", 0, 0 ).toUInt(), + ui->samplerateCB->currentText().section( " ", 0, 0 ).toUInt(), false, - bitrateCB->currentText().section( " ", 0, 0 ).toUInt(), - static_cast( - depthCB->currentIndex() ) ); + ui->bitrateCB->currentText().section( " ", 0, 0 ).toUInt(), + static_cast( ui->depthCB->currentIndex() ) ); m_renderer = new ProjectRenderer( qs, os, ft, m_fileName ); if( m_renderer->isReady() ) { updateTitleBar( 0 ); connect( m_renderer, SIGNAL( progressChanged( int ) ), - progressBar, SLOT( setValue( int ) ) ); + ui->progressBar, SLOT( setValue( int ) ) ); connect( m_renderer, SIGNAL( progressChanged( int ) ), this, SLOT( updateTitleBar( int ) ) ); connect( m_renderer, SIGNAL( finished() ), @@ -184,7 +184,7 @@ void exportProjectDialog::startBtnClicked() -void exportProjectDialog::updateTitleBar( int _prog ) +void ExportProjectDialog::updateTitleBar( int _prog ) { engine::mainWindow()->setWindowTitle( tr( "Rendering: %1%" ).arg( _prog ) ); @@ -192,7 +192,7 @@ void exportProjectDialog::updateTitleBar( int _prog ) -#include "moc_export_project_dialog.cxx" +#include "moc_ExportProjectDialog.cxx" /* vim: set tw=0 noexpandtab: */ diff --git a/src/gui/dialogs/about_dialog.ui b/src/gui/Forms/AboutDialog.ui similarity index 100% rename from src/gui/dialogs/about_dialog.ui rename to src/gui/Forms/AboutDialog.ui diff --git a/src/gui/dialogs/export_project.ui b/src/gui/Forms/ExportProjectDialog.ui similarity index 63% rename from src/gui/dialogs/export_project.ui rename to src/gui/Forms/ExportProjectDialog.ui index 50fdbb6a3..0d86aee5f 100644 --- a/src/gui/dialogs/export_project.ui +++ b/src/gui/Forms/ExportProjectDialog.ui @@ -1,126 +1,127 @@ - + + ExportProjectDialog - - + + 0 0 519 - 412 + 427 - + Export project - + - + - - + + Output - - + + -1 - + 9 - - + + File format: - + - - + + Samplerate: - + - + 44100 Hz - + 48000 Hz - + 88200 Hz - + 96000 Hz - + 192000 Hz - - - + + + -1 - + 0 - - + + Bitrate: - - + + 2 - + 64 KBit/s - + 128 KBit/s - + 160 KBit/s - + 192 KBit/s - + 256 KBit/s - + 320 KBit/s @@ -130,32 +131,32 @@ - - - + + + 0 - - + + Depth: - + - + 16 Bit Integer - + 24 Bit Integer - + 32 Bit Float @@ -166,13 +167,13 @@ - + Qt::Vertical - + QSizePolicy::Fixed - + 1 10 @@ -181,21 +182,27 @@ - - + + + + 0 + 0 + + + Please note that not all of the parameters above apply for all file formats. - + true - + Qt::Vertical - + 163 20 @@ -207,96 +214,96 @@ - - + + Quality settings - + - - + + Interpolation: - - + + 1 - + Zero Order Hold - + Sinc Fastest - + Sinc Medium (recommended) - + Sinc Best (very slow!) - - + + Oversampling (use with care!): - + - + 1x (None) - + 2x - + 4x - + 8x - - + + Sample-exact controllers - - + + Alias-free oscillators - + Qt::Vertical - + 20 40 @@ -310,13 +317,13 @@ - + - + Qt::Horizontal - + 40 20 @@ -325,15 +332,15 @@ - - + + Start - - + + Cancel @@ -341,11 +348,11 @@ - - + + false - + 0 @@ -360,11 +367,11 @@ ExportProjectDialog reject() - + 357 293 - + 202 175 diff --git a/src/gui/dialogs/QuickLoadDialog.ui b/src/gui/Forms/QuickLoadDialog.ui similarity index 100% rename from src/gui/dialogs/QuickLoadDialog.ui rename to src/gui/Forms/QuickLoadDialog.ui diff --git a/src/gui/dialogs/WelcomeScreen.ui b/src/gui/Forms/WelcomeScreen.ui similarity index 100% rename from src/gui/dialogs/WelcomeScreen.ui rename to src/gui/Forms/WelcomeScreen.ui diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 9cba4ba8b..2197e53ab 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ #include "embed.h" #include "engine.h" #include "fx_mixer_view.h" -#include "about_dialog.h" +#include "AboutDialog.h" #include "ControllerRackView.h" #include "plugin_browser.h" #include "side_bar.h" @@ -1061,7 +1062,7 @@ void MainWindow::showSettingsDialog() void MainWindow::aboutLMMS() { - aboutDialog().exec(); + AboutDialog().exec(); }