diff --git a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp index 3be5d404a4..854b9f94fa 100644 --- a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp @@ -315,18 +315,17 @@ class FlacWriter : public AudioFormatWriter { public: //============================================================================== - FlacWriter (OutputStream* const out, - const double sampleRate_, - const int numChannels_, - const int bitsPerSample_) + FlacWriter (OutputStream* const out, double sampleRate_, + int numChannels_, int bitsPerSample_, int qualityOptionIndex) : AudioFormatWriter (out, TRANS (flacFormatName), - sampleRate_, - numChannels_, - bitsPerSample_) + sampleRate_, numChannels_, bitsPerSample_) { using namespace FlacNamespace; encoder = FLAC__stream_encoder_new(); + if (qualityOptionIndex > 0) + FLAC__stream_encoder_set_compression_level (encoder, jmin (8, qualityOptionIndex)); + FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2); FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2); FLAC__stream_encoder_set_channels (encoder, numChannels); @@ -510,20 +509,9 @@ const Array FlacAudioFormat::getPossibleBitDepths() return Array (depths); } -bool FlacAudioFormat::canDoStereo() -{ - return true; -} - -bool FlacAudioFormat::canDoMono() -{ - return true; -} - -bool FlacAudioFormat::isCompressed() -{ - return true; -} +bool FlacAudioFormat::canDoStereo() { return true; } +bool FlacAudioFormat::canDoMono() { return true; } +bool FlacAudioFormat::isCompressed() { return true; } AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, const bool deleteStreamIfOpeningFails) @@ -544,11 +532,11 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, unsigned int numberOfChannels, int bitsPerSample, const StringPairArray& /*metadataValues*/, - int /*qualityOptionIndex*/) + int qualityOptionIndex) { if (getPossibleBitDepths().contains (bitsPerSample)) { - ScopedPointer w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample)); + ScopedPointer w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample, qualityOptionIndex)); if (w->ok) return w.release(); diff --git a/src/containers/juce_Array.h b/src/containers/juce_Array.h index 8b227cf074..d38632a80c 100644 --- a/src/containers/juce_Array.h +++ b/src/containers/juce_Array.h @@ -33,15 +33,15 @@ //============================================================================== /** - Holds a list of simple objects, such as ints, doubles, or pointers. + Holds a resizable array of primitive or copy-by-value objects. Examples of arrays are: Array, Array or Array - The array can be used to hold simple, non-polymorphic objects as well as primitive types - to + The Array class can be used to hold simple, non-polymorphic objects as well as primitive types - to do so, the class must fulfil these requirements: - - it must have a copy constructor and operator= - - it must be able to be relocated in memory by a memcpy without this causing a problem - so no - objects whose functionality relies on pointers or references to themselves can be used. + - it must have a copy constructor and assignment operator + - it must be able to be relocated in memory by a memcpy without this causing any problems - so + objects whose functionality relies on external pointers or references to themselves can be used. You can of course have an array of pointers to any kind of object, e.g. Array , but if you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the diff --git a/src/gui/components/menus/juce_PopupMenu.cpp b/src/gui/components/menus/juce_PopupMenu.cpp index 3f1a744e75..130f776d91 100644 --- a/src/gui/components/menus/juce_PopupMenu.cpp +++ b/src/gui/components/menus/juce_PopupMenu.cpp @@ -283,8 +283,6 @@ public: menuCreationTime = lastFocused = lastScroll = Time::getMillisecondCounter(); setWantsKeyboardFocus (true); setMouseClickGrabsKeyboardFocus (false); - - setOpaque (true); setAlwaysOnTop (true); Desktop::getInstance().addGlobalMouseListener (this); @@ -324,6 +322,7 @@ public: ScopedPointer mw (new Window()); mw->setLookAndFeel (menu.lookAndFeel); mw->setWantsKeyboardFocus (false); + mw->setOpaque (mw->getLookAndFeel().findColour (PopupMenu::backgroundColourId).isOpaque() || ! Desktop::canUseSemiTransparentWindows()); mw->minimumWidth = minimumWidth; mw->maximumNumColumns = maximumNumColumns; mw->standardItemHeight = standardItemHeight; @@ -370,6 +369,9 @@ public: //============================================================================== void paint (Graphics& g) { + if (isOpaque()) + g.fillAll (Colours::white); + getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight()); } diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index b5b1f6331e..2e8c2ab6ba 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -1861,6 +1861,7 @@ private: return 0; case WM_WINDOWPOSCHANGED: + doMouseEvent (getCurrentMousePos()); handleMovedOrResized(); if (dontRepaint)