mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-29 02:40:05 +00:00
Copied a couple of fixes across from the modules branch.
This commit is contained in:
parent
32f2ac99b8
commit
62ea670f73
4 changed files with 33 additions and 15 deletions
|
|
@ -1049,7 +1049,7 @@ protected:
|
|||
|
||||
#define JUCE_AMALGAMATED_TEMPLATE 1
|
||||
|
||||
#if JUCE_BUILD_NATIVE
|
||||
#if (JUCE_BUILD_NATIVE || JUCE_BUILD_AMALGAMATION) && ! defined (__JUCE_AMALGAMATED_TEMPLATE_JUCEHEADER__)
|
||||
#include "juce_amalgamated.h" // FORCE_AMALGAMATOR_INCLUDE
|
||||
#endif
|
||||
|
||||
|
|
@ -28650,18 +28650,21 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
|
|||
HeapBlock <char> newData;
|
||||
newData.allocate (newTotalBytes, clearExtraSpace);
|
||||
|
||||
const int numChansToCopy = jmin (numChannels, newNumChannels);
|
||||
const size_t numBytesToCopy = sizeof (float) * jmin (newNumSamples, size);
|
||||
|
||||
float** const newChannels = reinterpret_cast <float**> (newData.getData());
|
||||
float* newChan = reinterpret_cast <float*> (newData + channelListSize);
|
||||
for (int i = 0; i < numChansToCopy; ++i)
|
||||
|
||||
for (int j = 0; j < newNumChannels; ++j)
|
||||
{
|
||||
memcpy (newChan, channels[i], numBytesToCopy);
|
||||
newChannels[i] = newChan;
|
||||
newChannels[j] = newChan;
|
||||
newChan += newNumSamples;
|
||||
}
|
||||
|
||||
const int numChansToCopy = jmin (numChannels, newNumChannels);
|
||||
for (int i = 0; i < numChansToCopy; ++i)
|
||||
memcpy (newChannels[i], channels[i], numBytesToCopy);
|
||||
|
||||
allocatedData.swapWith (newData);
|
||||
allocatedBytes = (int) newTotalBytes;
|
||||
channels = newChannels;
|
||||
|
|
@ -36215,8 +36218,12 @@ private:
|
|||
|
||||
void removeView (HIViewRef)
|
||||
{
|
||||
owner->dispatch (effEditClose, 0, 0, 0, 0);
|
||||
owner->dispatch (effEditSleep, 0, 0, 0, 0);
|
||||
if (owner->isOpen)
|
||||
{
|
||||
owner->isOpen = false;
|
||||
owner->dispatch (effEditClose, 0, 0, 0, 0);
|
||||
owner->dispatch (effEditSleep, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool getEmbeddedViewSize (int& w, int& h)
|
||||
|
|
@ -282841,7 +282848,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis
|
|||
{
|
||||
[NSApp setPresentationOptions: NSApplicationPresentationDefault];
|
||||
}
|
||||
#else
|
||||
#elif JUCE_SUPPORT_CARBON
|
||||
if (enableOrDisable)
|
||||
{
|
||||
SetSystemUIMode (kUIModeAllSuppressed, allowMenusAndBars ? kUIOptionAutoShowMenuBar : 0);
|
||||
|
|
@ -282851,6 +282858,8 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis
|
|||
{
|
||||
SetSystemUIMode (kUIModeNormal, 0);
|
||||
}
|
||||
#else
|
||||
jassertfalse;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,18 +171,21 @@ void AudioSampleBuffer::setSize (const int newNumChannels,
|
|||
HeapBlock <char> newData;
|
||||
newData.allocate (newTotalBytes, clearExtraSpace);
|
||||
|
||||
const int numChansToCopy = jmin (numChannels, newNumChannels);
|
||||
const size_t numBytesToCopy = sizeof (float) * jmin (newNumSamples, size);
|
||||
|
||||
float** const newChannels = reinterpret_cast <float**> (newData.getData());
|
||||
float* newChan = reinterpret_cast <float*> (newData + channelListSize);
|
||||
for (int i = 0; i < numChansToCopy; ++i)
|
||||
|
||||
for (int j = 0; j < newNumChannels; ++j)
|
||||
{
|
||||
memcpy (newChan, channels[i], numBytesToCopy);
|
||||
newChannels[i] = newChan;
|
||||
newChannels[j] = newChan;
|
||||
newChan += newNumSamples;
|
||||
}
|
||||
|
||||
const int numChansToCopy = jmin (numChannels, newNumChannels);
|
||||
for (int i = 0; i < numChansToCopy; ++i)
|
||||
memcpy (newChannels[i], channels[i], numBytesToCopy);
|
||||
|
||||
allocatedData.swapWith (newData);
|
||||
allocatedBytes = (int) newTotalBytes;
|
||||
channels = newChannels;
|
||||
|
|
|
|||
|
|
@ -1822,8 +1822,12 @@ private:
|
|||
|
||||
void removeView (HIViewRef)
|
||||
{
|
||||
owner->dispatch (effEditClose, 0, 0, 0, 0);
|
||||
owner->dispatch (effEditSleep, 0, 0, 0, 0);
|
||||
if (owner->isOpen)
|
||||
{
|
||||
owner->isOpen = false;
|
||||
owner->dispatch (effEditClose, 0, 0, 0, 0);
|
||||
owner->dispatch (effEditSleep, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool getEmbeddedViewSize (int& w, int& h)
|
||||
|
|
|
|||
|
|
@ -1753,7 +1753,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis
|
|||
{
|
||||
[NSApp setPresentationOptions: NSApplicationPresentationDefault];
|
||||
}
|
||||
#else
|
||||
#elif JUCE_SUPPORT_CARBON
|
||||
if (enableOrDisable)
|
||||
{
|
||||
SetSystemUIMode (kUIModeAllSuppressed, allowMenusAndBars ? kUIOptionAutoShowMenuBar : 0);
|
||||
|
|
@ -1763,6 +1763,8 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis
|
|||
{
|
||||
SetSystemUIMode (kUIModeNormal, 0);
|
||||
}
|
||||
#else
|
||||
jassertfalse;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue