@@ -44,7 +44,7 @@
|
||||
#include "interpolation.h"
|
||||
#include "MemoryManager.h"
|
||||
|
||||
template<ch_cnt_t CHANNELS> class BasicFilters;
|
||||
template<ch_cnt_t CHANNELS=DEFAULT_CHANNELS> class BasicFilters;
|
||||
|
||||
template<ch_cnt_t CHANNELS>
|
||||
class LinkwitzRiley
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#ifndef CONTROLLER_H
|
||||
#define CONTROLLER_H
|
||||
|
||||
#include "export.h"
|
||||
#include "Engine.h"
|
||||
#include "Model.h"
|
||||
#include "JournallingObject.h"
|
||||
@@ -40,7 +41,7 @@ class ControllerConnection;
|
||||
typedef QVector<Controller *> ControllerVector;
|
||||
|
||||
|
||||
class Controller : public Model, public JournallingObject
|
||||
class EXPORT Controller : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -25,45 +25,21 @@
|
||||
#ifndef MICRO_TIMER
|
||||
#define MICRO_TIMER
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <cstdlib>
|
||||
#include "lmms_basics.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
class MicroTimer
|
||||
{
|
||||
using time_point = std::chrono::steady_clock::time_point;
|
||||
|
||||
public:
|
||||
inline MicroTimer()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
inline ~MicroTimer()
|
||||
{
|
||||
}
|
||||
|
||||
inline void reset()
|
||||
{
|
||||
gettimeofday( &begin, NULL );
|
||||
}
|
||||
|
||||
inline int elapsed() const
|
||||
{
|
||||
struct timeval now;
|
||||
gettimeofday( &now, NULL );
|
||||
return ( now.tv_sec - begin.tv_sec ) * 1000 * 1000 +
|
||||
( now.tv_usec - begin.tv_usec );
|
||||
}
|
||||
MicroTimer();
|
||||
~MicroTimer();
|
||||
|
||||
void reset();
|
||||
int elapsed() const;
|
||||
|
||||
private:
|
||||
struct timeval begin;
|
||||
|
||||
time_point begin;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QFile>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "MicroTimer.h"
|
||||
|
||||
class MixerProfiler
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define NOTE_PLAY_HANDLE_H
|
||||
|
||||
#include "AtomicInt.h"
|
||||
#include "BasicFilters.h"
|
||||
#include "Note.h"
|
||||
#include "PlayHandle.h"
|
||||
#include "Track.h"
|
||||
@@ -36,7 +37,6 @@ class QReadWriteLock;
|
||||
class InstrumentTrack;
|
||||
class NotePlayHandle;
|
||||
|
||||
template<ch_cnt_t=DEFAULT_CHANNELS> class BasicFilters;
|
||||
typedef QList<NotePlayHandle *> NotePlayHandleList;
|
||||
typedef QList<const NotePlayHandle *> ConstNotePlayHandleList;
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#include "MemoryManager.h"
|
||||
|
||||
#include "ThreadableJob.h"
|
||||
@@ -38,7 +40,7 @@ class QThread;
|
||||
class Track;
|
||||
class AudioPort;
|
||||
|
||||
class PlayHandle : public ThreadableJob
|
||||
class EXPORT PlayHandle : public ThreadableJob
|
||||
{
|
||||
public:
|
||||
enum Types
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "MidiEvent.h"
|
||||
#include "VstSyncData.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
@@ -234,7 +235,7 @@ public:
|
||||
// recursive lock
|
||||
inline void lock()
|
||||
{
|
||||
if( !isInvalid() && __sync_add_and_fetch( &m_lockDepth, 1 ) == 1 )
|
||||
if( !isInvalid() && m_lockDepth.fetch_add( 1 ) == 0 )
|
||||
{
|
||||
m_dataSem.acquire();
|
||||
}
|
||||
@@ -243,7 +244,7 @@ public:
|
||||
// recursive unlock
|
||||
inline void unlock()
|
||||
{
|
||||
if( __sync_sub_and_fetch( &m_lockDepth, 1) <= 0 )
|
||||
if( m_lockDepth.fetch_sub( 1 ) <= 1 )
|
||||
{
|
||||
m_dataSem.release();
|
||||
}
|
||||
@@ -404,7 +405,7 @@ private:
|
||||
shmData * m_data;
|
||||
QSystemSemaphore m_dataSem;
|
||||
QSystemSemaphore m_messageSem;
|
||||
volatile int m_lockDepth;
|
||||
std::atomic_int m_lockDepth;
|
||||
|
||||
} ;
|
||||
#endif
|
||||
|
||||
@@ -174,6 +174,7 @@ private:
|
||||
TrackContainerView* m_trackContainerView;
|
||||
|
||||
} ;
|
||||
friend class TrackContainerView::scrollArea;
|
||||
|
||||
TrackContainer* m_tc;
|
||||
typedef QList<TrackView *> trackViewList;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef EXPORT_H
|
||||
#define EXPORT_H
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,9 +56,12 @@ typedef uint16_t fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL)
|
||||
typedef uint32_t jo_id_t; // (unique) ID of a journalling object
|
||||
|
||||
// use for improved branch prediction
|
||||
#define likely(x) __builtin_expect((x),1)
|
||||
#define unlikely(x) __builtin_expect((x),0)
|
||||
#define likely(x) Q_LIKELY(x)
|
||||
#define unlikely(x) Q_UNLIKELY(x)
|
||||
|
||||
// windows headers define "min" and "max" macros, breaking the methods bwloe
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
template<typename T>
|
||||
struct typeInfo
|
||||
@@ -93,7 +96,7 @@ struct typeInfo
|
||||
template<>
|
||||
inline float typeInfo<float>::minEps()
|
||||
{
|
||||
return 1.0e-10;
|
||||
return 1.0e-10f;
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#include "lmms_basics.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GCC_VERSION "GCC " __VERSION__
|
||||
#define COMPILER_VERSION "GCC " __VERSION__
|
||||
#elif defined(_MSC_VER)
|
||||
#define COMPILER_VERSION "MSVC " STRINGIFY(_MSC_FULL_VER)
|
||||
#else
|
||||
#define GCC_VERSION "unknown compiler"
|
||||
#define COMPILER_VERSION "unknown compiler"
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HOST_X86
|
||||
|
||||
Reference in New Issue
Block a user