Skip to content

Commit

Permalink
SongEditor: Use Editor superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Dec 7, 2014
1 parent 02006f9 commit 3e9cc61
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 181 deletions.
6 changes: 3 additions & 3 deletions include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Mixer;
class PianoRoll;
class ProjectNotes;
class Song;
class SongEditor;
class SongEditorWindow;
class Ladspa2LMMS;
class ControllerRackView;

Expand Down Expand Up @@ -108,7 +108,7 @@ class EXPORT Engine
return s_fxMixerView;
}

static SongEditor* songEditor()
static SongEditorWindow* songEditor()
{
return s_songEditor;
}
Expand Down Expand Up @@ -187,7 +187,7 @@ class EXPORT Engine
// GUI
static MainWindow * s_mainWindow;
static FxMixerView * s_fxMixerView;
static SongEditor* s_songEditor;
static SongEditorWindow* s_songEditor;
static AutomationEditorWindow * s_automationEditor;
static BBEditor * s_bbEditor;
static PianoRoll* s_pianoRoll;
Expand Down
44 changes: 35 additions & 9 deletions include/SongEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
#ifndef SONG_EDITOR_H
#define SONG_EDITOR_H

#include "Editor.h"
#include "TrackContainerView.h"

class QLabel;
class QScrollBar;

class AutomatableSlider;
class ComboBox;
class ComboBoxModel;
class LcdSpinBox;
class MeterDialog;
class Song;
Expand All @@ -56,6 +58,12 @@ class SongEditor : public TrackContainerView
{
Q_OBJECT
public:
enum Mode
{
DrawMode,
EditMode
};

SongEditor( Song * _song );
virtual ~SongEditor();

Expand All @@ -65,6 +73,10 @@ class SongEditor : public TrackContainerView
public slots:
void scrolled( int _new_pos );

void setMode(Mode mode);
void setModeDraw();
void setModeEdit();


private slots:
void setHighQuality( bool );
Expand Down Expand Up @@ -119,22 +131,36 @@ private slots:
TextFloat * m_mvsStatus;
TextFloat * m_mpsStatus;

ToolButton * m_addBBTrackButton;
ToolButton * m_addSampleTrackButton;
ToolButton * m_addAutomationTrackButton;

ToolButton * m_drawModeButton;
ToolButton * m_editModeButton;

ComboBox * m_zoomingComboBox;

positionLine * m_positionLine;

ComboBoxModel* m_zoomingModel;

bool m_scrollBack;
bool m_smoothScroll;

Mode m_mode;

friend class SongEditorWindow;

} ;

class SongEditorWindow : public Editor
{
Q_OBJECT
public:
SongEditorWindow(Song* song);

SongEditor* m_editor;

private:
ToolButton * m_addBBTrackButton;
ToolButton * m_addSampleTrackButton;
ToolButton * m_addAutomationTrackButton;

ToolButton * m_drawModeButton;
ToolButton * m_editModeButton;

ComboBox * m_zoomingComboBox;
};

#endif
4 changes: 2 additions & 2 deletions src/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ FxMixerView * Engine::s_fxMixerView = NULL;
MainWindow * Engine::s_mainWindow = NULL;
BBTrackContainer * Engine::s_bbTrackContainer = NULL;
Song * Engine::s_song = NULL;
SongEditor* Engine::s_songEditor = NULL;
SongEditorWindow* Engine::s_songEditor = NULL;
AutomationEditorWindow * Engine::s_automationEditor = NULL;
BBEditor * Engine::s_bbEditor = NULL;
PianoRoll* Engine::s_pianoRoll = NULL;
Expand Down Expand Up @@ -93,7 +93,7 @@ void Engine::init( const bool _has_gui )
if( s_hasGUI )
{
s_mainWindow = new MainWindow;
s_songEditor = new SongEditor( s_song );
s_songEditor = new SongEditorWindow( s_song );
s_fxMixerView = new FxMixerView;
s_controllerRackView = new ControllerRackView;
s_projectNotes = new ProjectNotes;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void Song::clearProject()
}
if( Engine::songEditor() )
{
Engine::songEditor()->clearAllTracks();
Engine::songEditor()->m_editor->clearAllTracks();
}
if( Engine::fxMixerView() )
{
Expand Down
Loading

0 comments on commit 3e9cc61

Please sign in to comment.