Finish audioport rehaul, get vol/pan knobs working again, also some bugfixes

We're now doing the vol/pan stuff in audioport, since this way we avoid the pointless repetition of doing it in the playhandles
This commit is contained in:
Vesa
2014-08-27 23:08:22 +03:00
parent 857de8d2c8
commit 1deb80acc3
9 changed files with 142 additions and 60 deletions

View File

@@ -34,12 +34,14 @@
#include "PlayHandle.h"
class EffectChain;
class FloatModel;
class AudioPort : public ThreadableJob
{
MM_OPERATORS
public:
AudioPort( const QString & _name, bool _has_effect_chain = true );
AudioPort( const QString & _name, bool _has_effect_chain = true,
FloatModel * volumeModel = NULL, FloatModel * panningModel = NULL );
virtual ~AudioPort();
inline sampleFrame * buffer()
@@ -120,6 +122,9 @@ private:
PlayHandleList m_playHandles;
QMutex m_playHandleLock;
FloatModel * m_volumeModel;
FloatModel * m_panningModel;
friend class Mixer;
friend class MixerWorkerThread;

View File

@@ -225,7 +225,6 @@ protected slots:
private:
AudioPort m_audioPort;
MidiPort m_midiPort;
NotePlayHandle* m_notes[NumKeys];
@@ -244,6 +243,9 @@ private:
FloatModel m_volumeModel;
FloatModel m_panningModel;
AudioPort m_audioPort;
FloatModel m_pitchModel;
IntModel m_pitchRangeModel;
IntModel m_effectChannelModel;

View File

@@ -26,7 +26,7 @@
#ifndef SAMPLE_BUFFER_H
#define SAMPLE_BUFFER_H
#include <QtCore/QMutex>
#include <QtCore/QReadWriteLock>
#include <QtCore/QObject>
#include <QtCore/QRect>
@@ -151,21 +151,21 @@ public:
void setLoopStartFrame( f_cnt_t _start )
{
m_varLock.lock();
m_varLock.lockForWrite();
m_loopStartFrame = _start;
m_varLock.unlock();
}
void setLoopEndFrame( f_cnt_t _end )
{
m_varLock.lock();
m_varLock.lockForWrite();
m_loopEndFrame = _end;
m_varLock.unlock();
}
void setAllPointFrames( f_cnt_t _start, f_cnt_t _end, f_cnt_t _loopstart, f_cnt_t _loopend )
{
m_varLock.lock();
m_varLock.lockForWrite();
m_startFrame = _start;
m_endFrame = _end;
m_loopStartFrame = _loopstart;
@@ -205,14 +205,14 @@ public:
inline void setFrequency( float _freq )
{
m_varLock.lock();
m_varLock.lockForWrite();
m_frequency = _freq;
m_varLock.unlock();
}
inline void setSampleRate( sample_rate_t _rate )
{
m_varLock.lock();
m_varLock.lockForWrite();
m_sampleRate = _rate;
m_varLock.unlock();
}
@@ -291,7 +291,7 @@ private:
sampleFrame * m_origData;
f_cnt_t m_origFrames;
sampleFrame * m_data;
QMutex m_varLock;
QReadWriteLock m_varLock;
f_cnt_t m_frames;
f_cnt_t m_startFrame;
f_cnt_t m_endFrame;

View File

@@ -147,8 +147,8 @@ public:
private:
AudioPort m_audioPort;
FloatModel m_volumeModel;
AudioPort m_audioPort;
friend class SampleTrackView;