Merge branch 'master' into cmake_dist
# Conflicts: # include/ConfigManager.h # include/Engine.h # plugins/CMakeLists.txt # plugins/vst_base/CMakeLists.txt # plugins/vst_base/Win64/CMakeLists.txt # src/core/Engine.cpp
This commit is contained in:
@@ -45,7 +45,11 @@ public:
|
||||
|
||||
#ifdef LMMS_HAVE_PORTAUDIO
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#include <portaudio2/portaudio.h>
|
||||
#else
|
||||
#include <portaudio.h>
|
||||
#endif
|
||||
|
||||
#include "AudioDevice.h"
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
// has to be accessed by more than one object, then this function shouldn't be used.
|
||||
bool isValueChanged()
|
||||
{
|
||||
if( m_valueChanged )
|
||||
if( m_valueChanged || valueBuffer() )
|
||||
{
|
||||
m_valueChanged = false;
|
||||
return true;
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
AutomationPattern( const AutomationPattern & _pat_to_copy );
|
||||
virtual ~AutomationPattern();
|
||||
|
||||
void addObject( AutomatableModel * _obj, bool _search_dup = true );
|
||||
bool addObject( AutomatableModel * _obj, bool _search_dup = true );
|
||||
|
||||
const AutomatableModel * firstObject() const;
|
||||
|
||||
|
||||
@@ -41,8 +41,12 @@ class Engine;
|
||||
|
||||
|
||||
const QString PROJECTS_PATH = "projects/";
|
||||
const QString TEMPLATE_PATH = "templates/";
|
||||
const QString PRESETS_PATH = "presets/";
|
||||
const QString SAMPLES_PATH = "samples/";
|
||||
const QString GIG_PATH = "samples/gig/";
|
||||
const QString SF2_PATH = "samples/sf2/";
|
||||
const QString LADSPA_PATH ="plugins/ladspa/";
|
||||
const QString DEFAULT_THEME_PATH = "themes/default/";
|
||||
const QString TRACK_ICON_PATH = "track_icons/";
|
||||
const QString LOCALE_PATH = "locale/";
|
||||
@@ -76,6 +80,11 @@ public:
|
||||
return workingDir() + PROJECTS_PATH;
|
||||
}
|
||||
|
||||
QString userTemplateDir() const
|
||||
{
|
||||
return workingDir() + TEMPLATE_PATH;
|
||||
}
|
||||
|
||||
QString userPresetsDir() const
|
||||
{
|
||||
return workingDir() + PRESETS_PATH;
|
||||
@@ -86,6 +95,26 @@ public:
|
||||
return workingDir() + SAMPLES_PATH;
|
||||
}
|
||||
|
||||
QString userGigDir() const
|
||||
{
|
||||
return workingDir() + GIG_PATH;
|
||||
}
|
||||
|
||||
QString userSf2Dir() const
|
||||
{
|
||||
return workingDir() + SF2_PATH;
|
||||
}
|
||||
|
||||
QString userLadspaDir() const
|
||||
{
|
||||
return workingDir() + LADSPA_PATH;
|
||||
}
|
||||
|
||||
QString userVstDir() const
|
||||
{
|
||||
return m_vstDir;
|
||||
}
|
||||
|
||||
QString factoryProjectsDir() const
|
||||
{
|
||||
return dataDir() + PROJECTS_PATH;
|
||||
@@ -126,6 +155,16 @@ public:
|
||||
return m_dataDir + LOCALE_PATH;
|
||||
}
|
||||
|
||||
const QString & gigDir() const
|
||||
{
|
||||
return m_gigDir;
|
||||
}
|
||||
|
||||
const QString & sf2Dir() const
|
||||
{
|
||||
return m_sf2Dir;
|
||||
}
|
||||
|
||||
const QString & vstDir() const
|
||||
{
|
||||
return m_vstDir;
|
||||
@@ -195,6 +234,8 @@ public:
|
||||
void setSTKDir( const QString & _fd );
|
||||
void setDefaultSoundfont( const QString & _sf );
|
||||
void setBackgroundArtwork( const QString & _ba );
|
||||
void setGIGDir( const QString & gd );
|
||||
void setSF2Dir( const QString & sfd );
|
||||
|
||||
|
||||
private:
|
||||
@@ -214,6 +255,8 @@ private:
|
||||
QString m_vstDir;
|
||||
QString m_flDir;
|
||||
QString m_ladDir;
|
||||
QString m_gigDir;
|
||||
QString m_sf2Dir;
|
||||
QString m_version;
|
||||
#ifdef LMMS_HAVE_STK
|
||||
QString m_stkDir;
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#define ENGINE_H
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
|
||||
#include "export.h"
|
||||
|
||||
@@ -39,8 +42,9 @@ class Song;
|
||||
class Ladspa2LMMS;
|
||||
|
||||
|
||||
class EXPORT Engine
|
||||
class EXPORT Engine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static void init();
|
||||
static void destroy();
|
||||
@@ -91,6 +95,19 @@ public:
|
||||
}
|
||||
static void updateFramesPerTick();
|
||||
|
||||
static inline Engine * inst()
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new Engine();
|
||||
}
|
||||
return s_instanceOfMe;
|
||||
}
|
||||
|
||||
signals:
|
||||
void initProgress(const QString &msg);
|
||||
|
||||
|
||||
private:
|
||||
// small helper function which sets the pointer to NULL before actually deleting
|
||||
// the object it refers to
|
||||
@@ -114,6 +131,9 @@ private:
|
||||
|
||||
static Ladspa2LMMS * s_ladspaManager;
|
||||
|
||||
// even though most methods are static, an instance is needed for Qt slots/signals
|
||||
static Engine * s_instanceOfMe;
|
||||
|
||||
friend class GuiApplication;
|
||||
};
|
||||
|
||||
|
||||
@@ -100,14 +100,12 @@ private:
|
||||
|
||||
int knobPosY() const
|
||||
{
|
||||
float fRange = m_model->maxValue() - m_model->minValue();
|
||||
float realVal = m_model->value() - m_model->minValue();
|
||||
float fRange = model()->maxValue() - model()->minValue();
|
||||
float realVal = model()->value() - model()->minValue();
|
||||
|
||||
return height() - ( ( height() - m_knob->height() ) * ( realVal / fRange ) );
|
||||
}
|
||||
|
||||
FloatModel * m_model;
|
||||
|
||||
void setPeak( float fPeak, float &targetPeak, float &persistentPeak, QTime &lastPeakTime );
|
||||
int calculateDisplayPeak( float fPeak );
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ public slots:
|
||||
void filterItems( const QString & filter );
|
||||
void reloadTree( void );
|
||||
|
||||
private slots:
|
||||
void giveFocusToFilter();
|
||||
|
||||
private:
|
||||
bool filterItems( QTreeWidgetItem * item, const QString & filter );
|
||||
|
||||
@@ -53,6 +53,8 @@ public:
|
||||
public:
|
||||
FxChannelView(QWidget * _parent, FxMixerView * _mv, int _chIndex );
|
||||
|
||||
void setChannelIndex( int index );
|
||||
|
||||
FxLine * m_fxLine;
|
||||
PixmapButton * m_muteBtn;
|
||||
PixmapButton * m_soloBtn;
|
||||
@@ -97,6 +99,7 @@ public:
|
||||
|
||||
// move the channel to the left or right
|
||||
void moveChannelLeft(int index);
|
||||
void moveChannelLeft(int index, int focusIndex);
|
||||
void moveChannelRight(int index);
|
||||
|
||||
// make sure the display syncs up with the fx mixer.
|
||||
|
||||
@@ -25,8 +25,12 @@
|
||||
#ifndef GUIAPPLICATION_H
|
||||
#define GUIAPPLICATION_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
class AutomationEditorWindow;
|
||||
class BBEditor;
|
||||
class ControllerRackView;
|
||||
@@ -36,8 +40,9 @@ class PianoRollWindow;
|
||||
class ProjectNotes;
|
||||
class SongEditorWindow;
|
||||
|
||||
class EXPORT GuiApplication
|
||||
class EXPORT GuiApplication : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
explicit GuiApplication();
|
||||
~GuiApplication();
|
||||
@@ -53,6 +58,9 @@ public:
|
||||
AutomationEditorWindow* automationEditor() { return m_automationEditor; }
|
||||
ControllerRackView* getControllerRackView() { return m_controllerRackView; }
|
||||
|
||||
public slots:
|
||||
void displayInitProgress(const QString &msg);
|
||||
|
||||
private:
|
||||
static GuiApplication* s_instance;
|
||||
|
||||
@@ -64,6 +72,7 @@ private:
|
||||
PianoRollWindow* m_pianoRoll;
|
||||
ProjectNotes* m_projectNotes;
|
||||
ControllerRackView* m_controllerRackView;
|
||||
QLabel* m_loadingProgressLabel;
|
||||
};
|
||||
|
||||
#define gui GuiApplication::instance()
|
||||
|
||||
@@ -84,7 +84,6 @@ public:
|
||||
|
||||
private:
|
||||
Instrument* m_instrument;
|
||||
InstrumentTrack * m_instrumentTrack;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ class InstrumentMidiIOView;
|
||||
class InstrumentMiscView;
|
||||
class Knob;
|
||||
class LcdSpinBox;
|
||||
class LeftRightNav;
|
||||
class midiPortMenu;
|
||||
class DataFile;
|
||||
class PluginView;
|
||||
@@ -416,16 +417,19 @@ protected:
|
||||
|
||||
protected slots:
|
||||
void saveSettingsBtnClicked();
|
||||
|
||||
void viewNextInstrument();
|
||||
void viewPrevInstrument();
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void viewInstrumentInDirection(int d);
|
||||
|
||||
InstrumentTrack * m_track;
|
||||
InstrumentTrackView * m_itv;
|
||||
|
||||
// widgets on the top of an instrument-track-window
|
||||
QLineEdit * m_nameLineEdit;
|
||||
LeftRightNav * m_leftRightNav;
|
||||
Knob * m_volumeKnob;
|
||||
Knob * m_panningKnob;
|
||||
Knob * m_pitchKnob;
|
||||
|
||||
49
include/LeftRightNav.h
Normal file
49
include/LeftRightNav.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* LeftRightNav.cpp - side-by-side left-facing and right-facing arrows for navigation (looks like < > )
|
||||
*
|
||||
* Copyright (c) 2015 Colin Wallace <wallacoloo/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 LEFT_RIGHT_NAV_H
|
||||
#define LEFT_RIGHT_NAV_H
|
||||
|
||||
#include "PixmapButton.h"
|
||||
|
||||
#include <QLayout>
|
||||
|
||||
class LeftRightNav : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LeftRightNav(QWidget *parent=NULL);
|
||||
PixmapButton* getLeftBtn();
|
||||
PixmapButton* getRightBtn();
|
||||
void setShortcuts(const QKeySequence &leftShortcut=Qt::Key_Minus, const QKeySequence &rightShortcut=Qt::Key_Plus);
|
||||
signals:
|
||||
void onNavLeft();
|
||||
void onNavRight();
|
||||
private:
|
||||
QHBoxLayout m_layout;
|
||||
PixmapButton m_leftBtn;
|
||||
PixmapButton m_rightBtn;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -121,6 +121,7 @@ public slots:
|
||||
|
||||
void updatePlayPauseIcons();
|
||||
|
||||
void updateUndoRedoButtons();
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
@@ -167,6 +168,8 @@ private:
|
||||
} m_keyMods;
|
||||
|
||||
QMenu * m_toolsMenu;
|
||||
QAction * m_undoAction;
|
||||
QAction * m_redoAction;
|
||||
QList<PluginView *> m_tools;
|
||||
|
||||
QBasicTimer m_updateTimer;
|
||||
@@ -190,6 +193,7 @@ private slots:
|
||||
|
||||
signals:
|
||||
void periodicUpdate();
|
||||
void initProgress(const QString &msg);
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -25,13 +25,7 @@
|
||||
#ifndef MIXER_H
|
||||
#define MIXER_H
|
||||
|
||||
// denormals stripping
|
||||
#ifdef __SSE__
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
#ifdef __SSE3__
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
#include "denormals.h"
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
|
||||
@@ -384,6 +384,8 @@ signals:
|
||||
void currentPatternChanged();
|
||||
|
||||
private:
|
||||
void focusInEvent(QFocusEvent * event);
|
||||
|
||||
PianoRoll* m_editor;
|
||||
|
||||
ComboBox * m_zoomingComboBox;
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
void setActiveGraphic( const QPixmap & _pm );
|
||||
void setInactiveGraphic( const QPixmap & _pm, bool _update = true );
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
signals:
|
||||
void doubleClicked();
|
||||
|
||||
@@ -45,6 +45,9 @@ public:
|
||||
void undo();
|
||||
void redo();
|
||||
|
||||
bool canUndo() const;
|
||||
bool canRedo() const;
|
||||
|
||||
void addJournalCheckPoint( JournallingObject *jo );
|
||||
|
||||
bool isJournalling() const
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* SetupDialog.h - dialog for setting up LMMS
|
||||
*
|
||||
@@ -71,6 +72,8 @@ private slots:
|
||||
// path settings widget
|
||||
void setWorkingDir( const QString & _wd );
|
||||
void setVSTDir( const QString & _vd );
|
||||
void setGIGDir( const QString & _gd );
|
||||
void setSF2Dir( const QString & _sfd );
|
||||
void setArtworkDir( const QString & _ad );
|
||||
void setFLDir( const QString & _fd );
|
||||
void setLADSPADir( const QString & _ld );
|
||||
@@ -96,6 +99,8 @@ private slots:
|
||||
|
||||
void openWorkingDir();
|
||||
void openVSTDir();
|
||||
void openGIGDir();
|
||||
void openSF2Dir();
|
||||
void openArtworkDir();
|
||||
void openFLDir();
|
||||
void openLADSPADir();
|
||||
@@ -138,6 +143,8 @@ private:
|
||||
QLineEdit * m_adLineEdit;
|
||||
QLineEdit * m_fdLineEdit;
|
||||
QLineEdit * m_ladLineEdit;
|
||||
QLineEdit * m_gigLineEdit;
|
||||
QLineEdit * m_sf2LineEdit;
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
QLineEdit * m_sfLineEdit;
|
||||
#endif
|
||||
@@ -151,6 +158,8 @@ private:
|
||||
QString m_artworkDir;
|
||||
QString m_flDir;
|
||||
QString m_ladDir;
|
||||
QString m_gigDir;
|
||||
QString m_sf2Dir;
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
QString m_defaultSoundfont;
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
{
|
||||
Mode_None,
|
||||
Mode_PlaySong,
|
||||
Mode_PlayTrack,
|
||||
Mode_PlayBB,
|
||||
Mode_PlayPattern,
|
||||
Mode_PlayAutomationPattern,
|
||||
@@ -75,7 +74,6 @@ public:
|
||||
PlayPos( const int abs = 0 ) :
|
||||
MidiTime( abs ),
|
||||
m_timeLine( NULL ),
|
||||
m_timeLineUpdate( true ),
|
||||
m_currentFrame( 0.0f )
|
||||
{
|
||||
}
|
||||
@@ -88,7 +86,6 @@ public:
|
||||
return m_currentFrame;
|
||||
}
|
||||
TimeLineWidget * m_timeLine;
|
||||
bool m_timeLineUpdate;
|
||||
|
||||
private:
|
||||
float m_currentFrame;
|
||||
@@ -258,7 +255,6 @@ public slots:
|
||||
void playSong();
|
||||
void record();
|
||||
void playAndRecord();
|
||||
void playTrack( Track * trackToPlay );
|
||||
void playBB();
|
||||
void playPattern( const Pattern * patternToPlay, bool loop = true );
|
||||
void togglePause();
|
||||
@@ -355,7 +351,6 @@ private:
|
||||
PlayPos m_playPos[Mode_Count];
|
||||
tact_t m_length;
|
||||
|
||||
Track * m_trackToPlay;
|
||||
const Pattern* m_patternToPlay;
|
||||
bool m_loopPattern;
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ public:
|
||||
static Track * create( TrackTypes tt, TrackContainer * tc );
|
||||
static Track * create( const QDomElement & element,
|
||||
TrackContainer * tc );
|
||||
void clone();
|
||||
Track * clone();
|
||||
|
||||
|
||||
// pure virtual functions
|
||||
|
||||
@@ -103,8 +103,15 @@ public:
|
||||
return m_tc;
|
||||
}
|
||||
|
||||
void moveTrackViewUp( TrackView * _tv );
|
||||
void moveTrackViewDown( TrackView * _tv );
|
||||
const QList<TrackView *> & trackViews() const
|
||||
{
|
||||
return( m_trackViews );
|
||||
}
|
||||
|
||||
void moveTrackView( TrackView * trackView, int indexTo );
|
||||
void moveTrackViewUp( TrackView * trackView );
|
||||
void moveTrackViewDown( TrackView * trackView );
|
||||
void scrollToTrackView( TrackView * _tv );
|
||||
|
||||
// -- for usage by trackView only ---------------
|
||||
TrackView * addTrackView( TrackView * _tv );
|
||||
@@ -121,7 +128,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void realignTracks();
|
||||
void createTrackView( Track * _t );
|
||||
TrackView * createTrackView( Track * _t );
|
||||
void deleteTrackView( TrackView * _tv );
|
||||
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
@@ -141,11 +148,6 @@ public slots:
|
||||
protected:
|
||||
static const int DEFAULT_PIXELS_PER_TACT = 16;
|
||||
|
||||
const QList<TrackView *> & trackViews() const
|
||||
{
|
||||
return( m_trackViews );
|
||||
}
|
||||
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
|
||||
32
include/denormals.h
Normal file
32
include/denormals.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// Denormals stripping.
|
||||
// These snippets should be common enough to be considered public domain.
|
||||
|
||||
#ifndef DENORMALS_H
|
||||
#define DENORMALS_H
|
||||
|
||||
|
||||
#ifdef __SSE__
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
#ifdef __SSE3__
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Set denormal protection for this thread.
|
||||
// To be on the safe side, don't set the DAZ flag for SSE2 builds,
|
||||
// even if most SSE2 CPUs can handle it.
|
||||
void inline disable_denormals() {
|
||||
#ifdef __SSE3__
|
||||
/* DAZ flag */
|
||||
_MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON );
|
||||
#endif
|
||||
|
||||
#ifdef __SSE__
|
||||
/* FTZ flag */
|
||||
_MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU)
|
||||
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU) || defined (__FreeBSD__)
|
||||
#ifndef isnanf
|
||||
#define isnanf(x) isnan(x)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user