Merge branch 'master' into coding

Conflicts:
	include/Plugin.h
	src/core/Note.cpp
	src/core/Track.cpp
This commit is contained in:
Jonas Trappenberg
2015-01-31 18:59:34 -08:00
78 changed files with 1007 additions and 751 deletions

View File

@@ -25,7 +25,6 @@
#ifndef AUTOMATABLE_MODEL_H
#define AUTOMATABLE_MODEL_H
#include "lmms_math.h"
#include <QtCore/QMutex>
#include "JournallingObject.h"
@@ -174,7 +173,7 @@ public:
{
return castValue<T>( m_step );
}
//! @brief Returns value scaled with the scale type and min/max values of this model
float scaledValue( float value ) const;
//! @brief Returns value applied with the inverse of this model's scale type
@@ -265,22 +264,22 @@ public:
}
float globalAutomationValueAt( const MidiTime& time );
bool hasStrictStepSize() const
{
return m_hasStrictStepSize;
}
void setStrictStepSize( const bool b )
{
m_hasStrictStepSize = b;
}
static void incrementPeriodCounter()
{
++s_periodCounter;
}
static void resetPeriodCounter()
{
s_periodCounter = 0;
@@ -333,13 +332,13 @@ private:
float m_step;
float m_range;
float m_centerValue;
bool m_valueChanged;
// currently unused?
float m_oldValue;
int m_setValueDepth;
// used to determine if step size should be applied strictly (ie. always)
// or only when value set from gui (default)
bool m_hasStrictStepSize;
@@ -357,9 +356,9 @@ private:
ValueBuffer m_valueBuffer;
long m_lastUpdatedPeriod;
static long s_periodCounter;
bool m_hasSampleExactData;
// prevent several threads from attempting to write the same vb at the same time
QMutex m_valueBufferMutex;

View File

@@ -262,6 +262,9 @@ public:
void setCurrentPattern(AutomationPattern* pattern);
const AutomationPattern* currentPattern();
virtual void dropEvent( QDropEvent * _de );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
void open(AutomationPattern* pattern);
AutomationEditor* m_editor;

View File

@@ -57,9 +57,6 @@ public slots:
void play();
void stop();
protected:
virtual void closeEvent( QCloseEvent * _ce );
private:
BBTrackContainerView* m_trackContainerView;
ComboBox * m_bbComboBox;
@@ -80,13 +77,16 @@ public:
void removeBBView(int bb);
void saveSettings(QDomDocument& doc, QDomElement& element);
void loadSettings(const QDomElement& element);
public slots:
void addSteps();
void removeSteps();
void addAutomationTrack();
protected slots:
virtual void dropEvent(QDropEvent * de );
void dropEvent(QDropEvent * de );
void updatePosition();
private:

View File

@@ -27,7 +27,7 @@
#define BB_TRACK_CONTAINER_H
#include "TrackContainer.h"
#include "ComboBox.h"
#include "ComboBoxModel.h"
class EXPORT BBTrackContainer : public TrackContainer

View File

@@ -26,11 +26,9 @@
#ifndef BANDLIMITEDWAVE_H
#define BANDLIMITEDWAVE_H
#include <QString>
#include <QDataStream>
#include <QFile>
class QDataStream;
class QString;
#include "ConfigManager.h"
#include "export.h"
#include "interpolation.h"
#include "lmms_basics.h"

View File

@@ -22,17 +22,14 @@
* Boston, MA 02110-1301 USA.
*
*/
#ifndef BUFFER_MANAGER_H
#define BUFFER_MANAGER_H
#include "MemoryManager.h"
#include "export.h"
#include "lmms_basics.h"
#include "Engine.h"
#include "Mixer.h"
#include <QtCore/QAtomicInt>
#include <QtCore/QReadWriteLock>
class QAtomicInt;
const int BM_INITIAL_BUFFERS = 512;
//const int BM_INCREMENT = 64;
@@ -45,11 +42,11 @@ public:
static void release( sampleFrame * buf );
static void refresh();
// static void extend( int c );
private:
static sampleFrame ** s_available;
static QAtomicInt s_availableIndex;
static sampleFrame ** s_released;
static QAtomicInt s_releasedIndex;
// static QReadWriteLock s_mutex;

View File

@@ -29,7 +29,6 @@
#include <QtCore/QPair>
#include "AutomatableModel.h"
#include "templates.h"
class PixmapLoader;

View File

@@ -28,12 +28,12 @@
#define DATA_FILE_H
#include <QDomDocument>
#include <QTextStream>
#include "export.h"
#include "lmms_basics.h"
#include "MemoryManager.h"
class QTextStream;
class EXPORT DataFile : public QDomDocument
{
MM_OPERATORS

View File

@@ -3,7 +3,7 @@
*
* Copyright (c) 1998-2000 Paul Kellett (mda-vst.com)
* Copyright (c) 2007 Paul Giblock <drfaygo/at/gmail.com>
*
*
* This file is part of LMMS - http://lmms.io
*
* This program is free software; you can redistribute it and/or
@@ -42,11 +42,11 @@ class DrumSynth {
void GetEnv(int env, const char *sec, const char *key, const char *ini);
float waveform(float ph, int form);
int GetPrivateProfileString(const char *sec, const char *key, const char *def, char *buffer, int size, const char *file);
int GetPrivateProfileInt(const char *sec, const char *key, int def, const char *file);
float GetPrivateProfileFloat(const char *sec, const char *key, float def, const char *file);
};
#endif
#endif

View File

@@ -26,28 +26,17 @@
#ifndef ENGINE_H
#define ENGINE_H
#include "lmmsconfig.h"
#include "MemoryManager.h"
#include <QtCore/QMap>
#include "export.h"
class AutomationEditorWindow;
class BBEditor;
class BBTrackContainer;
class DummyTrackContainer;
class FxMixer;
class FxMixerView;
class ProjectJournal;
class MainWindow;
class Mixer;
class PianoRollWindow;
class ProjectNotes;
class Song;
class SongEditorWindow;
class Ladspa2LMMS;
class ControllerRackView;
class EXPORT Engine

View File

@@ -39,6 +39,7 @@ public:
_activated_color, QWidget * _parent );
virtual ~FadeButton();
void setActiveColor( const QColor & activated_color );
public slots:

View File

@@ -26,17 +26,18 @@
#ifndef INSTRUMENT_H
#define INSTRUMENT_H
#include <QWidget>
#include <QString>
#include <QtGlobal>
#include "export.h"
#include "lmms_basics.h"
#include "MemoryManager.h"
#include "MidiTime.h"
#include "Plugin.h"
#include "Mixer.h"
// forward-declarations
class InstrumentTrack;
class InstrumentView;
class MidiEvent;
class MidiTime;
class NotePlayHandle;
class Track;

View File

@@ -306,6 +306,9 @@ public:
static void cleanupWindowCache();
// Create a menu for assigning/creating channels for this track
QMenu * createFxMenu( QString title, QString newFxLabel );
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
@@ -320,6 +323,10 @@ private slots:
void midiInSelected();
void midiOutSelected();
void midiConfigChanged();
void muteChanged();
void assignFxLine( int channelIndex );
void createFxLine();
private:
@@ -374,6 +381,12 @@ public:
void setInstrumentTrackView( InstrumentTrackView * _tv );
InstrumentTrackView *instrumentTrackView()
{
return m_itv;
}
PianoView * pianoView()
{
return m_pianoView;

View File

@@ -28,11 +28,12 @@
#include <QtCore/QVector>
#include <QtCore/QMutex>
#include <QtCore/QReadWriteLock>
#include <QtCore/QHash>
#include "MemoryHelper.h"
#include "export.h"
class QReadWriteLock;
const int MM_CHUNK_SIZE = 64; // granularity of managed memory
const int MM_INITIAL_CHUNKS = 1024 * 1024; // how many chunks to allocate at startup - TODO: make configurable
const int MM_INCREMENT_CHUNKS = 16 * 1024; // min. amount of chunks to increment at a time

View File

@@ -28,15 +28,9 @@
#include <QtCore/QAtomicPointer>
#include <QtCore/QThread>
#include "ThreadableJob.h"
#include "Mixer.h"
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif
class QWaitCondition;
class Mixer;
class ThreadableJob;
class MixerWorkerThread : public QThread
{

View File

@@ -25,8 +25,8 @@
#ifndef MODEL_H
#define MODEL_H
#include <QtCore/QString>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include "export.h"

View File

@@ -25,6 +25,7 @@
#ifndef MODEL_VIEW_H
#define MODEL_VIEW_H
#include <QtCore/QPointer>
#include "Model.h"

View File

@@ -26,14 +26,13 @@
#ifndef NOTE_PLAY_HANDLE_H
#define NOTE_PLAY_HANDLE_H
#include "lmmsconfig.h"
#include "Note.h"
#include "PlayHandle.h"
#include "Track.h"
#include "MemoryManager.h"
#include <QtCore/QAtomicInt>
#include <QtCore/QReadWriteLock>
class QAtomicInt;
class QReadWriteLock;
class InstrumentTrack;
class NotePlayHandle;
@@ -59,7 +58,7 @@ public:
OriginCount
};
typedef Origins Origin;
NotePlayHandle( InstrumentTrack* instrumentTrack,
const f_cnt_t offset,
const f_cnt_t frames,
@@ -83,9 +82,9 @@ public:
{
return m_midiChannel;
}
/*! convenience function that returns offset for the first period and zero otherwise,
used by instruments to handle the offset: instruments have to check this property and
used by instruments to handle the offset: instruments have to check this property and
add the correct number of empty frames in the beginning of the period */
f_cnt_t noteOffset() const
{

View File

@@ -36,8 +36,6 @@
#include "SampleBuffer.h"
#include "lmms_constants.h"
class SampleBuffer;
class IntModel;

View File

@@ -160,6 +160,8 @@ protected slots:
void hidePattern( Pattern* pattern );
void selectRegionFromPixels( int xStart, int xEnd );
signals:
void currentPatternChanged();
@@ -229,7 +231,7 @@ private:
inline int noteEditRight() const;
inline int noteEditLeft() const;
void dragNotes( int x, int y, bool alt, bool shift );
void dragNotes( int x, int y, bool alt, bool shift, bool ctrl );
static const int cm_scrollAmtHoriz = 10;
static const int cm_scrollAmtVert = 1;
@@ -295,7 +297,7 @@ private:
int m_oldNotesEditHeight;
int m_notesEditHeight;
int m_ppt;
int m_ppt; // pixels per tact
int m_totalKeysToScroll;
// remember these values to use them

View File

@@ -148,8 +148,8 @@ public:
// returns display-name out of descriptor
virtual QString displayName() const
{
return Model::displayName().isEmpty()
? m_descriptor->displayName
return Model::displayName().isEmpty()
? m_descriptor->displayName
: Model::displayName();
}

View File

@@ -35,6 +35,7 @@ class QPixmap;
class QToolBar;
class NStateButton;
class TextFloat;
class SongEditor;
class TimeLineWidget : public QWidget, public JournallingObject
@@ -128,6 +129,11 @@ public:
m_ppt / MidiTime::ticksPerTact() );
}
signals:
void regionSelectedFromPixels( int, int );
void selectionFinished();
public slots:
void updatePosition( const MidiTime & );
@@ -171,6 +177,7 @@ private:
TextFloat * m_hint;
int m_initalXSelect;
enum actions
@@ -178,7 +185,8 @@ private:
NoAction,
MovePositionMarker,
MoveLoopBegin,
MoveLoopEnd
MoveLoopEnd,
SelectSongTCO,
} m_action;
int m_moveXOff;

View File

@@ -391,8 +391,6 @@ private slots:
void recordingOn();
void recordingOff();
void clearTrack();
void assignFxLine( int channelIndex );
void createFxLine();
private:
static QPixmap * s_grip;

View File

@@ -126,6 +126,17 @@ public slots:
virtual void dropEvent( QDropEvent * _de );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
///
/// \brief selectRegionFromPixels
/// \param x
/// \param y
/// Use the rubber band to select TCO from all tracks using x, y pixels
void selectRegionFromPixels(int xStart, int xEnd);
///
/// \brief stopRubberBand
/// Removes the rubber band from display when finished with.
void stopRubberBand();
protected:
static const int DEFAULT_PIXELS_PER_TACT = 16;

View File

@@ -26,7 +26,6 @@
#ifndef FFT_HELPERS_H
#define FFT_HELPERS_H
#include "lmmsconfig.h"
#include "export.h"
#include <fftw3.h>

View File

@@ -78,9 +78,9 @@ struct typeInfo
return 1;
}
static inline bool isEqual( T _x, T _y )
static inline bool isEqual( T x, T y )
{
return _x == _y;
return x == y;
}
static inline T absVal( T t )
@@ -97,13 +97,13 @@ inline float typeInfo<float>::minEps()
}
template<>
inline bool typeInfo<float>::isEqual( float _x, float _y )
inline bool typeInfo<float>::isEqual( float x, float y )
{
if( likely( _x == _y ) )
if( x == y )
{
return true;
}
return absVal( _x - _y ) < minEps();
return absVal( x - y ) < minEps();
}