Merge branch 'master' into fix/msvc
# Conflicts: # plugins/LadspaEffect/CMakeLists.txt # plugins/Xpressive/Xpressive.cpp # plugins/opl2/CMakeLists.txt # plugins/papu/CMakeLists.txt # plugins/xpressive/CMakeLists.txt # src/CMakeLists.txt
This commit is contained in:
@@ -28,7 +28,11 @@
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_JACK
|
||||
#ifndef LMMS_HAVE_WEAKJACK
|
||||
#include <jack/jack.h>
|
||||
#else
|
||||
#include "weak_libjack.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef AUTOMATABLE_MODEL_H
|
||||
#define AUTOMATABLE_MODEL_H
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#include "JournallingObject.h"
|
||||
|
||||
@@ -132,6 +132,7 @@ protected:
|
||||
void getSelectedValues(timeMap & selected_values );
|
||||
|
||||
void drawLine( int x0, float y0, int x1, float y1 );
|
||||
void removePoints( int x0, int x1 );
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
|
||||
@@ -44,7 +44,7 @@ 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 SF2_PATH = "samples/soundfonts/";
|
||||
const QString LADSPA_PATH ="plugins/ladspa/";
|
||||
const QString DEFAULT_THEME_PATH = "themes/default/";
|
||||
const QString TRACK_ICON_PATH = "track_icons/";
|
||||
|
||||
@@ -127,6 +127,7 @@ private:
|
||||
void upgrade_1_1_91();
|
||||
void upgrade_1_2_0_rc3();
|
||||
void upgrade_1_2_0_rc2_42();
|
||||
void upgrade_1_3_0();
|
||||
|
||||
void upgrade();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* MemoryManager.h - A lightweight, generic memory manager for LMMS
|
||||
* MemoryManager.h
|
||||
*
|
||||
* Copyright (c) 2017 Lukas W <lukaswhl/at/gmail.com>
|
||||
* Copyright (c) 2014 Vesa Kivimäki
|
||||
* Copyright (c) 2007-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -26,81 +27,22 @@
|
||||
#ifndef MEMORY_MANAGER_H
|
||||
#define MEMORY_MANAGER_H
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QHash>
|
||||
#include "MemoryHelper.h"
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
#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
|
||||
|
||||
struct MemoryPool
|
||||
{
|
||||
void * m_pool;
|
||||
char * m_free;
|
||||
size_t m_chunks;
|
||||
QMutex m_mutex;
|
||||
|
||||
MemoryPool() :
|
||||
m_pool( NULL ),
|
||||
m_free( NULL ),
|
||||
m_chunks( 0 )
|
||||
{}
|
||||
|
||||
MemoryPool( size_t chunks ) :
|
||||
m_chunks( chunks )
|
||||
{
|
||||
m_free = reinterpret_cast<char*>( MemoryHelper::alignedMalloc( chunks ) );
|
||||
memset( m_free, 1, chunks );
|
||||
}
|
||||
|
||||
MemoryPool( const MemoryPool & mp ) :
|
||||
m_pool( mp.m_pool ),
|
||||
m_free( mp.m_free ),
|
||||
m_chunks( mp.m_chunks ),
|
||||
m_mutex()
|
||||
{}
|
||||
|
||||
MemoryPool & operator = ( const MemoryPool & mp )
|
||||
{
|
||||
m_pool = mp.m_pool;
|
||||
m_free = mp.m_free;
|
||||
m_chunks = mp.m_chunks;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void * getChunks( int chunksNeeded );
|
||||
void releaseChunks( void * ptr, int chunks );
|
||||
};
|
||||
|
||||
struct PtrInfo
|
||||
{
|
||||
int chunks;
|
||||
MemoryPool * memPool;
|
||||
};
|
||||
|
||||
typedef QVector<MemoryPool> MemoryPoolVector;
|
||||
typedef QHash<void*, PtrInfo> PointerInfoMap;
|
||||
|
||||
class EXPORT MemoryManager
|
||||
{
|
||||
public:
|
||||
static bool init();
|
||||
struct ThreadGuard
|
||||
{
|
||||
ThreadGuard();
|
||||
~ThreadGuard();
|
||||
};
|
||||
|
||||
static void * alloc( size_t size );
|
||||
static void free( void * ptr );
|
||||
static int extend( int chunks ); // returns index of created pool (for use by alloc)
|
||||
static void cleanup();
|
||||
|
||||
private:
|
||||
static MemoryPoolVector s_memoryPools;
|
||||
static QReadWriteLock s_poolMutex;
|
||||
|
||||
static PointerInfoMap s_pointerInfo;
|
||||
static QMutex s_pointerMutex;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -147,32 +89,4 @@ static void operator delete[] ( void * ptr ) \
|
||||
// and just for symmetry...
|
||||
#define MM_FREE( ptr ) MemoryManager::free( ptr )
|
||||
|
||||
|
||||
|
||||
// for debugging purposes
|
||||
|
||||
#define MM_OPERATORS_DEBUG \
|
||||
public: \
|
||||
static void * operator new ( size_t size ) \
|
||||
{ \
|
||||
qDebug( "MM_OPERATORS_DEBUG: new called for %d bytes", size ); \
|
||||
return MemoryManager::alloc( size ); \
|
||||
} \
|
||||
static void * operator new[] ( size_t size ) \
|
||||
{ \
|
||||
qDebug( "MM_OPERATORS_DEBUG: new[] called for %d bytes", size ); \
|
||||
return MemoryManager::alloc( size ); \
|
||||
} \
|
||||
static void operator delete ( void * ptr ) \
|
||||
{ \
|
||||
qDebug( "MM_OPERATORS_DEBUG: delete called for %p", ptr ); \
|
||||
MemoryManager::free( ptr ); \
|
||||
} \
|
||||
static void operator delete[] ( void * ptr ) \
|
||||
{ \
|
||||
qDebug( "MM_OPERATORS_DEBUG: delete[] called for %p", ptr ); \
|
||||
MemoryManager::free( ptr ); \
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,12 @@
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_JACK
|
||||
#ifndef LMMS_HAVE_WEAKJACK
|
||||
#include <jack/jack.h>
|
||||
#include <jack/midiport.h>
|
||||
#else
|
||||
#include "weak_libjack.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore/QThread>
|
||||
#include <QMutex>
|
||||
|
||||
@@ -113,11 +113,19 @@ public:
|
||||
void quantizeLength( const int qGrid );
|
||||
void quantizePos( const int qGrid );
|
||||
|
||||
static inline bool lessThan( Note * &lhs, Note * &rhs )
|
||||
static inline bool lessThan( const Note * lhs, const Note * rhs )
|
||||
{
|
||||
// function to compare two notes - must be called explictly when
|
||||
// using qSort
|
||||
return (bool) ((int) ( *lhs ).pos() < (int) ( *rhs ).pos());
|
||||
if( (int)( *lhs ).pos() < (int)( *rhs ).pos() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( (int)( *lhs ).pos() > (int)( *rhs ).pos() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return ( (int)( *lhs ).key() > (int)( *rhs ).key() );
|
||||
}
|
||||
|
||||
inline bool selected() const
|
||||
|
||||
@@ -66,8 +66,7 @@ public:
|
||||
NotePlayHandle* parent = NULL,
|
||||
int midiEventChannel = -1,
|
||||
Origin origin = OriginPattern );
|
||||
virtual ~NotePlayHandle() {}
|
||||
void done();
|
||||
virtual ~NotePlayHandle();
|
||||
|
||||
void * operator new ( size_t size, void * p )
|
||||
{
|
||||
|
||||
@@ -37,8 +37,7 @@ class PluginBrowser : public SideBarWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
PluginBrowser( QWidget * _parent );
|
||||
virtual ~PluginBrowser();
|
||||
|
||||
virtual ~PluginBrowser() = default;
|
||||
|
||||
private:
|
||||
QWidget * m_view;
|
||||
@@ -62,29 +61,21 @@ class PluginDescWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
PluginDescWidget( const Plugin::Descriptor & _pd, QWidget * _parent );
|
||||
virtual ~PluginDescWidget();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void enterEvent( QEvent * _e );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private slots:
|
||||
void updateHeight();
|
||||
|
||||
void enterEvent( QEvent * _e ) override;
|
||||
void leaveEvent( QEvent * _e ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
|
||||
private:
|
||||
QTimer m_updateTimer;
|
||||
constexpr static int DEFAULT_HEIGHT{24};
|
||||
|
||||
const Plugin::Descriptor & m_pluginDescriptor;
|
||||
QPixmap m_logo;
|
||||
|
||||
bool m_mouseOver;
|
||||
int m_targetHeight;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QList>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
@@ -70,7 +70,6 @@ protected:
|
||||
m_layout->addLayout( _l );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QWidget * m_contents;
|
||||
QVBoxLayout * m_layout;
|
||||
|
||||
@@ -104,17 +104,36 @@ public:
|
||||
|
||||
inline int getMilliseconds() const
|
||||
{
|
||||
return m_elapsedMilliSeconds;
|
||||
return m_elapsedMilliSeconds[m_playMode];
|
||||
}
|
||||
|
||||
inline void setToTime( MidiTime const & midiTime )
|
||||
inline int getMilliseconds(PlayModes playMode) const
|
||||
{
|
||||
m_elapsedMilliSeconds = midiTime.getTimeInMilliseconds(getTempo());
|
||||
return m_elapsedMilliSeconds[playMode];
|
||||
}
|
||||
|
||||
inline void setToTime(MidiTime const & midiTime)
|
||||
{
|
||||
m_elapsedMilliSeconds[m_playMode] = midiTime.getTimeInMilliseconds(getTempo());
|
||||
m_playPos[m_playMode].setTicks(midiTime.getTicks());
|
||||
}
|
||||
|
||||
inline void setToTime(MidiTime const & midiTime, PlayModes playMode)
|
||||
{
|
||||
m_elapsedMilliSeconds[playMode] = midiTime.getTimeInMilliseconds(getTempo());
|
||||
m_playPos[playMode].setTicks(midiTime.getTicks());
|
||||
}
|
||||
|
||||
inline void setToTimeByTicks(tick_t ticks)
|
||||
{
|
||||
m_elapsedMilliSeconds = MidiTime::ticksToMilliseconds(ticks, getTempo());
|
||||
m_elapsedMilliSeconds[m_playMode] = MidiTime::ticksToMilliseconds(ticks, getTempo());
|
||||
m_playPos[m_playMode].setTicks(ticks);
|
||||
}
|
||||
|
||||
inline void setToTimeByTicks(tick_t ticks, PlayModes playMode)
|
||||
{
|
||||
m_elapsedMilliSeconds[playMode] = MidiTime::ticksToMilliseconds(ticks, getTempo());
|
||||
m_playPos[playMode].setTicks(ticks);
|
||||
}
|
||||
|
||||
inline int getTacts() const
|
||||
@@ -376,7 +395,7 @@ private:
|
||||
const Pattern* m_patternToPlay;
|
||||
bool m_loopPattern;
|
||||
|
||||
double m_elapsedMilliSeconds;
|
||||
double m_elapsedMilliSeconds[Mode_Count];
|
||||
tick_t m_elapsedTicks;
|
||||
tact_t m_elapsedTacts;
|
||||
|
||||
|
||||
@@ -40,7 +40,14 @@ class QMoveEvent;
|
||||
class QResizeEvent;
|
||||
class QWidget;
|
||||
|
||||
|
||||
/**
|
||||
* @brief The SubWindow class
|
||||
*
|
||||
* Because of a bug in the QMdiSubWindow class to save the right position and size
|
||||
* of a subwindow in a project and because of the inability
|
||||
* for cusomizing the title bar appearance, lmms implements its own subwindow
|
||||
* class.
|
||||
*/
|
||||
class EXPORT SubWindow : public QMdiSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
TimeLineWidget( int xoff, int yoff, float ppt, Song::PlayPos & pos,
|
||||
const MidiTime & begin, QWidget * parent );
|
||||
TimeLineWidget(int xoff, int yoff, float ppt, Song::PlayPos & pos,
|
||||
const MidiTime & begin, Song::PlayModes mode, QWidget * parent);
|
||||
virtual ~TimeLineWidget();
|
||||
|
||||
inline QColor const & getBarLineColor() const { return m_barLineColor; }
|
||||
@@ -217,6 +217,7 @@ private:
|
||||
float m_ppt;
|
||||
Song::PlayPos & m_pos;
|
||||
const MidiTime & m_begin;
|
||||
const Song::PlayModes m_mode;
|
||||
MidiTime m_loopPos[2];
|
||||
|
||||
MidiTime m_savedPos;
|
||||
|
||||
@@ -149,6 +149,9 @@ public:
|
||||
/// Returns true if and only if a->startPosition() < b->startPosition()
|
||||
static bool comparePosition(const TrackContentObject* a, const TrackContentObject* b);
|
||||
|
||||
MidiTime startTimeOffset() const;
|
||||
void setStartTimeOffset( const MidiTime &startTimeOffset );
|
||||
|
||||
public slots:
|
||||
void copy();
|
||||
void paste();
|
||||
@@ -174,6 +177,7 @@ private:
|
||||
|
||||
MidiTime m_startPosition;
|
||||
MidiTime m_length;
|
||||
MidiTime m_startTimeOffset;
|
||||
|
||||
BoolModel m_mutedModel;
|
||||
BoolModel m_soloModel;
|
||||
@@ -281,6 +285,7 @@ private:
|
||||
Move,
|
||||
MoveSelection,
|
||||
Resize,
|
||||
ResizeLeft,
|
||||
CopySelection,
|
||||
ToggleSelected
|
||||
} ;
|
||||
|
||||
@@ -26,10 +26,12 @@
|
||||
#ifndef AEFFECTX_H
|
||||
#define AEFFECTX_H
|
||||
|
||||
#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
|
||||
( ( (int) b ) << 16 ) | \
|
||||
( ( (int) c ) << 8 ) | \
|
||||
( ( (int) d ) << 0 ) )
|
||||
#include <stdint.h>
|
||||
|
||||
#define CCONST(a, b, c, d)( ( ( (int32_t) a ) << 24 ) | \
|
||||
( ( (int32_t) b ) << 16 ) | \
|
||||
( ( (int32_t) c ) << 8 ) | \
|
||||
( ( (int32_t) d ) << 0 ) )
|
||||
|
||||
const int audioMasterAutomate = 0;
|
||||
const int audioMasterVersion = 1;
|
||||
@@ -147,17 +149,17 @@ class VstMidiEvent
|
||||
{
|
||||
public:
|
||||
// 00
|
||||
int type;
|
||||
int32_t type;
|
||||
// 04
|
||||
int byteSize;
|
||||
int32_t byteSize;
|
||||
// 08
|
||||
int deltaFrames;
|
||||
int32_t deltaFrames;
|
||||
// 0c?
|
||||
int flags;
|
||||
int32_t flags;
|
||||
// 10?
|
||||
int noteLength;
|
||||
int32_t noteLength;
|
||||
// 14?
|
||||
int noteOffset;
|
||||
int32_t noteOffset;
|
||||
// 18
|
||||
char midiData[4];
|
||||
// 1c?
|
||||
@@ -187,7 +189,7 @@ class VstEvents
|
||||
{
|
||||
public:
|
||||
// 00
|
||||
int numEvents;
|
||||
int32_t numEvents;
|
||||
// 04
|
||||
void *reserved;
|
||||
// 08
|
||||
@@ -201,25 +203,25 @@ class AEffect
|
||||
public:
|
||||
// Never use virtual functions!!!
|
||||
// 00-03
|
||||
int magic;
|
||||
int32_t magic;
|
||||
// dispatcher 04-07
|
||||
intptr_t (* dispatcher)( AEffect * , int , int , intptr_t, void * , float );
|
||||
intptr_t (* dispatcher)( AEffect * , int32_t , int32_t , intptr_t, void * , float );
|
||||
// process, quite sure 08-0b
|
||||
void (* process)( AEffect * , float * * , float * * , int );
|
||||
void (* process)( AEffect * , float * * , float * * , int32_t );
|
||||
// setParameter 0c-0f
|
||||
void (* setParameter)( AEffect * , int , float );
|
||||
void (* setParameter)( AEffect * , int32_t , float );
|
||||
// getParameter 10-13
|
||||
float (* getParameter)( AEffect * , int );
|
||||
float (* getParameter)( AEffect * , int32_t );
|
||||
// programs 14-17
|
||||
int numPrograms;
|
||||
int32_t numPrograms;
|
||||
// Params 18-1b
|
||||
int numParams;
|
||||
int32_t numParams;
|
||||
// Input 1c-1f
|
||||
int numInputs;
|
||||
int32_t numInputs;
|
||||
// Output 20-23
|
||||
int numOutputs;
|
||||
int32_t numOutputs;
|
||||
// flags 24-27
|
||||
int flags;
|
||||
int32_t flags;
|
||||
// Fill somewhere 28-2b
|
||||
void *ptr1;
|
||||
void *ptr2;
|
||||
|
||||
Reference in New Issue
Block a user