1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

minor fixes to callFunctionOnMessageThread, menu positioning on windows, and audio thumbnails

This commit is contained in:
jules 2008-12-10 11:51:16 +00:00
parent fa401f1952
commit 3050cfd7f3
3 changed files with 30 additions and 10 deletions

View file

@ -18237,8 +18237,9 @@ void AudioThumbnail::setSource (InputSource* const newSource)
clear();
if (! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
if (newSource != 0
&& ! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
{
{
const ScopedLock sl (readerLock);
@ -63966,7 +63967,11 @@ private:
const Rectangle mon (Desktop::getInstance()
.getMonitorAreaContaining ((minX + maxX) / 2,
(minY + maxY) / 2,
#if JUCE_MAC
true));
#else
false)); // on windows, don't stop the menu overlapping the taskbar
#endif
int x, y, widthToUse, heightToUse;
layoutMenuItems (mon.getWidth() - 24, widthToUse, heightToUse);
@ -268621,12 +268626,19 @@ using namespace JUCE_NAMESPACE;
- (void) performCallback: (id) info
{
CallbackMessagePayload* pl = (CallbackMessagePayload*) info;
if (pl != 0)
if ([info isKindOfClass: [NSData class]])
{
pl->result = (*pl->function) (pl->parameter);
pl->hasBeenExecuted = true;
CallbackMessagePayload* pl = (CallbackMessagePayload*) [((NSData*) info) bytes];
if (pl != 0)
{
pl->result = (*pl->function) (pl->parameter);
pl->hasBeenExecuted = true;
}
}
else
{
jassertfalse // should never get here!
}
}
@ -268725,6 +268737,8 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* call
}
else
{
const ScopedAutoReleasePool pool;
CallbackMessagePayload cmp;
cmp.function = callback;
cmp.parameter = data;
@ -268732,7 +268746,8 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* call
cmp.hasBeenExecuted = false;
[juceAppDelegate performSelectorOnMainThread: @selector (performCallback:)
withObject: (id) &cmp
withObject: [NSData dataWithBytesNoCopy: &cmp
length: sizeof (cmp)]
waitUntilDone: YES];
return cmp.result;

View file

@ -105,8 +105,9 @@ void AudioThumbnail::setSource (InputSource* const newSource)
clear();
if (! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
if (newSource != 0
&& ! (cache.loadThumb (*this, newSource->hashCode())
&& isFullyLoaded()))
{
{
const ScopedLock sl (readerLock);

View file

@ -848,7 +848,11 @@ private:
const Rectangle mon (Desktop::getInstance()
.getMonitorAreaContaining ((minX + maxX) / 2,
(minY + maxY) / 2,
#if JUCE_MAC
true));
#else
false)); // on windows, don't stop the menu overlapping the taskbar
#endif
int x, y, widthToUse, heightToUse;
layoutMenuItems (mon.getWidth() - 24, widthToUse, heightToUse);