Merge pull request #2108 from LMMS/travis-qt5

Travis QT5
This commit is contained in:
Lukas W
2015-06-21 16:22:27 +02:00
19 changed files with 77 additions and 29 deletions

25
include/AtomicInt.h Normal file
View File

@@ -0,0 +1,25 @@
/// \file AtomicInt.h
/// \brief Compatibility subclass of QAtomicInt for supporting both Qt4 and Qt5
#ifndef LMMS_ATOMIC_H
#define LMMS_ATOMIC_H
#include <QtCore/QAtomicInt>
#if QT_VERSION >= 0x050000 && QT_VERSION <= 0x050300
class AtomicInt : public QAtomicInt
{
public:
AtomicInt(int value=0) : QAtomicInt(value) {};
operator int() const {return loadAcquire();}
};
#else
typedef QAtomicInt AtomicInt;
#endif // QT_VERSION >= 0x050000 && QT_VERSION <= 0x050300
#endif

View File

@@ -26,6 +26,7 @@
#ifndef BUFFER_MANAGER_H
#define BUFFER_MANAGER_H
#include "AtomicInt.h"
#include "export.h"
#include "lmms_basics.h"
@@ -45,10 +46,10 @@ public:
private:
static sampleFrame ** s_available;
static QAtomicInt s_availableIndex;
static AtomicInt s_availableIndex;
static sampleFrame ** s_released;
static QAtomicInt s_releasedIndex;
static AtomicInt s_releasedIndex;
// static QReadWriteLock s_mutex;
static int s_size;
};

View File

@@ -25,6 +25,7 @@
#ifndef MIXER_WORKER_THREAD_H
#define MIXER_WORKER_THREAD_H
#include <AtomicInt.h>
#include <QtCore/QAtomicPointer>
#include <QtCore/QThread>
@@ -63,8 +64,8 @@ public:
private:
#define JOB_QUEUE_SIZE 1024
QAtomicPointer<ThreadableJob> m_items[JOB_QUEUE_SIZE];
QAtomicInt m_queueSize;
QAtomicInt m_itemsDone;
AtomicInt m_queueSize;
AtomicInt m_itemsDone;
OperationMode m_opMode;
} ;

View File

@@ -26,6 +26,7 @@
#ifndef NOTE_PLAY_HANDLE_H
#define NOTE_PLAY_HANDLE_H
#include "AtomicInt.h"
#include "Note.h"
#include "PlayHandle.h"
#include "Track.h"
@@ -335,7 +336,7 @@ public:
private:
static NotePlayHandle ** s_available;
static QReadWriteLock s_mutex;
static QAtomicInt s_availableIndex;
static AtomicInt s_availableIndex;
static int s_size;
};

View File

@@ -25,7 +25,7 @@
#ifndef THREADABLE_JOB_H
#define THREADABLE_JOB_H
#include <QtCore/QAtomicInt>
#include "AtomicInt.h"
#include "lmms_basics.h"
@@ -82,7 +82,7 @@ public:
protected:
virtual void doProcessing() = 0;
QAtomicInt m_state;
AtomicInt m_state;
} ;