From e06d581ec340b9cb4ed28cf0d59abdb074842b7e Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 2 Oct 2008 18:12:25 +0000 Subject: [PATCH] --- .../juce_linux_Windowing.cpp | 14 ++++- .../wrapper/formats/VST/juce_VstWrapper.cpp | 47 ++++++--------- juce_Config.h | 20 ++++++- .../juce_FlacAudioFormat.cpp | 44 +++++++------- .../juce_OggVorbisAudioFormat.cpp | 60 ++++++++++--------- .../components/windows/juce_ComponentPeer.cpp | 7 ++- .../gui/graphics/drawables/juce_SVGParser.cpp | 2 +- .../juce_GZIPDecompressorInputStream.cpp | 4 ++ 8 files changed, 116 insertions(+), 82 deletions(-) diff --git a/build/linux/platform_specific_code/juce_linux_Windowing.cpp b/build/linux/platform_specific_code/juce_linux_Windowing.cpp index 400788a215..58b0bfd6df 100644 --- a/build/linux/platform_specific_code/juce_linux_Windowing.cpp +++ b/build/linux/platform_specific_code/juce_linux_Windowing.cpp @@ -1753,6 +1753,14 @@ public: // For more recent KDE's... trayAtom = XInternAtom (display, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", false); XChangeProperty (display, windowH, trayAtom, XA_WINDOW, 32, PropModeReplace, (unsigned char*) &windowH, 1); + + // a minimum size must be specified for GNOME and Xfce, otherwise the icon is displayed with a width of 1 + XSizeHints* hints = XAllocSizeHints(); + hints->flags = PMinSize; + hints->min_width = 22; + hints->min_height = 22; + XSetWMNormalHints (display, windowH, hints); + XFree (hints); } void deleteTaskBarIcon() @@ -3250,7 +3258,11 @@ void SystemTrayIconComponent::paint (Graphics& g) const Image* const image = wp->getTaskbarIcon(); if (image != 0) - g.drawImageAt (image, 0, 0, false); + { + g.drawImageWithin (image, 0, 0, getWidth(), getHeight(), + RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, + false); + } } } diff --git a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp index b722aaa37e..3d0251a61e 100644 --- a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp @@ -638,49 +638,38 @@ public: } else { - if (! hasCreatedTempChannels) + int i; + for (i = 0; i < numOut; ++i) { - // do this just once when we start processing.. - hasCreatedTempChannels = true; + float* chan = (float*) tempChannels.getUnchecked(i); - // if some output channels are disabled, some hosts supply the same buffer - // for multiple channels - this buggers up our method of copying the - // inputs over the outputs, so we need to create unique temp buffers in this case.. - for (int i = 0; i < numOut; ++i) + if (chan == 0) { + chan = outputs[i]; + + // if some output channels are disabled, some hosts supply the same buffer + // for multiple channels - this buggers up our method of copying the + // inputs over the outputs, so we need to create unique temp buffers in this case.. for (int j = i; --j >= 0;) { - if (outputs[j] == outputs[i] && outputs[i] != 0) + if (outputs[j] == chan) { - tempChannels.set (i, juce_malloc (sizeof (float) * blockSize * 2)); + chan = juce_malloc (sizeof (float) * blockSize * 2); + tempChannels.set (i, chan); break; } } } - } - { - int i; - for (i = 0; i < numOut; ++i) - { - // if some output channels are disabled, the host may pass the same dummy buffer - // pointer for all of these outputs - and that means that we'd be copying all our - // input channels into the same place... so in this case, we use an internal dummy - // buffer which has enough channels for each input. - float* chan = (float*) tempChannels.getUnchecked(i); - if (chan == 0) - chan = outputs[i]; - - if (i < numIn && chan != inputs[i]) - memcpy (chan, inputs[i], sizeof (float) * numSamples); - - channels[i] = chan; - } + if (i < numIn && chan != inputs[i]) + memcpy (chan, inputs[i], sizeof (float) * numSamples); - for (; i < numIn; ++i) - channels[i] = inputs[i]; + channels[i] = chan; } + for (; i < numIn; ++i) + channels[i] = inputs[i]; + AudioSampleBuffer chans (channels, jmax (numIn, numOut), numSamples); filter->processBlock (chans, midiEvents); diff --git a/juce_Config.h b/juce_Config.h index 8ece855976..9648fa3155 100644 --- a/juce_Config.h +++ b/juce_Config.h @@ -123,6 +123,24 @@ #define JUCE_USE_OGGVORBIS 1 #endif +//============================================================================= +/** These flags let you turn off the direct inclusion of various 3rd-party libs + in the build. + You might need to turn these off if you're linking with these libs yourself + are struggling with name-clashes. +*/ +#ifndef JUCE_INCLUDE_ZLIB_CODE + #define JUCE_INCLUDE_ZLIB_CODE 1 +#endif + +#ifndef JUCE_INCLUDE_OGGVORBIS_CODE + #define JUCE_INCLUDE_OGGVORBIS_CODE 1 +#endif + +#ifndef JUCE_INCLUDE_FLAC_CODE + #define JUCE_INCLUDE_FLAC_CODE 1 +#endif + //============================================================================= /** This flag lets you enable support for CD-burning. You might want to disable it to build without the MS SDK under windows. @@ -159,7 +177,7 @@ /** Enabling this builds support for VST audio plugins. @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU */ -//#define JUCE_PLUGINHOST_VST 1 +#define JUCE_PLUGINHOST_VST 1 /** Enabling this builds support for AudioUnit audio plugins. @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST diff --git a/src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp b/src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp index 7d8a55eeba..3b817cf88e 100644 --- a/src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp +++ b/src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp @@ -45,29 +45,33 @@ namespace FlacNamespace { -#define FLAC__NO_DLL 1 +#if JUCE_INCLUDE_FLAC_CODE + #define FLAC__NO_DLL 1 -#if ! defined (SIZE_MAX) + #if ! defined (SIZE_MAX) #define SIZE_MAX 0xffffffff + #endif + + #define __STDC_LIMIT_MACROS 1 + #include "flac/all.h" + #include "flac/libFLAC/bitmath.c" + #include "flac/libFLAC/bitreader.c" + #include "flac/libFLAC/bitwriter.c" + #include "flac/libFLAC/cpu.c" + #include "flac/libFLAC/crc.c" + #include "flac/libFLAC/fixed.c" + #include "flac/libFLAC/float.c" + #include "flac/libFLAC/format.c" + #include "flac/libFLAC/lpc_flac.c" + #include "flac/libFLAC/md5.c" + #include "flac/libFLAC/memory.c" + #include "flac/libFLAC/stream_decoder.c" + #include "flac/libFLAC/stream_encoder.c" + #include "flac/libFLAC/stream_encoder_framing.c" + #include "flac/libFLAC/window_flac.c" +#else + #include #endif - -#define __STDC_LIMIT_MACROS 1 -#include "flac/all.h" -#include "flac/libFLAC/bitmath.c" -#include "flac/libFLAC/bitreader.c" -#include "flac/libFLAC/bitwriter.c" -#include "flac/libFLAC/cpu.c" -#include "flac/libFLAC/crc.c" -#include "flac/libFLAC/fixed.c" -#include "flac/libFLAC/float.c" -#include "flac/libFLAC/format.c" -#include "flac/libFLAC/lpc_flac.c" -#include "flac/libFLAC/md5.c" -#include "flac/libFLAC/memory.c" -#include "flac/libFLAC/stream_decoder.c" -#include "flac/libFLAC/stream_encoder.c" -#include "flac/libFLAC/stream_encoder_framing.c" -#include "flac/libFLAC/window_flac.c" } #ifdef _MSC_VER diff --git a/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp b/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp index 9756e2cf01..4538c31608 100644 --- a/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp +++ b/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp @@ -42,33 +42,39 @@ namespace OggVorbisNamespace { -#include "oggvorbis/vorbisenc.h" -#include "oggvorbis/codec.h" -#include "oggvorbis/vorbisfile.h" - -#include "oggvorbis/bitwise.c" -#include "oggvorbis/framing.c" -#include "oggvorbis/libvorbis-1.1.2/lib/analysis.c" -#include "oggvorbis/libvorbis-1.1.2/lib/bitrate.c" -#include "oggvorbis/libvorbis-1.1.2/lib/block.c" -#include "oggvorbis/libvorbis-1.1.2/lib/codebook.c" -#include "oggvorbis/libvorbis-1.1.2/lib/envelope.c" -#include "oggvorbis/libvorbis-1.1.2/lib/floor0.c" -#include "oggvorbis/libvorbis-1.1.2/lib/floor1.c" -#include "oggvorbis/libvorbis-1.1.2/lib/info.c" -#include "oggvorbis/libvorbis-1.1.2/lib/lpc.c" -#include "oggvorbis/libvorbis-1.1.2/lib/lsp.c" -#include "oggvorbis/libvorbis-1.1.2/lib/mapping0.c" -#include "oggvorbis/libvorbis-1.1.2/lib/mdct.c" -#include "oggvorbis/libvorbis-1.1.2/lib/psy.c" -#include "oggvorbis/libvorbis-1.1.2/lib/registry.c" -#include "oggvorbis/libvorbis-1.1.2/lib/res0.c" -#include "oggvorbis/libvorbis-1.1.2/lib/sharedbook.c" -#include "oggvorbis/libvorbis-1.1.2/lib/smallft.c" -#include "oggvorbis/libvorbis-1.1.2/lib/synthesis.c" -#include "oggvorbis/libvorbis-1.1.2/lib/vorbisenc.c" -#include "oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c" -#include "oggvorbis/libvorbis-1.1.2/lib/window.c" +#if JUCE_INCLUDE_OGGVORBIS_CODE + #include "oggvorbis/vorbisenc.h" + #include "oggvorbis/codec.h" + #include "oggvorbis/vorbisfile.h" + + #include "oggvorbis/bitwise.c" + #include "oggvorbis/framing.c" + #include "oggvorbis/libvorbis-1.1.2/lib/analysis.c" + #include "oggvorbis/libvorbis-1.1.2/lib/bitrate.c" + #include "oggvorbis/libvorbis-1.1.2/lib/block.c" + #include "oggvorbis/libvorbis-1.1.2/lib/codebook.c" + #include "oggvorbis/libvorbis-1.1.2/lib/envelope.c" + #include "oggvorbis/libvorbis-1.1.2/lib/floor0.c" + #include "oggvorbis/libvorbis-1.1.2/lib/floor1.c" + #include "oggvorbis/libvorbis-1.1.2/lib/info.c" + #include "oggvorbis/libvorbis-1.1.2/lib/lpc.c" + #include "oggvorbis/libvorbis-1.1.2/lib/lsp.c" + #include "oggvorbis/libvorbis-1.1.2/lib/mapping0.c" + #include "oggvorbis/libvorbis-1.1.2/lib/mdct.c" + #include "oggvorbis/libvorbis-1.1.2/lib/psy.c" + #include "oggvorbis/libvorbis-1.1.2/lib/registry.c" + #include "oggvorbis/libvorbis-1.1.2/lib/res0.c" + #include "oggvorbis/libvorbis-1.1.2/lib/sharedbook.c" + #include "oggvorbis/libvorbis-1.1.2/lib/smallft.c" + #include "oggvorbis/libvorbis-1.1.2/lib/synthesis.c" + #include "oggvorbis/libvorbis-1.1.2/lib/vorbisenc.c" + #include "oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c" + #include "oggvorbis/libvorbis-1.1.2/lib/window.c" +#else + #include + #include + #include +#endif } BEGIN_JUCE_NAMESPACE diff --git a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp index 5da6fe89e2..672fb1cc59 100644 --- a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp @@ -375,9 +375,10 @@ void ComponentPeer::handleMessage (const Message& message) { if (message.intParameter1 == fakeMouseMoveMessage) { - handleMouseMove (message.intParameter2, - message.intParameter3, - Time::currentTimeMillis()); + if (! ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown()) + handleMouseMove (message.intParameter2, + message.intParameter3, + Time::currentTimeMillis()); } } diff --git a/src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp b/src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp index d0cc29b889..855a3d23e8 100644 --- a/src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp @@ -1137,7 +1137,7 @@ private: tokens.trim(); tokens.removeEmptyStrings(); - if (tokens[0].containsChar T('%')) + if (tokens[0].containsChar (T('%'))) return Colour ((uint8) roundDoubleToInt (2.55 * tokens[0].getDoubleValue()), (uint8) roundDoubleToInt (2.55 * tokens[1].getDoubleValue()), (uint8) roundDoubleToInt (2.55 * tokens[2].getDoubleValue())); diff --git a/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp b/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp index ad1c8b006d..54db9389b7 100644 --- a/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp +++ b/src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp @@ -38,6 +38,7 @@ namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE extern "C" { #undef OS_CODE @@ -68,6 +69,9 @@ namespace zlibNamespace #include "zlib/zutil.c" #undef Byte } +#else + #include +#endif } #if JUCE_MSVC