Browse Source

Fix for a linux build error; CoreAudio fix for mac; added some notes to the plugin framework docs

tags/2021-05-28
jules 16 years ago
parent
commit
7fc53bff30
4 changed files with 33 additions and 20 deletions
  1. +1
    -0
      build/linux/platform_specific_code/juce_linux_Files.cpp
  2. +12
    -10
      build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp
  3. +7
    -0
      extras/audio plugins/How to use this framework.txt
  4. +13
    -10
      juce_amalgamated.cpp

+ 1
- 0
build/linux/platform_specific_code/juce_linux_Files.cpp View File

@@ -55,6 +55,7 @@ BEGIN_JUCE_NAMESPACE
#include "../../../src/juce_core/io/files/juce_FileOutputStream.h"
#include "../../../src/juce_core/basics/juce_SystemStats.h"
#include "../../../src/juce_core/basics/juce_Time.h"
#include "../../../src/juce_core/basics/juce_Random.h"
#include "../../../src/juce_core/io/network/juce_URL.h"
#include "../../../src/juce_core/io/files/juce_NamedPipe.h"
#include "../../../src/juce_core/threads/juce_InterProcessLock.h"


+ 12
- 10
build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp View File

@@ -124,22 +124,21 @@ public:
delete inputDevice;
}
void setTempBufferSize (const int numChannels, const int numSamples)
void allocateTempBuffers()
{
const int tempBufSize = bufferSize + 4;
juce_free (audioBuffer);
audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float));
audioBuffer = (float*) juce_calloc ((numInputChans + numOutputChans) * tempBufSize * sizeof (float));
zeromem (tempInputBuffers, sizeof (tempInputBuffers));
zeromem (tempOutputBuffers, sizeof (tempOutputBuffers));
int count = 0;
int i;
int i, count = 0;
for (i = 0; i < numInputChans; ++i)
tempInputBuffers[i] = audioBuffer + count++ * numSamples;
tempInputBuffers[i] = audioBuffer + count++ * tempBufSize;
for (i = 0; i < numOutputChans; ++i)
tempOutputBuffers[i] = audioBuffer + count++ * numSamples;
tempOutputBuffers[i] = audioBuffer + count++ * tempBufSize;
}
// returns the number of actual available channels
@@ -218,9 +217,7 @@ public:
if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf)))
{
bufferSize = framesPerBuf;
if (bufferSize > 0)
setTempBufferSize (numInputChans + numOutputChans, bufferSize);
allocateTempBuffers();
}
bufferSizes.clear();
@@ -611,6 +608,11 @@ public:
{
jassert (inputDevice->bufferSize == bufferSize);
// Sometimes the two linked devices seem to get their callbacks in
// parallel, so we need to lock both devices to stop the input data being
// changed while inside our callback..
const ScopedLock sl (inputDevice->callbackLock);
callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers,
inputDevice->numInputChans,
tempOutputBuffers,


+ 7
- 0
extras/audio plugins/How to use this framework.txt View File

@@ -116,9 +116,16 @@ make it easier to update to the latest code.
DAE.lib, DigiExt.lib, DSI.lib, PlugInLib.lib.
- In XCode: After installing the Digidesign SDK, make sure you've run the config_SDK_for_Mac
command in the SDK's root directory. This sets up some of the tools that it needs.
- In XCode: If you're using the Digi files CommonDebugSettings.xcconfig and CommonReleaseSettings.xcconfig,
then you'll probably have to remove the "-x c++" option from their OTHER_CFLAGS setting, because
that prevents it compiling obj-C. Also, you might need to comment-out the GCC_PREFIX_HEADER setting,
unless you can persuade precompiled headers to work (I've never managed to get them working myself..)
You'll also probably want to add a "MacBag" setting to these files, rather than putting it into
your project - e.g. "MacBag = /Users/jules/SDKs/PT_80_SDK/MacBag"
-----------------------------------------------------------------------------------------------------
Choosing the formats to build
=============================


+ 13
- 10
juce_amalgamated.cpp View File

@@ -267204,6 +267204,7 @@ NSRect NSViewComponentPeer::constrainRect (NSRect r)
current.origin.y = [[[NSScreen screens] objectAtIndex: 0] frame].size.height - current.origin.y - current.size.height;

r.origin.y = [[[NSScreen screens] objectAtIndex: 0] frame].size.height - r.origin.y - r.size.height;

int x = (int) r.origin.x;
int y = (int) r.origin.y;
int w = (int) r.size.width;
@@ -270883,22 +270884,21 @@ public:
delete inputDevice;
}

void setTempBufferSize (const int numChannels, const int numSamples)
void allocateTempBuffers()
{
const int tempBufSize = bufferSize + 4;
juce_free (audioBuffer);

audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float));
audioBuffer = (float*) juce_calloc ((numInputChans + numOutputChans) * tempBufSize * sizeof (float));

zeromem (tempInputBuffers, sizeof (tempInputBuffers));
zeromem (tempOutputBuffers, sizeof (tempOutputBuffers));

int count = 0;
int i;
int i, count = 0;
for (i = 0; i < numInputChans; ++i)
tempInputBuffers[i] = audioBuffer + count++ * numSamples;
tempInputBuffers[i] = audioBuffer + count++ * tempBufSize;

for (i = 0; i < numOutputChans; ++i)
tempOutputBuffers[i] = audioBuffer + count++ * numSamples;
tempOutputBuffers[i] = audioBuffer + count++ * tempBufSize;
}

// returns the number of actual available channels
@@ -270977,9 +270977,7 @@ public:
if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf)))
{
bufferSize = framesPerBuf;

if (bufferSize > 0)
setTempBufferSize (numInputChans + numOutputChans, bufferSize);
allocateTempBuffers();
}

bufferSizes.clear();
@@ -271368,6 +271366,11 @@ public:
{
jassert (inputDevice->bufferSize == bufferSize);

// Sometimes the two linked devices seem to get their callbacks in
// parallel, so we need to lock both devices to stop the input data being
// changed while inside our callback..
const ScopedLock sl (inputDevice->callbackLock);

callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers,
inputDevice->numInputChans,
tempOutputBuffers,


Loading…
Cancel
Save