Fixed freeze when finishing export
Fixed stopping processing
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#define ALSA_PCM_NEW_HW_PARAMS_API
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
#include <QThread>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
|
||||
|
||||
@@ -25,17 +25,15 @@
|
||||
#ifndef AUDIO_DEVICE_H
|
||||
#define AUDIO_DEVICE_H
|
||||
|
||||
#include <QtCore/QPair>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QThread>
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "TabWidget.h"
|
||||
|
||||
|
||||
class AudioPort;
|
||||
class Mixer;
|
||||
class QThread;
|
||||
|
||||
|
||||
class AudioDevice
|
||||
@@ -135,6 +133,8 @@ protected:
|
||||
|
||||
bool hqAudio() const;
|
||||
|
||||
static void stopProcessingThread( QThread * thread );
|
||||
|
||||
|
||||
protected:
|
||||
bool m_supportsCapture;
|
||||
|
||||
@@ -84,11 +84,7 @@ private:
|
||||
|
||||
virtual void stopProcessing()
|
||||
{
|
||||
if( isRunning() )
|
||||
{
|
||||
wait( 1000 );
|
||||
terminate();
|
||||
}
|
||||
stopProcessingThread( this );
|
||||
}
|
||||
|
||||
virtual void run()
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#ifdef LMMS_HAVE_OSS
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
#include "AudioDeviceSetupWidget.h"
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#ifdef LMMS_HAVE_PULSEAUDIO
|
||||
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <QThread>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
#include "AudioDeviceSetupWidget.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#ifdef LMMS_HAVE_SNDIO
|
||||
|
||||
#include <QThread>
|
||||
#include <sndio.h>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
|
||||
@@ -331,6 +331,8 @@ private:
|
||||
|
||||
virtual void run();
|
||||
|
||||
void write( surroundSampleFrame * buffer );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -347,6 +349,7 @@ private:
|
||||
|
||||
const surroundSampleFrame * renderNextBuffer();
|
||||
|
||||
void clearInternal();
|
||||
|
||||
void runChangesInModel();
|
||||
|
||||
@@ -403,6 +406,8 @@ private:
|
||||
|
||||
bool m_metronomeActive;
|
||||
|
||||
bool m_clearSignal;
|
||||
|
||||
bool m_changesSignal;
|
||||
bool m_waitForMixer;
|
||||
unsigned int m_changes;
|
||||
|
||||
@@ -57,6 +57,18 @@ public:
|
||||
m_reader_sem.release();
|
||||
}
|
||||
|
||||
bool tryWrite( T _element )
|
||||
{
|
||||
if( m_writer_sem.tryAcquire() )
|
||||
{
|
||||
m_buffer[m_writer_index++] = _element;
|
||||
m_writer_index %= m_size;
|
||||
m_reader_sem.release();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
T read()
|
||||
{
|
||||
m_reader_sem.acquire();
|
||||
|
||||
Reference in New Issue
Block a user