Merge branch 'coding'
Conflicts: include/Note.h include/ProjectVersion.h include/TimeLineWidget.h include/Track.h src/core/Plugin.cpp src/core/ProjectVersion.cpp src/core/Song.cpp src/core/Track.cpp src/gui/TimeLineWidget.cpp
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
class AboutDialog : public QDialog, public Ui::AboutDialog
|
||||
{
|
||||
public:
|
||||
AboutDialog( void );
|
||||
AboutDialog(QWidget* parent=0);
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
57
include/ActionGroup.h
Normal file
57
include/ActionGroup.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Editor.h - declaration of Editor class
|
||||
*
|
||||
* 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 ACTION_GROUP_H
|
||||
#define ACTION_GROUP_H
|
||||
|
||||
#include <QActionGroup>
|
||||
|
||||
/// \brief Convenience subclass of QActionGroup
|
||||
///
|
||||
/// This class provides the same functionality as QActionGroup, but in addition
|
||||
/// has the actionTriggered(int) signal.
|
||||
/// It also sets every added action's checkable property to true.
|
||||
class ActionGroup : public QActionGroup
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ActionGroup(QObject* parent);
|
||||
|
||||
QAction* addAction(QAction *a);
|
||||
QAction* addAction(const QString &text);
|
||||
QAction* addAction(const QIcon &icon, const QString &text);
|
||||
|
||||
signals:
|
||||
/// This signal is emitted when the action at the given index is triggered.
|
||||
void triggered(int index);
|
||||
|
||||
private slots:
|
||||
void actionTriggered_(QAction* action);
|
||||
|
||||
private:
|
||||
QList<QAction*> m_actions;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <QtCore/QMutex>
|
||||
#include <QWidget>
|
||||
|
||||
#include "Editor.h"
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "MidiTime.h"
|
||||
@@ -36,58 +38,60 @@
|
||||
#include "ComboBoxModel.h"
|
||||
#include "Knob.h"
|
||||
|
||||
|
||||
class QPainter;
|
||||
class QPixmap;
|
||||
class QScrollBar;
|
||||
|
||||
class ComboBox;
|
||||
class NotePlayHandle;
|
||||
class Timeline;
|
||||
class ToolButton;
|
||||
class TimeLineWidget;
|
||||
|
||||
|
||||
|
||||
class AutomationEditor : public QWidget, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QColor gridColor READ gridColor WRITE setGridColor )
|
||||
Q_PROPERTY( QColor vertexColor READ vertexColor WRITE setVertexColor )
|
||||
Q_PROPERTY( QBrush scaleColor READ scaleColor WRITE setScaleColor )
|
||||
Q_PROPERTY( QBrush graphColor READ graphColor WRITE setGraphColor )
|
||||
Q_PROPERTY(QColor gridColor READ gridColor WRITE setGridColor)
|
||||
Q_PROPERTY(QColor vertexColor READ vertexColor WRITE setVertexColor)
|
||||
Q_PROPERTY(QBrush scaleColor READ scaleColor WRITE setScaleColor)
|
||||
Q_PROPERTY(QBrush graphColor READ graphColor WRITE setGraphColor)
|
||||
public:
|
||||
void setCurrentPattern( AutomationPattern * _new_pattern );
|
||||
void setCurrentPattern(AutomationPattern * new_pattern);
|
||||
|
||||
inline const AutomationPattern * currentPattern() const
|
||||
{
|
||||
return( m_pattern );
|
||||
return m_pattern;
|
||||
}
|
||||
|
||||
inline bool validPattern() const
|
||||
{
|
||||
return( m_pattern != NULL );
|
||||
return m_pattern != nullptr;
|
||||
}
|
||||
|
||||
int quantization() const;
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
virtual void saveSettings(QDomDocument & doc, QDomElement & parent);
|
||||
virtual void loadSettings(const QDomElement & parent);
|
||||
QString nodeName() const
|
||||
{
|
||||
return( "automationeditor" );
|
||||
return "automationeditor";
|
||||
}
|
||||
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
// qproperty access methods
|
||||
QColor gridColor() const;
|
||||
QBrush graphColor() const;
|
||||
QColor vertexColor() const;
|
||||
QBrush scaleColor() const;
|
||||
void setGridColor( const QColor & c );
|
||||
void setGraphColor( const QBrush & c );
|
||||
void setVertexColor( const QColor & c );
|
||||
void setScaleColor( const QBrush & c );
|
||||
void setGridColor(const QColor& c);
|
||||
void setGraphColor(const QBrush& c);
|
||||
void setVertexColor(const QColor& c);
|
||||
void setScaleColor(const QBrush& c);
|
||||
|
||||
enum EditModes
|
||||
{
|
||||
DRAW,
|
||||
ERASE,
|
||||
SELECT,
|
||||
MOVE
|
||||
};
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
@@ -97,69 +101,56 @@ public slots:
|
||||
protected:
|
||||
typedef AutomationPattern::timeMap timeMap;
|
||||
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void keyPressEvent(QKeyEvent * ke);
|
||||
virtual void leaveEvent(QEvent * e);
|
||||
virtual void mousePressEvent(QMouseEvent * mouseEvent);
|
||||
virtual void mouseReleaseEvent(QMouseEvent * mouseEvent);
|
||||
virtual void mouseMoveEvent(QMouseEvent * mouseEvent);
|
||||
virtual void paintEvent(QPaintEvent * pe);
|
||||
virtual void resizeEvent(QResizeEvent * re);
|
||||
virtual void wheelEvent(QWheelEvent * we);
|
||||
|
||||
float getLevel( int _y );
|
||||
int xCoordOfTick( int _tick );
|
||||
int yCoordOfLevel( float _level );
|
||||
inline void drawLevelTick( QPainter & _p, int _tick,
|
||||
float _value, bool _is_selected );
|
||||
float getLevel( int y );
|
||||
int xCoordOfTick( int tick );
|
||||
int yCoordOfLevel( float level );
|
||||
inline void drawLevelTick( QPainter & p, int tick,
|
||||
float value, bool is_selected );
|
||||
void removeSelection();
|
||||
void selectAll();
|
||||
void getSelectedValues( timeMap & _selected_values );
|
||||
void getSelectedValues(timeMap & selected_values );
|
||||
|
||||
void drawLine( int x0, float y0, int x1, float y1 );
|
||||
void disableTensionKnob();
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
void stop();
|
||||
|
||||
void horScrolled( int _new_pos );
|
||||
void verScrolled( int _new_pos );
|
||||
void horScrolled( int new_pos );
|
||||
void verScrolled( int new_pos );
|
||||
|
||||
void drawButtonToggled();
|
||||
void eraseButtonToggled();
|
||||
void selectButtonToggled();
|
||||
void moveButtonToggled();
|
||||
void flipYButtonPressed();
|
||||
void flipXButtonPressed();
|
||||
void setEditMode(AutomationEditor::EditModes mode);
|
||||
void setEditMode(int mode);
|
||||
|
||||
void discreteButtonToggled();
|
||||
void linearButtonToggled();
|
||||
void cubicHermiteButtonToggled();
|
||||
void tensionChanged();
|
||||
void setProgressionType(AutomationPattern::ProgressionTypes type);
|
||||
void setProgressionType(int type);
|
||||
void setTension();
|
||||
|
||||
void copySelectedValues();
|
||||
void cutSelectedValues();
|
||||
void pasteValues();
|
||||
void deleteSelectedValues();
|
||||
|
||||
void updatePosition( const MidiTime & _t );
|
||||
void updatePosition( const MidiTime & t );
|
||||
|
||||
void zoomingXChanged();
|
||||
void zoomingYChanged();
|
||||
|
||||
/// Updates the pattern's quantization using the current user selected value.
|
||||
void setQuantization();
|
||||
|
||||
private:
|
||||
|
||||
enum editModes
|
||||
{
|
||||
DRAW,
|
||||
ERASE,
|
||||
SELECT,
|
||||
MOVE
|
||||
} ;
|
||||
|
||||
enum actions
|
||||
enum Actions
|
||||
{
|
||||
NONE,
|
||||
MOVE_VALUE,
|
||||
@@ -168,11 +159,8 @@ private:
|
||||
} ;
|
||||
|
||||
// some constants...
|
||||
static const int INITIAL_WIDTH = 860;
|
||||
static const int INITIAL_HEIGHT = 480;
|
||||
|
||||
static const int SCROLLBAR_SIZE = 16;
|
||||
static const int TOP_MARGIN = 48;
|
||||
static const int TOP_MARGIN = 16;
|
||||
|
||||
static const int DEFAULT_Y_DELTA = 6;
|
||||
static const int DEFAULT_STEPS_PER_TACT = 16;
|
||||
@@ -184,7 +172,6 @@ private:
|
||||
AutomationEditor( const AutomationEditor & );
|
||||
virtual ~AutomationEditor();
|
||||
|
||||
|
||||
static QPixmap * s_toolDraw;
|
||||
static QPixmap * s_toolErase;
|
||||
static QPixmap * s_toolSelect;
|
||||
@@ -192,37 +179,12 @@ private:
|
||||
static QPixmap * s_toolYFlip;
|
||||
static QPixmap * s_toolXFlip;
|
||||
|
||||
|
||||
QWidget * m_toolBar;
|
||||
|
||||
ToolButton * m_playButton;
|
||||
ToolButton * m_stopButton;
|
||||
|
||||
ToolButton * m_drawButton;
|
||||
ToolButton * m_eraseButton;
|
||||
ToolButton * m_selectButton;
|
||||
ToolButton * m_moveButton;
|
||||
ToolButton * m_flipYButton;
|
||||
ToolButton * m_flipXButton;
|
||||
|
||||
ToolButton * m_discreteButton;
|
||||
ToolButton * m_linearButton;
|
||||
ToolButton * m_cubicHermiteButton;
|
||||
Knob * m_tensionKnob;
|
||||
FloatModel * m_tensionModel;
|
||||
|
||||
ToolButton * m_cutButton;
|
||||
ToolButton * m_copyButton;
|
||||
ToolButton * m_pasteButton;
|
||||
|
||||
ComboBox * m_zoomingXComboBox;
|
||||
ComboBox * m_zoomingYComboBox;
|
||||
ComboBox * m_quantizeComboBox;
|
||||
|
||||
ComboBoxModel m_zoomingXModel;
|
||||
ComboBoxModel m_zoomingYModel;
|
||||
ComboBoxModel m_quantizeModel;
|
||||
|
||||
FloatModel * m_tensionModel;
|
||||
|
||||
QMutex m_patternMutex;
|
||||
AutomationPattern * m_pattern;
|
||||
float m_minLevel;
|
||||
@@ -239,7 +201,7 @@ private:
|
||||
|
||||
MidiTime m_currentPosition;
|
||||
|
||||
actions m_action;
|
||||
Actions m_action;
|
||||
|
||||
tick_t m_selectStartTick;
|
||||
tick_t m_selectedTick;
|
||||
@@ -261,13 +223,13 @@ private:
|
||||
timeMap m_selValuesForMove;
|
||||
|
||||
|
||||
editModes m_editMode;
|
||||
EditModes m_editMode;
|
||||
|
||||
|
||||
Timeline * m_timeLine;
|
||||
TimeLineWidget * m_timeLine;
|
||||
bool m_scrollBack;
|
||||
|
||||
void drawCross( QPainter & _p );
|
||||
void drawCross(QPainter & p );
|
||||
void drawAutomationPoint( QPainter & p, timeMap::iterator it );
|
||||
bool inBBEditor();
|
||||
|
||||
@@ -276,14 +238,62 @@ private:
|
||||
QColor m_vertexColor;
|
||||
QBrush m_scaleColor;
|
||||
|
||||
friend class Engine;
|
||||
//friend class Engine;
|
||||
friend class AutomationEditorWindow;
|
||||
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
void positionChanged( const MidiTime & );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class AutomationEditorWindow : public Editor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
static const int INITIAL_WIDTH = 860;
|
||||
static const int INITIAL_HEIGHT = 480;
|
||||
public:
|
||||
AutomationEditorWindow();
|
||||
~AutomationEditorWindow();
|
||||
|
||||
void setCurrentPattern(AutomationPattern* pattern);
|
||||
const AutomationPattern* currentPattern();
|
||||
|
||||
void open(AutomationPattern* pattern);
|
||||
|
||||
AutomationEditor* m_editor;
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
public slots:
|
||||
void clearCurrentPattern();
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
QAction* m_discreteAction;
|
||||
QAction* m_linearAction;
|
||||
QAction* m_cubicHermiteAction;
|
||||
|
||||
QAction* m_flipYAction;
|
||||
QAction* m_flipXAction;
|
||||
|
||||
Knob * m_tensionKnob;
|
||||
|
||||
ComboBox * m_zoomingXComboBox;
|
||||
ComboBox * m_zoomingYComboBox;
|
||||
ComboBox * m_quantizeComboBox;
|
||||
|
||||
friend class Engine;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -136,15 +136,8 @@ public:
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
static inline const QString classNodeName()
|
||||
{
|
||||
return "automationpattern";
|
||||
}
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return classNodeName();
|
||||
}
|
||||
static const QString classNodeName() { return "automationpattern"; }
|
||||
QString nodeName() const { return classNodeName(); }
|
||||
|
||||
void processMidiTime( const MidiTime & _time );
|
||||
|
||||
@@ -156,21 +149,17 @@ public:
|
||||
static AutomationPattern * globalAutomationPattern( AutomatableModel * _m );
|
||||
static void resolveAllIDs();
|
||||
|
||||
bool isRecording() const
|
||||
{
|
||||
return m_isRecording;
|
||||
}
|
||||
|
||||
void setRecording( const bool b )
|
||||
{
|
||||
m_isRecording = b;
|
||||
}
|
||||
bool isRecording() const { return m_isRecording; }
|
||||
void setRecording( const bool b ) { m_isRecording = b; }
|
||||
|
||||
static int quantization() { return s_quantization; }
|
||||
static void setQuantization(int q) { s_quantization = q; }
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void openInAutomationEditor();
|
||||
void objectDestroyed( jo_id_t );
|
||||
void flipY( int min, int max );
|
||||
void flipY();
|
||||
void flipX( int length = -1 );
|
||||
|
||||
private:
|
||||
@@ -194,6 +183,8 @@ private:
|
||||
bool m_isRecording;
|
||||
float m_lastRecordedValue;
|
||||
|
||||
static int s_quantization;
|
||||
|
||||
static const float DEFAULT_MIN_VALUE;
|
||||
static const float DEFAULT_MAX_VALUE;
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
virtual ~AutomationPatternView();
|
||||
|
||||
public slots:
|
||||
/// Opens this view's pattern in the global automation editor
|
||||
void openInAutomationEditor();
|
||||
virtual void update();
|
||||
|
||||
|
||||
@@ -56,7 +58,7 @@ protected slots:
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent * me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
|
||||
@@ -26,56 +26,72 @@
|
||||
#ifndef BB_EDITOR_H
|
||||
#define BB_EDITOR_H
|
||||
|
||||
#include "Editor.h"
|
||||
#include "TrackContainerView.h"
|
||||
|
||||
|
||||
class BBTrackContainer;
|
||||
class ComboBox;
|
||||
class ToolButton;
|
||||
|
||||
class BBTrackContainerView;
|
||||
|
||||
class BBEditor : public TrackContainerView
|
||||
class BBEditor : public Editor
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BBEditor( BBTrackContainer * _tc );
|
||||
virtual ~BBEditor();
|
||||
~BBEditor();
|
||||
|
||||
virtual inline bool fixedTCOs() const
|
||||
{
|
||||
return( true );
|
||||
QSize sizeHint() const;
|
||||
|
||||
const BBTrackContainerView* trackContainerView() const {
|
||||
return m_trackContainerView;
|
||||
}
|
||||
BBTrackContainerView* trackContainerView() {
|
||||
return m_trackContainerView;
|
||||
}
|
||||
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
|
||||
void removeBBView( int _bb );
|
||||
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
void removeBBView( int bb );
|
||||
|
||||
public slots:
|
||||
void play();
|
||||
void stop();
|
||||
void updatePosition();
|
||||
void addAutomationTrack();
|
||||
void addSteps();
|
||||
void removeSteps();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
|
||||
BBTrackContainer * m_bbtc;
|
||||
QWidget * m_toolBar;
|
||||
|
||||
ToolButton * m_playButton;
|
||||
ToolButton * m_stopButton;
|
||||
|
||||
BBTrackContainerView* m_trackContainerView;
|
||||
ComboBox * m_bbComboBox;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class BBTrackContainerView : public TrackContainerView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BBTrackContainerView(BBTrackContainer* tc);
|
||||
|
||||
bool fixedTCOs() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void removeBBView(int bb);
|
||||
|
||||
public slots:
|
||||
void addSteps();
|
||||
void removeSteps();
|
||||
void addAutomationTrack();
|
||||
|
||||
protected slots:
|
||||
virtual void dropEvent(QDropEvent * de );
|
||||
void updatePosition();
|
||||
|
||||
private:
|
||||
BBTrackContainer * m_bbtc;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -398,7 +398,6 @@ public:
|
||||
out *= 0.25f;
|
||||
m_last[_chnl] = _in0;
|
||||
return out;
|
||||
break;
|
||||
}
|
||||
|
||||
// 4-pole state-variant lowpass filter, adapted from Nekobee source code
|
||||
@@ -425,7 +424,6 @@ public:
|
||||
return m_type == Lowpass_SV
|
||||
? m_delay4[_chnl]
|
||||
: m_delay3[_chnl];
|
||||
break;
|
||||
}
|
||||
|
||||
case Highpass_SV:
|
||||
@@ -440,7 +438,6 @@ public:
|
||||
}
|
||||
|
||||
return hp;
|
||||
break;
|
||||
}
|
||||
|
||||
case Notch_SV:
|
||||
@@ -460,7 +457,6 @@ public:
|
||||
|
||||
/* mix filter output into output buffer */
|
||||
return m_delay4[_chnl] + hp1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -492,7 +488,6 @@ public:
|
||||
m_rcbp0[_chnl] = bp;
|
||||
}
|
||||
return lp;
|
||||
break;
|
||||
}
|
||||
case Highpass_RC12:
|
||||
case Bandpass_RC12:
|
||||
@@ -514,7 +509,6 @@ public:
|
||||
m_rcbp0[_chnl] = bp;
|
||||
}
|
||||
return m_type == Highpass_RC12 ? hp : bp;
|
||||
break;
|
||||
}
|
||||
|
||||
case Lowpass_RC24:
|
||||
@@ -559,7 +553,6 @@ public:
|
||||
m_rchp1[_chnl] = hp;
|
||||
}
|
||||
return lp;
|
||||
break;
|
||||
}
|
||||
case Highpass_RC24:
|
||||
case Bandpass_RC24:
|
||||
@@ -599,7 +592,6 @@ public:
|
||||
m_rcbp1[_chnl] = bp;
|
||||
}
|
||||
return m_type == Highpass_RC24 ? hp : bp;
|
||||
break;
|
||||
}
|
||||
|
||||
case Formantfilter:
|
||||
@@ -697,7 +689,6 @@ public:
|
||||
out += bp;
|
||||
}
|
||||
return m_type == FastFormant ? out * 2.0f : out * 0.5f;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
@@ -53,6 +53,10 @@ public:
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
public slots:
|
||||
void selectNext();
|
||||
void selectPrevious();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent* event );
|
||||
|
||||
94
include/Editor.h
Normal file
94
include/Editor.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Editor.h - declaration of Editor class
|
||||
*
|
||||
* 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 EDITOR_COMMON_H
|
||||
#define EDITOR_COMMON_H
|
||||
|
||||
#include <QAction>
|
||||
#include <QMainWindow>
|
||||
#include <QToolBar>
|
||||
|
||||
#include "TimeLineWidget.h"
|
||||
#include "ToolButton.h"
|
||||
|
||||
class DropToolBar;
|
||||
|
||||
/// \brief Superclass for editors with a toolbar.
|
||||
///
|
||||
/// Those editors include the Song Editor, the Automation Editor, B&B Editor,
|
||||
/// and the Piano Roll.
|
||||
class Editor : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
void setPauseIcon(bool displayPauseIcon=true);
|
||||
|
||||
protected slots:
|
||||
virtual void play() {}
|
||||
virtual void record() {}
|
||||
virtual void recordAccompany() {}
|
||||
virtual void stop() {}
|
||||
|
||||
private slots:
|
||||
/// Called by pressing the space key. Plays or stops.
|
||||
void togglePlayStop();
|
||||
|
||||
signals:
|
||||
|
||||
protected:
|
||||
/// \brief Constructor.
|
||||
///
|
||||
/// \param record If set true, the editor's toolbar will contain record
|
||||
/// buttons in addition to the play and stop buttons.
|
||||
Editor(bool record = false);
|
||||
virtual ~Editor();
|
||||
|
||||
|
||||
DropToolBar* m_toolBar;
|
||||
|
||||
QAction* m_playAction;
|
||||
QAction* m_recordAction;
|
||||
QAction* m_recordAccompanyAction;
|
||||
QAction* m_stopAction;
|
||||
};
|
||||
|
||||
|
||||
/// Small helper class: A QToolBar that accepts and exposes drop events as signals
|
||||
class DropToolBar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DropToolBar(QWidget* parent=0);
|
||||
|
||||
signals:
|
||||
void dragEntered(QDragEnterEvent* event);
|
||||
void dropped(QDropEvent* event);
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent* event);
|
||||
void dropEvent(QDropEvent* event);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class AutomationEditor;
|
||||
class AutomationEditorWindow;
|
||||
class BBEditor;
|
||||
class BBTrackContainer;
|
||||
class DummyTrackContainer;
|
||||
@@ -42,10 +42,10 @@ class FxMixerView;
|
||||
class ProjectJournal;
|
||||
class MainWindow;
|
||||
class Mixer;
|
||||
class PianoRoll;
|
||||
class PianoRollWindow;
|
||||
class ProjectNotes;
|
||||
class Song;
|
||||
class SongEditor;
|
||||
class SongEditorWindow;
|
||||
class Ladspa2LMMS;
|
||||
class ControllerRackView;
|
||||
|
||||
@@ -53,23 +53,10 @@ class ControllerRackView;
|
||||
class EXPORT Engine
|
||||
{
|
||||
public:
|
||||
static void init( const bool _has_gui = true );
|
||||
static void init();
|
||||
static void destroy();
|
||||
|
||||
static bool hasGUI()
|
||||
{
|
||||
return s_hasGUI;
|
||||
}
|
||||
|
||||
static void setSuppressMessages( bool _on )
|
||||
{
|
||||
s_suppressMessages = _on;
|
||||
}
|
||||
|
||||
static bool suppressMessages()
|
||||
{
|
||||
return !s_hasGUI || s_suppressMessages;
|
||||
}
|
||||
static bool hasGUI();
|
||||
|
||||
// core
|
||||
static Mixer *mixer()
|
||||
@@ -97,42 +84,6 @@ public:
|
||||
return s_projectJournal;
|
||||
}
|
||||
|
||||
// GUI
|
||||
static MainWindow * mainWindow()
|
||||
{
|
||||
return s_mainWindow;
|
||||
}
|
||||
|
||||
static FxMixerView * fxMixerView()
|
||||
{
|
||||
return s_fxMixerView;
|
||||
}
|
||||
|
||||
static SongEditor* songEditor()
|
||||
{
|
||||
return s_songEditor;
|
||||
}
|
||||
|
||||
static BBEditor * getBBEditor()
|
||||
{
|
||||
return s_bbEditor;
|
||||
}
|
||||
|
||||
static PianoRoll* pianoRoll()
|
||||
{
|
||||
return s_pianoRoll;
|
||||
}
|
||||
|
||||
static ProjectNotes * getProjectNotes()
|
||||
{
|
||||
return s_projectNotes;
|
||||
}
|
||||
|
||||
static AutomationEditor * automationEditor()
|
||||
{
|
||||
return s_automationEditor;
|
||||
}
|
||||
|
||||
static Ladspa2LMMS * getLADSPAManager()
|
||||
{
|
||||
return s_ladspaManager;
|
||||
@@ -143,11 +94,6 @@ public:
|
||||
return s_dummyTC;
|
||||
}
|
||||
|
||||
static ControllerRackView * getControllerRackView()
|
||||
{
|
||||
return s_controllerRackView;
|
||||
}
|
||||
|
||||
static float framesPerTick()
|
||||
{
|
||||
return s_framesPerTick;
|
||||
@@ -171,8 +117,6 @@ private:
|
||||
delete tmp;
|
||||
}
|
||||
|
||||
static bool s_hasGUI;
|
||||
static bool s_suppressMessages;
|
||||
static float s_framesPerTick;
|
||||
|
||||
// core
|
||||
@@ -182,23 +126,15 @@ 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 SongEditor* s_songEditor;
|
||||
static AutomationEditor * s_automationEditor;
|
||||
static BBEditor * s_bbEditor;
|
||||
static PianoRoll* s_pianoRoll;
|
||||
static ProjectNotes * s_projectNotes;
|
||||
static Ladspa2LMMS * s_ladspaManager;
|
||||
|
||||
static QMap<QString, QString> s_pluginFileHandling;
|
||||
|
||||
static void initPluginFileHandling();
|
||||
|
||||
} ;
|
||||
friend class GuiApplication;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class FileBrowser : public SideBarWidget
|
||||
public:
|
||||
FileBrowser( const QString & directories, const QString & filter,
|
||||
const QString & title, const QPixmap & pm,
|
||||
QWidget * parent, bool dirs_as_items = false );
|
||||
QWidget * parent, bool dirs_as_items = false, bool recurse = false );
|
||||
virtual ~FileBrowser();
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ private:
|
||||
QString m_filter;
|
||||
|
||||
bool m_dirsAsItems;
|
||||
bool m_recurse;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -161,6 +162,8 @@ private:
|
||||
QStringList m_directories;
|
||||
QString m_filter;
|
||||
|
||||
int m_dirCount;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -194,6 +194,11 @@ public:
|
||||
return m_fxChannels.size();
|
||||
}
|
||||
|
||||
inline QVector<FxChannel *> fxChannels() const
|
||||
{
|
||||
return m_fxChannels;
|
||||
}
|
||||
|
||||
FxRouteVector m_fxRoutes;
|
||||
|
||||
private:
|
||||
|
||||
@@ -103,12 +103,14 @@ public:
|
||||
// useful for loading projects
|
||||
void refreshDisplay();
|
||||
|
||||
public slots:
|
||||
int addNewChannel();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
private slots:
|
||||
void updateFaders();
|
||||
void addNewChannel();
|
||||
void toggledSolo();
|
||||
|
||||
private:
|
||||
|
||||
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
|
||||
@@ -34,6 +34,8 @@
|
||||
class GroupBox;
|
||||
class LcdSpinBox;
|
||||
class QToolButton;
|
||||
class LedCheckBox;
|
||||
class InstrumentTrack;
|
||||
|
||||
|
||||
class InstrumentMidiIOView : public QWidget, public ModelView
|
||||
@@ -63,4 +65,17 @@ private:
|
||||
|
||||
} ;
|
||||
|
||||
class InstrumentMiscView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InstrumentMiscView( InstrumentTrack *it, QWidget* parent );
|
||||
~InstrumentMiscView();
|
||||
|
||||
private:
|
||||
|
||||
GroupBox * m_pitchGroupBox;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,7 @@ class FadeButton;
|
||||
class Instrument;
|
||||
class InstrumentTrackWindow;
|
||||
class InstrumentMidiIOView;
|
||||
class InstrumentMiscView;
|
||||
class Knob;
|
||||
class LcdSpinBox;
|
||||
class midiPortMenu;
|
||||
@@ -56,6 +57,7 @@ class DataFile;
|
||||
class PluginView;
|
||||
class TabWidget;
|
||||
class TrackLabelButton;
|
||||
class LedCheckBox;
|
||||
|
||||
|
||||
class EXPORT InstrumentTrack : public Track, public MidiEventProcessor
|
||||
@@ -250,6 +252,7 @@ private:
|
||||
FloatModel m_pitchModel;
|
||||
IntModel m_pitchRangeModel;
|
||||
IntModel m_effectChannelModel;
|
||||
BoolModel m_useMasterPitchModel;
|
||||
|
||||
FadeButton *m_fb;
|
||||
|
||||
@@ -266,6 +269,7 @@ private:
|
||||
friend class InstrumentTrackWindow;
|
||||
friend class NotePlayHandle;
|
||||
friend class FlpImport;
|
||||
friend class InstrumentMiscView;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -416,6 +420,7 @@ private:
|
||||
LcdSpinBox * m_effectChannelNumber;
|
||||
|
||||
|
||||
|
||||
// tab-widget with all children
|
||||
TabWidget * m_tabWidget;
|
||||
PluginView * m_instrumentView;
|
||||
@@ -424,6 +429,8 @@ private:
|
||||
InstrumentFunctionArpeggioView* m_arpeggioView;
|
||||
InstrumentMidiIOView * m_midiView;
|
||||
EffectRackView * m_effectView;
|
||||
InstrumentMiscView *m_miscView;
|
||||
|
||||
|
||||
// test-piano at the bottom of every instrument-settings-window
|
||||
PianoView * m_pianoView;
|
||||
|
||||
@@ -95,12 +95,6 @@ public:
|
||||
static void saveWidgetState( QWidget * _w, QDomElement & _de );
|
||||
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
|
||||
|
||||
void collectErrors( const QList<QString>* errors );
|
||||
void collectError( const QString error );
|
||||
void clearErrors();
|
||||
void showErrors( const QString reason );
|
||||
|
||||
|
||||
public slots:
|
||||
void resetWindowTitle();
|
||||
|
||||
@@ -176,9 +170,7 @@ private:
|
||||
QBasicTimer m_updateTimer;
|
||||
QTimer m_autoSaveTimer;
|
||||
|
||||
QList<QString>* m_errors;
|
||||
|
||||
friend class Engine;
|
||||
friend class GuiApplication;
|
||||
|
||||
|
||||
private slots:
|
||||
@@ -197,4 +189,3 @@ signals:
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -137,7 +137,8 @@ public:
|
||||
|
||||
static int stepsPerTact()
|
||||
{
|
||||
return qMax( 1, ticksPerTact() / DefaultBeatsPerTact );
|
||||
int steps = ticksPerTact() / DefaultBeatsPerTact;
|
||||
return qMax( 1, steps );
|
||||
}
|
||||
|
||||
static void setTicksPerTact( tick_t _tpt )
|
||||
|
||||
@@ -91,9 +91,10 @@ public:
|
||||
virtual ~Note();
|
||||
|
||||
// used by GUI
|
||||
inline void setSelected( const bool selected ){ m_selected = selected; }
|
||||
inline void setOldKey( const int oldKey ){ m_oldKey = oldKey; }
|
||||
inline void setOldPos( const MidiTime & oldPos ){ m_oldPos = oldPos; }
|
||||
inline void setSelected( const bool selected ) { m_selected = selected; }
|
||||
inline void setOldKey( const int oldKey ) { m_oldKey = oldKey; }
|
||||
inline void setOldPos( const MidiTime & oldPos ) { m_oldPos = oldPos; }
|
||||
|
||||
inline void setOldLength( const MidiTime & oldLength )
|
||||
{
|
||||
m_oldLength = oldLength;
|
||||
@@ -202,11 +203,10 @@ public:
|
||||
{
|
||||
return m_detuning;
|
||||
}
|
||||
|
||||
void editDetuningPattern();
|
||||
|
||||
bool hasDetuningInfo() const;
|
||||
|
||||
void createDetuning();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void saveSettings( QDomDocument & doc, QDomElement & parent );
|
||||
@@ -227,10 +227,7 @@ private:
|
||||
MidiTime m_length;
|
||||
MidiTime m_pos;
|
||||
DetuningHelper * m_detuning;
|
||||
|
||||
void createDetuning();
|
||||
|
||||
} ;
|
||||
};
|
||||
|
||||
|
||||
typedef QVector<Note *> NoteVector;
|
||||
|
||||
@@ -94,6 +94,10 @@ public:
|
||||
void checkType();
|
||||
|
||||
|
||||
// next/previous track based on position in the containing track
|
||||
Pattern * previousPattern() const;
|
||||
Pattern * nextPattern() const;
|
||||
|
||||
// settings-management
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
@@ -137,8 +141,10 @@ private:
|
||||
NoteVector m_notes;
|
||||
int m_steps;
|
||||
|
||||
Pattern * adjacentPatternByOffset(int offset) const;
|
||||
|
||||
friend class PatternView;
|
||||
friend class BBEditor;
|
||||
friend class BBTrackContainerView;
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QWidget>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "Editor.h"
|
||||
#include "ComboBoxModel.h"
|
||||
#include "SerializingObject.h"
|
||||
#include "Note.h"
|
||||
@@ -47,10 +48,9 @@ class QSignalMapper;
|
||||
class ComboBox;
|
||||
class NotePlayHandle;
|
||||
class Pattern;
|
||||
class Timeline;
|
||||
class ToolButton;
|
||||
class TimeLineWidget;
|
||||
|
||||
class PianoRoll : public QWidget, public SerializingObject
|
||||
class PianoRoll : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY( QColor gridColor READ gridColor WRITE setGridColor )
|
||||
@@ -58,6 +58,14 @@ class PianoRoll : public QWidget, public SerializingObject
|
||||
Q_PROPERTY( QColor noteColor READ noteColor WRITE setNoteColor )
|
||||
Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor )
|
||||
public:
|
||||
enum EditModes
|
||||
{
|
||||
ModeDraw,
|
||||
ModeErase,
|
||||
ModeSelect,
|
||||
ModeEditDetuning,
|
||||
};
|
||||
|
||||
/*! \brief Resets settings to default when e.g. creating a new project */
|
||||
void reset();
|
||||
|
||||
@@ -86,47 +94,36 @@ public:
|
||||
Song::PlayModes desiredPlayModeForAccompany() const;
|
||||
|
||||
int quantization() const;
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
void setPauseIcon( bool pause );
|
||||
|
||||
// qproperty acces functions
|
||||
QColor gridColor() const;
|
||||
void setGridColor( const QColor & _c );
|
||||
void setGridColor( const QColor & c );
|
||||
QColor noteModeColor() const;
|
||||
void setNoteModeColor( const QColor & _c );
|
||||
void setNoteModeColor( const QColor & c );
|
||||
QColor noteColor() const;
|
||||
void setNoteColor( const QColor & _c );
|
||||
void setNoteColor( const QColor & c );
|
||||
QColor barColor() const;
|
||||
void setBarColor( const QColor & _c );
|
||||
void setBarColor( const QColor & c );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void keyReleaseEvent( QKeyEvent * _ke );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void keyPressEvent( QKeyEvent * ke );
|
||||
virtual void keyReleaseEvent( QKeyEvent * ke );
|
||||
virtual void leaveEvent( QEvent * e );
|
||||
virtual void mousePressEvent( QMouseEvent * me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * me );
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
virtual void resizeEvent( QResizeEvent * re );
|
||||
virtual void wheelEvent( QWheelEvent * we );
|
||||
|
||||
int getKey( int _y ) const;
|
||||
static inline void drawNoteRect( QPainter & _p, int _x, int _y,
|
||||
int _width, Note * _n, const QColor & noteCol );
|
||||
int getKey( int y ) const;
|
||||
static inline void drawNoteRect( QPainter & p, int x, int y,
|
||||
int width, Note * n, const QColor & noteCol );
|
||||
void removeSelection();
|
||||
void selectAll();
|
||||
void getSelectedNotes( NoteVector & _selected_notes );
|
||||
void getSelectedNotes( NoteVector & selected_notes );
|
||||
|
||||
// for entering values with dblclick in the vol/pan bars
|
||||
void enterValue( NoteVector* nv );
|
||||
@@ -137,24 +134,21 @@ protected slots:
|
||||
void recordAccompany();
|
||||
void stop();
|
||||
|
||||
void startRecordNote( const Note & _n );
|
||||
void finishRecordNote( const Note & _n );
|
||||
void startRecordNote( const Note & n );
|
||||
void finishRecordNote( const Note & n );
|
||||
|
||||
void horScrolled( int _new_pos );
|
||||
void verScrolled( int _new_pos );
|
||||
void horScrolled( int new_pos );
|
||||
void verScrolled( int new_pos );
|
||||
|
||||
void drawButtonToggled();
|
||||
void eraseButtonToggled();
|
||||
void selectButtonToggled();
|
||||
void detuneButtonToggled();
|
||||
void setEditMode(int mode);
|
||||
|
||||
void copySelectedNotes();
|
||||
void cutSelectedNotes();
|
||||
void pasteNotes();
|
||||
void deleteSelectedNotes();
|
||||
|
||||
void updatePosition( const MidiTime & _t );
|
||||
void updatePositionAccompany( const MidiTime & _t );
|
||||
void updatePosition(const MidiTime & t );
|
||||
void updatePositionAccompany(const MidiTime & t );
|
||||
|
||||
void zoomingChanged();
|
||||
void quantizeChanged();
|
||||
@@ -174,15 +168,7 @@ signals:
|
||||
|
||||
|
||||
private:
|
||||
enum editModes
|
||||
{
|
||||
ModeDraw,
|
||||
ModeErase,
|
||||
ModeSelect,
|
||||
ModeEditDetuning,
|
||||
};
|
||||
|
||||
enum actions
|
||||
enum Actions
|
||||
{
|
||||
ActionNone,
|
||||
ActionMoveNote,
|
||||
@@ -192,14 +178,14 @@ private:
|
||||
ActionResizeNoteEditArea
|
||||
};
|
||||
|
||||
enum noteEditMode
|
||||
enum NoteEditMode
|
||||
{
|
||||
NoteEditVolume,
|
||||
NoteEditPanning,
|
||||
NoteEditCount // make sure this one is always last
|
||||
};
|
||||
|
||||
enum semiToneMarkerAction
|
||||
enum SemiToneMarkerAction
|
||||
{
|
||||
stmaUnmarkAll,
|
||||
stmaMarkCurrentSemiTone,
|
||||
@@ -224,7 +210,7 @@ private:
|
||||
PianoRoll( const PianoRoll & );
|
||||
virtual ~PianoRoll();
|
||||
|
||||
void autoScroll( const MidiTime & _t );
|
||||
void autoScroll(const MidiTime & t );
|
||||
|
||||
MidiTime newNoteLen() const;
|
||||
|
||||
@@ -234,7 +220,7 @@ private:
|
||||
int selectionCount() const;
|
||||
void testPlayNote( Note * n );
|
||||
void testPlayKey( int _key, int _vol, int _pan );
|
||||
void pauseTestNotes( bool _pause = true );
|
||||
void pauseTestNotes(bool pause = true );
|
||||
|
||||
inline int noteEditTop() const;
|
||||
inline int keyAreaBottom() const;
|
||||
@@ -264,28 +250,6 @@ private:
|
||||
|
||||
static TextFloat * s_textFloat;
|
||||
|
||||
QWidget * m_toolBar;
|
||||
|
||||
ToolButton * m_playButton;
|
||||
ToolButton * m_recordButton;
|
||||
ToolButton * m_recordAccompanyButton;
|
||||
ToolButton * m_stopButton;
|
||||
|
||||
ToolButton * m_drawButton;
|
||||
ToolButton * m_eraseButton;
|
||||
ToolButton * m_selectButton;
|
||||
ToolButton * m_detuneButton;
|
||||
|
||||
ToolButton * m_cutButton;
|
||||
ToolButton * m_copyButton;
|
||||
ToolButton * m_pasteButton;
|
||||
|
||||
ComboBox * m_zoomingComboBox;
|
||||
ComboBox * m_quantizeComboBox;
|
||||
ComboBox * m_noteLenComboBox;
|
||||
ComboBox * m_scaleComboBox;
|
||||
ComboBox * m_chordComboBox;
|
||||
|
||||
ComboBoxModel m_zoomingModel;
|
||||
ComboBoxModel m_quantizeModel;
|
||||
ComboBoxModel m_noteLenModel;
|
||||
@@ -293,7 +257,6 @@ private:
|
||||
ComboBoxModel m_chordModel;
|
||||
|
||||
|
||||
|
||||
Pattern* m_pattern;
|
||||
QScrollBar * m_leftRightScroll;
|
||||
QScrollBar * m_topBottomScroll;
|
||||
@@ -303,8 +266,8 @@ private:
|
||||
QList<Note> m_recordingNotes;
|
||||
|
||||
Note * m_currentNote;
|
||||
actions m_action;
|
||||
noteEditMode m_noteEditMode;
|
||||
Actions m_action;
|
||||
NoteEditMode m_noteEditMode;
|
||||
|
||||
int m_selectStartTick;
|
||||
int m_selectedTick;
|
||||
@@ -341,19 +304,19 @@ private:
|
||||
volume_t m_lastNoteVolume;
|
||||
panning_t m_lastNotePanning;
|
||||
|
||||
int m_startKey; // first key when drawing
|
||||
int m_startKey; // first key when drawing
|
||||
int m_lastKey;
|
||||
|
||||
editModes m_editMode;
|
||||
editModes m_ctrlMode; // mode they were in before they hit ctrl
|
||||
EditModes m_editMode;
|
||||
EditModes m_ctrlMode; // mode they were in before they hit ctrl
|
||||
|
||||
bool m_mouseDownLeft; //true if left click is being held down
|
||||
bool m_mouseDownRight; //true if right click is being held down
|
||||
|
||||
Timeline * m_timeLine;
|
||||
TimeLineWidget * m_timeLine;
|
||||
bool m_scrollBack;
|
||||
|
||||
void copy_to_clipboard( const NoteVector & _notes ) const;
|
||||
void copy_to_clipboard(const NoteVector & notes ) const;
|
||||
|
||||
void drawDetuningInfo( QPainter & _p, Note * _n, int _x, int _y );
|
||||
bool mouseOverNote();
|
||||
@@ -367,6 +330,7 @@ private:
|
||||
bool m_startedWithShift;
|
||||
|
||||
friend class Engine;
|
||||
friend class PianoRollWindow;
|
||||
|
||||
// qproperty fields
|
||||
QColor m_gridColor;
|
||||
@@ -380,5 +344,54 @@ signals:
|
||||
} ;
|
||||
|
||||
|
||||
class PianoRollWindow : public Editor, SerializingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PianoRollWindow();
|
||||
|
||||
const Pattern* currentPattern() const;
|
||||
void setCurrentPattern(Pattern* pattern);
|
||||
|
||||
int quantization() const;
|
||||
|
||||
void play();
|
||||
void stop();
|
||||
void record();
|
||||
void recordAccompany();
|
||||
void stopRecording();
|
||||
|
||||
bool isRecording() const;
|
||||
|
||||
/*! \brief Resets settings to default when e.g. creating a new project */
|
||||
void reset();
|
||||
|
||||
using SerializingObject::saveState;
|
||||
using SerializingObject::restoreState;
|
||||
virtual void saveSettings(QDomDocument & doc, QDomElement & de );
|
||||
virtual void loadSettings( const QDomElement & de );
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
|
||||
private:
|
||||
PianoRoll* m_editor;
|
||||
|
||||
ComboBox * m_zoomingComboBox;
|
||||
ComboBox * m_quantizeComboBox;
|
||||
ComboBox * m_noteLenComboBox;
|
||||
ComboBox * m_scaleComboBox;
|
||||
ComboBox * m_chordComboBox;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ public:
|
||||
m_type = p.m_type;
|
||||
m_offset = p.m_offset;
|
||||
m_affinity = p.m_affinity;
|
||||
m_usesBuffer = p.m_usesBuffer;
|
||||
m_audioPort = p.m_audioPort;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* ProjectVersion.h - version compared in import upgrades
|
||||
*
|
||||
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2015 Tres Finocchiaro <tres.finocchiaro/at/gmail.com>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
@@ -28,29 +29,46 @@
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
enum CompareType { Major, Minor, Release, Build };
|
||||
|
||||
class ProjectVersion : public QString
|
||||
|
||||
/*! \brief Version number parsing and comparison
|
||||
*
|
||||
* Parses and compares version information. i.e. "1.0.3" < "1.0.10"
|
||||
*/
|
||||
class ProjectVersion
|
||||
{
|
||||
public:
|
||||
ProjectVersion( const QString & s ) :
|
||||
QString( s )
|
||||
{
|
||||
}
|
||||
ProjectVersion( QString version, CompareType c = CompareType::Build );
|
||||
ProjectVersion( const char * version, CompareType c = CompareType::Build );
|
||||
|
||||
static int compare( const ProjectVersion & v1,
|
||||
const ProjectVersion & v2 );
|
||||
int getMajor() const { return m_major; }
|
||||
int getMinor() const { return m_minor; }
|
||||
int getRelease() const { return m_release; }
|
||||
QString getBuild() const { return m_build; }
|
||||
CompareType getCompareType() const { return m_compareType; }
|
||||
ProjectVersion setCompareType(CompareType compareType) { m_compareType = compareType; return * this; }
|
||||
|
||||
static int compare(const ProjectVersion& a, const ProjectVersion& b, CompareType c);
|
||||
static int compare(ProjectVersion v1, ProjectVersion v2);
|
||||
|
||||
private:
|
||||
QString m_version;
|
||||
int m_major;
|
||||
int m_minor;
|
||||
int m_release;
|
||||
QString m_build;
|
||||
CompareType m_compareType;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
inline bool operator<( const ProjectVersion & v1, const char * str )
|
||||
{
|
||||
return ProjectVersion::compare( v1, ProjectVersion( str ) ) < 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ProjectVersion v. ProjectVersion
|
||||
*/
|
||||
inline bool operator<(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) < 0; }
|
||||
inline bool operator>(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) > 0; }
|
||||
inline bool operator<=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) <= 0; }
|
||||
inline bool operator>=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) >= 0; }
|
||||
inline bool operator==(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) == 0; }
|
||||
inline bool operator!=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) != 0; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -91,6 +91,7 @@ private slots:
|
||||
void toggleWarnAfterSetup( bool _enabled );
|
||||
void toggleDisplaydBV( bool _enabled );
|
||||
void toggleMMPZ( bool _enabled );
|
||||
void toggleDisableBackup( bool _enabled );
|
||||
void toggleHQAudioDev( bool _enabled );
|
||||
|
||||
void openWorkingDir();
|
||||
@@ -112,6 +113,8 @@ private slots:
|
||||
void toggleDisplayWaveform( bool en );
|
||||
void toggleDisableAutoquit( bool en );
|
||||
|
||||
void setLanguage( int lang );
|
||||
|
||||
|
||||
private:
|
||||
TabBar * m_tabBar;
|
||||
@@ -124,7 +127,10 @@ private:
|
||||
bool m_warnAfterSetup;
|
||||
bool m_displaydBV;
|
||||
bool m_MMPZ;
|
||||
bool m_disableBackup;
|
||||
bool m_hqAudioDev;
|
||||
QString m_lang;
|
||||
QStringList m_languages;
|
||||
|
||||
|
||||
QLineEdit * m_wdLineEdit;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class AutomationTrack;
|
||||
class Pattern;
|
||||
class Timeline;
|
||||
class TimeLineWidget;
|
||||
|
||||
|
||||
const bpm_t MinTempo = 10;
|
||||
@@ -64,6 +64,10 @@ public:
|
||||
Mode_Count
|
||||
} ;
|
||||
|
||||
void clearErrors();
|
||||
void collectError( const QString error );
|
||||
bool hasErrors();
|
||||
QString* errorSummary();
|
||||
|
||||
class PlayPos : public MidiTime
|
||||
{
|
||||
@@ -83,7 +87,7 @@ public:
|
||||
{
|
||||
return m_currentFrame;
|
||||
}
|
||||
Timeline * m_timeLine;
|
||||
TimeLineWidget * m_timeLine;
|
||||
bool m_timeLineUpdate;
|
||||
|
||||
private:
|
||||
@@ -344,6 +348,8 @@ private:
|
||||
|
||||
bool m_loadingProject;
|
||||
|
||||
QList<QString> * m_errors;
|
||||
|
||||
PlayModes m_playMode;
|
||||
PlayPos m_playPos[Mode_Count];
|
||||
tact_t m_length;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef SONG_EDITOR_H
|
||||
#define SONG_EDITOR_H
|
||||
|
||||
#include "Editor.h"
|
||||
#include "TrackContainerView.h"
|
||||
|
||||
class QLabel;
|
||||
@@ -34,12 +35,12 @@ class QScrollBar;
|
||||
|
||||
class AutomatableSlider;
|
||||
class ComboBox;
|
||||
class ComboBoxModel;
|
||||
class LcdSpinBox;
|
||||
class MeterDialog;
|
||||
class Song;
|
||||
class TextFloat;
|
||||
class Timeline;
|
||||
class ToolButton;
|
||||
class TimeLineWidget;
|
||||
|
||||
class positionLine : public QWidget
|
||||
{
|
||||
@@ -56,43 +57,46 @@ class SongEditor : public TrackContainerView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum EditMode
|
||||
{
|
||||
DrawMode,
|
||||
SelectMode
|
||||
};
|
||||
|
||||
SongEditor( Song * _song );
|
||||
virtual ~SongEditor();
|
||||
|
||||
void setPauseIcon( bool pause );
|
||||
~SongEditor();
|
||||
|
||||
void saveSettings( QDomDocument& doc, QDomElement& element );
|
||||
void loadSettings( const QDomElement& element );
|
||||
|
||||
public slots:
|
||||
void scrolled( int _new_pos );
|
||||
|
||||
void setEditMode(EditMode mode);
|
||||
void setEditModeDraw();
|
||||
void setEditModeSelect();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
private slots:
|
||||
void setHighQuality( bool );
|
||||
|
||||
void play();
|
||||
void record();
|
||||
void recordAccompany();
|
||||
void stop();
|
||||
void setMasterVolume( int _new_val );
|
||||
void showMasterVolumeFloat();
|
||||
void updateMasterVolumeFloat( int _new_val );
|
||||
void hideMasterVolumeFloat();
|
||||
|
||||
void masterVolumeChanged( int _new_val );
|
||||
void masterVolumePressed();
|
||||
void masterVolumeMoved( int _new_val );
|
||||
void masterVolumeReleased();
|
||||
void masterPitchChanged( int _new_val );
|
||||
void masterPitchPressed();
|
||||
void masterPitchMoved( int _new_val );
|
||||
void masterPitchReleased();
|
||||
void setMasterPitch( int _new_val );
|
||||
void showMasterPitchFloat();
|
||||
void updateMasterPitchFloat( int _new_val );
|
||||
void hideMasterPitchFloat();
|
||||
|
||||
void updateScrollBar( int );
|
||||
void updatePosition( const MidiTime & _t );
|
||||
|
||||
void zoomingChanged();
|
||||
|
||||
void adjustUiAfterProjectLoad();
|
||||
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
@@ -104,15 +108,9 @@ private:
|
||||
|
||||
QScrollBar * m_leftRightScroll;
|
||||
|
||||
QWidget * m_toolBar;
|
||||
|
||||
ToolButton * m_playButton;
|
||||
ToolButton * m_recordButton;
|
||||
ToolButton * m_recordAccompanyButton;
|
||||
ToolButton * m_stopButton;
|
||||
LcdSpinBox * m_tempoSpinBox;
|
||||
|
||||
Timeline * m_timeLine;
|
||||
TimeLineWidget * m_timeLine;
|
||||
|
||||
MeterDialog * m_timeSigDisplay;
|
||||
AutomatableSlider * m_masterVolumeSlider;
|
||||
@@ -121,22 +119,46 @@ private:
|
||||
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;
|
||||
|
||||
EditMode m_mode;
|
||||
|
||||
friend class SongEditorWindow;
|
||||
|
||||
} ;
|
||||
|
||||
class SongEditorWindow : public Editor
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SongEditorWindow(Song* song);
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
SongEditor* m_editor;
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
void record();
|
||||
void recordAccompany();
|
||||
void stop();
|
||||
|
||||
void adjustUiAfterProjectLoad();
|
||||
|
||||
private:
|
||||
QAction* m_addBBTrackAction;
|
||||
QAction* m_addSampleTrackAction;
|
||||
QAction* m_addAutomationTrackAction;
|
||||
|
||||
QAction* m_drawModeAction;
|
||||
QAction* m_selectModeAction;
|
||||
|
||||
ComboBox * m_zoomingComboBox;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Timeline.h - class timeLine, representing a time-line with position marker
|
||||
* TimeLineWidget.h - class timeLine, representing a time-line with position marker
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -32,11 +32,12 @@
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class QToolBar;
|
||||
class NStateButton;
|
||||
class TextFloat;
|
||||
|
||||
|
||||
class Timeline : public QWidget, public JournallingObject
|
||||
class TimeLineWidget : public QWidget, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -60,9 +61,15 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
<<<<<<< HEAD:include/Timeline.h
|
||||
Timeline( int _xoff, int _yoff, float _ppt, Song::PlayPos & _pos,
|
||||
const MidiTime & _begin, QWidget * _parent );
|
||||
virtual ~Timeline();
|
||||
=======
|
||||
TimeLineWidget( int xoff, int yoff, float ppt, Song::PlayPos & pos,
|
||||
const MidiTime & begin, QWidget * parent );
|
||||
virtual ~TimeLineWidget();
|
||||
>>>>>>> coding:include/TimeLineWidget.h
|
||||
|
||||
inline Song::PlayPos & pos()
|
||||
{
|
||||
@@ -111,7 +118,7 @@ public:
|
||||
update();
|
||||
}
|
||||
|
||||
void addToolButtons( QWidget * _tool_bar );
|
||||
void addToolButtons(QToolBar* _tool_bar );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
@@ -34,48 +34,16 @@ class ToolButton : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ToolButton( const QPixmap & _pixmap, const QString & _tooltip,
|
||||
QObject * _receiver, const char * _slot,
|
||||
QWidget * _parent );
|
||||
ToolButton(const QPixmap & _pixmap, const QString & _tooltip,
|
||||
QObject * _receiver=nullptr, const char * _slot=nullptr,
|
||||
QWidget * _parent=nullptr);
|
||||
|
||||
inline ToolButton( QWidget * _parent ) :
|
||||
QToolButton( _parent ),
|
||||
m_colorStandard( s_stdColor ),
|
||||
m_colorHighlighted( s_hlColor )
|
||||
{
|
||||
// setup colors
|
||||
leaveEvent( NULL );
|
||||
}
|
||||
inline ToolButton(QWidget * _parent) :
|
||||
QToolButton(_parent)
|
||||
{ }
|
||||
|
||||
virtual ~ToolButton();
|
||||
|
||||
inline void setStandardColor( const QColor & _color )
|
||||
{
|
||||
m_colorStandard = _color;
|
||||
}
|
||||
|
||||
inline void setHighlightedColor( const QColor & _color )
|
||||
{
|
||||
m_colorHighlighted = _color;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
virtual void enterEvent( QEvent * _ev );
|
||||
virtual void leaveEvent( QEvent * _ev );
|
||||
|
||||
|
||||
private slots:
|
||||
void toggledBool( bool _on );
|
||||
|
||||
|
||||
private:
|
||||
static const QColor s_stdColor;
|
||||
static const QColor s_hlColor;
|
||||
|
||||
QColor m_colorStandard;
|
||||
QColor m_colorHighlighted;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
#include <QWidget>
|
||||
#include <QSignalMapper>
|
||||
#include <QColor>
|
||||
#include <QMimeData>
|
||||
|
||||
@@ -67,7 +68,7 @@ const int TRACK_OP_WIDTH_COMPACT = 60;
|
||||
* Tracks can be resized by shift-dragging anywhere inside the track
|
||||
* display. This sets the minimum size in pixels for a track.
|
||||
*/
|
||||
const int MINIMAL_TRACK_HEIGHT = 8;
|
||||
const int MINIMAL_TRACK_HEIGHT = 32;
|
||||
const int DEFAULT_TRACK_HEIGHT = 32;
|
||||
|
||||
const int TCO_BORDER_WIDTH = 2;
|
||||
@@ -121,6 +122,16 @@ public:
|
||||
return m_length;
|
||||
}
|
||||
|
||||
inline void setAutoResize( const bool r )
|
||||
{
|
||||
m_autoResize = r;
|
||||
}
|
||||
|
||||
inline const bool getAutoResize() const
|
||||
{
|
||||
return m_autoResize;
|
||||
}
|
||||
|
||||
virtual void movePosition( const MidiTime & pos );
|
||||
virtual void changeLength( const MidiTime & length );
|
||||
|
||||
@@ -165,6 +176,7 @@ private:
|
||||
|
||||
BoolModel m_mutedModel;
|
||||
BoolModel m_soloModel;
|
||||
bool m_autoResize;
|
||||
|
||||
bool m_selectViewOnCreate;
|
||||
|
||||
@@ -216,7 +228,6 @@ protected:
|
||||
virtual void mouseMoveEvent( QMouseEvent * me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * me );
|
||||
|
||||
void setAutoResizeEnabled( bool e = false );
|
||||
float pixelsPerTact();
|
||||
|
||||
inline TrackView * getTrackView()
|
||||
@@ -248,7 +259,6 @@ private:
|
||||
TrackContentObject * m_tco;
|
||||
TrackView * m_trackView;
|
||||
Actions m_action;
|
||||
bool m_autoResize;
|
||||
QPoint m_initialMousePos;
|
||||
QPoint m_initialMouseGlobalPos;
|
||||
|
||||
@@ -381,6 +391,8 @@ private slots:
|
||||
void recordingOn();
|
||||
void recordingOff();
|
||||
void clearTrack();
|
||||
void assignFxLine( int channelIndex );
|
||||
void createFxLine();
|
||||
|
||||
private:
|
||||
static QPixmap * s_grip;
|
||||
|
||||
@@ -42,6 +42,11 @@ class EXPORT TrackContainer : public Model, public JournallingObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef QVector<Track *> TrackList;
|
||||
enum TrackContainerTypes
|
||||
{
|
||||
BBContainer,
|
||||
SongContainer
|
||||
} ;
|
||||
|
||||
TrackContainer();
|
||||
virtual ~TrackContainer();
|
||||
@@ -78,6 +83,16 @@ public:
|
||||
return "trackcontainer";
|
||||
}
|
||||
|
||||
inline void setType( TrackContainerTypes newType )
|
||||
{
|
||||
m_TrackContainerType = newType;
|
||||
}
|
||||
|
||||
inline TrackContainerTypes type() const
|
||||
{
|
||||
return m_TrackContainerType;
|
||||
}
|
||||
|
||||
|
||||
signals:
|
||||
void trackAdded( Track * _track );
|
||||
@@ -88,6 +103,8 @@ protected:
|
||||
private:
|
||||
TrackList m_tracks;
|
||||
|
||||
TrackContainerTypes m_TrackContainerType;
|
||||
|
||||
|
||||
friend class TrackContainerView;
|
||||
friend class Track;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "Track.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "InstrumentTrack.h"
|
||||
|
||||
|
||||
class QVBoxLayout;
|
||||
@@ -123,6 +124,8 @@ public slots:
|
||||
void createTrackView( Track * _t );
|
||||
void deleteTrackView( TrackView * _tv );
|
||||
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
|
||||
protected:
|
||||
static const int DEFAULT_PIXELS_PER_TACT = 16;
|
||||
@@ -132,8 +135,6 @@ protected:
|
||||
return( m_trackViews );
|
||||
}
|
||||
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
@@ -182,6 +183,19 @@ signals:
|
||||
|
||||
} ;
|
||||
|
||||
class InstrumentLoaderThread : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InstrumentLoaderThread( QObject *parent = 0, InstrumentTrack *it = 0,
|
||||
QString name = "" );
|
||||
|
||||
void run();
|
||||
|
||||
private:
|
||||
InstrumentTrack *m_it;
|
||||
QString m_name;
|
||||
QThread *m_containerThread;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user