mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-06 13:56:29 -04:00
Merge branch 'gui_application' into ed_refac
Conflicts: src/core/Song.cpp src/gui/MainWindow.cpp
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
class AboutDialog : public QDialog, public Ui::AboutDialog
|
||||
{
|
||||
public:
|
||||
AboutDialog( void );
|
||||
AboutDialog(QWidget* parent=0);
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -97,42 +97,6 @@ public:
|
||||
return s_projectJournal;
|
||||
}
|
||||
|
||||
// GUI
|
||||
static MainWindow * mainWindow()
|
||||
{
|
||||
return s_mainWindow;
|
||||
}
|
||||
|
||||
static FxMixerView * fxMixerView()
|
||||
{
|
||||
return s_fxMixerView;
|
||||
}
|
||||
|
||||
static SongEditorWindow* songEditor()
|
||||
{
|
||||
return s_songEditor;
|
||||
}
|
||||
|
||||
static BBEditor * getBBEditor()
|
||||
{
|
||||
return s_bbEditor;
|
||||
}
|
||||
|
||||
static PianoRollWindow* pianoRoll()
|
||||
{
|
||||
return s_pianoRoll;
|
||||
}
|
||||
|
||||
static ProjectNotes * getProjectNotes()
|
||||
{
|
||||
return s_projectNotes;
|
||||
}
|
||||
|
||||
static AutomationEditorWindow * automationEditor()
|
||||
{
|
||||
return s_automationEditor;
|
||||
}
|
||||
|
||||
static Ladspa2LMMS * getLADSPAManager()
|
||||
{
|
||||
return s_ladspaManager;
|
||||
@@ -143,11 +107,6 @@ public:
|
||||
return s_dummyTC;
|
||||
}
|
||||
|
||||
static ControllerRackView * getControllerRackView()
|
||||
{
|
||||
return s_controllerRackView;
|
||||
}
|
||||
|
||||
static float framesPerTick()
|
||||
{
|
||||
return s_framesPerTick;
|
||||
@@ -182,22 +141,14 @@ private:
|
||||
static BBTrackContainer * s_bbTrackContainer;
|
||||
static ProjectJournal * s_projectJournal;
|
||||
static DummyTrackContainer * s_dummyTC;
|
||||
static ControllerRackView * s_controllerRackView;
|
||||
|
||||
// GUI
|
||||
static MainWindow * s_mainWindow;
|
||||
static FxMixerView * s_fxMixerView;
|
||||
static SongEditorWindow* s_songEditor;
|
||||
static AutomationEditorWindow * s_automationEditor;
|
||||
static BBEditor * s_bbEditor;
|
||||
static PianoRollWindow* s_pianoRoll;
|
||||
static ProjectNotes * s_projectNotes;
|
||||
static Ladspa2LMMS * s_ladspaManager;
|
||||
|
||||
static QMap<QString, QString> s_pluginFileHandling;
|
||||
|
||||
static void initPluginFileHandling();
|
||||
|
||||
friend class GuiApplication;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
71
include/GuiApplication.h
Normal file
71
include/GuiApplication.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* GuiApplication.h
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GUIAPPLICATION_H
|
||||
#define GUIAPPLICATION_H
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class AutomationEditorWindow;
|
||||
class BBEditor;
|
||||
class ControllerRackView;
|
||||
class FxMixerView;
|
||||
class MainWindow;
|
||||
class PianoRollWindow;
|
||||
class ProjectNotes;
|
||||
class SongEditorWindow;
|
||||
|
||||
class EXPORT GuiApplication
|
||||
{
|
||||
public:
|
||||
explicit GuiApplication();
|
||||
~GuiApplication();
|
||||
|
||||
static GuiApplication* instance();
|
||||
|
||||
MainWindow* mainWindow() { return m_mainWindow; }
|
||||
FxMixerView* fxMixerView() { return m_fxMixerView; }
|
||||
SongEditorWindow* songEditor() { return m_songEditor; }
|
||||
BBEditor* getBBEditor() { return m_bbEditor; }
|
||||
PianoRollWindow* pianoRoll() { return m_pianoRoll; }
|
||||
ProjectNotes* getProjectNotes() { return m_projectNotes; }
|
||||
AutomationEditorWindow* automationEditor() { return m_automationEditor; }
|
||||
ControllerRackView* getControllerRackView() { return m_controllerRackView; }
|
||||
|
||||
private:
|
||||
static GuiApplication* s_instance;
|
||||
|
||||
MainWindow* m_mainWindow;
|
||||
FxMixerView* m_fxMixerView;
|
||||
SongEditorWindow* m_songEditor;
|
||||
AutomationEditorWindow* m_automationEditor;
|
||||
BBEditor* m_bbEditor;
|
||||
PianoRollWindow* m_pianoRoll;
|
||||
ProjectNotes* m_projectNotes;
|
||||
ControllerRackView* m_controllerRackView;
|
||||
};
|
||||
|
||||
#define gui GuiApplication::instance()
|
||||
|
||||
#endif // GUIAPPLICATION_H
|
||||
@@ -178,7 +178,7 @@ private:
|
||||
|
||||
QList<QString>* m_errors;
|
||||
|
||||
friend class Engine;
|
||||
friend class GuiApplication;
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "Fader.h"
|
||||
#include "EffectControls.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "qwidget.h"
|
||||
#include "TextFloat.h"
|
||||
#include "qlist.h"
|
||||
@@ -46,7 +47,7 @@ public:
|
||||
resize( 23, 116 );
|
||||
m_lPeak = lPeak;
|
||||
m_rPeak = rPeak;
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
|
||||
m_model = model;
|
||||
setPeak_L( 0 );
|
||||
setPeak_R( 0 );
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "ConfigManager.h"
|
||||
#include "Pattern.h"
|
||||
#include "Instrument.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MidiTime.h"
|
||||
#include "debug.h"
|
||||
@@ -99,7 +100,7 @@ bool MidiImport::tryImport( TrackContainer* tc )
|
||||
if( Engine::hasGUI() &&
|
||||
ConfigManager::inst()->defaultSoundfont().isEmpty() )
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "Setup incomplete" ),
|
||||
tr( "You do not have set up a default soundfont in "
|
||||
"the settings dialog (Edit->Settings). "
|
||||
@@ -111,7 +112,7 @@ bool MidiImport::tryImport( TrackContainer* tc )
|
||||
#else
|
||||
if( Engine::hasGUI() )
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "Setup incomplete" ),
|
||||
tr( "You did not compile LMMS with support for "
|
||||
"SoundFont2 player, which is used to add default "
|
||||
@@ -268,7 +269,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
|
||||
|
||||
const int preTrackSteps = 2;
|
||||
QProgressDialog pd( TrackContainer::tr( "Importing MIDI-file..." ),
|
||||
TrackContainer::tr( "Cancel" ), 0, preTrackSteps, Engine::mainWindow() );
|
||||
TrackContainer::tr( "Cancel" ), 0, preTrackSteps, gui->mainWindow() );
|
||||
pd.setWindowTitle( TrackContainer::tr( "Please wait..." ) );
|
||||
pd.setWindowModality(Qt::WindowModal);
|
||||
pd.setMinimumDuration( 0 );
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "SpectrumAnalyzer.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LedCheckbox.h"
|
||||
#include "embed.h"
|
||||
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
m_background( PLUGIN_NAME::getIconPixmap( "spectrum_background" ).toImage() )
|
||||
{
|
||||
setFixedSize( 249, 151 );
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) );
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "VstEffect.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include <QMdiArea>
|
||||
#include <QApplication>
|
||||
|
||||
@@ -309,7 +310,7 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
|
||||
m_vi->m_scrollArea = new QScrollArea( widget );
|
||||
l = new QGridLayout( widget );
|
||||
|
||||
m_vi->m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
m_vi->m_subWindow = gui->mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||
m_vi->m_subWindow->setFixedSize( 960, 300);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "GroupBox.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
@@ -1418,7 +1419,7 @@ else
|
||||
{
|
||||
Engine::fxMixer()->createChannel();
|
||||
}
|
||||
Engine::fxMixerView()->refreshDisplay();
|
||||
gui->fxMixerView()->refreshDisplay();
|
||||
|
||||
// set global parameters
|
||||
Engine::getSong()->setMasterVolume( p.mainVolume );
|
||||
@@ -1426,7 +1427,7 @@ else
|
||||
Engine::getSong()->setTempo( p.tempo );
|
||||
|
||||
// set project notes
|
||||
Engine::getProjectNotes()->setText( p.projectNotes );
|
||||
gui->getProjectNotes()->setText( p.projectNotes );
|
||||
|
||||
|
||||
progressDialog.setMaximum( p.maxPatterns + p.channels.size() +
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "InstrumentTrack.h"
|
||||
#include "VstPlugin.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "StringPairDrag.h"
|
||||
#include "TextFloat.h"
|
||||
@@ -873,7 +874,7 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
|
||||
widget = new QWidget(this);
|
||||
l = new QGridLayout( this );
|
||||
|
||||
m_vi->m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
m_vi->m_subWindow = gui->mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::MinimumExpanding );
|
||||
m_vi->m_subWindow->setFixedWidth( 960 );
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
#include "ConfigManager.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
#include "templates.h"
|
||||
@@ -189,7 +189,7 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
|
||||
{
|
||||
target->setFixedSize( m_pluginGeometry );
|
||||
vstSubWin * sw = new vstSubWin(
|
||||
Engine::mainWindow()->workspace() );
|
||||
gui->mainWindow()->workspace() );
|
||||
sw->setWidget( helper );
|
||||
helper->setWindowTitle( name() );
|
||||
m_pluginWidget = helper;
|
||||
@@ -238,7 +238,7 @@ void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
|
||||
if( _parent == NULL )
|
||||
{
|
||||
vstSubWin * sw = new vstSubWin(
|
||||
Engine::mainWindow()->workspace() );
|
||||
gui->mainWindow()->workspace() );
|
||||
if( isEffect )
|
||||
{
|
||||
sw->setAttribute( Qt::WA_TranslucentBackground );
|
||||
|
||||
@@ -24,24 +24,17 @@
|
||||
|
||||
|
||||
#include "Engine.h"
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Ladspa2LMMS.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Mixer.h"
|
||||
#include "Pattern.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "PresetPreviewPlayHandle.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "ProjectNotes.h"
|
||||
#include "Plugin.h"
|
||||
#include "SongEditor.h"
|
||||
#include "Song.h"
|
||||
#include "BandLimitedWave.h"
|
||||
|
||||
@@ -51,19 +44,11 @@ bool Engine::s_suppressMessages = false;
|
||||
float Engine::s_framesPerTick;
|
||||
Mixer* Engine::s_mixer = NULL;
|
||||
FxMixer * Engine::s_fxMixer = NULL;
|
||||
FxMixerView * Engine::s_fxMixerView = NULL;
|
||||
MainWindow * Engine::s_mainWindow = NULL;
|
||||
BBTrackContainer * Engine::s_bbTrackContainer = NULL;
|
||||
Song * Engine::s_song = NULL;
|
||||
SongEditorWindow* Engine::s_songEditor = NULL;
|
||||
AutomationEditorWindow * Engine::s_automationEditor = NULL;
|
||||
BBEditor * Engine::s_bbEditor = NULL;
|
||||
PianoRollWindow* Engine::s_pianoRoll = NULL;
|
||||
ProjectNotes * Engine::s_projectNotes = NULL;
|
||||
ProjectJournal * Engine::s_projectJournal = NULL;
|
||||
Ladspa2LMMS * Engine::s_ladspaManager = NULL;
|
||||
DummyTrackContainer * Engine::s_dummyTC = NULL;
|
||||
ControllerRackView * Engine::s_controllerRackView = NULL;
|
||||
QMap<QString, QString> Engine::s_pluginFileHandling;
|
||||
|
||||
|
||||
@@ -90,20 +75,6 @@ void Engine::init( const bool _has_gui )
|
||||
|
||||
s_mixer->initDevices();
|
||||
|
||||
if( s_hasGUI )
|
||||
{
|
||||
s_mainWindow = new MainWindow;
|
||||
s_songEditor = new SongEditorWindow( s_song );
|
||||
s_fxMixerView = new FxMixerView;
|
||||
s_controllerRackView = new ControllerRackView;
|
||||
s_projectNotes = new ProjectNotes;
|
||||
s_bbEditor = new BBEditor( s_bbTrackContainer );
|
||||
s_pianoRoll = new PianoRollWindow();
|
||||
s_automationEditor = new AutomationEditorWindow;
|
||||
|
||||
s_mainWindow->finalize();
|
||||
}
|
||||
|
||||
PresetPreviewPlayHandle::init();
|
||||
s_dummyTC = new DummyTrackContainer;
|
||||
|
||||
@@ -118,15 +89,7 @@ void Engine::destroy()
|
||||
s_projectJournal->stopAllJournalling();
|
||||
s_mixer->stopProcessing();
|
||||
|
||||
deleteHelper( &s_projectNotes );
|
||||
deleteHelper( &s_songEditor );
|
||||
deleteHelper( &s_bbEditor );
|
||||
deleteHelper( &s_pianoRoll );
|
||||
deleteHelper( &s_automationEditor );
|
||||
deleteHelper( &s_fxMixerView );
|
||||
|
||||
PresetPreviewPlayHandle::cleanup();
|
||||
InstrumentTrackView::cleanupWindowCache();
|
||||
|
||||
s_song->clearProject();
|
||||
|
||||
@@ -141,8 +104,6 @@ void Engine::destroy()
|
||||
//delete ConfigManager::inst();
|
||||
deleteHelper( &s_projectJournal );
|
||||
|
||||
s_mainWindow = NULL;
|
||||
|
||||
deleteHelper( &s_song );
|
||||
|
||||
delete ConfigManager::inst();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "Engine.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "SamplePlayHandle.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "PianoRoll.h"
|
||||
|
||||
// platform-specific audio-interface-classes
|
||||
@@ -323,7 +324,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
Song::playPos p = Engine::getSong()->getPlayPos(
|
||||
Song::Mode_PlayPattern );
|
||||
if( Engine::getSong()->playMode() == Song::Mode_PlayPattern &&
|
||||
Engine::pianoRoll()->isRecording() == true &&
|
||||
gui->pianoRoll()->isRecording() == true &&
|
||||
p != last_metro_pos )
|
||||
{
|
||||
if ( p.getTicks() % (MidiTime::ticksPerTact() / 1 ) == 0 )
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Plugin.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "Mixer.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "DummyPlugin.h"
|
||||
@@ -127,7 +128,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent,
|
||||
|
||||
void Plugin::collectErrorForUI( QString err_msg )
|
||||
{
|
||||
Engine::mainWindow()->collectError( err_msg );
|
||||
gui->mainWindow()->collectError( err_msg );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "Clipboard.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -1136,7 +1137,7 @@ void TrackContentWidget::update()
|
||||
*/
|
||||
void TrackContentWidget::changePosition( const MidiTime & _new_pos )
|
||||
{
|
||||
if( m_trackView->trackContainerView() == Engine::getBBEditor()->trackContainerView() )
|
||||
if( m_trackView->trackContainerView() == gui->getBBEditor()->trackContainerView() )
|
||||
{
|
||||
const int cur_bb = Engine::getBBTrackContainer()->currentBB();
|
||||
setUpdatesEnabled( false );
|
||||
@@ -1468,7 +1469,7 @@ void TrackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
int ppt = static_cast<int>( tcv->pixelsPerTact() );
|
||||
QPainter p( this );
|
||||
// Don't draw background on BB-Editor
|
||||
if( m_trackView->trackContainerView() != Engine::getBBEditor()->trackContainerView() )
|
||||
if( m_trackView->trackContainerView() != gui->getBBEditor()->trackContainerView() )
|
||||
{
|
||||
p.drawTiledPixmap( rect(), m_background, QPoint(
|
||||
tcv->currentPosition().getTact() * ppt, 0 ) );
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "TrackContainer.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ void TrackContainer::loadSettings( const QDomElement & _this )
|
||||
pd = new QProgressDialog( tr( "Loading project..." ),
|
||||
tr( "Cancel" ), 0,
|
||||
_this.childNodes().count(),
|
||||
Engine::mainWindow() );
|
||||
gui->mainWindow() );
|
||||
pd->setWindowModality( Qt::ApplicationModal );
|
||||
pd->setWindowTitle( tr( "Please wait..." ) );
|
||||
pd->show();
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ConfigManager.h"
|
||||
@@ -106,7 +106,7 @@ void AudioJack::restartAfterZombified()
|
||||
{
|
||||
m_active = false;
|
||||
startProcessing();
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "JACK client restarted" ),
|
||||
tr( "LMMS was kicked by JACK for some reason. "
|
||||
"Therefore the JACK backend of LMMS has been "
|
||||
@@ -115,7 +115,7 @@ void AudioJack::restartAfterZombified()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information( Engine::mainWindow(),
|
||||
QMessageBox::information( gui->mainWindow(),
|
||||
tr( "JACK server down" ),
|
||||
tr( "The JACK server seems to have been shutdown "
|
||||
"and starting a new instance failed. "
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#include "NotePlayHandle.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LmmsStyle.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -102,7 +103,7 @@ int main( int argc, char * * argv )
|
||||
// initialize memory managers
|
||||
MemoryManager::init();
|
||||
NotePlayHandleManager::init();
|
||||
|
||||
|
||||
// intialize RNG
|
||||
srand( getpid() + time( 0 ) );
|
||||
|
||||
@@ -418,28 +419,7 @@ int main( int argc, char * * argv )
|
||||
|
||||
if( render_out.isEmpty() )
|
||||
{
|
||||
// init style and palette
|
||||
LmmsStyle * lmmsstyle = new LmmsStyle();
|
||||
QApplication::setStyle( lmmsstyle );
|
||||
|
||||
LmmsPalette * lmmspal = new LmmsPalette( NULL, lmmsstyle );
|
||||
QPalette lpal = lmmspal->palette();
|
||||
|
||||
QApplication::setPalette( lpal );
|
||||
LmmsStyle::s_palette = &lpal;
|
||||
|
||||
|
||||
// show splash screen
|
||||
QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
|
||||
splashScreen.show();
|
||||
splashScreen.showMessage( MainWindow::tr( "Version %1" ).arg( LMMS_VERSION ),
|
||||
Qt::AlignRight | Qt::AlignBottom, Qt::white );
|
||||
qApp->processEvents();
|
||||
|
||||
// init central engine which handles all components of LMMS
|
||||
Engine::init();
|
||||
|
||||
splashScreen.hide();
|
||||
new GuiApplication();
|
||||
|
||||
// re-intialize RNG - shared libraries might have srand() or
|
||||
// srandom() calls in their init procedure
|
||||
@@ -449,7 +429,7 @@ int main( int argc, char * * argv )
|
||||
QString recoveryFile = ConfigManager::inst()->recoveryFile();
|
||||
|
||||
if( QFileInfo(recoveryFile).exists() &&
|
||||
QMessageBox::question( Engine::mainWindow(), MainWindow::tr( "Project recovery" ),
|
||||
QMessageBox::question( gui->mainWindow(), MainWindow::tr( "Project recovery" ),
|
||||
MainWindow::tr( "It looks like the last session did not end properly. "
|
||||
"Do you want to recover the project of this session?" ),
|
||||
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
|
||||
@@ -460,10 +440,10 @@ int main( int argc, char * * argv )
|
||||
// we try to load given file
|
||||
if( !file_to_load.isEmpty() )
|
||||
{
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
if( file_to_load == recoveryFile )
|
||||
{
|
||||
@@ -482,10 +462,10 @@ int main( int argc, char * * argv )
|
||||
return 0;
|
||||
}
|
||||
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -494,12 +474,13 @@ int main( int argc, char * * argv )
|
||||
|
||||
// [Settel] workaround: showMaximized() doesn't work with
|
||||
// FVWM2 unless the window is already visible -> show() first
|
||||
Engine::mainWindow()->show();
|
||||
gui->mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
Engine::mainWindow()->showMaximized();
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -536,9 +517,9 @@ int main( int argc, char * * argv )
|
||||
|
||||
const int ret = app->exec();
|
||||
delete app;
|
||||
|
||||
|
||||
// cleanup memory managers
|
||||
MemoryManager::cleanup();
|
||||
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AboutDialog.cpp - implementation of about-dialog
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -26,14 +26,12 @@
|
||||
#include "lmmsversion.h"
|
||||
#include "AboutDialog.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "MainWindow.h"
|
||||
#include "versioninfo.h"
|
||||
|
||||
|
||||
|
||||
AboutDialog::AboutDialog() :
|
||||
QDialog( Engine::mainWindow() ),
|
||||
AboutDialog::AboutDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
Ui::AboutDialog()
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "ControllerConnectionDialog.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "StringPairDrag.h"
|
||||
|
||||
@@ -179,7 +180,7 @@ void AutomatableModelViewSlots::execConnectionDialog()
|
||||
AutomatableModel* m = m_amv->modelUntyped();
|
||||
|
||||
m->displayName();
|
||||
ControllerConnectionDialog d( (QWidget*) Engine::mainWindow(), m );
|
||||
ControllerConnectionDialog d( gui->mainWindow(), m );
|
||||
|
||||
if( d.exec() == 1 )
|
||||
{
|
||||
@@ -226,7 +227,7 @@ void AutomatableModelViewSlots::removeConnection()
|
||||
|
||||
void AutomatableModelViewSlots::editSongGlobalAutomation()
|
||||
{
|
||||
Engine::automationEditor()->open(
|
||||
gui->automationEditor()->open(
|
||||
AutomationPattern::globalAutomationPattern(m_amv->modelUntyped())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "AutomationEditor.h"
|
||||
#include "AutomationPattern.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "RenameDialog.h"
|
||||
@@ -49,7 +49,7 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern,
|
||||
{
|
||||
connect( m_pat, SIGNAL( dataChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( Engine::automationEditor(), SIGNAL( currentPatternChanged() ),
|
||||
connect( gui->automationEditor(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
@@ -123,9 +123,9 @@ void AutomationPatternView::disconnectObject( QAction * _a )
|
||||
update();
|
||||
|
||||
//If automation editor is opened, update its display after disconnection
|
||||
if( Engine::automationEditor() )
|
||||
if( gui->automationEditor() )
|
||||
{
|
||||
Engine::automationEditor()->m_editor->updateAfterPatternChange();
|
||||
gui->automationEditor()->m_editor->updateAfterPatternChange();
|
||||
}
|
||||
|
||||
//if there is no more connection connected to the AutomationPattern
|
||||
@@ -230,7 +230,7 @@ void AutomationPatternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
_me->ignore();
|
||||
return;
|
||||
}
|
||||
Engine::automationEditor()->open(m_pat);
|
||||
gui->automationEditor()->open(m_pat);
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
lingrad.setColorAt( 0, c );
|
||||
|
||||
p.setBrush( lingrad );
|
||||
if( Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
@@ -352,7 +352,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
// outer edge
|
||||
p.setBrush( QBrush() );
|
||||
if( Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
@@ -413,10 +413,10 @@ void AutomationPatternView::dropEvent( QDropEvent * _de )
|
||||
}
|
||||
update();
|
||||
|
||||
if( Engine::automationEditor() &&
|
||||
Engine::automationEditor()->currentPattern() == m_pat )
|
||||
if( gui->automationEditor() &&
|
||||
gui->automationEditor()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::automationEditor()->setCurrentPattern( m_pat );
|
||||
gui->automationEditor()->setCurrentPattern( m_pat );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "ExportProjectDialog.h"
|
||||
#include "Song.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "BBTrack.h"
|
||||
@@ -282,7 +282,7 @@ void ExportProjectDialog::render( ProjectRenderer* renderer )
|
||||
connect( renderer, SIGNAL( progressChanged( int ) ), progressBar, SLOT( setValue( int ) ) );
|
||||
connect( renderer, SIGNAL( progressChanged( int ) ), this, SLOT( updateTitleBar( int ) )) ;
|
||||
connect( renderer, SIGNAL( finished() ), this, SLOT( accept() ) );
|
||||
connect( renderer, SIGNAL( finished() ), Engine::mainWindow(), SLOT( resetWindowTitle() ) );
|
||||
connect( renderer, SIGNAL( finished() ), gui->mainWindow(), SLOT( resetWindowTitle() ) );
|
||||
|
||||
renderer->startProcessing();
|
||||
}
|
||||
@@ -341,6 +341,6 @@ void ExportProjectDialog::startBtnClicked()
|
||||
|
||||
void ExportProjectDialog::updateTitleBar( int _prog )
|
||||
{
|
||||
Engine::mainWindow()->setWindowTitle(
|
||||
gui->mainWindow()->setWindowTitle(
|
||||
tr( "Rendering: %1%" ).arg( _prog ) );
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "debug.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "Instrument.h"
|
||||
@@ -549,7 +550,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it )
|
||||
switch( f->handling() )
|
||||
{
|
||||
case FileItem::LoadAsProject:
|
||||
if( Engine::mainWindow()->mayChangeProject() )
|
||||
if( gui->mainWindow()->mayChangeProject() )
|
||||
{
|
||||
Engine::getSong()->loadProject( f->fullName() );
|
||||
}
|
||||
@@ -580,7 +581,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it )
|
||||
|
||||
case FileItem::ImportAsProject:
|
||||
if( f->type() == FileItem::FlpFile &&
|
||||
!Engine::mainWindow()->mayChangeProject() )
|
||||
!gui->mainWindow()->mayChangeProject() )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -663,7 +664,7 @@ void FileBrowserTreeWidget::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
// get all windows opened in the workspace
|
||||
QList<QMdiSubWindow*> pl =
|
||||
Engine::mainWindow()->workspace()->
|
||||
gui->mainWindow()->workspace()->
|
||||
subWindowList( QMdiArea::StackingOrder );
|
||||
QListIterator<QMdiSubWindow *> w( pl );
|
||||
w.toBack();
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "Knob.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentTrack.h"
|
||||
@@ -141,13 +142,13 @@ FxMixerView::FxMixerView() :
|
||||
updateGeometry();
|
||||
|
||||
// timer for updating faders
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( updateFaders() ) );
|
||||
|
||||
|
||||
// add ourself to workspace
|
||||
QMdiSubWindow * subWin =
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
subWin->setWindowFlags( flags );
|
||||
|
||||
95
src/gui/GuiApplication.cpp
Normal file
95
src/gui/GuiApplication.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* GuiApplication.cpp
|
||||
*
|
||||
* Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* This program 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GuiApplication.h"
|
||||
|
||||
#include "lmmsversion.h"
|
||||
|
||||
#include "LmmsStyle.h"
|
||||
#include "LmmsPalette.h"
|
||||
|
||||
#include "AutomationEditor.h"
|
||||
#include "BBEditor.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "ProjectNotes.h"
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSplashScreen>
|
||||
|
||||
GuiApplication* GuiApplication::s_instance = nullptr;
|
||||
|
||||
GuiApplication* GuiApplication::instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
GuiApplication::GuiApplication()
|
||||
{
|
||||
s_instance = this;
|
||||
|
||||
// Init style and palette
|
||||
LmmsStyle* lmmsstyle = new LmmsStyle();
|
||||
QApplication::setStyle(lmmsstyle);
|
||||
|
||||
LmmsPalette* lmmspal = new LmmsPalette(nullptr, lmmsstyle);
|
||||
QPalette* lpal = new QPalette(lmmspal->palette());
|
||||
|
||||
QApplication::setPalette( *lpal );
|
||||
LmmsStyle::s_palette = lpal;
|
||||
|
||||
// Show splash screen
|
||||
QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) );
|
||||
splashScreen.show();
|
||||
splashScreen.showMessage( MainWindow::tr( "Version %1" ).arg( LMMS_VERSION ),
|
||||
Qt::AlignRight | Qt::AlignBottom, Qt::white );
|
||||
qApp->processEvents();
|
||||
|
||||
// Init central engine which handles all components of LMMS
|
||||
Engine::init(false);
|
||||
|
||||
m_mainWindow = new MainWindow;
|
||||
|
||||
m_songEditor = new SongEditorWindow(Engine::getSong());
|
||||
m_fxMixerView = new FxMixerView;
|
||||
m_controllerRackView = new ControllerRackView;
|
||||
m_projectNotes = new ProjectNotes;
|
||||
m_bbEditor = new BBEditor(Engine::getBBTrackContainer());
|
||||
m_pianoRoll = new PianoRollWindow();
|
||||
m_automationEditor = new AutomationEditorWindow;
|
||||
|
||||
m_mainWindow->finalize();
|
||||
splashScreen.finish(m_mainWindow);
|
||||
|
||||
Engine::s_hasGUI = true;
|
||||
}
|
||||
|
||||
GuiApplication::~GuiApplication()
|
||||
{
|
||||
InstrumentTrackView::cleanupWindowCache();
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QDomElement>
|
||||
#include <QUrl>
|
||||
@@ -36,7 +37,7 @@
|
||||
#include <QWhatsThis>
|
||||
|
||||
#include "lmmsversion.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "BBEditor.h"
|
||||
#include "SongEditor.h"
|
||||
#include "Song.h"
|
||||
@@ -533,10 +534,10 @@ void MainWindow::finalize()
|
||||
|
||||
// Add editor subwindows
|
||||
for (QWidget* widget : QList<QWidget*>{
|
||||
Engine::automationEditor(),
|
||||
Engine::getBBEditor(),
|
||||
Engine::pianoRoll(),
|
||||
Engine::songEditor()
|
||||
gui->automationEditor(),
|
||||
gui->getBBEditor(),
|
||||
gui->pianoRoll(),
|
||||
gui->songEditor()
|
||||
})
|
||||
{
|
||||
QMdiSubWindow* window = workspace()->addSubWindow(widget);
|
||||
@@ -545,13 +546,13 @@ void MainWindow::finalize()
|
||||
window->resize(widget->sizeHint());
|
||||
}
|
||||
|
||||
Engine::automationEditor()->parentWidget()->hide();
|
||||
Engine::getBBEditor()->parentWidget()->move( 610, 5 );
|
||||
Engine::getBBEditor()->parentWidget()->show();
|
||||
Engine::pianoRoll()->parentWidget()->move(5, 5);
|
||||
Engine::pianoRoll()->parentWidget()->hide();
|
||||
Engine::songEditor()->parentWidget()->move(5, 5);
|
||||
Engine::songEditor()->parentWidget()->show();
|
||||
gui->automationEditor()->parentWidget()->hide();
|
||||
gui->getBBEditor()->parentWidget()->move( 610, 5 );
|
||||
gui->getBBEditor()->parentWidget()->show();
|
||||
gui->pianoRoll()->parentWidget()->move(5, 5);
|
||||
gui->pianoRoll()->parentWidget()->hide();
|
||||
gui->songEditor()->parentWidget()->move(5, 5);
|
||||
gui->songEditor()->parentWidget()->show();
|
||||
|
||||
// reset window title every time we change the state of a subwindow to show the correct title
|
||||
foreach( QMdiSubWindow * subWindow, workspace()->subWindowList() )
|
||||
@@ -878,7 +879,7 @@ void MainWindow::showSettingsDialog()
|
||||
|
||||
void MainWindow::aboutLMMS()
|
||||
{
|
||||
AboutDialog().exec();
|
||||
AboutDialog(this).exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -935,10 +936,10 @@ void MainWindow::refocus()
|
||||
{
|
||||
QList<QWidget*> editors;
|
||||
editors
|
||||
<< Engine::songEditor()->parentWidget()
|
||||
<< Engine::getBBEditor()->parentWidget()
|
||||
<< Engine::pianoRoll()->parentWidget()
|
||||
<< Engine::automationEditor()->parentWidget();
|
||||
<< gui->songEditor()->parentWidget()
|
||||
<< gui->getBBEditor()->parentWidget()
|
||||
<< gui->pianoRoll()->parentWidget()
|
||||
<< gui->automationEditor()->parentWidget();
|
||||
|
||||
bool found = false;
|
||||
QList<QWidget*>::Iterator editor;
|
||||
@@ -960,7 +961,7 @@ void MainWindow::refocus()
|
||||
|
||||
void MainWindow::toggleBBEditorWin( bool forceShow )
|
||||
{
|
||||
toggleWindow( Engine::getBBEditor(), forceShow );
|
||||
toggleWindow( gui->getBBEditor(), forceShow );
|
||||
}
|
||||
|
||||
|
||||
@@ -968,7 +969,7 @@ void MainWindow::toggleBBEditorWin( bool forceShow )
|
||||
|
||||
void MainWindow::toggleSongEditorWin()
|
||||
{
|
||||
toggleWindow( Engine::songEditor() );
|
||||
toggleWindow( gui->songEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -976,7 +977,7 @@ void MainWindow::toggleSongEditorWin()
|
||||
|
||||
void MainWindow::toggleProjectNotesWin()
|
||||
{
|
||||
toggleWindow( Engine::getProjectNotes() );
|
||||
toggleWindow( gui->getProjectNotes() );
|
||||
}
|
||||
|
||||
|
||||
@@ -984,7 +985,7 @@ void MainWindow::toggleProjectNotesWin()
|
||||
|
||||
void MainWindow::togglePianoRollWin()
|
||||
{
|
||||
toggleWindow( Engine::pianoRoll() );
|
||||
toggleWindow( gui->pianoRoll() );
|
||||
}
|
||||
|
||||
|
||||
@@ -992,7 +993,7 @@ void MainWindow::togglePianoRollWin()
|
||||
|
||||
void MainWindow::toggleAutomationEditorWin()
|
||||
{
|
||||
toggleWindow( Engine::automationEditor() );
|
||||
toggleWindow( gui->automationEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1000,7 +1001,7 @@ void MainWindow::toggleAutomationEditorWin()
|
||||
|
||||
void MainWindow::toggleFxMixerWin()
|
||||
{
|
||||
toggleWindow( Engine::fxMixerView() );
|
||||
toggleWindow( gui->fxMixerView() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1008,7 +1009,7 @@ void MainWindow::toggleFxMixerWin()
|
||||
|
||||
void MainWindow::toggleControllerRack()
|
||||
{
|
||||
toggleWindow( Engine::getControllerRackView() );
|
||||
toggleWindow( gui->getControllerRackView() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1016,29 +1017,29 @@ void MainWindow::toggleControllerRack()
|
||||
|
||||
void MainWindow::updatePlayPauseIcons()
|
||||
{
|
||||
Engine::songEditor()->setPauseIcon( false );
|
||||
Engine::automationEditor()->setPauseIcon( false );
|
||||
Engine::getBBEditor()->setPauseIcon( false );
|
||||
Engine::pianoRoll()->setPauseIcon( false );
|
||||
gui->songEditor()->setPauseIcon( false );
|
||||
gui->automationEditor()->setPauseIcon( false );
|
||||
gui->getBBEditor()->setPauseIcon( false );
|
||||
gui->pianoRoll()->setPauseIcon( false );
|
||||
|
||||
if( Engine::getSong()->isPlaying() )
|
||||
{
|
||||
switch( Engine::getSong()->playMode() )
|
||||
{
|
||||
case Song::Mode_PlaySong:
|
||||
Engine::songEditor()->setPauseIcon( true );
|
||||
gui->songEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayAutomationPattern:
|
||||
Engine::automationEditor()->setPauseIcon( true );
|
||||
gui->automationEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayBB:
|
||||
Engine::getBBEditor()->setPauseIcon( true );
|
||||
gui->getBBEditor()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
case Song::Mode_PlayPattern:
|
||||
Engine::pianoRoll()->setPauseIcon( true );
|
||||
gui->pianoRoll()->setPauseIcon( true );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
#include "StringPairDrag.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ StringPairDrag::~StringPairDrag()
|
||||
{
|
||||
// during a drag, we might have lost key-press-events, so reset
|
||||
// modifiers of main-win
|
||||
if( Engine::mainWindow() )
|
||||
if( gui->mainWindow() )
|
||||
{
|
||||
Engine::mainWindow()->clearKeyModifiers();
|
||||
gui->mainWindow()->clearKeyModifiers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "Engine.h"
|
||||
#include "templates.h"
|
||||
#include "NStateButton.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "TextFloat.h"
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ TimeLineWidget::TimeLineWidget( const int _xoff, const int _yoff, const float _p
|
||||
|
||||
TimeLineWidget::~TimeLineWidget()
|
||||
{
|
||||
if( Engine::songEditor() )
|
||||
if( gui->songEditor() )
|
||||
{
|
||||
m_pos.m_timeLine = NULL;
|
||||
}
|
||||
|
||||
@@ -31,13 +31,14 @@
|
||||
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) :
|
||||
PluginView( _toolPlugin, NULL )
|
||||
{
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
|
||||
setWindowTitle( _toolPlugin->displayName() );
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "ActionGroup.h"
|
||||
#include "SongEditor.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "PixmapButton.h"
|
||||
@@ -296,7 +297,7 @@ void AutomationEditor::update()
|
||||
// Note detuning?
|
||||
if( m_pattern && !m_pattern->getTrack() )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1549,7 +1550,7 @@ void AutomationEditor::play()
|
||||
if( Engine::getSong()->playMode() != Song::Mode_PlayPattern )
|
||||
{
|
||||
Engine::getSong()->stop();
|
||||
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
|
||||
Engine::getSong()->playPattern( gui->pianoRoll()->currentPattern() );
|
||||
}
|
||||
else if( Engine::getSong()->isStopped() == false )
|
||||
{
|
||||
@@ -1557,7 +1558,7 @@ void AutomationEditor::play()
|
||||
}
|
||||
else
|
||||
{
|
||||
Engine::getSong()->playPattern( Engine::pianoRoll()->currentPattern() );
|
||||
Engine::getSong()->playPattern( gui->pianoRoll()->currentPattern() );
|
||||
}
|
||||
}
|
||||
else if( inBBEditor() )
|
||||
@@ -1814,7 +1815,7 @@ void AutomationEditor::cutSelectedValues()
|
||||
}
|
||||
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
|
||||
|
||||
@@ -1836,7 +1837,7 @@ void AutomationEditor::pasteValues()
|
||||
// least one value...
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1866,7 +1867,7 @@ void AutomationEditor::deleteSelectedValues()
|
||||
{
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "debug.h"
|
||||
#include "DetuningHelper.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -799,7 +800,7 @@ void PianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones
|
||||
|
||||
// we modified the song
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
|
||||
}
|
||||
|
||||
@@ -835,7 +836,7 @@ void PianoRoll::shiftPos( int amount ) //shift notes pos by amount
|
||||
|
||||
// we modified the song
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
|
||||
|
||||
@@ -1203,7 +1204,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me )
|
||||
{
|
||||
Note* n = noteUnderMouse();
|
||||
if (n->detuning() == NULL) n->createDetuning();
|
||||
Engine::automationEditor()->open( noteUnderMouse()->detuning()->automationPattern() );
|
||||
gui->automationEditor()->open( noteUnderMouse()->detuning()->automationPattern() );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1483,7 +1484,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me )
|
||||
// added new notes, so must update engine, song, etc
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3612,7 +3613,7 @@ void PianoRoll::cutSelectedNotes()
|
||||
}
|
||||
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
|
||||
|
||||
@@ -3661,7 +3662,7 @@ void PianoRoll::pasteNotes()
|
||||
// least one note...
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3705,7 +3706,7 @@ void PianoRoll::deleteSelectedNotes()
|
||||
{
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
Engine::songEditor()->update();
|
||||
gui->songEditor()->update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QTimeLine>
|
||||
#include <QAction>
|
||||
#include <QButtonGroup>
|
||||
@@ -36,12 +38,12 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "ActionGroup.h"
|
||||
#include "SongEditor.h"
|
||||
#include "AutomatableSlider.h"
|
||||
#include "ComboBox.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "CPULoadWidget.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LcdSpinBox.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
@@ -108,9 +110,9 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
|
||||
|
||||
// add some essential widgets to global tool-bar
|
||||
QWidget * tb = Engine::mainWindow()->toolBar();
|
||||
QWidget * tb = gui->mainWindow()->toolBar();
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
m_tempoSpinBox = new LcdSpinBox( 3, tb, tr( "Tempo" ) );
|
||||
m_tempoSpinBox->setModel( &m_song->m_tempoModel );
|
||||
@@ -125,7 +127,7 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
"should be played within a minute (or how many measures "
|
||||
"should be played within four minutes)." ) );
|
||||
|
||||
int tempoSpinBoxCol = Engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
int tempoSpinBoxCol = gui->mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
|
||||
#if 0
|
||||
toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ),
|
||||
@@ -135,18 +137,18 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
connect( hq_btn, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( setHighQuality( bool ) ) );
|
||||
hq_btn->setFixedWidth( 42 );
|
||||
Engine::mainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
gui->mainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
#endif
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol );
|
||||
gui->mainWindow()->addWidgetToToolBar( new TimeDisplayWidget, 1, tempoSpinBoxCol );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
m_timeSigDisplay = new MeterDialog( this, true );
|
||||
m_timeSigDisplay->setModel( &m_song->m_timeSigModel );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_vol_lbl = new QLabel( tb );
|
||||
@@ -175,11 +177,11 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
m_mvsStatus->setTitle( tr( "Master volume" ) );
|
||||
m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) );
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
gui->mainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_pitch_lbl = new QLabel( tb );
|
||||
@@ -207,10 +209,10 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
m_mpsStatus->setTitle( tr( "Master pitch" ) );
|
||||
m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) );
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
Engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
gui->mainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
gui->mainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
|
||||
Engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
gui->mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
// create widget for visualization- and cpu-load-widget
|
||||
QWidget * vc_w = new QWidget( tb );
|
||||
@@ -225,7 +227,7 @@ SongEditor::SongEditor( Song * _song ) :
|
||||
vcw_layout->addWidget( new CPULoadWidget( vc_w ) );
|
||||
vcw_layout->addStretch();
|
||||
|
||||
Engine::mainWindow()->addWidgetToToolBar( vc_w );
|
||||
gui->mainWindow()->addWidgetToToolBar( vc_w );
|
||||
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, m_timeLine );
|
||||
|
||||
@@ -305,13 +307,13 @@ void SongEditor::setEditModeSelect()
|
||||
void SongEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( /*_ke->modifiers() & Qt::ShiftModifier*/
|
||||
Engine::mainWindow()->isShiftPressed() == true &&
|
||||
gui->mainWindow()->isShiftPressed() == true &&
|
||||
_ke->key() == Qt::Key_Insert )
|
||||
{
|
||||
m_song->insertBar();
|
||||
}
|
||||
else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/
|
||||
Engine::mainWindow()->isShiftPressed() == true &&
|
||||
gui->mainWindow()->isShiftPressed() == true &&
|
||||
_ke->key() == Qt::Key_Delete )
|
||||
{
|
||||
m_song->removeBar();
|
||||
@@ -347,7 +349,7 @@ void SongEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
void SongEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( Engine::mainWindow()->isCtrlPressed() == true )
|
||||
if( gui->mainWindow()->isCtrlPressed() == true )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
@@ -371,7 +373,7 @@ void SongEditor::wheelEvent( QWheelEvent * _we )
|
||||
// and make sure, all TCO's are resized and relocated
|
||||
realignTracks();
|
||||
}
|
||||
else if( Engine::mainWindow()->isShiftPressed() == true )
|
||||
else if( gui->mainWindow()->isShiftPressed() == true )
|
||||
{
|
||||
m_leftRightScroll->setValue( m_leftRightScroll->value() -
|
||||
_we->delta() / 30 );
|
||||
@@ -601,7 +603,7 @@ void SongEditor::adjustUiAfterProjectLoad()
|
||||
// make sure to bring us to front as the song editor is the central
|
||||
// widget in a song and when just opening a song in order to listen to
|
||||
// it, it's very annyoing to manually bring up the song editor each time
|
||||
Engine::mainWindow()->workspace()->setActiveSubWindow(
|
||||
gui->mainWindow()->workspace()->setActiveSubWindow(
|
||||
qobject_cast<QMdiSubWindow *>( parentWidget() ) );
|
||||
}
|
||||
scrolled( 0 );
|
||||
@@ -721,5 +723,5 @@ void SongEditorWindow::recordAccompany()
|
||||
void SongEditorWindow::stop()
|
||||
{
|
||||
m_editor->m_song->stop();
|
||||
Engine::pianoRoll()->stopRecording();
|
||||
gui->pianoRoll()->stopRecording();
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "Song.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GroupBox.h"
|
||||
#include "ControllerRackView.h"
|
||||
@@ -75,7 +76,7 @@ ControllerRackView::ControllerRackView( ) :
|
||||
this->setLayout( layout );
|
||||
|
||||
QMdiSubWindow * subWin =
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
|
||||
// No maximize button
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "LedCheckbox.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ToolTip.h"
|
||||
@@ -62,9 +63,9 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
|
||||
connect( ctls_btn, SIGNAL( clicked() ),
|
||||
this, SLOT( editControls() ) );
|
||||
|
||||
m_controllerDlg = getController()->createDialog( Engine::mainWindow()->workspace() );
|
||||
m_controllerDlg = getController()->createDialog( gui->mainWindow()->workspace() );
|
||||
|
||||
m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = gui->mainWindow()->workspace()->addSubWindow(
|
||||
m_controllerDlg );
|
||||
|
||||
Qt::WindowFlags flags = m_subWindow->windowFlags();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "EffectControlDialog.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "Knob.h"
|
||||
#include "LedCheckbox.h"
|
||||
@@ -109,7 +110,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
|
||||
m_controlView = effect()->controls()->createView();
|
||||
if( m_controlView )
|
||||
{
|
||||
m_subWindow = Engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = gui->mainWindow()->workspace()->addSubWindow(
|
||||
m_controlView,
|
||||
Qt::SubWindow | Qt::CustomizeWindowHint |
|
||||
Qt::WindowTitleHint | Qt::WindowSystemMenuHint );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "FxMixerView.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "SendButtonIndicator.h"
|
||||
#include "gui_templates.h"
|
||||
#include "CaptionMenu.h"
|
||||
@@ -229,28 +230,28 @@ void FxLine::renameChannel()
|
||||
|
||||
void FxLine::removeChannel()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->deleteChannel( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
void FxLine::removeUnusedChannels()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->deleteUnusedChannels();
|
||||
}
|
||||
|
||||
|
||||
void FxLine::moveChannelLeft()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->moveChannelLeft( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
void FxLine::moveChannelRight()
|
||||
{
|
||||
FxMixerView * mix = Engine::fxMixerView();
|
||||
FxMixerView * mix = gui->fxMixerView();
|
||||
mix->moveChannelRight( m_channelIndex );
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "Song.h"
|
||||
@@ -458,15 +459,15 @@ float Knob::getValue( const QPoint & _p )
|
||||
{
|
||||
float value;
|
||||
|
||||
// arcane mathemagicks for calculating knob movement
|
||||
// arcane mathemagicks for calculating knob movement
|
||||
value = ( ( _p.y() + _p.y() * qMin( qAbs( _p.y() / 2.5f ), 6.0f ) ) ) / 12.0f;
|
||||
|
||||
|
||||
// if shift pressed we want slower movement
|
||||
if( Engine::mainWindow()->isShiftPressed() )
|
||||
if( gui->mainWindow()->isShiftPressed() )
|
||||
{
|
||||
value /= 4.0f;
|
||||
value = qBound( -4.0f, value, 4.0f );
|
||||
}
|
||||
}
|
||||
return value * pageSize();
|
||||
}
|
||||
|
||||
@@ -483,7 +484,7 @@ void Knob::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
CaptionMenu contextMenu( model()->displayName(), this );
|
||||
addDefaultActions( &contextMenu );
|
||||
contextMenu.addAction( QPixmap(),
|
||||
contextMenu.addAction( QPixmap(),
|
||||
model()->isScaleLogarithmic() ? tr( "Set linear" ) : tr( "Set logarithmic" ),
|
||||
this, SLOT( toggleScale() ) );
|
||||
contextMenu.addSeparator();
|
||||
@@ -561,7 +562,7 @@ void Knob::mousePressEvent( QMouseEvent * _me )
|
||||
m_buttonPressed = true;
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
Engine::mainWindow()->isShiftPressed() == true )
|
||||
gui->mainWindow()->isShiftPressed() == true )
|
||||
{
|
||||
new StringPairDrag( "float_value",
|
||||
QString::number( model()->value() ),
|
||||
@@ -681,7 +682,7 @@ void Knob::setPosition( const QPoint & _p )
|
||||
|
||||
if( model()->isScaleLogarithmic() ) // logarithmic code
|
||||
{
|
||||
const float pos = model()->minValue() < 0
|
||||
const float pos = model()->minValue() < 0
|
||||
? oldValue / qMax( qAbs( model()->maxValue() ), qAbs( model()->minValue() ) )
|
||||
: ( oldValue - model()->minValue() ) / model()->range();
|
||||
const float ratio = 0.1f + qAbs( pos ) * 15.f;
|
||||
@@ -697,11 +698,11 @@ void Knob::setPosition( const QPoint & _p )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
else // linear code
|
||||
{
|
||||
if( qAbs( value ) >= step )
|
||||
{
|
||||
{
|
||||
model()->setValue( oldValue - value );
|
||||
m_leftOver = 0.0f;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "CaptionMenu.h"
|
||||
#include "Engine.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -126,7 +127,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event )
|
||||
if( m_mouseMoving )
|
||||
{
|
||||
int dy = event->globalY() - m_origMousePos.y();
|
||||
if( Engine::mainWindow()->isShiftPressed() )
|
||||
if( gui->mainWindow()->isShiftPressed() )
|
||||
dy = qBound( -4, dy/4, 4 );
|
||||
if( dy > 1 || dy < -1 )
|
||||
{
|
||||
|
||||
@@ -39,13 +39,14 @@
|
||||
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
|
||||
ProjectNotes::ProjectNotes() :
|
||||
QMainWindow( Engine::mainWindow()->workspace() )
|
||||
QMainWindow( gui->mainWindow()->workspace() )
|
||||
{
|
||||
m_edit = new QTextEdit( this );
|
||||
m_edit->setAutoFillBackground( true );
|
||||
@@ -70,7 +71,7 @@ ProjectNotes::ProjectNotes() :
|
||||
setWindowTitle( tr( "Project notes" ) );
|
||||
setWindowIcon( embed::getIconPixmap( "project_notes" ) );
|
||||
|
||||
Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->move( 700, 10 );
|
||||
parentWidget()->resize( 400, 300 );
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Engine.h"
|
||||
#include "CaptionMenu.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "Song.h"
|
||||
@@ -86,10 +87,10 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
CaptionMenu contextMenu( model()->displayName(), this );
|
||||
addDefaultActions( &contextMenu );
|
||||
contextMenu.addSeparator();
|
||||
|
||||
|
||||
float limit = 60000.0f / ( Engine::getSong()->getTempo() *
|
||||
model()->m_scale );
|
||||
|
||||
|
||||
QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon,
|
||||
m_tempoSyncDescription );
|
||||
if( limit / 8.0f <= model()->maxValue() )
|
||||
@@ -149,7 +150,7 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
contextMenu.addHelpAction();
|
||||
contextMenu.exec( QCursor::pos() );
|
||||
|
||||
|
||||
delete syncMenu;
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ void TempoSyncKnob::updateDescAndIcon()
|
||||
switch( model()->m_tempoSyncMode )
|
||||
{
|
||||
case TempoSyncKnobModel::SyncCustom:
|
||||
m_tempoSyncDescription = tr( "Custom " ) +
|
||||
m_tempoSyncDescription = tr( "Custom " ) +
|
||||
"(" +
|
||||
QString::number( model()->m_custom.numeratorModel().value() ) +
|
||||
"/" +
|
||||
@@ -291,8 +292,8 @@ void TempoSyncKnob::showCustom()
|
||||
{
|
||||
if( m_custom == NULL )
|
||||
{
|
||||
m_custom = new MeterDialog( Engine::mainWindow()->workspace() );
|
||||
Engine::mainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom = new MeterDialog( gui->mainWindow()->workspace() );
|
||||
gui->mainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom->setWindowTitle( "Meter" );
|
||||
m_custom->setModel( &model()->m_custom );
|
||||
}
|
||||
|
||||
@@ -28,13 +28,14 @@
|
||||
|
||||
#include "TextFloat.h"
|
||||
#include "gui_templates.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Engine.h"
|
||||
|
||||
|
||||
|
||||
TextFloat::TextFloat() :
|
||||
QWidget( Engine::mainWindow(), Qt::ToolTip ),
|
||||
QWidget( gui->mainWindow(), Qt::ToolTip ),
|
||||
m_title(),
|
||||
m_text(),
|
||||
m_pixmap()
|
||||
@@ -89,7 +90,7 @@ void TextFloat::setVisibilityTimeOut( int _msecs )
|
||||
TextFloat * TextFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
QWidget * _parent, int _add_y_margin )
|
||||
{
|
||||
QWidget * mw = Engine::mainWindow();
|
||||
QWidget * mw = gui->mainWindow();
|
||||
TextFloat * tf = new TextFloat;
|
||||
if( _parent != NULL )
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "TimeDisplayWidget.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Engine.h"
|
||||
#include "ToolTip.h"
|
||||
@@ -53,7 +54,7 @@ TimeDisplayWidget::TimeDisplayWidget() :
|
||||
// update labels of LCD spinboxes
|
||||
setDisplayMode( m_displayMode );
|
||||
|
||||
connect( Engine::mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( updateTime() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "VisualizationWidget.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "gui_templates.h"
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
@@ -90,7 +91,7 @@ void VisualizationWidget::setActive( bool _active )
|
||||
m_active = _active;
|
||||
if( m_active )
|
||||
{
|
||||
connect( Engine::mainWindow(),
|
||||
connect( gui->mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( Engine::mixer(),
|
||||
@@ -99,7 +100,7 @@ void VisualizationWidget::setActive( bool _active )
|
||||
}
|
||||
else
|
||||
{
|
||||
disconnect( Engine::mainWindow(),
|
||||
disconnect( gui->mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
disconnect( Engine::mixer(),
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "Engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "Mixer.h"
|
||||
#include "RenameDialog.h"
|
||||
#include "Song.h"
|
||||
@@ -275,7 +276,7 @@ void BBTCOView::openInBBEditor()
|
||||
{
|
||||
Engine::getBBTrackContainer()->setCurrentBB( m_bbTCO->bbTrackIndex() );
|
||||
|
||||
Engine::mainWindow()->toggleBBEditorWin( true );
|
||||
gui->mainWindow()->toggleBBEditorWin( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +311,7 @@ void BBTCOView::changeColor()
|
||||
if( isSelected() )
|
||||
{
|
||||
QVector<selectableObject *> selected =
|
||||
Engine::songEditor()->m_editor->selectedObjects();
|
||||
gui->songEditor()->m_editor->selectedObjects();
|
||||
for( QVector<selectableObject *>::iterator it =
|
||||
selected.begin();
|
||||
it != selected.end(); ++it )
|
||||
@@ -599,7 +600,7 @@ BBTrackView::BBTrackView( BBTrack * _bbt, TrackContainerView* tcv ) :
|
||||
|
||||
BBTrackView::~BBTrackView()
|
||||
{
|
||||
Engine::getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
gui->getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
}
|
||||
|
||||
|
||||
@@ -607,7 +608,7 @@ BBTrackView::~BBTrackView()
|
||||
|
||||
bool BBTrackView::close()
|
||||
{
|
||||
Engine::getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
gui->getBBEditor()->removeBBView( BBTrack::s_infoMap[m_bbTrack] );
|
||||
return TrackView::close();
|
||||
}
|
||||
|
||||
@@ -617,7 +618,7 @@ bool BBTrackView::close()
|
||||
void BBTrackView::clickedTrackLabel()
|
||||
{
|
||||
Engine::getBBTrackContainer()->setCurrentBB( m_bbTrack->index() );
|
||||
Engine::getBBEditor()->show();
|
||||
gui->getBBEditor()->show();
|
||||
/* foreach( bbTrackView * tv,
|
||||
trackContainerView()->findChildren<bbTrackView *>() )
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "FileBrowser.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "InstrumentSoundShapingView.h"
|
||||
#include "FadeButton.h"
|
||||
@@ -941,7 +942,7 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
|
||||
{
|
||||
InstrumentTrackWindow * w = NULL;
|
||||
foreach( QMdiSubWindow * sw,
|
||||
Engine::mainWindow()->workspace()->subWindowList(
|
||||
gui->mainWindow()->workspace()->subWindowList(
|
||||
QMdiArea::ActivationHistoryOrder ) )
|
||||
{
|
||||
if( sw->isVisible() && sw->widget()->inherits( "InstrumentTrackWindow" ) )
|
||||
@@ -1135,10 +1136,10 @@ class fxLineLcdSpinBox : public LcdSpinBox
|
||||
protected:
|
||||
virtual void mouseDoubleClickEvent ( QMouseEvent * _me )
|
||||
{
|
||||
Engine::fxMixerView()->setCurrentFxLine( model()->value() );
|
||||
gui->fxMixerView()->setCurrentFxLine( model()->value() );
|
||||
|
||||
Engine::fxMixerView()->show();// show fxMixer window
|
||||
Engine::fxMixerView()->setFocus();// set focus to fxMixer window
|
||||
gui->fxMixerView()->show();// show fxMixer window
|
||||
gui->fxMixerView()->setFocus();// set focus to fxMixer window
|
||||
//engine::getFxMixerView()->raise();
|
||||
}
|
||||
};
|
||||
@@ -1280,7 +1281,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
setFixedWidth( INSTRUMENT_WIDTH );
|
||||
resize( sizeHint() );
|
||||
|
||||
QMdiSubWindow * subWin = Engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
QMdiSubWindow * subWin = gui->mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
@@ -1306,7 +1307,7 @@ InstrumentTrackWindow::~InstrumentTrackWindow()
|
||||
|
||||
delete m_instrumentView;
|
||||
|
||||
if( Engine::mainWindow()->workspace() )
|
||||
if( gui->mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
parentWidget()->deleteLater();
|
||||
@@ -1472,7 +1473,7 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
if( Engine::mainWindow()->workspace() )
|
||||
if( gui->mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "TrackContainer.h"
|
||||
#include "RenameDialog.h"
|
||||
@@ -170,9 +170,9 @@ MidiTime Pattern::beatPatternLength() const
|
||||
Note * Pattern::addNote( const Note & _new_note, const bool _quant_pos )
|
||||
{
|
||||
Note * new_note = new Note( _new_note );
|
||||
if( _quant_pos && Engine::pianoRoll() )
|
||||
if( _quant_pos && gui->pianoRoll() )
|
||||
{
|
||||
new_note->quantizePos( Engine::pianoRoll()->quantization() );
|
||||
new_note->quantizePos( gui->pianoRoll()->quantization() );
|
||||
}
|
||||
|
||||
instrumentTrack()->lock();
|
||||
@@ -539,9 +539,9 @@ void Pattern::updateBBTrack()
|
||||
Engine::getBBTrackContainer()->updateBBTrack( this );
|
||||
}
|
||||
|
||||
if( Engine::pianoRoll() && Engine::pianoRoll()->currentPattern() == this )
|
||||
if( gui->pianoRoll() && gui->pianoRoll()->currentPattern() == this )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) :
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
connect( Engine::pianoRoll(), SIGNAL( currentPatternChanged() ),
|
||||
connect( gui->pianoRoll(), SIGNAL( currentPatternChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
if( s_stepBtnOn == NULL )
|
||||
@@ -668,10 +668,10 @@ void PatternView::update()
|
||||
|
||||
void PatternView::openInPianoRoll()
|
||||
{
|
||||
Engine::pianoRoll()->setCurrentPattern( m_pat );
|
||||
Engine::pianoRoll()->parentWidget()->show();
|
||||
Engine::pianoRoll()->show();
|
||||
Engine::pianoRoll()->setFocus();
|
||||
gui->pianoRoll()->setCurrentPattern( m_pat );
|
||||
gui->pianoRoll()->parentWidget()->show();
|
||||
gui->pianoRoll()->show();
|
||||
gui->pianoRoll()->setFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -802,9 +802,9 @@ void PatternView::mousePressEvent( QMouseEvent * _me )
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -863,9 +863,9 @@ void PatternView::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
Engine::getSong()->setModified();
|
||||
update();
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
{
|
||||
Engine::pianoRoll()->update();
|
||||
gui->pianoRoll()->update();
|
||||
}
|
||||
}
|
||||
_we->accept();
|
||||
@@ -925,7 +925,7 @@ void PatternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setBrush( lingrad );
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
@@ -934,7 +934,7 @@ void PatternView::paintEvent( QPaintEvent * )
|
||||
p.setBrush( QBrush() );
|
||||
if( m_pat->m_patternType != Pattern::BeatPattern )
|
||||
{
|
||||
if( Engine::pianoRoll()->currentPattern() == m_pat )
|
||||
if( gui->pianoRoll()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
else
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "StringPairDrag.h"
|
||||
#include "Knob.h"
|
||||
#include "MainWindow.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "EffectRackView.h"
|
||||
#include "TrackLabelButton.h"
|
||||
#include "ConfigManager.h"
|
||||
@@ -567,7 +568,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) :
|
||||
m_effectRack = new EffectRackView( _t->audioPort()->effects() );
|
||||
m_effectRack->setFixedSize( 240, 242 );
|
||||
|
||||
m_effWindow = Engine::mainWindow()->workspace()->addSubWindow( m_effectRack );
|
||||
m_effWindow = gui->mainWindow()->workspace()->addSubWindow( m_effectRack );
|
||||
m_effWindow->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||
m_effWindow->setWindowTitle( _t->name() );
|
||||
|
||||
Reference in New Issue
Block a user