mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
On OSX/linux, made sure the MidiOutput closes its thread on destruction.
This commit is contained in:
parent
5bd71401d8
commit
9fc2a0ca27
4 changed files with 13 additions and 8 deletions
|
|
@ -41,6 +41,7 @@ MidiOutput* MidiOutput::openDevice (int index)
|
|||
|
||||
MidiOutput::~MidiOutput()
|
||||
{
|
||||
stopBackgroundThread();
|
||||
}
|
||||
|
||||
void MidiOutput::sendMessageNow (const MidiMessage&)
|
||||
|
|
|
|||
|
|
@ -512,12 +512,14 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName)
|
|||
|
||||
MidiOutput::~MidiOutput()
|
||||
{
|
||||
delete static_cast <MidiOutputDevice*> (internal);
|
||||
stopBackgroundThread();
|
||||
|
||||
delete static_cast<MidiOutputDevice*> (internal);
|
||||
}
|
||||
|
||||
void MidiOutput::sendMessageNow (const MidiMessage& message)
|
||||
{
|
||||
static_cast <MidiOutputDevice*> (internal)->sendMessageNow (message);
|
||||
static_cast<MidiOutputDevice*> (internal)->sendMessageNow (message);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -529,7 +531,7 @@ MidiInput::MidiInput (const String& nm)
|
|||
MidiInput::~MidiInput()
|
||||
{
|
||||
stop();
|
||||
delete static_cast <AlsaPortAndCallback*> (internal);
|
||||
delete static_cast<AlsaPortAndCallback*> (internal);
|
||||
}
|
||||
|
||||
void MidiInput::start()
|
||||
|
|
|
|||
|
|
@ -357,6 +357,8 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName)
|
|||
|
||||
MidiOutput::~MidiOutput()
|
||||
{
|
||||
stopBackgroundThread();
|
||||
|
||||
delete static_cast<CoreMidiHelpers::MidiPortAndEndpoint*> (internal);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -297,11 +297,11 @@ MidiInput::MidiInput (const String& name_)
|
|||
|
||||
MidiInput::~MidiInput()
|
||||
{
|
||||
delete static_cast <MidiInCollector*> (internal);
|
||||
delete static_cast<MidiInCollector*> (internal);
|
||||
}
|
||||
|
||||
void MidiInput::start() { static_cast <MidiInCollector*> (internal)->start(); }
|
||||
void MidiInput::stop() { static_cast <MidiInCollector*> (internal)->stop(); }
|
||||
void MidiInput::start() { static_cast<MidiInCollector*> (internal)->start(); }
|
||||
void MidiInput::stop() { static_cast<MidiInCollector*> (internal)->stop(); }
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -432,7 +432,7 @@ MidiOutput::~MidiOutput()
|
|||
{
|
||||
stopBackgroundThread();
|
||||
|
||||
MidiOutHandle* const h = static_cast <MidiOutHandle*> (internal);
|
||||
MidiOutHandle* const h = static_cast<MidiOutHandle*> (internal);
|
||||
|
||||
if (MidiOutHandle::activeHandles.contains (h) && --(h->refCount) == 0)
|
||||
{
|
||||
|
|
@ -444,7 +444,7 @@ MidiOutput::~MidiOutput()
|
|||
|
||||
void MidiOutput::sendMessageNow (const MidiMessage& message)
|
||||
{
|
||||
const MidiOutHandle* const handle = static_cast <const MidiOutHandle*> (internal);
|
||||
const MidiOutHandle* const handle = static_cast<const MidiOutHandle*> (internal);
|
||||
|
||||
if (message.getRawDataSize() > 3 || message.isSysEx())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue