Merge branch 'stable-1.2'
# Conflicts: # include/MixerWorkerThread.h # src/core/MixerWorkerThread.cpp
This commit is contained in:
@@ -292,9 +292,7 @@ void ConfigManager::setDefaultSoundfont( const QString & _sf )
|
||||
|
||||
void ConfigManager::setBackgroundArtwork( const QString & _ba )
|
||||
{
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
m_backgroundArtwork = _ba;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ConfigManager::setGIGDir(const QString &gd)
|
||||
|
||||
@@ -344,7 +344,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n )
|
||||
if( _n->origin() == NotePlayHandle::OriginArpeggio ||
|
||||
_n->origin() == NotePlayHandle::OriginNoteStacking ||
|
||||
!m_arpEnabledModel.value() ||
|
||||
( _n->isReleased() && _n->releaseFramesDone() >= _n->actualReleaseFramesToDo() ) )
|
||||
_n->isReleased() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -412,7 +412,6 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n )
|
||||
// Skip notes randomly
|
||||
if( m_arpSkipModel.value() )
|
||||
{
|
||||
|
||||
if( 100 * ( (float) rand() / (float)( RAND_MAX + 1.0f ) ) < m_arpSkipModel.value() )
|
||||
{
|
||||
// Set master note to prevent the note to extend over skipped notes
|
||||
@@ -501,12 +500,6 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n )
|
||||
continue;
|
||||
}
|
||||
|
||||
float vol_level = 1.0f;
|
||||
if( _n->isReleased() )
|
||||
{
|
||||
vol_level = _n->volumeLevel( cur_frame + gated_frames );
|
||||
}
|
||||
|
||||
// create new arp-note
|
||||
|
||||
// create sub-note-play-handle, only ptr to note is different
|
||||
@@ -515,7 +508,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n )
|
||||
NotePlayHandleManager::acquire( _n->instrumentTrack(),
|
||||
frames_processed,
|
||||
gated_frames,
|
||||
Note( MidiTime( 0 ), MidiTime( 0 ), sub_note_key, (volume_t) qRound( _n->getVolume() * vol_level ),
|
||||
Note( MidiTime( 0 ), MidiTime( 0 ), sub_note_key, _n->getVolume(),
|
||||
_n->getPanning(), _n->detuning() ),
|
||||
_n, -1, NotePlayHandle::OriginArpeggio )
|
||||
);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "MixerWorkerThread.h"
|
||||
|
||||
#include <xmmintrin.h>
|
||||
#include <QDebug>
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
@@ -39,7 +40,7 @@ QList<MixerWorkerThread *> MixerWorkerThread::workerThreads;
|
||||
// implementation of internal JobQueue
|
||||
void MixerWorkerThread::JobQueue::reset( OperationMode _opMode )
|
||||
{
|
||||
m_queueSize = 0;
|
||||
m_writeIndex = 0;
|
||||
m_itemsDone = 0;
|
||||
m_opMode = _opMode;
|
||||
}
|
||||
@@ -54,7 +55,13 @@ void MixerWorkerThread::JobQueue::addJob( ThreadableJob * _job )
|
||||
// update job state
|
||||
_job->queue();
|
||||
// actually queue the job via atomic operations
|
||||
m_items[m_queueSize++] = _job;
|
||||
auto index = m_writeIndex++;
|
||||
if (index < JOB_QUEUE_SIZE) {
|
||||
m_items[index] = _job;
|
||||
} else {
|
||||
qWarning() << "Job queue is full!";
|
||||
++m_itemsDone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,10 +70,10 @@ void MixerWorkerThread::JobQueue::addJob( ThreadableJob * _job )
|
||||
void MixerWorkerThread::JobQueue::run()
|
||||
{
|
||||
bool processedJob = true;
|
||||
while (processedJob && m_itemsDone < m_queueSize)
|
||||
while (processedJob && m_itemsDone < m_writeIndex)
|
||||
{
|
||||
processedJob = false;
|
||||
for( int i = 0; i < m_queueSize; ++i )
|
||||
for( int i = 0; i < m_writeIndex && i < JOB_QUEUE_SIZE; ++i )
|
||||
{
|
||||
ThreadableJob * job = m_items[i].exchange(nullptr);
|
||||
if( job )
|
||||
@@ -86,7 +93,7 @@ void MixerWorkerThread::JobQueue::run()
|
||||
|
||||
void MixerWorkerThread::JobQueue::wait()
|
||||
{
|
||||
while (m_itemsDone < m_queueSize)
|
||||
while (m_itemsDone < m_writeIndex)
|
||||
{
|
||||
#if defined(LMMS_HOST_X86) || defined(LMMS_HOST_X86_64)
|
||||
_mm_pause();
|
||||
|
||||
@@ -143,7 +143,9 @@ void TrackContentObject::movePosition( const MidiTime & pos )
|
||||
{
|
||||
if( m_startPosition != pos )
|
||||
{
|
||||
Engine::mixer()->requestChangeInModel();
|
||||
m_startPosition = pos;
|
||||
Engine::mixer()->doneChangeInModel();
|
||||
Engine::getSong()->updateLength();
|
||||
emit positionChanged();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@ MidiClient::MidiClient()
|
||||
MidiClient::~MidiClient()
|
||||
{
|
||||
//TODO: noteOffAll(); / clear all ports
|
||||
for (MidiPort* port : m_midiPorts)
|
||||
{
|
||||
port->invalidateCilent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
|
||||
#include "MidiPort.h"
|
||||
#include "MidiClient.h"
|
||||
#include "MidiDummy.h"
|
||||
#include "Note.h"
|
||||
#include "Song.h"
|
||||
|
||||
static MidiDummy s_dummyClient;
|
||||
|
||||
|
||||
|
||||
MidiPort::MidiPort( const QString& name,
|
||||
@@ -410,4 +413,7 @@ void MidiPort::updateOutputProgram()
|
||||
|
||||
|
||||
|
||||
|
||||
void MidiPort::invalidateCilent()
|
||||
{
|
||||
m_midiClient = &s_dummyClient;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>RowTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>RowTableView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
@@ -1525,9 +1525,7 @@ void SetupDialog::setDefaultSoundfont( const QString & _sf )
|
||||
|
||||
void SetupDialog::setBackgroundArtwork( const QString & _ba )
|
||||
{
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
m_backgroundArtwork = _ba;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user