Merge branch 'gui_application' into ed_refac
Conflicts: src/core/Song.cpp src/gui/MainWindow.cpp
This commit is contained in:
commit
748cccd266
48 files changed
+436
-345
No files matched your search
+45
-43
@@ -22,6 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Song.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
@@ -30,7 +32,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "Song.h"
|
||||
#include "AutomationTrack.h"
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
@@ -44,6 +45,7 @@
|
||||
#include "ExportProjectDialog.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -755,17 +757,17 @@ void Song::clearProject()
|
||||
|
||||
|
||||
Engine::mixer()->lock();
|
||||
if( Engine::getBBEditor() )
|
||||
if( gui->getBBEditor() )
|
||||
{
|
||||
Engine::getBBEditor()->trackContainerView()->clearAllTracks();
|
||||
gui->getBBEditor()->trackContainerView()->clearAllTracks();
|
||||
}
|
||||
if( Engine::songEditor() )
|
||||
if( gui->songEditor() )
|
||||
{
|
||||
Engine::songEditor()->m_editor->clearAllTracks();
|
||||
gui->songEditor()->m_editor->clearAllTracks();
|
||||
}
|
||||
if( Engine::fxMixerView() )
|
||||
if( gui->fxMixerView() )
|
||||
{
|
||||
Engine::fxMixerView()->clear();
|
||||
gui->fxMixerView()->clear();
|
||||
}
|
||||
QCoreApplication::sendPostedEvents();
|
||||
Engine::getBBTrackContainer()->clearAllTracks();
|
||||
@@ -773,14 +775,14 @@ void Song::clearProject()
|
||||
|
||||
Engine::fxMixer()->clear();
|
||||
|
||||
if( Engine::automationEditor() )
|
||||
if( gui->automationEditor() )
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( NULL );
|
||||
gui->automationEditor()->setCurrentPattern( NULL );
|
||||
}
|
||||
|
||||
if( Engine::pianoRoll() )
|
||||
if( gui->pianoRoll() )
|
||||
{
|
||||
Engine::pianoRoll()->reset();
|
||||
gui->pianoRoll()->reset();
|
||||
}
|
||||
|
||||
m_tempoModel.reset();
|
||||
@@ -796,9 +798,9 @@ void Song::clearProject()
|
||||
|
||||
Engine::mixer()->unlock();
|
||||
|
||||
if( Engine::getProjectNotes() )
|
||||
if( gui->getProjectNotes() )
|
||||
{
|
||||
Engine::getProjectNotes()->clear();
|
||||
gui->getProjectNotes()->clear();
|
||||
}
|
||||
|
||||
// Move to function
|
||||
@@ -877,9 +879,9 @@ void Song::createNewProject()
|
||||
|
||||
m_modified = false;
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -893,9 +895,9 @@ void Song::createNewProjectFromTemplate( const QString & _template )
|
||||
// saving...
|
||||
m_fileName = m_oldFileName = "";
|
||||
// update window title
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -911,9 +913,9 @@ void Song::loadProject( const QString & _file_name )
|
||||
m_loadingProject = true;
|
||||
|
||||
Engine::projectJournal()->setJournalling( false );
|
||||
if( Engine::mainWindow() )
|
||||
if( gui )
|
||||
{
|
||||
Engine::mainWindow()->clearErrors();
|
||||
gui->mainWindow()->clearErrors();
|
||||
}
|
||||
|
||||
m_fileName = _file_name;
|
||||
@@ -962,7 +964,7 @@ void Song::loadProject( const QString & _file_name )
|
||||
if( Engine::hasGUI() )
|
||||
{
|
||||
// refresh FxMixerView
|
||||
Engine::fxMixerView()->refreshDisplay();
|
||||
gui->fxMixerView()->refreshDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,21 +983,21 @@ void Song::loadProject( const QString & _file_name )
|
||||
}
|
||||
else if( Engine::hasGUI() )
|
||||
{
|
||||
if( node.nodeName() == Engine::getControllerRackView()->nodeName() )
|
||||
if( node.nodeName() == gui->getControllerRackView()->nodeName() )
|
||||
{
|
||||
Engine::getControllerRackView()->restoreState( node.toElement() );
|
||||
gui->getControllerRackView()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::pianoRoll()->nodeName() )
|
||||
else if( node.nodeName() == gui->pianoRoll()->nodeName() )
|
||||
{
|
||||
Engine::pianoRoll()->restoreState( node.toElement() );
|
||||
gui->pianoRoll()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::automationEditor()->m_editor->nodeName() )
|
||||
else if( node.nodeName() == gui->automationEditor()->m_editor->nodeName() )
|
||||
{
|
||||
Engine::automationEditor()->m_editor->restoreState( node.toElement() );
|
||||
gui->automationEditor()->m_editor->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == Engine::getProjectNotes()->nodeName() )
|
||||
else if( node.nodeName() == gui->getProjectNotes()->nodeName() )
|
||||
{
|
||||
Engine::getProjectNotes()->SerializingObject::restoreState( node.toElement() );
|
||||
gui->getProjectNotes()->SerializingObject::restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == m_playPos[Mode_PlaySong].m_timeLine->nodeName() )
|
||||
{
|
||||
@@ -1026,17 +1028,17 @@ void Song::loadProject( const QString & _file_name )
|
||||
|
||||
emit projectLoaded();
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if( gui )
|
||||
{
|
||||
Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
|
||||
gui->mainWindow()->showErrors( tr( "The following errors occured while loading: " ) );
|
||||
}
|
||||
|
||||
m_loadingProject = false;
|
||||
m_modified = false;
|
||||
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,10 +1061,10 @@ bool Song::saveProjectFile( const QString & _filename )
|
||||
Engine::fxMixer()->saveState( dataFile, dataFile.content() );
|
||||
if( Engine::hasGUI() )
|
||||
{
|
||||
Engine::getControllerRackView()->saveState( dataFile, dataFile.content() );
|
||||
Engine::pianoRoll()->saveState( dataFile, dataFile.content() );
|
||||
Engine::automationEditor()->m_editor->saveState( dataFile, dataFile.content() );
|
||||
Engine::getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() );
|
||||
gui->getControllerRackView()->saveState( dataFile, dataFile.content() );
|
||||
gui->pianoRoll()->saveState( dataFile, dataFile.content() );
|
||||
gui->automationEditor()->m_editor->saveState( dataFile, dataFile.content() );
|
||||
gui->getProjectNotes()->SerializingObject::saveState( dataFile, dataFile.content() );
|
||||
m_playPos[Mode_PlaySong].m_timeLine->saveState( dataFile, dataFile.content() );
|
||||
}
|
||||
|
||||
@@ -1087,7 +1089,7 @@ bool Song::guiSaveProject()
|
||||
2000 );
|
||||
ConfigManager::inst()->addRecentlyOpenedProject( m_fileName );
|
||||
m_modified = false;
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
else if( Engine::hasGUI() )
|
||||
{
|
||||
@@ -1190,7 +1192,7 @@ void Song::exportProject(bool multiExport)
|
||||
{
|
||||
if( isEmpty() )
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "Empty project" ),
|
||||
tr( "This project is empty so exporting makes "
|
||||
"no sense. Please put some items into "
|
||||
@@ -1198,7 +1200,7 @@ void Song::exportProject(bool multiExport)
|
||||
return;
|
||||
}
|
||||
|
||||
FileDialog efd( Engine::mainWindow() );
|
||||
FileDialog efd( gui->mainWindow() );
|
||||
if (multiExport)
|
||||
{
|
||||
efd.setFileMode( FileDialog::Directory);
|
||||
@@ -1258,7 +1260,7 @@ void Song::exportProject(bool multiExport)
|
||||
}
|
||||
|
||||
const QString export_file_name = efd.selectedFiles()[0] + suffix;
|
||||
ExportProjectDialog epd( export_file_name, Engine::mainWindow(), multiExport );
|
||||
ExportProjectDialog epd( export_file_name, gui->mainWindow(), multiExport );
|
||||
epd.exec();
|
||||
}
|
||||
}
|
||||
@@ -1279,10 +1281,10 @@ void Song::setModified()
|
||||
if( !m_loadingProject )
|
||||
{
|
||||
m_modified = true;
|
||||
if( Engine::mainWindow() &&
|
||||
QThread::currentThread() == Engine::mainWindow()->thread() )
|
||||
if( Engine::hasGUI() && gui->mainWindow() &&
|
||||
QThread::currentThread() == gui->mainWindow()->thread() )
|
||||
{
|
||||
Engine::mainWindow()->resetWindowTitle();
|
||||
gui->mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user