diff --git a/extras/audio plugins/How to use this framework.txt b/extras/audio plugins/How to use this framework.txt index e8ea7fc0e6..73ea2a353a 100644 --- a/extras/audio plugins/How to use this framework.txt +++ b/extras/audio plugins/How to use this framework.txt @@ -241,6 +241,9 @@ any compilation problems if, for example, you don't have the appropriate SDK for - As for the PC, you'll need to make sure your project contains a correctly set-up JucePluginCharacteristics.h file - start with a copy of the one in the demo plugin project, and go through it making sure that all the values make sense for your plugin. +- The JucePluginCharacteristics.h file is included not only by the code, but also by the resources files - so it + needs to be locatable on both your normal header search path, and also on your resource include path, which is + the project setting called 'Rez Search Paths' - Because of the flat naming structure used by Objective-C, if a host loads several different plugins which all contain slightly different versions of the juce library, you can get nasty situations where all their obj-C classes are cross-linked to the similarly-named class in other modules, and everything turns into a big mess... diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index fc09d06471..2d5f88e122 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -782,6 +782,18 @@ public: setEmbeddedWindowToOurSize(); } + static void recursiveHIViewRepaint (HIViewRef view) throw() + { + HIViewSetNeedsDisplay (view, true); + HIViewRef child = HIViewGetFirstSubview (view); + + while (child != 0) + { + recursiveHIViewRepaint (child); + child = HIViewGetNextView (child); + } + } + void timerCallback() { setOurSizeToEmbeddedViewSize(); @@ -789,7 +801,7 @@ public: // To avoid strange overpainting problems when the UI is first opened, we'll // repaint it a few times during the first second that it's on-screen.. if ((Time::getCurrentTime() - creationTime).inMilliseconds() < 1000) - HIViewSetNeedsDisplay (embeddedView, true); + recursiveHIViewRepaint (HIViewGetRoot (wrapperWindow)); } OSStatus carbonEventHandler (EventHandlerCallRef nextHandlerRef, @@ -60024,29 +60036,19 @@ void Viewport::updateVisibleRegion() verticalScrollBar->setVisible (false); } - if ((contentComp->getWidth() > 0) && showHScrollbar - && getHeight() > getScrollBarThickness()) - { - horizontalScrollBar->setRangeLimits (0.0, contentComp->getWidth()); - horizontalScrollBar->setCurrentRange (newVX, getMaximumVisibleWidth()); - horizontalScrollBar->setSingleStepSize (singleStepX); - } - else - { + horizontalScrollBar->setRangeLimits (0.0, contentComp->getWidth()); + horizontalScrollBar->setCurrentRange (newVX, getMaximumVisibleWidth()); + horizontalScrollBar->setSingleStepSize (singleStepX); + + if (! (contentComp->getWidth() > 0 && showHScrollbar && getHeight() > getScrollBarThickness())) horizontalScrollBar->setVisible (false); - } - if ((contentComp->getHeight() > 0) && showVScrollbar - && getWidth() > getScrollBarThickness()) - { - verticalScrollBar->setRangeLimits (0.0, contentComp->getHeight()); - verticalScrollBar->setCurrentRange (newVY, getMaximumVisibleHeight()); - verticalScrollBar->setSingleStepSize (singleStepY); - } - else - { + verticalScrollBar->setRangeLimits (0.0, contentComp->getHeight()); + verticalScrollBar->setCurrentRange (newVY, getMaximumVisibleHeight()); + verticalScrollBar->setSingleStepSize (singleStepY); + + if (! (contentComp->getHeight() > 0 && showVScrollbar && getWidth() > getScrollBarThickness())) verticalScrollBar->setVisible (false); - } if (verticalScrollBar->isVisible()) { @@ -122969,17 +122971,17 @@ public: } else { - if (startSampleInFile < reservoirStart - || startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511)) + if (startSampleInFile >= (int) lengthInSamples) { samplesInReservoir = 0; - - if (startSampleInFile >= (int) lengthInSamples) - break; - + } + else if (startSampleInFile < reservoirStart + || startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511)) + { // had some problems with flac crashing if the read pos is aligned more // accurately than this. Probably fixed in newer versions of the library, though. reservoirStart = (int) (startSampleInFile & ~511); + samplesInReservoir = 0; FLAC__stream_decoder_seek_absolute (decoder, (FLAC__uint64) reservoirStart); } else @@ -123240,9 +123242,13 @@ public: return FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; } - static FLAC__StreamEncoderTellStatus encodeTellCallback (const FLAC__StreamEncoder*, FLAC__uint64*, void*) + static FLAC__StreamEncoderTellStatus encodeTellCallback (const FLAC__StreamEncoder*, FLAC__uint64* absolute_byte_offset, void* client_data) { - return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + if (client_data == 0) + return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + + *absolute_byte_offset = (FLAC__uint64) ((FlacWriter*) client_data)->output->getPosition(); + return FLAC__STREAM_ENCODER_TELL_STATUS_OK; } static void encodeMetadataCallback (const FLAC__StreamEncoder*, @@ -239115,11 +239121,13 @@ private: IConnectionPoint* connectionPoint; DWORD adviseCookie; - class EventHandler : public IDispatch + class EventHandler : public IDispatch, + public ComponentMovementWatcher { public: EventHandler (WebBrowserComponent* owner_) - : owner (owner_), + : ComponentMovementWatcher (owner_), + owner (owner_), refCount (0) { } @@ -239180,6 +239188,14 @@ private: return E_NOTIMPL; } + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) {} + void componentPeerChanged() {} + + void componentVisibilityChanged (Component&) + { + owner->visibilityChanged(); + } + juce_UseDebuggingNewOperator private: diff --git a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp index 4f3932f4f9..9c8dd6c005 100644 --- a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp @@ -177,17 +177,17 @@ public: } else { - if (startSampleInFile < reservoirStart - || startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511)) + if (startSampleInFile >= (int) lengthInSamples) { samplesInReservoir = 0; - - if (startSampleInFile >= (int) lengthInSamples) - break; - + } + else if (startSampleInFile < reservoirStart + || startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511)) + { // had some problems with flac crashing if the read pos is aligned more // accurately than this. Probably fixed in newer versions of the library, though. reservoirStart = (int) (startSampleInFile & ~511); + samplesInReservoir = 0; FLAC__stream_decoder_seek_absolute (decoder, (FLAC__uint64) reservoirStart); } else @@ -454,9 +454,13 @@ public: return FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; } - static FLAC__StreamEncoderTellStatus encodeTellCallback (const FLAC__StreamEncoder*, FLAC__uint64*, void*) + static FLAC__StreamEncoderTellStatus encodeTellCallback (const FLAC__StreamEncoder*, FLAC__uint64* absolute_byte_offset, void* client_data) { - return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + if (client_data == 0) + return FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; + + *absolute_byte_offset = (FLAC__uint64) ((FlacWriter*) client_data)->output->getPosition(); + return FLAC__STREAM_ENCODER_TELL_STATUS_OK; } static void encodeMetadataCallback (const FLAC__StreamEncoder*, diff --git a/src/gui/components/layout/juce_Viewport.cpp b/src/gui/components/layout/juce_Viewport.cpp index e748865ed7..9670d1734c 100644 --- a/src/gui/components/layout/juce_Viewport.cpp +++ b/src/gui/components/layout/juce_Viewport.cpp @@ -151,29 +151,19 @@ void Viewport::updateVisibleRegion() verticalScrollBar->setVisible (false); } - if ((contentComp->getWidth() > 0) && showHScrollbar - && getHeight() > getScrollBarThickness()) - { - horizontalScrollBar->setRangeLimits (0.0, contentComp->getWidth()); - horizontalScrollBar->setCurrentRange (newVX, getMaximumVisibleWidth()); - horizontalScrollBar->setSingleStepSize (singleStepX); - } - else - { + horizontalScrollBar->setRangeLimits (0.0, contentComp->getWidth()); + horizontalScrollBar->setCurrentRange (newVX, getMaximumVisibleWidth()); + horizontalScrollBar->setSingleStepSize (singleStepX); + + if (! (contentComp->getWidth() > 0 && showHScrollbar && getHeight() > getScrollBarThickness())) horizontalScrollBar->setVisible (false); - } - if ((contentComp->getHeight() > 0) && showVScrollbar - && getWidth() > getScrollBarThickness()) - { - verticalScrollBar->setRangeLimits (0.0, contentComp->getHeight()); - verticalScrollBar->setCurrentRange (newVY, getMaximumVisibleHeight()); - verticalScrollBar->setSingleStepSize (singleStepY); - } - else - { + verticalScrollBar->setRangeLimits (0.0, contentComp->getHeight()); + verticalScrollBar->setCurrentRange (newVY, getMaximumVisibleHeight()); + verticalScrollBar->setSingleStepSize (singleStepY); + + if (! (contentComp->getHeight() > 0 && showVScrollbar && getWidth() > getScrollBarThickness())) verticalScrollBar->setVisible (false); - } if (verticalScrollBar->isVisible()) { diff --git a/src/native/mac/juce_mac_CarbonViewWrapperComponent.h b/src/native/mac/juce_mac_CarbonViewWrapperComponent.h index e7d3f3070f..8e863035e7 100644 --- a/src/native/mac/juce_mac_CarbonViewWrapperComponent.h +++ b/src/native/mac/juce_mac_CarbonViewWrapperComponent.h @@ -202,6 +202,18 @@ public: setEmbeddedWindowToOurSize(); } + static void recursiveHIViewRepaint (HIViewRef view) throw() + { + HIViewSetNeedsDisplay (view, true); + HIViewRef child = HIViewGetFirstSubview (view); + + while (child != 0) + { + recursiveHIViewRepaint (child); + child = HIViewGetNextView (child); + } + } + void timerCallback() { setOurSizeToEmbeddedViewSize(); @@ -209,7 +221,7 @@ public: // To avoid strange overpainting problems when the UI is first opened, we'll // repaint it a few times during the first second that it's on-screen.. if ((Time::getCurrentTime() - creationTime).inMilliseconds() < 1000) - HIViewSetNeedsDisplay (embeddedView, true); + recursiveHIViewRepaint (HIViewGetRoot (wrapperWindow)); } OSStatus carbonEventHandler (EventHandlerCallRef nextHandlerRef, diff --git a/src/native/windows/juce_win32_WebBrowserComponent.cpp b/src/native/windows/juce_win32_WebBrowserComponent.cpp index da8a79ce15..dd4e987a20 100644 --- a/src/native/windows/juce_win32_WebBrowserComponent.cpp +++ b/src/native/windows/juce_win32_WebBrowserComponent.cpp @@ -129,11 +129,13 @@ private: DWORD adviseCookie; //============================================================================== - class EventHandler : public IDispatch + class EventHandler : public IDispatch, + public ComponentMovementWatcher { public: EventHandler (WebBrowserComponent* owner_) - : owner (owner_), + : ComponentMovementWatcher (owner_), + owner (owner_), refCount (0) { } @@ -195,6 +197,14 @@ private: return E_NOTIMPL; } + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) {} + void componentPeerChanged() {} + + void componentVisibilityChanged (Component&) + { + owner->visibilityChanged(); + } + //============================================================================== juce_UseDebuggingNewOperator