From ddc16536a3e918bc99ed03ffa92b8cbab396dfbb Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 13 Aug 2009 11:11:26 +0000 Subject: [PATCH] Changed the Linux native code files to use the same amalgamation file structure as the mac and windows ones do; made a small adjustment to the amalgamator, and removed some redundancy from the amalgamated files (if you are amalgamating code yourself, please build a new copy of the amalgamator, as the old one won't work correctly on this new code); fixed a few minor build warnings in linux --- build/linux/JUCE.make | 46 +- .../juce_linux_Audio.cpp | 48 +- .../juce_linux_AudioCDReader.cpp | 10 +- .../juce_linux_FileChooser.cpp | 13 +- .../juce_linux_Files.cpp | 40 +- .../juce_linux_Fonts.cpp | 25 +- .../juce_linux_Messaging.cpp | 23 +- .../juce_linux_Midi.cpp | 36 +- .../juce_linux_NativeCode.cpp | 120 + .../juce_linux_NativeIncludes.h | 122 + .../juce_linux_Network.cpp | 24 +- .../juce_linux_SystemStats.cpp | 22 +- .../juce_linux_Threads.cpp | 26 +- .../juce_linux_WebBrowserComponent.cpp | 10 +- .../juce_linux_Windowing.cpp | 64 +- .../platform_specific_code/linuxincludes.h | 54 - .../juce_mac_NamedPipe.cpp | 26 +- .../juce_mac_NativeCode.mm | 3 +- .../juce_posix_SharedCode.h | 3 +- extras/amalgamator/juce_AmalgamatorMain.cpp | 3 +- extras/amalgamator/juce_AppConfig.h | 14 +- extras/audio plugin host/src/juce_AppConfig.h | 13 +- .../audio plugins/demo/src/juce_AppConfig.h | 13 +- extras/binarybuilder/juce_AppConfig.h | 14 +- .../example projects/common/juce_AppConfig.h | 14 +- extras/juce demo/build/linux/JuceDemo.make | 12 +- extras/juce demo/build/win32_vc8/jucedemo.sln | 4 +- extras/juce demo/src/BinaryData.cpp | 354 +- extras/juce demo/src/BinaryData.h | 14 +- extras/juce demo/src/MainDemoWindow.cpp | 1356 +- .../src/binarydata/WebBrowserDemo.cpp | 60 +- extras/juce demo/src/demos/WebBrowserDemo.cpp | 60 +- extras/juce demo/src/juce_AppConfig.h | 13 +- extras/juce demo/src/jucedemo_headers.h | 154 +- extras/the jucer/build/linux/Jucer.make | 110 +- extras/the jucer/src/juce_AppConfig.h | 13 +- extras/the jucer/src/juce_LibrarySource.cpp | 9 + juce_Config.h | 2 +- juce_amalgamated.cpp | 20897 ++++------------ juce_amalgamated.h | 16 +- src/juce_amalgamated_template.cpp | 42 +- .../audio_file_formats/oggvorbis/codec.h | 2 +- .../oggvorbis/libvorbis-1.1.2/lib/analysis.c | 2 +- .../oggvorbis/libvorbis-1.1.2/lib/info.c | 4 +- .../libvorbis-1.1.2/lib/vorbisfile.c | 2 +- src/juce_core/basics/juce_StandardHeader.h | 4 - src/juce_core/io/streams/zlib/zutil.c | 2 +- src/juce_core/io/streams/zlib/zutil.h | 2 +- src/juce_core_includes.h | 12 +- 49 files changed, 6427 insertions(+), 17505 deletions(-) create mode 100644 build/linux/platform_specific_code/juce_linux_NativeCode.cpp create mode 100644 build/linux/platform_specific_code/juce_linux_NativeIncludes.h delete mode 100644 build/linux/platform_specific_code/linuxincludes.h diff --git a/build/linux/JUCE.make b/build/linux/JUCE.make index 34a32da02d..78f8440609 100644 --- a/build/linux/JUCE.make +++ b/build/linux/JUCE.make @@ -291,19 +291,20 @@ OBJECTS := \ $(OBJDIR)/juce_TopLevelWindow.o \ $(OBJDIR)/juce_ComponentPeer.o \ $(OBJDIR)/juce_AlertWindow.o \ - $(OBJDIR)/juce_linux_FileChooser.o \ + $(OBJDIR)/juce_linux_Files.o \ + $(OBJDIR)/juce_linux_Audio.o \ $(OBJDIR)/juce_linux_Fonts.o \ - $(OBJDIR)/juce_linux_Messaging.o \ - $(OBJDIR)/juce_linux_Midi.o \ + $(OBJDIR)/juce_linux_Network.o \ $(OBJDIR)/juce_linux_NamedPipe.o \ + $(OBJDIR)/juce_linux_Midi.o \ + $(OBJDIR)/juce_linux_Windowing.o \ + $(OBJDIR)/juce_linux_AudioCDReader.o \ $(OBJDIR)/juce_linux_Threads.o \ + $(OBJDIR)/juce_linux_Messaging.o \ $(OBJDIR)/juce_linux_SystemStats.o \ + $(OBJDIR)/juce_linux_NativeCode.o \ + $(OBJDIR)/juce_linux_FileChooser.o \ $(OBJDIR)/juce_linux_WebBrowserComponent.o \ - $(OBJDIR)/juce_linux_Audio.o \ - $(OBJDIR)/juce_linux_Network.o \ - $(OBJDIR)/juce_linux_AudioCDReader.o \ - $(OBJDIR)/juce_linux_Files.o \ - $(OBJDIR)/juce_linux_Windowing.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) @@ -1605,22 +1606,22 @@ $(OBJDIR)/juce_AlertWindow.o: ../../src/juce_appframework/gui/components/windows @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_FileChooser.o: platform_specific_code/juce_linux_FileChooser.cpp +$(OBJDIR)/juce_linux_Files.o: platform_specific_code/juce_linux_Files.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Fonts.o: platform_specific_code/juce_linux_Fonts.cpp +$(OBJDIR)/juce_linux_Audio.o: platform_specific_code/juce_linux_Audio.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Messaging.o: platform_specific_code/juce_linux_Messaging.cpp +$(OBJDIR)/juce_linux_Fonts.o: platform_specific_code/juce_linux_Fonts.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Midi.o: platform_specific_code/juce_linux_Midi.cpp +$(OBJDIR)/juce_linux_Network.o: platform_specific_code/juce_linux_Network.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" @@ -1630,42 +1631,47 @@ $(OBJDIR)/juce_linux_NamedPipe.o: platform_specific_code/juce_linux_NamedPipe.cp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Threads.o: platform_specific_code/juce_linux_Threads.cpp +$(OBJDIR)/juce_linux_Midi.o: platform_specific_code/juce_linux_Midi.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_SystemStats.o: platform_specific_code/juce_linux_SystemStats.cpp +$(OBJDIR)/juce_linux_Windowing.o: platform_specific_code/juce_linux_Windowing.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_WebBrowserComponent.o: platform_specific_code/juce_linux_WebBrowserComponent.cpp +$(OBJDIR)/juce_linux_AudioCDReader.o: platform_specific_code/juce_linux_AudioCDReader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Audio.o: platform_specific_code/juce_linux_Audio.cpp +$(OBJDIR)/juce_linux_Threads.o: platform_specific_code/juce_linux_Threads.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Network.o: platform_specific_code/juce_linux_Network.cpp +$(OBJDIR)/juce_linux_Messaging.o: platform_specific_code/juce_linux_Messaging.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_AudioCDReader.o: platform_specific_code/juce_linux_AudioCDReader.cpp +$(OBJDIR)/juce_linux_SystemStats.o: platform_specific_code/juce_linux_SystemStats.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Files.o: platform_specific_code/juce_linux_Files.cpp +$(OBJDIR)/juce_linux_NativeCode.o: platform_specific_code/juce_linux_NativeCode.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/juce_linux_Windowing.o: platform_specific_code/juce_linux_Windowing.cpp +$(OBJDIR)/juce_linux_FileChooser.o: platform_specific_code/juce_linux_FileChooser.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + +$(OBJDIR)/juce_linux_WebBrowserComponent.o: platform_specific_code/juce_linux_WebBrowserComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" diff --git a/build/linux/platform_specific_code/juce_linux_Audio.cpp b/build/linux/platform_specific_code/juce_linux_Audio.cpp index fbdfea120e..f5fee1c561 100644 --- a/build/linux/platform_specific_code/juce_linux_Audio.cpp +++ b/build/linux/platform_specific_code/juce_linux_Audio.cpp @@ -29,38 +29,13 @@ ============================================================================== */ -#include "../../../juce_Config.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE #if JUCE_ALSA -#include "linuxincludes.h" - -//============================================================================== -/* Got an include error here? If so, you've either not got ALSA installed, or you've - not got your paths set up correctly to find its header files. - - The package you need to install to get ASLA support is "libasound2-dev". - - If you don't have the ALSA library and don't want to build Juce with audio support, - just disable the JUCE_ALSA flag in juce_Config.h -*/ -#include - - //============================================================================== -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/io/files/juce_FileInputStream.h" -#include "../../../src/juce_core/basics/juce_Singleton.h" -#include "../../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.h" - static const int maxNumChans = 64; @@ -1028,20 +1003,13 @@ AudioIODeviceType* juce_createDefaultAudioIODeviceType() return new ALSAAudioIODeviceType(); } - -END_JUCE_NAMESPACE - - //============================================================================== #else // if ALSA is turned off.. -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" -AudioIODeviceType* juce_createDefaultAudioIODeviceType() { return 0; } - -END_JUCE_NAMESPACE +AudioIODeviceType* juce_createDefaultAudioIODeviceType() +{ + return 0; +} #endif +#endif diff --git a/build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp b/build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp index c09eb54148..e023ace41a 100644 --- a/build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp +++ b/build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp @@ -29,11 +29,9 @@ ============================================================================== */ -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== @@ -106,4 +104,4 @@ int AudioCDReader::getCDDBId() return 0; } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_FileChooser.cpp b/build/linux/platform_specific_code/juce_linux_FileChooser.cpp index c16c85863f..eca39220c1 100644 --- a/build/linux/platform_specific_code/juce_linux_FileChooser.cpp +++ b/build/linux/platform_specific_code/juce_linux_FileChooser.cpp @@ -29,14 +29,9 @@ ============================================================================== */ -#include "../../../juce_Config.h" -#include "linuxincludes.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" - +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== void FileChooser::showPlatformDialog (OwnedArray& results, @@ -53,4 +48,4 @@ void FileChooser::showPlatformDialog (OwnedArray& results, jassertfalse } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Files.cpp b/build/linux/platform_specific_code/juce_linux_Files.cpp index 95c592fc02..70c9be3c1c 100644 --- a/build/linux/platform_specific_code/juce_linux_Files.cpp +++ b/build/linux/platform_specific_code/juce_linux_Files.cpp @@ -29,20 +29,9 @@ ============================================================================== */ -#include "linuxincludes.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -#include -#include -#include -#include // for statfs -#include -#include -#include -#include -#include -#include -#include +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE #define U_ISOFS_SUPER_MAGIC (short) 0x9660 // linux/iso_fs.h #define U_MSDOS_SUPER_MAGIC (short) 0x4d44 // linux/msdos_fs.h @@ -50,26 +39,6 @@ #define U_SMB_SUPER_MAGIC (short) 0x517B // linux/smb_fs.h -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/io/files/juce_FileInputStream.h" -#include "../../../src/juce_core/io/files/juce_FileOutputStream.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/basics/juce_Random.h" -#include "../../../src/juce_core/io/network/juce_URL.h" -#include "../../../src/juce_core/io/files/juce_NamedPipe.h" -#include "../../../src/juce_core/threads/juce_InterProcessLock.h" -#include "../../../src/juce_core/threads/juce_Thread.h" - -//============================================================================== -/* - Note that a lot of methods that you'd expect to find in this file actually - live in juce_posix_SharedCode.h! -*/ -#include "../../macosx/platform_specific_code/juce_posix_SharedCode.h" - - //============================================================================== void juce_getFileTimes (const String& fileName, int64& modificationTime, @@ -479,5 +448,4 @@ bool juce_launchFile (const String& fileName, return cpid >= 0; } - -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Fonts.cpp b/build/linux/platform_specific_code/juce_linux_Fonts.cpp index 6a4303ed17..2e4c58e32a 100644 --- a/build/linux/platform_specific_code/juce_linux_Fonts.cpp +++ b/build/linux/platform_specific_code/juce_linux_Fonts.cpp @@ -29,26 +29,9 @@ ============================================================================== */ -#include "../../../juce_Config.h" -#include "linuxincludes.h" - -/* Got a build error here? You'll need to install the freetype library... - - The name of the package to install is "libfreetype6-dev". -*/ -#include -#include FT_FREETYPE_H - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/gui/graphics/fonts/juce_Font.h" -#include "../../../src/juce_core/basics/juce_Singleton.h" -#include "../../../src/juce_core/io/streams/juce_MemoryInputStream.h" -#include "../../../src/juce_core/io/files/juce_DirectoryIterator.h" -#include "../../../src/juce_core/text/juce_XmlDocument.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== @@ -637,4 +620,4 @@ void Typeface::getDefaultFontNames (String& defaultSans, String& defaultSerif, S defaultFixed = linux_getDefaultMonospacedFontName(); } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Messaging.cpp b/build/linux/platform_specific_code/juce_linux_Messaging.cpp index 1097b959fc..cbf38c360a 100644 --- a/build/linux/platform_specific_code/juce_linux_Messaging.cpp +++ b/build/linux/platform_specific_code/juce_linux_Messaging.cpp @@ -29,24 +29,11 @@ ============================================================================== */ -#include "../../../juce_Config.h" - -#include "linuxincludes.h" -#include -#include -#include -#include -#include -#include -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_core/threads/juce_WaitableEvent.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE +//============================================================================== #ifdef JUCE_DEBUG #define JUCE_DEBUG_XERRORS 1 #endif @@ -417,4 +404,4 @@ bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) return true; } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Midi.cpp b/build/linux/platform_specific_code/juce_linux_Midi.cpp index 390c182607..8c341fb19d 100644 --- a/build/linux/platform_specific_code/juce_linux_Midi.cpp +++ b/build/linux/platform_specific_code/juce_linux_Midi.cpp @@ -29,21 +29,12 @@ ============================================================================== */ -#include "../../../juce_Config.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE #if JUCE_ALSA -#include "../../../src/juce_core/basics/juce_StandardHeader.h" -#include - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/devices/juce_MidiOutput.h" -#include "../../../src/juce_appframework/audio/devices/juce_MidiInput.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/basics/juce_Time.h" - - //============================================================================== static snd_seq_t* iterateDevices (const bool forInput, StringArray& deviceNamesFound, @@ -442,23 +433,11 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba -END_JUCE_NAMESPACE - //============================================================================== - #else -//============================================================================== // (These are just stub functions if ALSA is unavailable...) -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/devices/juce_MidiOutput.h" -#include "../../../src/juce_appframework/audio/devices/juce_MidiInput.h" - -//============================================================================== const StringArray MidiOutput::getDevices() { return StringArray(); } int MidiOutput::getDefaultDeviceIndex() { return 0; } MidiOutput* MidiOutput::openDevice (int) { return 0; } @@ -469,11 +448,7 @@ bool MidiOutput::getVolume (float&, float&) { return false; } void MidiOutput::setVolume (float, float) {} void MidiOutput::sendMessageNow (const MidiMessage&) {} -MidiInput::MidiInput (const String& name_) - : name (name_), - internal (0) -{} - +MidiInput::MidiInput (const String& name_) : name (name_), internal (0) {} MidiInput::~MidiInput() {} void MidiInput::start() {} void MidiInput::stop() {} @@ -482,6 +457,5 @@ const StringArray MidiInput::getDevices() { return StringArray(); } MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return 0; } MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return 0; } -END_JUCE_NAMESPACE - +#endif #endif diff --git a/build/linux/platform_specific_code/juce_linux_NativeCode.cpp b/build/linux/platform_specific_code/juce_linux_NativeCode.cpp new file mode 100644 index 0000000000..6c06b6b8de --- /dev/null +++ b/build/linux/platform_specific_code/juce_linux_NativeCode.cpp @@ -0,0 +1,120 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ + +/* + This file wraps together all the mac-specific code, so that + we can include all the native headers just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the way of + the rest of the codebase. +*/ + +#include "juce_linux_NativeIncludes.h" + + +BEGIN_JUCE_NAMESPACE + +#include "../../../src/juce_core/io/files/juce_FileInputStream.h" +#include "../../../src/juce_core/io/files/juce_FileOutputStream.h" +#include "../../../src/juce_core/basics/juce_SystemStats.h" +#include "../../../src/juce_core/basics/juce_Time.h" +#include "../../../src/juce_core/basics/juce_Random.h" +#include "../../../src/juce_core/io/network/juce_URL.h" +#include "../../../src/juce_core/io/files/juce_NamedPipe.h" +#include "../../../src/juce_core/threads/juce_InterProcessLock.h" +#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" +#include "../../../src/juce_core/threads/juce_Thread.h" +#include "../../../src/juce_core/threads/juce_ScopedLock.h" +#include "../../../src/juce_core/io/files/juce_File.h" +#include "../../../src/juce_core/basics/juce_Singleton.h" +#include "../../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.h" +#include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.h" +#include "../../../src/juce_appframework/gui/graphics/fonts/juce_Font.h" +#include "../../../src/juce_core/io/streams/juce_MemoryInputStream.h" +#include "../../../src/juce_core/io/files/juce_DirectoryIterator.h" +#include "../../../src/juce_core/text/juce_XmlDocument.h" +#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" +#include "../../../src/juce_appframework/events/juce_MessageManager.h" +#include "../../../src/juce_core/threads/juce_WaitableEvent.h" +#include "../../../src/juce_core/threads/juce_Process.h" +#include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" +#include "../../../src/juce_appframework/audio/devices/juce_MidiOutput.h" +#include "../../../src/juce_appframework/audio/devices/juce_MidiInput.h" +#include "../../../src/juce_core/text/juce_StringArray.h" +#include "../../../src/juce_core/containers/juce_MemoryBlock.h" +#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +#include "../../../src/juce_core/threads/juce_CriticalSection.h" +#include "../../../src/juce_appframework/events/juce_Timer.h" +#include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" +#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPress.h" +#include "../../../src/juce_appframework/application/juce_SystemClipboard.h" +#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" +#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h" +#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" +#include "../../../src/juce_appframework/gui/components/juce_ComponentDeletionWatcher.h" +#include "../../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h" +#include "../../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.h" +#include "../../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" +#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h" +#include "../../../src/juce_appframework/gui/components/special/juce_SystemTrayIconComponent.h" +#include "../../../src/juce_appframework/application/juce_Application.h" + +/* Remove this macro if you're having problems compiling the cpu affinity + calls (the API for these has changed about quite a bit in various Linux + versions, and a lot of distros seem to ship with obsolete versions) +*/ +#if defined (CPU_ISSET) && ! defined (SUPPORT_AFFINITIES) + #define SUPPORT_AFFINITIES 1 +#endif + +//============================================================================== +#define JUCE_INCLUDED_FILE 1 + +// Now include the actual code files.. + +#include "../../macosx/platform_specific_code/juce_posix_SharedCode.h" +#include "juce_linux_Files.cpp" +#include "../../macosx/platform_specific_code/juce_mac_NamedPipe.cpp" +#include "juce_linux_Network.cpp" +#include "juce_linux_SystemStats.cpp" +#include "juce_linux_Threads.cpp" + +#if ! JUCE_ONLY_BUILD_CORE_LIBRARY + #include "juce_linux_Messaging.cpp" + #include "juce_linux_Fonts.cpp" + #include "juce_linux_Windowing.cpp" + #include "juce_linux_Audio.cpp" + #include "juce_linux_Midi.cpp" + #include "juce_linux_AudioCDReader.cpp" + #include "juce_linux_FileChooser.cpp" + #include "juce_linux_WebBrowserComponent.cpp" +#endif + +END_JUCE_NAMESPACE diff --git a/build/linux/platform_specific_code/juce_linux_NativeIncludes.h b/build/linux/platform_specific_code/juce_linux_NativeIncludes.h new file mode 100644 index 0000000000..4e7e19f821 --- /dev/null +++ b/build/linux/platform_specific_code/juce_linux_NativeIncludes.h @@ -0,0 +1,122 @@ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ + +#ifndef __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ +#define __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ + +/* + This file wraps together all the linux-specific headers, so + that we can include them all just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the + way of the rest of the codebase. +*/ + +#include "../../../src/juce_core/basics/juce_StandardHeader.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Got a build error here? You'll need to install the freetype library... + The name of the package to install is "libfreetype6-dev". +*/ +#include +#include FT_FREETYPE_H + +#include +#include +#include +#include +#include +#include +#include + +#if JUCE_USE_XINERAMA + /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. */ + #include +#endif + +#if JUCE_USE_XSHM + #include + #include + #include +#endif + +#if JUCE_OPENGL + /* Got an include error here? + + If you want to install OpenGL support, the packages to get are "mesa-common-dev" + and "freeglut3-dev". + + Alternatively, you can turn off the JUCE_OPENGL flag in juce_Config.h if you + want to disable it. + */ + #include +#endif + +#undef KeyPress + +#if JUCE_ALSA + /* Got an include error here? If so, you've either not got ALSA installed, or you've + not got your paths set up correctly to find its header files. + + The package you need to install to get ASLA support is "libasound2-dev". + + If you don't have the ALSA library and don't want to build Juce with audio support, + just disable the JUCE_ALSA flag in juce_Config.h + */ + #include +#endif + +#undef SIZEOF + +#endif // __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ diff --git a/build/linux/platform_specific_code/juce_linux_Network.cpp b/build/linux/platform_specific_code/juce_linux_Network.cpp index ebfbc21d54..542e12cc83 100644 --- a/build/linux/platform_specific_code/juce_linux_Network.cpp +++ b/build/linux/platform_specific_code/juce_linux_Network.cpp @@ -29,25 +29,9 @@ ============================================================================== */ -#include "linuxincludes.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/text/juce_StringArray.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/containers/juce_MemoryBlock.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/io/network/juce_URL.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== @@ -500,4 +484,4 @@ int juce_seekInInternetFile (void* handle, int newPosition) return 0; } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_SystemStats.cpp b/build/linux/platform_specific_code/juce_linux_SystemStats.cpp index a6e822a718..df279f982a 100644 --- a/build/linux/platform_specific_code/juce_linux_SystemStats.cpp +++ b/build/linux/platform_specific_code/juce_linux_SystemStats.cpp @@ -29,23 +29,9 @@ ============================================================================== */ -#include "linuxincludes.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" -#include -#include - - -#ifndef CPU_ISSET - #undef SUPPORT_AFFINITIES -#endif - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== @@ -274,4 +260,4 @@ void PlatformUtilities::fpuReset() { } -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Threads.cpp b/build/linux/platform_specific_code/juce_linux_Threads.cpp index 0ab088d6d1..c0954893a9 100644 --- a/build/linux/platform_specific_code/juce_linux_Threads.cpp +++ b/build/linux/platform_specific_code/juce_linux_Threads.cpp @@ -29,33 +29,15 @@ ============================================================================== */ -#include "linuxincludes.h" -#include -#include -#include -#include -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/threads/juce_CriticalSection.h" -#include "../../../src/juce_core/threads/juce_WaitableEvent.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -//============================================================================== /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! */ -#ifndef CPU_ISSET - #undef SUPPORT_AFFINITIES -#endif - //============================================================================== void JUCE_API juce_threadEntryPoint (void*); @@ -276,4 +258,4 @@ void* PlatformUtilities::getProcedureEntryPoint (void* libraryHandle, const Stri #endif -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp b/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp index 906f0b9cc8..933cb96777 100644 --- a/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp +++ b/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp @@ -29,11 +29,9 @@ ============================================================================== */ -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE #if JUCE_WEB_BROWSER @@ -133,4 +131,4 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) } #endif -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/juce_linux_Windowing.cpp b/build/linux/platform_specific_code/juce_linux_Windowing.cpp index 8bb4c36f89..5d293823d0 100644 --- a/build/linux/platform_specific_code/juce_linux_Windowing.cpp +++ b/build/linux/platform_specific_code/juce_linux_Windowing.cpp @@ -29,65 +29,9 @@ ============================================================================== */ -#include "../../../juce_Config.h" -#include "linuxincludes.h" -#include -#include -#include -#include -#include -#include -#include - -#if JUCE_USE_XINERAMA - /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. - */ - #include -#endif - -#if JUCE_USE_XSHM - #include - #include - #include -#endif - -#if JUCE_OPENGL - /* Got an include error here? - - If you want to install OpenGL support, the packages to get are "mesa-common-dev" - and "freeglut3-dev". - - Alternatively, you can turn off the JUCE_OPENGL flag in juce_Config.h if you - want to disable it. - */ - #include -#endif - - -#undef KeyPress - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPress.h" -#include "../../../src/juce_appframework/application/juce_SystemClipboard.h" -#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" -#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h" -#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/gui/components/juce_ComponentDeletionWatcher.h" -#include "../../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h" -#include "../../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.h" -#include "../../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" -#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h" -#include "../../../src/juce_appframework/gui/components/special/juce_SystemTrayIconComponent.h" -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_core/io/network/juce_URL.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== #define TAKE_FOCUS 0 @@ -3369,4 +3313,4 @@ const int KeyPress::fastForwardKey = (0xffeeff02) | extendedKeyModifier; const int KeyPress::rewindKey = (0xffeeff03) | extendedKeyModifier; -END_JUCE_NAMESPACE +#endif diff --git a/build/linux/platform_specific_code/linuxincludes.h b/build/linux/platform_specific_code/linuxincludes.h deleted file mode 100644 index 580c709ed5..0000000000 --- a/build/linux/platform_specific_code/linuxincludes.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-7 by Raw Material Software ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the - GNU General Public License, as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later version. - - JUCE is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with JUCE; if not, visit www.gnu.org/licenses or write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------------ - - If you'd like to release a closed-source product which uses JUCE, commercial - licenses are also available: visit www.rawmaterialsoftware.com/juce for - more information. - - ============================================================================== -*/ - -#ifndef __LINUXINCLUDES_JUCEHEADER__ -#define __LINUXINCLUDES_JUCEHEADER__ - -// Linux Header Files: -#include -#include -#include -#include -#include -#include - -#include "../../../juce_Config.h" - -/* Remove this macro if you're having problems compiling the cpu affinity - calls (the API for these has changed about quite a bit in various Linux - versions, and a lot of distros seem to ship with obsolete versions) -*/ -#ifndef SUPPORT_AFFINITIES - #define SUPPORT_AFFINITIES 1 -#endif - - -#endif // __LINUXINCLUDES_JUCEHEADER__ diff --git a/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp b/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp index 5ec6ecc22d..e1c52543f9 100644 --- a/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp +++ b/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp @@ -29,26 +29,9 @@ ============================================================================== */ -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -#include -#include -#include - -// As well as being for the mac, this file is included by the linux build. - -#if ! JUCE_MAC - #include - #include - #include -#endif - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/io/files/juce_NamedPipe.h" -#include "../../../src/juce_core/threads/juce_Thread.h" - +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== struct NamedPipeInternal @@ -233,5 +216,4 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut return bytesWritten; } - -END_JUCE_NAMESPACE +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_NativeCode.mm b/build/macosx/platform_specific_code/juce_mac_NativeCode.mm index dcdc509f4c..899ce56283 100644 --- a/build/macosx/platform_specific_code/juce_mac_NativeCode.mm +++ b/build/macosx/platform_specific_code/juce_mac_NativeCode.mm @@ -38,7 +38,6 @@ #include "juce_mac_NativeIncludes.h" - BEGIN_JUCE_NAMESPACE //============================================================================== @@ -49,6 +48,7 @@ BEGIN_JUCE_NAMESPACE #include "../../../src/juce_core/threads/juce_Thread.h" #include "../../../src/juce_core/threads/juce_InterProcessLock.h" #include "../../../src/juce_core/io/files/juce_FileInputStream.h" +#include "../../../src/juce_core/io/files/juce_NamedPipe.h" #include "../../../src/juce_core/io/network/juce_URL.h" #include "../../../src/juce_core/misc/juce_PlatformUtilities.h" #include "../../../src/juce_core/text/juce_LocalisedStrings.h" @@ -109,6 +109,7 @@ BEGIN_JUCE_NAMESPACE #include "juce_mac_Strings.mm" #include "juce_mac_SystemStats.mm" #include "juce_mac_Network.mm" +#include "juce_mac_NamedPipe.cpp" #include "juce_mac_Threads.mm" #include "juce_posix_SharedCode.h" #include "juce_mac_Files.mm" diff --git a/build/macosx/platform_specific_code/juce_posix_SharedCode.h b/build/macosx/platform_specific_code/juce_posix_SharedCode.h index 5f7c91be3f..b1ed87e323 100644 --- a/build/macosx/platform_specific_code/juce_posix_SharedCode.h +++ b/build/macosx/platform_specific_code/juce_posix_SharedCode.h @@ -407,7 +407,8 @@ const String juce_getVolumeLabel (const String& filenameOnVolume, //============================================================================== void juce_runSystemCommand (const String& command) { - system ((const char*) command.toUTF8()); + int result = system ((const char*) command.toUTF8()); + (void) result; } const String juce_getOutputFromCommand (const String& command) diff --git a/extras/amalgamator/juce_AmalgamatorMain.cpp b/extras/amalgamator/juce_AmalgamatorMain.cpp index 45b48dc4d3..6bc8898534 100644 --- a/extras/amalgamator/juce_AmalgamatorMain.cpp +++ b/extras/amalgamator/juce_AmalgamatorMain.cpp @@ -131,7 +131,8 @@ static bool parseFile (const File& rootFolder, if (matchesWildcard (filename.replaceCharacter (T('\\'), T('/')), wildcards) && ! includesToIgnore.contains (targetFile.getFileName())) { - if (! alreadyIncludedFiles.contains (targetFile.getFullPathName())) + if (line.containsIgnoreCase (T("FORCE_AMALGAMATOR_INCLUDE")) + || ! alreadyIncludedFiles.contains (targetFile.getFullPathName())) { if (! canFileBeReincluded (targetFile)) alreadyIncludedFiles.add (targetFile.getFullPathName()); diff --git a/extras/amalgamator/juce_AppConfig.h b/extras/amalgamator/juce_AppConfig.h index 8095704736..5ae80b760f 100644 --- a/extras/amalgamator/juce_AppConfig.h +++ b/extras/amalgamator/juce_AppConfig.h @@ -1,10 +1,16 @@ - /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. + + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ #define JUCE_ONLY_BUILD_CORE_LIBRARY 1 diff --git a/extras/audio plugin host/src/juce_AppConfig.h b/extras/audio plugin host/src/juce_AppConfig.h index 721978f1ab..8fe33a01bc 100644 --- a/extras/audio plugin host/src/juce_AppConfig.h +++ b/extras/audio plugin host/src/juce_AppConfig.h @@ -31,10 +31,17 @@ /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. + + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ #define JUCE_PLUGINHOST_VST 1 diff --git a/extras/audio plugins/demo/src/juce_AppConfig.h b/extras/audio plugins/demo/src/juce_AppConfig.h index 62f1fdc5a7..e121abacff 100644 --- a/extras/audio plugins/demo/src/juce_AppConfig.h +++ b/extras/audio plugins/demo/src/juce_AppConfig.h @@ -31,10 +31,17 @@ /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. + + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ #define JUCE_QUICKTIME 0 diff --git a/extras/binarybuilder/juce_AppConfig.h b/extras/binarybuilder/juce_AppConfig.h index 8095704736..5ae80b760f 100644 --- a/extras/binarybuilder/juce_AppConfig.h +++ b/extras/binarybuilder/juce_AppConfig.h @@ -1,10 +1,16 @@ - /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. + + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ #define JUCE_ONLY_BUILD_CORE_LIBRARY 1 diff --git a/extras/example projects/common/juce_AppConfig.h b/extras/example projects/common/juce_AppConfig.h index 0a7095627b..1d8761f6d1 100644 --- a/extras/example projects/common/juce_AppConfig.h +++ b/extras/example projects/common/juce_AppConfig.h @@ -1,10 +1,16 @@ - /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. + + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 diff --git a/extras/juce demo/build/linux/JuceDemo.make b/extras/juce demo/build/linux/JuceDemo.make index 538e0662a9..61f547e33d 100644 --- a/extras/juce demo/build/linux/JuceDemo.make +++ b/extras/juce demo/build/linux/JuceDemo.make @@ -43,7 +43,6 @@ OBJECTS := \ $(OBJDIR)/BinaryData.o \ $(OBJDIR)/juce_LibrarySource.o \ $(OBJDIR)/MainDemoWindow.o \ - $(OBJDIR)/WebBrowserDemo.o \ $(OBJDIR)/WidgetsDemo.o \ $(OBJDIR)/ThreadingDemo.o \ $(OBJDIR)/TreeViewDemo.o \ @@ -56,6 +55,7 @@ OBJECTS := \ $(OBJDIR)/DragAndDropDemo.o \ $(OBJDIR)/CameraDemo.o \ $(OBJDIR)/AudioDemo.o \ + $(OBJDIR)/WebBrowserDemo.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) @@ -117,11 +117,6 @@ $(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/WebBrowserDemo.o: ../../src/demos/WebBrowserDemo.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" - $(OBJDIR)/WidgetsDemo.o: ../../src/demos/WidgetsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -182,5 +177,10 @@ $(OBJDIR)/AudioDemo.o: ../../src/demos/AudioDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" +$(OBJDIR)/WebBrowserDemo.o: ../../src/demos/WebBrowserDemo.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" + -include $(OBJECTS:%.o=%.d) diff --git a/extras/juce demo/build/win32_vc8/jucedemo.sln b/extras/juce demo/build/win32_vc8/jucedemo.sln index a08814acc5..bfcffff690 100644 --- a/extras/juce demo/build/win32_vc8/jucedemo.sln +++ b/extras/juce demo/build/win32_vc8/jucedemo.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jucedemo", "jucedemo.vcproj", "{050D65C2-17C4-4EE1-ABCE-BEA9DA83D77A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JUCE", "..\..\..\..\build\win32\vc8\JUCE.vcproj", "{AE232C11-D91C-4CA1-B24E-8B11A52EFF26}" diff --git a/extras/juce demo/src/BinaryData.cpp b/extras/juce demo/src/BinaryData.cpp index 757a55bff1..229d8c821e 100644 --- a/extras/juce demo/src/BinaryData.cpp +++ b/extras/juce demo/src/BinaryData.cpp @@ -1828,141 +1828,142 @@ static const unsigned char temp4[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61, 32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,84,114,101,101,86,105,101,119,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; const char* BinaryData::treeviewdemo_cpp = (const char*) temp4; -static const unsigned char temp5[] = {47,42,13,10,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, +static const unsigned char temp5[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,13,10,32,13,10,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32,116,104,101,32,74,85,67,69,32,108, - 105,98,114,97,114,121,32,45,32,34,74,117,108,101,115,39,32,85,116,105,108,105,116,121,32,67,108,97,115,115,32,69,120,116,101,110,115,105,111,110, - 115,34,13,10,32,67,111,112,121,114,105,103,104,116,32,50,48,48,52,45,55,32,98,121,32,82,97,119,32,77,97,116,101,114,105,97,108,32,83,111, - 102,116,119,97,114,101,32,108,116,100,46,13,10,32,13,10,32,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, + 61,61,61,61,13,10,13,10,32,32,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32,116,104,101,32,74,85,67,69, + 32,108,105,98,114,97,114,121,32,45,32,34,74,117,108,101,115,39,32,85,116,105,108,105,116,121,32,67,108,97,115,115,32,69,120,116,101,110,115,105, + 111,110,115,34,13,10,32,32,32,67,111,112,121,114,105,103,104,116,32,50,48,48,52,45,55,32,98,121,32,82,97,119,32,77,97,116,101,114,105,97, + 108,32,83,111,102,116,119,97,114,101,32,108,116,100,46,13,10,13,10,32,32,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, - 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,32,13,10,32,74,85,67,69,32,99,97,110,32,98,101,32,114,101,100,105,115,116,114, - 105,98,117,116,101,100,32,97,110,100,47,111,114,32,109,111,100,105,102,105,101,100,32,117,110,100,101,114,32,116,104,101,32,116,101,114,109,115,32,111, - 102,32,116,104,101,13,10,32,71,78,85,32,71,101,110,101,114,97,108,32,80,117,98,108,105,99,32,76,105,99,101,110,115,101,44,32,97,115,32,112, - 117,98,108,105,115,104,101,100,32,98,121,32,116,104,101,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110, - 59,13,10,32,101,105,116,104,101,114,32,118,101,114,115,105,111,110,32,50,32,111,102,32,116,104,101,32,76,105,99,101,110,115,101,44,32,111,114,32, - 40,97,116,32,121,111,117,114,32,111,112,116,105,111,110,41,32,97,110,121,32,108,97,116,101,114,32,118,101,114,115,105,111,110,46,13,10,32,13,10, - 32,74,85,67,69,32,105,115,32,100,105,115,116,114,105,98,117,116,101,100,32,105,110,32,116,104,101,32,104,111,112,101,32,116,104,97,116,32,105,116, - 32,119,105,108,108,32,98,101,32,117,115,101,102,117,108,44,13,10,32,98,117,116,32,87,73,84,72,79,85,84,32,65,78,89,32,87,65,82,82,65, - 78,84,89,59,32,119,105,116,104,111,117,116,32,101,118,101,110,32,116,104,101,32,105,109,112,108,105,101,100,32,119,97,114,114,97,110,116,121,32,111, - 102,13,10,32,77,69,82,67,72,65,78,84,65,66,73,76,73,84,89,32,111,114,32,70,73,84,78,69,83,83,32,70,79,82,32,65,32,80,65,82, - 84,73,67,85,76,65,82,32,80,85,82,80,79,83,69,46,32,32,83,101,101,32,116,104,101,13,10,32,71,78,85,32,71,101,110,101,114,97,108,32, - 80,117,98,108,105,99,32,76,105,99,101,110,115,101,32,102,111,114,32,109,111,114,101,32,100,101,116,97,105,108,115,46,13,10,32,13,10,32,89,111, - 117,32,115,104,111,117,108,100,32,104,97,118,101,32,114,101,99,101,105,118,101,100,32,97,32,99,111,112,121,32,111,102,32,116,104,101,32,71,78,85, - 32,71,101,110,101,114,97,108,32,80,117,98,108,105,99,32,76,105,99,101,110,115,101,13,10,32,97,108,111,110,103,32,119,105,116,104,32,74,85,67, - 69,59,32,105,102,32,110,111,116,44,32,118,105,115,105,116,32,119,119,119,46,103,110,117,46,111,114,103,47,108,105,99,101,110,115,101,115,32,111,114, - 32,119,114,105,116,101,32,116,111,32,116,104,101,13,10,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110, - 44,32,73,110,99,46,44,32,53,57,32,84,101,109,112,108,101,32,80,108,97,99,101,44,32,83,117,105,116,101,32,51,51,48,44,13,10,32,66,111, - 115,116,111,110,44,32,77,65,32,48,50,49,49,49,45,49,51,48,55,32,85,83,65,13,10,32,13,10,32,45,45,45,45,45,45,45,45,45,45,45, + 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,13,10,32,32,32,74,85,67,69,32,99,97,110,32,98,101,32,114,101, + 100,105,115,116,114,105,98,117,116,101,100,32,97,110,100,47,111,114,32,109,111,100,105,102,105,101,100,32,117,110,100,101,114,32,116,104,101,32,116,101, + 114,109,115,32,111,102,32,116,104,101,13,10,32,32,32,71,78,85,32,71,101,110,101,114,97,108,32,80,117,98,108,105,99,32,76,105,99,101,110,115, + 101,44,32,97,115,32,112,117,98,108,105,115,104,101,100,32,98,121,32,116,104,101,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117, + 110,100,97,116,105,111,110,59,13,10,32,32,32,101,105,116,104,101,114,32,118,101,114,115,105,111,110,32,50,32,111,102,32,116,104,101,32,76,105,99, + 101,110,115,101,44,32,111,114,32,40,97,116,32,121,111,117,114,32,111,112,116,105,111,110,41,32,97,110,121,32,108,97,116,101,114,32,118,101,114,115, + 105,111,110,46,13,10,13,10,32,32,32,74,85,67,69,32,105,115,32,100,105,115,116,114,105,98,117,116,101,100,32,105,110,32,116,104,101,32,104,111, + 112,101,32,116,104,97,116,32,105,116,32,119,105,108,108,32,98,101,32,117,115,101,102,117,108,44,13,10,32,32,32,98,117,116,32,87,73,84,72,79, + 85,84,32,65,78,89,32,87,65,82,82,65,78,84,89,59,32,119,105,116,104,111,117,116,32,101,118,101,110,32,116,104,101,32,105,109,112,108,105,101, + 100,32,119,97,114,114,97,110,116,121,32,111,102,13,10,32,32,32,77,69,82,67,72,65,78,84,65,66,73,76,73,84,89,32,111,114,32,70,73,84, + 78,69,83,83,32,70,79,82,32,65,32,80,65,82,84,73,67,85,76,65,82,32,80,85,82,80,79,83,69,46,32,32,83,101,101,32,116,104,101,13, + 10,32,32,32,71,78,85,32,71,101,110,101,114,97,108,32,80,117,98,108,105,99,32,76,105,99,101,110,115,101,32,102,111,114,32,109,111,114,101,32, + 100,101,116,97,105,108,115,46,13,10,13,10,32,32,32,89,111,117,32,115,104,111,117,108,100,32,104,97,118,101,32,114,101,99,101,105,118,101,100,32, + 97,32,99,111,112,121,32,111,102,32,116,104,101,32,71,78,85,32,71,101,110,101,114,97,108,32,80,117,98,108,105,99,32,76,105,99,101,110,115,101, + 13,10,32,32,32,97,108,111,110,103,32,119,105,116,104,32,74,85,67,69,59,32,105,102,32,110,111,116,44,32,118,105,115,105,116,32,119,119,119,46, + 103,110,117,46,111,114,103,47,108,105,99,101,110,115,101,115,32,111,114,32,119,114,105,116,101,32,116,111,32,116,104,101,13,10,32,32,32,70,114,101, + 101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110,44,32,73,110,99,46,44,32,53,57,32,84,101,109,112,108,101,32,80, + 108,97,99,101,44,32,83,117,105,116,101,32,51,51,48,44,13,10,32,32,32,66,111,115,116,111,110,44,32,77,65,32,48,50,49,49,49,45,49,51, + 48,55,32,85,83,65,13,10,13,10,32,32,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, - 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,32,13,10,32,73,102,32,121,111,117,39, - 100,32,108,105,107,101,32,116,111,32,114,101,108,101,97,115,101,32,97,32,99,108,111,115,101,100,45,115,111,117,114,99,101,32,112,114,111,100,117,99, - 116,32,119,104,105,99,104,32,117,115,101,115,32,74,85,67,69,44,32,99,111,109,109,101,114,99,105,97,108,13,10,32,108,105,99,101,110,115,101,115, - 32,97,114,101,32,97,108,115,111,32,97,118,97,105,108,97,98,108,101,58,32,118,105,115,105,116,32,119,119,119,46,114,97,119,109,97,116,101,114,105, - 97,108,115,111,102,116,119,97,114,101,46,99,111,109,47,106,117,99,101,32,102,111,114,13,10,32,109,111,114,101,32,105,110,102,111,114,109,97,116,105, - 111,110,46,13,10,32,13,10,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,13,10,32,42,47,13,10,13,10,35,105,110,99,108,117,100,101,32,34,46,46,47,106,117,99,101,100,101,109,111,95,104,101, - 97,100,101,114,115,46,104,34,13,10,13,10,35,105,102,32,74,85,67,69,95,87,69,66,95,66,82,79,87,83,69,82,13,10,13,10,47,47,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,47,42, - 42,32,87,101,39,108,108,32,117,115,101,32,97,32,115,117,98,99,108,97,115,115,32,111,102,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112, - 111,110,101,110,116,32,116,111,32,100,101,109,111,110,115,116,114,97,116,101,32,104,111,119,32,116,111,32,103,101,116,32,99,97,108,108,98,97,99,107, - 115,13,10,32,32,32,32,119,104,101,110,32,116,104,101,32,98,114,111,119,115,101,114,32,99,104,97,110,103,101,115,32,85,82,76,46,32,89,111,117, - 32,100,111,110,39,116,32,110,101,101,100,32,116,111,32,100,111,32,116,104,105,115,44,32,121,111,117,32,99,97,110,32,106,117,115,116,32,97,108,115, - 111,13,10,32,32,32,32,106,117,115,116,32,117,115,101,32,116,104,101,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32, - 99,108,97,115,115,32,100,105,114,101,99,116,108,121,46,13,10,42,47,13,10,99,108,97,115,115,32,68,101,109,111,66,114,111,119,115,101,114,67,111, - 109,112,111,110,101,110,116,32,32,58,32,112,117,98,108,105,99,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,13,10,123, - 13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110, - 116,32,40,84,101,120,116,69,100,105,116,111,114,42,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,95,41,13,10,32,32,32,32,32,32,32, - 32,58,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,95,41,13,10,32,32,32, - 32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,109,101,116,104,111,100,32,103,101,116,115,32,99,97,108, - 108,101,100,32,119,104,101,110,32,116,104,101,32,98,114,111,119,115,101,114,32,105,115,32,97,98,111,117,116,32,116,111,32,103,111,32,116,111,32,97, - 32,110,101,119,32,85,82,76,46,46,13,10,32,32,32,32,98,111,111,108,32,112,97,103,101,65,98,111,117,116,84,111,76,111,97,100,32,40,99,111, - 110,115,116,32,83,116,114,105,110,103,38,32,110,101,119,85,82,76,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,87, - 101,39,108,108,32,106,117,115,116,32,117,112,100,97,116,101,32,111,117,114,32,97,100,100,114,101,115,115,32,98,111,120,32,116,111,32,114,101,102,108, - 101,99,116,32,116,104,101,32,110,101,119,32,108,111,99,97,116,105,111,110,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84, - 101,120,116,66,111,120,45,62,115,101,116,84,101,120,116,32,40,110,101,119,85,82,76,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,47,47,32,119,101,32,99,111,117,108,100,32,114,101,116,117,114,110,32,102,97,108,115,101,32,104,101,114,101,32,116,111,32,116,101,108, - 108,32,116,104,101,32,98,114,111,119,115,101,114,32,110,111,116,32,116,111,32,103,111,32,97,104,101,97,100,32,119,105,116,104,13,10,32,32,32,32, - 32,32,32,32,47,47,32,108,111,97,100,105,110,103,32,116,104,101,32,112,97,103,101,46,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110, - 32,116,114,117,101,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,106,117,99,101,95,85,115,101,68,101,98,117,103, - 103,105,110,103,78,101,119,79,112,101,114,97,116,111,114,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,101,120,116,69,100,105, - 116,111,114,42,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,59,13,10,13,10,32,32,32,32,68,101,109,111,66,114,111,119,115,101,114,67, - 111,109,112,111,110,101,110,116,32,40,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,38,41,59,13,10,32,32,32,32,99, - 111,110,115,116,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,38,32,111,112,101,114,97,116,111,114,61,32,40,99,111, - 110,115,116,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,38,41,59,13,10,125,59,13,10,13,10,13,10,47,47,61, + 45,45,45,45,45,45,45,45,45,45,13,10,13,10,32,32,32,73,102,32,121,111,117,39,100,32,108,105,107,101,32,116,111,32,114,101,108,101,97,115, + 101,32,97,32,99,108,111,115,101,100,45,115,111,117,114,99,101,32,112,114,111,100,117,99,116,32,119,104,105,99,104,32,117,115,101,115,32,74,85,67, + 69,44,32,99,111,109,109,101,114,99,105,97,108,13,10,32,32,32,108,105,99,101,110,115,101,115,32,97,114,101,32,97,108,115,111,32,97,118,97,105, + 108,97,98,108,101,58,32,118,105,115,105,116,32,119,119,119,46,114,97,119,109,97,116,101,114,105,97,108,115,111,102,116,119,97,114,101,46,99,111,109, + 47,106,117,99,101,32,102,111,114,13,10,32,32,32,109,111,114,101,32,105,110,102,111,114,109,97,116,105,111,110,46,13,10,13,10,32,32,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,99, - 108,97,115,115,32,87,101,98,66,114,111,119,115,101,114,68,101,109,111,32,32,32,58,32,112,117,98,108,105,99,32,67,111,109,112,111,110,101,110,116, - 44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,117,98,108,105,99,32,84,101,120,116,69, - 100,105,116,111,114,76,105,115,116,101,110,101,114,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,112,117,98,108,105,99,32,66,117,116,116,111,110,76,105,115,116,101,110,101,114,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32, - 47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,42,47,13, + 10,13,10,35,105,110,99,108,117,100,101,32,34,46,46,47,106,117,99,101,100,101,109,111,95,104,101,97,100,101,114,115,46,104,34,13,10,13,10,35, + 105,102,32,74,85,67,69,95,87,69,66,95,66,82,79,87,83,69,82,13,10,13,10,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,47,42,42,32,87,101,39,108,108,32,117,115,101,32,97, + 32,115,117,98,99,108,97,115,115,32,111,102,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32,116,111,32,100,101,109,111, + 110,115,116,114,97,116,101,32,104,111,119,32,116,111,32,103,101,116,32,99,97,108,108,98,97,99,107,115,13,10,32,32,32,32,119,104,101,110,32,116, + 104,101,32,98,114,111,119,115,101,114,32,99,104,97,110,103,101,115,32,85,82,76,46,32,89,111,117,32,100,111,110,39,116,32,110,101,101,100,32,116, + 111,32,100,111,32,116,104,105,115,44,32,121,111,117,32,99,97,110,32,106,117,115,116,32,97,108,115,111,13,10,32,32,32,32,106,117,115,116,32,117, + 115,101,32,116,104,101,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32,99,108,97,115,115,32,100,105,114,101,99,116,108, + 121,46,13,10,42,47,13,10,99,108,97,115,115,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32,32,58,32,112,117, + 98,108,105,99,32,87,101,98,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32, + 32,32,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,13,10,32,32,32,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32,40,84,101,120,116,69,100,105,116,111,114, + 42,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,95,41,13,10,32,32,32,32,32,32,32,32,58,32,97,100,100,114,101,115,115,84,101,120, + 116,66,111,120,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,95,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10, + 32,32,32,32,47,47,32,84,104,105,115,32,109,101,116,104,111,100,32,103,101,116,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32, + 98,114,111,119,115,101,114,32,105,115,32,97,98,111,117,116,32,116,111,32,103,111,32,116,111,32,97,32,110,101,119,32,85,82,76,46,46,13,10,32, + 32,32,32,98,111,111,108,32,112,97,103,101,65,98,111,117,116,84,111,76,111,97,100,32,40,99,111,110,115,116,32,83,116,114,105,110,103,38,32,110, + 101,119,85,82,76,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,87,101,39,108,108,32,106,117,115,116,32,117,112,100, + 97,116,101,32,111,117,114,32,97,100,100,114,101,115,115,32,98,111,120,32,116,111,32,114,101,102,108,101,99,116,32,116,104,101,32,110,101,119,32,108, + 111,99,97,116,105,111,110,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,115,101,116,84,101, + 120,116,32,40,110,101,119,85,82,76,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,32,99,111,117, + 108,100,32,114,101,116,117,114,110,32,102,97,108,115,101,32,104,101,114,101,32,116,111,32,116,101,108,108,32,116,104,101,32,98,114,111,119,115,101,114, + 32,110,111,116,32,116,111,32,103,111,32,97,104,101,97,100,32,119,105,116,104,13,10,32,32,32,32,32,32,32,32,47,47,32,108,111,97,100,105,110, + 103,32,116,104,101,32,112,97,103,101,46,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,116,114,117,101,59,13,10,32,32,32,32,125, + 13,10,13,10,32,32,32,32,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,13,10,32,32,32,32,106,117,99,101,95,85,115,101,68,101,98,117,103,103,105,110,103,78,101,119,79,112,101,114,97,116, + 111,114,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,97,100,100,114,101,115,115,84, + 101,120,116,66,111,120,59,13,10,13,10,32,32,32,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32,40,68,101,109, + 111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,38,41,59,13,10,32,32,32,32,99,111,110,115,116,32,68,101,109,111,66,114,111,119, + 115,101,114,67,111,109,112,111,110,101,110,116,38,32,111,112,101,114,97,116,111,114,61,32,40,99,111,110,115,116,32,68,101,109,111,66,114,111,119,115, + 101,114,67,111,109,112,111,110,101,110,116,38,41,59,13,10,125,59,13,10,13,10,13,10,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,99,108,97,115,115,32,87,101,98,66,114,111,119,115, + 101,114,68,101,109,111,32,32,32,58,32,112,117,98,108,105,99,32,67,111,109,112,111,110,101,110,116,44,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,117,98,108,105,99,32,84,101,120,116,69,100,105,116,111,114,76,105,115,116,101,110,101,114, + 44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,117,98,108,105,99,32,66,117,116,116,111, + 110,76,105,115,116,101,110,101,114,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,47,47,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,87,101,98,66,114,111,119, + 115,101,114,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,34,87,101,98,32, + 66,114,111,119,115,101,114,34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114,101,97,116,101,32,97,110,32,97,100,100,114,101, + 115,115,32,98,111,120,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,97,100,100, + 114,101,115,115,84,101,120,116,66,111,120,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,40,41,41,59,13,10,32,32,32,32,32,32, + 32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,115,101,116,84,101,120,116,84,111,83,104,111,119,87,104,101,110,69,109,112,116,121, + 32,40,34,69,110,116,101,114,32,97,32,119,101,98,32,97,100,100,114,101,115,115,44,32,101,46,103,46,32,104,116,116,112,58,47,47,119,119,119,46, + 114,97,119,109,97,116,101,114,105,97,108,115,111,102,116,119,97,114,101,46,99,111,109,34,44,32,67,111,108,111,117,114,115,58,58,103,114,101,121,41, + 59,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,97,100,100,76,105,115,116,101,110,101,114,32,40, + 116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,116,104,101,32,97,99,116,117,97,108,32,98, + 114,111,119,115,101,114,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107,101,86,105,115,105, + 98,108,101,32,40,119,101,98,86,105,101,119,32,61,32,110,101,119,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,32, + 40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,115,111,109, + 101,32,98,117,116,116,111,110,115,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40, + 103,111,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40,34,71,111,34,44,32,34,71,111,32,116,111,32, + 85,82,76,34,41,41,59,13,10,32,32,32,32,32,32,32,32,103,111,66,117,116,116,111,110,45,62,97,100,100,66,117,116,116,111,110,76,105,115,116, + 101,110,101,114,32,40,116,104,105,115,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32, + 40,98,97,99,107,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40,34,60,60,34,44,32,34,66,97,99, + 107,34,41,41,59,13,10,32,32,32,32,32,32,32,32,98,97,99,107,66,117,116,116,111,110,45,62,97,100,100,66,117,116,116,111,110,76,105,115,116, + 101,110,101,114,32,40,116,104,105,115,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32, + 40,102,111,114,119,97,114,100,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40,34,62,62,34,44,32,34, + 70,111,114,119,97,114,100,34,41,41,59,13,10,32,32,32,32,32,32,32,32,102,111,114,119,97,114,100,66,117,116,116,111,110,45,62,97,100,100,66, + 117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,115,101,110,100, + 32,116,104,101,32,98,114,111,119,115,101,114,32,116,111,32,97,32,115,116,97,114,116,32,112,97,103,101,46,46,13,10,32,32,32,32,32,32,32,32, + 119,101,98,86,105,101,119,45,62,103,111,84,111,85,82,76,32,40,34,104,116,116,112,58,47,47,119,119,119,46,103,111,111,103,108,101,46,99,111,109, + 34,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,87,101,98,66,114,111,119,115,101,114,68,101,109,111,40,41,13,10,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,108,108,67,104,105,108,100,114,101,110,40,41,59,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,118,111,105,100,32,114,101,115,105,122,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,119,101, + 98,86,105,101,119,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,52,53,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,50, + 48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,53,53,41,59,13,10,32,32,32,32,32,32,32,32,103,111,66,117,116,116,111,110,45, + 62,115,101,116,66,111,117,110,100,115,32,40,103,101,116,87,105,100,116,104,40,41,32,45,32,52,53,44,32,49,48,44,32,51,53,44,32,50,53,41, + 59,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48, + 48,44,32,49,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,49,53,53,44,32,50,53,41,59,13,10,32,32,32,32,32,32,32,32,98, + 97,99,107,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49,48,44,32,51,53,44,32,50,53,41,59,13,10, + 32,32,32,32,32,32,32,32,102,111,114,119,97,114,100,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,53,53,44,32,49,48, + 44,32,51,53,44,32,50,53,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116,69,100,105,116,111,114, + 84,101,120,116,67,104,97,110,103,101,100,32,40,84,101,120,116,69,100,105,116,111,114,38,32,101,100,105,116,111,114,41,32,32,32,32,32,32,32,32, + 32,32,32,32,32,123,125,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116,69,100,105,116,111,114,69,115,99,97,112,101,75,101,121,80,114,101, + 115,115,101,100,32,40,84,101,120,116,69,100,105,116,111,114,38,32,101,100,105,116,111,114,41,32,32,32,32,32,32,32,32,123,125,13,10,32,32,32, + 32,118,111,105,100,32,116,101,120,116,69,100,105,116,111,114,70,111,99,117,115,76,111,115,116,32,40,84,101,120,116,69,100,105,116,111,114,38,32,101, + 100,105,116,111,114,41,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116, + 69,100,105,116,111,114,82,101,116,117,114,110,75,101,121,80,114,101,115,115,101,100,32,40,84,101,120,116,69,100,105,116,111,114,38,41,13,10,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111,84,111,85,82,76,32,40,97,100,100,114,101,115,115,84,101, + 120,116,66,111,120,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,98,117, + 116,116,111,110,67,108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,32,98,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, + 105,102,32,40,98,32,61,61,32,98,97,99,107,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,101,98,86,105,101, + 119,45,62,103,111,66,97,99,107,40,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,98,32,61,61,32,102,111,114,119, + 97,114,100,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111,70,111,114,119,97, + 114,100,40,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,98,32,61,61,32,103,111,66,117,116,116,111,110,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111,84,111,85,82,76,32,40,97,100,100,114,101,115,115,84,101,120, + 116,66,111,120,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,106,117,99,101,95,85,115,101, + 68,101,98,117,103,103,105,110,103,78,101,119,79,112,101,114,97,116,111,114,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,68,101, + 109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,42,32,119,101,98,86,105,101,119,59,13,10,13,10,32,32,32,32,84,101,120,116, + 69,100,105,116,111,114,42,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42, + 32,103,111,66,117,116,116,111,110,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,98,97,99,107,66,117,116,116,111,110,59,13, + 10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,102,111,114,119,97,114,100,66,117,116,116,111,110,59,13,10,125,59,13,10,13,10,13, + 10,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 13,10,32,32,32,32,87,101,98,66,114,111,119,115,101,114,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115, - 101,116,78,97,109,101,32,40,34,87,101,98,32,66,114,111,119,115,101,114,34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114, - 101,97,116,101,32,97,110,32,97,100,100,114,101,115,115,32,98,111,120,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100,77,97,107, - 101,86,105,115,105,98,108,101,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111, - 114,40,41,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,115,101,116,84,101,120,116,84,111, - 83,104,111,119,87,104,101,110,69,109,112,116,121,32,40,34,69,110,116,101,114,32,97,32,119,101,98,32,97,100,100,114,101,115,115,44,32,101,46,103, - 46,32,104,116,116,112,58,47,47,119,119,119,46,114,97,119,109,97,116,101,114,105,97,108,115,111,102,116,119,97,114,101,46,99,111,109,34,44,32,67, - 111,108,111,117,114,115,58,58,103,114,101,121,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62, - 97,100,100,76,105,115,116,101,110,101,114,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101, - 32,116,104,101,32,97,99,116,117,97,108,32,98,114,111,119,115,101,114,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,97, - 100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,119,101,98,86,105,101,119,32,61,32,110,101,119,32,68,101,109,111,66,114,111,119, - 115,101,114,67,111,109,112,111,110,101,110,116,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,41,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,47,47,32,97,100,100,32,115,111,109,101,32,98,117,116,116,111,110,115,46,46,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110,100, - 77,97,107,101,86,105,115,105,98,108,101,32,40,103,111,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40, - 34,71,111,34,44,32,34,71,111,32,116,111,32,85,82,76,34,41,41,59,13,10,32,32,32,32,32,32,32,32,103,111,66,117,116,116,111,110,45,62, - 97,100,100,66,117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,116,104,105,115,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110, - 100,77,97,107,101,86,105,115,105,98,108,101,32,40,98,97,99,107,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111, - 110,32,40,34,60,60,34,44,32,34,66,97,99,107,34,41,41,59,13,10,32,32,32,32,32,32,32,32,98,97,99,107,66,117,116,116,111,110,45,62, - 97,100,100,66,117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,116,104,105,115,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,65,110, - 100,77,97,107,101,86,105,115,105,98,108,101,32,40,102,111,114,119,97,114,100,66,117,116,116,111,110,32,61,32,110,101,119,32,84,101,120,116,66,117, - 116,116,111,110,32,40,34,62,62,34,44,32,34,70,111,114,119,97,114,100,34,41,41,59,13,10,32,32,32,32,32,32,32,32,102,111,114,119,97,114, - 100,66,117,116,116,111,110,45,62,97,100,100,66,117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,116,104,105,115,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,47,47,32,115,101,110,100,32,116,104,101,32,98,114,111,119,115,101,114,32,116,111,32,97,32,115,116,97,114,116,32,112,97,103, - 101,46,46,13,10,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111,84,111,85,82,76,32,40,34,104,116,116,112,58,47,47,119, - 119,119,46,103,111,111,103,108,101,46,99,111,109,34,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,87,101,98,66,114,111,119,115, - 101,114,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,108,108,67,104,105,108,100,114, - 101,110,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,101,115,105,122,101,100,40,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,52,53,44,32,103, - 101,116,87,105,100,116,104,40,41,32,45,32,50,48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,53,53,41,59,13,10,32,32,32,32, - 32,32,32,32,103,111,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,103,101,116,87,105,100,116,104,40,41,32,45,32,52,53, - 44,32,49,48,44,32,51,53,44,32,50,53,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62, - 115,101,116,66,111,117,110,100,115,32,40,49,48,48,44,32,49,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,49,53,53,44,32,50,53, - 41,59,13,10,32,32,32,32,32,32,32,32,98,97,99,107,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49, - 48,44,32,51,53,44,32,50,53,41,59,13,10,32,32,32,32,32,32,32,32,102,111,114,119,97,114,100,66,117,116,116,111,110,45,62,115,101,116,66, - 111,117,110,100,115,32,40,53,53,44,32,49,48,44,32,51,53,44,32,50,53,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111, - 105,100,32,116,101,120,116,69,100,105,116,111,114,84,101,120,116,67,104,97,110,103,101,100,32,40,84,101,120,116,69,100,105,116,111,114,38,32,101,100, - 105,116,111,114,41,32,32,32,32,32,32,32,32,32,32,32,32,32,123,125,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116,69,100,105,116,111, - 114,69,115,99,97,112,101,75,101,121,80,114,101,115,115,101,100,32,40,84,101,120,116,69,100,105,116,111,114,38,32,101,100,105,116,111,114,41,32,32, - 32,32,32,32,32,32,123,125,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116,69,100,105,116,111,114,70,111,99,117,115,76,111,115,116,32,40, - 84,101,120,116,69,100,105,116,111,114,38,32,101,100,105,116,111,114,41,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,125,13,10,32,32, - 32,32,13,10,32,32,32,32,118,111,105,100,32,116,101,120,116,69,100,105,116,111,114,82,101,116,117,114,110,75,101,121,80,114,101,115,115,101,100,32, - 40,84,101,120,116,69,100,105,116,111,114,38,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103, - 111,84,111,85,82,76,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,98,117,116,116,111,110,67,108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,32,98,41, - 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,98,32,61,61,32,98,97,99,107,66,117,116,116,111,110,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111,66,97,99,107,40,41,59,13,10,32,32,32,32,32,32,32,32,101, - 108,115,101,32,105,102,32,40,98,32,61,61,32,102,111,114,119,97,114,100,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,119,101,98,86,105,101,119,45,62,103,111,70,111,114,119,97,114,100,40,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32, - 40,98,32,61,61,32,103,111,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,101,98,86,105,101,119,45,62,103,111, - 84,111,85,82,76,32,40,97,100,100,114,101,115,115,84,101,120,116,66,111,120,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32,32, - 125,13,10,13,10,32,32,32,32,106,117,99,101,95,85,115,101,68,101,98,117,103,103,105,110,103,78,101,119,79,112,101,114,97,116,111,114,13,10,13, - 10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,68,101,109,111,66,114,111,119,115,101,114,67,111,109,112,111,110,101,110,116,42,32,119,101,98, - 86,105,101,119,59,13,10,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,97,100,100,114,101,115,115,84,101,120,116,66,111,120,59, - 13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,103,111,66,117,116,116,111,110,59,13,10,32,32,32,32,84,101,120,116,66,117,116, - 116,111,110,42,32,98,97,99,107,66,117,116,116,111,110,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,102,111,114,119,97,114, - 100,66,117,116,116,111,110,59,13,10,125,59,13,10,13,10,13,10,47,47,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,87,101,98, - 66,114,111,119,115,101,114,68,101,109,111,40,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,101,98,66,114,111,119, - 115,101,114,68,101,109,111,40,41,59,13,10,125,13,10,13,10,35,101,110,100,105,102,13,10,0,0}; + 61,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,87,101,98,66,114,111,119,115,101,114,68,101,109,111,40,41,13,10,123,13, + 10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,101,98,66,114,111,119,115,101,114,68,101,109,111,40,41,59,13,10,125,13,10,13,10, + 35,101,110,100,105,102,13,10,0,0}; const char* BinaryData::webbrowserdemo_cpp = (const char*) temp5; static const unsigned char temp6[] = {80,75,3,4,20,0,2,0,8,0,128,122,250,52,23,17,234,255,206,13,0,0,219,67,0,0,16,0,0,0,100,111,99,117,109,101,110,116,45,110, @@ -6051,16 +6052,7 @@ static const unsigned char temp9[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61, 10,125,13,10,0,0}; const char* BinaryData::threadingdemo_cpp = (const char*) temp9; -static const unsigned char temp10[] = {13,10,70,89,73,46,46,13,10,13,10,84,111,32,101,109,98,101,100,32,116,104,101,32,102,105,108,101,115,32,97,110,100,32,116,104,105,110,103,115, - 32,116,104,97,116,32,116,104,101,32,100,101,109,111,32,110,101,101,100,115,32,105,110,116,111,32,105,116,115,32,101,120,101,99,117,116,97,98,108,101, - 44,32,13,10,73,39,118,101,32,117,115,101,100,32,109,121,32,66,105,110,97,114,121,66,117,105,108,100,101,114,32,117,116,105,108,105,116,121,32,45, - 32,116,104,101,32,102,105,108,101,115,32,105,110,32,116,104,105,115,32,100,105,114,101,99,116,111,114,121,32,97,114,101,32,116,104,101,13,10,111,110, - 101,115,32,116,104,97,116,32,103,101,116,32,101,110,99,111,100,101,100,32,105,110,116,111,32,66,105,110,97,114,121,68,97,116,97,46,99,112,112,32, - 97,110,100,32,66,105,110,97,114,121,68,97,116,97,46,104,44,32,119,104,105,99,104,32,103,101,116,32,98,117,105,108,116,32,13,10,105,110,116,111, - 32,116,104,101,32,97,112,112,108,105,99,97,116,105,111,110,46,13,10,0,0}; -const char* BinaryData::readme__what_this_directory_is_for_txt = (const char*) temp10; - -static const unsigned char temp11[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, +static const unsigned char temp10[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,13,10,13,10,32,32,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32,116,104,101,32,74,85,67,69, 32,108,105,98,114,97,114,121,32,45,32,34,74,117,108,101,115,39,32,85,116,105,108,105,116,121,32,67,108,97,115,115,32,69,120,116,101,110,115,105, @@ -6650,40 +6642,9 @@ static const unsigned char temp11[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,65,117,100,105,111,68,101,109,111,40,41,13,10,123,13,10,32,32, 32,32,114,101,116,117,114,110,32,110,101,119,32,65,117,100,105,111,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::audiodemo_cpp = (const char*) temp11; - -static const unsigned char temp12[] = {60,116,114,101,101,62,13,10,32,32,32,32,60,105,116,101,109,49,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111, - 108,111,117,114,61,34,102,102,102,102,48,48,48,48,34,32,119,105,100,116,104,61,34,56,48,48,34,32,47,62,13,10,32,32,32,32,32,32,32,32, - 60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,102,102,51,51,98,98,48,48,34,32,119,105,100,116,104,61,34,53,48,34,32,47,62, - 13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,51,51,48,48,48,48,48,48,34,32,47,62,13, - 10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,49,48,48,34,32,47,62,13,10,32,32,32,32,32,32, - 32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,102,102,56,56,54,54,101,101,34,32,47,62,13,10,32,32,32,32,32,32,32, - 32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,51,51, - 48,48,48,48,48,48,34,32,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32, - 60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,60,47,105,116,101,109,49,62,13,10,13,10,32,32,32,32,60,105,116,101,109,50,32,99, - 111,108,111,117,114,61,34,102,102,55,55,55,55,55,55,34,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32, - 32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32, - 32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116, - 104,61,34,56,48,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,56,48,48,34,47, - 62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47, - 62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,105,116,101,109,51,62,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60, - 115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,47,115,117,98,110, - 111,100,101,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111, - 100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32, - 32,32,32,32,32,32,60,47,105,116,101,109,51,62,13,10,32,32,32,32,60,47,105,116,101,109,50,62,13,10,13,10,32,32,32,32,60,105,116,101, - 109,52,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, - 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, - 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, - 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, - 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,60,47,105,116,101,109,52,62,13,10,60, - 47,116,114,101,101,62,0,0}; -const char* BinaryData::treedemo_xml = (const char*) temp12; +const char* BinaryData::audiodemo_cpp = (const char*) temp10; -static const unsigned char temp13[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, +static const unsigned char temp11[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,13,10,13,10,32,32,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32,116,104,101,32,74,85,67,69, 32,108,105,98,114,97,114,121,32,45,32,34,74,117,108,101,115,39,32,85,116,105,108,105,116,121,32,67,108,97,115,115,32,69,120,116,101,110,115,105, @@ -6923,9 +6884,18 @@ static const unsigned char temp13[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,79,112,101,110,71, 76,68,101,109,111,40,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,79,112,101,110,71,76,68,101,109,111,40,41,59, 13,10,125,13,10,13,10,35,101,110,100,105,102,13,10,0,0}; -const char* BinaryData::opengldemo_cpp = (const char*) temp13; +const char* BinaryData::opengldemo_cpp = (const char*) temp11; + +static const unsigned char temp12[] = {13,10,70,89,73,46,46,13,10,13,10,84,111,32,101,109,98,101,100,32,116,104,101,32,102,105,108,101,115,32,97,110,100,32,116,104,105,110,103,115, + 32,116,104,97,116,32,116,104,101,32,100,101,109,111,32,110,101,101,100,115,32,105,110,116,111,32,105,116,115,32,101,120,101,99,117,116,97,98,108,101, + 44,32,13,10,73,39,118,101,32,117,115,101,100,32,109,121,32,66,105,110,97,114,121,66,117,105,108,100,101,114,32,117,116,105,108,105,116,121,32,45, + 32,116,104,101,32,102,105,108,101,115,32,105,110,32,116,104,105,115,32,100,105,114,101,99,116,111,114,121,32,97,114,101,32,116,104,101,13,10,111,110, + 101,115,32,116,104,97,116,32,103,101,116,32,101,110,99,111,100,101,100,32,105,110,116,111,32,66,105,110,97,114,121,68,97,116,97,46,99,112,112,32, + 97,110,100,32,66,105,110,97,114,121,68,97,116,97,46,104,44,32,119,104,105,99,104,32,103,101,116,32,98,117,105,108,116,32,13,10,105,110,116,111, + 32,116,104,101,32,97,112,112,108,105,99,97,116,105,111,110,46,13,10,0,0}; +const char* BinaryData::readme__what_this_directory_is_for_txt = (const char*) temp12; -static const unsigned char temp14[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, +static const unsigned char temp13[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,13,10,13,10,32,32,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32,116,104,101,32,74,85,67,69, 32,108,105,98,114,97,114,121,32,45,32,34,74,117,108,101,115,39,32,85,116,105,108,105,116,121,32,67,108,97,115,115,32,69,120,116,101,110,115,105, @@ -7281,7 +7251,38 @@ static const unsigned char temp14[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 101,40,41,41,59,13,10,32,32,32,32,125,13,10,125,59,13,10,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,80,97,116, 104,115,65,110,100,84,114,97,110,115,102,111,114,109,115,68,101,109,111,40,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119, 32,80,97,116,104,115,65,110,100,84,114,97,110,115,102,111,114,109,115,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::pathsandtransformsdemo_cpp = (const char*) temp14; +const char* BinaryData::pathsandtransformsdemo_cpp = (const char*) temp13; + +static const unsigned char temp14[] = {60,116,114,101,101,62,13,10,32,32,32,32,60,105,116,101,109,49,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111, + 108,111,117,114,61,34,102,102,102,102,48,48,48,48,34,32,119,105,100,116,104,61,34,56,48,48,34,32,47,62,13,10,32,32,32,32,32,32,32,32, + 60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,102,102,51,51,98,98,48,48,34,32,119,105,100,116,104,61,34,53,48,34,32,47,62, + 13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,51,51,48,48,48,48,48,48,34,32,47,62,13, + 10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,49,48,48,34,32,47,62,13,10,32,32,32,32,32,32, + 32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,102,102,56,56,54,54,101,101,34,32,47,62,13,10,32,32,32,32,32,32,32, + 32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,99,111,108,111,117,114,61,34,51,51, + 48,48,48,48,48,48,34,32,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32, + 60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,60,47,105,116,101,109,49,62,13,10,13,10,32,32,32,32,60,105,116,101,109,50,32,99, + 111,108,111,117,114,61,34,102,102,55,55,55,55,55,55,34,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32, + 32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32, + 32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116, + 104,61,34,56,48,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,56,48,48,34,47, + 62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47, + 62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,105,116,101,109,51,62,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60, + 115,117,98,110,111,100,101,32,119,105,100,116,104,61,34,53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,47,115,117,98,110, + 111,100,101,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111, + 100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32, + 32,32,32,32,32,32,60,47,105,116,101,109,51,62,13,10,32,32,32,32,60,47,105,116,101,109,50,62,13,10,13,10,32,32,32,32,60,105,116,101, + 109,52,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, + 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, + 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, + 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100, + 101,47,62,13,10,32,32,32,32,32,32,32,32,60,115,117,98,110,111,100,101,47,62,13,10,32,32,32,32,60,47,105,116,101,109,52,62,13,10,60, + 47,116,114,101,101,62,0,0}; +const char* BinaryData::treedemo_xml = (const char*) temp14; static const unsigned char temp15[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, @@ -8334,4 +8335,3 @@ static const unsigned char temp19[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,67,97,109,101,114,97,68,101,109,111,40,41,59,13,10,125,13,10,13,10, 35,101,110,100,105,102,13,10,0,0}; const char* BinaryData::camerademo_cpp = (const char*) temp19; - diff --git a/extras/juce demo/src/BinaryData.h b/extras/juce demo/src/BinaryData.h index b19afd1a12..0d68c501dc 100644 --- a/extras/juce demo/src/BinaryData.h +++ b/extras/juce demo/src/BinaryData.h @@ -18,7 +18,7 @@ namespace BinaryData const int treeviewdemo_cppSize = 8715; extern const char* webbrowserdemo_cpp; - const int webbrowserdemo_cppSize = 5385; + const int webbrowserdemo_cppSize = 5408; extern const char* icons_zip; const int icons_zipSize = 83876; @@ -32,21 +32,21 @@ namespace BinaryData extern const char* threadingdemo_cpp; const int threadingdemo_cppSize = 10484; - extern const char* readme__what_this_directory_is_for_txt; - const int readme__what_this_directory_is_for_txtSize = 259; - extern const char* audiodemo_cpp; const int audiodemo_cppSize = 23590; - extern const char* treedemo_xml; - const int treedemo_xmlSize = 1126; - extern const char* opengldemo_cpp; const int opengldemo_cppSize = 9575; + extern const char* readme__what_this_directory_is_for_txt; + const int readme__what_this_directory_is_for_txtSize = 259; + extern const char* pathsandtransformsdemo_cpp; const int pathsandtransformsdemo_cppSize = 14231; + extern const char* treedemo_xml; + const int treedemo_xmlSize = 1126; + extern const char* quicktimedemo_cpp; const int quicktimedemo_cppSize = 4576; diff --git a/extras/juce demo/src/MainDemoWindow.cpp b/extras/juce demo/src/MainDemoWindow.cpp index 622d11afd9..66fec5e035 100644 --- a/extras/juce demo/src/MainDemoWindow.cpp +++ b/extras/juce demo/src/MainDemoWindow.cpp @@ -1,678 +1,678 @@ -/* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-7 by Raw Material Software ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the - GNU General Public License, as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later version. - - JUCE is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with JUCE; if not, visit www.gnu.org/licenses or write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------------ - - If you'd like to release a closed-source product which uses JUCE, commercial - licenses are also available: visit www.rawmaterialsoftware.com/juce for - more information. - - ============================================================================== -*/ - -#include "jucedemo_headers.h" -#include "MainDemoWindow.h" - - -//============================================================================== -class SourceCodeWindow; -static SourceCodeWindow* sourceWindow = 0; - - -//============================================================================== -class SourceCodeWindow : public DialogWindow -{ - TextEditor* textBox; - -public: - SourceCodeWindow() - : DialogWindow (T("JUCE Demo Source Code!"), - Colours::floralwhite, - false) - { - setContentComponent (textBox = new TextEditor()); - - textBox->setColour (TextEditor::backgroundColourId, Colours::white); - textBox->setMultiLine (true, false); - textBox->setReturnKeyStartsNewLine (true); - - setResizable (true, true); // we'll choose a corner-resizer component for this window, - // as a contrast to the resizable border on the main window - } - - ~SourceCodeWindow() - { - // the text editor gets deleted automatically because it's the - // window's content component. - - sourceWindow = 0; - } - - void closeButtonPressed() - { - delete this; - } - - void updateSourceCode (const String& text) - { - Font font (14.0f); - font.setTypefaceName (Font::getDefaultMonospacedFontName()); - textBox->setFont (font); - - textBox->setText (text); - - toFront (true); - } -}; - -//============================================================================== -class ContentComp : public Component, - public MenuBarModel, - public ApplicationCommandTarget -{ - //============================================================================== - MainDemoWindow* mainWindow; - - OldSchoolLookAndFeel oldLookAndFeel; - - Component* currentDemo; - int currentDemoId; - const char* demoSourceCodeText; - - TooltipWindow tooltipWindow; // to add tooltips to an application, you - // just need to create one of these and leave it - // there to do its work.. - - enum CommandIDs - { - showPathsAndTransforms = 0x2000, - showFontsAndText = 0x2001, - showWidgets = 0x2002, - showThreading = 0x2003, - showTreeView = 0x2004, - showAudio = 0x2005, - showDragAndDrop = 0x2006, - showOpenGL = 0x2007, - showQuicktime = 0x2008, - showInterprocessComms = 0x2009, - showTable = 0x2010, - showCamera = 0x2011, - showWebBrowser = 0x2012, - - showSourceCode = 0x200a, - - setDefaultLookAndFeel = 0x200b, - setOldSchoolLookAndFeel = 0x200c, - useNativeTitleBar = 0x200d, - useNativeMenus = 0x200e, - goToKioskMode = 0x200f - }; - -public: - //============================================================================== - ContentComp (MainDemoWindow* mainWindow_) - : mainWindow (mainWindow_), - currentDemo (0), - currentDemoId (0), - demoSourceCodeText (0) - { - invokeDirectly (showPathsAndTransforms, true); - } - - ~ContentComp() - { - // (need to do this because the old school look-and-feel object is one of our members, - // so will be deleted with us, and would leave a dangling pointer if it's selected) - LookAndFeel::setDefaultLookAndFeel (0); - - deleteAllChildren(); - - deleteAndZero (sourceWindow); - } - - //============================================================================== - void resized() - { - if (currentDemo != 0) - currentDemo->setBounds (0, 0, getWidth(), getHeight()); - } - - //============================================================================== - void showDemo (Component* demoComp, const char* sourceCodeText) - { - delete currentDemo; - currentDemo = demoComp; - - addAndMakeVisible (currentDemo); - resized(); - - demoSourceCodeText = sourceCodeText; - } - - void showSource() - { - if (sourceWindow == 0) - { - sourceWindow = new SourceCodeWindow(); - sourceWindow->centreAroundComponent (this, 750, 600); - sourceWindow->setVisible (true); - } - - sourceWindow->updateSourceCode (demoSourceCodeText); - } - - //============================================================================== - const StringArray getMenuBarNames() - { - const tchar* const names[] = { T("Demo"), T("Source Code"), T("Look-and-feel"), 0 }; - - return StringArray ((const tchar**) names); - } - - const PopupMenu getMenuForIndex (int menuIndex, - const String& menuName) - { - ApplicationCommandManager* const commandManager = mainWindow->commandManager; - - PopupMenu menu; - - if (menuIndex == 0) - { - menu.addCommandItem (commandManager, showPathsAndTransforms); - menu.addCommandItem (commandManager, showFontsAndText); - menu.addCommandItem (commandManager, showWidgets); - menu.addCommandItem (commandManager, showThreading); - menu.addCommandItem (commandManager, showTreeView); - menu.addCommandItem (commandManager, showTable); - menu.addCommandItem (commandManager, showAudio); - menu.addCommandItem (commandManager, showDragAndDrop); - menu.addCommandItem (commandManager, showOpenGL); - menu.addCommandItem (commandManager, showQuicktime); - menu.addCommandItem (commandManager, showInterprocessComms); - menu.addCommandItem (commandManager, showCamera); - menu.addCommandItem (commandManager, showWebBrowser); - - menu.addSeparator(); - menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit); - } - else if (menuIndex == 1) - { - menu.addCommandItem (commandManager, showSourceCode); - } - else if (menuIndex == 2) - { - menu.addCommandItem (commandManager, setDefaultLookAndFeel); - menu.addCommandItem (commandManager, setOldSchoolLookAndFeel); - menu.addSeparator(); - menu.addCommandItem (commandManager, useNativeTitleBar); - -#if JUCE_MAC - menu.addCommandItem (commandManager, useNativeMenus); -#endif - -#if ! JUCE_LINUX - menu.addCommandItem (commandManager, goToKioskMode); -#endif - } - - return menu; - } - - void menuItemSelected (int menuItemID, - int topLevelMenuIndex) - { - // all our menu items are invoked automatically as commands, so no need to do - // anything in this callback - } - - //============================================================================== - // The following methods implement the ApplicationCommandTarget interface, allowing - // this window to publish a set of actions it can perform, and which can be mapped - // onto menus, keypresses, etc. - - ApplicationCommandTarget* getNextCommandTarget() - { - // this will return the next parent component that is an ApplicationCommandTarget (in this - // case, there probably isn't one, but it's best to use this method in your own apps). - return findFirstTargetParentComponent(); - } - - void getAllCommands (Array & commands) - { - // this returns the set of all commands that this target can perform.. - const CommandID ids[] = { showPathsAndTransforms, - showFontsAndText, - showWidgets, - showThreading, - showTreeView, - showTable, - showAudio, - showDragAndDrop, - showOpenGL, - showQuicktime, - showCamera, - showWebBrowser, - showInterprocessComms, - showSourceCode, - setDefaultLookAndFeel, - setOldSchoolLookAndFeel, - useNativeTitleBar -#if JUCE_MAC - , useNativeMenus -#endif - -#if ! JUCE_LINUX - , goToKioskMode -#endif - }; - - commands.addArray (ids, numElementsInArray (ids)); - } - - // This method is used when something needs to find out the details about one of the commands - // that this object can perform.. - void getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result) - { - const String generalCategory (T("General")); - const String demosCategory (T("Demos")); - - switch (commandID) - { - case showPathsAndTransforms: - result.setInfo (T("Paths and Transforms"), T("Shows the paths & transforms demo"), demosCategory, 0); - result.setTicked (currentDemoId == showPathsAndTransforms); - result.addDefaultKeypress (T('1'), ModifierKeys::commandModifier); - break; - - case showFontsAndText: - result.setInfo (T("Fonts and Text"), T("Shows the fonts & text demo"), demosCategory, 0); - result.setTicked (currentDemoId == showFontsAndText); - result.addDefaultKeypress (T('2'), ModifierKeys::commandModifier); - break; - - case showWidgets: - result.setInfo (T("Widgets"), T("Shows the widgets demo"), demosCategory, 0); - result.setTicked (currentDemoId == showWidgets); - result.addDefaultKeypress (T('3'), ModifierKeys::commandModifier); - break; - - case showThreading: - result.setInfo (T("Multithreading"), T("Shows the threading demo"), demosCategory, 0); - result.setTicked (currentDemoId == showThreading); - result.addDefaultKeypress (T('4'), ModifierKeys::commandModifier); - break; - - case showTreeView: - result.setInfo (T("Treeviews"), T("Shows the treeviews demo"), demosCategory, 0); - result.setTicked (currentDemoId == showTreeView); - result.addDefaultKeypress (T('5'), ModifierKeys::commandModifier); - break; - - case showTable: - result.setInfo (T("Table Components"), T("Shows the table component demo"), demosCategory, 0); - result.setTicked (currentDemoId == showTable); - result.addDefaultKeypress (T('6'), ModifierKeys::commandModifier); - break; - - case showAudio: - result.setInfo (T("Audio"), T("Shows the audio demo"), demosCategory, 0); - result.setTicked (currentDemoId == showAudio); - result.addDefaultKeypress (T('7'), ModifierKeys::commandModifier); - break; - - case showDragAndDrop: - result.setInfo (T("Drag-and-drop"), T("Shows the drag & drop demo"), demosCategory, 0); - result.setTicked (currentDemoId == showDragAndDrop); - result.addDefaultKeypress (T('8'), ModifierKeys::commandModifier); - break; - - case showOpenGL: - result.setInfo (T("OpenGL"), T("Shows the OpenGL demo"), demosCategory, 0); - result.addDefaultKeypress (T('9'), ModifierKeys::commandModifier); - result.setTicked (currentDemoId == showOpenGL); -#if ! JUCE_OPENGL - result.setActive (false); -#endif - break; - - case showQuicktime: - result.setInfo (T("Quicktime"), T("Shows the Quicktime demo"), demosCategory, 0); - result.addDefaultKeypress (T('b'), ModifierKeys::commandModifier); - result.setTicked (currentDemoId == showQuicktime); -#if ! (JUCE_QUICKTIME && ! JUCE_LINUX) - result.setActive (false); -#endif - break; - - case showCamera: - result.setInfo (T("Camera Capture"), T("Shows the camera demo"), demosCategory, 0); - result.addDefaultKeypress (T('c'), ModifierKeys::commandModifier); - result.setTicked (currentDemoId == showCamera); -#if ! JUCE_USE_CAMERA - result.setActive (false); -#endif - break; - - case showWebBrowser: - result.setInfo (T("Web Browser"), T("Shows the web browser demo"), demosCategory, 0); - result.addDefaultKeypress (T('i'), ModifierKeys::commandModifier); - result.setTicked (currentDemoId == showWebBrowser); -#if (! JUCE_WEB_BROWSER) || JUCE_LINUX - result.setActive (false); -#endif - break; - - case showInterprocessComms: - result.setInfo (T("Interprocess Comms"), T("Shows the interprocess communications demo"), demosCategory, 0); - result.addDefaultKeypress (T('0'), ModifierKeys::commandModifier); - result.setTicked (currentDemoId == showInterprocessComms); - break; - - case showSourceCode: - result.setInfo (T("Show the source code for this demo"), T("Opens a window containing this demo's source code"), generalCategory, 0); - result.addDefaultKeypress (T('s'), ModifierKeys::commandModifier); - break; - - case setDefaultLookAndFeel: - result.setInfo (T("Use default look-and-feel"), String::empty, generalCategory, 0); - result.setTicked ((typeid (LookAndFeel) == typeid (getLookAndFeel())) != 0); - break; - - case setOldSchoolLookAndFeel: - result.setInfo (T("Use the old, original juce look-and-feel"), String::empty, generalCategory, 0); - result.setTicked ((typeid (OldSchoolLookAndFeel) == typeid (getLookAndFeel())) != 0); - break; - - case useNativeTitleBar: - result.setInfo (T("Use native window title bar"), String::empty, generalCategory, 0); - result.setTicked (mainWindow->isUsingNativeTitleBar()); - break; - -#if JUCE_MAC - case useNativeMenus: - result.setInfo (T("Use the native OSX menu bar"), String::empty, generalCategory, 0); - result.setTicked (MenuBarModel::getMacMainMenu() != 0); - break; -#endif - -#if ! JUCE_LINUX - case goToKioskMode: - result.setInfo (T("Show full-screen kiosk mode"), String::empty, generalCategory, 0); - result.setTicked (Desktop::getInstance().getKioskModeComponent() != 0); - break; -#endif - - default: - break; - }; - } - - // this is the ApplicationCommandTarget method that is used to actually perform one of our commands.. - bool perform (const InvocationInfo& info) - { - switch (info.commandID) - { - case showPathsAndTransforms: - showDemo (createPathsAndTransformsDemo(), BinaryData::pathsandtransformsdemo_cpp); - currentDemoId = showPathsAndTransforms; - break; - - case showFontsAndText: - showDemo (createFontsAndTextDemo(), BinaryData::fontsandtextdemo_cpp); - currentDemoId = showFontsAndText; - break; - - case showWidgets: - showDemo (createWidgetsDemo (mainWindow->commandManager), BinaryData::widgetsdemo_cpp); - currentDemoId = showWidgets; - break; - - case showThreading: - showDemo (createThreadingDemo(), BinaryData::threadingdemo_cpp); - currentDemoId = showThreading; - break; - - case showTreeView: - showDemo (createTreeViewDemo(), BinaryData::treeviewdemo_cpp); - currentDemoId = showTreeView; - break; - - case showTable: - showDemo (createTableDemo(), BinaryData::tabledemo_cpp); - currentDemoId = showTable; - break; - - case showAudio: - showDemo (createAudioDemo(), BinaryData::audiodemo_cpp); - currentDemoId = showAudio; - break; - - case showDragAndDrop: - showDemo (createDragAndDropDemo(), BinaryData::draganddropdemo_cpp); - currentDemoId = showDragAndDrop; - break; - - case showOpenGL: -#if JUCE_OPENGL - showDemo (createOpenGLDemo(), BinaryData::opengldemo_cpp); - currentDemoId = showOpenGL; -#endif - break; - - case showQuicktime: -#if JUCE_QUICKTIME && ! JUCE_LINUX - showDemo (createQuickTimeDemo(), BinaryData::quicktimedemo_cpp); - currentDemoId = showQuicktime; -#endif - break; - - case showCamera: -#if JUCE_USE_CAMERA - showDemo (createCameraDemo(), BinaryData::camerademo_cpp); - currentDemoId = showCamera; -#endif - break; - - case showWebBrowser: -#if JUCE_WEB_BROWSER - showDemo (createWebBrowserDemo(), BinaryData::webbrowserdemo_cpp); - currentDemoId = showWebBrowser; -#endif - break; - - case showInterprocessComms: - showDemo (createInterprocessCommsDemo(), BinaryData::interprocesscommsdemo_cpp); - currentDemoId = showInterprocessComms; - break; - - case showSourceCode: - showSource(); - break; - - case setDefaultLookAndFeel: - LookAndFeel::setDefaultLookAndFeel (0); - break; - - case setOldSchoolLookAndFeel: - LookAndFeel::setDefaultLookAndFeel (&oldLookAndFeel); - break; - - case useNativeTitleBar: - mainWindow->setUsingNativeTitleBar (! mainWindow->isUsingNativeTitleBar()); - break; - -#if JUCE_MAC - case useNativeMenus: - if (MenuBarModel::getMacMainMenu() != 0) - { - MenuBarModel::setMacMainMenu (0); - mainWindow->setMenuBar ((ContentComp*) mainWindow->getContentComponent()); - } - else - { - MenuBarModel::setMacMainMenu ((ContentComp*) mainWindow->getContentComponent()); - mainWindow->setMenuBar (0); - } - - break; -#endif - -#if ! JUCE_LINUX - case goToKioskMode: - if (Desktop::getInstance().getKioskModeComponent() == 0) - { - Desktop::getInstance().setKioskModeComponent (getTopLevelComponent()); - } - else - { - Desktop::getInstance().setKioskModeComponent (0); - } - - break; -#endif - - default: - return false; - }; - - return true; - } - - juce_UseDebuggingNewOperator -}; - -//============================================================================== -#if JUCE_WIN32 || JUCE_LINUX - -// Just add a simple icon to the Window system tray area.. -class DemoTaskbarComponent : public SystemTrayIconComponent -{ -public: - DemoTaskbarComponent() - { - // Create an icon which is just a square with a "j" in it.. - Image icon (Image::RGB, 32, 32, true); - Graphics g (icon); - g.fillAll (Colours::lightblue); - g.setColour (Colours::black); - g.setFont ((float) icon.getHeight(), Font::bold); - g.drawText (T("j"), 0, 0, icon.getWidth(), icon.getHeight(), Justification::centred, false); - - setIconImage (icon); - - setIconTooltip (T("Juce Demo App!")); - } - - ~DemoTaskbarComponent() - { - } - - void mouseDown (const MouseEvent& e) - { - PopupMenu m; - m.addItem (1, T("Quit the Juce demo")); - - const int result = m.show(); - - if (result == 1) - JUCEApplication::getInstance()->systemRequestedQuit(); - } -}; - -#endif - -//============================================================================== -MainDemoWindow::MainDemoWindow() - : DocumentWindow (T("JUCE Demo!"), - Colours::azure, - DocumentWindow::allButtons, - true) -{ - commandManager = new ApplicationCommandManager(); - - setResizable (true, false); // resizability is a property of ResizableWindow - setResizeLimits (400, 300, 8192, 8192); - - ContentComp* contentComp = new ContentComp (this); - - commandManager->registerAllCommandsForTarget (contentComp); - commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance()); - - // this lets the command manager use keypresses that arrive in our window to send - // out commands - addKeyListener (commandManager->getKeyMappings()); - - // sets the main content component for the window to be this tabbed - // panel. This will be deleted when the window is deleted. - setContentComponent (contentComp); - - // this tells the DocumentWindow to automatically create and manage a MenuBarComponent - // which uses our contentComp as its MenuBarModel - setMenuBar (contentComp); - - // tells our menu bar model that it should watch this command manager for - // changes, and send change messages accordingly. - contentComp->setApplicationCommandManagerToWatch (commandManager); - - setVisible (true); - -#if JUCE_WIN32 || JUCE_LINUX - taskbarIcon = new DemoTaskbarComponent(); -#endif -} - -MainDemoWindow::~MainDemoWindow() -{ -#if JUCE_WIN32 || JUCE_LINUX - deleteAndZero (taskbarIcon); -#endif - - // because we've set the content comp to be used as our menu bar model, we - // have to switch this off before deleting the content comp.. - setMenuBar (0); - -#if JUCE_MAC // ..and also the main bar if we're using that on a Mac... - MenuBarModel::setMacMainMenu (0); -#endif - - // setting our content component to 0 will delete the current one, and - // that will in turn delete all its child components. You don't always - // have to do this explicitly, because the base class's destructor will - // also delete the content component, but in this case we need to - // make sure our content comp has gone away before deleting our command - // manager. - setContentComponent (0, true); - - delete commandManager; -} - -void MainDemoWindow::closeButtonPressed() -{ - // The correct thing to do when you want the app to quit is to call the - // JUCEApplication::systemRequestedQuit() method. - - // That means that requests to quit that come from your own UI, or from other - // OS-specific sources (e.g. the dock menu on the mac) all get handled in the - // same way. - - JUCEApplication::getInstance()->systemRequestedQuit(); -} +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ + +#include "jucedemo_headers.h" +#include "MainDemoWindow.h" + + +//============================================================================== +class SourceCodeWindow; +static SourceCodeWindow* sourceWindow = 0; + + +//============================================================================== +class SourceCodeWindow : public DialogWindow +{ + TextEditor* textBox; + +public: + SourceCodeWindow() + : DialogWindow (T("JUCE Demo Source Code!"), + Colours::floralwhite, + false) + { + setContentComponent (textBox = new TextEditor()); + + textBox->setColour (TextEditor::backgroundColourId, Colours::white); + textBox->setMultiLine (true, false); + textBox->setReturnKeyStartsNewLine (true); + + setResizable (true, true); // we'll choose a corner-resizer component for this window, + // as a contrast to the resizable border on the main window + } + + ~SourceCodeWindow() + { + // the text editor gets deleted automatically because it's the + // window's content component. + + sourceWindow = 0; + } + + void closeButtonPressed() + { + delete this; + } + + void updateSourceCode (const String& text) + { + Font font (14.0f); + font.setTypefaceName (Font::getDefaultMonospacedFontName()); + textBox->setFont (font); + + textBox->setText (text); + + toFront (true); + } +}; + +//============================================================================== +class ContentComp : public Component, + public MenuBarModel, + public ApplicationCommandTarget +{ + //============================================================================== + MainDemoWindow* mainWindow; + + OldSchoolLookAndFeel oldLookAndFeel; + + Component* currentDemo; + int currentDemoId; + const char* demoSourceCodeText; + + TooltipWindow tooltipWindow; // to add tooltips to an application, you + // just need to create one of these and leave it + // there to do its work.. + + enum CommandIDs + { + showPathsAndTransforms = 0x2000, + showFontsAndText = 0x2001, + showWidgets = 0x2002, + showThreading = 0x2003, + showTreeView = 0x2004, + showAudio = 0x2005, + showDragAndDrop = 0x2006, + showOpenGL = 0x2007, + showQuicktime = 0x2008, + showInterprocessComms = 0x2009, + showTable = 0x2010, + showCamera = 0x2011, + showWebBrowser = 0x2012, + + showSourceCode = 0x200a, + + setDefaultLookAndFeel = 0x200b, + setOldSchoolLookAndFeel = 0x200c, + useNativeTitleBar = 0x200d, + useNativeMenus = 0x200e, + goToKioskMode = 0x200f + }; + +public: + //============================================================================== + ContentComp (MainDemoWindow* mainWindow_) + : mainWindow (mainWindow_), + currentDemo (0), + currentDemoId (0), + demoSourceCodeText (0) + { + invokeDirectly (showPathsAndTransforms, true); + } + + ~ContentComp() + { + // (need to do this because the old school look-and-feel object is one of our members, + // so will be deleted with us, and would leave a dangling pointer if it's selected) + LookAndFeel::setDefaultLookAndFeel (0); + + deleteAllChildren(); + + deleteAndZero (sourceWindow); + } + + //============================================================================== + void resized() + { + if (currentDemo != 0) + currentDemo->setBounds (0, 0, getWidth(), getHeight()); + } + + //============================================================================== + void showDemo (Component* demoComp, const char* sourceCodeText) + { + delete currentDemo; + currentDemo = demoComp; + + addAndMakeVisible (currentDemo); + resized(); + + demoSourceCodeText = sourceCodeText; + } + + void showSource() + { + if (sourceWindow == 0) + { + sourceWindow = new SourceCodeWindow(); + sourceWindow->centreAroundComponent (this, 750, 600); + sourceWindow->setVisible (true); + } + + sourceWindow->updateSourceCode (demoSourceCodeText); + } + + //============================================================================== + const StringArray getMenuBarNames() + { + const tchar* const names[] = { T("Demo"), T("Source Code"), T("Look-and-feel"), 0 }; + + return StringArray ((const tchar**) names); + } + + const PopupMenu getMenuForIndex (int menuIndex, + const String& menuName) + { + ApplicationCommandManager* const commandManager = mainWindow->commandManager; + + PopupMenu menu; + + if (menuIndex == 0) + { + menu.addCommandItem (commandManager, showPathsAndTransforms); + menu.addCommandItem (commandManager, showFontsAndText); + menu.addCommandItem (commandManager, showWidgets); + menu.addCommandItem (commandManager, showThreading); + menu.addCommandItem (commandManager, showTreeView); + menu.addCommandItem (commandManager, showTable); + menu.addCommandItem (commandManager, showAudio); + menu.addCommandItem (commandManager, showDragAndDrop); + menu.addCommandItem (commandManager, showOpenGL); + menu.addCommandItem (commandManager, showQuicktime); + menu.addCommandItem (commandManager, showInterprocessComms); + menu.addCommandItem (commandManager, showCamera); + menu.addCommandItem (commandManager, showWebBrowser); + + menu.addSeparator(); + menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit); + } + else if (menuIndex == 1) + { + menu.addCommandItem (commandManager, showSourceCode); + } + else if (menuIndex == 2) + { + menu.addCommandItem (commandManager, setDefaultLookAndFeel); + menu.addCommandItem (commandManager, setOldSchoolLookAndFeel); + menu.addSeparator(); + menu.addCommandItem (commandManager, useNativeTitleBar); + +#if JUCE_MAC + menu.addCommandItem (commandManager, useNativeMenus); +#endif + +#if ! JUCE_LINUX + menu.addCommandItem (commandManager, goToKioskMode); +#endif + } + + return menu; + } + + void menuItemSelected (int menuItemID, + int topLevelMenuIndex) + { + // all our menu items are invoked automatically as commands, so no need to do + // anything in this callback + } + + //============================================================================== + // The following methods implement the ApplicationCommandTarget interface, allowing + // this window to publish a set of actions it can perform, and which can be mapped + // onto menus, keypresses, etc. + + ApplicationCommandTarget* getNextCommandTarget() + { + // this will return the next parent component that is an ApplicationCommandTarget (in this + // case, there probably isn't one, but it's best to use this method in your own apps). + return findFirstTargetParentComponent(); + } + + void getAllCommands (Array & commands) + { + // this returns the set of all commands that this target can perform.. + const CommandID ids[] = { showPathsAndTransforms, + showFontsAndText, + showWidgets, + showThreading, + showTreeView, + showTable, + showAudio, + showDragAndDrop, + showOpenGL, + showQuicktime, + showCamera, + showWebBrowser, + showInterprocessComms, + showSourceCode, + setDefaultLookAndFeel, + setOldSchoolLookAndFeel, + useNativeTitleBar +#if JUCE_MAC + , useNativeMenus +#endif + +#if ! JUCE_LINUX + , goToKioskMode +#endif + }; + + commands.addArray (ids, numElementsInArray (ids)); + } + + // This method is used when something needs to find out the details about one of the commands + // that this object can perform.. + void getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result) + { + const String generalCategory (T("General")); + const String demosCategory (T("Demos")); + + switch (commandID) + { + case showPathsAndTransforms: + result.setInfo (T("Paths and Transforms"), T("Shows the paths & transforms demo"), demosCategory, 0); + result.setTicked (currentDemoId == showPathsAndTransforms); + result.addDefaultKeypress (T('1'), ModifierKeys::commandModifier); + break; + + case showFontsAndText: + result.setInfo (T("Fonts and Text"), T("Shows the fonts & text demo"), demosCategory, 0); + result.setTicked (currentDemoId == showFontsAndText); + result.addDefaultKeypress (T('2'), ModifierKeys::commandModifier); + break; + + case showWidgets: + result.setInfo (T("Widgets"), T("Shows the widgets demo"), demosCategory, 0); + result.setTicked (currentDemoId == showWidgets); + result.addDefaultKeypress (T('3'), ModifierKeys::commandModifier); + break; + + case showThreading: + result.setInfo (T("Multithreading"), T("Shows the threading demo"), demosCategory, 0); + result.setTicked (currentDemoId == showThreading); + result.addDefaultKeypress (T('4'), ModifierKeys::commandModifier); + break; + + case showTreeView: + result.setInfo (T("Treeviews"), T("Shows the treeviews demo"), demosCategory, 0); + result.setTicked (currentDemoId == showTreeView); + result.addDefaultKeypress (T('5'), ModifierKeys::commandModifier); + break; + + case showTable: + result.setInfo (T("Table Components"), T("Shows the table component demo"), demosCategory, 0); + result.setTicked (currentDemoId == showTable); + result.addDefaultKeypress (T('6'), ModifierKeys::commandModifier); + break; + + case showAudio: + result.setInfo (T("Audio"), T("Shows the audio demo"), demosCategory, 0); + result.setTicked (currentDemoId == showAudio); + result.addDefaultKeypress (T('7'), ModifierKeys::commandModifier); + break; + + case showDragAndDrop: + result.setInfo (T("Drag-and-drop"), T("Shows the drag & drop demo"), demosCategory, 0); + result.setTicked (currentDemoId == showDragAndDrop); + result.addDefaultKeypress (T('8'), ModifierKeys::commandModifier); + break; + + case showOpenGL: + result.setInfo (T("OpenGL"), T("Shows the OpenGL demo"), demosCategory, 0); + result.addDefaultKeypress (T('9'), ModifierKeys::commandModifier); + result.setTicked (currentDemoId == showOpenGL); +#if ! JUCE_OPENGL + result.setActive (false); +#endif + break; + + case showQuicktime: + result.setInfo (T("Quicktime"), T("Shows the Quicktime demo"), demosCategory, 0); + result.addDefaultKeypress (T('b'), ModifierKeys::commandModifier); + result.setTicked (currentDemoId == showQuicktime); +#if ! (JUCE_QUICKTIME && ! JUCE_LINUX) + result.setActive (false); +#endif + break; + + case showCamera: + result.setInfo (T("Camera Capture"), T("Shows the camera demo"), demosCategory, 0); + result.addDefaultKeypress (T('c'), ModifierKeys::commandModifier); + result.setTicked (currentDemoId == showCamera); +#if ! JUCE_USE_CAMERA + result.setActive (false); +#endif + break; + + case showWebBrowser: + result.setInfo (T("Web Browser"), T("Shows the web browser demo"), demosCategory, 0); + result.addDefaultKeypress (T('i'), ModifierKeys::commandModifier); + result.setTicked (currentDemoId == showWebBrowser); +#if (! JUCE_WEB_BROWSER) || JUCE_LINUX + result.setActive (false); +#endif + break; + + case showInterprocessComms: + result.setInfo (T("Interprocess Comms"), T("Shows the interprocess communications demo"), demosCategory, 0); + result.addDefaultKeypress (T('0'), ModifierKeys::commandModifier); + result.setTicked (currentDemoId == showInterprocessComms); + break; + + case showSourceCode: + result.setInfo (T("Show the source code for this demo"), T("Opens a window containing this demo's source code"), generalCategory, 0); + result.addDefaultKeypress (T('s'), ModifierKeys::commandModifier); + break; + + case setDefaultLookAndFeel: + result.setInfo (T("Use default look-and-feel"), String::empty, generalCategory, 0); + result.setTicked ((typeid (LookAndFeel) == typeid (getLookAndFeel())) != 0); + break; + + case setOldSchoolLookAndFeel: + result.setInfo (T("Use the old, original juce look-and-feel"), String::empty, generalCategory, 0); + result.setTicked ((typeid (OldSchoolLookAndFeel) == typeid (getLookAndFeel())) != 0); + break; + + case useNativeTitleBar: + result.setInfo (T("Use native window title bar"), String::empty, generalCategory, 0); + result.setTicked (mainWindow->isUsingNativeTitleBar()); + break; + +#if JUCE_MAC + case useNativeMenus: + result.setInfo (T("Use the native OSX menu bar"), String::empty, generalCategory, 0); + result.setTicked (MenuBarModel::getMacMainMenu() != 0); + break; +#endif + +#if ! JUCE_LINUX + case goToKioskMode: + result.setInfo (T("Show full-screen kiosk mode"), String::empty, generalCategory, 0); + result.setTicked (Desktop::getInstance().getKioskModeComponent() != 0); + break; +#endif + + default: + break; + }; + } + + // this is the ApplicationCommandTarget method that is used to actually perform one of our commands.. + bool perform (const InvocationInfo& info) + { + switch (info.commandID) + { + case showPathsAndTransforms: + showDemo (createPathsAndTransformsDemo(), BinaryData::pathsandtransformsdemo_cpp); + currentDemoId = showPathsAndTransforms; + break; + + case showFontsAndText: + showDemo (createFontsAndTextDemo(), BinaryData::fontsandtextdemo_cpp); + currentDemoId = showFontsAndText; + break; + + case showWidgets: + showDemo (createWidgetsDemo (mainWindow->commandManager), BinaryData::widgetsdemo_cpp); + currentDemoId = showWidgets; + break; + + case showThreading: + showDemo (createThreadingDemo(), BinaryData::threadingdemo_cpp); + currentDemoId = showThreading; + break; + + case showTreeView: + showDemo (createTreeViewDemo(), BinaryData::treeviewdemo_cpp); + currentDemoId = showTreeView; + break; + + case showTable: + showDemo (createTableDemo(), BinaryData::tabledemo_cpp); + currentDemoId = showTable; + break; + + case showAudio: + showDemo (createAudioDemo(), BinaryData::audiodemo_cpp); + currentDemoId = showAudio; + break; + + case showDragAndDrop: + showDemo (createDragAndDropDemo(), BinaryData::draganddropdemo_cpp); + currentDemoId = showDragAndDrop; + break; + + case showOpenGL: +#if JUCE_OPENGL + showDemo (createOpenGLDemo(), BinaryData::opengldemo_cpp); + currentDemoId = showOpenGL; +#endif + break; + + case showQuicktime: +#if JUCE_QUICKTIME && ! JUCE_LINUX + showDemo (createQuickTimeDemo(), BinaryData::quicktimedemo_cpp); + currentDemoId = showQuicktime; +#endif + break; + + case showCamera: +#if JUCE_USE_CAMERA + showDemo (createCameraDemo(), BinaryData::camerademo_cpp); + currentDemoId = showCamera; +#endif + break; + + case showWebBrowser: +#if JUCE_WEB_BROWSER + showDemo (createWebBrowserDemo(), BinaryData::webbrowserdemo_cpp); + currentDemoId = showWebBrowser; +#endif + break; + + case showInterprocessComms: + showDemo (createInterprocessCommsDemo(), BinaryData::interprocesscommsdemo_cpp); + currentDemoId = showInterprocessComms; + break; + + case showSourceCode: + showSource(); + break; + + case setDefaultLookAndFeel: + LookAndFeel::setDefaultLookAndFeel (0); + break; + + case setOldSchoolLookAndFeel: + LookAndFeel::setDefaultLookAndFeel (&oldLookAndFeel); + break; + + case useNativeTitleBar: + mainWindow->setUsingNativeTitleBar (! mainWindow->isUsingNativeTitleBar()); + break; + +#if JUCE_MAC + case useNativeMenus: + if (MenuBarModel::getMacMainMenu() != 0) + { + MenuBarModel::setMacMainMenu (0); + mainWindow->setMenuBar ((ContentComp*) mainWindow->getContentComponent()); + } + else + { + MenuBarModel::setMacMainMenu ((ContentComp*) mainWindow->getContentComponent()); + mainWindow->setMenuBar (0); + } + + break; +#endif + +#if ! JUCE_LINUX + case goToKioskMode: + if (Desktop::getInstance().getKioskModeComponent() == 0) + { + Desktop::getInstance().setKioskModeComponent (getTopLevelComponent()); + } + else + { + Desktop::getInstance().setKioskModeComponent (0); + } + + break; +#endif + + default: + return false; + }; + + return true; + } + + juce_UseDebuggingNewOperator +}; + +//============================================================================== +#if JUCE_WIN32 || JUCE_LINUX + +// Just add a simple icon to the Window system tray area.. +class DemoTaskbarComponent : public SystemTrayIconComponent +{ +public: + DemoTaskbarComponent() + { + // Create an icon which is just a square with a "j" in it.. + Image icon (Image::RGB, 32, 32, true); + Graphics g (icon); + g.fillAll (Colours::lightblue); + g.setColour (Colours::black); + g.setFont ((float) icon.getHeight(), Font::bold); + g.drawText (T("j"), 0, 0, icon.getWidth(), icon.getHeight(), Justification::centred, false); + + setIconImage (icon); + + setIconTooltip (T("Juce Demo App!")); + } + + ~DemoTaskbarComponent() + { + } + + void mouseDown (const MouseEvent& e) + { + PopupMenu m; + m.addItem (1, T("Quit the Juce demo")); + + const int result = m.show(); + + if (result == 1) + JUCEApplication::getInstance()->systemRequestedQuit(); + } +}; + +#endif + +//============================================================================== +MainDemoWindow::MainDemoWindow() + : DocumentWindow (T("JUCE Demo!"), + Colours::azure, + DocumentWindow::allButtons, + true) +{ + commandManager = new ApplicationCommandManager(); + + setResizable (true, false); // resizability is a property of ResizableWindow + setResizeLimits (400, 300, 8192, 8192); + + ContentComp* contentComp = new ContentComp (this); + + commandManager->registerAllCommandsForTarget (contentComp); + commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance()); + + // this lets the command manager use keypresses that arrive in our window to send + // out commands + addKeyListener (commandManager->getKeyMappings()); + + // sets the main content component for the window to be this tabbed + // panel. This will be deleted when the window is deleted. + setContentComponent (contentComp); + + // this tells the DocumentWindow to automatically create and manage a MenuBarComponent + // which uses our contentComp as its MenuBarModel + setMenuBar (contentComp); + + // tells our menu bar model that it should watch this command manager for + // changes, and send change messages accordingly. + contentComp->setApplicationCommandManagerToWatch (commandManager); + + setVisible (true); + +#if JUCE_WIN32 || JUCE_LINUX + taskbarIcon = new DemoTaskbarComponent(); +#endif +} + +MainDemoWindow::~MainDemoWindow() +{ +#if JUCE_WIN32 || JUCE_LINUX + deleteAndZero (taskbarIcon); +#endif + + // because we've set the content comp to be used as our menu bar model, we + // have to switch this off before deleting the content comp.. + setMenuBar (0); + +#if JUCE_MAC // ..and also the main bar if we're using that on a Mac... + MenuBarModel::setMacMainMenu (0); +#endif + + // setting our content component to 0 will delete the current one, and + // that will in turn delete all its child components. You don't always + // have to do this explicitly, because the base class's destructor will + // also delete the content component, but in this case we need to + // make sure our content comp has gone away before deleting our command + // manager. + setContentComponent (0, true); + + delete commandManager; +} + +void MainDemoWindow::closeButtonPressed() +{ + // The correct thing to do when you want the app to quit is to call the + // JUCEApplication::systemRequestedQuit() method. + + // That means that requests to quit that come from your own UI, or from other + // OS-specific sources (e.g. the dock menu on the mac) all get handled in the + // same way. + + JUCEApplication::getInstance()->systemRequestedQuit(); +} diff --git a/extras/juce demo/src/binarydata/WebBrowserDemo.cpp b/extras/juce demo/src/binarydata/WebBrowserDemo.cpp index 54020225e3..d0c0d4f8d0 100644 --- a/extras/juce demo/src/binarydata/WebBrowserDemo.cpp +++ b/extras/juce demo/src/binarydata/WebBrowserDemo.cpp @@ -1,33 +1,33 @@ /* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-7 by Raw Material Software ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the - GNU General Public License, as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later version. - - JUCE is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with JUCE; if not, visit www.gnu.org/licenses or write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------------ - - If you'd like to release a closed-source product which uses JUCE, commercial - licenses are also available: visit www.rawmaterialsoftware.com/juce for - more information. - - ============================================================================== - */ + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ #include "../jucedemo_headers.h" @@ -117,7 +117,7 @@ public: void textEditorTextChanged (TextEditor& editor) {} void textEditorEscapeKeyPressed (TextEditor& editor) {} void textEditorFocusLost (TextEditor& editor) {} - + void textEditorReturnKeyPressed (TextEditor&) { webView->goToURL (addressTextBox->getText()); diff --git a/extras/juce demo/src/demos/WebBrowserDemo.cpp b/extras/juce demo/src/demos/WebBrowserDemo.cpp index 54020225e3..d0c0d4f8d0 100644 --- a/extras/juce demo/src/demos/WebBrowserDemo.cpp +++ b/extras/juce demo/src/demos/WebBrowserDemo.cpp @@ -1,33 +1,33 @@ /* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-7 by Raw Material Software ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the - GNU General Public License, as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later version. - - JUCE is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with JUCE; if not, visit www.gnu.org/licenses or write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------------ - - If you'd like to release a closed-source product which uses JUCE, commercial - licenses are also available: visit www.rawmaterialsoftware.com/juce for - more information. - - ============================================================================== - */ + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ #include "../jucedemo_headers.h" @@ -117,7 +117,7 @@ public: void textEditorTextChanged (TextEditor& editor) {} void textEditorEscapeKeyPressed (TextEditor& editor) {} void textEditorFocusLost (TextEditor& editor) {} - + void textEditorReturnKeyPressed (TextEditor&) { webView->goToURL (addressTextBox->getText()); diff --git a/extras/juce demo/src/juce_AppConfig.h b/extras/juce demo/src/juce_AppConfig.h index 32408e74fe..b946c6e333 100644 --- a/extras/juce demo/src/juce_AppConfig.h +++ b/extras/juce demo/src/juce_AppConfig.h @@ -31,10 +31,17 @@ /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. + + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 diff --git a/extras/juce demo/src/jucedemo_headers.h b/extras/juce demo/src/jucedemo_headers.h index cf0a514a8f..c1b43d5c04 100644 --- a/extras/juce demo/src/jucedemo_headers.h +++ b/extras/juce demo/src/jucedemo_headers.h @@ -1,77 +1,77 @@ -/* - ============================================================================== - - This file is part of the JUCE library - "Jules' Utility Class Extensions" - Copyright 2004-7 by Raw Material Software ltd. - - ------------------------------------------------------------------------------ - - JUCE can be redistributed and/or modified under the terms of the - GNU General Public License, as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later version. - - JUCE is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with JUCE; if not, visit www.gnu.org/licenses or write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------------ - - If you'd like to release a closed-source product which uses JUCE, commercial - licenses are also available: visit www.rawmaterialsoftware.com/juce for - more information. - - ============================================================================== -*/ - -#ifndef __JUCEDEMO_HEADERS_JUCEHEADER__ -#define __JUCEDEMO_HEADERS_JUCEHEADER__ - -// include the JUCE headers.. -#include "juce_AppConfig.h" - -#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) - // (in VC6, there are problems with the amalgamated version...) - #include "../../../juce.h" -#else - #include "../../../juce_amalgamated.h" -#endif - -// this declares the binary resources that we're building into the -// application - i.e. images, sounds, etc that the demos use -#include "BinaryData.h" - -// Pre-declare the functions that create each of the demo components.. -Component* createFontsAndTextDemo(); -Component* createPathsAndTransformsDemo(); -Component* createWidgetsDemo (ApplicationCommandManager* commandManager); -Component* createThreadingDemo(); -Component* createTreeViewDemo(); -Component* createTableDemo(); -Component* createAudioDemo(); -Component* createDragAndDropDemo(); -Component* createInterprocessCommsDemo(); - -#if JUCE_QUICKTIME && ! JUCE_LINUX - Component* createQuickTimeDemo(); -#endif - -#if JUCE_OPENGL - Component* createOpenGLDemo(); -#endif - -#if JUCE_WEB_BROWSER - Component* createWebBrowserDemo(); -#endif - -#if JUCE_USE_CAMERA - Component* createCameraDemo(); -#endif - - -#endif // __JUCEDEMO_HEADERS_JUCEHEADER__ +/* + ============================================================================== + + This file is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-7 by Raw Material Software ltd. + + ------------------------------------------------------------------------------ + + JUCE can be redistributed and/or modified under the terms of the + GNU General Public License, as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later version. + + JUCE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with JUCE; if not, visit www.gnu.org/licenses or write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + ------------------------------------------------------------------------------ + + If you'd like to release a closed-source product which uses JUCE, commercial + licenses are also available: visit www.rawmaterialsoftware.com/juce for + more information. + + ============================================================================== +*/ + +#ifndef __JUCEDEMO_HEADERS_JUCEHEADER__ +#define __JUCEDEMO_HEADERS_JUCEHEADER__ + +// include the JUCE headers.. +#include "juce_AppConfig.h" + +#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) + // (in VC6, there are problems with the amalgamated version...) + #include "../../../juce.h" +#else + #include "../../../juce_amalgamated.h" +#endif + +// this declares the binary resources that we're building into the +// application - i.e. images, sounds, etc that the demos use +#include "BinaryData.h" + +// Pre-declare the functions that create each of the demo components.. +Component* createFontsAndTextDemo(); +Component* createPathsAndTransformsDemo(); +Component* createWidgetsDemo (ApplicationCommandManager* commandManager); +Component* createThreadingDemo(); +Component* createTreeViewDemo(); +Component* createTableDemo(); +Component* createAudioDemo(); +Component* createDragAndDropDemo(); +Component* createInterprocessCommsDemo(); + +#if JUCE_QUICKTIME && ! JUCE_LINUX + Component* createQuickTimeDemo(); +#endif + +#if JUCE_OPENGL + Component* createOpenGLDemo(); +#endif + +#if JUCE_WEB_BROWSER + Component* createWebBrowserDemo(); +#endif + +#if JUCE_USE_CAMERA + Component* createCameraDemo(); +#endif + + +#endif // __JUCEDEMO_HEADERS_JUCEHEADER__ diff --git a/extras/the jucer/build/linux/Jucer.make b/extras/the jucer/build/linux/Jucer.make index 63447a4359..4c1a2357bc 100644 --- a/extras/the jucer/build/linux/Jucer.make +++ b/extras/the jucer/build/linux/Jucer.make @@ -5,19 +5,22 @@ ifndef CONFIG CONFIG=Debug endif +# if multiple archs are defined turn off automated dependency generation +DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD) + ifeq ($(CONFIG),Debug) BINDIR := build LIBDIR := build OBJDIR := build/intermediate/Debug OUTDIR := build - CPPFLAGS := -MMD -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" + CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -D_DEBUG -ggdb - CXXFLAGS := $(CFLAGS) + CXXFLAGS += $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -mwindows -L"/usr/X11R6/lib/" -L"../../../../bin" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound LDDEPS := RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" TARGET := jucer - BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) + BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif ifeq ($(CONFIG),Release) @@ -25,14 +28,14 @@ ifeq ($(CONFIG),Release) LIBDIR := build OBJDIR := build/intermediate/Release OUTDIR := build - CPPFLAGS := -MMD -D "LINUX=1" -D "NDEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" + CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O2 - CXXFLAGS := $(CFLAGS) + CXXFLAGS += $(CFLAGS) LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -mwindows -s -L"/usr/X11R6/lib/" -L"../../../../bin" -lfreetype -lpthread -lX11 -lGL -lGLU -lXinerama -lasound LDDEPS := RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -I "/usr/include" -I "/usr/include/freetype2" TARGET := jucer - BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) + BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) endif OBJECTS := \ @@ -55,18 +58,18 @@ OBJECTS := \ $(OBJDIR)/jucer_UtilityFunctions.o \ $(OBJDIR)/jucer_FilePropertyComponent.o \ $(OBJDIR)/jucer_FontPropertyComponent.o \ - $(OBJDIR)/jucer_BinaryResources.o \ $(OBJDIR)/jucer_ComponentLayout.o \ - $(OBJDIR)/jucer_GeneratedCode.o \ - $(OBJDIR)/jucer_JucerDocument.o \ + $(OBJDIR)/jucer_BinaryResources.o \ $(OBJDIR)/jucer_ObjectTypes.o \ $(OBJDIR)/jucer_PaintRoutine.o \ + $(OBJDIR)/jucer_GeneratedCode.o \ + $(OBJDIR)/jucer_JucerDocument.o \ $(OBJDIR)/jucer_ComponentTypeHandler.o \ $(OBJDIR)/jucer_ButtonDocument.o \ $(OBJDIR)/jucer_ComponentDocument.o \ $(OBJDIR)/jucer_ColouredElement.o \ - $(OBJDIR)/jucer_FillType.o \ $(OBJDIR)/jucer_PaintElement.o \ + $(OBJDIR)/jucer_FillType.o \ $(OBJDIR)/jucer_PaintElementPath.o \ $(OBJDIR)/jucer_StrokeType.o \ @@ -75,7 +78,7 @@ CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) ifeq (,$(CMD)) MKDIR_TYPE := posix endif -ifeq (/bin/sh.exe,$(SHELL)) +ifeq (/bin,$(findstring /bin,$(SHELL))) MKDIR_TYPE := posix endif ifeq ($(MKDIR_TYPE),posix) @@ -102,7 +105,8 @@ $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) clean: @echo Cleaning Jucer ifeq ($(MKDIR_TYPE),posix) - -@rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR) + -@rm -f $(OUTDIR)/$(TARGET) + -@rm -rf $(OBJDIR) else -@if exist $(subst /,\,$(OUTDIR)/$(TARGET)) del /q $(subst /,\,$(OUTDIR)/$(TARGET)) -@if exist $(subst /,\,$(OBJDIR)) del /q $(subst /,\,$(OBJDIR)) @@ -112,167 +116,167 @@ endif $(OBJDIR)/BinaryData.o: ../../src/BinaryData.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_Main.o: ../../src/jucer_Main.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/juce_LibrarySource.o: ../../src/juce_LibrarySource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ComponentLayoutEditor.o: ../../src/ui/jucer_ComponentLayoutEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ComponentLayoutPanel.o: ../../src/ui/jucer_ComponentLayoutPanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ComponentOverlayComponent.o: ../../src/ui/jucer_ComponentOverlayComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_EditingPanelBase.o: ../../src/ui/jucer_EditingPanelBase.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_JucerDocumentHolder.o: ../../src/ui/jucer_JucerDocumentHolder.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_MainWindow.o: ../../src/ui/jucer_MainWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_PaintRoutineEditor.o: ../../src/ui/jucer_PaintRoutineEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_PaintRoutinePanel.o: ../../src/ui/jucer_PaintRoutinePanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_PrefsPanel.o: ../../src/ui/jucer_PrefsPanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ResourceEditorPanel.o: ../../src/ui/jucer_ResourceEditorPanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_SnapGridPainter.o: ../../src/ui/jucer_SnapGridPainter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_TestComponent.o: ../../src/ui/jucer_TestComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_StoredSettings.o: ../../src/utility/jucer_StoredSettings.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_UtilityFunctions.o: ../../src/utility/jucer_UtilityFunctions.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_FilePropertyComponent.o: ../../src/properties/jucer_FilePropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_FontPropertyComponent.o: ../../src/properties/jucer_FontPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_BinaryResources.o: ../../src/model/jucer_BinaryResources.cpp +$(OBJDIR)/jucer_ComponentLayout.o: ../../src/model/jucer_ComponentLayout.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_ComponentLayout.o: ../../src/model/jucer_ComponentLayout.cpp +$(OBJDIR)/jucer_BinaryResources.o: ../../src/model/jucer_BinaryResources.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_GeneratedCode.o: ../../src/model/jucer_GeneratedCode.cpp +$(OBJDIR)/jucer_ObjectTypes.o: ../../src/model/jucer_ObjectTypes.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_JucerDocument.o: ../../src/model/jucer_JucerDocument.cpp +$(OBJDIR)/jucer_PaintRoutine.o: ../../src/model/jucer_PaintRoutine.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_ObjectTypes.o: ../../src/model/jucer_ObjectTypes.cpp +$(OBJDIR)/jucer_GeneratedCode.o: ../../src/model/jucer_GeneratedCode.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_PaintRoutine.o: ../../src/model/jucer_PaintRoutine.cpp +$(OBJDIR)/jucer_JucerDocument.o: ../../src/model/jucer_JucerDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ComponentTypeHandler.o: ../../src/model/components/jucer_ComponentTypeHandler.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ButtonDocument.o: ../../src/model/documents/jucer_ButtonDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ComponentDocument.o: ../../src/model/documents/jucer_ComponentDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_ColouredElement.o: ../../src/model/paintelements/jucer_ColouredElement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_FillType.o: ../../src/model/paintelements/jucer_FillType.cpp +$(OBJDIR)/jucer_PaintElement.o: ../../src/model/paintelements/jucer_PaintElement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -$(OBJDIR)/jucer_PaintElement.o: ../../src/model/paintelements/jucer_PaintElement.cpp +$(OBJDIR)/jucer_FillType.o: ../../src/model/paintelements/jucer_FillType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_PaintElementPath.o: ../../src/model/paintelements/jucer_PaintElementPath.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" $(OBJDIR)/jucer_StrokeType.o: ../../src/model/paintelements/jucer_StrokeType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< + @$(CXX) $(CXXFLAGS) -o "$@" -c "$<" -include $(OBJECTS:%.o=%.d) diff --git a/extras/the jucer/src/juce_AppConfig.h b/extras/the jucer/src/juce_AppConfig.h index 330ec8f9da..15558f21c7 100644 --- a/extras/the jucer/src/juce_AppConfig.h +++ b/extras/the jucer/src/juce_AppConfig.h @@ -31,10 +31,17 @@ /* This file contains settings that you might want to explicitly apply to - the your build. + your Juce build. - Most of these are turned on or off by default, but you can override - that setting here by un-commenting it and giving it a 1 or 0 value. + These flags enable or disable juce features - if you're linking to juce as + a library, then to change them, you'd need to alter your juce_Config.h file and + recompile the juce lib. But because we're using the amalgamated file, you can + just include this file before including your juce_amalgamated.cpp file to + have the same effect. + + If you leave any of these commented-out, they'll take on the default value + assigned to them in juce_Config.h, so to force them on or off, just set them + to an explicit 0 or 1 in here. */ //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 diff --git a/extras/the jucer/src/juce_LibrarySource.cpp b/extras/the jucer/src/juce_LibrarySource.cpp index 6310476300..b447646246 100644 --- a/extras/the jucer/src/juce_LibrarySource.cpp +++ b/extras/the jucer/src/juce_LibrarySource.cpp @@ -9,4 +9,13 @@ */ #include "juce_AppConfig.h" + +// This is where all the juce code gets included, via this amalgamated file.. #include "../../../juce_amalgamated.cpp" + + +/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through + the amalgamated file can be slow or impossible for the debugger. But if you use the following line + instead of the one above, then it makes it a lot easier.. +*/ +//#include "../../../src/juce_amalgamated_template.cpp" diff --git a/juce_Config.h b/juce_Config.h index bea0ae2f0f..dec4999a98 100644 --- a/juce_Config.h +++ b/juce_Config.h @@ -30,7 +30,7 @@ */ #ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) +#define __JUCE_CONFIG_JUCEHEADER__ //============================================================================== /* diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index d148867c88..3f3291090c 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -46,7 +46,7 @@ /********* Start of inlined file: juce_Config.h *********/ #ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) +#define __JUCE_CONFIG_JUCEHEADER__ /* This file contains macros that enable/disable various JUCE features. @@ -252,6 +252,8 @@ #endif /********* End of inlined file: juce_Config.h *********/ + // FORCE_AMALGAMATOR_INCLUDE + //============================================================================== #ifdef _WIN32 @@ -260,214 +262,6 @@ #ifndef __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__ #define __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifndef STRICT #define STRICT 1 #endif @@ -642,7 +436,99 @@ public: /********* End of inlined file: juce_win32_NativeIncludes.h *********/ #elif defined (LINUX) - // + +/********* Start of inlined file: juce_linux_NativeIncludes.h *********/ +#ifndef __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ +#define __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ + +/* + This file wraps together all the linux-specific headers, so + that we can include them all just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the + way of the rest of the codebase. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Got a build error here? You'll need to install the freetype library... + The name of the package to install is "libfreetype6-dev". +*/ +#include +#include FT_FREETYPE_H + +#include +#include +#include +#include +#include +#include +#include + +#if JUCE_USE_XINERAMA + /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. */ + #include +#endif + +#if JUCE_USE_XSHM + #include + #include + #include +#endif + +#if JUCE_OPENGL + /* Got an include error here? + + If you want to install OpenGL support, the packages to get are "mesa-common-dev" + and "freeglut3-dev". + + Alternatively, you can turn off the JUCE_OPENGL flag in juce_Config.h if you + want to disable it. + */ + #include +#endif + +#undef KeyPress + +#if JUCE_ALSA + /* Got an include error here? If so, you've either not got ALSA installed, or you've + not got your paths set up correctly to find its header files. + + The package you need to install to get ASLA support is "libasound2-dev". + + If you don't have the ALSA library and don't want to build Juce with audio support, + just disable the JUCE_ALSA flag in juce_Config.h + */ + #include +#endif + +#undef SIZEOF + +#endif // __JUCE_LINUX_NATIVEINCLUDES_JUCEHEADER__ +/********* End of inlined file: juce_linux_NativeIncludes.h *********/ + #else /********* Start of inlined file: juce_mac_NativeIncludes.h *********/ @@ -19768,214 +19654,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_QuickTimeAudioFormat.cpp *********/ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #if JUCE_QUICKTIME #if ! defined (_WIN32) @@ -28683,214 +28361,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_AudioUnitPluginFormat.mm *********/ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #if JUCE_PLUGINHOST_AU && (! (defined (LINUX) || defined (_WIN32))) #include @@ -30366,214 +29836,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_VSTPluginFormat.cpp *********/ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #if JUCE_PLUGINHOST_VST #if (defined (_WIN32) || defined (_WIN64)) @@ -93201,7 +92463,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #ifdef DEBUG # include extern int z_verbose; - extern void z_error OF((char *m)); + extern void z_error OF((const char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} @@ -99744,7 +99006,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int z_verbose = verbose; -void z_error (char *m) +void z_error (const char *m) { fprintf(stderr, "%s\n", m); exit(1); @@ -100173,214 +99435,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_FlacAudioFormat.cpp *********/ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #include #endif @@ -107399,214 +106453,6 @@ done1: // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -107759,214 +106605,6 @@ unsigned FLAC__bitmath_silog2_wide(FLAC__int64 v) // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -109464,214 +108102,6 @@ FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *v // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -110812,214 +109242,6 @@ FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw) // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -111429,214 +109651,6 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -111770,214 +109784,6 @@ unsigned FLAC__crc16(const FLAC__byte *data, unsigned len) // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -112551,214 +110357,6 @@ void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -113057,214 +110655,6 @@ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned p // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -113851,353 +111241,145 @@ FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_s // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) +#define VERSION "1.2.1" -/* - This file contains macros that enable/disable various JUCE features. -*/ +#define FLAC__NO_DLL 1 -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce +#ifdef _MSC_VER + #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312) #endif -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 +#if ! (defined (_WIN32) || defined (_WIN64) || defined (LINUX)) + #define FLAC__SYS_DARWIN 1 #endif +/********* End of inlined file: juce_FlacHeader.h *********/ -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. +#if JUCE_USE_FLAC - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 +#if HAVE_CONFIG_H +# include #endif -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. +#include - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif +/********* Start of inlined file: lpc.h *********/ +#ifndef FLAC__PRIVATE__LPC_H +#define FLAC__PRIVATE__LPC_H -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 +#ifdef HAVE_CONFIG_H +#include #endif -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. +#ifndef FLAC__INTEGER_ONLY_LIBRARY - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif +/* + * FLAC__lpc_window_data() + * -------------------------------------------------------------------- + * Applies the given window to the data. + * OPT: asm implementation + * + * IN in[0,data_len-1] + * IN window[0,data_len-1] + * OUT out[0,lag-1] + * IN data_len + */ +void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len); -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 +/* + * FLAC__lpc_compute_autocorrelation() + * -------------------------------------------------------------------- + * Compute the autocorrelation for lags between 0 and lag-1. + * Assumes data[] outside of [0,data_len-1] == 0. + * Asserts that lag > 0. + * + * IN data[0,data_len-1] + * IN data_len + * IN 0 < lag <= data_len + * OUT autoc[0,lag-1] + */ +void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +#ifndef FLAC__NO_ASM +# ifdef FLAC__CPU_IA32 +# ifdef FLAC__HAS_NASM +void FLAC__lpc_compute_autocorrelation_asm_ia32(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); +# endif +# endif #endif -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif +/* + * FLAC__lpc_compute_lp_coefficients() + * -------------------------------------------------------------------- + * Computes LP coefficients for orders 1..max_order. + * Do not call if autoc[0] == 0.0. This means the signal is zero + * and there is no point in calculating a predictor. + * + * IN autoc[0,max_order] autocorrelation values + * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute + * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order + * *** IMPORTANT: + * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched + * OUT error[0,max_order-1] error for each order (more + * specifically, the variance of + * the error signal times # of + * samples in the signal) + * + * Example: if max_order is 9, the LP coefficients for order 9 will be + * in lp_coeff[8][0,8], the LP coefficients for order 8 will be + * in lp_coeff[7][0,7], etc. + */ +void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]); -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif +/* + * FLAC__lpc_quantize_coefficients() + * -------------------------------------------------------------------- + * Quantizes the LP coefficients. NOTE: precision + bits_per_sample + * must be less than 32 (sizeof(FLAC__int32)*8). + * + * IN lp_coeff[0,order-1] LP coefficients + * IN order LP order + * IN FLAC__MIN_QLP_COEFF_PRECISION < precision + * desired precision (in bits, including sign + * bit) of largest coefficient + * OUT qlp_coeff[0,order-1] quantized coefficients + * OUT shift # of bits to shift right to get approximated + * LP coefficients. NOTE: could be negative. + * RETURN 0 => quantization OK + * 1 => coefficients require too much shifting for *shift to + * fit in the LPC subframe header. 'shift' is unset. + * 2 => coefficients are all zero, which is bad. 'shift' is + * unset. + */ +int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 +/* + * FLAC__lpc_compute_residual_from_qlp_coefficients() + * -------------------------------------------------------------------- + * Compute the residual signal obtained from sutracting the predicted + * signal from the original. + * + * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) + * IN data_len length of original signal + * IN qlp_coeff[0,order-1] quantized LP coefficients + * IN order > 0 LP order + * IN lp_quantization quantization of LP coefficients in bits + * OUT residual[0,data_len-1] residual signal + */ +void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); +void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); +#ifndef FLAC__NO_ASM +# ifdef FLAC__CPU_IA32 +# ifdef FLAC__HAS_NASM +void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); +void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); +# endif +# endif #endif -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - -#define VERSION "1.2.1" - -#define FLAC__NO_DLL 1 - -#ifdef _MSC_VER - #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312) -#endif - -#if ! (defined (_WIN32) || defined (_WIN64) || defined (LINUX)) - #define FLAC__SYS_DARWIN 1 -#endif -/********* End of inlined file: juce_FlacHeader.h *********/ - -#if JUCE_USE_FLAC - -#if HAVE_CONFIG_H -# include -#endif - -#include - -/********* Start of inlined file: lpc.h *********/ -#ifndef FLAC__PRIVATE__LPC_H -#define FLAC__PRIVATE__LPC_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -/* - * FLAC__lpc_window_data() - * -------------------------------------------------------------------- - * Applies the given window to the data. - * OPT: asm implementation - * - * IN in[0,data_len-1] - * IN window[0,data_len-1] - * OUT out[0,lag-1] - * IN data_len - */ -void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len); - -/* - * FLAC__lpc_compute_autocorrelation() - * -------------------------------------------------------------------- - * Compute the autocorrelation for lags between 0 and lag-1. - * Assumes data[] outside of [0,data_len-1] == 0. - * Asserts that lag > 0. - * - * IN data[0,data_len-1] - * IN data_len - * IN 0 < lag <= data_len - * OUT autoc[0,lag-1] - */ -void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -void FLAC__lpc_compute_autocorrelation_asm_ia32(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -# endif -# endif -#endif - -/* - * FLAC__lpc_compute_lp_coefficients() - * -------------------------------------------------------------------- - * Computes LP coefficients for orders 1..max_order. - * Do not call if autoc[0] == 0.0. This means the signal is zero - * and there is no point in calculating a predictor. - * - * IN autoc[0,max_order] autocorrelation values - * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute - * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order - * *** IMPORTANT: - * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched - * OUT error[0,max_order-1] error for each order (more - * specifically, the variance of - * the error signal times # of - * samples in the signal) - * - * Example: if max_order is 9, the LP coefficients for order 9 will be - * in lp_coeff[8][0,8], the LP coefficients for order 8 will be - * in lp_coeff[7][0,7], etc. - */ -void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]); - -/* - * FLAC__lpc_quantize_coefficients() - * -------------------------------------------------------------------- - * Quantizes the LP coefficients. NOTE: precision + bits_per_sample - * must be less than 32 (sizeof(FLAC__int32)*8). - * - * IN lp_coeff[0,order-1] LP coefficients - * IN order LP order - * IN FLAC__MIN_QLP_COEFF_PRECISION < precision - * desired precision (in bits, including sign - * bit) of largest coefficient - * OUT qlp_coeff[0,order-1] quantized coefficients - * OUT shift # of bits to shift right to get approximated - * LP coefficients. NOTE: could be negative. - * RETURN 0 => quantization OK - * 1 => coefficients require too much shifting for *shift to - * fit in the LPC subframe header. 'shift' is unset. - * 2 => coefficients are all zero, which is bad. 'shift' is - * unset. - */ -int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift); - -/* - * FLAC__lpc_compute_residual_from_qlp_coefficients() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. - * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * OUT residual[0,data_len-1] residual signal - */ -void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -# endif -# endif -#endif - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ +#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ /* * FLAC__lpc_restore_signal() @@ -115609,214 +112791,6 @@ unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned m // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -116308,214 +113282,6 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -116752,214 +113518,6 @@ FLAC__bool FLAC__memory_alloc_aligned_real_array(unsigned elements, FLAC__real * // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -120355,214 +116913,6 @@ FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_d // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -125032,214 +121382,6 @@ FILE *get_binary_stdout_(void) // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -125784,214 +121926,6 @@ FLAC__bool add_residual_partitioned_rice_(FLAC__BitWriter *bw, const FLAC__int32 // This file is included at the start of each FLAC .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #define VERSION "1.2.1" #define FLAC__NO_DLL 1 @@ -126680,214 +122614,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_OggVorbisAudioFormat.cpp *********/ -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #if JUCE_USE_OGGVORBIS #if JUCE_MAC @@ -127371,7 +123097,7 @@ extern int vorbis_info_blocksize(vorbis_info *vi,int zo); extern void vorbis_comment_init(vorbis_comment *vc); extern void vorbis_comment_add(vorbis_comment *vc, char *comment); extern void vorbis_comment_add_tag(vorbis_comment *vc, - char *tag, char *contents); + const char *tag, char *contents); extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); extern void vorbis_comment_clear(vorbis_comment *vc); @@ -127658,214 +123384,6 @@ extern int ov_halfrate_p(OggVorbis_File *vf); // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -128645,214 +124163,6 @@ int main(void){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -130634,214 +125944,6 @@ int main(void){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -131945,7 +127047,7 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){ } /* there was no great place to put this.... */ -void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ +void _analysis_output_always(const char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ int j; FILE *of; char buffer[80]; @@ -131995,214 +127097,6 @@ void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -132448,214 +127342,6 @@ int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,ogg_packet *op){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -133642,214 +128328,6 @@ float *vorbis_window(vorbis_dsp_state *v,int W){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -134451,214 +128929,6 @@ int main(){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -135025,214 +129295,6 @@ void _ve_envelope_shift(envelope_lookup *e,long shift){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -135454,214 +129516,6 @@ vorbis_func_floor floor0_exportbundle={ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -136719,214 +130573,6 @@ vorbis_func_floor floor1_exportbundle={ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -136941,7 +130587,7 @@ vorbis_func_floor floor1_exportbundle={ #include #include -static void _v_writestring(oggpack_buffer *o,char *s, int bytes){ +static void _v_writestring(oggpack_buffer *o, const char *s, int bytes){ while(bytes--){ oggpack_write(o,*s++,8); @@ -136970,7 +130616,7 @@ void vorbis_comment_add(vorbis_comment *vc,char *comment){ vc->user_comments[vc->comments]=NULL; } -void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents){ +void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, char *contents){ char *comment=(char*)alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */ strcpy(comment, tag); strcat(comment, "="); @@ -137541,214 +131187,6 @@ Carsten Bormann // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -137869,214 +131307,6 @@ void vorbis_lpc_predict(float *coeff,float *prime,int m, // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -138128,214 +131358,6 @@ extern float vorbis_fromdBlook_i(long a); // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -138679,349 +131701,141 @@ void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m, // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce +#ifdef _MSC_VER + #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif +/********* End of inlined file: juce_OggVorbisHeader.h *********/ -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif +#if JUCE_USE_OGGVORBIS -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. +#include - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. +/********* Start of inlined file: lookup.h *********/ +#ifndef _V_LOOKUP_H_ - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 +#ifdef FLOAT_LOOKUP +extern float vorbis_coslook(float a); +extern float vorbis_invsqlook(float a); +extern float vorbis_invsq2explook(int a); +extern float vorbis_fromdBlook(float a); #endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 +#ifdef INT_LOOKUP +extern long vorbis_invsqlook_i(long a,long e); +extern long vorbis_coslook_i(long a); +extern float vorbis_fromdBlook_i(long a); #endif -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 #endif +/********* End of inlined file: lookup.h *********/ -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. +/********* Start of inlined file: lookup_data.h *********/ +#ifndef _V_LOOKUP_DATA_H_ - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif +#ifdef FLOAT_LOOKUP +#define COS_LOOKUP_SZ 128 +static float COS_LOOKUP[COS_LOOKUP_SZ+1]={ + +1.0000000000000f,+0.9996988186962f,+0.9987954562052f,+0.9972904566787f, + +0.9951847266722f,+0.9924795345987f,+0.9891765099648f,+0.9852776423889f, + +0.9807852804032f,+0.9757021300385f,+0.9700312531945f,+0.9637760657954f, + +0.9569403357322f,+0.9495281805930f,+0.9415440651830f,+0.9329927988347f, + +0.9238795325113f,+0.9142097557035f,+0.9039892931234f,+0.8932243011955f, + +0.8819212643484f,+0.8700869911087f,+0.8577286100003f,+0.8448535652497f, + +0.8314696123025f,+0.8175848131516f,+0.8032075314806f,+0.7883464276266f, + +0.7730104533627f,+0.7572088465065f,+0.7409511253550f,+0.7242470829515f, + +0.7071067811865f,+0.6895405447371f,+0.6715589548470f,+0.6531728429538f, + +0.6343932841636f,+0.6152315905806f,+0.5956993044924f,+0.5758081914178f, + +0.5555702330196f,+0.5349976198871f,+0.5141027441932f,+0.4928981922298f, + +0.4713967368260f,+0.4496113296546f,+0.4275550934303f,+0.4052413140050f, + +0.3826834323651f,+0.3598950365350f,+0.3368898533922f,+0.3136817403989f, + +0.2902846772545f,+0.2667127574749f,+0.2429801799033f,+0.2191012401569f, + +0.1950903220161f,+0.1709618887603f,+0.1467304744554f,+0.1224106751992f, + +0.0980171403296f,+0.0735645635997f,+0.0490676743274f,+0.0245412285229f, + +0.0000000000000f,-0.0245412285229f,-0.0490676743274f,-0.0735645635997f, + -0.0980171403296f,-0.1224106751992f,-0.1467304744554f,-0.1709618887603f, + -0.1950903220161f,-0.2191012401569f,-0.2429801799033f,-0.2667127574749f, + -0.2902846772545f,-0.3136817403989f,-0.3368898533922f,-0.3598950365350f, + -0.3826834323651f,-0.4052413140050f,-0.4275550934303f,-0.4496113296546f, + -0.4713967368260f,-0.4928981922298f,-0.5141027441932f,-0.5349976198871f, + -0.5555702330196f,-0.5758081914178f,-0.5956993044924f,-0.6152315905806f, + -0.6343932841636f,-0.6531728429538f,-0.6715589548470f,-0.6895405447371f, + -0.7071067811865f,-0.7242470829515f,-0.7409511253550f,-0.7572088465065f, + -0.7730104533627f,-0.7883464276266f,-0.8032075314806f,-0.8175848131516f, + -0.8314696123025f,-0.8448535652497f,-0.8577286100003f,-0.8700869911087f, + -0.8819212643484f,-0.8932243011955f,-0.9039892931234f,-0.9142097557035f, + -0.9238795325113f,-0.9329927988347f,-0.9415440651830f,-0.9495281805930f, + -0.9569403357322f,-0.9637760657954f,-0.9700312531945f,-0.9757021300385f, + -0.9807852804032f,-0.9852776423889f,-0.9891765099648f,-0.9924795345987f, + -0.9951847266722f,-0.9972904566787f,-0.9987954562052f,-0.9996988186962f, + -1.0000000000000f, +}; -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif +#define INVSQ_LOOKUP_SZ 32 +static float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={ + 1.414213562373f,1.392621247646f,1.371988681140f,1.352246807566f, + 1.333333333333f,1.315191898443f,1.297771369046f,1.281025230441f, + 1.264911064067f,1.249390095109f,1.234426799697f,1.219988562661f, + 1.206045378311f,1.192569588000f,1.179535649239f,1.166919931983f, + 1.154700538379f,1.142857142857f,1.131370849898f,1.120224067222f, + 1.109400392450f,1.098884511590f,1.088662107904f,1.078719779941f, + 1.069044967650f,1.059625885652f,1.050451462878f,1.041511287847f, + 1.032795558989f,1.024295039463f,1.016001016002f,1.007905261358f, + 1.000000000000f, +}; -/** These flags enable the Ogg-Vorbis and Flac audio formats. +#define INVSQ2EXP_LOOKUP_MIN (-32) +#define INVSQ2EXP_LOOKUP_MAX 32 +static float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\ + INVSQ2EXP_LOOKUP_MIN+1]={ + 65536.f, 46340.95001f, 32768.f, 23170.47501f, + 16384.f, 11585.2375f, 8192.f, 5792.618751f, + 4096.f, 2896.309376f, 2048.f, 1448.154688f, + 1024.f, 724.0773439f, 512.f, 362.038672f, + 256.f, 181.019336f, 128.f, 90.50966799f, + 64.f, 45.254834f, 32.f, 22.627417f, + 16.f, 11.3137085f, 8.f, 5.656854249f, + 4.f, 2.828427125f, 2.f, 1.414213562f, + 1.f, 0.7071067812f, 0.5f, 0.3535533906f, + 0.25f, 0.1767766953f, 0.125f, 0.08838834765f, + 0.0625f, 0.04419417382f, 0.03125f, 0.02209708691f, + 0.015625f, 0.01104854346f, 0.0078125f, 0.005524271728f, + 0.00390625f, 0.002762135864f, 0.001953125f, 0.001381067932f, + 0.0009765625f, 0.000690533966f, 0.00048828125f, 0.000345266983f, + 0.000244140625f,0.0001726334915f,0.0001220703125f,8.631674575e-05f, + 6.103515625e-05f,4.315837288e-05f,3.051757812e-05f,2.157918644e-05f, + 1.525878906e-05f, +}; - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 #endif -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif +#define FROMdB_LOOKUP_SZ 35 +#define FROMdB2_LOOKUP_SZ 32 +#define FROMdB_SHIFT 5 +#define FROMdB2_SHIFT 3 +#define FROMdB2_MASK 31 +static float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={ + 1.f, 0.6309573445f, 0.3981071706f, 0.2511886432f, + 0.1584893192f, 0.1f, 0.06309573445f, 0.03981071706f, + 0.02511886432f, 0.01584893192f, 0.01f, 0.006309573445f, + 0.003981071706f, 0.002511886432f, 0.001584893192f, 0.001f, + 0.0006309573445f,0.0003981071706f,0.0002511886432f,0.0001584893192f, + 0.0001f,6.309573445e-05f,3.981071706e-05f,2.511886432e-05f, + 1.584893192e-05f, 1e-05f,6.309573445e-06f,3.981071706e-06f, + 2.511886432e-06f,1.584893192e-06f, 1e-06f,6.309573445e-07f, + 3.981071706e-07f,2.511886432e-07f,1.584893192e-07f, +}; -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif +static float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={ + 0.9928302478f, 0.9786445908f, 0.9646616199f, 0.9508784391f, + 0.9372921937f, 0.92390007f, 0.9106992942f, 0.8976871324f, + 0.8848608897f, 0.8722179097f, 0.8597555737f, 0.8474713009f, + 0.835362547f, 0.8234268041f, 0.8116616003f, 0.8000644989f, + 0.7886330981f, 0.7773650302f, 0.7662579617f, 0.755309592f, + 0.7445176537f, 0.7338799116f, 0.7233941627f, 0.7130582353f, + 0.7028699885f, 0.6928273125f, 0.6829281272f, 0.6731703824f, + 0.6635520573f, 0.6540711597f, 0.6447257262f, 0.6355138211f, +}; -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - -#ifdef _MSC_VER - #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) -#endif -/********* End of inlined file: juce_OggVorbisHeader.h *********/ - -#if JUCE_USE_OGGVORBIS - -#include - -/********* Start of inlined file: lookup.h *********/ -#ifndef _V_LOOKUP_H_ - -#ifdef FLOAT_LOOKUP -extern float vorbis_coslook(float a); -extern float vorbis_invsqlook(float a); -extern float vorbis_invsq2explook(int a); -extern float vorbis_fromdBlook(float a); -#endif -#ifdef INT_LOOKUP -extern long vorbis_invsqlook_i(long a,long e); -extern long vorbis_coslook_i(long a); -extern float vorbis_fromdBlook_i(long a); -#endif - -#endif -/********* End of inlined file: lookup.h *********/ - -/********* Start of inlined file: lookup_data.h *********/ -#ifndef _V_LOOKUP_DATA_H_ - -#ifdef FLOAT_LOOKUP -#define COS_LOOKUP_SZ 128 -static float COS_LOOKUP[COS_LOOKUP_SZ+1]={ - +1.0000000000000f,+0.9996988186962f,+0.9987954562052f,+0.9972904566787f, - +0.9951847266722f,+0.9924795345987f,+0.9891765099648f,+0.9852776423889f, - +0.9807852804032f,+0.9757021300385f,+0.9700312531945f,+0.9637760657954f, - +0.9569403357322f,+0.9495281805930f,+0.9415440651830f,+0.9329927988347f, - +0.9238795325113f,+0.9142097557035f,+0.9039892931234f,+0.8932243011955f, - +0.8819212643484f,+0.8700869911087f,+0.8577286100003f,+0.8448535652497f, - +0.8314696123025f,+0.8175848131516f,+0.8032075314806f,+0.7883464276266f, - +0.7730104533627f,+0.7572088465065f,+0.7409511253550f,+0.7242470829515f, - +0.7071067811865f,+0.6895405447371f,+0.6715589548470f,+0.6531728429538f, - +0.6343932841636f,+0.6152315905806f,+0.5956993044924f,+0.5758081914178f, - +0.5555702330196f,+0.5349976198871f,+0.5141027441932f,+0.4928981922298f, - +0.4713967368260f,+0.4496113296546f,+0.4275550934303f,+0.4052413140050f, - +0.3826834323651f,+0.3598950365350f,+0.3368898533922f,+0.3136817403989f, - +0.2902846772545f,+0.2667127574749f,+0.2429801799033f,+0.2191012401569f, - +0.1950903220161f,+0.1709618887603f,+0.1467304744554f,+0.1224106751992f, - +0.0980171403296f,+0.0735645635997f,+0.0490676743274f,+0.0245412285229f, - +0.0000000000000f,-0.0245412285229f,-0.0490676743274f,-0.0735645635997f, - -0.0980171403296f,-0.1224106751992f,-0.1467304744554f,-0.1709618887603f, - -0.1950903220161f,-0.2191012401569f,-0.2429801799033f,-0.2667127574749f, - -0.2902846772545f,-0.3136817403989f,-0.3368898533922f,-0.3598950365350f, - -0.3826834323651f,-0.4052413140050f,-0.4275550934303f,-0.4496113296546f, - -0.4713967368260f,-0.4928981922298f,-0.5141027441932f,-0.5349976198871f, - -0.5555702330196f,-0.5758081914178f,-0.5956993044924f,-0.6152315905806f, - -0.6343932841636f,-0.6531728429538f,-0.6715589548470f,-0.6895405447371f, - -0.7071067811865f,-0.7242470829515f,-0.7409511253550f,-0.7572088465065f, - -0.7730104533627f,-0.7883464276266f,-0.8032075314806f,-0.8175848131516f, - -0.8314696123025f,-0.8448535652497f,-0.8577286100003f,-0.8700869911087f, - -0.8819212643484f,-0.8932243011955f,-0.9039892931234f,-0.9142097557035f, - -0.9238795325113f,-0.9329927988347f,-0.9415440651830f,-0.9495281805930f, - -0.9569403357322f,-0.9637760657954f,-0.9700312531945f,-0.9757021300385f, - -0.9807852804032f,-0.9852776423889f,-0.9891765099648f,-0.9924795345987f, - -0.9951847266722f,-0.9972904566787f,-0.9987954562052f,-0.9996988186962f, - -1.0000000000000f, -}; - -#define INVSQ_LOOKUP_SZ 32 -static float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={ - 1.414213562373f,1.392621247646f,1.371988681140f,1.352246807566f, - 1.333333333333f,1.315191898443f,1.297771369046f,1.281025230441f, - 1.264911064067f,1.249390095109f,1.234426799697f,1.219988562661f, - 1.206045378311f,1.192569588000f,1.179535649239f,1.166919931983f, - 1.154700538379f,1.142857142857f,1.131370849898f,1.120224067222f, - 1.109400392450f,1.098884511590f,1.088662107904f,1.078719779941f, - 1.069044967650f,1.059625885652f,1.050451462878f,1.041511287847f, - 1.032795558989f,1.024295039463f,1.016001016002f,1.007905261358f, - 1.000000000000f, -}; - -#define INVSQ2EXP_LOOKUP_MIN (-32) -#define INVSQ2EXP_LOOKUP_MAX 32 -static float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\ - INVSQ2EXP_LOOKUP_MIN+1]={ - 65536.f, 46340.95001f, 32768.f, 23170.47501f, - 16384.f, 11585.2375f, 8192.f, 5792.618751f, - 4096.f, 2896.309376f, 2048.f, 1448.154688f, - 1024.f, 724.0773439f, 512.f, 362.038672f, - 256.f, 181.019336f, 128.f, 90.50966799f, - 64.f, 45.254834f, 32.f, 22.627417f, - 16.f, 11.3137085f, 8.f, 5.656854249f, - 4.f, 2.828427125f, 2.f, 1.414213562f, - 1.f, 0.7071067812f, 0.5f, 0.3535533906f, - 0.25f, 0.1767766953f, 0.125f, 0.08838834765f, - 0.0625f, 0.04419417382f, 0.03125f, 0.02209708691f, - 0.015625f, 0.01104854346f, 0.0078125f, 0.005524271728f, - 0.00390625f, 0.002762135864f, 0.001953125f, 0.001381067932f, - 0.0009765625f, 0.000690533966f, 0.00048828125f, 0.000345266983f, - 0.000244140625f,0.0001726334915f,0.0001220703125f,8.631674575e-05f, - 6.103515625e-05f,4.315837288e-05f,3.051757812e-05f,2.157918644e-05f, - 1.525878906e-05f, -}; - -#endif - -#define FROMdB_LOOKUP_SZ 35 -#define FROMdB2_LOOKUP_SZ 32 -#define FROMdB_SHIFT 5 -#define FROMdB2_SHIFT 3 -#define FROMdB2_MASK 31 -static float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={ - 1.f, 0.6309573445f, 0.3981071706f, 0.2511886432f, - 0.1584893192f, 0.1f, 0.06309573445f, 0.03981071706f, - 0.02511886432f, 0.01584893192f, 0.01f, 0.006309573445f, - 0.003981071706f, 0.002511886432f, 0.001584893192f, 0.001f, - 0.0006309573445f,0.0003981071706f,0.0002511886432f,0.0001584893192f, - 0.0001f,6.309573445e-05f,3.981071706e-05f,2.511886432e-05f, - 1.584893192e-05f, 1e-05f,6.309573445e-06f,3.981071706e-06f, - 2.511886432e-06f,1.584893192e-06f, 1e-06f,6.309573445e-07f, - 3.981071706e-07f,2.511886432e-07f,1.584893192e-07f, -}; - -static float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={ - 0.9928302478f, 0.9786445908f, 0.9646616199f, 0.9508784391f, - 0.9372921937f, 0.92390007f, 0.9106992942f, 0.8976871324f, - 0.8848608897f, 0.8722179097f, 0.8597555737f, 0.8474713009f, - 0.835362547f, 0.8234268041f, 0.8116616003f, 0.8000644989f, - 0.7886330981f, 0.7773650302f, 0.7662579617f, 0.755309592f, - 0.7445176537f, 0.7338799116f, 0.7233941627f, 0.7130582353f, - 0.7028699885f, 0.6928273125f, 0.6829281272f, 0.6731703824f, - 0.6635520573f, 0.6540711597f, 0.6447257262f, 0.6355138211f, -}; - -#ifdef INT_LOOKUP +#ifdef INT_LOOKUP #define INVSQ_LOOKUP_I_SHIFT 10 #define INVSQ_LOOKUP_I_MASK 1023 @@ -139509,214 +132323,6 @@ int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -140545,214 +133151,6 @@ vorbis_func_mapping mapping0_exportbundle={ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -141289,214 +133687,6 @@ void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -143475,214 +135665,6 @@ void hf_reduction(vorbis_info_psy_global *g, // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -143728,214 +135710,6 @@ vorbis_func_mapping *_mapping_P[]={ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -144816,214 +136590,6 @@ vorbis_func_residue residue2_exportbundle={ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -145755,214 +137321,6 @@ int main(){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -147201,214 +138559,6 @@ void drft_clear(drft_lookup *l){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -147571,214 +138721,6 @@ int vorbis_synthesis_halfrate_p(vorbis_info *vi){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -186132,214 +177074,6 @@ int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -188024,7 +178758,7 @@ long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int length, } extern float *vorbis_window(vorbis_dsp_state *v,int W); -extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, +extern void _analysis_output_always(const char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off); static void _ov_splice(float **pcm,float **lappcm, @@ -188313,214 +179047,6 @@ int ov_time_seek_page_lap(OggVorbis_File *vf,double pos){ // This file is included at the start of each Ogg-Vorbis .c file, just to do a few housekeeping // tasks.. -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif - -#endif -/********* End of inlined file: juce_Config.h *********/ - #ifdef _MSC_VER #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706) #endif @@ -255934,262 +246460,27 @@ END_JUCE_NAMESPACE //============================================================================== #if JUCE_LINUX -/********* Start of inlined file: juce_linux_Files.cpp *********/ - -/********* Start of inlined file: linuxincludes.h *********/ -#ifndef __LINUXINCLUDES_JUCEHEADER__ -#define __LINUXINCLUDES_JUCEHEADER__ - -// Linux Header Files: -#include -#include -#include -#include -#include -#include - -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - +/********* Start of inlined file: juce_linux_NativeCode.cpp *********/ /* - This file contains macros that enable/disable various JUCE features. -*/ - -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif - -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif - -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. - - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif - -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. - - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif - -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif - -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. - - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. - - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif - -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif - -/** These flags enable the Ogg-Vorbis and Flac audio formats. - - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif - -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 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. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif - -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif - -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif - -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif - -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif - -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif - -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif - -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif - -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif - -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif - -/** Enable this to add extra memory-leak info to the new and delete operators. - - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif - -/** Enable this to turn on juce's internal catching of exceptions. - - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif - -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. + This file wraps together all the mac-specific code, so that + we can include all the native headers just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the way of + the rest of the codebase. */ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif -#endif -/********* End of inlined file: juce_Config.h *********/ +BEGIN_JUCE_NAMESPACE /* Remove this macro if you're having problems compiling the cpu affinity calls (the API for these has changed about quite a bit in various Linux versions, and a lot of distros seem to ship with obsolete versions) */ -#ifndef SUPPORT_AFFINITIES +#if defined (CPU_ISSET) && ! defined (SUPPORT_AFFINITIES) #define SUPPORT_AFFINITIES 1 #endif -#endif // __LINUXINCLUDES_JUCEHEADER__ -/********* End of inlined file: linuxincludes.h *********/ - -#include -#include -#include -#include // for statfs -#include -#include -#include -#include -#include -#include -#include - -#define U_ISOFS_SUPER_MAGIC (short) 0x9660 // linux/iso_fs.h -#define U_MSDOS_SUPER_MAGIC (short) 0x4d44 // linux/msdos_fs.h -#define U_NFS_SUPER_MAGIC (short) 0x6969 // linux/nfs_fs.h -#define U_SMB_SUPER_MAGIC (short) 0x517B // linux/smb_fs.h - -BEGIN_JUCE_NAMESPACE +#define JUCE_INCLUDED_FILE 1 -/* - Note that a lot of methods that you'd expect to find in this file actually - live in juce_posix_SharedCode.h! -*/ +// Now include the actual code files.. /********* Start of inlined file: juce_posix_SharedCode.h *********/ /* @@ -256557,7 +246848,8 @@ const String juce_getVolumeLabel (const String& filenameOnVolume, void juce_runSystemCommand (const String& command) { - system ((const char*) command.toUTF8()); + int result = system ((const char*) command.toUTF8()); + (void) result; } const String juce_getOutputFromCommand (const String& command) @@ -256664,6 +246956,16 @@ void InterProcessLock::exit() throw() } /********* End of inlined file: juce_posix_SharedCode.h *********/ +/********* Start of inlined file: juce_linux_Files.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +#define U_ISOFS_SUPER_MAGIC (short) 0x9660 // linux/iso_fs.h +#define U_MSDOS_SUPER_MAGIC (short) 0x4d44 // linux/msdos_fs.h +#define U_NFS_SUPER_MAGIC (short) 0x6969 // linux/nfs_fs.h +#define U_SMB_SUPER_MAGIC (short) 0x517B // linux/smb_fs.h + void juce_getFileTimes (const String& fileName, int64& modificationTime, int64& accessTime, @@ -257064,26 +247366,13 @@ bool juce_launchFile (const String& fileName, return cpid >= 0; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_linux_Files.cpp *********/ -/********* Start of inlined file: juce_linux_NamedPipe.cpp *********/ - /********* Start of inlined file: juce_mac_NamedPipe.cpp *********/ - -#include -#include -#include - -// As well as being for the mac, this file is included by the linux build. - -#if ! JUCE_MAC - #include - #include - #include -#endif - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE struct NamedPipeInternal { @@ -257267,23 +247556,13 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut return bytesWritten; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_mac_NamedPipe.cpp *********/ -/********* End of inlined file: juce_linux_NamedPipe.cpp *********/ - /********* Start of inlined file: juce_linux_Network.cpp *********/ - -#include -#include -#include -#include -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() { @@ -257724,19 +248003,13 @@ int juce_seekInInternetFile (void* handle, int newPosition) return 0; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_linux_Network.cpp *********/ /********* Start of inlined file: juce_linux_SystemStats.cpp *********/ - -#include -#include - -#ifndef CPU_ISSET - #undef SUPPORT_AFFINITIES -#endif - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE /*static juce_noinline unsigned int getCPUIDWord (int* familyModel, int* extFeatures) throw() { @@ -257960,27 +248233,19 @@ void PlatformUtilities::fpuReset() { } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_linux_SystemStats.cpp *********/ /********* Start of inlined file: juce_linux_Threads.cpp *********/ - -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE /* Note that a lot of methods that you'd expect to find in this file actually live in juce_posix_SharedCode.h! */ -#ifndef CPU_ISSET - #undef SUPPORT_AFFINITIES -#endif - void JUCE_API juce_threadEntryPoint (void*); void* threadEntryProc (void* value) throw() @@ -258198,7122 +248463,5814 @@ void* PlatformUtilities::getProcedureEntryPoint (void* libraryHandle, const Stri #endif -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_linux_Threads.cpp *********/ #if ! JUCE_ONLY_BUILD_CORE_LIBRARY -/********* Start of inlined file: juce_linux_Audio.cpp *********/ - -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) - -/* - This file contains macros that enable/disable various JUCE features. -*/ +/********* Start of inlined file: juce_linux_Messaging.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce +#ifdef JUCE_DEBUG + #define JUCE_DEBUG_XERRORS 1 #endif -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif +Display* display = 0; // This is also referenced from WindowDriver.cpp +static Window juce_messageWindowHandle = None; -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. +#define SpecialAtom "JUCESpecialAtom" +#define BroadcastAtom "JUCEBroadcastAtom" +#define SpecialCallbackAtom "JUCESpecialCallbackAtom" - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. +static Atom specialId; +static Atom broadcastId; +static Atom specialCallbackId; - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif +// This is referenced from WindowDriver.cpp +XContext improbableNumber; -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. +// Defined in WindowDriver.cpp +extern void juce_windowMessageReceive (XEvent* event); - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif +struct MessageThreadFuncCall +{ + MessageCallbackFunction* func; + void* parameter; + void* result; + CriticalSection lock; + WaitableEvent event; +}; -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif +static bool errorCondition = false; +static XErrorHandler oldErrorHandler = (XErrorHandler) 0; +static XIOErrorHandler oldIOErrorHandler = (XIOErrorHandler) 0; -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. +// (defined in another file to avoid problems including certain headers in this one) +extern bool juce_isRunningAsApplication(); - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. +// Usually happens when client-server connection is broken +static int ioErrorHandler (Display* display) +{ + DBG (T("ERROR: connection to X server broken.. terminating.")); - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif + errorCondition = true; -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + if (juce_isRunningAsApplication()) + Process::terminate(); -/** These flags enable the Ogg-Vorbis and Flac audio formats. + return 0; +} - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif +// A protocol error has occurred +static int errorHandler (Display* display, XErrorEvent* event) +{ +#ifdef JUCE_DEBUG_XERRORS + char errorStr[64] = { 0 }; + char requestStr[64] = { 0 }; -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + XGetErrorText (display, event->error_code, errorStr, 64); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + XGetErrorDatabaseText (display, + "XRequest", + (const char*) String (event->request_code), + "Unknown", + requestStr, + 64); -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 + DBG (T("ERROR: X returned ") + String (errorStr) + T(" for operation ") + String (requestStr)); #endif -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. + return 0; +} - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif +static bool breakIn = false; -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif +// Breakin from keyboard +static void sig_handler (int sig) +{ + if (sig == SIGINT) + { + breakIn = true; + return; + } -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif + static bool reentrant = false; -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif + if (reentrant == false) + { + reentrant = true; -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif + // Illegal instruction + fflush (stdout); + Logger::outputDebugString ("ERROR: Program executed illegal instruction.. terminating"); -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif + errorCondition = true; -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif + if (juce_isRunningAsApplication()) + Process::terminate(); + } + else + { + if (juce_isRunningAsApplication()) + exit(0); + } +} -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif +void MessageManager::doPlatformSpecificInitialisation() +{ + // Initialise xlib for multiple thread support + static bool initThreadCalled = false; -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif + if (! initThreadCalled) + { + if (! XInitThreads()) + { + // This is fatal! Print error and closedown + Logger::outputDebugString ("Failed to initialise xlib thread support."); -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif + if (juce_isRunningAsApplication()) + Process::terminate(); -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + return; + } -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + initThreadCalled = true; + } -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + // This is called if the client/server connection is broken + oldIOErrorHandler = XSetIOErrorHandler (ioErrorHandler); -/** Enable this to add extra memory-leak info to the new and delete operators. + // This is called if a protocol error occurs + oldErrorHandler = XSetErrorHandler (errorHandler); - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 + // Install signal handler for break-in + struct sigaction saction; + sigset_t maskSet; + sigemptyset (&maskSet); + saction.sa_handler = sig_handler; + saction.sa_mask = maskSet; + saction.sa_flags = 0; + sigaction (SIGINT, &saction, NULL); + +#ifndef _DEBUG + // Setup signal handlers for various fatal errors + sigaction (SIGILL, &saction, NULL); + sigaction (SIGBUS, &saction, NULL); + sigaction (SIGFPE, &saction, NULL); + sigaction (SIGSEGV, &saction, NULL); + sigaction (SIGSYS, &saction, NULL); #endif -/** Enable this to turn on juce's internal catching of exceptions. + String displayName (getenv ("DISPLAY")); + if (displayName.isEmpty()) + displayName = T(":0.0"); - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + display = XOpenDisplay (displayName); -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + if (display == 0) + { + // This is fatal! Print error and closedown + Logger::outputDebugString ("Failed to open the X display."); -#endif -/********* End of inlined file: juce_Config.h *********/ + if (juce_isRunningAsApplication()) + Process::terminate(); -#if JUCE_ALSA + return; + } -/* Got an include error here? If so, you've either not got ALSA installed, or you've - not got your paths set up correctly to find its header files. + // Get defaults for various properties + int screen = DefaultScreen (display); + Window root = RootWindow (display, screen); + Visual* visual = DefaultVisual (display, screen); - The package you need to install to get ASLA support is "libasound2-dev". + // Create atoms for our ClientMessages (these cannot be deleted) + specialId = XInternAtom (display, SpecialAtom, false); + broadcastId = XInternAtom (display, BroadcastAtom, false); + specialCallbackId = XInternAtom (display, SpecialCallbackAtom, false); - If you don't have the ALSA library and don't want to build Juce with audio support, - just disable the JUCE_ALSA flag in juce_Config.h -*/ -#include + // Create a context to store user data associated with Windows we + // create in WindowDriver + improbableNumber = XUniqueContext(); -BEGIN_JUCE_NAMESPACE + // We're only interested in client messages for this window + // which are always sent + XSetWindowAttributes swa; + swa.event_mask = NoEventMask; -static const int maxNumChans = 64; + // Create our message window (this will never be mapped) + juce_messageWindowHandle = XCreateWindow (display, root, + 0, 0, 1, 1, 0, 0, InputOnly, + visual, CWEventMask, &swa); +} -static void getDeviceSampleRates (snd_pcm_t* handle, Array & rates) +void MessageManager::doPlatformSpecificShutdown() { - const int ratesToTry[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 0 }; + if (errorCondition == false) + { + XDestroyWindow (display, juce_messageWindowHandle); + XCloseDisplay (display); - snd_pcm_hw_params_t* hwParams; - snd_pcm_hw_params_alloca (&hwParams); + // reset pointers + juce_messageWindowHandle = 0; + display = 0; - for (int i = 0; ratesToTry[i] != 0; ++i) - { - if (snd_pcm_hw_params_any (handle, hwParams) >= 0 - && snd_pcm_hw_params_test_rate (handle, hwParams, ratesToTry[i], 0) == 0) - { - rates.addIfNotAlreadyThere (ratesToTry[i]); - } + // Restore original error handlers + XSetIOErrorHandler (oldIOErrorHandler); + oldIOErrorHandler = 0; + XSetErrorHandler (oldErrorHandler); + oldErrorHandler = 0; } } -static void getDeviceNumChannels (snd_pcm_t* handle, unsigned int* minChans, unsigned int* maxChans) +bool juce_postMessageToSystemQueue (void* message) { - snd_pcm_hw_params_t *params; - snd_pcm_hw_params_alloca (¶ms); + if (errorCondition) + return false; - if (snd_pcm_hw_params_any (handle, params) >= 0) - { - snd_pcm_hw_params_get_channels_min (params, minChans); - snd_pcm_hw_params_get_channels_max (params, maxChans); - } + XClientMessageEvent clientMsg; + clientMsg.display = display; + clientMsg.window = juce_messageWindowHandle; + clientMsg.type = ClientMessage; + clientMsg.format = 32; + clientMsg.message_type = specialId; +#if JUCE_64BIT + clientMsg.data.l[0] = (long) (0x00000000ffffffff & (((uint64) message) >> 32)); + clientMsg.data.l[1] = (long) (0x00000000ffffffff & (long) message); +#else + clientMsg.data.l[0] = (long) message; +#endif + + XSendEvent (display, juce_messageWindowHandle, false, + NoEventMask, (XEvent*) &clientMsg); + + XFlush (display); // This is necessary to ensure the event is delivered + + return true; } -static void getDeviceProperties (const String& id, - unsigned int& minChansOut, - unsigned int& maxChansOut, - unsigned int& minChansIn, - unsigned int& maxChansIn, - Array & rates) +void MessageManager::broadcastMessage (const String& value) throw() { - if (id.isEmpty()) - return; +} - snd_ctl_t* handle; +void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, + void* parameter) +{ + void* retVal = 0; - if (snd_ctl_open (&handle, id.upToLastOccurrenceOf (T(","), false, false), SND_CTL_NONBLOCK) >= 0) + if (! errorCondition) { - snd_pcm_info_t* info; - snd_pcm_info_alloca (&info); + if (! isThisTheMessageThread()) + { + static MessageThreadFuncCall messageFuncCallContext; - snd_pcm_info_set_stream (info, SND_PCM_STREAM_PLAYBACK); - snd_pcm_info_set_device (info, id.fromLastOccurrenceOf (T(","), false, false).getIntValue()); - snd_pcm_info_set_subdevice (info, 0); + const ScopedLock sl (messageFuncCallContext.lock); - if (snd_ctl_pcm_info (handle, info) >= 0) - { - snd_pcm_t* pcmHandle; - if (snd_pcm_open (&pcmHandle, id, SND_PCM_STREAM_PLAYBACK, SND_PCM_ASYNC | SND_PCM_NONBLOCK ) >= 0) - { - getDeviceNumChannels (pcmHandle, &minChansOut, &maxChansOut); - getDeviceSampleRates (pcmHandle, rates); + XClientMessageEvent clientMsg; + clientMsg.display = display; + clientMsg.window = juce_messageWindowHandle; + clientMsg.type = ClientMessage; + clientMsg.format = 32; + clientMsg.message_type = specialCallbackId; +#if JUCE_64BIT + clientMsg.data.l[0] = (long) (0x00000000ffffffff & (((uint64) &messageFuncCallContext) >> 32)); + clientMsg.data.l[1] = (long) (0x00000000ffffffff & (uint64) &messageFuncCallContext); +#else + clientMsg.data.l[0] = (long) &messageFuncCallContext; +#endif - snd_pcm_close (pcmHandle); - } - } + messageFuncCallContext.func = func; + messageFuncCallContext.parameter = parameter; - snd_pcm_info_set_stream (info, SND_PCM_STREAM_CAPTURE); + if (XSendEvent (display, juce_messageWindowHandle, false, NoEventMask, (XEvent*) &clientMsg) == 0) + return 0; - if (snd_ctl_pcm_info (handle, info) >= 0) - { - snd_pcm_t* pcmHandle; - if (snd_pcm_open (&pcmHandle, id, SND_PCM_STREAM_CAPTURE, SND_PCM_ASYNC | SND_PCM_NONBLOCK ) >= 0) - { - getDeviceNumChannels (pcmHandle, &minChansIn, &maxChansIn); + XFlush (display); // This is necessary to ensure the event is delivered - if (rates.size() == 0) - getDeviceSampleRates (pcmHandle, rates); + // Wait for it to complete before continuing + messageFuncCallContext.event.wait(); - snd_pcm_close (pcmHandle); - } + retVal = messageFuncCallContext.result; + } + else + { + // Just call the function directly + retVal = func (parameter); } - - snd_ctl_close (handle); } + + return retVal; } -class ALSADevice +bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) { -public: - ALSADevice (const String& id, - const bool forInput) - : handle (0), - bitDepth (16), - numChannelsRunning (0), - isInput (forInput), - sampleFormat (AudioDataConverters::int16LE) - { - failed (snd_pcm_open (&handle, id, - forInput ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, - SND_PCM_ASYNC)); - } + if (errorCondition) + return false; - ~ALSADevice() + if (breakIn) { - if (handle != 0) - snd_pcm_close (handle); + errorCondition = true; + + if (juce_isRunningAsApplication()) + Process::terminate(); + + return false; } - bool setParameters (unsigned int sampleRate, int numChannels, int bufferSize) - { - if (handle == 0) - return false; + if (returnIfNoPendingMessages && ! XPending (display)) + return false; - snd_pcm_hw_params_t* hwParams; - snd_pcm_hw_params_alloca (&hwParams); + XEvent evt; + XNextEvent (display, &evt); - if (failed (snd_pcm_hw_params_any (handle, hwParams))) - return false; + if (evt.type == ClientMessage && evt.xany.window == juce_messageWindowHandle) + { + XClientMessageEvent* const clientMsg = (XClientMessageEvent*) &evt; - if (snd_pcm_hw_params_set_access (handle, hwParams, SND_PCM_ACCESS_RW_NONINTERLEAVED) >= 0) - isInterleaved = false; - else if (snd_pcm_hw_params_set_access (handle, hwParams, SND_PCM_ACCESS_RW_INTERLEAVED) >= 0) - isInterleaved = true; - else + if (clientMsg->format != 32) { jassertfalse - return false; + DBG ("Error: juce_dispatchNextMessageOnSystemQueue received malformed client message."); } - - const int formatsToTry[] = { SND_PCM_FORMAT_FLOAT_LE, 32, AudioDataConverters::float32LE, - SND_PCM_FORMAT_FLOAT_BE, 32, AudioDataConverters::float32BE, - SND_PCM_FORMAT_S32_LE, 32, AudioDataConverters::int32LE, - SND_PCM_FORMAT_S32_BE, 32, AudioDataConverters::int32BE, - SND_PCM_FORMAT_S24_3LE, 24, AudioDataConverters::int24LE, - SND_PCM_FORMAT_S24_3BE, 24, AudioDataConverters::int24BE, - SND_PCM_FORMAT_S16_LE, 16, AudioDataConverters::int16LE, - SND_PCM_FORMAT_S16_BE, 16, AudioDataConverters::int16BE }; - bitDepth = 0; - - for (int i = 0; i < numElementsInArray (formatsToTry); i += 3) + else { - if (snd_pcm_hw_params_set_format (handle, hwParams, (_snd_pcm_format) formatsToTry [i]) >= 0) + JUCE_TRY { - bitDepth = formatsToTry [i + 1]; - sampleFormat = (AudioDataConverters::DataFormat) formatsToTry [i + 2]; - break; - } - } +#if JUCE_64BIT + void* const messagePtr + = (void*) ((0xffffffff00000000 & (((uint64) clientMsg->data.l[0]) << 32)) + | (clientMsg->data.l[1] & 0x00000000ffffffff)); +#else + void* const messagePtr = (void*) (clientMsg->data.l[0]); +#endif - if (bitDepth == 0) - { - error = "device doesn't support a compatible PCM format"; - DBG (T("ALSA error: ") + error + T("\n")); - return false; + if (clientMsg->message_type == specialId) + { + MessageManager::getInstance()->deliverMessage (messagePtr); + } + else if (clientMsg->message_type == specialCallbackId) + { + MessageThreadFuncCall* const call = (MessageThreadFuncCall*) messagePtr; + MessageCallbackFunction* func = call->func; + call->result = (*func) (call->parameter); + call->event.signal(); + } + else if (clientMsg->message_type == broadcastId) + { +#if 0 + TCHAR buffer[8192]; + zeromem (buffer, sizeof (buffer)); + + if (GlobalGetAtomName ((ATOM) lParam, buffer, 8192) != 0) + mq->deliverBroadcastMessage (String (buffer)); +#endif + } + else + { + DBG ("Error: juce_dispatchNextMessageOnSystemQueue received unknown client message."); + } + } + JUCE_CATCH_ALL } + } + else if (evt.xany.window != juce_messageWindowHandle) + { + juce_windowMessageReceive (&evt); + } - int dir = 0; - unsigned int periods = 4; - snd_pcm_uframes_t samplesPerPeriod = bufferSize; + return true; +} - if (failed (snd_pcm_hw_params_set_rate_near (handle, hwParams, &sampleRate, 0)) - || failed (snd_pcm_hw_params_set_channels (handle, hwParams, numChannels)) - || failed (snd_pcm_hw_params_set_periods_near (handle, hwParams, &periods, &dir)) - || failed (snd_pcm_hw_params_set_period_size_near (handle, hwParams, &samplesPerPeriod, &dir)) - || failed (snd_pcm_hw_params (handle, hwParams))) - { - return false; - } +#endif +/********* End of inlined file: juce_linux_Messaging.cpp *********/ - snd_pcm_sw_params_t* swParams; - snd_pcm_sw_params_alloca (&swParams); - snd_pcm_uframes_t boundary; +/********* Start of inlined file: juce_linux_Fonts.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - if (failed (snd_pcm_sw_params_current (handle, swParams)) - || failed (snd_pcm_sw_params_get_boundary (swParams, &boundary)) - || failed (snd_pcm_sw_params_set_silence_threshold (handle, swParams, 0)) - || failed (snd_pcm_sw_params_set_silence_size (handle, swParams, boundary)) - || failed (snd_pcm_sw_params_set_start_threshold (handle, swParams, samplesPerPeriod)) - || failed (snd_pcm_sw_params_set_stop_threshold (handle, swParams, boundary)) - || failed (snd_pcm_sw_params (handle, swParams))) - { - return false; - } +class FreeTypeFontFace +{ +public: - /* -#ifdef JUCE_DEBUG - // enable this to dump the config of the devices that get opened - snd_output_t* out; - snd_output_stdio_attach (&out, stderr, 0); - snd_pcm_hw_params_dump (hwParams, out); - snd_pcm_sw_params_dump (swParams, out); -#endif - */ + enum FontStyle + { + Plain = 0, + Bold = 1, + Italic = 2 + }; - numChannelsRunning = numChannels; + struct FontNameIndex + { + String fileName; + int faceIndex; + }; - return true; + FreeTypeFontFace (const String& familyName) + : hasSerif (false), + monospaced (false) + { + family = familyName; } - bool write (float** const data, const int numSamples) + void setFileName (const String& name, + const int faceIndex, + FontStyle style) { - if (isInterleaved) + if (names[(int) style].fileName.isEmpty()) { - scratch.ensureSize (sizeof (float) * numSamples * numChannelsRunning, false); - float* interleaved = (float*) scratch; + names[(int) style].fileName = name; + names[(int) style].faceIndex = faceIndex; + } + } - AudioDataConverters::interleaveSamples ((const float**) data, interleaved, numSamples, numChannelsRunning); - AudioDataConverters::convertFloatToFormat (sampleFormat, interleaved, interleaved, numSamples * numChannelsRunning); + const String& getFamilyName() const throw() + { + return family; + } - snd_pcm_sframes_t num = snd_pcm_writei (handle, (void*) interleaved, numSamples); + const String& getFileName (int style, int* faceIndex) const throw() + { + *faceIndex = names [style].faceIndex; + return names[style].fileName; + } - if (failed (num) && num != -EPIPE && num != -ESTRPIPE) - return false; - } - else - { - for (int i = 0; i < numChannelsRunning; ++i) - if (data[i] != 0) - AudioDataConverters::convertFloatToFormat (sampleFormat, data[i], data[i], numSamples); + void setMonospaced (bool mono) { monospaced = mono; } + bool getMonospaced () const throw() { return monospaced; } - snd_pcm_sframes_t num = snd_pcm_writen (handle, (void**) data, numSamples); + void setSerif (const bool serif) { hasSerif = serif; } + bool getSerif () const throw() { return hasSerif; } - if (failed (num)) - { - if (num == -EPIPE) - { - if (failed (snd_pcm_prepare (handle))) - return false; - } - else if (num != -ESTRPIPE) - return false; - } - } +private: - return true; - } + String family; + FontNameIndex names[4]; + bool hasSerif, monospaced; +}; - bool read (float** const data, const int numSamples) +class FreeTypeInterface : public DeletedAtShutdown +{ +public: + + FreeTypeInterface() throw() + : lastFace (0), + lastBold (false), + lastItalic (false) { - if (isInterleaved) + if (FT_Init_FreeType (&ftLib) != 0) { - scratch.ensureSize (sizeof (float) * numSamples * numChannelsRunning, false); - float* interleaved = (float*) scratch; + ftLib = 0; + DBG (T("Failed to initialize FreeType")); + } - snd_pcm_sframes_t num = snd_pcm_readi (handle, (void*) interleaved, numSamples); + StringArray fontDirs; + fontDirs.addTokens (String (getenv ("JUCE_FONT_PATH")), T(";,"), 0); + fontDirs.removeEmptyStrings (true); - if (failed (num)) + if (fontDirs.size() == 0) + { + XmlDocument fontsConfig (File ("/etc/fonts/fonts.conf")); + XmlElement* const fontsInfo = fontsConfig.getDocumentElement(); + + if (fontsInfo != 0) { - if (num == -EPIPE) + forEachXmlChildElementWithTagName (*fontsInfo, e, T("dir")) { - if (failed (snd_pcm_prepare (handle))) - return false; + fontDirs.add (e->getAllSubText().trim()); } - else if (num != -ESTRPIPE) - return false; - } - AudioDataConverters::convertFormatToFloat (sampleFormat, interleaved, interleaved, numSamples * numChannelsRunning); - AudioDataConverters::deinterleaveSamples (interleaved, data, numSamples, numChannelsRunning); + delete fontsInfo; + } } - else - { - snd_pcm_sframes_t num = snd_pcm_readn (handle, (void**) data, numSamples); - - if (failed (num) && num != -EPIPE && num != -ESTRPIPE) - return false; - for (int i = 0; i < numChannelsRunning; ++i) - if (data[i] != 0) - AudioDataConverters::convertFormatToFloat (sampleFormat, data[i], data[i], numSamples); - } + if (fontDirs.size() == 0) + fontDirs.add ("/usr/X11R6/lib/X11/fonts"); - return true; + for (int i = 0; i < fontDirs.size(); ++i) + enumerateFaces (fontDirs[i]); } - juce_UseDebuggingNewOperator - - snd_pcm_t* handle; - String error; - int bitDepth, numChannelsRunning; - -private: - const bool isInput; - bool isInterleaved; - MemoryBlock scratch; - AudioDataConverters::DataFormat sampleFormat; - - bool failed (const int errorNum) + ~FreeTypeInterface() throw() { - if (errorNum >= 0) - return false; + if (lastFace != 0) + FT_Done_Face (lastFace); - error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); - return true; + if (ftLib != 0) + FT_Done_FreeType (ftLib); + + clearSingletonInstance(); } -}; -class ALSAThread : public Thread -{ -public: - ALSAThread (const String& inputId_, - const String& outputId_) - : Thread ("Juce ALSA"), - sampleRate (0), - bufferSize (0), - callback (0), - inputId (inputId_), - outputId (outputId_), - outputDevice (0), - inputDevice (0), - numCallbacks (0), - totalNumInputChannels (0), - totalNumOutputChannels (0) + FreeTypeFontFace* findOrCreate (const String& familyName, + const bool create = false) throw() { - zeromem (outputChannelData, sizeof (outputChannelData)); - zeromem (outputChannelDataForCallback, sizeof (outputChannelDataForCallback)); - zeromem (inputChannelData, sizeof (inputChannelData)); - zeromem (inputChannelDataForCallback, sizeof (inputChannelDataForCallback)); + for (int i = 0; i < faces.size(); i++) + if (faces[i]->getFamilyName() == familyName) + return faces[i]; - initialiseRatesAndChannels(); - } + if (! create) + return NULL; - ~ALSAThread() - { - close(); + FreeTypeFontFace* newFace = new FreeTypeFontFace (familyName); + faces.add (newFace); + + return newFace; } - void open (BitArray inputChannels, - BitArray outputChannels, - const double sampleRate_, - const int bufferSize_) + // Enumerate all font faces available in a given directory + void enumerateFaces (const String& path) throw() { - close(); + File dirPath (path); + if (path.isEmpty() || ! dirPath.isDirectory()) + return; - error = String::empty; - sampleRate = sampleRate_; - bufferSize = bufferSize_; - currentInputChans.clear(); - currentOutputChans.clear(); + DirectoryIterator di (dirPath, true); - if (inputChannels.getHighestBit() >= 0) + while (di.next()) { - for (int i = 0; i <= jmax (inputChannels.getHighestBit(), minChansIn); ++i) - { - inputChannelData [i] = (float*) juce_calloc (sizeof (float) * bufferSize); - - if (inputChannels[i]) - { - inputChannelDataForCallback [totalNumInputChannels++] = inputChannelData [i]; - currentInputChans.setBit (i); - } - } - } + File possible (di.getFile()); - if (outputChannels.getHighestBit() >= 0) - { - for (int i = 0; i <= jmax (outputChannels.getHighestBit(), minChansOut); ++i) + if (possible.hasFileExtension (T("ttf")) + || possible.hasFileExtension (T("pfb")) + || possible.hasFileExtension (T("pcf"))) { - outputChannelData [i] = (float*) juce_calloc (sizeof (float) * bufferSize); + FT_Face face; + int faceIndex = 0; + int numFaces = 0; - if (outputChannels[i]) + do { - outputChannelDataForCallback [totalNumOutputChannels++] = outputChannelData [i]; - currentOutputChans.setBit (i); - } - } - } + if (FT_New_Face (ftLib, + possible.getFullPathName(), + faceIndex, + &face) == 0) + { + if (faceIndex == 0) + numFaces = face->num_faces; - if (totalNumOutputChannels > 0 && outputId.isNotEmpty()) - { - outputDevice = new ALSADevice (outputId, false); + if ((face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) + { + FreeTypeFontFace* const newFace = findOrCreate (face->family_name, true); + int style = (int) FreeTypeFontFace::Plain; - if (outputDevice->error.isNotEmpty()) - { - error = outputDevice->error; - deleteAndZero (outputDevice); - return; - } + if ((face->style_flags & FT_STYLE_FLAG_BOLD) != 0) + style |= (int) FreeTypeFontFace::Bold; - currentOutputChans.setRange (0, minChansOut, true); + if ((face->style_flags & FT_STYLE_FLAG_ITALIC) != 0) + style |= (int) FreeTypeFontFace::Italic; - if (! outputDevice->setParameters ((unsigned int) sampleRate, - jlimit ((int) minChansOut, (int) maxChansOut, currentOutputChans.getHighestBit() + 1), - bufferSize)) - { - error = outputDevice->error; - deleteAndZero (outputDevice); - return; - } - } + newFace->setFileName (possible.getFullPathName(), faceIndex, (FreeTypeFontFace::FontStyle) style); - if (totalNumInputChannels > 0 && inputId.isNotEmpty()) - { - inputDevice = new ALSADevice (inputId, true); + if ((face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0) + newFace->setMonospaced (true); + else + newFace->setMonospaced (false); - if (inputDevice->error.isNotEmpty()) - { - error = inputDevice->error; - deleteAndZero (inputDevice); - return; - } + // Surely there must be a better way to do this? + if (String (face->family_name).containsIgnoreCase (T("Sans")) + || String (face->family_name).containsIgnoreCase (T("Verdana")) + || String (face->family_name).containsIgnoreCase (T("Arial"))) + { + newFace->setSerif (false); + } + else + { + newFace->setSerif (true); + } + } - currentInputChans.setRange (0, minChansIn, true); + FT_Done_Face (face); + } - if (! inputDevice->setParameters ((unsigned int) sampleRate, - jlimit ((int) minChansIn, (int) maxChansIn, currentInputChans.getHighestBit() + 1), - bufferSize)) - { - error = inputDevice->error; - deleteAndZero (inputDevice); - return; + ++faceIndex; + } + while (faceIndex < numFaces); } } + } - if (outputDevice == 0 && inputDevice == 0) - { - error = "no channels"; - return; - } + // Create a FreeType face object for a given font + FT_Face createFT_Face (const String& fontName, + const bool bold, + const bool italic) throw() + { + FT_Face face = NULL; - if (outputDevice != 0 && inputDevice != 0) + if (fontName == lastFontName && bold == lastBold && italic == lastItalic) { - snd_pcm_link (outputDevice->handle, inputDevice->handle); + face = lastFace; } + else + { + if (lastFace) + { + FT_Done_Face (lastFace); + lastFace = NULL; + } - if (inputDevice != 0 && failed (snd_pcm_prepare (inputDevice->handle))) - return; + lastFontName = fontName; + lastBold = bold; + lastItalic = italic; - if (outputDevice != 0 && failed (snd_pcm_prepare (outputDevice->handle))) - return; + FreeTypeFontFace* const ftFace = findOrCreate (fontName); - startThread (9); + if (ftFace != 0) + { + int style = (int) FreeTypeFontFace::Plain; - int count = 1000; + if (bold) + style |= (int) FreeTypeFontFace::Bold; - while (numCallbacks == 0) - { - sleep (5); + if (italic) + style |= (int) FreeTypeFontFace::Italic; - if (--count < 0 || ! isThreadRunning()) - { - error = "device didn't start"; - break; - } - } - } + int faceIndex; + String fileName (ftFace->getFileName (style, &faceIndex)); - void close() - { - stopThread (6000); + if (fileName.isEmpty()) + { + style ^= (int) FreeTypeFontFace::Bold; - deleteAndZero (inputDevice); - deleteAndZero (outputDevice); + fileName = ftFace->getFileName (style, &faceIndex); - for (int i = 0; i < maxNumChans; ++i) - { - juce_free (inputChannelData [i]); - juce_free (outputChannelData [i]); - } - - zeromem (outputChannelData, sizeof (outputChannelData)); - zeromem (outputChannelDataForCallback, sizeof (outputChannelDataForCallback)); - zeromem (inputChannelData, sizeof (inputChannelData)); - zeromem (inputChannelDataForCallback, sizeof (inputChannelDataForCallback)); - totalNumOutputChannels = 0; - totalNumInputChannels = 0; + if (fileName.isEmpty()) + { + style ^= (int) FreeTypeFontFace::Bold; + style ^= (int) FreeTypeFontFace::Italic; - numCallbacks = 0; - } + fileName = ftFace->getFileName (style, &faceIndex); - void setCallback (AudioIODeviceCallback* const newCallback) throw() - { - const ScopedLock sl (callbackLock); - callback = newCallback; - } + if (! fileName.length()) + { + style ^= (int) FreeTypeFontFace::Bold; + fileName = ftFace->getFileName (style, &faceIndex); + } + } + } - void run() - { - while (! threadShouldExit()) - { - if (inputDevice != 0) - { - if (! inputDevice->read (inputChannelData, bufferSize)) + if (! FT_New_Face (ftLib, (const char*) fileName, faceIndex, &lastFace)) { - DBG ("ALSA: read failure"); - break; + face = lastFace; + + // If there isn't a unicode charmap then select the first one. + if (FT_Select_Charmap (face, ft_encoding_unicode)) + FT_Set_Charmap (face, face->charmaps[0]); } } + } + return face; + } - if (threadShouldExit()) - break; + bool addGlyph (FT_Face face, Typeface& dest, uint32 character) throw() + { + const unsigned int glyphIndex = FT_Get_Char_Index (face, character); + const float height = (float) (face->ascender - face->descender); + const float scaleX = 1.0f / height; + const float scaleY = -1.0f / height; + Path destShape; - { - const ScopedLock sl (callbackLock); - ++numCallbacks; + #define CONVERTX(val) (scaleX * (val).x) + #define CONVERTY(val) (scaleY * (val).y) - if (callback != 0) - { - callback->audioDeviceIOCallback ((const float**) inputChannelDataForCallback, - totalNumInputChannels, - outputChannelDataForCallback, - totalNumOutputChannels, - bufferSize); - } - else - { - for (int i = 0; i < totalNumOutputChannels; ++i) - zeromem (outputChannelDataForCallback[i], sizeof (float) * bufferSize); - } - } + if (FT_Load_Glyph (face, glyphIndex, FT_LOAD_NO_SCALE + | FT_LOAD_NO_BITMAP + | FT_LOAD_IGNORE_TRANSFORM) != 0 + || face->glyph->format != ft_glyph_format_outline) + { + return false; + } - if (outputDevice != 0) - { - failed (snd_pcm_wait (outputDevice->handle, 2000)); + const FT_Outline* const outline = &face->glyph->outline; + const short* const contours = outline->contours; + const char* const tags = outline->tags; + FT_Vector* const points = outline->points; - if (threadShouldExit()) - break; + for (int c = 0; c < outline->n_contours; c++) + { + const int startPoint = (c == 0) ? 0 : contours [c - 1] + 1; + const int endPoint = contours[c]; - failed (snd_pcm_avail_update (outputDevice->handle)); + for (int p = startPoint; p <= endPoint; p++) + { + const float x = CONVERTX (points[p]); + const float y = CONVERTY (points[p]); - if (! outputDevice->write (outputChannelData, bufferSize)) + if (p == startPoint) { - DBG ("ALSA: write failure"); - break; - } - } - } - } + if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) + { + float x2 = CONVERTX (points [endPoint]); + float y2 = CONVERTY (points [endPoint]); - int getBitDepth() const throw() - { - if (outputDevice != 0) - return outputDevice->bitDepth; + if (FT_CURVE_TAG (tags[endPoint]) != FT_Curve_Tag_On) + { + x2 = (x + x2) * 0.5f; + y2 = (y + y2) * 0.5f; + } - if (inputDevice != 0) - return inputDevice->bitDepth; + destShape.startNewSubPath (x2, y2); + } + else + { + destShape.startNewSubPath (x, y); + } + } - return 16; - } + if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_On) + { + if (p != startPoint) + destShape.lineTo (x, y); + } + else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) + { + const int nextIndex = (p == endPoint) ? startPoint : p + 1; + float x2 = CONVERTX (points [nextIndex]); + float y2 = CONVERTY (points [nextIndex]); - juce_UseDebuggingNewOperator + if (FT_CURVE_TAG (tags [nextIndex]) == FT_Curve_Tag_Conic) + { + x2 = (x + x2) * 0.5f; + y2 = (y + y2) * 0.5f; + } + else + { + ++p; + } - String error; - double sampleRate; - int bufferSize; - BitArray currentInputChans, currentOutputChans; + destShape.quadraticTo (x, y, x2, y2); + } + else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Cubic) + { + if (p >= endPoint) + return false; - Array sampleRates; - StringArray channelNamesOut, channelNamesIn; - AudioIODeviceCallback* callback; + const int next1 = p + 1; + const int next2 = (p == (endPoint - 1)) ? startPoint : p + 2; -private: + const float x2 = CONVERTX (points [next1]); + const float y2 = CONVERTY (points [next1]); + const float x3 = CONVERTX (points [next2]); + const float y3 = CONVERTY (points [next2]); - const String inputId, outputId; - ALSADevice* outputDevice; - ALSADevice* inputDevice; - int numCallbacks; + if (FT_CURVE_TAG (tags[next1]) != FT_Curve_Tag_Cubic + || FT_CURVE_TAG (tags[next2]) != FT_Curve_Tag_On) + return false; - CriticalSection callbackLock; + destShape.cubicTo (x, y, x2, y2, x3, y3); + p += 2; + } + } - float* outputChannelData [maxNumChans]; - float* outputChannelDataForCallback [maxNumChans]; - int totalNumInputChannels; - float* inputChannelData [maxNumChans]; - float* inputChannelDataForCallback [maxNumChans]; - int totalNumOutputChannels; + destShape.closeSubPath(); + } - unsigned int minChansOut, maxChansOut; - unsigned int minChansIn, maxChansIn; + dest.addGlyph (character, destShape, face->glyph->metrics.horiAdvance/height); - bool failed (const int errorNum) throw() - { - if (errorNum >= 0) - return false; + if ((face->face_flags & FT_FACE_FLAG_KERNING) != 0) + addKerning (face, dest, character, glyphIndex); - error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); return true; } - void initialiseRatesAndChannels() throw() + void addKerning (FT_Face face, Typeface& dest, const uint32 character, const uint32 glyphIndex) throw() { - sampleRates.clear(); - channelNamesOut.clear(); - channelNamesIn.clear(); - minChansOut = 0; - maxChansOut = 0; - minChansIn = 0; - maxChansIn = 0; - unsigned int dummy = 0; - - getDeviceProperties (inputId, dummy, dummy, minChansIn, maxChansIn, sampleRates); - getDeviceProperties (outputId, minChansOut, maxChansOut, dummy, dummy, sampleRates); - - unsigned int i; - for (i = 0; i < maxChansOut; ++i) - channelNamesOut.add (T("channel ") + String ((int) i + 1)); - - for (i = 0; i < maxChansIn; ++i) - channelNamesIn.add (T("channel ") + String ((int) i + 1)); - } -}; + const float height = (float) (face->ascender - face->descender); -class ALSAAudioIODevice : public AudioIODevice -{ -public: - ALSAAudioIODevice (const String& deviceName, - const String& inputId_, - const String& outputId_) - : AudioIODevice (deviceName, T("ALSA")), - inputId (inputId_), - outputId (outputId_), - isOpen_ (false), - isStarted (false), - internal (0) - { - internal = new ALSAThread (inputId, outputId); - } + uint32 rightGlyphIndex; + uint32 rightCharCode = FT_Get_First_Char (face, &rightGlyphIndex); - ~ALSAAudioIODevice() - { - delete internal; - } + while (rightGlyphIndex != 0) + { + FT_Vector kerning; - const StringArray getOutputChannelNames() - { - return internal->channelNamesOut; - } + if (FT_Get_Kerning (face, glyphIndex, rightGlyphIndex, ft_kerning_unscaled, &kerning) == 0) + { + if (kerning.x != 0) + dest.addKerningPair (character, rightCharCode, kerning.x / height); + } - const StringArray getInputChannelNames() - { - return internal->channelNamesIn; + rightCharCode = FT_Get_Next_Char (face, rightCharCode, &rightGlyphIndex); + } } - int getNumSampleRates() + // Add a glyph to a font + bool addGlyphToFont (const uint32 character, + const tchar* fontName, bool bold, bool italic, + Typeface& dest) throw() { - return internal->sampleRates.size(); - } + FT_Face face = createFT_Face (fontName, bold, italic); - double getSampleRate (int index) - { - return internal->sampleRates [index]; - } + if (face != 0) + return addGlyph (face, dest, character); - int getNumBufferSizesAvailable() - { - return 50; + return false; } - int getBufferSizeSamples (int index) + // Create a Typeface object for given name/style + bool createTypeface (const String& fontName, + const bool bold, const bool italic, + Typeface& dest, + const bool addAllGlyphs) throw() { - int n = 16; - for (int i = 0; i < index; ++i) - n += n < 64 ? 16 - : (n < 512 ? 32 - : (n < 1024 ? 64 - : (n < 2048 ? 128 : 256))); + dest.clear(); + dest.setName (fontName); + dest.setBold (bold); + dest.setItalic (italic); - return n; - } + FT_Face face = createFT_Face (fontName, bold, italic); - int getDefaultBufferSize() - { - return 512; - } + if (face == 0) + { +#ifdef JUCE_DEBUG + String msg (T("Failed to create typeface: ")); + msg << fontName << " " << (bold ? 'B' : ' ') << (italic ? 'I' : ' '); + DBG (msg); +#endif + return face; + } - const String open (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate, - int bufferSizeSamples) - { - close(); + const float height = (float) (face->ascender - face->descender); - if (bufferSizeSamples <= 0) - bufferSizeSamples = getDefaultBufferSize(); + dest.setAscent (face->ascender / height); + dest.setDefaultCharacter (L' '); - if (sampleRate <= 0) + if (addAllGlyphs) { - for (int i = 0; i < getNumSampleRates(); ++i) + uint32 glyphIndex; + uint32 charCode = FT_Get_First_Char (face, &glyphIndex); + + while (glyphIndex != 0) { - if (getSampleRate (i) >= 44100) - { - sampleRate = getSampleRate (i); - break; - } + addGlyph (face, dest, charCode); + charCode = FT_Get_Next_Char (face, charCode, &glyphIndex); } } - internal->open (inputChannels, outputChannels, - sampleRate, bufferSizeSamples); - - isOpen_ = internal->error.isEmpty(); - return internal->error; + return true; } - void close() + void getFamilyNames (StringArray& familyNames) const throw() { - stop(); - internal->close(); - isOpen_ = false; + for (int i = 0; i < faces.size(); i++) + familyNames.add (faces[i]->getFamilyName()); } - bool isOpen() + void getMonospacedNames (StringArray& monoSpaced) const throw() { - return isOpen_; + for (int i = 0; i < faces.size(); i++) + if (faces[i]->getMonospaced()) + monoSpaced.add (faces[i]->getFamilyName()); } - int getCurrentBufferSizeSamples() + void getSerifNames (StringArray& serif) const throw() { - return internal->bufferSize; + for (int i = 0; i < faces.size(); i++) + if (faces[i]->getSerif()) + serif.add (faces[i]->getFamilyName()); } - double getCurrentSampleRate() + void getSansSerifNames (StringArray& sansSerif) const throw() { - return internal->sampleRate; + for (int i = 0; i < faces.size(); i++) + if (! faces[i]->getSerif()) + sansSerif.add (faces[i]->getFamilyName()); } - int getCurrentBitDepth() - { - return internal->getBitDepth(); - } + juce_DeclareSingleton_SingleThreaded_Minimal (FreeTypeInterface) - const BitArray getActiveOutputChannels() const - { - return internal->currentOutputChans; - } +private: - const BitArray getActiveInputChannels() const - { - return internal->currentInputChans; - } + FT_Library ftLib; + FT_Face lastFace; + String lastFontName; + bool lastBold, lastItalic; + OwnedArray faces; +}; - int getOutputLatencyInSamples() - { - return 0; - } +juce_ImplementSingleton_SingleThreaded (FreeTypeInterface) - int getInputLatencyInSamples() - { - return 0; - } +void Typeface::initialiseTypefaceCharacteristics (const String& fontName, + bool bold, bool italic, + bool addAllGlyphsToFont) throw() +{ + FreeTypeInterface::getInstance() + ->createTypeface (fontName, bold, italic, *this, addAllGlyphsToFont); +} - void start (AudioIODeviceCallback* callback) - { - if (! isOpen_) - callback = 0; +bool Typeface::findAndAddSystemGlyph (juce_wchar character) throw() +{ + return FreeTypeInterface::getInstance() + ->addGlyphToFont (character, getName(), isBold(), isItalic(), *this); +} - internal->setCallback (callback); +const StringArray Font::findAllTypefaceNames() throw() +{ + StringArray s; + FreeTypeInterface::getInstance()->getFamilyNames (s); + s.sort (true); + return s; +} - if (callback != 0) - callback->audioDeviceAboutToStart (this); +static const String pickBestFont (const StringArray& names, + const char* const choicesString) +{ + StringArray choices; + choices.addTokens (String (choicesString), T(","), 0); + choices.trim(); + choices.removeEmptyStrings(); - isStarted = (callback != 0); - } + int i, j; + for (j = 0; j < choices.size(); ++j) + if (names.contains (choices[j], true)) + return choices[j]; - void stop() - { - AudioIODeviceCallback* const oldCallback = internal->callback; + for (j = 0; j < choices.size(); ++j) + for (i = 0; i < names.size(); i++) + if (names[i].startsWithIgnoreCase (choices[j])) + return names[i]; - start (0); + for (j = 0; j < choices.size(); ++j) + for (i = 0; i < names.size(); i++) + if (names[i].containsIgnoreCase (choices[j])) + return names[i]; - if (oldCallback != 0) - oldCallback->audioDeviceStopped(); - } + return names[0]; +} - bool isPlaying() - { - return isStarted && internal->error.isEmpty(); - } +static const String linux_getDefaultSansSerifFontName() +{ + StringArray allFonts; + FreeTypeInterface::getInstance()->getSansSerifNames (allFonts); - const String getLastError() - { - return internal->error; - } + return pickBestFont (allFonts, "Verdana, Bitstream Vera Sans, Luxi Sans, Sans"); +} - String inputId, outputId; +static const String linux_getDefaultSerifFontName() +{ + StringArray allFonts; + FreeTypeInterface::getInstance()->getSerifNames (allFonts); -private: - bool isOpen_, isStarted; - ALSAThread* internal; -}; + return pickBestFont (allFonts, "Bitstream Vera Serif, Times, Nimbus Roman, Serif"); +} -class ALSAAudioIODeviceType : public AudioIODeviceType +static const String linux_getDefaultMonospacedFontName() { -public: + StringArray allFonts; + FreeTypeInterface::getInstance()->getMonospacedNames (allFonts); - ALSAAudioIODeviceType() - : AudioIODeviceType (T("ALSA")), - hasScanned (false) - { - } + return pickBestFont (allFonts, "Bitstream Vera Sans Mono, Courier, Sans Mono, Mono"); +} - ~ALSAAudioIODeviceType() - { - } +void Typeface::getDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +{ + defaultSans = linux_getDefaultSansSerifFontName(); + defaultSerif = linux_getDefaultSerifFontName(); + defaultFixed = linux_getDefaultMonospacedFontName(); +} - void scanForDevices() - { - if (hasScanned) - return; +#endif +/********* End of inlined file: juce_linux_Fonts.cpp *********/ - hasScanned = true; - inputNames.clear(); - inputIds.clear(); - outputNames.clear(); - outputIds.clear(); +/********* Start of inlined file: juce_linux_Windowing.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - snd_ctl_t* handle; - snd_ctl_card_info_t* info; - snd_ctl_card_info_alloca (&info); +#define TAKE_FOCUS 0 +#define DELETE_WINDOW 1 - int cardNum = -1; +#define SYSTEM_TRAY_REQUEST_DOCK 0 +#define SYSTEM_TRAY_BEGIN_MESSAGE 1 +#define SYSTEM_TRAY_CANCEL_MESSAGE 2 - while (outputIds.size() + inputIds.size() <= 32) - { - snd_card_next (&cardNum); +static const int repaintTimerPeriod = 1000 / 100; // 100 fps maximum - if (cardNum < 0) - break; +static Atom wm_ChangeState = None; +static Atom wm_State = None; +static Atom wm_Protocols = None; +static Atom wm_ProtocolList [2] = { None, None }; +static Atom wm_ActiveWin = None; - if (snd_ctl_open (&handle, T("hw:") + String (cardNum), SND_CTL_NONBLOCK) >= 0) - { - if (snd_ctl_card_info (handle, info) >= 0) - { - String cardId (snd_ctl_card_info_get_id (info)); +#define ourDndVersion 3 +static Atom XA_XdndAware = None; +static Atom XA_XdndEnter = None; +static Atom XA_XdndLeave = None; +static Atom XA_XdndPosition = None; +static Atom XA_XdndStatus = None; +static Atom XA_XdndDrop = None; +static Atom XA_XdndFinished = None; +static Atom XA_XdndSelection = None; +static Atom XA_XdndProxy = None; - if (cardId.removeCharacters (T("0123456789")).isEmpty()) - cardId = String (cardNum); +static Atom XA_XdndTypeList = None; +static Atom XA_XdndActionList = None; +static Atom XA_XdndActionDescription = None; +static Atom XA_XdndActionCopy = None; +static Atom XA_XdndActionMove = None; +static Atom XA_XdndActionLink = None; +static Atom XA_XdndActionAsk = None; +static Atom XA_XdndActionPrivate = None; +static Atom XA_JXSelectionWindowProperty = None; - int device = -1; +static Atom XA_MimeTextPlain = None; +static Atom XA_MimeTextUriList = None; +static Atom XA_MimeRootDrop = None; - for (;;) - { - if (snd_ctl_pcm_next_device (handle, &device) < 0 || device < 0) - break; +static XErrorHandler oldHandler = 0; +static int trappedErrorCode = 0; - String id, name; - id << "hw:" << cardId << ',' << device; +extern "C" int errorTrapHandler (Display* dpy, XErrorEvent* err) +{ + trappedErrorCode = err->error_code; + return 0; +} - bool isInput, isOutput; +static void trapErrors() +{ + trappedErrorCode = 0; + oldHandler = XSetErrorHandler (errorTrapHandler); +} - if (testDevice (id, isInput, isOutput)) - { - name << snd_ctl_card_info_get_name (info); +static bool untrapErrors() +{ + XSetErrorHandler (oldHandler); + return (trappedErrorCode == 0); +} - if (name.isEmpty()) - name = id; +static bool isActiveApplication = false; - if (isInput) - { - inputNames.add (name); - inputIds.add (id); - } +bool Process::isForegroundProcess() throw() +{ + return isActiveApplication; +} - if (isOutput) - { - outputNames.add (name); - outputIds.add (id); - } - } - } - } +// (used in the messaging code, declared here for build reasons) +bool juce_isRunningAsApplication() +{ + return JUCEApplication::getInstance() != 0; +} - snd_ctl_close (handle); - } - } +// These are defined in juce_linux_Messaging.cpp +extern Display* display; +extern XContext improbableNumber; - inputNames.appendNumbersToDuplicates (false, true); - outputNames.appendNumbersToDuplicates (false, true); - } +static const int eventMask = NoEventMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask + | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask + | ExposureMask | StructureNotifyMask | FocusChangeMask; - const StringArray getDeviceNames (const bool wantInputNames) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this +static int pointerMap[5]; +static int lastMousePosX = 0, lastMousePosY = 0; - return wantInputNames ? inputNames : outputNames; - } +enum MouseButtons +{ + NoButton = 0, + LeftButton = 1, + MiddleButton = 2, + RightButton = 3, + WheelUp = 4, + WheelDown = 5 +}; - int getDefaultDeviceIndex (const bool forInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this - return 0; - } +static void getMousePos (int& x, int& y, int& mouseMods) throw() +{ + Window root, child; + int winx, winy; + unsigned int mask; - bool hasSeparateInputsAndOutputs() const { return true; } + mouseMods = 0; - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + if (XQueryPointer (display, + RootWindow (display, DefaultScreen (display)), + &root, &child, + &x, &y, &winx, &winy, &mask) == False) { - jassert (hasScanned); // need to call scanForDevices() before doing this - - ALSAAudioIODevice* const d = dynamic_cast (device); - if (d == 0) - return -1; - - return asInput ? inputIds.indexOf (d->inputId) - : outputIds.indexOf (d->outputId); + // Pointer not on the default screen + x = y = -1; } - - AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) + else { - jassert (hasScanned); // need to call scanForDevices() before doing this - - const int inputIndex = inputNames.indexOf (inputDeviceName); - const int outputIndex = outputNames.indexOf (outputDeviceName); - - String deviceName (outputDeviceName); - if (deviceName.isEmpty()) - deviceName = inputDeviceName; + if ((mask & Button1Mask) != 0) + mouseMods |= ModifierKeys::leftButtonModifier; - if (index >= 0) - return new ALSAAudioIODevice (deviceName, - inputIds [inputIndex], - outputIds [outputIndex]); + if ((mask & Button2Mask) != 0) + mouseMods |= ModifierKeys::middleButtonModifier; - return 0; + if ((mask & Button3Mask) != 0) + mouseMods |= ModifierKeys::rightButtonModifier; } +} - juce_UseDebuggingNewOperator +static int AltMask = 0; +static int NumLockMask = 0; +static bool numLock = 0; +static bool capsLock = 0; +static char keyStates [32]; -private: - StringArray inputNames, outputNames, inputIds, outputIds; - bool hasScanned; +static void updateKeyStates (const int keycode, const bool press) throw() +{ + const int keybyte = keycode >> 3; + const int keybit = (1 << (keycode & 7)); - static bool testDevice (const String& id, bool& isInput, bool& isOutput) - { - unsigned int minChansOut = 0, maxChansOut = 0; - unsigned int minChansIn = 0, maxChansIn = 0; - Array rates; + if (press) + keyStates [keybyte] |= keybit; + else + keyStates [keybyte] &= ~keybit; +} - getDeviceProperties (id, minChansOut, maxChansOut, minChansIn, maxChansIn, rates); +static bool keyDown (const int keycode) throw() +{ + const int keybyte = keycode >> 3; + const int keybit = (1 << (keycode & 7)); - DBG (T("ALSA device: ") + id - + T(" outs=") + String ((int) minChansOut) + T("-") + String ((int) maxChansOut) - + T(" ins=") + String ((int) minChansIn) + T("-") + String ((int) maxChansIn) - + T(" rates=") + String (rates.size())); + return (keyStates [keybyte] & keybit) != 0; +} - isInput = maxChansIn > 0; - isOutput = maxChansOut > 0; +static const int extendedKeyModifier = 0x10000000; - return (isInput || isOutput) && rates.size() > 0; +bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +{ + int keysym; + + if (keyCode & extendedKeyModifier) + { + keysym = 0xff00 | (keyCode & 0xff); } + else + { + keysym = keyCode; - ALSAAudioIODeviceType (const ALSAAudioIODeviceType&); - const ALSAAudioIODeviceType& operator= (const ALSAAudioIODeviceType&); -}; + if (keysym == (XK_Tab & 0xff) + || keysym == (XK_Return & 0xff) + || keysym == (XK_Escape & 0xff) + || keysym == (XK_BackSpace & 0xff)) + { + keysym |= 0xff00; + } + } -AudioIODeviceType* juce_createDefaultAudioIODeviceType() -{ - return new ALSAAudioIODeviceType(); + return keyDown (XKeysymToKeycode (display, keysym)); } -END_JUCE_NAMESPACE - -#else // if ALSA is turned off.. - -BEGIN_JUCE_NAMESPACE +// Alt and Num lock are not defined by standard X +// modifier constants: check what they're mapped to +static void getModifierMapping() throw() +{ + const int altLeftCode = XKeysymToKeycode (display, XK_Alt_L); + const int numLockCode = XKeysymToKeycode (display, XK_Num_Lock); -AudioIODeviceType* juce_createDefaultAudioIODeviceType() { return 0; } + AltMask = 0; + NumLockMask = 0; -END_JUCE_NAMESPACE + XModifierKeymap* mapping = XGetModifierMapping (display); -#endif -/********* End of inlined file: juce_linux_Audio.cpp *********/ + if (mapping) + { + for (int i = 0; i < 8; i++) + { + if (mapping->modifiermap [i << 1] == altLeftCode) + AltMask = 1 << i; + else if (mapping->modifiermap [i << 1] == numLockCode) + NumLockMask = 1 << i; + } -/********* Start of inlined file: juce_linux_AudioCDReader.cpp *********/ + XFreeModifiermap (mapping); + } +} -BEGIN_JUCE_NAMESPACE +static int currentModifiers = 0; -AudioCDReader::AudioCDReader() - : AudioFormatReader (0, T("CD Audio")) +void ModifierKeys::updateCurrentModifiers() throw() { + currentModifierFlags = currentModifiers; } -const StringArray AudioCDReader::getAvailableCDNames() +const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() { - StringArray names; - return names; -} + int x, y, mouseMods; + getMousePos (x, y, mouseMods); -AudioCDReader* AudioCDReader::createReaderForCD (const int index) -{ - return 0; -} + currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + currentModifiers |= mouseMods; -AudioCDReader::~AudioCDReader() -{ + return ModifierKeys (currentModifiers); } -void AudioCDReader::refreshTrackLengths() +static void updateKeyModifiers (const int status) throw() { -} + currentModifiers &= ~(ModifierKeys::shiftModifier + | ModifierKeys::ctrlModifier + | ModifierKeys::altModifier); -bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer, - int64 startSampleInFile, int numSamples) -{ - return false; -} + if (status & ShiftMask) + currentModifiers |= ModifierKeys::shiftModifier; -bool AudioCDReader::isCDStillPresent() const -{ - return false; -} + if (status & ControlMask) + currentModifiers |= ModifierKeys::ctrlModifier; -int AudioCDReader::getNumTracks() const -{ - return 0; -} + if (status & AltMask) + currentModifiers |= ModifierKeys::altModifier; -int AudioCDReader::getPositionOfTrackStart (int trackNum) const -{ - return 0; + numLock = ((status & NumLockMask) != 0); + capsLock = ((status & LockMask) != 0); } -bool AudioCDReader::isTrackAudio (int trackNum) const +static bool updateKeyModifiersFromSym (KeySym sym, const bool press) throw() { - return false; -} + int modifier = 0; + bool isModifier = true; -void AudioCDReader::enableIndexScanning (bool b) -{ -} + switch (sym) + { + case XK_Shift_L: + case XK_Shift_R: + modifier = ModifierKeys::shiftModifier; + break; -int AudioCDReader::getLastIndex() const -{ - return 0; -} + case XK_Control_L: + case XK_Control_R: + modifier = ModifierKeys::ctrlModifier; + break; -const Array AudioCDReader::findIndexesInTrack (const int trackNumber) -{ - return Array(); -} + case XK_Alt_L: + case XK_Alt_R: + modifier = ModifierKeys::altModifier; + break; -int AudioCDReader::getCDDBId() -{ - return 0; -} + case XK_Num_Lock: + if (press) + numLock = ! numLock; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_AudioCDReader.cpp *********/ + break; -/********* Start of inlined file: juce_linux_FileChooser.cpp *********/ + case XK_Caps_Lock: + if (press) + capsLock = ! capsLock; -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) + break; -/* - This file contains macros that enable/disable various JUCE features. -*/ + case XK_Scroll_Lock: + break; -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif + default: + isModifier = false; + break; + } -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif + if (modifier != 0) + { + if (press) + currentModifiers |= modifier; + else + currentModifiers &= ~modifier; + } -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. + return isModifier; +} - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. +#if JUCE_USE_XSHM +static bool isShmAvailable() throw() +{ + static bool isChecked = false; + static bool isAvailable = false; - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif + if (! isChecked) + { + isChecked = true; -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. + int major, minor; + Bool pixmaps; - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif + if (XShmQueryVersion (display, &major, &minor, &pixmaps)) + { + trapErrors(); -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif + XShmSegmentInfo segmentInfo; + zerostruct (segmentInfo); + XImage* xImage = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), + 24, ZPixmap, 0, &segmentInfo, 50, 50); -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. + if ((segmentInfo.shmid = shmget (IPC_PRIVATE, + xImage->bytes_per_line * xImage->height, + IPC_CREAT | 0777)) >= 0) + { + segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. + if (segmentInfo.shmaddr != (void*) -1) + { + segmentInfo.readOnly = False; + xImage->data = segmentInfo.shmaddr; + XSync (display, False); - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif + if (XShmAttach (display, &segmentInfo) != 0) + { + XSync (display, False); + XShmDetach (display, &segmentInfo); -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + isAvailable = true; + } + } -/** These flags enable the Ogg-Vorbis and Flac audio formats. + XFlush (display); + XDestroyImage (xImage); - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif + shmdt (segmentInfo.shmaddr); + } -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + shmctl (segmentInfo.shmid, IPC_RMID, 0); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + isAvailable &= untrapErrors(); + } + } -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 + return isAvailable; +} #endif -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. - - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif - -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif - -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif +static Pixmap juce_createColourPixmapFromImage (Display* display, const Image& image) +{ + const int width = image.getWidth(); + const int height = image.getHeight(); + uint32* const colour = (uint32*) juce_malloc (width * height * sizeof (uint32)); + int index = 0; -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif + for (int y = 0; y < height; ++y) + for (int x = 0; x < width; ++x) + colour[index++] = image.getPixelAt (x, y).getARGB(); -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif + XImage* ximage = XCreateImage (display, CopyFromParent, 24, ZPixmap, + 0, (char*) colour, width, height, 32, 0); -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif + Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), + width, height, 24); -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif + GC gc = XCreateGC (display, pixmap, 0, 0); + XPutImage (display, pixmap, gc, ximage, 0, 0, 0, 0, width, height); + XFreeGC (display, gc); + juce_free (colour); -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif + return pixmap; +} -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif +static Pixmap juce_createMaskPixmapFromImage (Display* display, const Image& image) +{ + const int width = image.getWidth(); + const int height = image.getHeight(); + const int stride = (width + 7) >> 3; + uint8* const mask = (uint8*) juce_calloc (stride * height); + const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif + for (int y = 0; y < height; ++y) + { + for (int x = 0; x < width; ++x) + { + const uint8 bit = (uint8) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); + const int offset = y * stride + (x >> 3); -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + if (image.getPixelAt (x, y).getAlpha() >= 128) + mask[offset] |= bit; + } + } -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + Pixmap pixmap = XCreatePixmapFromBitmapData (display, DefaultRootWindow (display), + (char*) mask, width, height, 1, 0, 1); -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + juce_free (mask); -/** Enable this to add extra memory-leak info to the new and delete operators. + return pixmap; +} - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif +class XBitmapImage : public Image +{ +public: -/** Enable this to turn on juce's internal catching of exceptions. + XBitmapImage (const PixelFormat format_, const int w, const int h, + const bool clearImage, const bool is16Bit_) + : Image (format_, w, h), + is16Bit (is16Bit_) + { + jassert (format_ == RGB || format_ == ARGB); - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + pixelStride = (format_ == RGB) ? 3 : 4; + lineStride = ((w * pixelStride + 3) & ~3); -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + Visual* const visual = DefaultVisual (display, DefaultScreen (display)); -#endif -/********* End of inlined file: juce_Config.h *********/ +#if JUCE_USE_XSHM + usingXShm = false; -BEGIN_JUCE_NAMESPACE + if ((! is16Bit) && isShmAvailable()) + { + zerostruct (segmentInfo); -void FileChooser::showPlatformDialog (OwnedArray& results, - const String& title, - const File& file, - const String& filters, - bool isDirectory, - bool isSave, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, - FilePreviewComponent* previewComponent) -{ - //xxx ain't got one! - jassertfalse -} + xImage = XShmCreateImage (display, visual, 24, ZPixmap, 0, &segmentInfo, w, h); -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_FileChooser.cpp *********/ + if (xImage != 0) + { + if ((segmentInfo.shmid = shmget (IPC_PRIVATE, + xImage->bytes_per_line * xImage->height, + IPC_CREAT | 0777)) >= 0) + { + segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); -/********* Start of inlined file: juce_linux_Fonts.cpp *********/ + if (segmentInfo.shmaddr != (void*) -1) + { + segmentInfo.readOnly = False; -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) + xImage->data = segmentInfo.shmaddr; + imageData = (uint8*) segmentInfo.shmaddr; -/* - This file contains macros that enable/disable various JUCE features. -*/ + XSync (display, False); -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif + if (XShmAttach (display, &segmentInfo) != 0) + { + XSync (display, False); + usingXShm = true; + } + else + { + jassertfalse + } + } + else + { + shmctl (segmentInfo.shmid, IPC_RMID, 0); + } + } + } + } -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 + if (! usingXShm) #endif + { + imageData = (uint8*) juce_malloc (lineStride * h); -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. + if (format_ == ARGB && clearImage) + zeromem (imageData, h * lineStride); - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. + xImage = (XImage*) juce_calloc (sizeof (XImage)); - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif + xImage->width = w; + xImage->height = h; + xImage->xoffset = 0; + xImage->format = ZPixmap; + xImage->data = (char*) imageData; + xImage->byte_order = ImageByteOrder (display); + xImage->bitmap_unit = BitmapUnit (display); + xImage->bitmap_bit_order = BitmapBitOrder (display); + xImage->bitmap_pad = 32; + xImage->depth = pixelStride * 8; + xImage->bytes_per_line = lineStride; + xImage->bits_per_pixel = pixelStride * 8; + xImage->red_mask = 0x00FF0000; + xImage->green_mask = 0x0000FF00; + xImage->blue_mask = 0x000000FF; -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. + if (is16Bit) + { + const int pixelStride = 2; + const int lineStride = ((w * pixelStride + 3) & ~3); - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif + xImage->data = (char*) juce_malloc (lineStride * h); + xImage->bitmap_pad = 16; + xImage->depth = pixelStride * 8; + xImage->bytes_per_line = lineStride; + xImage->bits_per_pixel = pixelStride * 8; + xImage->red_mask = visual->red_mask; + xImage->green_mask = visual->green_mask; + xImage->blue_mask = visual->blue_mask; + } -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif + if (! XInitImage (xImage)) + { + jassertfalse + } + } + } -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. + ~XBitmapImage() + { +#if JUCE_USE_XSHM + if (usingXShm) + { + XShmDetach (display, &segmentInfo); - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. + XFlush (display); + XDestroyImage (xImage); - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 + shmdt (segmentInfo.shmaddr); + shmctl (segmentInfo.shmid, IPC_RMID, 0); + } + else #endif + { + juce_free (xImage->data); + xImage->data = 0; + XDestroyImage (xImage); + } -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + if (! is16Bit) + imageData = 0; // to stop the base class freeing this (for the 16-bit version we want it to free it) + } -/** These flags enable the Ogg-Vorbis and Flac audio formats. + void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy) + { + static GC gc = 0; - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif + if (gc == 0) + gc = DefaultGC (display, DefaultScreen (display)); -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + if (is16Bit) + { + const uint32 rMask = xImage->red_mask; + const uint32 rShiftL = jmax (0, getShiftNeeded (rMask)); + const uint32 rShiftR = jmax (0, -getShiftNeeded (rMask)); + const uint32 gMask = xImage->green_mask; + const uint32 gShiftL = jmax (0, getShiftNeeded (gMask)); + const uint32 gShiftR = jmax (0, -getShiftNeeded (gMask)); + const uint32 bMask = xImage->blue_mask; + const uint32 bShiftL = jmax (0, getShiftNeeded (bMask)); + const uint32 bShiftR = jmax (0, -getShiftNeeded (bMask)); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + int ls, ps; + const uint8* const pixels = lockPixelDataReadOnly (0, 0, getWidth(), getHeight(), ls, ps); -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif + for (int y = sy; y < sy + dh; ++y) + { + const uint8* p = pixels + y * ls + sx * ps; -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. + for (int x = sx; x < sx + dw; ++x) + { + const PixelRGB* const pixel = (const PixelRGB*) p; + p += ps; - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif + XPutPixel (xImage, x, y, + (((((uint32) pixel->getRed()) << rShiftL) >> rShiftR) & rMask) + | (((((uint32) pixel->getGreen()) << gShiftL) >> gShiftR) & gMask) + | (((((uint32) pixel->getBlue()) << bShiftL) >> bShiftR) & bMask)); + } + } -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif + releasePixelDataReadOnly (pixels); + } -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 + // blit results to screen. +#if JUCE_USE_XSHM + if (usingXShm) + XShmPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh, False); + else #endif + XPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh); + } -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif + juce_UseDebuggingNewOperator -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif +private: + XImage* xImage; + const bool is16Bit; -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 +#if JUCE_USE_XSHM + XShmSegmentInfo segmentInfo; + bool usingXShm; #endif -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif + static int getShiftNeeded (const uint32 mask) throw() + { + for (int i = 32; --i >= 0;) + if (((mask >> i) & 1) != 0) + return i - 7; -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif + jassertfalse + return 0; + } +}; -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif +#define checkMessageManagerIsLocked jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager()); -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif +class LinuxComponentPeer : public ComponentPeer +{ +public: -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + LinuxComponentPeer (Component* const component, const int windowStyleFlags) + : ComponentPeer (component, windowStyleFlags), + windowH (0), + parentWindow (0), + wx (0), + wy (0), + ww (0), + wh (0), + taskbarImage (0), + fullScreen (false), + entered (false), + mapped (false) + { + // it's dangerous to create a window on a thread other than the message thread.. + checkMessageManagerIsLocked -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + repainter = new LinuxRepaintManager (this); -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + createWindow(); -/** Enable this to add extra memory-leak info to the new and delete operators. + setTitle (component->getName()); + } - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif + ~LinuxComponentPeer() + { + // it's dangerous to delete a window on a thread other than the message thread.. + checkMessageManagerIsLocked -/** Enable this to turn on juce's internal catching of exceptions. + deleteTaskBarIcon(); + deleteIconPixmaps(); - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + destroyWindow(); -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + windowH = 0; + delete repainter; + } -#endif -/********* End of inlined file: juce_Config.h *********/ + void* getNativeHandle() const + { + return (void*) windowH; + } -/* Got a build error here? You'll need to install the freetype library... + static LinuxComponentPeer* getPeerFor (Window windowHandle) throw() + { + XPointer peer = 0; - The name of the package to install is "libfreetype6-dev". -*/ -#include -#include FT_FREETYPE_H + if (! XFindContext (display, (XID) windowHandle, improbableNumber, &peer)) + { + if (peer != 0 && ! ((LinuxComponentPeer*) peer)->isValidMessageListener()) + peer = 0; + } -BEGIN_JUCE_NAMESPACE + return (LinuxComponentPeer*) peer; + } -class FreeTypeFontFace -{ -public: + void setVisible (bool shouldBeVisible) + { + if (shouldBeVisible) + XMapWindow (display, windowH); + else + XUnmapWindow (display, windowH); + } - enum FontStyle + void setTitle (const String& title) { - Plain = 0, - Bold = 1, - Italic = 2 - }; + setWindowTitle (windowH, title); + } - struct FontNameIndex + void setPosition (int x, int y) { - String fileName; - int faceIndex; - }; + setBounds (x, y, ww, wh, false); + } - FreeTypeFontFace (const String& familyName) - : hasSerif (false), - monospaced (false) + void setSize (int w, int h) { - family = familyName; + setBounds (wx, wy, w, h, false); } - void setFileName (const String& name, - const int faceIndex, - FontStyle style) + void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) { - if (names[(int) style].fileName.isEmpty()) + fullScreen = isNowFullScreen; + + if (windowH != 0) { - names[(int) style].fileName = name; - names[(int) style].faceIndex = faceIndex; + const ComponentDeletionWatcher deletionChecker (component); + + wx = x; + wy = y; + ww = jmax (1, w); + wh = jmax (1, h); + + // Make sure the Window manager does what we want + XSizeHints* hints = XAllocSizeHints(); + hints->flags = USSize | USPosition; + hints->width = ww; + hints->height = wh; + hints->x = wx; + hints->y = wy; + + if ((getStyleFlags() & (windowHasTitleBar | windowIsResizable)) == windowHasTitleBar) + { + hints->min_width = hints->max_width = hints->width; + hints->min_height = hints->max_height = hints->height; + hints->flags |= PMinSize | PMaxSize; + } + + XSetWMNormalHints (display, windowH, hints); + XFree (hints); + + XMoveResizeWindow (display, windowH, + wx - windowBorder.getLeft(), + wy - windowBorder.getTop(), ww, wh); + + if (! deletionChecker.hasBeenDeleted()) + { + updateBorderSize(); + handleMovedOrResized(); + } } } - const String& getFamilyName() const throw() + void getBounds (int& x, int& y, int& w, int& h) const { - return family; + x = wx; + y = wy; + w = ww; + h = wh; } - const String& getFileName (int style, int* faceIndex) const throw() + int getScreenX() const { - *faceIndex = names [style].faceIndex; - return names[style].fileName; + return wx; } - void setMonospaced (bool mono) { monospaced = mono; } - bool getMonospaced () const throw() { return monospaced; } + int getScreenY() const + { + return wy; + } - void setSerif (const bool serif) { hasSerif = serif; } - bool getSerif () const throw() { return hasSerif; } + void relativePositionToGlobal (int& x, int& y) + { + x += wx; + y += wy; + } -private: + void globalPositionToRelative (int& x, int& y) + { + x -= wx; + y -= wy; + } - String family; - FontNameIndex names[4]; - bool hasSerif, monospaced; -}; + void setMinimised (bool shouldBeMinimised) + { + if (shouldBeMinimised) + { + Window root = RootWindow (display, DefaultScreen (display)); -class FreeTypeInterface : public DeletedAtShutdown -{ -public: + XClientMessageEvent clientMsg; + clientMsg.display = display; + clientMsg.window = windowH; + clientMsg.type = ClientMessage; + clientMsg.format = 32; + clientMsg.message_type = wm_ChangeState; + clientMsg.data.l[0] = IconicState; - FreeTypeInterface() throw() - : lastFace (0), - lastBold (false), - lastItalic (false) - { - if (FT_Init_FreeType (&ftLib) != 0) + XSendEvent (display, root, false, + SubstructureRedirectMask | SubstructureNotifyMask, + (XEvent*) &clientMsg); + } + else { - ftLib = 0; - DBG (T("Failed to initialize FreeType")); + setVisible (true); } + } - StringArray fontDirs; - fontDirs.addTokens (String (getenv ("JUCE_FONT_PATH")), T(";,"), 0); - fontDirs.removeEmptyStrings (true); + bool isMinimised() const + { + bool minimised = false; - if (fontDirs.size() == 0) - { - XmlDocument fontsConfig (File ("/etc/fonts/fonts.conf")); - XmlElement* const fontsInfo = fontsConfig.getDocumentElement(); + unsigned char* stateProp; + unsigned long nitems, bytesLeft; + Atom actualType; + int actualFormat; - if (fontsInfo != 0) - { - forEachXmlChildElementWithTagName (*fontsInfo, e, T("dir")) - { - fontDirs.add (e->getAllSubText().trim()); - } + if (XGetWindowProperty (display, windowH, wm_State, 0, 64, False, + wm_State, &actualType, &actualFormat, &nitems, &bytesLeft, + &stateProp) == Success + && actualType == wm_State + && actualFormat == 32 + && nitems > 0) + { + if (((unsigned long*) stateProp)[0] == IconicState) + minimised = true; - delete fontsInfo; - } + XFree (stateProp); } - if (fontDirs.size() == 0) - fontDirs.add ("/usr/X11R6/lib/X11/fonts"); - - for (int i = 0; i < fontDirs.size(); ++i) - enumerateFaces (fontDirs[i]); + return minimised; } - ~FreeTypeInterface() throw() + void setFullScreen (const bool shouldBeFullScreen) { - if (lastFace != 0) - FT_Done_Face (lastFace); + Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) - if (ftLib != 0) - FT_Done_FreeType (ftLib); + setMinimised (false); - clearSingletonInstance(); + if (fullScreen != shouldBeFullScreen) + { + if (shouldBeFullScreen) + r = Desktop::getInstance().getMainMonitorArea(); + + if (! r.isEmpty()) + setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); + + getComponent()->repaint(); + } } - FreeTypeFontFace* findOrCreate (const String& familyName, - const bool create = false) throw() + bool isFullScreen() const { - for (int i = 0; i < faces.size(); i++) - if (faces[i]->getFamilyName() == familyName) - return faces[i]; + return fullScreen; + } - if (! create) - return NULL; + bool isChildWindowOf (Window possibleParent) const + { + Window* windowList = 0; + uint32 windowListSize = 0; + Window parent, root; - FreeTypeFontFace* newFace = new FreeTypeFontFace (familyName); - faces.add (newFace); + if (XQueryTree (display, windowH, &root, &parent, &windowList, &windowListSize) != 0) + { + if (windowList != 0) + XFree (windowList); - return newFace; + return parent == possibleParent; + } + + return false; } - // Enumerate all font faces available in a given directory - void enumerateFaces (const String& path) throw() + bool isFrontWindow() const { - File dirPath (path); - if (path.isEmpty() || ! dirPath.isDirectory()) - return; + Window* windowList = 0; + uint32 windowListSize = 0; + bool result = false; - DirectoryIterator di (dirPath, true); + Window parent, root = RootWindow (display, DefaultScreen (display)); - while (di.next()) + if (XQueryTree (display, root, &root, &parent, &windowList, &windowListSize) != 0) { - File possible (di.getFile()); - - if (possible.hasFileExtension (T("ttf")) - || possible.hasFileExtension (T("pfb")) - || possible.hasFileExtension (T("pcf"))) + for (int i = windowListSize; --i >= 0;) { - FT_Face face; - int faceIndex = 0; - int numFaces = 0; + LinuxComponentPeer* const peer = LinuxComponentPeer::getPeerFor (windowList[i]); - do + if (peer != 0) { - if (FT_New_Face (ftLib, - possible.getFullPathName(), - faceIndex, - &face) == 0) - { - if (faceIndex == 0) - numFaces = face->num_faces; - - if ((face->face_flags & FT_FACE_FLAG_SCALABLE) != 0) - { - FreeTypeFontFace* const newFace = findOrCreate (face->family_name, true); - int style = (int) FreeTypeFontFace::Plain; + result = (peer == this); + break; + } + } + } - if ((face->style_flags & FT_STYLE_FLAG_BOLD) != 0) - style |= (int) FreeTypeFontFace::Bold; + if (windowList != 0) + XFree (windowList); - if ((face->style_flags & FT_STYLE_FLAG_ITALIC) != 0) - style |= (int) FreeTypeFontFace::Italic; + return result; + } - newFace->setFileName (possible.getFullPathName(), faceIndex, (FreeTypeFontFace::FontStyle) style); + bool contains (int x, int y, bool trueIfInAChildWindow) const + { + jassert (x >= 0 && y >= 0 && x < ww && y < wh); // should only be called for points that are actually inside the bounds - if ((face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0) - newFace->setMonospaced (true); - else - newFace->setMonospaced (false); + if (((unsigned int) x) >= (unsigned int) ww + || ((unsigned int) y) >= (unsigned int) wh) + return false; - // Surely there must be a better way to do this? - if (String (face->family_name).containsIgnoreCase (T("Sans")) - || String (face->family_name).containsIgnoreCase (T("Verdana")) - || String (face->family_name).containsIgnoreCase (T("Arial"))) - { - newFace->setSerif (false); - } - else - { - newFace->setSerif (true); - } - } + bool inFront = false; - FT_Done_Face (face); - } + for (int i = 0; i < Desktop::getInstance().getNumComponents(); ++i) + { + Component* const c = Desktop::getInstance().getComponent (i); - ++faceIndex; + if (inFront) + { + if (c->contains (x + wx - c->getScreenX(), + y + wy - c->getScreenY())) + { + return false; } - while (faceIndex < numFaces); + } + else if (c == getComponent()) + { + inFront = true; } } - } - // Create a FreeType face object for a given font - FT_Face createFT_Face (const String& fontName, - const bool bold, - const bool italic) throw() - { - FT_Face face = NULL; + if (trueIfInAChildWindow) + return true; - if (fontName == lastFontName && bold == lastBold && italic == lastItalic) + ::Window root, child; + unsigned int bw, depth; + int wx, wy, w, h; + + if (! XGetGeometry (display, (::Drawable) windowH, &root, + &wx, &wy, (unsigned int*) &w, (unsigned int*) &h, + &bw, &depth)) { - face = lastFace; + return false; } - else + + if (! XTranslateCoordinates (display, windowH, windowH, x, y, &wx, &wy, &child)) + return false; + + return child == None; + } + + const BorderSize getFrameSize() const + { + return BorderSize(); + } + + bool setAlwaysOnTop (bool alwaysOnTop) + { + if (windowH != 0) { - if (lastFace) - { - FT_Done_Face (lastFace); - lastFace = NULL; - } + const bool wasVisible = component->isVisible(); - lastFontName = fontName; - lastBold = bold; - lastItalic = italic; + if (wasVisible) + setVisible (false); // doesn't always seem to work if the window is visible when this is done.. - FreeTypeFontFace* const ftFace = findOrCreate (fontName); + XSetWindowAttributes swa; + swa.override_redirect = alwaysOnTop ? True : False; - if (ftFace != 0) - { - int style = (int) FreeTypeFontFace::Plain; + XChangeWindowAttributes (display, windowH, CWOverrideRedirect, &swa); - if (bold) - style |= (int) FreeTypeFontFace::Bold; + if (wasVisible) + setVisible (true); + } - if (italic) - style |= (int) FreeTypeFontFace::Italic; + return true; + } - int faceIndex; - String fileName (ftFace->getFileName (style, &faceIndex)); + void toFront (bool makeActive) + { + if (makeActive) + { + setVisible (true); + grabFocus(); + } - if (fileName.isEmpty()) - { - style ^= (int) FreeTypeFontFace::Bold; + XEvent ev; + ev.xclient.type = ClientMessage; + ev.xclient.serial = 0; + ev.xclient.send_event = True; + ev.xclient.message_type = wm_ActiveWin; + ev.xclient.window = windowH; + ev.xclient.format = 32; + ev.xclient.data.l[0] = 2; + ev.xclient.data.l[1] = CurrentTime; + ev.xclient.data.l[2] = 0; + ev.xclient.data.l[3] = 0; + ev.xclient.data.l[4] = 0; - fileName = ftFace->getFileName (style, &faceIndex); + XSendEvent (display, RootWindow (display, DefaultScreen (display)), + False, + SubstructureRedirectMask | SubstructureNotifyMask, + &ev); - if (fileName.isEmpty()) - { - style ^= (int) FreeTypeFontFace::Bold; - style ^= (int) FreeTypeFontFace::Italic; + XWindowAttributes attr; + XGetWindowAttributes (display, windowH, &attr); - fileName = ftFace->getFileName (style, &faceIndex); + if (attr.override_redirect) + XRaiseWindow (display, windowH); - if (! fileName.length()) - { - style ^= (int) FreeTypeFontFace::Bold; - fileName = ftFace->getFileName (style, &faceIndex); - } - } - } + XSync (display, False); - if (! FT_New_Face (ftLib, (const char*) fileName, faceIndex, &lastFace)) - { - face = lastFace; + handleBroughtToFront(); + } - // If there isn't a unicode charmap then select the first one. - if (FT_Select_Charmap (face, ft_encoding_unicode)) - FT_Set_Charmap (face, face->charmaps[0]); - } - } + void toBehind (ComponentPeer* other) + { + LinuxComponentPeer* const otherPeer = dynamic_cast (other); + jassert (otherPeer != 0); // wrong type of window? + + if (otherPeer != 0) + { + setMinimised (false); + + Window newStack[] = { otherPeer->windowH, windowH }; + + XRestackWindows (display, newStack, 2); } - return face; } - bool addGlyph (FT_Face face, Typeface& dest, uint32 character) throw() + bool isFocused() const { - const unsigned int glyphIndex = FT_Get_Char_Index (face, character); - const float height = (float) (face->ascender - face->descender); - const float scaleX = 1.0f / height; - const float scaleY = -1.0f / height; - Path destShape; + int revert; + Window focusedWindow = 0; + XGetInputFocus (display, &focusedWindow, &revert); - #define CONVERTX(val) (scaleX * (val).x) - #define CONVERTY(val) (scaleY * (val).y) + return focusedWindow == windowH; + } - if (FT_Load_Glyph (face, glyphIndex, FT_LOAD_NO_SCALE - | FT_LOAD_NO_BITMAP - | FT_LOAD_IGNORE_TRANSFORM) != 0 - || face->glyph->format != ft_glyph_format_outline) + void grabFocus() + { + XWindowAttributes atts; + + if (windowH != 0 + && XGetWindowAttributes (display, windowH, &atts) + && atts.map_state == IsViewable + && ! isFocused()) { - return false; + XSetInputFocus (display, windowH, RevertToParent, CurrentTime); + isActiveApplication = true; } + } - const FT_Outline* const outline = &face->glyph->outline; - const short* const contours = outline->contours; - const char* const tags = outline->tags; - FT_Vector* const points = outline->points; + void textInputRequired (int /*x*/, int /*y*/) + { + } - for (int c = 0; c < outline->n_contours; c++) + void repaint (int x, int y, int w, int h) + { + if (Rectangle::intersectRectangles (x, y, w, h, + 0, 0, + getComponent()->getWidth(), + getComponent()->getHeight())) { - const int startPoint = (c == 0) ? 0 : contours [c - 1] + 1; - const int endPoint = contours[c]; + repainter->repaint (x, y, w, h); + } + } - for (int p = startPoint; p <= endPoint; p++) - { - const float x = CONVERTX (points[p]); - const float y = CONVERTY (points[p]); - - if (p == startPoint) - { - if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) - { - float x2 = CONVERTX (points [endPoint]); - float y2 = CONVERTY (points [endPoint]); - - if (FT_CURVE_TAG (tags[endPoint]) != FT_Curve_Tag_On) - { - x2 = (x + x2) * 0.5f; - y2 = (y + y2) * 0.5f; - } - - destShape.startNewSubPath (x2, y2); - } - else - { - destShape.startNewSubPath (x, y); - } - } + void performAnyPendingRepaintsNow() + { + repainter->performAnyPendingRepaintsNow(); + } - if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_On) - { - if (p != startPoint) - destShape.lineTo (x, y); - } - else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Conic) - { - const int nextIndex = (p == endPoint) ? startPoint : p + 1; - float x2 = CONVERTX (points [nextIndex]); - float y2 = CONVERTY (points [nextIndex]); + void setIcon (const Image& newIcon) + { + const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2; + unsigned long* const data = (unsigned long*) juce_malloc (dataSize * sizeof (uint32)); - if (FT_CURVE_TAG (tags [nextIndex]) == FT_Curve_Tag_Conic) - { - x2 = (x + x2) * 0.5f; - y2 = (y + y2) * 0.5f; - } - else - { - ++p; - } + int index = 0; + data[index++] = newIcon.getWidth(); + data[index++] = newIcon.getHeight(); - destShape.quadraticTo (x, y, x2, y2); - } - else if (FT_CURVE_TAG (tags[p]) == FT_Curve_Tag_Cubic) - { - if (p >= endPoint) - return false; + for (int y = 0; y < newIcon.getHeight(); ++y) + for (int x = 0; x < newIcon.getWidth(); ++x) + data[index++] = newIcon.getPixelAt (x, y).getARGB(); - const int next1 = p + 1; - const int next2 = (p == (endPoint - 1)) ? startPoint : p + 2; + XChangeProperty (display, windowH, + XInternAtom (display, "_NET_WM_ICON", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*) data, dataSize); - const float x2 = CONVERTX (points [next1]); - const float y2 = CONVERTY (points [next1]); - const float x3 = CONVERTX (points [next2]); - const float y3 = CONVERTY (points [next2]); + juce_free (data); - if (FT_CURVE_TAG (tags[next1]) != FT_Curve_Tag_Cubic - || FT_CURVE_TAG (tags[next2]) != FT_Curve_Tag_On) - return false; + deleteIconPixmaps(); - destShape.cubicTo (x, y, x2, y2, x3, y3); - p += 2; - } - } + XWMHints* wmHints = XGetWMHints (display, windowH); - destShape.closeSubPath(); - } + if (wmHints == 0) + wmHints = XAllocWMHints(); - dest.addGlyph (character, destShape, face->glyph->metrics.horiAdvance/height); + wmHints->flags |= IconPixmapHint | IconMaskHint; + wmHints->icon_pixmap = juce_createColourPixmapFromImage (display, newIcon); + wmHints->icon_mask = juce_createMaskPixmapFromImage (display, newIcon); - if ((face->face_flags & FT_FACE_FLAG_KERNING) != 0) - addKerning (face, dest, character, glyphIndex); + XSetWMHints (display, windowH, wmHints); + XFree (wmHints); - return true; + XSync (display, False); } - void addKerning (FT_Face face, Typeface& dest, const uint32 character, const uint32 glyphIndex) throw() + void deleteIconPixmaps() { - const float height = (float) (face->ascender - face->descender); - - uint32 rightGlyphIndex; - uint32 rightCharCode = FT_Get_First_Char (face, &rightGlyphIndex); + XWMHints* wmHints = XGetWMHints (display, windowH); - while (rightGlyphIndex != 0) + if (wmHints != 0) { - FT_Vector kerning; + if ((wmHints->flags & IconPixmapHint) != 0) + { + wmHints->flags &= ~IconPixmapHint; + XFreePixmap (display, wmHints->icon_pixmap); + } - if (FT_Get_Kerning (face, glyphIndex, rightGlyphIndex, ft_kerning_unscaled, &kerning) == 0) + if ((wmHints->flags & IconMaskHint) != 0) { - if (kerning.x != 0) - dest.addKerningPair (character, rightCharCode, kerning.x / height); + wmHints->flags &= ~IconMaskHint; + XFreePixmap (display, wmHints->icon_mask); } - rightCharCode = FT_Get_Next_Char (face, rightCharCode, &rightGlyphIndex); + XSetWMHints (display, windowH, wmHints); + XFree (wmHints); } } - // Add a glyph to a font - bool addGlyphToFont (const uint32 character, - const tchar* fontName, bool bold, bool italic, - Typeface& dest) throw() + void handleWindowMessage (XEvent* event) { - FT_Face face = createFT_Face (fontName, bold, italic); - - if (face != 0) - return addGlyph (face, dest, character); - - return false; - } + switch (event->xany.type) + { + case 2: // 'KeyPress' + { + XKeyEvent* const keyEvent = (XKeyEvent*) &event->xkey; + updateKeyStates (keyEvent->keycode, true); - // Create a Typeface object for given name/style - bool createTypeface (const String& fontName, - const bool bold, const bool italic, - Typeface& dest, - const bool addAllGlyphs) throw() - { - dest.clear(); - dest.setName (fontName); - dest.setBold (bold); - dest.setItalic (italic); + char utf8 [64]; + zeromem (utf8, sizeof (utf8)); + KeySym sym; + XLookupString (keyEvent, utf8, sizeof (utf8), &sym, 0); - FT_Face face = createFT_Face (fontName, bold, italic); + const juce_wchar unicodeChar = *(const juce_wchar*) String::fromUTF8 ((const uint8*) utf8, sizeof (utf8) - 1); + int keyCode = (int) unicodeChar; - if (face == 0) - { -#ifdef JUCE_DEBUG - String msg (T("Failed to create typeface: ")); - msg << fontName << " " << (bold ? 'B' : ' ') << (italic ? 'I' : ' '); - DBG (msg); -#endif - return face; - } + if (keyCode < 0x20) + keyCode = XKeycodeToKeysym (display, keyEvent->keycode, + (currentModifiers & ModifierKeys::shiftModifier) != 0 ? 1 : 0); - const float height = (float) (face->ascender - face->descender); + const int oldMods = currentModifiers; + bool keyPressed = false; - dest.setAscent (face->ascender / height); - dest.setDefaultCharacter (L' '); + const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, true); - if (addAllGlyphs) - { - uint32 glyphIndex; - uint32 charCode = FT_Get_First_Char (face, &glyphIndex); + if ((sym & 0xff00) == 0xff00) + { + // Translate keypad + if (sym == XK_KP_Divide) + keyCode = XK_slash; + else if (sym == XK_KP_Multiply) + keyCode = XK_asterisk; + else if (sym == XK_KP_Subtract) + keyCode = XK_hyphen; + else if (sym == XK_KP_Add) + keyCode = XK_plus; + else if (sym == XK_KP_Enter) + keyCode = XK_Return; + else if (sym == XK_KP_Decimal) + keyCode = numLock ? XK_period : XK_Delete; + else if (sym == XK_KP_0) + keyCode = numLock ? XK_0 : XK_Insert; + else if (sym == XK_KP_1) + keyCode = numLock ? XK_1 : XK_End; + else if (sym == XK_KP_2) + keyCode = numLock ? XK_2 : XK_Down; + else if (sym == XK_KP_3) + keyCode = numLock ? XK_3 : XK_Page_Down; + else if (sym == XK_KP_4) + keyCode = numLock ? XK_4 : XK_Left; + else if (sym == XK_KP_5) + keyCode = XK_5; + else if (sym == XK_KP_6) + keyCode = numLock ? XK_6 : XK_Right; + else if (sym == XK_KP_7) + keyCode = numLock ? XK_7 : XK_Home; + else if (sym == XK_KP_8) + keyCode = numLock ? XK_8 : XK_Up; + else if (sym == XK_KP_9) + keyCode = numLock ? XK_9 : XK_Page_Up; - while (glyphIndex != 0) - { - addGlyph (face, dest, charCode); - charCode = FT_Get_Next_Char (face, charCode, &glyphIndex); - } - } + switch (sym) + { + case XK_Left: + case XK_Right: + case XK_Up: + case XK_Down: + case XK_Page_Up: + case XK_Page_Down: + case XK_End: + case XK_Home: + case XK_Delete: + case XK_Insert: + keyPressed = true; + keyCode = (sym & 0xff) | extendedKeyModifier; + break; + case XK_Tab: + case XK_Return: + case XK_Escape: + case XK_BackSpace: + keyPressed = true; + keyCode &= 0xff; + break; + default: + { + if (sym >= XK_F1 && sym <= XK_F16) + { + keyPressed = true; + keyCode = (sym & 0xff) | extendedKeyModifier; + } + break; + } + } + } - return true; - } + if (utf8[0] != 0 || ((sym & 0xff00) == 0 && sym >= 8)) + keyPressed = true; - void getFamilyNames (StringArray& familyNames) const throw() - { - for (int i = 0; i < faces.size(); i++) - familyNames.add (faces[i]->getFamilyName()); - } + if (oldMods != currentModifiers) + handleModifierKeysChange(); - void getMonospacedNames (StringArray& monoSpaced) const throw() - { - for (int i = 0; i < faces.size(); i++) - if (faces[i]->getMonospaced()) - monoSpaced.add (faces[i]->getFamilyName()); - } + if (keyDownChange) + handleKeyUpOrDown (true); - void getSerifNames (StringArray& serif) const throw() - { - for (int i = 0; i < faces.size(); i++) - if (faces[i]->getSerif()) - serif.add (faces[i]->getFamilyName()); - } + if (keyPressed) + handleKeyPress (keyCode, unicodeChar); - void getSansSerifNames (StringArray& sansSerif) const throw() - { - for (int i = 0; i < faces.size(); i++) - if (! faces[i]->getSerif()) - sansSerif.add (faces[i]->getFamilyName()); - } + break; + } - juce_DeclareSingleton_SingleThreaded_Minimal (FreeTypeInterface) + case KeyRelease: + { + const XKeyEvent* const keyEvent = (const XKeyEvent*) &event->xkey; + updateKeyStates (keyEvent->keycode, false); -private: + KeySym sym = XKeycodeToKeysym (display, keyEvent->keycode, 0); - FT_Library ftLib; - FT_Face lastFace; - String lastFontName; - bool lastBold, lastItalic; - OwnedArray faces; -}; + const int oldMods = currentModifiers; + const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, false); -juce_ImplementSingleton_SingleThreaded (FreeTypeInterface) + if (oldMods != currentModifiers) + handleModifierKeysChange(); -void Typeface::initialiseTypefaceCharacteristics (const String& fontName, - bool bold, bool italic, - bool addAllGlyphsToFont) throw() -{ - FreeTypeInterface::getInstance() - ->createTypeface (fontName, bold, italic, *this, addAllGlyphsToFont); -} + if (keyDownChange) + handleKeyUpOrDown (false); -bool Typeface::findAndAddSystemGlyph (juce_wchar character) throw() -{ - return FreeTypeInterface::getInstance() - ->addGlyphToFont (character, getName(), isBold(), isItalic(), *this); -} + break; + } -const StringArray Font::findAllTypefaceNames() throw() -{ - StringArray s; - FreeTypeInterface::getInstance()->getFamilyNames (s); - s.sort (true); - return s; -} + case ButtonPress: + { + const XButtonPressedEvent* const buttonPressEvent = (const XButtonPressedEvent*) &event->xbutton; -static const String pickBestFont (const StringArray& names, - const char* const choicesString) -{ - StringArray choices; - choices.addTokens (String (choicesString), T(","), 0); - choices.trim(); - choices.removeEmptyStrings(); + bool buttonMsg = false; + bool wheelUpMsg = false; + bool wheelDownMsg = false; - int i, j; - for (j = 0; j < choices.size(); ++j) - if (names.contains (choices[j], true)) - return choices[j]; + const int map = pointerMap [buttonPressEvent->button - Button1]; - for (j = 0; j < choices.size(); ++j) - for (i = 0; i < names.size(); i++) - if (names[i].startsWithIgnoreCase (choices[j])) - return names[i]; + if (map == LeftButton) + { + currentModifiers |= ModifierKeys::leftButtonModifier; + buttonMsg = true; + } + else if (map == RightButton) + { + currentModifiers |= ModifierKeys::rightButtonModifier; + buttonMsg = true; + } + else if (map == MiddleButton) + { + currentModifiers |= ModifierKeys::middleButtonModifier; + buttonMsg = true; + } + else if (map == WheelUp) + { + wheelUpMsg = true; + } + else if (map == WheelDown) + { + wheelDownMsg = true; + } - for (j = 0; j < choices.size(); ++j) - for (i = 0; i < names.size(); i++) - if (names[i].containsIgnoreCase (choices[j])) - return names[i]; + updateKeyModifiers (buttonPressEvent->state); - return names[0]; -} + if (buttonMsg) + { + toFront (true); + handleMouseDown (buttonPressEvent->x, buttonPressEvent->y, + getEventTime (buttonPressEvent->time)); + } + else if (wheelUpMsg || wheelDownMsg) + { + handleMouseWheel (0, wheelDownMsg ? -84 : 84, + getEventTime (buttonPressEvent->time)); + } -static const String linux_getDefaultSansSerifFontName() -{ - StringArray allFonts; - FreeTypeInterface::getInstance()->getSansSerifNames (allFonts); + lastMousePosX = lastMousePosY = 0x100000; + break; + } - return pickBestFont (allFonts, "Verdana, Bitstream Vera Sans, Luxi Sans, Sans"); -} + case ButtonRelease: + { + const XButtonReleasedEvent* const buttonRelEvent = (const XButtonReleasedEvent*) &event->xbutton; -static const String linux_getDefaultSerifFontName() -{ - StringArray allFonts; - FreeTypeInterface::getInstance()->getSerifNames (allFonts); + const int oldModifiers = currentModifiers; + const int map = pointerMap [buttonRelEvent->button - Button1]; - return pickBestFont (allFonts, "Bitstream Vera Serif, Times, Nimbus Roman, Serif"); -} + if (map == LeftButton) + currentModifiers &= ~ModifierKeys::leftButtonModifier; + else if (map == RightButton) + currentModifiers &= ~ModifierKeys::rightButtonModifier; + else if (map == MiddleButton) + currentModifiers &= ~ModifierKeys::middleButtonModifier; -static const String linux_getDefaultMonospacedFontName() -{ - StringArray allFonts; - FreeTypeInterface::getInstance()->getMonospacedNames (allFonts); + updateKeyModifiers (buttonRelEvent->state); - return pickBestFont (allFonts, "Bitstream Vera Sans Mono, Courier, Sans Mono, Mono"); -} + handleMouseUp (oldModifiers, + buttonRelEvent->x, buttonRelEvent->y, + getEventTime (buttonRelEvent->time)); -void Typeface::getDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() -{ - defaultSans = linux_getDefaultSansSerifFontName(); - defaultSerif = linux_getDefaultSerifFontName(); - defaultFixed = linux_getDefaultMonospacedFontName(); -} + lastMousePosX = lastMousePosY = 0x100000; + break; + } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_Fonts.cpp *********/ + case MotionNotify: + { + const XPointerMovedEvent* const movedEvent = (const XPointerMovedEvent*) &event->xmotion; -/********* Start of inlined file: juce_linux_Messaging.cpp *********/ + updateKeyModifiers (movedEvent->state); -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) + int x, y, mouseMods; + getMousePos (x, y, mouseMods); -/* - This file contains macros that enable/disable various JUCE features. -*/ + if (lastMousePosX != x || lastMousePosY != y) + { + lastMousePosX = x; + lastMousePosY = y; -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif + if (parentWindow != 0 && (styleFlags & windowHasTitleBar) == 0) + { + Window wRoot = 0, wParent = 0; + Window* wChild = 0; + unsigned int numChildren; + XQueryTree (display, windowH, &wRoot, &wParent, &wChild, &numChildren); -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif + if (wParent != 0 + && wParent != windowH + && wParent != wRoot) + { + parentWindow = wParent; + updateBounds(); + x -= getScreenX(); + y -= getScreenY(); + } + else + { + parentWindow = 0; + x -= getScreenX(); + y -= getScreenY(); + } + } + else + { + x -= getScreenX(); + y -= getScreenY(); + } -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. + if ((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0) + handleMouseMove (x, y, getEventTime (movedEvent->time)); + else + handleMouseDrag (x, y, getEventTime (movedEvent->time)); + } - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. + break; + } - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif + case EnterNotify: + { + lastMousePosX = lastMousePosY = 0x100000; + const XEnterWindowEvent* const enterEvent = (const XEnterWindowEvent*) &event->xcrossing; -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. + if ((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0 + && ! entered) + { + updateKeyModifiers (enterEvent->state); - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif + handleMouseEnter (enterEvent->x, enterEvent->y, getEventTime (enterEvent->time)); -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif + entered = true; + } -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. + break; + } - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. + case LeaveNotify: + { + const XLeaveWindowEvent* const leaveEvent = (const XLeaveWindowEvent*) &event->xcrossing; - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif + // Suppress the normal leave if we've got a pointer grab, or if + // it's a bogus one caused by clicking a mouse button when running + // in a Window manager + if (((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0 + && leaveEvent->mode == NotifyNormal) + || leaveEvent->mode == NotifyUngrab) + { + updateKeyModifiers (leaveEvent->state); -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + handleMouseExit (leaveEvent->x, leaveEvent->y, getEventTime (leaveEvent->time)); -/** These flags enable the Ogg-Vorbis and Flac audio formats. + entered = false; + } - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif + break; + } -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + case FocusIn: + { + isActiveApplication = true; + if (isFocused()) + handleFocusGain(); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + break; + } -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif + case FocusOut: + { + isActiveApplication = false; + if (! isFocused()) + handleFocusLoss(); -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. + break; + } - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif + case Expose: + { + // Batch together all pending expose events + XExposeEvent* exposeEvent = (XExposeEvent*) &event->xexpose; + XEvent nextEvent; -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif + if (exposeEvent->window != windowH) + { + Window child; + XTranslateCoordinates (display, exposeEvent->window, windowH, + exposeEvent->x, exposeEvent->y, &exposeEvent->x, &exposeEvent->y, + &child); + } -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif + repaint (exposeEvent->x, exposeEvent->y, + exposeEvent->width, exposeEvent->height); -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif + while (XEventsQueued (display, QueuedAfterFlush) > 0) + { + XPeekEvent (display, (XEvent*) &nextEvent); + if (nextEvent.type != Expose || nextEvent.xany.window != event->xany.window) + break; -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif + XNextEvent (display, (XEvent*) &nextEvent); + XExposeEvent* nextExposeEvent = (XExposeEvent*) &nextEvent.xexpose; + repaint (nextExposeEvent->x, nextExposeEvent->y, + nextExposeEvent->width, nextExposeEvent->height); + } -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif + break; + } -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif + case CirculateNotify: + case CreateNotify: + case DestroyNotify: + // Think we can ignore these + break; -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif + case ConfigureNotify: + { + updateBounds(); + updateBorderSize(); + handleMovedOrResized(); -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif + // if the native title bar is dragged, need to tell any active menus, etc. + if ((styleFlags & windowHasTitleBar) != 0 + && component->isCurrentlyBlockedByAnotherModalComponent()) + { + Component* const currentModalComp = Component::getCurrentlyModalComponent(); -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif + if (currentModalComp != 0) + currentModalComp->inputAttemptWhenModal(); + } -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + XConfigureEvent* const confEvent = (XConfigureEvent*) &event->xconfigure; -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + if (confEvent->window == windowH + && confEvent->above != 0 + && isFrontWindow()) + { + handleBroughtToFront(); + } -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + break; + } -/** Enable this to add extra memory-leak info to the new and delete operators. + case ReparentNotify: + case GravityNotify: + { + parentWindow = 0; + Window wRoot = 0; + Window* wChild = 0; + unsigned int numChildren; + XQueryTree (display, windowH, &wRoot, &parentWindow, &wChild, &numChildren); - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif + if (parentWindow == windowH || parentWindow == wRoot) + parentWindow = 0; -/** Enable this to turn on juce's internal catching of exceptions. + updateBounds(); + updateBorderSize(); + handleMovedOrResized(); + break; + } - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + case MapNotify: + mapped = true; + handleBroughtToFront(); + break; -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + case UnmapNotify: + mapped = false; + break; -#endif -/********* End of inlined file: juce_Config.h *********/ + case MappingNotify: + { + XMappingEvent* mappingEvent = (XMappingEvent*) &event->xmapping; -#include -#include -#include -#include -#include -#include + if (mappingEvent->request != MappingPointer) + { + // Deal with modifier/keyboard mapping + XRefreshKeyboardMapping (mappingEvent); + getModifierMapping(); + } -BEGIN_JUCE_NAMESPACE + break; + } -#ifdef JUCE_DEBUG - #define JUCE_DEBUG_XERRORS 1 -#endif + case ClientMessage: + { + const XClientMessageEvent* const clientMsg = (const XClientMessageEvent*) &event->xclient; -Display* display = 0; // This is also referenced from WindowDriver.cpp -static Window juce_messageWindowHandle = None; + if (clientMsg->message_type == wm_Protocols && clientMsg->format == 32) + { + const Atom atom = (Atom) clientMsg->data.l[0]; -#define SpecialAtom "JUCESpecialAtom" -#define BroadcastAtom "JUCEBroadcastAtom" -#define SpecialCallbackAtom "JUCESpecialCallbackAtom" + if (atom == wm_ProtocolList [TAKE_FOCUS]) + { + XWindowAttributes atts; -static Atom specialId; -static Atom broadcastId; -static Atom specialCallbackId; + if (clientMsg->window != 0 + && XGetWindowAttributes (display, clientMsg->window, &atts)) + { + if (atts.map_state == IsViewable) + XSetInputFocus (display, clientMsg->window, RevertToParent, clientMsg->data.l[1]); + } + } + else if (atom == wm_ProtocolList [DELETE_WINDOW]) + { + handleUserClosingWindow(); + } + } + else if (clientMsg->message_type == XA_XdndEnter) + { + handleDragAndDropEnter (clientMsg); + } + else if (clientMsg->message_type == XA_XdndLeave) + { + resetDragAndDrop(); + } + else if (clientMsg->message_type == XA_XdndPosition) + { + handleDragAndDropPosition (clientMsg); + } + else if (clientMsg->message_type == XA_XdndDrop) + { + handleDragAndDropDrop (clientMsg); + } + else if (clientMsg->message_type == XA_XdndStatus) + { + handleDragAndDropStatus (clientMsg); + } + else if (clientMsg->message_type == XA_XdndFinished) + { + resetDragAndDrop(); + } -// This is referenced from WindowDriver.cpp -XContext improbableNumber; + break; + } -// Defined in WindowDriver.cpp -extern void juce_windowMessageReceive (XEvent* event); + case SelectionNotify: + handleDragAndDropSelection (event); + break; -struct MessageThreadFuncCall -{ - MessageCallbackFunction* func; - void* parameter; - void* result; - CriticalSection lock; - WaitableEvent event; -}; + case SelectionClear: + case SelectionRequest: + break; -static bool errorCondition = false; -static XErrorHandler oldErrorHandler = (XErrorHandler) 0; -static XIOErrorHandler oldIOErrorHandler = (XIOErrorHandler) 0; + default: + break; + } + } -// (defined in another file to avoid problems including certain headers in this one) -extern bool juce_isRunningAsApplication(); + void showMouseCursor (Cursor cursor) throw() + { + XDefineCursor (display, windowH, cursor); + } -// Usually happens when client-server connection is broken -static int ioErrorHandler (Display* display) -{ - DBG (T("ERROR: connection to X server broken.. terminating.")); + void setTaskBarIcon (const Image& image) + { + deleteTaskBarIcon(); + taskbarImage = image.createCopy(); - errorCondition = true; + Screen* const screen = XDefaultScreenOfDisplay (display); + const int screenNumber = XScreenNumberOfScreen (screen); - if (juce_isRunningAsApplication()) - Process::terminate(); + char screenAtom[32]; + snprintf (screenAtom, sizeof (screenAtom), "_NET_SYSTEM_TRAY_S%d", screenNumber); + Atom selectionAtom = XInternAtom (display, screenAtom, false); - return 0; -} + XGrabServer (display); + Window managerWin = XGetSelectionOwner (display, selectionAtom); -// A protocol error has occurred -static int errorHandler (Display* display, XErrorEvent* event) -{ -#ifdef JUCE_DEBUG_XERRORS - char errorStr[64] = { 0 }; - char requestStr[64] = { 0 }; + if (managerWin != None) + XSelectInput (display, managerWin, StructureNotifyMask); - XGetErrorText (display, event->error_code, errorStr, 64); + XUngrabServer (display); + XFlush (display); - XGetErrorDatabaseText (display, - "XRequest", - (const char*) String (event->request_code), - "Unknown", - requestStr, - 64); + if (managerWin != None) + { + XEvent ev; + zerostruct (ev); + ev.xclient.type = ClientMessage; + ev.xclient.window = managerWin; + ev.xclient.message_type = XInternAtom (display, "_NET_SYSTEM_TRAY_OPCODE", False); + ev.xclient.format = 32; + ev.xclient.data.l[0] = CurrentTime; + ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK; + ev.xclient.data.l[2] = windowH; + ev.xclient.data.l[3] = 0; + ev.xclient.data.l[4] = 0; - DBG (T("ERROR: X returned ") + String (errorStr) + T(" for operation ") + String (requestStr)); -#endif + XSendEvent (display, managerWin, False, NoEventMask, &ev); + XSync (display, False); + } - return 0; -} + // For older KDE's ... + long atomData = 1; + Atom trayAtom = XInternAtom (display, "KWM_DOCKWINDOW", false); + XChangeProperty (display, windowH, trayAtom, trayAtom, 32, PropModeReplace, (unsigned char*) &atomData, 1); -static bool breakIn = false; + // 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); -// Breakin from keyboard -static void sig_handler (int sig) -{ - if (sig == SIGINT) - { - breakIn = true; - return; + // 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); } - static bool reentrant = false; - - if (reentrant == false) + void deleteTaskBarIcon() { - reentrant = true; + deleteAndZero (taskbarImage); + } - // Illegal instruction - fflush (stdout); - Logger::outputDebugString ("ERROR: Program executed illegal instruction.. terminating"); + const Image* getTaskbarIcon() const throw() { return taskbarImage; } - errorCondition = true; + juce_UseDebuggingNewOperator - if (juce_isRunningAsApplication()) - Process::terminate(); - } - else - { - if (juce_isRunningAsApplication()) - exit(0); - } -} + bool dontRepaint; -void MessageManager::doPlatformSpecificInitialisation() -{ - // Initialise xlib for multiple thread support - static bool initThreadCalled = false; +private: - if (! initThreadCalled) + class LinuxRepaintManager : public Timer { - if (! XInitThreads()) + public: + LinuxRepaintManager (LinuxComponentPeer* const peer_) + : peer (peer_), + image (0), + lastTimeImageUsed (0) { - // This is fatal! Print error and closedown - Logger::outputDebugString ("Failed to initialise xlib thread support."); - - if (juce_isRunningAsApplication()) - Process::terminate(); +#if JUCE_USE_XSHM + useARGBImagesForRendering = isShmAvailable(); - return; - } + if (useARGBImagesForRendering) + { + XShmSegmentInfo segmentinfo; - initThreadCalled = true; - } + XImage* const testImage + = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), + 24, ZPixmap, 0, &segmentinfo, 64, 64); - // This is called if the client/server connection is broken - oldIOErrorHandler = XSetIOErrorHandler (ioErrorHandler); + useARGBImagesForRendering = (testImage->bits_per_pixel == 32); + XDestroyImage (testImage); + } +#endif + } - // This is called if a protocol error occurs - oldErrorHandler = XSetErrorHandler (errorHandler); + ~LinuxRepaintManager() + { + delete image; + } - // Install signal handler for break-in - struct sigaction saction; - sigset_t maskSet; - sigemptyset (&maskSet); - saction.sa_handler = sig_handler; - saction.sa_mask = maskSet; - saction.sa_flags = 0; - sigaction (SIGINT, &saction, NULL); - -#ifndef _DEBUG - // Setup signal handlers for various fatal errors - sigaction (SIGILL, &saction, NULL); - sigaction (SIGBUS, &saction, NULL); - sigaction (SIGFPE, &saction, NULL); - sigaction (SIGSEGV, &saction, NULL); - sigaction (SIGSYS, &saction, NULL); -#endif - - String displayName (getenv ("DISPLAY")); - if (displayName.isEmpty()) - displayName = T(":0.0"); + void timerCallback() + { + if (! regionsNeedingRepaint.isEmpty()) + { + stopTimer(); + performAnyPendingRepaintsNow(); + } + else if (Time::getApproximateMillisecondCounter() > lastTimeImageUsed + 3000) + { + stopTimer(); + deleteAndZero (image); + } + } - display = XOpenDisplay (displayName); + void repaint (int x, int y, int w, int h) + { + if (! isTimerRunning()) + startTimer (repaintTimerPeriod); - if (display == 0) - { - // This is fatal! Print error and closedown - Logger::outputDebugString ("Failed to open the X display."); + regionsNeedingRepaint.add (x, y, w, h); + } - if (juce_isRunningAsApplication()) - Process::terminate(); + void performAnyPendingRepaintsNow() + { + peer->clearMaskedRegion(); - return; - } + const Rectangle totalArea (regionsNeedingRepaint.getBounds()); - // Get defaults for various properties - int screen = DefaultScreen (display); - Window root = RootWindow (display, screen); - Visual* visual = DefaultVisual (display, screen); + if (! totalArea.isEmpty()) + { + if (image == 0 || image->getWidth() < totalArea.getWidth() + || image->getHeight() < totalArea.getHeight()) + { + delete image; - // Create atoms for our ClientMessages (these cannot be deleted) - specialId = XInternAtom (display, SpecialAtom, false); - broadcastId = XInternAtom (display, BroadcastAtom, false); - specialCallbackId = XInternAtom (display, SpecialCallbackAtom, false); +#if JUCE_USE_XSHM + image = new XBitmapImage (useARGBImagesForRendering ? Image::ARGB + : Image::RGB, +#else + image = new XBitmapImage (Image::RGB, +#endif + (totalArea.getWidth() + 31) & ~31, + (totalArea.getHeight() + 31) & ~31, + false, + peer->depthIs16Bit); + } - // Create a context to store user data associated with Windows we - // create in WindowDriver - improbableNumber = XUniqueContext(); + startTimer (repaintTimerPeriod); - // We're only interested in client messages for this window - // which are always sent - XSetWindowAttributes swa; - swa.event_mask = NoEventMask; + LowLevelGraphicsSoftwareRenderer context (*image); - // Create our message window (this will never be mapped) - juce_messageWindowHandle = XCreateWindow (display, root, - 0, 0, 1, 1, 0, 0, InputOnly, - visual, CWEventMask, &swa); -} + context.setOrigin (-totalArea.getX(), -totalArea.getY()); -void MessageManager::doPlatformSpecificShutdown() -{ - if (errorCondition == false) - { - XDestroyWindow (display, juce_messageWindowHandle); - XCloseDisplay (display); + if (context.reduceClipRegion (regionsNeedingRepaint)) + peer->handlePaint (context); - // reset pointers - juce_messageWindowHandle = 0; - display = 0; + if (! peer->maskedRegion.isEmpty()) + regionsNeedingRepaint.subtract (peer->maskedRegion); - // Restore original error handlers - XSetIOErrorHandler (oldIOErrorHandler); - oldIOErrorHandler = 0; - XSetErrorHandler (oldErrorHandler); - oldErrorHandler = 0; - } -} + for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) + { + const Rectangle& r = *i.getRectangle(); -bool juce_postMessageToSystemQueue (void* message) -{ - if (errorCondition) - return false; + image->blitToWindow (peer->windowH, + r.getX(), r.getY(), r.getWidth(), r.getHeight(), + r.getX() - totalArea.getX(), r.getY() - totalArea.getY()); + } + } - XClientMessageEvent clientMsg; - clientMsg.display = display; - clientMsg.window = juce_messageWindowHandle; - clientMsg.type = ClientMessage; - clientMsg.format = 32; - clientMsg.message_type = specialId; -#if JUCE_64BIT - clientMsg.data.l[0] = (long) (0x00000000ffffffff & (((uint64) message) >> 32)); - clientMsg.data.l[1] = (long) (0x00000000ffffffff & (long) message); -#else - clientMsg.data.l[0] = (long) message; -#endif + regionsNeedingRepaint.clear(); - XSendEvent (display, juce_messageWindowHandle, false, - NoEventMask, (XEvent*) &clientMsg); + lastTimeImageUsed = Time::getApproximateMillisecondCounter(); + startTimer (repaintTimerPeriod); + } - XFlush (display); // This is necessary to ensure the event is delivered + private: + LinuxComponentPeer* const peer; + XBitmapImage* image; + uint32 lastTimeImageUsed; + RectangleList regionsNeedingRepaint; - return true; -} +#if JUCE_USE_XSHM + bool useARGBImagesForRendering; +#endif + LinuxRepaintManager (const LinuxRepaintManager&); + const LinuxRepaintManager& operator= (const LinuxRepaintManager&); + }; -void MessageManager::broadcastMessage (const String& value) throw() -{ -} + LinuxRepaintManager* repainter; -void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, - void* parameter) -{ - void* retVal = 0; + friend class LinuxRepaintManager; + Window windowH, parentWindow; + int wx, wy, ww, wh; + Image* taskbarImage; + bool fullScreen, entered, mapped, depthIs16Bit; + BorderSize windowBorder; - if (! errorCondition) + void removeWindowDecorations (Window wndH) { - if (! isThisTheMessageThread()) + Atom hints = XInternAtom (display, "_MOTIF_WM_HINTS", True); + + if (hints != None) { - static MessageThreadFuncCall messageFuncCallContext; + typedef struct + { + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; + } MotifWmHints; - const ScopedLock sl (messageFuncCallContext.lock); + MotifWmHints motifHints; + zerostruct (motifHints); + motifHints.flags = 2; /* MWM_HINTS_DECORATIONS */ + motifHints.decorations = 0; - XClientMessageEvent clientMsg; - clientMsg.display = display; - clientMsg.window = juce_messageWindowHandle; - clientMsg.type = ClientMessage; - clientMsg.format = 32; - clientMsg.message_type = specialCallbackId; -#if JUCE_64BIT - clientMsg.data.l[0] = (long) (0x00000000ffffffff & (((uint64) &messageFuncCallContext) >> 32)); - clientMsg.data.l[1] = (long) (0x00000000ffffffff & (uint64) &messageFuncCallContext); -#else - clientMsg.data.l[0] = (long) &messageFuncCallContext; -#endif + XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, + (unsigned char*) &motifHints, 4); + } - messageFuncCallContext.func = func; - messageFuncCallContext.parameter = parameter; + hints = XInternAtom (display, "_WIN_HINTS", True); - if (XSendEvent (display, juce_messageWindowHandle, false, NoEventMask, (XEvent*) &clientMsg) == 0) - return 0; + if (hints != None) + { + long gnomeHints = 0; - XFlush (display); // This is necessary to ensure the event is delivered + XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, + (unsigned char*) &gnomeHints, 1); + } - // Wait for it to complete before continuing - messageFuncCallContext.event.wait(); + hints = XInternAtom (display, "KWM_WIN_DECORATION", True); - retVal = messageFuncCallContext.result; + if (hints != None) + { + long kwmHints = 2; /*KDE_tinyDecoration*/ + + XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, + (unsigned char*) &kwmHints, 1); } - else + + hints = XInternAtom (display, "_NET_WM_WINDOW_TYPE", True); + + if (hints != None) { - // Just call the function directly - retVal = func (parameter); + int netHints [2]; + int numHints = 0; + if ((styleFlags & windowIsTemporary) != 0) + netHints [numHints] = XInternAtom (display, "_NET_WM_WINDOW_TYPE_MENU", True); + else + netHints [numHints] = XInternAtom (display, "_NET_WM_WINDOW_TYPE_NORMAL", True); + + if (netHints [numHints] != 0) + ++numHints; + + netHints[numHints] = XInternAtom (display, "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", True); + + if (netHints [numHints] != 0) + ++numHints; + + XChangeProperty (display, wndH, hints, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &netHints, numHints); } } - return retVal; -} + void addWindowButtons (Window wndH) + { + Atom hints = XInternAtom (display, "_MOTIF_WM_HINTS", True); -bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) -{ - if (errorCondition) - return false; + if (hints != None) + { + typedef struct + { + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; + } MotifWmHints; - if (breakIn) - { - errorCondition = true; + MotifWmHints motifHints; + zerostruct (motifHints); - if (juce_isRunningAsApplication()) - Process::terminate(); + motifHints.flags = 1 | 2; /* MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS */ + motifHints.decorations = 2 /* MWM_DECOR_BORDER */ | 8 /* MWM_DECOR_TITLE */ | 16; /* MWM_DECOR_MENU */ - return false; - } + motifHints.functions = 4 /* MWM_FUNC_MOVE */; - if (returnIfNoPendingMessages && ! XPending (display)) - return false; + if ((styleFlags & windowHasCloseButton) != 0) + motifHints.functions |= 32; /* MWM_FUNC_CLOSE */ - XEvent evt; - XNextEvent (display, &evt); + if ((styleFlags & windowHasMinimiseButton) != 0) + { + motifHints.functions |= 8; /* MWM_FUNC_MINIMIZE */ + motifHints.decorations |= 0x20; /* MWM_DECOR_MINIMIZE */ + } - if (evt.type == ClientMessage && evt.xany.window == juce_messageWindowHandle) - { - XClientMessageEvent* const clientMsg = (XClientMessageEvent*) &evt; + if ((styleFlags & windowHasMaximiseButton) != 0) + { + motifHints.functions |= 0x10; /* MWM_FUNC_MAXIMIZE */ + motifHints.decorations |= 0x40; /* MWM_DECOR_MAXIMIZE */ + } - if (clientMsg->format != 32) - { - jassertfalse - DBG ("Error: juce_dispatchNextMessageOnSystemQueue received malformed client message."); + if ((styleFlags & windowIsResizable) != 0) + { + motifHints.functions |= 2; /* MWM_FUNC_RESIZE */ + motifHints.decorations |= 0x4; /* MWM_DECOR_RESIZEH */ + } + + XChangeProperty (display, wndH, hints, hints, 32, 0, (unsigned char*) &motifHints, 5); } - else + + hints = XInternAtom (display, "_NET_WM_ALLOWED_ACTIONS", True); + + if (hints != None) { - JUCE_TRY - { -#if JUCE_64BIT - void* const messagePtr - = (void*) ((0xffffffff00000000 & (((uint64) clientMsg->data.l[0]) << 32)) - | (clientMsg->data.l[1] & 0x00000000ffffffff)); -#else - void* const messagePtr = (void*) (clientMsg->data.l[0]); -#endif + int netHints [6]; + int num = 0; - if (clientMsg->message_type == specialId) - { - MessageManager::getInstance()->deliverMessage (messagePtr); - } - else if (clientMsg->message_type == specialCallbackId) - { - MessageThreadFuncCall* const call = (MessageThreadFuncCall*) messagePtr; - MessageCallbackFunction* func = call->func; - call->result = (*func) (call->parameter); - call->event.signal(); - } - else if (clientMsg->message_type == broadcastId) - { -#if 0 - TCHAR buffer[8192]; - zeromem (buffer, sizeof (buffer)); + netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_RESIZE", (styleFlags & windowIsResizable) ? True : False); + netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_FULLSCREEN", (styleFlags & windowHasMaximiseButton) ? True : False); + netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_MINIMIZE", (styleFlags & windowHasMinimiseButton) ? True : False); + netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_CLOSE", (styleFlags & windowHasCloseButton) ? True : False); - if (GlobalGetAtomName ((ATOM) lParam, buffer, 8192) != 0) - mq->deliverBroadcastMessage (String (buffer)); -#endif - } - else - { - DBG ("Error: juce_dispatchNextMessageOnSystemQueue received unknown client message."); - } - } - JUCE_CATCH_ALL + XChangeProperty (display, wndH, hints, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &netHints, num); } } - else if (evt.xany.window != juce_messageWindowHandle) + + void createWindow() { - juce_windowMessageReceive (&evt); - } + static bool atomsInitialised = false; - return true; -} + if (! atomsInitialised) + { + atomsInitialised = true; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_Messaging.cpp *********/ + wm_Protocols = XInternAtom (display, "WM_PROTOCOLS", 1); + wm_ProtocolList [TAKE_FOCUS] = XInternAtom (display, "WM_TAKE_FOCUS", 1); + wm_ProtocolList [DELETE_WINDOW] = XInternAtom (display, "WM_DELETE_WINDOW", 1); + wm_ChangeState = XInternAtom (display, "WM_CHANGE_STATE", 1); + wm_State = XInternAtom (display, "WM_STATE", 1); + wm_ActiveWin = XInternAtom (display, "_NET_ACTIVE_WINDOW", False); -/********* Start of inlined file: juce_linux_Midi.cpp *********/ + XA_XdndAware = XInternAtom (display, "XdndAware", 0); + XA_XdndEnter = XInternAtom (display, "XdndEnter", 0); + XA_XdndLeave = XInternAtom (display, "XdndLeave", 0); + XA_XdndPosition = XInternAtom (display, "XdndPosition", 0); + XA_XdndStatus = XInternAtom (display, "XdndStatus", 0); + XA_XdndDrop = XInternAtom (display, "XdndDrop", 0); + XA_XdndFinished = XInternAtom (display, "XdndFinished", 0); + XA_XdndSelection = XInternAtom (display, "XdndSelection", 0); + XA_XdndProxy = XInternAtom (display, "XdndProxy", 0); -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) + XA_XdndTypeList = XInternAtom (display, "XdndTypeList", 0); + XA_XdndActionList = XInternAtom (display, "XdndActionList", 0); + XA_XdndActionCopy = XInternAtom (display, "XdndActionCopy", 0); + XA_XdndActionMove = XInternAtom (display, "XdndActionMove", 0); + XA_XdndActionLink = XInternAtom (display, "XdndActionLink", 0); + XA_XdndActionAsk = XInternAtom (display, "XdndActionAsk", 0); + XA_XdndActionPrivate = XInternAtom (display, "XdndActionPrivate", 0); + XA_XdndActionDescription = XInternAtom (display, "XdndActionDescription", 0); -/* - This file contains macros that enable/disable various JUCE features. -*/ + XA_JXSelectionWindowProperty = XInternAtom (display, "JXSelectionWindowProperty", 0); -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif + XA_MimeTextPlain = XInternAtom (display, "text/plain", 0); + XA_MimeTextUriList = XInternAtom (display, "text/uri-list", 0); + XA_MimeRootDrop = XInternAtom (display, "application/x-rootwindow-drop", 0); + } -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif + resetDragAndDrop(); -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. + XA_OtherMime = XA_MimeTextPlain; // xxx why?? + allowedMimeTypeAtoms [0] = XA_MimeTextPlain; + allowedMimeTypeAtoms [1] = XA_OtherMime; + allowedMimeTypeAtoms [2] = XA_MimeTextUriList; - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. + allowedActions [0] = XA_XdndActionMove; + allowedActions [1] = XA_XdndActionCopy; + allowedActions [2] = XA_XdndActionLink; + allowedActions [3] = XA_XdndActionAsk; + allowedActions [4] = XA_XdndActionPrivate; - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif + // Get defaults for various properties + const int screen = DefaultScreen (display); + Window root = RootWindow (display, screen); -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. + // Attempt to create a 24-bit window on the default screen. If this is not + // possible then exit + XVisualInfo desiredVisual; + desiredVisual.screen = screen; + desiredVisual.depth = 24; + depthIs16Bit = false; - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif + int numVisuals; + XVisualInfo* visuals = XGetVisualInfo (display, VisualScreenMask | VisualDepthMask, + &desiredVisual, &numVisuals); -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif + if (numVisuals < 1 || visuals == 0) + { + XFree (visuals); + desiredVisual.depth = 16; -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. + visuals = XGetVisualInfo (display, VisualScreenMask | VisualDepthMask, + &desiredVisual, &numVisuals); - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. + if (numVisuals < 1 || visuals == 0) + { + Logger::outputDebugString ("ERROR: System doesn't support 24 or 16 bit RGB display.\n"); + Process::terminate(); + } - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif + depthIs16Bit = true; + } -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + XFree (visuals); -/** These flags enable the Ogg-Vorbis and Flac audio formats. + // Set up the window attributes + XSetWindowAttributes swa; + swa.border_pixel = 0; + swa.background_pixmap = None; + swa.colormap = DefaultColormap (display, screen); + swa.override_redirect = getComponent()->isAlwaysOnTop() ? True : False; + swa.event_mask = eventMask; - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif + Window wndH = XCreateWindow (display, root, + 0, 0, 1, 1, + 0, 0, InputOutput, (Visual*) CopyFromParent, + CWBorderPixel | CWColormap | CWBackPixmap | CWEventMask | CWOverrideRedirect, + &swa); -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + XGrabButton (display, AnyButton, AnyModifier, wndH, False, + ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, + GrabModeAsync, GrabModeAsync, None, None); -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + // Set the window context to identify the window handle object + if (XSaveContext (display, (XID) wndH, improbableNumber, (XPointer) this)) + { + // Failed + jassertfalse + Logger::outputDebugString ("Failed to create context information for window.\n"); + XDestroyWindow (display, wndH); + wndH = 0; + } -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif + // Set window manager hints + XWMHints* wmHints = XAllocWMHints(); + wmHints->flags = InputHint | StateHint; + wmHints->input = True; // Locally active input model + wmHints->initial_state = NormalState; + XSetWMHints (display, wndH, wmHints); + XFree (wmHints); -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. + if ((styleFlags & windowIsSemiTransparent) != 0) + { + //xxx + } - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif + if ((styleFlags & windowAppearsOnTaskbar) != 0) + { + //xxx + } -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif + //XSetTransientForHint (display, wndH, RootWindow (display, DefaultScreen (display))); -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif + if ((styleFlags & windowHasTitleBar) == 0) + removeWindowDecorations (wndH); + else + addWindowButtons (wndH); -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif + // Set window manager protocols + XChangeProperty (display, wndH, wm_Protocols, XA_ATOM, 32, PropModeReplace, + (unsigned char*) wm_ProtocolList, 2); -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif + // Set drag and drop flags + XChangeProperty (display, wndH, XA_XdndTypeList, XA_ATOM, 32, PropModeReplace, + (const unsigned char*) allowedMimeTypeAtoms, numElementsInArray (allowedMimeTypeAtoms)); -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif + XChangeProperty (display, wndH, XA_XdndActionList, XA_ATOM, 32, PropModeReplace, + (const unsigned char*) allowedActions, numElementsInArray (allowedActions)); -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif + XChangeProperty (display, wndH, XA_XdndActionDescription, XA_STRING, 8, PropModeReplace, + (const unsigned char*) "", 0); -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif + unsigned long dndVersion = ourDndVersion; + XChangeProperty (display, wndH, XA_XdndAware, XA_ATOM, 32, PropModeReplace, + (const unsigned char*) &dndVersion, 1); -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif + // Set window name + setWindowTitle (wndH, getComponent()->getName()); -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif + // Initialise the pointer and keyboard mapping + // This is not the same as the logical pointer mapping the X server uses: + // we don't mess with this. + static bool mappingInitialised = false; -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + if (! mappingInitialised) + { + mappingInitialised = true; -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + const int numButtons = XGetPointerMapping (display, 0, 0); -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + if (numButtons == 2) + { + pointerMap[0] = LeftButton; + pointerMap[1] = RightButton; + pointerMap[2] = pointerMap[3] = pointerMap[4] = NoButton; + } + else if (numButtons >= 3) + { + pointerMap[0] = LeftButton; + pointerMap[1] = MiddleButton; + pointerMap[2] = RightButton; -/** Enable this to add extra memory-leak info to the new and delete operators. + if (numButtons >= 5) + { + pointerMap[3] = WheelUp; + pointerMap[4] = WheelDown; + } + } - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif + getModifierMapping(); + } -/** Enable this to turn on juce's internal catching of exceptions. + windowH = wndH; + } - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + void destroyWindow() + { + XPointer handlePointer; + if (! XFindContext (display, (XID) windowH, improbableNumber, &handlePointer)) + XDeleteContext (display, (XID) windowH, improbableNumber); -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + XDestroyWindow (display, windowH); -#endif -/********* End of inlined file: juce_Config.h *********/ + // Wait for it to complete and then remove any events for this + // window from the event queue. + XSync (display, false); -#if JUCE_ALSA + XEvent event; + while (XCheckWindowEvent (display, windowH, eventMask, &event) == True) + {} + } -#include + static int64 getEventTime (::Time t) throw() + { + static int64 eventTimeOffset = 0x12345678; + const int64 thisMessageTime = t; -BEGIN_JUCE_NAMESPACE + if (eventTimeOffset == 0x12345678) + eventTimeOffset = Time::currentTimeMillis() - thisMessageTime; -static snd_seq_t* iterateDevices (const bool forInput, - StringArray& deviceNamesFound, - const int deviceIndexToOpen) -{ - snd_seq_t* returnedHandle = 0; - snd_seq_t* seqHandle; + return eventTimeOffset + thisMessageTime; + } - if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT - : SND_SEQ_OPEN_OUTPUT, 0) == 0) + static void setWindowTitle (Window xwin, const char* const title) throw() { - snd_seq_system_info_t* systemInfo; - snd_seq_client_info_t* clientInfo; + XTextProperty nameProperty; + char* strings[] = { (char*) title }; - if (snd_seq_system_info_malloc (&systemInfo) == 0) + if (XStringListToTextProperty (strings, 1, &nameProperty)) { - if (snd_seq_system_info (seqHandle, systemInfo) == 0 - && snd_seq_client_info_malloc (&clientInfo) == 0) - { - int numClients = snd_seq_system_info_get_cur_clients (systemInfo); - - while (--numClients >= 0 && returnedHandle == 0) - { - if (snd_seq_query_next_client (seqHandle, clientInfo) == 0) - { - snd_seq_port_info_t* portInfo; - if (snd_seq_port_info_malloc (&portInfo) == 0) - { - int numPorts = snd_seq_client_info_get_num_ports (clientInfo); - const int client = snd_seq_client_info_get_client (clientInfo); - - snd_seq_port_info_set_client (portInfo, client); - snd_seq_port_info_set_port (portInfo, -1); - - while (--numPorts >= 0) - { - if (snd_seq_query_next_port (seqHandle, portInfo) == 0 - && (snd_seq_port_info_get_capability (portInfo) - & (forInput ? SND_SEQ_PORT_CAP_READ - : SND_SEQ_PORT_CAP_WRITE)) != 0) - { - deviceNamesFound.add (snd_seq_client_info_get_name (clientInfo)); + XSetWMName (display, xwin, &nameProperty); + XSetWMIconName (display, xwin, &nameProperty); - if (deviceNamesFound.size() == deviceIndexToOpen + 1) - { - const int sourcePort = snd_seq_port_info_get_port (portInfo); - const int sourceClient = snd_seq_client_info_get_client (clientInfo); + XFree (nameProperty.value); + } + } - if (sourcePort != -1) - { - snd_seq_set_client_name (seqHandle, - forInput ? "Juce Midi Input" - : "Juce Midi Output"); + void updateBorderSize() + { + if ((styleFlags & windowHasTitleBar) == 0) + { + windowBorder = BorderSize (0); + } + else if (windowBorder.getTopAndBottom() == 0 && windowBorder.getLeftAndRight() == 0) + { + Atom hints = XInternAtom (display, "_NET_FRAME_EXTENTS", True); - const int portId - = snd_seq_create_simple_port (seqHandle, - forInput ? "Juce Midi In Port" - : "Juce Midi Out Port", - forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) - : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), - SND_SEQ_PORT_TYPE_MIDI_GENERIC); + if (hints != None) + { + unsigned char* data = 0; + unsigned long nitems, bytesLeft; + Atom actualType; + int actualFormat; - snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); + if (XGetWindowProperty (display, windowH, hints, 0, 4, False, + XA_CARDINAL, &actualType, &actualFormat, &nitems, &bytesLeft, + &data) == Success) + { + const unsigned long* const sizes = (const unsigned long*) data; - returnedHandle = seqHandle; - } - } - } - } + if (actualFormat == 32) + windowBorder = BorderSize ((int) sizes[2], (int) sizes[0], + (int) sizes[3], (int) sizes[1]); - snd_seq_port_info_free (portInfo); - } - } + XFree (data); } - - snd_seq_client_info_free (clientInfo); } - - snd_seq_system_info_free (systemInfo); } - - if (returnedHandle == 0) - snd_seq_close (seqHandle); } - deviceNamesFound.appendNumbersToDuplicates (true, true); - - return returnedHandle; -} + void updateBounds() + { + jassert (windowH != 0); + if (windowH != 0) + { + Window root, child; + unsigned int bw, depth; -static snd_seq_t* createDevice (const bool forInput, - const String& deviceNameToOpen) -{ - snd_seq_t* seqHandle = 0; + if (! XGetGeometry (display, (::Drawable) windowH, &root, + &wx, &wy, (unsigned int*) &ww, (unsigned int*) &wh, + &bw, &depth)) + { + wx = wy = ww = wh = 0; + } + else if (! XTranslateCoordinates (display, windowH, root, 0, 0, &wx, &wy, &child)) + { + wx = wy = 0; + } + } + } - if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT - : SND_SEQ_OPEN_OUTPUT, 0) == 0) + void resetDragAndDrop() { - snd_seq_set_client_name (seqHandle, - (const char*) (forInput ? (deviceNameToOpen + T(" Input")) - : (deviceNameToOpen + T(" Output")))); + dragAndDropFiles.clear(); + lastDropX = lastDropY = -1; + dragAndDropCurrentMimeType = 0; + dragAndDropSourceWindow = 0; + srcMimeTypeAtomList.clear(); + } - const int portId - = snd_seq_create_simple_port (seqHandle, - forInput ? "in" - : "out", - forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) - : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), - forInput ? SND_SEQ_PORT_TYPE_APPLICATION - : SND_SEQ_PORT_TYPE_MIDI_GENERIC); + void sendDragAndDropMessage (XClientMessageEvent& msg) + { + msg.type = ClientMessage; + msg.display = display; + msg.window = dragAndDropSourceWindow; + msg.format = 32; + msg.data.l[0] = windowH; - if (portId < 0) - { - snd_seq_close (seqHandle); - seqHandle = 0; - } + XSendEvent (display, dragAndDropSourceWindow, False, 0, (XEvent*) &msg); } - return seqHandle; -} + void sendDragAndDropStatus (const bool acceptDrop, Atom dropAction) + { + XClientMessageEvent msg; + zerostruct (msg); + msg.message_type = XA_XdndStatus; + msg.data.l[1] = (acceptDrop ? 1 : 0) | 2; // 2 indicates that we want to receive position messages + msg.data.l[4] = dropAction; -class MidiOutputDevice -{ -public: - MidiOutputDevice (MidiOutput* const midiOutput_, - snd_seq_t* const seqHandle_) - : - midiOutput (midiOutput_), - seqHandle (seqHandle_), - maxEventSize (16 * 1024) + sendDragAndDropMessage (msg); + } + + void sendDragAndDropLeave() { - jassert (seqHandle != 0 && midiOutput != 0); - snd_midi_event_new (maxEventSize, &midiParser); + XClientMessageEvent msg; + zerostruct (msg); + msg.message_type = XA_XdndLeave; + sendDragAndDropMessage (msg); } - ~MidiOutputDevice() + void sendDragAndDropFinish() { - snd_midi_event_free (midiParser); - snd_seq_close (seqHandle); + XClientMessageEvent msg; + zerostruct (msg); + msg.message_type = XA_XdndFinished; + sendDragAndDropMessage (msg); } - void sendMessageNow (const MidiMessage& message) + void handleDragAndDropStatus (const XClientMessageEvent* const clientMsg) { - if (message.getRawDataSize() > maxEventSize) + if ((clientMsg->data.l[1] & 1) == 0) { - maxEventSize = message.getRawDataSize(); - snd_midi_event_free (midiParser); - snd_midi_event_new (maxEventSize, &midiParser); - } + sendDragAndDropLeave(); - snd_seq_event_t event; - snd_seq_ev_clear (&event); + if (dragAndDropFiles.size() > 0) + handleFileDragExit (dragAndDropFiles); - snd_midi_event_encode (midiParser, - message.getRawData(), - message.getRawDataSize(), - &event); + dragAndDropFiles.clear(); + } + } - snd_midi_event_reset_encode (midiParser); + void handleDragAndDropPosition (const XClientMessageEvent* const clientMsg) + { + if (dragAndDropSourceWindow == 0) + return; - snd_seq_ev_set_source (&event, 0); - snd_seq_ev_set_subs (&event); - snd_seq_ev_set_direct (&event); + dragAndDropSourceWindow = clientMsg->data.l[0]; - snd_seq_event_output (seqHandle, &event); - snd_seq_drain_output (seqHandle); - } + const int dropX = ((int) clientMsg->data.l[2] >> 16) - getScreenX(); + const int dropY = ((int) clientMsg->data.l[2] & 0xffff) - getScreenY(); - juce_UseDebuggingNewOperator + if (lastDropX != dropX || lastDropY != dropY) + { + lastDropX = dropX; + lastDropY = dropY; -private: - MidiOutput* const midiOutput; - snd_seq_t* const seqHandle; - snd_midi_event_t* midiParser; - int maxEventSize; -}; + dragAndDropTimestamp = clientMsg->data.l[3]; -const StringArray MidiOutput::getDevices() -{ - StringArray devices; - iterateDevices (false, devices, -1); - return devices; -} + Atom targetAction = XA_XdndActionCopy; -int MidiOutput::getDefaultDeviceIndex() -{ - return 0; -} + for (int i = numElementsInArray (allowedActions); --i >= 0;) + { + if ((Atom) clientMsg->data.l[4] == allowedActions[i]) + { + targetAction = allowedActions[i]; + break; + } + } -MidiOutput* MidiOutput::openDevice (int deviceIndex) -{ - MidiOutput* newDevice = 0; + sendDragAndDropStatus (true, targetAction); - StringArray devices; - snd_seq_t* const handle = iterateDevices (false, devices, deviceIndex); + if (dragAndDropFiles.size() == 0) + updateDraggedFileList (clientMsg); - if (handle != 0) - { - newDevice = new MidiOutput(); - newDevice->internal = new MidiOutputDevice (newDevice, handle); + if (dragAndDropFiles.size() > 0) + handleFileDragMove (dragAndDropFiles, dropX, dropY); + } } - return newDevice; -} + void handleDragAndDropDrop (const XClientMessageEvent* const clientMsg) + { + if (dragAndDropFiles.size() == 0) + updateDraggedFileList (clientMsg); -MidiOutput* MidiOutput::createNewDevice (const String& deviceName) -{ - MidiOutput* newDevice = 0; + const StringArray files (dragAndDropFiles); + const int lastX = lastDropX, lastY = lastDropY; - snd_seq_t* const handle = createDevice (false, deviceName); + sendDragAndDropFinish(); + resetDragAndDrop(); - if (handle != 0) - { - newDevice = new MidiOutput(); - newDevice->internal = new MidiOutputDevice (newDevice, handle); + if (files.size() > 0) + handleFileDragDrop (files, lastX, lastY); } - return newDevice; -} + void handleDragAndDropEnter (const XClientMessageEvent* const clientMsg) + { + dragAndDropFiles.clear(); + srcMimeTypeAtomList.clear(); -MidiOutput::~MidiOutput() -{ - MidiOutputDevice* const device = (MidiOutputDevice*) internal; - delete device; -} + dragAndDropCurrentMimeType = 0; + const int dndCurrentVersion = (int) (clientMsg->data.l[1] & 0xff000000) >> 24; -void MidiOutput::reset() -{ -} + if (dndCurrentVersion < 3 || dndCurrentVersion > ourDndVersion) + { + dragAndDropSourceWindow = 0; + return; + } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) -{ - return false; -} + dragAndDropSourceWindow = clientMsg->data.l[0]; -void MidiOutput::setVolume (float leftVol, float rightVol) -{ -} + if ((clientMsg->data.l[1] & 1) != 0) + { + Atom actual; + int format; + unsigned long count = 0, remaining = 0; + unsigned char* data = 0; -void MidiOutput::sendMessageNow (const MidiMessage& message) -{ - ((MidiOutputDevice*) internal)->sendMessageNow (message); -} + XGetWindowProperty (display, dragAndDropSourceWindow, XA_XdndTypeList, + 0, 0x8000000L, False, XA_ATOM, &actual, &format, + &count, &remaining, &data); -class MidiInputThread : public Thread -{ -public: - MidiInputThread (MidiInput* const midiInput_, - snd_seq_t* const seqHandle_, - MidiInputCallback* const callback_) - : Thread (T("Juce MIDI Input")), - midiInput (midiInput_), - seqHandle (seqHandle_), - callback (callback_) - { - jassert (seqHandle != 0 && callback != 0 && midiInput != 0); - } + if (data != 0) + { + if (actual == XA_ATOM && format == 32 && count != 0) + { + const unsigned long* const types = (const unsigned long*) data; - ~MidiInputThread() - { - snd_seq_close (seqHandle); - } + for (unsigned int i = 0; i < count; ++i) + if (types[i] != None) + srcMimeTypeAtomList.add (types[i]); + } - void run() - { - const int maxEventSize = 16 * 1024; - snd_midi_event_t* midiParser; + XFree (data); + } + } - if (snd_midi_event_new (maxEventSize, &midiParser) >= 0) + if (srcMimeTypeAtomList.size() == 0) { - uint8* const buffer = (uint8*) juce_malloc (maxEventSize); + for (int i = 2; i < 5; ++i) + if (clientMsg->data.l[i] != None) + srcMimeTypeAtomList.add (clientMsg->data.l[i]); - const int numPfds = snd_seq_poll_descriptors_count (seqHandle, POLLIN); - struct pollfd* const pfd = (struct pollfd*) alloca (numPfds * sizeof (struct pollfd)); + if (srcMimeTypeAtomList.size() == 0) + { + dragAndDropSourceWindow = 0; + return; + } + } - snd_seq_poll_descriptors (seqHandle, pfd, numPfds, POLLIN); + for (int i = 0; i < srcMimeTypeAtomList.size() && dragAndDropCurrentMimeType == 0; ++i) + for (int j = 0; j < numElementsInArray (allowedMimeTypeAtoms); ++j) + if (srcMimeTypeAtomList[i] == allowedMimeTypeAtoms[j]) + dragAndDropCurrentMimeType = allowedMimeTypeAtoms[j]; - while (! threadShouldExit()) - { - if (poll (pfd, numPfds, 500) > 0) - { - snd_seq_event_t* inputEvent = 0; + handleDragAndDropPosition (clientMsg); + } - snd_seq_nonblock (seqHandle, 1); + void handleDragAndDropSelection (const XEvent* const evt) + { + dragAndDropFiles.clear(); - do - { - if (snd_seq_event_input (seqHandle, &inputEvent) >= 0) - { - // xxx what about SYSEXes that are too big for the buffer? - const int numBytes = snd_midi_event_decode (midiParser, buffer, maxEventSize, inputEvent); + if (evt->xselection.property != 0) + { + StringArray lines; - snd_midi_event_reset_decode (midiParser); + { + MemoryBlock dropData; - if (numBytes > 0) - { - const MidiMessage message ((const uint8*) buffer, - numBytes, - Time::getMillisecondCounter() * 0.001); + for (;;) + { + Atom actual; + uint8* data = 0; + unsigned long count = 0, remaining = 0; + int format = 0; - callback->handleIncomingMidiMessage (midiInput, message); - } + if (XGetWindowProperty (display, evt->xany.window, evt->xselection.property, + dropData.getSize() / 4, 65536, 1, AnyPropertyType, &actual, + &format, &count, &remaining, &data) == Success) + { + dropData.append (data, count * format / 8); + XFree (data); - snd_seq_free_event (inputEvent); - } + if (remaining == 0) + break; + } + else + { + XFree (data); + break; } - while (snd_seq_event_input_pending (seqHandle, 0) > 0); - - snd_seq_free_event (inputEvent); } + + lines.addLines (dropData.toString()); } - snd_midi_event_free (midiParser); - juce_free (buffer); + for (int i = 0; i < lines.size(); ++i) + dragAndDropFiles.add (URL::removeEscapeChars (lines[i].fromFirstOccurrenceOf (T("file://"), false, true))); + + dragAndDropFiles.trim(); + dragAndDropFiles.removeEmptyStrings(); } - }; + } - juce_UseDebuggingNewOperator + void updateDraggedFileList (const XClientMessageEvent* const clientMsg) + { + dragAndDropFiles.clear(); -private: - MidiInput* const midiInput; - snd_seq_t* const seqHandle; - MidiInputCallback* const callback; -}; + if (dragAndDropSourceWindow != None + && dragAndDropCurrentMimeType != 0) + { + dragAndDropTimestamp = clientMsg->data.l[2]; -MidiInput::MidiInput (const String& name_) - : name (name_), - internal (0) -{ -} + XConvertSelection (display, + XA_XdndSelection, + dragAndDropCurrentMimeType, + XA_JXSelectionWindowProperty, + windowH, + dragAndDropTimestamp); + } + } -MidiInput::~MidiInput() -{ - stop(); - MidiInputThread* const thread = (MidiInputThread*) internal; - delete thread; -} + StringArray dragAndDropFiles; + int dragAndDropTimestamp, lastDropX, lastDropY; -void MidiInput::start() -{ - ((MidiInputThread*) internal)->startThread(); -} + Atom XA_OtherMime, dragAndDropCurrentMimeType; + Window dragAndDropSourceWindow; -void MidiInput::stop() -{ - ((MidiInputThread*) internal)->stopThread (3000); -} + unsigned int allowedActions [5]; + unsigned int allowedMimeTypeAtoms [3]; + Array srcMimeTypeAtomList; +}; -int MidiInput::getDefaultDeviceIndex() +void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars) { - return 0; + if (enableOrDisable) + kioskModeComponent->setBounds (Desktop::getInstance().getMainMonitorArea (false)); } -const StringArray MidiInput::getDevices() +ComponentPeer* Component::createNewPeer (int styleFlags, void* /*nativeWindowToAttachTo*/) { - StringArray devices; - iterateDevices (true, devices, -1); - return devices; + return new LinuxComponentPeer (this, styleFlags); } -MidiInput* MidiInput::openDevice (int deviceIndex, MidiInputCallback* callback) +// (this callback is hooked up in the messaging code) +void juce_windowMessageReceive (XEvent* event) { - MidiInput* newDevice = 0; - - StringArray devices; - snd_seq_t* const handle = iterateDevices (true, devices, deviceIndex); - - if (handle != 0) + if (event->xany.window != None) { - newDevice = new MidiInput (devices [deviceIndex]); - newDevice->internal = new MidiInputThread (newDevice, handle, callback); + LinuxComponentPeer* const peer = LinuxComponentPeer::getPeerFor (event->xany.window); + + if (ComponentPeer::isValidPeer (peer)) + peer->handleWindowMessage (event); } + else + { + switch (event->xany.type) + { + case KeymapNotify: + { + const XKeymapEvent* const keymapEvent = (const XKeymapEvent*) &event->xkeymap; + memcpy (keyStates, keymapEvent->key_vector, 32); + break; + } - return newDevice; + default: + break; + } + } } -MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallback* callback) +void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool /*clipToWorkArea*/) throw() { - MidiInput* newDevice = 0; - - snd_seq_t* const handle = createDevice (true, deviceName); +#if JUCE_USE_XINERAMA + int major_opcode, first_event, first_error; - if (handle != 0) + if (XQueryExtension (display, "XINERAMA", &major_opcode, &first_event, &first_error) + && XineramaIsActive (display)) { - newDevice = new MidiInput (deviceName); - newDevice->internal = new MidiInputThread (newDevice, handle, callback); - } - - return newDevice; -} + int numMonitors = 0; + XineramaScreenInfo* const screens = XineramaQueryScreens (display, &numMonitors); -END_JUCE_NAMESPACE + if (screens != 0) + { + for (int i = numMonitors; --i >= 0;) + { + int index = screens[i].screen_number; -#else + if (index >= 0) + { + while (monitorCoords.size() < index) + monitorCoords.add (Rectangle (0, 0, 0, 0)); -// (These are just stub functions if ALSA is unavailable...) + monitorCoords.set (index, Rectangle (screens[i].x_org, + screens[i].y_org, + screens[i].width, + screens[i].height)); + } + } -BEGIN_JUCE_NAMESPACE + XFree (screens); + } + } -const StringArray MidiOutput::getDevices() { return StringArray(); } -int MidiOutput::getDefaultDeviceIndex() { return 0; } -MidiOutput* MidiOutput::openDevice (int) { return 0; } -MidiOutput* MidiOutput::createNewDevice (const String&) { return 0; } -MidiOutput::~MidiOutput() {} -void MidiOutput::reset() {} -bool MidiOutput::getVolume (float&, float&) { return false; } -void MidiOutput::setVolume (float, float) {} -void MidiOutput::sendMessageNow (const MidiMessage&) {} + if (monitorCoords.size() == 0) +#endif + { + Atom hints = XInternAtom (display, "_NET_WORKAREA", True); -MidiInput::MidiInput (const String& name_) - : name (name_), - internal (0) -{} + if (hints != None) + { + const int numMonitors = ScreenCount (display); -MidiInput::~MidiInput() {} -void MidiInput::start() {} -void MidiInput::stop() {} -int MidiInput::getDefaultDeviceIndex() { return 0; } -const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return 0; } -MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return 0; } + for (int i = 0; i < numMonitors; ++i) + { + Window root = RootWindow (display, i); -END_JUCE_NAMESPACE + unsigned long nitems, bytesLeft; + Atom actualType; + int actualFormat; + unsigned char* data = 0; -#endif -/********* End of inlined file: juce_linux_Midi.cpp *********/ + if (XGetWindowProperty (display, root, hints, 0, 4, False, + XA_CARDINAL, &actualType, &actualFormat, &nitems, &bytesLeft, + &data) == Success) + { + const long* const position = (const long*) data; -/********* Start of inlined file: juce_linux_WebBrowserComponent.cpp *********/ + if (actualType == XA_CARDINAL && actualFormat == 32 && nitems == 4) + monitorCoords.add (Rectangle (position[0], position[1], + position[2], position[3])); -BEGIN_JUCE_NAMESPACE + XFree (data); + } + } + } -#if JUCE_WEB_BROWSER + if (monitorCoords.size() == 0) + { + monitorCoords.add (Rectangle (0, 0, + DisplayWidth (display, DefaultScreen (display)), + DisplayHeight (display, DefaultScreen (display)))); + } + } +} -/* - Sorry.. This class isn't implemented on Linux! -*/ +bool Desktop::canUseSemiTransparentWindows() throw() +{ + return false; +} -WebBrowserComponent::WebBrowserComponent() - : browser (0), - blankPageShown (false) +void Desktop::getMousePosition (int& x, int& y) throw() { - setOpaque (true); + int mouseMods; + getMousePos (x, y, mouseMods); } -WebBrowserComponent::~WebBrowserComponent() +void Desktop::setMousePosition (int x, int y) throw() { + Window root = RootWindow (display, DefaultScreen (display)); + XWarpPointer (display, None, root, 0, 0, 0, 0, x, y); } -void WebBrowserComponent::goToURL (const String& url, - const StringArray* headers, - const MemoryBlock* postData) +static bool screenSaverAllowed = true; + +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() { - lastURL = url; + if (screenSaverAllowed != isEnabled) + { + screenSaverAllowed = isEnabled; - lastHeaders.clear(); - if (headers != 0) - lastHeaders = *headers; + typedef void (*tXScreenSaverSuspend) (Display*, Bool); + static tXScreenSaverSuspend xScreenSaverSuspend = 0; - lastPostData.setSize (0); - if (postData != 0) - lastPostData = *postData; + if (xScreenSaverSuspend == 0) + { + void* h = dlopen ("libXss.so", RTLD_GLOBAL | RTLD_NOW); - blankPageShown = false; + if (h != 0) + xScreenSaverSuspend = (tXScreenSaverSuspend) dlsym (h, "XScreenSaverSuspend"); + } + if (xScreenSaverSuspend != 0) + xScreenSaverSuspend (display, ! isEnabled); + } } -void WebBrowserComponent::stop() +bool Desktop::isScreenSaverEnabled() throw() { + return screenSaverAllowed; } -void WebBrowserComponent::goBack() +void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() { - lastURL = String::empty; - blankPageShown = false; + Window root = RootWindow (display, DefaultScreen (display)); + const unsigned int imageW = image.getWidth(); + const unsigned int imageH = image.getHeight(); + unsigned int cursorW, cursorH; -} + if (! XQueryBestCursor (display, root, imageW, imageH, &cursorW, &cursorH)) + return 0; -void WebBrowserComponent::goForward() -{ - lastURL = String::empty; + Image im (Image::ARGB, cursorW, cursorH, true); + Graphics g (im); -} + if (imageW > cursorW || imageH > cursorH) + { + hotspotX = (hotspotX * cursorW) / imageW; + hotspotY = (hotspotY * cursorH) / imageH; -void WebBrowserComponent::refresh() -{ -} + g.drawImageWithin (&image, 0, 0, imageW, imageH, + RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, + false); + } + else + { + g.drawImageAt (&image, 0, 0); + } -void WebBrowserComponent::paint (Graphics& g) -{ - g.fillAll (Colours::white); -} + const int stride = (cursorW + 7) >> 3; + uint8* const maskPlane = (uint8*) juce_calloc (stride * cursorH); + uint8* const sourcePlane = (uint8*) juce_calloc (stride * cursorH); -void WebBrowserComponent::checkWindowAssociation() -{ -} + const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); -void WebBrowserComponent::reloadLastURL() -{ - if (lastURL.isNotEmpty()) + for (int y = cursorH; --y >= 0;) { - goToURL (lastURL, &lastHeaders, &lastPostData); - lastURL = String::empty; + for (int x = cursorW; --x >= 0;) + { + const uint8 mask = (uint8) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); + const int offset = y * stride + (x >> 3); + + const Colour c (im.getPixelAt (x, y)); + + if (c.getAlpha() >= 128) + maskPlane[offset] |= mask; + + if (c.getBrightness() >= 0.5f) + sourcePlane[offset] |= mask; + } } -} -void WebBrowserComponent::parentHierarchyChanged() -{ - checkWindowAssociation(); -} + Pixmap sourcePixmap = XCreatePixmapFromBitmapData (display, root, (char*) sourcePlane, cursorW, cursorH, 0xffff, 0, 1); + Pixmap maskPixmap = XCreatePixmapFromBitmapData (display, root, (char*) maskPlane, cursorW, cursorH, 0xffff, 0, 1); -void WebBrowserComponent::resized() -{ + juce_free (maskPlane); + juce_free (sourcePlane); + + XColor white, black; + black.red = black.green = black.blue = 0; + white.red = white.green = white.blue = 0xffff; + + void* result = (void*) XCreatePixmapCursor (display, sourcePixmap, maskPixmap, &white, &black, hotspotX, hotspotY); + + XFreePixmap (display, sourcePixmap); + XFreePixmap (display, maskPixmap); + + return result; } -void WebBrowserComponent::visibilityChanged() +void juce_deleteMouseCursor (void* const cursorHandle, const bool) throw() { - checkWindowAssociation(); + if (cursorHandle != None) + XFreeCursor (display, (Cursor) cursorHandle); } -bool WebBrowserComponent::pageAboutToLoad (const String& url) +void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() { - return true; -} + unsigned int shape; -#endif -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_WebBrowserComponent.cpp *********/ + switch (type) + { + case MouseCursor::NoCursor: + { + const Image im (Image::ARGB, 16, 16, true); + return juce_createMouseCursorFromImage (im, 0, 0); + } -/********* Start of inlined file: juce_linux_Windowing.cpp *********/ + case MouseCursor::NormalCursor: + return (void*) None; // Use parent cursor -/********* Start of inlined file: juce_Config.h *********/ -#ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) + case MouseCursor::DraggingHandCursor: + { + static unsigned char dragHandData[] = {71,73,70,56,57,97,16,0,16,0,145,2,0,0,0,0,255,255,255,0, + 0,0,0,0,0,33,249,4,1,0,0,2,0,44,0,0,0,0,16,0, + 16,0,0,2,52,148,47,0,200,185,16,130,90,12,74,139,107,84,123,39, + 132,117,151,116,132,146,248,60,209,138,98,22,203,114,34,236,37,52,77,217, + 247,154,191,119,110,240,193,128,193,95,163,56,60,234,98,135,2,0,59 }; + const int dragHandDataSize = 99; -/* - This file contains macros that enable/disable various JUCE features. -*/ + Image* const im = ImageFileFormat::loadFrom ((const char*) dragHandData, dragHandDataSize); + void* const dragHandCursor = juce_createMouseCursorFromImage (*im, 8, 7); + delete im; -/** The name of the namespace that all Juce classes and functions will be - put inside. If this is not defined, no namespace will be used. -*/ -#ifndef JUCE_NAMESPACE - #define JUCE_NAMESPACE juce -#endif + return dragHandCursor; + } -/** Normally, JUCE_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this can force it to be true or - false. -*/ -#ifndef JUCE_FORCE_DEBUG - //#define JUCE_FORCE_DEBUG 1 -#endif + case MouseCursor::CopyingCursor: + { + static unsigned char copyCursorData[] = {71,73,70,56,57,97,21,0,21,0,145,0,0,0,0,0,255,255,255,0, + 128,128,255,255,255,33,249,4,1,0,0,3,0,44,0,0,0,0,21,0, + 21,0,0,2,72,4,134,169,171,16,199,98,11,79,90,71,161,93,56,111, + 78,133,218,215,137,31,82,154,100,200,86,91,202,142,12,108,212,87,235,174, + 15,54,214,126,237,226,37,96,59,141,16,37,18,201,142,157,230,204,51,112, + 252,114,147,74,83,5,50,68,147,208,217,16,71,149,252,124,5,0,59,0,0 }; + const int copyCursorSize = 119; -/** If this flag is enabled, the the jassert and jassertfalse macros will - always use Logger::writeToLog() to write a message when an assertion happens. + Image* const im = ImageFileFormat::loadFrom ((const char*) copyCursorData, copyCursorSize); + void* const copyCursor = juce_createMouseCursorFromImage (*im, 1, 3); + delete im; - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the jassert and jassertfalse macros will not be compiled in a - release build. + return copyCursor; + } - @see jassert, jassertfalse, Logger -*/ -#ifndef JUCE_LOG_ASSERTIONS -// #define JUCE_LOG_ASSERTIONS 1 -#endif + case MouseCursor::WaitCursor: + shape = XC_watch; + break; -/** Comment out this macro if you haven't got the Steinberg ASIO SDK, without - which the ASIOAudioIODevice class can't be built. See the comments in the - ASIOAudioIODevice class's header file for more info about this. + case MouseCursor::IBeamCursor: + shape = XC_xterm; + break; - (This only affects a Win32 build) -*/ -#ifndef JUCE_ASIO - #define JUCE_ASIO 1 -#endif + case MouseCursor::PointingHandCursor: + shape = XC_hand2; + break; -/** Comment out this macro to disable building of ALSA device support on Linux. -*/ -#ifndef JUCE_ALSA - #define JUCE_ALSA 1 -#endif + case MouseCursor::LeftRightResizeCursor: + shape = XC_sb_h_double_arrow; + break; -/** Comment out this macro if you don't want to enable QuickTime or if you don't - have the SDK installed. + case MouseCursor::UpDownResizeCursor: + shape = XC_sb_v_double_arrow; + break; - If this flag is not enabled, the QuickTimeMovieComponent and QuickTimeAudioFormat - classes will be unavailable. + case MouseCursor::UpDownLeftRightResizeCursor: + shape = XC_fleur; + break; - On Windows, if you enable this, you'll need to have the QuickTime SDK - installed, and its header files will need to be on your include path. -*/ -#if ! (defined (JUCE_QUICKTIME) || defined (LINUX) || (defined (_WIN32) && ! defined (_MSC_VER))) - #define JUCE_QUICKTIME 1 -#endif + case MouseCursor::TopEdgeResizeCursor: + shape = XC_top_side; + break; -/** Comment out this macro if you don't want to enable OpenGL or if you don't - have the appropriate headers and libraries available. If it's not enabled, the - OpenGLComponent class will be unavailable. -*/ -#ifndef JUCE_OPENGL - #define JUCE_OPENGL 1 -#endif + case MouseCursor::BottomEdgeResizeCursor: + shape = XC_bottom_side; + break; -/** These flags enable the Ogg-Vorbis and Flac audio formats. + case MouseCursor::LeftEdgeResizeCursor: + shape = XC_left_side; + break; - If you're not going to need either of these formats, turn off the flags to - avoid bloating your codebase with them. -*/ -#ifndef JUCE_USE_FLAC - #define JUCE_USE_FLAC 1 -#endif + case MouseCursor::RightEdgeResizeCursor: + shape = XC_right_side; + break; -#ifndef JUCE_USE_OGGVORBIS - #define JUCE_USE_OGGVORBIS 1 -#endif + case MouseCursor::TopLeftCornerResizeCursor: + shape = XC_top_left_corner; + break; -/** This flag lets you enable support for CD-burning. You might want to disable - it to build without the MS SDK under windows. -*/ -#if (! defined (JUCE_USE_CDBURNER)) && ! (defined (_WIN32) && ! defined (_MSC_VER)) - #define JUCE_USE_CDBURNER 1 -#endif + case MouseCursor::TopRightCornerResizeCursor: + shape = XC_top_right_corner; + break; -/** Enabling this provides support for cameras, using the CameraDevice class -*/ -#if JUCE_QUICKTIME && ! defined (JUCE_USE_CAMERA) -// #define JUCE_USE_CAMERA 1 -#endif + case MouseCursor::BottomLeftCornerResizeCursor: + shape = XC_bottom_left_corner; + break; -/** Enabling this macro means that all regions that get repainted will have a coloured - line drawn around them. + case MouseCursor::BottomRightCornerResizeCursor: + shape = XC_bottom_right_corner; + break; - This is handy if you're trying to optimise drawing, because it lets you easily see - when anything is being repainted unnecessarily. -*/ -#ifndef JUCE_ENABLE_REPAINT_DEBUGGING -// #define JUCE_ENABLE_REPAINT_DEBUGGING 1 -#endif + case MouseCursor::CrosshairCursor: + shape = XC_crosshair; + break; -/** Enable this under Linux to use Xinerama for multi-monitor support. -*/ -#ifndef JUCE_USE_XINERAMA - #define JUCE_USE_XINERAMA 1 -#endif + default: + return (void*) None; // Use parent cursor + } -/** Enable this under Linux to use XShm for faster shared-memory rendering. -*/ -#ifndef JUCE_USE_XSHM - #define JUCE_USE_XSHM 1 -#endif + return (void*) XCreateFontCursor (display, shape); +} -/** Enabling this builds support for VST audio plugins. - @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU -*/ -#ifndef JUCE_PLUGINHOST_VST -// #define JUCE_PLUGINHOST_VST 1 -#endif +void MouseCursor::showInWindow (ComponentPeer* peer) const throw() +{ + LinuxComponentPeer* const lp = dynamic_cast (peer); -/** Enabling this builds support for AudioUnit audio plugins. - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST -*/ -#ifndef JUCE_PLUGINHOST_AU -// #define JUCE_PLUGINHOST_AU 1 -#endif + if (lp != 0) + lp->showMouseCursor ((Cursor) getHandle()); +} -/** Enabling this will avoid including any UI code in the build. This is handy for - writing command-line utilities, e.g. on linux boxes which don't have some - of the UI libraries installed. -*/ -#ifndef JUCE_ONLY_BUILD_CORE_LIBRARY - //#define JUCE_ONLY_BUILD_CORE_LIBRARY 1 -#endif +void MouseCursor::showInAllWindows() const throw() +{ + for (int i = ComponentPeer::getNumPeers(); --i >= 0;) + showInWindow (ComponentPeer::getPeer (i)); +} -/** This lets you disable building of the WebBrowserComponent, if it's not required. -*/ -#ifndef JUCE_WEB_BROWSER - #define JUCE_WEB_BROWSER 1 -#endif +Image* juce_createIconForFile (const File& file) +{ + return 0; +} -/** Setting this allows the build to use old Carbon libraries that will be - deprecated in newer versions of OSX. This is handy for some backwards-compatibility - reasons. -*/ -#ifndef JUCE_SUPPORT_CARBON - #define JUCE_SUPPORT_CARBON 1 -#endif +#if JUCE_OPENGL -/* These flags let you avoid the direct inclusion of some 3rd-party libs in the - codebase - you might need to use this if you're linking to some of these libraries - yourself. -*/ -#ifndef JUCE_INCLUDE_ZLIB_CODE - #define JUCE_INCLUDE_ZLIB_CODE 1 -#endif +class WindowedGLContext : public OpenGLContext +{ +public: + WindowedGLContext (Component* const component, + const OpenGLPixelFormat& pixelFormat_, + GLXContext sharedContext) + : renderContext (0), + embeddedWindow (0), + pixelFormat (pixelFormat_) + { + jassert (component != 0); + LinuxComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); + if (peer == 0) + return; -#ifndef JUCE_INCLUDE_FLAC_CODE - #define JUCE_INCLUDE_FLAC_CODE 1 -#endif + XSync (display, False); -#ifndef JUCE_INCLUDE_OGGVORBIS_CODE - #define JUCE_INCLUDE_OGGVORBIS_CODE 1 -#endif + GLint attribs [64]; + int n = 0; + attribs[n++] = GLX_RGBA; + attribs[n++] = GLX_DOUBLEBUFFER; + attribs[n++] = GLX_RED_SIZE; + attribs[n++] = pixelFormat.redBits; + attribs[n++] = GLX_GREEN_SIZE; + attribs[n++] = pixelFormat.greenBits; + attribs[n++] = GLX_BLUE_SIZE; + attribs[n++] = pixelFormat.blueBits; + attribs[n++] = GLX_ALPHA_SIZE; + attribs[n++] = pixelFormat.alphaBits; + attribs[n++] = GLX_DEPTH_SIZE; + attribs[n++] = pixelFormat.depthBufferBits; + attribs[n++] = GLX_STENCIL_SIZE; + attribs[n++] = pixelFormat.stencilBufferBits; + attribs[n++] = GLX_ACCUM_RED_SIZE; + attribs[n++] = pixelFormat.accumulationBufferRedBits; + attribs[n++] = GLX_ACCUM_GREEN_SIZE; + attribs[n++] = pixelFormat.accumulationBufferGreenBits; + attribs[n++] = GLX_ACCUM_BLUE_SIZE; + attribs[n++] = pixelFormat.accumulationBufferBlueBits; + attribs[n++] = GLX_ACCUM_ALPHA_SIZE; + attribs[n++] = pixelFormat.accumulationBufferAlphaBits; -#ifndef JUCE_INCLUDE_PNGLIB_CODE - #define JUCE_INCLUDE_PNGLIB_CODE 1 -#endif + // xxx not sure how to do fullSceneAntiAliasingNumSamples on linux.. -#ifndef JUCE_INCLUDE_JPEGLIB_CODE - #define JUCE_INCLUDE_JPEGLIB_CODE 1 -#endif + attribs[n++] = None; -/** Enable this to add extra memory-leak info to the new and delete operators. + XVisualInfo* const bestVisual = glXChooseVisual (display, DefaultScreen (display), attribs); - (Currently, this only affects Windows builds in debug mode). -*/ -#ifndef JUCE_CHECK_MEMORY_LEAKS - #define JUCE_CHECK_MEMORY_LEAKS 1 -#endif + if (bestVisual == 0) + return; -/** Enable this to turn on juce's internal catching of exceptions. + renderContext = glXCreateContext (display, bestVisual, sharedContext, GL_TRUE); - Turning it off will avoid any exception catching. With it on, all exceptions - are passed to the JUCEApplication::unhandledException() callback for logging. -*/ -#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS - #define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 -#endif + Window windowH = (Window) peer->getNativeHandle(); -/** If this macro is set, the Juce String class will use unicode as its - internal representation. If it isn't set, it'll use ANSI. -*/ -#ifndef JUCE_STRINGS_ARE_UNICODE - #define JUCE_STRINGS_ARE_UNICODE 1 -#endif + Colormap colourMap = XCreateColormap (display, windowH, bestVisual->visual, AllocNone); + XSetWindowAttributes swa; + swa.colormap = colourMap; + swa.border_pixel = 0; + swa.event_mask = ExposureMask | StructureNotifyMask; -#endif -/********* End of inlined file: juce_Config.h *********/ + embeddedWindow = XCreateWindow (display, windowH, + 0, 0, 1, 1, 0, + bestVisual->depth, + InputOutput, + bestVisual->visual, + CWBorderPixel | CWColormap | CWEventMask, + &swa); -#include -#include -#include -#include -#include -#include -#include + XSaveContext (display, (XID) embeddedWindow, improbableNumber, (XPointer) peer); -#if JUCE_USE_XINERAMA - /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. - */ - #include -#endif + XMapWindow (display, embeddedWindow); + XFreeColormap (display, colourMap); -#if JUCE_USE_XSHM - #include - #include - #include -#endif + XFree (bestVisual); + XSync (display, False); + } -#if JUCE_OPENGL - /* Got an include error here? + ~WindowedGLContext() + { + makeInactive(); - If you want to install OpenGL support, the packages to get are "mesa-common-dev" - and "freeglut3-dev". + glXDestroyContext (display, renderContext); - Alternatively, you can turn off the JUCE_OPENGL flag in juce_Config.h if you - want to disable it. - */ - #include -#endif + XUnmapWindow (display, embeddedWindow); + XDestroyWindow (display, embeddedWindow); + } -#undef KeyPress + bool makeActive() const throw() + { + jassert (renderContext != 0); -BEGIN_JUCE_NAMESPACE + return glXMakeCurrent (display, embeddedWindow, renderContext) + && XSync (display, False); + } -#define TAKE_FOCUS 0 -#define DELETE_WINDOW 1 + bool makeInactive() const throw() + { + return (! isActive()) || glXMakeCurrent (display, None, 0); + } -#define SYSTEM_TRAY_REQUEST_DOCK 0 -#define SYSTEM_TRAY_BEGIN_MESSAGE 1 -#define SYSTEM_TRAY_CANCEL_MESSAGE 2 + bool isActive() const throw() + { + return glXGetCurrentContext() == renderContext; + } -static const int repaintTimerPeriod = 1000 / 100; // 100 fps maximum + const OpenGLPixelFormat getPixelFormat() const + { + return pixelFormat; + } -static Atom wm_ChangeState = None; -static Atom wm_State = None; -static Atom wm_Protocols = None; -static Atom wm_ProtocolList [2] = { None, None }; -static Atom wm_ActiveWin = None; + void* getRawContext() const throw() + { + return renderContext; + } -#define ourDndVersion 3 -static Atom XA_XdndAware = None; -static Atom XA_XdndEnter = None; -static Atom XA_XdndLeave = None; -static Atom XA_XdndPosition = None; -static Atom XA_XdndStatus = None; -static Atom XA_XdndDrop = None; -static Atom XA_XdndFinished = None; -static Atom XA_XdndSelection = None; -static Atom XA_XdndProxy = None; + void updateWindowPosition (int x, int y, int w, int h, int) + { + XMoveResizeWindow (display, embeddedWindow, + x, y, jmax (1, w), jmax (1, h)); + } -static Atom XA_XdndTypeList = None; -static Atom XA_XdndActionList = None; -static Atom XA_XdndActionDescription = None; -static Atom XA_XdndActionCopy = None; -static Atom XA_XdndActionMove = None; -static Atom XA_XdndActionLink = None; -static Atom XA_XdndActionAsk = None; -static Atom XA_XdndActionPrivate = None; -static Atom XA_JXSelectionWindowProperty = None; + void swapBuffers() + { + glXSwapBuffers (display, embeddedWindow); + } -static Atom XA_MimeTextPlain = None; -static Atom XA_MimeTextUriList = None; -static Atom XA_MimeRootDrop = None; + bool setSwapInterval (const int numFramesPerSwap) + { + // xxx needs doing.. + return false; + } -static XErrorHandler oldHandler = 0; -static int trappedErrorCode = 0; + int getSwapInterval() const + { + // xxx needs doing.. + return 0; + } -extern "C" int errorTrapHandler (Display* dpy, XErrorEvent* err) + void repaint() + { + } + + juce_UseDebuggingNewOperator + + GLXContext renderContext; + +private: + Window embeddedWindow; + OpenGLPixelFormat pixelFormat; + + WindowedGLContext (const WindowedGLContext&); + const WindowedGLContext& operator= (const WindowedGLContext&); +}; + +OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, + const OpenGLPixelFormat& pixelFormat, + const OpenGLContext* const contextToShareWith) { - trappedErrorCode = err->error_code; - return 0; + WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, + contextToShareWith != 0 ? (GLXContext) contextToShareWith->getRawContext() : 0); + + if (c->renderContext == 0) + deleteAndZero (c); + + return c; } -static void trapErrors() +void juce_glViewport (const int w, const int h) { - trappedErrorCode = 0; - oldHandler = XSetErrorHandler (errorTrapHandler); + glViewport (0, 0, w, h); } -static bool untrapErrors() +void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, + OwnedArray & results) { - XSetErrorHandler (oldHandler); - return (trappedErrorCode == 0); + results.add (new OpenGLPixelFormat()); // xxx } -static bool isActiveApplication = false; +#endif -bool Process::isForegroundProcess() throw() +static void initClipboard (Window root, Atom* cutBuffers) throw() { - return isActiveApplication; -} + static bool init = false; -// (used in the messaging code, declared here for build reasons) -bool juce_isRunningAsApplication() -{ - return JUCEApplication::getInstance() != 0; -} + if (! init) + { + init = true; -// These are defined in juce_linux_Messaging.cpp -extern Display* display; -extern XContext improbableNumber; + // Make sure all cut buffers exist before use + for (int i = 0; i < 8; i++) + { + XChangeProperty (display, root, cutBuffers[i], + XA_STRING, 8, PropModeAppend, NULL, 0); + } + } +} -static const int eventMask = NoEventMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask - | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask - | ExposureMask | StructureNotifyMask | FocusChangeMask; +// Clipboard implemented currently using cut buffers +// rather than the more powerful selection method +void SystemClipboard::copyTextToClipboard (const String& clipText) throw() +{ + Window root = RootWindow (display, DefaultScreen (display)); + Atom cutBuffers[8] = { XA_CUT_BUFFER0, XA_CUT_BUFFER1, XA_CUT_BUFFER2, XA_CUT_BUFFER3, + XA_CUT_BUFFER4, XA_CUT_BUFFER5, XA_CUT_BUFFER6, XA_CUT_BUFFER7 }; -static int pointerMap[5]; -static int lastMousePosX = 0, lastMousePosY = 0; + initClipboard (root, cutBuffers); -enum MouseButtons -{ - NoButton = 0, - LeftButton = 1, - MiddleButton = 2, - RightButton = 3, - WheelUp = 4, - WheelDown = 5 -}; + XRotateWindowProperties (display, root, cutBuffers, 8, 1); + XChangeProperty (display, root, cutBuffers[0], + XA_STRING, 8, PropModeReplace, (const unsigned char*) (const char*) clipText, + clipText.length()); +} -static void getMousePos (int& x, int& y, int& mouseMods) throw() +const String SystemClipboard::getTextFromClipboard() throw() { - Window root, child; - int winx, winy; - unsigned int mask; + const int bufSize = 64; // in words + String returnData; + int byteOffset = 0; - mouseMods = 0; + Window root = RootWindow (display, DefaultScreen (display)); - if (XQueryPointer (display, - RootWindow (display, DefaultScreen (display)), - &root, &child, - &x, &y, &winx, &winy, &mask) == False) - { - // Pointer not on the default screen - x = y = -1; - } - else - { - if ((mask & Button1Mask) != 0) - mouseMods |= ModifierKeys::leftButtonModifier; - - if ((mask & Button2Mask) != 0) - mouseMods |= ModifierKeys::middleButtonModifier; - - if ((mask & Button3Mask) != 0) - mouseMods |= ModifierKeys::rightButtonModifier; - } -} - -static int AltMask = 0; -static int NumLockMask = 0; -static bool numLock = 0; -static bool capsLock = 0; -static char keyStates [32]; - -static void updateKeyStates (const int keycode, const bool press) throw() -{ - const int keybyte = keycode >> 3; - const int keybit = (1 << (keycode & 7)); - - if (press) - keyStates [keybyte] |= keybit; - else - keyStates [keybyte] &= ~keybit; -} - -static bool keyDown (const int keycode) throw() -{ - const int keybyte = keycode >> 3; - const int keybit = (1 << (keycode & 7)); - - return (keyStates [keybyte] & keybit) != 0; -} - -static const int extendedKeyModifier = 0x10000000; + Atom cutBuffers[8] = { XA_CUT_BUFFER0, XA_CUT_BUFFER1, XA_CUT_BUFFER2, XA_CUT_BUFFER3, + XA_CUT_BUFFER4, XA_CUT_BUFFER5, XA_CUT_BUFFER6, XA_CUT_BUFFER7 }; -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() -{ - int keysym; + initClipboard (root, cutBuffers); - if (keyCode & extendedKeyModifier) - { - keysym = 0xff00 | (keyCode & 0xff); - } - else + for (;;) { - keysym = keyCode; + unsigned long bytesLeft = 0, nitems = 0; + unsigned char* clipData = 0; + int actualFormat = 0; + Atom actualType; - if (keysym == (XK_Tab & 0xff) - || keysym == (XK_Return & 0xff) - || keysym == (XK_Escape & 0xff) - || keysym == (XK_BackSpace & 0xff)) + if (XGetWindowProperty (display, root, cutBuffers[0], byteOffset >> 2, bufSize, + False, XA_STRING, &actualType, &actualFormat, &nitems, &bytesLeft, + &clipData) == Success) { - keysym |= 0xff00; - } - } - - return keyDown (XKeysymToKeycode (display, keysym)); -} - -// Alt and Num lock are not defined by standard X -// modifier constants: check what they're mapped to -static void getModifierMapping() throw() -{ - const int altLeftCode = XKeysymToKeycode (display, XK_Alt_L); - const int numLockCode = XKeysymToKeycode (display, XK_Num_Lock); - - AltMask = 0; - NumLockMask = 0; - - XModifierKeymap* mapping = XGetModifierMapping (display); + if (actualType == XA_STRING && actualFormat == 8) + { + byteOffset += nitems; + returnData += String ((const char*) clipData, nitems); + } + else + { + bytesLeft = 0; + } - if (mapping) - { - for (int i = 0; i < 8; i++) - { - if (mapping->modifiermap [i << 1] == altLeftCode) - AltMask = 1 << i; - else if (mapping->modifiermap [i << 1] == numLockCode) - NumLockMask = 1 << i; + if (clipData != 0) + XFree (clipData); } - XFreeModifiermap (mapping); + if (bytesLeft == 0) + break; } -} -static int currentModifiers = 0; - -void ModifierKeys::updateCurrentModifiers() throw() -{ - currentModifierFlags = currentModifiers; + return returnData; } -const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) { - int x, y, mouseMods; - getMousePos (x, y, mouseMods); - - currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; - currentModifiers |= mouseMods; - - return ModifierKeys (currentModifiers); + jassertfalse // not implemented! + return false; } -static void updateKeyModifiers (const int status) throw() +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) { - currentModifiers &= ~(ModifierKeys::shiftModifier - | ModifierKeys::ctrlModifier - | ModifierKeys::altModifier); - - if (status & ShiftMask) - currentModifiers |= ModifierKeys::shiftModifier; - - if (status & ControlMask) - currentModifiers |= ModifierKeys::ctrlModifier; - - if (status & AltMask) - currentModifiers |= ModifierKeys::altModifier; - - numLock = ((status & NumLockMask) != 0); - capsLock = ((status & LockMask) != 0); + jassertfalse // not implemented! + return false; } -static bool updateKeyModifiersFromSym (KeySym sym, const bool press) throw() +void SystemTrayIconComponent::setIconImage (const Image& newImage) { - int modifier = 0; - bool isModifier = true; - - switch (sym) - { - case XK_Shift_L: - case XK_Shift_R: - modifier = ModifierKeys::shiftModifier; - break; - - case XK_Control_L: - case XK_Control_R: - modifier = ModifierKeys::ctrlModifier; - break; - - case XK_Alt_L: - case XK_Alt_R: - modifier = ModifierKeys::altModifier; - break; - - case XK_Num_Lock: - if (press) - numLock = ! numLock; - - break; - - case XK_Caps_Lock: - if (press) - capsLock = ! capsLock; - - break; - - case XK_Scroll_Lock: - break; + if (! isOnDesktop ()) + addToDesktop (0); - default: - isModifier = false; - break; - } + LinuxComponentPeer* const wp = dynamic_cast (getPeer()); - if (modifier != 0) + if (wp != 0) { - if (press) - currentModifiers |= modifier; - else - currentModifiers &= ~modifier; - } + wp->setTaskBarIcon (newImage); - return isModifier; + setVisible (true); + toFront (false); + repaint(); + } } -#if JUCE_USE_XSHM -static bool isShmAvailable() throw() +void SystemTrayIconComponent::paint (Graphics& g) { - static bool isChecked = false; - static bool isAvailable = false; + LinuxComponentPeer* const wp = dynamic_cast (getPeer()); - if (! isChecked) + if (wp != 0) { - isChecked = true; - - int major, minor; - Bool pixmaps; + const Image* const image = wp->getTaskbarIcon(); - if (XShmQueryVersion (display, &major, &minor, &pixmaps)) + if (image != 0) { - trapErrors(); - - XShmSegmentInfo segmentInfo; - zerostruct (segmentInfo); - XImage* xImage = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), - 24, ZPixmap, 0, &segmentInfo, 50, 50); - - if ((segmentInfo.shmid = shmget (IPC_PRIVATE, - xImage->bytes_per_line * xImage->height, - IPC_CREAT | 0777)) >= 0) - { - segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); - - if (segmentInfo.shmaddr != (void*) -1) - { - segmentInfo.readOnly = False; - xImage->data = segmentInfo.shmaddr; - XSync (display, False); - - if (XShmAttach (display, &segmentInfo) != 0) - { - XSync (display, False); - XShmDetach (display, &segmentInfo); - - isAvailable = true; - } - } - - XFlush (display); - XDestroyImage (xImage); - - shmdt (segmentInfo.shmaddr); - } - - shmctl (segmentInfo.shmid, IPC_RMID, 0); - - isAvailable &= untrapErrors(); + g.drawImageWithin (image, 0, 0, getWidth(), getHeight(), + RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, + false); } } - - return isAvailable; } -#endif -static Pixmap juce_createColourPixmapFromImage (Display* display, const Image& image) +void SystemTrayIconComponent::setIconTooltip (const String& tooltip) { - const int width = image.getWidth(); - const int height = image.getHeight(); - uint32* const colour = (uint32*) juce_malloc (width * height * sizeof (uint32)); - int index = 0; - - for (int y = 0; y < height; ++y) - for (int x = 0; x < width; ++x) - colour[index++] = image.getPixelAt (x, y).getARGB(); - - XImage* ximage = XCreateImage (display, CopyFromParent, 24, ZPixmap, - 0, (char*) colour, width, height, 32, 0); - - Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), - width, height, 24); - - GC gc = XCreateGC (display, pixmap, 0, 0); - XPutImage (display, pixmap, gc, ximage, 0, 0, 0, 0, width, height); - XFreeGC (display, gc); - juce_free (colour); - - return pixmap; + // xxx not yet implemented! } -static Pixmap juce_createMaskPixmapFromImage (Display* display, const Image& image) +void PlatformUtilities::beep() { - const int width = image.getWidth(); - const int height = image.getHeight(); - const int stride = (width + 7) >> 3; - uint8* const mask = (uint8*) juce_calloc (stride * height); - const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); - - for (int y = 0; y < height; ++y) - { - for (int x = 0; x < width; ++x) - { - const uint8 bit = (uint8) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); - const int offset = y * stride + (x >> 3); - - if (image.getPixelAt (x, y).getAlpha() >= 128) - mask[offset] |= bit; - } - } - - Pixmap pixmap = XCreatePixmapFromBitmapData (display, DefaultRootWindow (display), - (char*) mask, width, height, 1, 0, 1); - - juce_free (mask); - - return pixmap; + fprintf (stdout, "\a"); + fflush (stdout); } -class XBitmapImage : public Image +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) { -public: - - XBitmapImage (const PixelFormat format_, const int w, const int h, - const bool clearImage, const bool is16Bit_) - : Image (format_, w, h), - is16Bit (is16Bit_) - { - jassert (format_ == RGB || format_ == ARGB); - - pixelStride = (format_ == RGB) ? 3 : 4; - lineStride = ((w * pixelStride + 3) & ~3); - - Visual* const visual = DefaultVisual (display, DefaultScreen (display)); - -#if JUCE_USE_XSHM - usingXShm = false; - - if ((! is16Bit) && isShmAvailable()) - { - zerostruct (segmentInfo); - - xImage = XShmCreateImage (display, visual, 24, ZPixmap, 0, &segmentInfo, w, h); - - if (xImage != 0) - { - if ((segmentInfo.shmid = shmget (IPC_PRIVATE, - xImage->bytes_per_line * xImage->height, - IPC_CREAT | 0777)) >= 0) - { - segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); - - if (segmentInfo.shmaddr != (void*) -1) - { - segmentInfo.readOnly = False; + // xxx this is supposed to pop up an alert! + Logger::outputDebugString (title + ": " + bodyText); - xImage->data = segmentInfo.shmaddr; - imageData = (uint8*) segmentInfo.shmaddr; + // use a non-native one for the time being.. + if (isOkCancel) + return AlertWindow::showOkCancelBox (AlertWindow::NoIcon, title, bodyText); + else + AlertWindow::showMessageBox (AlertWindow::NoIcon, title, bodyText); - XSync (display, False); + return true; +} - if (XShmAttach (display, &segmentInfo) != 0) - { - XSync (display, False); - usingXShm = true; - } - else - { - jassertfalse - } - } - else - { - shmctl (segmentInfo.shmid, IPC_RMID, 0); - } - } - } - } +const int KeyPress::spaceKey = XK_space & 0xff; +const int KeyPress::returnKey = XK_Return & 0xff; +const int KeyPress::escapeKey = XK_Escape & 0xff; +const int KeyPress::backspaceKey = XK_BackSpace & 0xff; +const int KeyPress::leftKey = (XK_Left & 0xff) | extendedKeyModifier; +const int KeyPress::rightKey = (XK_Right & 0xff) | extendedKeyModifier; +const int KeyPress::upKey = (XK_Up & 0xff) | extendedKeyModifier; +const int KeyPress::downKey = (XK_Down & 0xff) | extendedKeyModifier; +const int KeyPress::pageUpKey = (XK_Page_Up & 0xff) | extendedKeyModifier; +const int KeyPress::pageDownKey = (XK_Page_Down & 0xff) | extendedKeyModifier; +const int KeyPress::endKey = (XK_End & 0xff) | extendedKeyModifier; +const int KeyPress::homeKey = (XK_Home & 0xff) | extendedKeyModifier; +const int KeyPress::insertKey = (XK_Insert & 0xff) | extendedKeyModifier; +const int KeyPress::deleteKey = (XK_Delete & 0xff) | extendedKeyModifier; +const int KeyPress::tabKey = XK_Tab & 0xff; +const int KeyPress::F1Key = (XK_F1 & 0xff) | extendedKeyModifier; +const int KeyPress::F2Key = (XK_F2 & 0xff) | extendedKeyModifier; +const int KeyPress::F3Key = (XK_F3 & 0xff) | extendedKeyModifier; +const int KeyPress::F4Key = (XK_F4 & 0xff) | extendedKeyModifier; +const int KeyPress::F5Key = (XK_F5 & 0xff) | extendedKeyModifier; +const int KeyPress::F6Key = (XK_F6 & 0xff) | extendedKeyModifier; +const int KeyPress::F7Key = (XK_F7 & 0xff) | extendedKeyModifier; +const int KeyPress::F8Key = (XK_F8 & 0xff) | extendedKeyModifier; +const int KeyPress::F9Key = (XK_F9 & 0xff) | extendedKeyModifier; +const int KeyPress::F10Key = (XK_F10 & 0xff) | extendedKeyModifier; +const int KeyPress::F11Key = (XK_F11 & 0xff) | extendedKeyModifier; +const int KeyPress::F12Key = (XK_F12 & 0xff) | extendedKeyModifier; +const int KeyPress::F13Key = (XK_F13 & 0xff) | extendedKeyModifier; +const int KeyPress::F14Key = (XK_F14 & 0xff) | extendedKeyModifier; +const int KeyPress::F15Key = (XK_F15 & 0xff) | extendedKeyModifier; +const int KeyPress::F16Key = (XK_F16 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad0 = (XK_KP_0 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad1 = (XK_KP_1 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad2 = (XK_KP_2 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad3 = (XK_KP_3 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad4 = (XK_KP_4 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad5 = (XK_KP_5 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad6 = (XK_KP_6 & 0xff) | extendedKeyModifier; +const int KeyPress::numberPad7 = (XK_KP_7 & 0xff)| extendedKeyModifier; +const int KeyPress::numberPad8 = (XK_KP_8 & 0xff)| extendedKeyModifier; +const int KeyPress::numberPad9 = (XK_KP_9 & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadAdd = (XK_KP_Add & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadSubtract = (XK_KP_Subtract & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadMultiply = (XK_KP_Multiply & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadDivide = (XK_KP_Divide & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadSeparator = (XK_KP_Separator & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadDecimalPoint = (XK_KP_Decimal & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadEquals = (XK_KP_Equal & 0xff)| extendedKeyModifier; +const int KeyPress::numberPadDelete = (XK_KP_Delete & 0xff)| extendedKeyModifier; +const int KeyPress::playKey = (0xffeeff00) | extendedKeyModifier; +const int KeyPress::stopKey = (0xffeeff01) | extendedKeyModifier; +const int KeyPress::fastForwardKey = (0xffeeff02) | extendedKeyModifier; +const int KeyPress::rewindKey = (0xffeeff03) | extendedKeyModifier; - if (! usingXShm) #endif - { - imageData = (uint8*) juce_malloc (lineStride * h); - - if (format_ == ARGB && clearImage) - zeromem (imageData, h * lineStride); - - xImage = (XImage*) juce_calloc (sizeof (XImage)); - - xImage->width = w; - xImage->height = h; - xImage->xoffset = 0; - xImage->format = ZPixmap; - xImage->data = (char*) imageData; - xImage->byte_order = ImageByteOrder (display); - xImage->bitmap_unit = BitmapUnit (display); - xImage->bitmap_bit_order = BitmapBitOrder (display); - xImage->bitmap_pad = 32; - xImage->depth = pixelStride * 8; - xImage->bytes_per_line = lineStride; - xImage->bits_per_pixel = pixelStride * 8; - xImage->red_mask = 0x00FF0000; - xImage->green_mask = 0x0000FF00; - xImage->blue_mask = 0x000000FF; - - if (is16Bit) - { - const int pixelStride = 2; - const int lineStride = ((w * pixelStride + 3) & ~3); - - xImage->data = (char*) juce_malloc (lineStride * h); - xImage->bitmap_pad = 16; - xImage->depth = pixelStride * 8; - xImage->bytes_per_line = lineStride; - xImage->bits_per_pixel = pixelStride * 8; - xImage->red_mask = visual->red_mask; - xImage->green_mask = visual->green_mask; - xImage->blue_mask = visual->blue_mask; - } +/********* End of inlined file: juce_linux_Windowing.cpp *********/ - if (! XInitImage (xImage)) - { - jassertfalse - } - } - } +/********* Start of inlined file: juce_linux_Audio.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - ~XBitmapImage() - { -#if JUCE_USE_XSHM - if (usingXShm) - { - XShmDetach (display, &segmentInfo); +#if JUCE_ALSA - XFlush (display); - XDestroyImage (xImage); +static const int maxNumChans = 64; - shmdt (segmentInfo.shmaddr); - shmctl (segmentInfo.shmid, IPC_RMID, 0); - } - else -#endif - { - juce_free (xImage->data); - xImage->data = 0; - XDestroyImage (xImage); - } +static void getDeviceSampleRates (snd_pcm_t* handle, Array & rates) +{ + const int ratesToTry[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 0 }; - if (! is16Bit) - imageData = 0; // to stop the base class freeing this (for the 16-bit version we want it to free it) - } + snd_pcm_hw_params_t* hwParams; + snd_pcm_hw_params_alloca (&hwParams); - void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy) + for (int i = 0; ratesToTry[i] != 0; ++i) { - static GC gc = 0; - - if (gc == 0) - gc = DefaultGC (display, DefaultScreen (display)); - - if (is16Bit) + if (snd_pcm_hw_params_any (handle, hwParams) >= 0 + && snd_pcm_hw_params_test_rate (handle, hwParams, ratesToTry[i], 0) == 0) { - const uint32 rMask = xImage->red_mask; - const uint32 rShiftL = jmax (0, getShiftNeeded (rMask)); - const uint32 rShiftR = jmax (0, -getShiftNeeded (rMask)); - const uint32 gMask = xImage->green_mask; - const uint32 gShiftL = jmax (0, getShiftNeeded (gMask)); - const uint32 gShiftR = jmax (0, -getShiftNeeded (gMask)); - const uint32 bMask = xImage->blue_mask; - const uint32 bShiftL = jmax (0, getShiftNeeded (bMask)); - const uint32 bShiftR = jmax (0, -getShiftNeeded (bMask)); - - int ls, ps; - const uint8* const pixels = lockPixelDataReadOnly (0, 0, getWidth(), getHeight(), ls, ps); - - for (int y = sy; y < sy + dh; ++y) - { - const uint8* p = pixels + y * ls + sx * ps; - - for (int x = sx; x < sx + dw; ++x) - { - const PixelRGB* const pixel = (const PixelRGB*) p; - p += ps; - - XPutPixel (xImage, x, y, - (((((uint32) pixel->getRed()) << rShiftL) >> rShiftR) & rMask) - | (((((uint32) pixel->getGreen()) << gShiftL) >> gShiftR) & gMask) - | (((((uint32) pixel->getBlue()) << bShiftL) >> bShiftR) & bMask)); - } - } - - releasePixelDataReadOnly (pixels); + rates.addIfNotAlreadyThere (ratesToTry[i]); } - - // blit results to screen. -#if JUCE_USE_XSHM - if (usingXShm) - XShmPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh, False); - else -#endif - XPutImage (display, (::Drawable) window, gc, xImage, sx, sy, dx, dy, dw, dh); } +} - juce_UseDebuggingNewOperator - -private: - XImage* xImage; - const bool is16Bit; - -#if JUCE_USE_XSHM - XShmSegmentInfo segmentInfo; - bool usingXShm; -#endif - - static int getShiftNeeded (const uint32 mask) throw() - { - for (int i = 32; --i >= 0;) - if (((mask >> i) & 1) != 0) - return i - 7; - - jassertfalse - return 0; - } -}; - -#define checkMessageManagerIsLocked jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager()); - -class LinuxComponentPeer : public ComponentPeer +static void getDeviceNumChannels (snd_pcm_t* handle, unsigned int* minChans, unsigned int* maxChans) { -public: - - LinuxComponentPeer (Component* const component, const int windowStyleFlags) - : ComponentPeer (component, windowStyleFlags), - windowH (0), - parentWindow (0), - wx (0), - wy (0), - ww (0), - wh (0), - taskbarImage (0), - fullScreen (false), - entered (false), - mapped (false) - { - // it's dangerous to create a window on a thread other than the message thread.. - checkMessageManagerIsLocked - - repainter = new LinuxRepaintManager (this); - - createWindow(); - - setTitle (component->getName()); - } - - ~LinuxComponentPeer() - { - // it's dangerous to delete a window on a thread other than the message thread.. - checkMessageManagerIsLocked - - deleteTaskBarIcon(); - deleteIconPixmaps(); - - destroyWindow(); - - windowH = 0; - delete repainter; - } - - void* getNativeHandle() const - { - return (void*) windowH; - } - - static LinuxComponentPeer* getPeerFor (Window windowHandle) throw() - { - XPointer peer = 0; - - if (! XFindContext (display, (XID) windowHandle, improbableNumber, &peer)) - { - if (peer != 0 && ! ((LinuxComponentPeer*) peer)->isValidMessageListener()) - peer = 0; - } - - return (LinuxComponentPeer*) peer; - } + snd_pcm_hw_params_t *params; + snd_pcm_hw_params_alloca (¶ms); - void setVisible (bool shouldBeVisible) + if (snd_pcm_hw_params_any (handle, params) >= 0) { - if (shouldBeVisible) - XMapWindow (display, windowH); - else - XUnmapWindow (display, windowH); + snd_pcm_hw_params_get_channels_min (params, minChans); + snd_pcm_hw_params_get_channels_max (params, maxChans); } +} - void setTitle (const String& title) - { - setWindowTitle (windowH, title); - } +static void getDeviceProperties (const String& id, + unsigned int& minChansOut, + unsigned int& maxChansOut, + unsigned int& minChansIn, + unsigned int& maxChansIn, + Array & rates) +{ + if (id.isEmpty()) + return; - void setPosition (int x, int y) - { - setBounds (x, y, ww, wh, false); - } + snd_ctl_t* handle; - void setSize (int w, int h) + if (snd_ctl_open (&handle, id.upToLastOccurrenceOf (T(","), false, false), SND_CTL_NONBLOCK) >= 0) { - setBounds (wx, wy, w, h, false); - } + snd_pcm_info_t* info; + snd_pcm_info_alloca (&info); - void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) - { - fullScreen = isNowFullScreen; + snd_pcm_info_set_stream (info, SND_PCM_STREAM_PLAYBACK); + snd_pcm_info_set_device (info, id.fromLastOccurrenceOf (T(","), false, false).getIntValue()); + snd_pcm_info_set_subdevice (info, 0); - if (windowH != 0) + if (snd_ctl_pcm_info (handle, info) >= 0) { - const ComponentDeletionWatcher deletionChecker (component); - - wx = x; - wy = y; - ww = jmax (1, w); - wh = jmax (1, h); - - // Make sure the Window manager does what we want - XSizeHints* hints = XAllocSizeHints(); - hints->flags = USSize | USPosition; - hints->width = ww; - hints->height = wh; - hints->x = wx; - hints->y = wy; - - if ((getStyleFlags() & (windowHasTitleBar | windowIsResizable)) == windowHasTitleBar) + snd_pcm_t* pcmHandle; + if (snd_pcm_open (&pcmHandle, id, SND_PCM_STREAM_PLAYBACK, SND_PCM_ASYNC | SND_PCM_NONBLOCK ) >= 0) { - hints->min_width = hints->max_width = hints->width; - hints->min_height = hints->max_height = hints->height; - hints->flags |= PMinSize | PMaxSize; - } - - XSetWMNormalHints (display, windowH, hints); - XFree (hints); - - XMoveResizeWindow (display, windowH, - wx - windowBorder.getLeft(), - wy - windowBorder.getTop(), ww, wh); + getDeviceNumChannels (pcmHandle, &minChansOut, &maxChansOut); + getDeviceSampleRates (pcmHandle, rates); - if (! deletionChecker.hasBeenDeleted()) - { - updateBorderSize(); - handleMovedOrResized(); + snd_pcm_close (pcmHandle); } } - } - void getBounds (int& x, int& y, int& w, int& h) const - { - x = wx; - y = wy; - w = ww; - h = wh; - } - - int getScreenX() const - { - return wx; - } - - int getScreenY() const - { - return wy; - } - - void relativePositionToGlobal (int& x, int& y) - { - x += wx; - y += wy; - } - - void globalPositionToRelative (int& x, int& y) - { - x -= wx; - y -= wy; - } - - void setMinimised (bool shouldBeMinimised) - { - if (shouldBeMinimised) - { - Window root = RootWindow (display, DefaultScreen (display)); - - XClientMessageEvent clientMsg; - clientMsg.display = display; - clientMsg.window = windowH; - clientMsg.type = ClientMessage; - clientMsg.format = 32; - clientMsg.message_type = wm_ChangeState; - clientMsg.data.l[0] = IconicState; - - XSendEvent (display, root, false, - SubstructureRedirectMask | SubstructureNotifyMask, - (XEvent*) &clientMsg); - } - else - { - setVisible (true); - } - } - - bool isMinimised() const - { - bool minimised = false; - - unsigned char* stateProp; - unsigned long nitems, bytesLeft; - Atom actualType; - int actualFormat; - - if (XGetWindowProperty (display, windowH, wm_State, 0, 64, False, - wm_State, &actualType, &actualFormat, &nitems, &bytesLeft, - &stateProp) == Success - && actualType == wm_State - && actualFormat == 32 - && nitems > 0) - { - if (((unsigned long*) stateProp)[0] == IconicState) - minimised = true; - - XFree (stateProp); - } - - return minimised; - } - - void setFullScreen (const bool shouldBeFullScreen) - { - Rectangle r (lastNonFullscreenBounds); // (get a copy of this before de-minimising) - - setMinimised (false); - - if (fullScreen != shouldBeFullScreen) - { - if (shouldBeFullScreen) - r = Desktop::getInstance().getMainMonitorArea(); - - if (! r.isEmpty()) - setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); - - getComponent()->repaint(); - } - } - - bool isFullScreen() const - { - return fullScreen; - } - - bool isChildWindowOf (Window possibleParent) const - { - Window* windowList = 0; - uint32 windowListSize = 0; - Window parent, root; - - if (XQueryTree (display, windowH, &root, &parent, &windowList, &windowListSize) != 0) - { - if (windowList != 0) - XFree (windowList); - - return parent == possibleParent; - } - - return false; - } - - bool isFrontWindow() const - { - Window* windowList = 0; - uint32 windowListSize = 0; - bool result = false; - - Window parent, root = RootWindow (display, DefaultScreen (display)); + snd_pcm_info_set_stream (info, SND_PCM_STREAM_CAPTURE); - if (XQueryTree (display, root, &root, &parent, &windowList, &windowListSize) != 0) + if (snd_ctl_pcm_info (handle, info) >= 0) { - for (int i = windowListSize; --i >= 0;) + snd_pcm_t* pcmHandle; + if (snd_pcm_open (&pcmHandle, id, SND_PCM_STREAM_CAPTURE, SND_PCM_ASYNC | SND_PCM_NONBLOCK ) >= 0) { - LinuxComponentPeer* const peer = LinuxComponentPeer::getPeerFor (windowList[i]); - - if (peer != 0) - { - result = (peer == this); - break; - } - } - } - - if (windowList != 0) - XFree (windowList); - - return result; - } - - bool contains (int x, int y, bool trueIfInAChildWindow) const - { - jassert (x >= 0 && y >= 0 && x < ww && y < wh); // should only be called for points that are actually inside the bounds - - if (((unsigned int) x) >= (unsigned int) ww - || ((unsigned int) y) >= (unsigned int) wh) - return false; - - bool inFront = false; + getDeviceNumChannels (pcmHandle, &minChansIn, &maxChansIn); - for (int i = 0; i < Desktop::getInstance().getNumComponents(); ++i) - { - Component* const c = Desktop::getInstance().getComponent (i); + if (rates.size() == 0) + getDeviceSampleRates (pcmHandle, rates); - if (inFront) - { - if (c->contains (x + wx - c->getScreenX(), - y + wy - c->getScreenY())) - { - return false; - } - } - else if (c == getComponent()) - { - inFront = true; + snd_pcm_close (pcmHandle); } } - if (trueIfInAChildWindow) - return true; - - ::Window root, child; - unsigned int bw, depth; - int wx, wy, w, h; - - if (! XGetGeometry (display, (::Drawable) windowH, &root, - &wx, &wy, (unsigned int*) &w, (unsigned int*) &h, - &bw, &depth)) - { - return false; - } - - if (! XTranslateCoordinates (display, windowH, windowH, x, y, &wx, &wy, &child)) - return false; - - return child == None; - } - - const BorderSize getFrameSize() const - { - return BorderSize(); - } - - bool setAlwaysOnTop (bool alwaysOnTop) - { - if (windowH != 0) - { - const bool wasVisible = component->isVisible(); - - if (wasVisible) - setVisible (false); // doesn't always seem to work if the window is visible when this is done.. - - XSetWindowAttributes swa; - swa.override_redirect = alwaysOnTop ? True : False; - - XChangeWindowAttributes (display, windowH, CWOverrideRedirect, &swa); - - if (wasVisible) - setVisible (true); - } - - return true; - } - - void toFront (bool makeActive) - { - if (makeActive) - { - setVisible (true); - grabFocus(); - } - - XEvent ev; - ev.xclient.type = ClientMessage; - ev.xclient.serial = 0; - ev.xclient.send_event = True; - ev.xclient.message_type = wm_ActiveWin; - ev.xclient.window = windowH; - ev.xclient.format = 32; - ev.xclient.data.l[0] = 2; - ev.xclient.data.l[1] = CurrentTime; - ev.xclient.data.l[2] = 0; - ev.xclient.data.l[3] = 0; - ev.xclient.data.l[4] = 0; - - XSendEvent (display, RootWindow (display, DefaultScreen (display)), - False, - SubstructureRedirectMask | SubstructureNotifyMask, - &ev); - - XWindowAttributes attr; - XGetWindowAttributes (display, windowH, &attr); - - if (attr.override_redirect) - XRaiseWindow (display, windowH); - - XSync (display, False); - - handleBroughtToFront(); + snd_ctl_close (handle); } +} - void toBehind (ComponentPeer* other) +class ALSADevice +{ +public: + ALSADevice (const String& id, + const bool forInput) + : handle (0), + bitDepth (16), + numChannelsRunning (0), + isInput (forInput), + sampleFormat (AudioDataConverters::int16LE) { - LinuxComponentPeer* const otherPeer = dynamic_cast (other); - jassert (otherPeer != 0); // wrong type of window? - - if (otherPeer != 0) - { - setMinimised (false); - - Window newStack[] = { otherPeer->windowH, windowH }; - - XRestackWindows (display, newStack, 2); - } + failed (snd_pcm_open (&handle, id, + forInput ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, + SND_PCM_ASYNC)); } - bool isFocused() const + ~ALSADevice() { - int revert; - Window focusedWindow = 0; - XGetInputFocus (display, &focusedWindow, &revert); - - return focusedWindow == windowH; + if (handle != 0) + snd_pcm_close (handle); } - void grabFocus() + bool setParameters (unsigned int sampleRate, int numChannels, int bufferSize) { - XWindowAttributes atts; + if (handle == 0) + return false; - if (windowH != 0 - && XGetWindowAttributes (display, windowH, &atts) - && atts.map_state == IsViewable - && ! isFocused()) - { - XSetInputFocus (display, windowH, RevertToParent, CurrentTime); - isActiveApplication = true; - } - } + snd_pcm_hw_params_t* hwParams; + snd_pcm_hw_params_alloca (&hwParams); - void textInputRequired (int /*x*/, int /*y*/) - { - } + if (failed (snd_pcm_hw_params_any (handle, hwParams))) + return false; - void repaint (int x, int y, int w, int h) - { - if (Rectangle::intersectRectangles (x, y, w, h, - 0, 0, - getComponent()->getWidth(), - getComponent()->getHeight())) + if (snd_pcm_hw_params_set_access (handle, hwParams, SND_PCM_ACCESS_RW_NONINTERLEAVED) >= 0) + isInterleaved = false; + else if (snd_pcm_hw_params_set_access (handle, hwParams, SND_PCM_ACCESS_RW_INTERLEAVED) >= 0) + isInterleaved = true; + else { - repainter->repaint (x, y, w, h); + jassertfalse + return false; } - } - - void performAnyPendingRepaintsNow() - { - repainter->performAnyPendingRepaintsNow(); - } - - void setIcon (const Image& newIcon) - { - const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2; - unsigned long* const data = (unsigned long*) juce_malloc (dataSize * sizeof (uint32)); - - int index = 0; - data[index++] = newIcon.getWidth(); - data[index++] = newIcon.getHeight(); - - for (int y = 0; y < newIcon.getHeight(); ++y) - for (int x = 0; x < newIcon.getWidth(); ++x) - data[index++] = newIcon.getPixelAt (x, y).getARGB(); - - XChangeProperty (display, windowH, - XInternAtom (display, "_NET_WM_ICON", False), - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*) data, dataSize); - - juce_free (data); - - deleteIconPixmaps(); - - XWMHints* wmHints = XGetWMHints (display, windowH); - - if (wmHints == 0) - wmHints = XAllocWMHints(); - - wmHints->flags |= IconPixmapHint | IconMaskHint; - wmHints->icon_pixmap = juce_createColourPixmapFromImage (display, newIcon); - wmHints->icon_mask = juce_createMaskPixmapFromImage (display, newIcon); - - XSetWMHints (display, windowH, wmHints); - XFree (wmHints); - - XSync (display, False); - } - - void deleteIconPixmaps() - { - XWMHints* wmHints = XGetWMHints (display, windowH); - if (wmHints != 0) - { - if ((wmHints->flags & IconPixmapHint) != 0) - { - wmHints->flags &= ~IconPixmapHint; - XFreePixmap (display, wmHints->icon_pixmap); - } - - if ((wmHints->flags & IconMaskHint) != 0) - { - wmHints->flags &= ~IconMaskHint; - XFreePixmap (display, wmHints->icon_mask); - } - - XSetWMHints (display, windowH, wmHints); - XFree (wmHints); - } - } + const int formatsToTry[] = { SND_PCM_FORMAT_FLOAT_LE, 32, AudioDataConverters::float32LE, + SND_PCM_FORMAT_FLOAT_BE, 32, AudioDataConverters::float32BE, + SND_PCM_FORMAT_S32_LE, 32, AudioDataConverters::int32LE, + SND_PCM_FORMAT_S32_BE, 32, AudioDataConverters::int32BE, + SND_PCM_FORMAT_S24_3LE, 24, AudioDataConverters::int24LE, + SND_PCM_FORMAT_S24_3BE, 24, AudioDataConverters::int24BE, + SND_PCM_FORMAT_S16_LE, 16, AudioDataConverters::int16LE, + SND_PCM_FORMAT_S16_BE, 16, AudioDataConverters::int16BE }; + bitDepth = 0; - void handleWindowMessage (XEvent* event) - { - switch (event->xany.type) + for (int i = 0; i < numElementsInArray (formatsToTry); i += 3) { - case 2: // 'KeyPress' - { - XKeyEvent* const keyEvent = (XKeyEvent*) &event->xkey; - updateKeyStates (keyEvent->keycode, true); - - char utf8 [64]; - zeromem (utf8, sizeof (utf8)); - KeySym sym; - XLookupString (keyEvent, utf8, sizeof (utf8), &sym, 0); - - const juce_wchar unicodeChar = *(const juce_wchar*) String::fromUTF8 ((const uint8*) utf8, sizeof (utf8) - 1); - int keyCode = (int) unicodeChar; - - if (keyCode < 0x20) - keyCode = XKeycodeToKeysym (display, keyEvent->keycode, - (currentModifiers & ModifierKeys::shiftModifier) != 0 ? 1 : 0); - - const int oldMods = currentModifiers; - bool keyPressed = false; - - const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, true); - - if ((sym & 0xff00) == 0xff00) - { - // Translate keypad - if (sym == XK_KP_Divide) - keyCode = XK_slash; - else if (sym == XK_KP_Multiply) - keyCode = XK_asterisk; - else if (sym == XK_KP_Subtract) - keyCode = XK_hyphen; - else if (sym == XK_KP_Add) - keyCode = XK_plus; - else if (sym == XK_KP_Enter) - keyCode = XK_Return; - else if (sym == XK_KP_Decimal) - keyCode = numLock ? XK_period : XK_Delete; - else if (sym == XK_KP_0) - keyCode = numLock ? XK_0 : XK_Insert; - else if (sym == XK_KP_1) - keyCode = numLock ? XK_1 : XK_End; - else if (sym == XK_KP_2) - keyCode = numLock ? XK_2 : XK_Down; - else if (sym == XK_KP_3) - keyCode = numLock ? XK_3 : XK_Page_Down; - else if (sym == XK_KP_4) - keyCode = numLock ? XK_4 : XK_Left; - else if (sym == XK_KP_5) - keyCode = XK_5; - else if (sym == XK_KP_6) - keyCode = numLock ? XK_6 : XK_Right; - else if (sym == XK_KP_7) - keyCode = numLock ? XK_7 : XK_Home; - else if (sym == XK_KP_8) - keyCode = numLock ? XK_8 : XK_Up; - else if (sym == XK_KP_9) - keyCode = numLock ? XK_9 : XK_Page_Up; - - switch (sym) - { - case XK_Left: - case XK_Right: - case XK_Up: - case XK_Down: - case XK_Page_Up: - case XK_Page_Down: - case XK_End: - case XK_Home: - case XK_Delete: - case XK_Insert: - keyPressed = true; - keyCode = (sym & 0xff) | extendedKeyModifier; - break; - case XK_Tab: - case XK_Return: - case XK_Escape: - case XK_BackSpace: - keyPressed = true; - keyCode &= 0xff; - break; - default: - { - if (sym >= XK_F1 && sym <= XK_F16) - { - keyPressed = true; - keyCode = (sym & 0xff) | extendedKeyModifier; - } - break; - } - } - } - - if (utf8[0] != 0 || ((sym & 0xff00) == 0 && sym >= 8)) - keyPressed = true; - - if (oldMods != currentModifiers) - handleModifierKeysChange(); - - if (keyDownChange) - handleKeyUpOrDown (true); - - if (keyPressed) - handleKeyPress (keyCode, unicodeChar); - - break; - } - - case KeyRelease: - { - const XKeyEvent* const keyEvent = (const XKeyEvent*) &event->xkey; - updateKeyStates (keyEvent->keycode, false); - - KeySym sym = XKeycodeToKeysym (display, keyEvent->keycode, 0); - - const int oldMods = currentModifiers; - const bool keyDownChange = (sym != NoSymbol) && ! updateKeyModifiersFromSym (sym, false); - - if (oldMods != currentModifiers) - handleModifierKeysChange(); - - if (keyDownChange) - handleKeyUpOrDown (false); - - break; - } - - case ButtonPress: - { - const XButtonPressedEvent* const buttonPressEvent = (const XButtonPressedEvent*) &event->xbutton; - - bool buttonMsg = false; - bool wheelUpMsg = false; - bool wheelDownMsg = false; - - const int map = pointerMap [buttonPressEvent->button - Button1]; - - if (map == LeftButton) - { - currentModifiers |= ModifierKeys::leftButtonModifier; - buttonMsg = true; - } - else if (map == RightButton) - { - currentModifiers |= ModifierKeys::rightButtonModifier; - buttonMsg = true; - } - else if (map == MiddleButton) - { - currentModifiers |= ModifierKeys::middleButtonModifier; - buttonMsg = true; - } - else if (map == WheelUp) - { - wheelUpMsg = true; - } - else if (map == WheelDown) - { - wheelDownMsg = true; - } - - updateKeyModifiers (buttonPressEvent->state); - - if (buttonMsg) - { - toFront (true); - handleMouseDown (buttonPressEvent->x, buttonPressEvent->y, - getEventTime (buttonPressEvent->time)); - } - else if (wheelUpMsg || wheelDownMsg) - { - handleMouseWheel (0, wheelDownMsg ? -84 : 84, - getEventTime (buttonPressEvent->time)); - } - - lastMousePosX = lastMousePosY = 0x100000; - break; - } - - case ButtonRelease: - { - const XButtonReleasedEvent* const buttonRelEvent = (const XButtonReleasedEvent*) &event->xbutton; - - const int oldModifiers = currentModifiers; - const int map = pointerMap [buttonRelEvent->button - Button1]; - - if (map == LeftButton) - currentModifiers &= ~ModifierKeys::leftButtonModifier; - else if (map == RightButton) - currentModifiers &= ~ModifierKeys::rightButtonModifier; - else if (map == MiddleButton) - currentModifiers &= ~ModifierKeys::middleButtonModifier; - - updateKeyModifiers (buttonRelEvent->state); - - handleMouseUp (oldModifiers, - buttonRelEvent->x, buttonRelEvent->y, - getEventTime (buttonRelEvent->time)); - - lastMousePosX = lastMousePosY = 0x100000; - break; - } - - case MotionNotify: - { - const XPointerMovedEvent* const movedEvent = (const XPointerMovedEvent*) &event->xmotion; - - updateKeyModifiers (movedEvent->state); - - int x, y, mouseMods; - getMousePos (x, y, mouseMods); - - if (lastMousePosX != x || lastMousePosY != y) - { - lastMousePosX = x; - lastMousePosY = y; - - if (parentWindow != 0 && (styleFlags & windowHasTitleBar) == 0) - { - Window wRoot = 0, wParent = 0; - Window* wChild = 0; - unsigned int numChildren; - XQueryTree (display, windowH, &wRoot, &wParent, &wChild, &numChildren); - - if (wParent != 0 - && wParent != windowH - && wParent != wRoot) - { - parentWindow = wParent; - updateBounds(); - x -= getScreenX(); - y -= getScreenY(); - } - else - { - parentWindow = 0; - x -= getScreenX(); - y -= getScreenY(); - } - } - else - { - x -= getScreenX(); - y -= getScreenY(); - } - - if ((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0) - handleMouseMove (x, y, getEventTime (movedEvent->time)); - else - handleMouseDrag (x, y, getEventTime (movedEvent->time)); - } - - break; - } - - case EnterNotify: - { - lastMousePosX = lastMousePosY = 0x100000; - const XEnterWindowEvent* const enterEvent = (const XEnterWindowEvent*) &event->xcrossing; - - if ((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0 - && ! entered) - { - updateKeyModifiers (enterEvent->state); - - handleMouseEnter (enterEvent->x, enterEvent->y, getEventTime (enterEvent->time)); - - entered = true; - } - - break; - } - - case LeaveNotify: - { - const XLeaveWindowEvent* const leaveEvent = (const XLeaveWindowEvent*) &event->xcrossing; - - // Suppress the normal leave if we've got a pointer grab, or if - // it's a bogus one caused by clicking a mouse button when running - // in a Window manager - if (((currentModifiers & ModifierKeys::allMouseButtonModifiers) == 0 - && leaveEvent->mode == NotifyNormal) - || leaveEvent->mode == NotifyUngrab) - { - updateKeyModifiers (leaveEvent->state); - - handleMouseExit (leaveEvent->x, leaveEvent->y, getEventTime (leaveEvent->time)); - - entered = false; - } - - break; - } - - case FocusIn: - { - isActiveApplication = true; - if (isFocused()) - handleFocusGain(); - - break; - } - - case FocusOut: - { - isActiveApplication = false; - if (! isFocused()) - handleFocusLoss(); - - break; - } - - case Expose: - { - // Batch together all pending expose events - XExposeEvent* exposeEvent = (XExposeEvent*) &event->xexpose; - XEvent nextEvent; - - if (exposeEvent->window != windowH) - { - Window child; - XTranslateCoordinates (display, exposeEvent->window, windowH, - exposeEvent->x, exposeEvent->y, &exposeEvent->x, &exposeEvent->y, - &child); - } - - repaint (exposeEvent->x, exposeEvent->y, - exposeEvent->width, exposeEvent->height); - - while (XEventsQueued (display, QueuedAfterFlush) > 0) - { - XPeekEvent (display, (XEvent*) &nextEvent); - if (nextEvent.type != Expose || nextEvent.xany.window != event->xany.window) - break; - - XNextEvent (display, (XEvent*) &nextEvent); - XExposeEvent* nextExposeEvent = (XExposeEvent*) &nextEvent.xexpose; - repaint (nextExposeEvent->x, nextExposeEvent->y, - nextExposeEvent->width, nextExposeEvent->height); - } - - break; - } - - case CirculateNotify: - case CreateNotify: - case DestroyNotify: - // Think we can ignore these - break; - - case ConfigureNotify: - { - updateBounds(); - updateBorderSize(); - handleMovedOrResized(); - - // if the native title bar is dragged, need to tell any active menus, etc. - if ((styleFlags & windowHasTitleBar) != 0 - && component->isCurrentlyBlockedByAnotherModalComponent()) - { - Component* const currentModalComp = Component::getCurrentlyModalComponent(); - - if (currentModalComp != 0) - currentModalComp->inputAttemptWhenModal(); - } - - XConfigureEvent* const confEvent = (XConfigureEvent*) &event->xconfigure; - - if (confEvent->window == windowH - && confEvent->above != 0 - && isFrontWindow()) - { - handleBroughtToFront(); - } - - break; - } - - case ReparentNotify: - case GravityNotify: - { - parentWindow = 0; - Window wRoot = 0; - Window* wChild = 0; - unsigned int numChildren; - XQueryTree (display, windowH, &wRoot, &parentWindow, &wChild, &numChildren); - - if (parentWindow == windowH || parentWindow == wRoot) - parentWindow = 0; - - updateBounds(); - updateBorderSize(); - handleMovedOrResized(); - break; - } - - case MapNotify: - mapped = true; - handleBroughtToFront(); - break; - - case UnmapNotify: - mapped = false; - break; - - case MappingNotify: - { - XMappingEvent* mappingEvent = (XMappingEvent*) &event->xmapping; - - if (mappingEvent->request != MappingPointer) - { - // Deal with modifier/keyboard mapping - XRefreshKeyboardMapping (mappingEvent); - getModifierMapping(); - } - - break; - } - - case ClientMessage: + if (snd_pcm_hw_params_set_format (handle, hwParams, (_snd_pcm_format) formatsToTry [i]) >= 0) { - const XClientMessageEvent* const clientMsg = (const XClientMessageEvent*) &event->xclient; - - if (clientMsg->message_type == wm_Protocols && clientMsg->format == 32) - { - const Atom atom = (Atom) clientMsg->data.l[0]; - - if (atom == wm_ProtocolList [TAKE_FOCUS]) - { - XWindowAttributes atts; - - if (clientMsg->window != 0 - && XGetWindowAttributes (display, clientMsg->window, &atts)) - { - if (atts.map_state == IsViewable) - XSetInputFocus (display, clientMsg->window, RevertToParent, clientMsg->data.l[1]); - } - } - else if (atom == wm_ProtocolList [DELETE_WINDOW]) - { - handleUserClosingWindow(); - } - } - else if (clientMsg->message_type == XA_XdndEnter) - { - handleDragAndDropEnter (clientMsg); - } - else if (clientMsg->message_type == XA_XdndLeave) - { - resetDragAndDrop(); - } - else if (clientMsg->message_type == XA_XdndPosition) - { - handleDragAndDropPosition (clientMsg); - } - else if (clientMsg->message_type == XA_XdndDrop) - { - handleDragAndDropDrop (clientMsg); - } - else if (clientMsg->message_type == XA_XdndStatus) - { - handleDragAndDropStatus (clientMsg); - } - else if (clientMsg->message_type == XA_XdndFinished) - { - resetDragAndDrop(); - } - + bitDepth = formatsToTry [i + 1]; + sampleFormat = (AudioDataConverters::DataFormat) formatsToTry [i + 2]; break; } - - case SelectionNotify: - handleDragAndDropSelection (event); - break; - - case SelectionClear: - case SelectionRequest: - break; - - default: - break; - } - } - - void showMouseCursor (Cursor cursor) throw() - { - XDefineCursor (display, windowH, cursor); - } - - void setTaskBarIcon (const Image& image) - { - deleteTaskBarIcon(); - taskbarImage = image.createCopy(); - - Screen* const screen = XDefaultScreenOfDisplay (display); - const int screenNumber = XScreenNumberOfScreen (screen); - - char screenAtom[32]; - snprintf (screenAtom, sizeof (screenAtom), "_NET_SYSTEM_TRAY_S%d", screenNumber); - Atom selectionAtom = XInternAtom (display, screenAtom, false); - - XGrabServer (display); - Window managerWin = XGetSelectionOwner (display, selectionAtom); - - if (managerWin != None) - XSelectInput (display, managerWin, StructureNotifyMask); - - XUngrabServer (display); - XFlush (display); - - if (managerWin != None) - { - XEvent ev; - zerostruct (ev); - ev.xclient.type = ClientMessage; - ev.xclient.window = managerWin; - ev.xclient.message_type = XInternAtom (display, "_NET_SYSTEM_TRAY_OPCODE", False); - ev.xclient.format = 32; - ev.xclient.data.l[0] = CurrentTime; - ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK; - ev.xclient.data.l[2] = windowH; - ev.xclient.data.l[3] = 0; - ev.xclient.data.l[4] = 0; - - XSendEvent (display, managerWin, False, NoEventMask, &ev); - XSync (display, False); } - // For older KDE's ... - long atomData = 1; - Atom trayAtom = XInternAtom (display, "KWM_DOCKWINDOW", false); - XChangeProperty (display, windowH, trayAtom, trayAtom, 32, PropModeReplace, (unsigned char*) &atomData, 1); - - // 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() - { - deleteAndZero (taskbarImage); - } - - const Image* getTaskbarIcon() const throw() { return taskbarImage; } - - juce_UseDebuggingNewOperator - - bool dontRepaint; - -private: - - class LinuxRepaintManager : public Timer - { - public: - LinuxRepaintManager (LinuxComponentPeer* const peer_) - : peer (peer_), - image (0), - lastTimeImageUsed (0) + if (bitDepth == 0) { -#if JUCE_USE_XSHM - useARGBImagesForRendering = isShmAvailable(); - - if (useARGBImagesForRendering) - { - XShmSegmentInfo segmentinfo; - - XImage* const testImage - = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), - 24, ZPixmap, 0, &segmentinfo, 64, 64); - - useARGBImagesForRendering = (testImage->bits_per_pixel == 32); - XDestroyImage (testImage); - } -#endif + error = "device doesn't support a compatible PCM format"; + DBG (T("ALSA error: ") + error + T("\n")); + return false; } - ~LinuxRepaintManager() - { - delete image; - } + int dir = 0; + unsigned int periods = 4; + snd_pcm_uframes_t samplesPerPeriod = bufferSize; - void timerCallback() + if (failed (snd_pcm_hw_params_set_rate_near (handle, hwParams, &sampleRate, 0)) + || failed (snd_pcm_hw_params_set_channels (handle, hwParams, numChannels)) + || failed (snd_pcm_hw_params_set_periods_near (handle, hwParams, &periods, &dir)) + || failed (snd_pcm_hw_params_set_period_size_near (handle, hwParams, &samplesPerPeriod, &dir)) + || failed (snd_pcm_hw_params (handle, hwParams))) { - if (! regionsNeedingRepaint.isEmpty()) - { - stopTimer(); - performAnyPendingRepaintsNow(); - } - else if (Time::getApproximateMillisecondCounter() > lastTimeImageUsed + 3000) - { - stopTimer(); - deleteAndZero (image); - } + return false; } - void repaint (int x, int y, int w, int h) - { - if (! isTimerRunning()) - startTimer (repaintTimerPeriod); - - regionsNeedingRepaint.add (x, y, w, h); - } + snd_pcm_sw_params_t* swParams; + snd_pcm_sw_params_alloca (&swParams); + snd_pcm_uframes_t boundary; - void performAnyPendingRepaintsNow() + if (failed (snd_pcm_sw_params_current (handle, swParams)) + || failed (snd_pcm_sw_params_get_boundary (swParams, &boundary)) + || failed (snd_pcm_sw_params_set_silence_threshold (handle, swParams, 0)) + || failed (snd_pcm_sw_params_set_silence_size (handle, swParams, boundary)) + || failed (snd_pcm_sw_params_set_start_threshold (handle, swParams, samplesPerPeriod)) + || failed (snd_pcm_sw_params_set_stop_threshold (handle, swParams, boundary)) + || failed (snd_pcm_sw_params (handle, swParams))) { - peer->clearMaskedRegion(); - - const Rectangle totalArea (regionsNeedingRepaint.getBounds()); - - if (! totalArea.isEmpty()) - { - if (image == 0 || image->getWidth() < totalArea.getWidth() - || image->getHeight() < totalArea.getHeight()) - { - delete image; - -#if JUCE_USE_XSHM - image = new XBitmapImage (useARGBImagesForRendering ? Image::ARGB - : Image::RGB, -#else - image = new XBitmapImage (Image::RGB, -#endif - (totalArea.getWidth() + 31) & ~31, - (totalArea.getHeight() + 31) & ~31, - false, - peer->depthIs16Bit); - } - - startTimer (repaintTimerPeriod); - - LowLevelGraphicsSoftwareRenderer context (*image); - - context.setOrigin (-totalArea.getX(), -totalArea.getY()); - - if (context.reduceClipRegion (regionsNeedingRepaint)) - peer->handlePaint (context); - - if (! peer->maskedRegion.isEmpty()) - regionsNeedingRepaint.subtract (peer->maskedRegion); - - for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) - { - const Rectangle& r = *i.getRectangle(); - - image->blitToWindow (peer->windowH, - r.getX(), r.getY(), r.getWidth(), r.getHeight(), - r.getX() - totalArea.getX(), r.getY() - totalArea.getY()); - } - } - - regionsNeedingRepaint.clear(); - - lastTimeImageUsed = Time::getApproximateMillisecondCounter(); - startTimer (repaintTimerPeriod); + return false; } - private: - LinuxComponentPeer* const peer; - XBitmapImage* image; - uint32 lastTimeImageUsed; - RectangleList regionsNeedingRepaint; - -#if JUCE_USE_XSHM - bool useARGBImagesForRendering; + /* +#ifdef JUCE_DEBUG + // enable this to dump the config of the devices that get opened + snd_output_t* out; + snd_output_stdio_attach (&out, stderr, 0); + snd_pcm_hw_params_dump (hwParams, out); + snd_pcm_sw_params_dump (swParams, out); #endif - LinuxRepaintManager (const LinuxRepaintManager&); - const LinuxRepaintManager& operator= (const LinuxRepaintManager&); - }; + */ - LinuxRepaintManager* repainter; + numChannelsRunning = numChannels; - friend class LinuxRepaintManager; - Window windowH, parentWindow; - int wx, wy, ww, wh; - Image* taskbarImage; - bool fullScreen, entered, mapped, depthIs16Bit; - BorderSize windowBorder; + return true; + } - void removeWindowDecorations (Window wndH) + bool write (float** const data, const int numSamples) { - Atom hints = XInternAtom (display, "_MOTIF_WM_HINTS", True); + if (isInterleaved) + { + scratch.ensureSize (sizeof (float) * numSamples * numChannelsRunning, false); + float* interleaved = (float*) scratch; - if (hints != None) + AudioDataConverters::interleaveSamples ((const float**) data, interleaved, numSamples, numChannelsRunning); + AudioDataConverters::convertFloatToFormat (sampleFormat, interleaved, interleaved, numSamples * numChannelsRunning); + + snd_pcm_sframes_t num = snd_pcm_writei (handle, (void*) interleaved, numSamples); + + if (failed (num) && num != -EPIPE && num != -ESTRPIPE) + return false; + } + else { - typedef struct - { - unsigned long flags; - unsigned long functions; - unsigned long decorations; - long input_mode; - unsigned long status; - } MotifWmHints; + for (int i = 0; i < numChannelsRunning; ++i) + if (data[i] != 0) + AudioDataConverters::convertFloatToFormat (sampleFormat, data[i], data[i], numSamples); - MotifWmHints motifHints; - zerostruct (motifHints); - motifHints.flags = 2; /* MWM_HINTS_DECORATIONS */ - motifHints.decorations = 0; + snd_pcm_sframes_t num = snd_pcm_writen (handle, (void**) data, numSamples); - XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, - (unsigned char*) &motifHints, 4); + if (failed (num)) + { + if (num == -EPIPE) + { + if (failed (snd_pcm_prepare (handle))) + return false; + } + else if (num != -ESTRPIPE) + return false; + } } - hints = XInternAtom (display, "_WIN_HINTS", True); + return true; + } - if (hints != None) + bool read (float** const data, const int numSamples) + { + if (isInterleaved) { - long gnomeHints = 0; + scratch.ensureSize (sizeof (float) * numSamples * numChannelsRunning, false); + float* interleaved = (float*) scratch; - XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, - (unsigned char*) &gnomeHints, 1); - } + snd_pcm_sframes_t num = snd_pcm_readi (handle, (void*) interleaved, numSamples); - hints = XInternAtom (display, "KWM_WIN_DECORATION", True); + if (failed (num)) + { + if (num == -EPIPE) + { + if (failed (snd_pcm_prepare (handle))) + return false; + } + else if (num != -ESTRPIPE) + return false; + } - if (hints != None) + AudioDataConverters::convertFormatToFloat (sampleFormat, interleaved, interleaved, numSamples * numChannelsRunning); + AudioDataConverters::deinterleaveSamples (interleaved, data, numSamples, numChannelsRunning); + } + else { - long kwmHints = 2; /*KDE_tinyDecoration*/ + snd_pcm_sframes_t num = snd_pcm_readn (handle, (void**) data, numSamples); - XChangeProperty (display, wndH, hints, hints, 32, PropModeReplace, - (unsigned char*) &kwmHints, 1); + if (failed (num) && num != -EPIPE && num != -ESTRPIPE) + return false; + + for (int i = 0; i < numChannelsRunning; ++i) + if (data[i] != 0) + AudioDataConverters::convertFormatToFloat (sampleFormat, data[i], data[i], numSamples); } - hints = XInternAtom (display, "_NET_WM_WINDOW_TYPE", True); + return true; + } - if (hints != None) - { - int netHints [2]; - int numHints = 0; - if ((styleFlags & windowIsTemporary) != 0) - netHints [numHints] = XInternAtom (display, "_NET_WM_WINDOW_TYPE_MENU", True); - else - netHints [numHints] = XInternAtom (display, "_NET_WM_WINDOW_TYPE_NORMAL", True); + juce_UseDebuggingNewOperator - if (netHints [numHints] != 0) - ++numHints; + snd_pcm_t* handle; + String error; + int bitDepth, numChannelsRunning; - netHints[numHints] = XInternAtom (display, "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", True); +private: + const bool isInput; + bool isInterleaved; + MemoryBlock scratch; + AudioDataConverters::DataFormat sampleFormat; - if (netHints [numHints] != 0) - ++numHints; + bool failed (const int errorNum) + { + if (errorNum >= 0) + return false; - XChangeProperty (display, wndH, hints, XA_ATOM, 32, PropModeReplace, - (unsigned char*) &netHints, numHints); - } + error = snd_strerror (errorNum); + DBG (T("ALSA error: ") + error + T("\n")); + return true; } +}; - void addWindowButtons (Window wndH) +class ALSAThread : public Thread +{ +public: + ALSAThread (const String& inputId_, + const String& outputId_) + : Thread ("Juce ALSA"), + sampleRate (0), + bufferSize (0), + callback (0), + inputId (inputId_), + outputId (outputId_), + outputDevice (0), + inputDevice (0), + numCallbacks (0), + totalNumInputChannels (0), + totalNumOutputChannels (0) { - Atom hints = XInternAtom (display, "_MOTIF_WM_HINTS", True); - - if (hints != None) - { - typedef struct - { - unsigned long flags; - unsigned long functions; - unsigned long decorations; - long input_mode; - unsigned long status; - } MotifWmHints; + zeromem (outputChannelData, sizeof (outputChannelData)); + zeromem (outputChannelDataForCallback, sizeof (outputChannelDataForCallback)); + zeromem (inputChannelData, sizeof (inputChannelData)); + zeromem (inputChannelDataForCallback, sizeof (inputChannelDataForCallback)); - MotifWmHints motifHints; - zerostruct (motifHints); + initialiseRatesAndChannels(); + } - motifHints.flags = 1 | 2; /* MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS */ - motifHints.decorations = 2 /* MWM_DECOR_BORDER */ | 8 /* MWM_DECOR_TITLE */ | 16; /* MWM_DECOR_MENU */ + ~ALSAThread() + { + close(); + } - motifHints.functions = 4 /* MWM_FUNC_MOVE */; + void open (BitArray inputChannels, + BitArray outputChannels, + const double sampleRate_, + const int bufferSize_) + { + close(); - if ((styleFlags & windowHasCloseButton) != 0) - motifHints.functions |= 32; /* MWM_FUNC_CLOSE */ + error = String::empty; + sampleRate = sampleRate_; + bufferSize = bufferSize_; + currentInputChans.clear(); + currentOutputChans.clear(); - if ((styleFlags & windowHasMinimiseButton) != 0) + if (inputChannels.getHighestBit() >= 0) + { + for (int i = 0; i <= jmax (inputChannels.getHighestBit(), minChansIn); ++i) { - motifHints.functions |= 8; /* MWM_FUNC_MINIMIZE */ - motifHints.decorations |= 0x20; /* MWM_DECOR_MINIMIZE */ + inputChannelData [i] = (float*) juce_calloc (sizeof (float) * bufferSize); + + if (inputChannels[i]) + { + inputChannelDataForCallback [totalNumInputChannels++] = inputChannelData [i]; + currentInputChans.setBit (i); + } } + } - if ((styleFlags & windowHasMaximiseButton) != 0) + if (outputChannels.getHighestBit() >= 0) + { + for (int i = 0; i <= jmax (outputChannels.getHighestBit(), minChansOut); ++i) { - motifHints.functions |= 0x10; /* MWM_FUNC_MAXIMIZE */ - motifHints.decorations |= 0x40; /* MWM_DECOR_MAXIMIZE */ + outputChannelData [i] = (float*) juce_calloc (sizeof (float) * bufferSize); + + if (outputChannels[i]) + { + outputChannelDataForCallback [totalNumOutputChannels++] = outputChannelData [i]; + currentOutputChans.setBit (i); + } } + } - if ((styleFlags & windowIsResizable) != 0) + if (totalNumOutputChannels > 0 && outputId.isNotEmpty()) + { + outputDevice = new ALSADevice (outputId, false); + + if (outputDevice->error.isNotEmpty()) { - motifHints.functions |= 2; /* MWM_FUNC_RESIZE */ - motifHints.decorations |= 0x4; /* MWM_DECOR_RESIZEH */ + error = outputDevice->error; + deleteAndZero (outputDevice); + return; } - XChangeProperty (display, wndH, hints, hints, 32, 0, (unsigned char*) &motifHints, 5); - } + currentOutputChans.setRange (0, minChansOut, true); - hints = XInternAtom (display, "_NET_WM_ALLOWED_ACTIONS", True); + if (! outputDevice->setParameters ((unsigned int) sampleRate, + jlimit ((int) minChansOut, (int) maxChansOut, currentOutputChans.getHighestBit() + 1), + bufferSize)) + { + error = outputDevice->error; + deleteAndZero (outputDevice); + return; + } + } - if (hints != None) + if (totalNumInputChannels > 0 && inputId.isNotEmpty()) { - int netHints [6]; - int num = 0; + inputDevice = new ALSADevice (inputId, true); - netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_RESIZE", (styleFlags & windowIsResizable) ? True : False); - netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_FULLSCREEN", (styleFlags & windowHasMaximiseButton) ? True : False); - netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_MINIMIZE", (styleFlags & windowHasMinimiseButton) ? True : False); - netHints [num++] = XInternAtom (display, "_NET_WM_ACTION_CLOSE", (styleFlags & windowHasCloseButton) ? True : False); + if (inputDevice->error.isNotEmpty()) + { + error = inputDevice->error; + deleteAndZero (inputDevice); + return; + } - XChangeProperty (display, wndH, hints, XA_ATOM, 32, PropModeReplace, - (unsigned char*) &netHints, num); + currentInputChans.setRange (0, minChansIn, true); + + if (! inputDevice->setParameters ((unsigned int) sampleRate, + jlimit ((int) minChansIn, (int) maxChansIn, currentInputChans.getHighestBit() + 1), + bufferSize)) + { + error = inputDevice->error; + deleteAndZero (inputDevice); + return; + } } - } - void createWindow() - { - static bool atomsInitialised = false; + if (outputDevice == 0 && inputDevice == 0) + { + error = "no channels"; + return; + } - if (! atomsInitialised) + if (outputDevice != 0 && inputDevice != 0) { - atomsInitialised = true; + snd_pcm_link (outputDevice->handle, inputDevice->handle); + } - wm_Protocols = XInternAtom (display, "WM_PROTOCOLS", 1); - wm_ProtocolList [TAKE_FOCUS] = XInternAtom (display, "WM_TAKE_FOCUS", 1); - wm_ProtocolList [DELETE_WINDOW] = XInternAtom (display, "WM_DELETE_WINDOW", 1); - wm_ChangeState = XInternAtom (display, "WM_CHANGE_STATE", 1); - wm_State = XInternAtom (display, "WM_STATE", 1); - wm_ActiveWin = XInternAtom (display, "_NET_ACTIVE_WINDOW", False); + if (inputDevice != 0 && failed (snd_pcm_prepare (inputDevice->handle))) + return; - XA_XdndAware = XInternAtom (display, "XdndAware", 0); - XA_XdndEnter = XInternAtom (display, "XdndEnter", 0); - XA_XdndLeave = XInternAtom (display, "XdndLeave", 0); - XA_XdndPosition = XInternAtom (display, "XdndPosition", 0); - XA_XdndStatus = XInternAtom (display, "XdndStatus", 0); - XA_XdndDrop = XInternAtom (display, "XdndDrop", 0); - XA_XdndFinished = XInternAtom (display, "XdndFinished", 0); - XA_XdndSelection = XInternAtom (display, "XdndSelection", 0); - XA_XdndProxy = XInternAtom (display, "XdndProxy", 0); + if (outputDevice != 0 && failed (snd_pcm_prepare (outputDevice->handle))) + return; - XA_XdndTypeList = XInternAtom (display, "XdndTypeList", 0); - XA_XdndActionList = XInternAtom (display, "XdndActionList", 0); - XA_XdndActionCopy = XInternAtom (display, "XdndActionCopy", 0); - XA_XdndActionMove = XInternAtom (display, "XdndActionMove", 0); - XA_XdndActionLink = XInternAtom (display, "XdndActionLink", 0); - XA_XdndActionAsk = XInternAtom (display, "XdndActionAsk", 0); - XA_XdndActionPrivate = XInternAtom (display, "XdndActionPrivate", 0); - XA_XdndActionDescription = XInternAtom (display, "XdndActionDescription", 0); + startThread (9); - XA_JXSelectionWindowProperty = XInternAtom (display, "JXSelectionWindowProperty", 0); + int count = 1000; - XA_MimeTextPlain = XInternAtom (display, "text/plain", 0); - XA_MimeTextUriList = XInternAtom (display, "text/uri-list", 0); - XA_MimeRootDrop = XInternAtom (display, "application/x-rootwindow-drop", 0); + while (numCallbacks == 0) + { + sleep (5); + + if (--count < 0 || ! isThreadRunning()) + { + error = "device didn't start"; + break; + } } + } - resetDragAndDrop(); + void close() + { + stopThread (6000); - XA_OtherMime = XA_MimeTextPlain; // xxx why?? - allowedMimeTypeAtoms [0] = XA_MimeTextPlain; - allowedMimeTypeAtoms [1] = XA_OtherMime; - allowedMimeTypeAtoms [2] = XA_MimeTextUriList; + deleteAndZero (inputDevice); + deleteAndZero (outputDevice); - allowedActions [0] = XA_XdndActionMove; - allowedActions [1] = XA_XdndActionCopy; - allowedActions [2] = XA_XdndActionLink; - allowedActions [3] = XA_XdndActionAsk; - allowedActions [4] = XA_XdndActionPrivate; + for (int i = 0; i < maxNumChans; ++i) + { + juce_free (inputChannelData [i]); + juce_free (outputChannelData [i]); + } - // Get defaults for various properties - const int screen = DefaultScreen (display); - Window root = RootWindow (display, screen); + zeromem (outputChannelData, sizeof (outputChannelData)); + zeromem (outputChannelDataForCallback, sizeof (outputChannelDataForCallback)); + zeromem (inputChannelData, sizeof (inputChannelData)); + zeromem (inputChannelDataForCallback, sizeof (inputChannelDataForCallback)); + totalNumOutputChannels = 0; + totalNumInputChannels = 0; - // Attempt to create a 24-bit window on the default screen. If this is not - // possible then exit - XVisualInfo desiredVisual; - desiredVisual.screen = screen; - desiredVisual.depth = 24; - depthIs16Bit = false; + numCallbacks = 0; + } - int numVisuals; - XVisualInfo* visuals = XGetVisualInfo (display, VisualScreenMask | VisualDepthMask, - &desiredVisual, &numVisuals); + void setCallback (AudioIODeviceCallback* const newCallback) throw() + { + const ScopedLock sl (callbackLock); + callback = newCallback; + } - if (numVisuals < 1 || visuals == 0) + void run() + { + while (! threadShouldExit()) { - XFree (visuals); - desiredVisual.depth = 16; - - visuals = XGetVisualInfo (display, VisualScreenMask | VisualDepthMask, - &desiredVisual, &numVisuals); - - if (numVisuals < 1 || visuals == 0) + if (inputDevice != 0) { - Logger::outputDebugString ("ERROR: System doesn't support 24 or 16 bit RGB display.\n"); - Process::terminate(); + if (! inputDevice->read (inputChannelData, bufferSize)) + { + DBG ("ALSA: read failure"); + break; + } } - depthIs16Bit = true; - } - - XFree (visuals); + if (threadShouldExit()) + break; - // Set up the window attributes - XSetWindowAttributes swa; - swa.border_pixel = 0; - swa.background_pixmap = None; - swa.colormap = DefaultColormap (display, screen); - swa.override_redirect = getComponent()->isAlwaysOnTop() ? True : False; - swa.event_mask = eventMask; + { + const ScopedLock sl (callbackLock); + ++numCallbacks; - Window wndH = XCreateWindow (display, root, - 0, 0, 1, 1, - 0, 0, InputOutput, (Visual*) CopyFromParent, - CWBorderPixel | CWColormap | CWBackPixmap | CWEventMask | CWOverrideRedirect, - &swa); + if (callback != 0) + { + callback->audioDeviceIOCallback ((const float**) inputChannelDataForCallback, + totalNumInputChannels, + outputChannelDataForCallback, + totalNumOutputChannels, + bufferSize); + } + else + { + for (int i = 0; i < totalNumOutputChannels; ++i) + zeromem (outputChannelDataForCallback[i], sizeof (float) * bufferSize); + } + } - XGrabButton (display, AnyButton, AnyModifier, wndH, False, - ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, None); + if (outputDevice != 0) + { + failed (snd_pcm_wait (outputDevice->handle, 2000)); - // Set the window context to identify the window handle object - if (XSaveContext (display, (XID) wndH, improbableNumber, (XPointer) this)) - { - // Failed - jassertfalse - Logger::outputDebugString ("Failed to create context information for window.\n"); - XDestroyWindow (display, wndH); - wndH = 0; - } + if (threadShouldExit()) + break; - // Set window manager hints - XWMHints* wmHints = XAllocWMHints(); - wmHints->flags = InputHint | StateHint; - wmHints->input = True; // Locally active input model - wmHints->initial_state = NormalState; - XSetWMHints (display, wndH, wmHints); - XFree (wmHints); + failed (snd_pcm_avail_update (outputDevice->handle)); - if ((styleFlags & windowIsSemiTransparent) != 0) - { - //xxx + if (! outputDevice->write (outputChannelData, bufferSize)) + { + DBG ("ALSA: write failure"); + break; + } + } } + } - if ((styleFlags & windowAppearsOnTaskbar) != 0) - { - //xxx - } + int getBitDepth() const throw() + { + if (outputDevice != 0) + return outputDevice->bitDepth; - //XSetTransientForHint (display, wndH, RootWindow (display, DefaultScreen (display))); + if (inputDevice != 0) + return inputDevice->bitDepth; - if ((styleFlags & windowHasTitleBar) == 0) - removeWindowDecorations (wndH); - else - addWindowButtons (wndH); + return 16; + } - // Set window manager protocols - XChangeProperty (display, wndH, wm_Protocols, XA_ATOM, 32, PropModeReplace, - (unsigned char*) wm_ProtocolList, 2); + juce_UseDebuggingNewOperator - // Set drag and drop flags - XChangeProperty (display, wndH, XA_XdndTypeList, XA_ATOM, 32, PropModeReplace, - (const unsigned char*) allowedMimeTypeAtoms, numElementsInArray (allowedMimeTypeAtoms)); + String error; + double sampleRate; + int bufferSize; + BitArray currentInputChans, currentOutputChans; - XChangeProperty (display, wndH, XA_XdndActionList, XA_ATOM, 32, PropModeReplace, - (const unsigned char*) allowedActions, numElementsInArray (allowedActions)); + Array sampleRates; + StringArray channelNamesOut, channelNamesIn; + AudioIODeviceCallback* callback; - XChangeProperty (display, wndH, XA_XdndActionDescription, XA_STRING, 8, PropModeReplace, - (const unsigned char*) "", 0); +private: - unsigned long dndVersion = ourDndVersion; - XChangeProperty (display, wndH, XA_XdndAware, XA_ATOM, 32, PropModeReplace, - (const unsigned char*) &dndVersion, 1); + const String inputId, outputId; + ALSADevice* outputDevice; + ALSADevice* inputDevice; + int numCallbacks; - // Set window name - setWindowTitle (wndH, getComponent()->getName()); + CriticalSection callbackLock; - // Initialise the pointer and keyboard mapping - // This is not the same as the logical pointer mapping the X server uses: - // we don't mess with this. - static bool mappingInitialised = false; + float* outputChannelData [maxNumChans]; + float* outputChannelDataForCallback [maxNumChans]; + int totalNumInputChannels; + float* inputChannelData [maxNumChans]; + float* inputChannelDataForCallback [maxNumChans]; + int totalNumOutputChannels; - if (! mappingInitialised) - { - mappingInitialised = true; + unsigned int minChansOut, maxChansOut; + unsigned int minChansIn, maxChansIn; - const int numButtons = XGetPointerMapping (display, 0, 0); + bool failed (const int errorNum) throw() + { + if (errorNum >= 0) + return false; - if (numButtons == 2) - { - pointerMap[0] = LeftButton; - pointerMap[1] = RightButton; - pointerMap[2] = pointerMap[3] = pointerMap[4] = NoButton; - } - else if (numButtons >= 3) - { - pointerMap[0] = LeftButton; - pointerMap[1] = MiddleButton; - pointerMap[2] = RightButton; + error = snd_strerror (errorNum); + DBG (T("ALSA error: ") + error + T("\n")); + return true; + } - if (numButtons >= 5) - { - pointerMap[3] = WheelUp; - pointerMap[4] = WheelDown; - } - } + void initialiseRatesAndChannels() throw() + { + sampleRates.clear(); + channelNamesOut.clear(); + channelNamesIn.clear(); + minChansOut = 0; + maxChansOut = 0; + minChansIn = 0; + maxChansIn = 0; + unsigned int dummy = 0; - getModifierMapping(); - } + getDeviceProperties (inputId, dummy, dummy, minChansIn, maxChansIn, sampleRates); + getDeviceProperties (outputId, minChansOut, maxChansOut, dummy, dummy, sampleRates); - windowH = wndH; + unsigned int i; + for (i = 0; i < maxChansOut; ++i) + channelNamesOut.add (T("channel ") + String ((int) i + 1)); + + for (i = 0; i < maxChansIn; ++i) + channelNamesIn.add (T("channel ") + String ((int) i + 1)); } +}; - void destroyWindow() +class ALSAAudioIODevice : public AudioIODevice +{ +public: + ALSAAudioIODevice (const String& deviceName, + const String& inputId_, + const String& outputId_) + : AudioIODevice (deviceName, T("ALSA")), + inputId (inputId_), + outputId (outputId_), + isOpen_ (false), + isStarted (false), + internal (0) { - XPointer handlePointer; - if (! XFindContext (display, (XID) windowH, improbableNumber, &handlePointer)) - XDeleteContext (display, (XID) windowH, improbableNumber); + internal = new ALSAThread (inputId, outputId); + } - XDestroyWindow (display, windowH); + ~ALSAAudioIODevice() + { + delete internal; + } - // Wait for it to complete and then remove any events for this - // window from the event queue. - XSync (display, false); + const StringArray getOutputChannelNames() + { + return internal->channelNamesOut; + } - XEvent event; - while (XCheckWindowEvent (display, windowH, eventMask, &event) == True) - {} + const StringArray getInputChannelNames() + { + return internal->channelNamesIn; } - static int64 getEventTime (::Time t) throw() + int getNumSampleRates() { - static int64 eventTimeOffset = 0x12345678; - const int64 thisMessageTime = t; + return internal->sampleRates.size(); + } - if (eventTimeOffset == 0x12345678) - eventTimeOffset = Time::currentTimeMillis() - thisMessageTime; + double getSampleRate (int index) + { + return internal->sampleRates [index]; + } - return eventTimeOffset + thisMessageTime; + int getNumBufferSizesAvailable() + { + return 50; } - static void setWindowTitle (Window xwin, const char* const title) throw() + int getBufferSizeSamples (int index) { - XTextProperty nameProperty; - char* strings[] = { (char*) title }; + int n = 16; + for (int i = 0; i < index; ++i) + n += n < 64 ? 16 + : (n < 512 ? 32 + : (n < 1024 ? 64 + : (n < 2048 ? 128 : 256))); - if (XStringListToTextProperty (strings, 1, &nameProperty)) - { - XSetWMName (display, xwin, &nameProperty); - XSetWMIconName (display, xwin, &nameProperty); + return n; + } - XFree (nameProperty.value); - } + int getDefaultBufferSize() + { + return 512; } - void updateBorderSize() + const String open (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate, + int bufferSizeSamples) { - if ((styleFlags & windowHasTitleBar) == 0) - { - windowBorder = BorderSize (0); - } - else if (windowBorder.getTopAndBottom() == 0 && windowBorder.getLeftAndRight() == 0) - { - Atom hints = XInternAtom (display, "_NET_FRAME_EXTENTS", True); + close(); - if (hints != None) - { - unsigned char* data = 0; - unsigned long nitems, bytesLeft; - Atom actualType; - int actualFormat; + if (bufferSizeSamples <= 0) + bufferSizeSamples = getDefaultBufferSize(); - if (XGetWindowProperty (display, windowH, hints, 0, 4, False, - XA_CARDINAL, &actualType, &actualFormat, &nitems, &bytesLeft, - &data) == Success) + if (sampleRate <= 0) + { + for (int i = 0; i < getNumSampleRates(); ++i) + { + if (getSampleRate (i) >= 44100) { - const unsigned long* const sizes = (const unsigned long*) data; - - if (actualFormat == 32) - windowBorder = BorderSize ((int) sizes[2], (int) sizes[0], - (int) sizes[3], (int) sizes[1]); - - XFree (data); + sampleRate = getSampleRate (i); + break; } } } + + internal->open (inputChannels, outputChannels, + sampleRate, bufferSizeSamples); + + isOpen_ = internal->error.isEmpty(); + return internal->error; } - void updateBounds() + void close() { - jassert (windowH != 0); - if (windowH != 0) - { - Window root, child; - unsigned int bw, depth; + stop(); + internal->close(); + isOpen_ = false; + } - if (! XGetGeometry (display, (::Drawable) windowH, &root, - &wx, &wy, (unsigned int*) &ww, (unsigned int*) &wh, - &bw, &depth)) - { - wx = wy = ww = wh = 0; - } - else if (! XTranslateCoordinates (display, windowH, root, 0, 0, &wx, &wy, &child)) - { - wx = wy = 0; - } - } + bool isOpen() + { + return isOpen_; } - void resetDragAndDrop() + int getCurrentBufferSizeSamples() { - dragAndDropFiles.clear(); - lastDropX = lastDropY = -1; - dragAndDropCurrentMimeType = 0; - dragAndDropSourceWindow = 0; - srcMimeTypeAtomList.clear(); + return internal->bufferSize; } - void sendDragAndDropMessage (XClientMessageEvent& msg) + double getCurrentSampleRate() { - msg.type = ClientMessage; - msg.display = display; - msg.window = dragAndDropSourceWindow; - msg.format = 32; - msg.data.l[0] = windowH; + return internal->sampleRate; + } - XSendEvent (display, dragAndDropSourceWindow, False, 0, (XEvent*) &msg); + int getCurrentBitDepth() + { + return internal->getBitDepth(); } - void sendDragAndDropStatus (const bool acceptDrop, Atom dropAction) + const BitArray getActiveOutputChannels() const { - XClientMessageEvent msg; - zerostruct (msg); - msg.message_type = XA_XdndStatus; - msg.data.l[1] = (acceptDrop ? 1 : 0) | 2; // 2 indicates that we want to receive position messages - msg.data.l[4] = dropAction; + return internal->currentOutputChans; + } - sendDragAndDropMessage (msg); + const BitArray getActiveInputChannels() const + { + return internal->currentInputChans; } - void sendDragAndDropLeave() + int getOutputLatencyInSamples() { - XClientMessageEvent msg; - zerostruct (msg); - msg.message_type = XA_XdndLeave; - sendDragAndDropMessage (msg); + return 0; } - void sendDragAndDropFinish() + int getInputLatencyInSamples() { - XClientMessageEvent msg; - zerostruct (msg); - msg.message_type = XA_XdndFinished; - sendDragAndDropMessage (msg); + return 0; } - void handleDragAndDropStatus (const XClientMessageEvent* const clientMsg) + void start (AudioIODeviceCallback* callback) { - if ((clientMsg->data.l[1] & 1) == 0) - { - sendDragAndDropLeave(); + if (! isOpen_) + callback = 0; - if (dragAndDropFiles.size() > 0) - handleFileDragExit (dragAndDropFiles); + internal->setCallback (callback); - dragAndDropFiles.clear(); - } + if (callback != 0) + callback->audioDeviceAboutToStart (this); + + isStarted = (callback != 0); } - void handleDragAndDropPosition (const XClientMessageEvent* const clientMsg) + void stop() { - if (dragAndDropSourceWindow == 0) - return; - - dragAndDropSourceWindow = clientMsg->data.l[0]; + AudioIODeviceCallback* const oldCallback = internal->callback; - const int dropX = ((int) clientMsg->data.l[2] >> 16) - getScreenX(); - const int dropY = ((int) clientMsg->data.l[2] & 0xffff) - getScreenY(); + start (0); - if (lastDropX != dropX || lastDropY != dropY) - { - lastDropX = dropX; - lastDropY = dropY; + if (oldCallback != 0) + oldCallback->audioDeviceStopped(); + } - dragAndDropTimestamp = clientMsg->data.l[3]; + bool isPlaying() + { + return isStarted && internal->error.isEmpty(); + } - Atom targetAction = XA_XdndActionCopy; + const String getLastError() + { + return internal->error; + } - for (int i = numElementsInArray (allowedActions); --i >= 0;) - { - if ((Atom) clientMsg->data.l[4] == allowedActions[i]) - { - targetAction = allowedActions[i]; - break; - } - } + String inputId, outputId; - sendDragAndDropStatus (true, targetAction); +private: + bool isOpen_, isStarted; + ALSAThread* internal; +}; - if (dragAndDropFiles.size() == 0) - updateDraggedFileList (clientMsg); +class ALSAAudioIODeviceType : public AudioIODeviceType +{ +public: - if (dragAndDropFiles.size() > 0) - handleFileDragMove (dragAndDropFiles, dropX, dropY); - } + ALSAAudioIODeviceType() + : AudioIODeviceType (T("ALSA")), + hasScanned (false) + { } - void handleDragAndDropDrop (const XClientMessageEvent* const clientMsg) + ~ALSAAudioIODeviceType() { - if (dragAndDropFiles.size() == 0) - updateDraggedFileList (clientMsg); - - const StringArray files (dragAndDropFiles); - const int lastX = lastDropX, lastY = lastDropY; - - sendDragAndDropFinish(); - resetDragAndDrop(); - - if (files.size() > 0) - handleFileDragDrop (files, lastX, lastY); } - void handleDragAndDropEnter (const XClientMessageEvent* const clientMsg) + void scanForDevices() { - dragAndDropFiles.clear(); - srcMimeTypeAtomList.clear(); + if (hasScanned) + return; - dragAndDropCurrentMimeType = 0; - const int dndCurrentVersion = (int) (clientMsg->data.l[1] & 0xff000000) >> 24; + hasScanned = true; + inputNames.clear(); + inputIds.clear(); + outputNames.clear(); + outputIds.clear(); - if (dndCurrentVersion < 3 || dndCurrentVersion > ourDndVersion) - { - dragAndDropSourceWindow = 0; - return; - } + snd_ctl_t* handle; + snd_ctl_card_info_t* info; + snd_ctl_card_info_alloca (&info); - dragAndDropSourceWindow = clientMsg->data.l[0]; + int cardNum = -1; - if ((clientMsg->data.l[1] & 1) != 0) + while (outputIds.size() + inputIds.size() <= 32) { - Atom actual; - int format; - unsigned long count = 0, remaining = 0; - unsigned char* data = 0; + snd_card_next (&cardNum); - XGetWindowProperty (display, dragAndDropSourceWindow, XA_XdndTypeList, - 0, 0x8000000L, False, XA_ATOM, &actual, &format, - &count, &remaining, &data); + if (cardNum < 0) + break; - if (data != 0) + if (snd_ctl_open (&handle, T("hw:") + String (cardNum), SND_CTL_NONBLOCK) >= 0) { - if (actual == XA_ATOM && format == 32 && count != 0) + if (snd_ctl_card_info (handle, info) >= 0) { - const unsigned long* const types = (const unsigned long*) data; + String cardId (snd_ctl_card_info_get_id (info)); - for (unsigned int i = 0; i < count; ++i) - if (types[i] != None) - srcMimeTypeAtomList.add (types[i]); - } + if (cardId.removeCharacters (T("0123456789")).isEmpty()) + cardId = String (cardNum); - XFree (data); - } - } + int device = -1; - if (srcMimeTypeAtomList.size() == 0) - { - for (int i = 2; i < 5; ++i) - if (clientMsg->data.l[i] != None) - srcMimeTypeAtomList.add (clientMsg->data.l[i]); + for (;;) + { + if (snd_ctl_pcm_next_device (handle, &device) < 0 || device < 0) + break; - if (srcMimeTypeAtomList.size() == 0) - { - dragAndDropSourceWindow = 0; - return; + String id, name; + id << "hw:" << cardId << ',' << device; + + bool isInput, isOutput; + + if (testDevice (id, isInput, isOutput)) + { + name << snd_ctl_card_info_get_name (info); + + if (name.isEmpty()) + name = id; + + if (isInput) + { + inputNames.add (name); + inputIds.add (id); + } + + if (isOutput) + { + outputNames.add (name); + outputIds.add (id); + } + } + } + } + + snd_ctl_close (handle); } } - for (int i = 0; i < srcMimeTypeAtomList.size() && dragAndDropCurrentMimeType == 0; ++i) - for (int j = 0; j < numElementsInArray (allowedMimeTypeAtoms); ++j) - if (srcMimeTypeAtomList[i] == allowedMimeTypeAtoms[j]) - dragAndDropCurrentMimeType = allowedMimeTypeAtoms[j]; + inputNames.appendNumbersToDuplicates (false, true); + outputNames.appendNumbersToDuplicates (false, true); + } - handleDragAndDropPosition (clientMsg); + const StringArray getDeviceNames (const bool wantInputNames) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this + + return wantInputNames ? inputNames : outputNames; } - void handleDragAndDropSelection (const XEvent* const evt) + int getDefaultDeviceIndex (const bool forInput) const { - dragAndDropFiles.clear(); + jassert (hasScanned); // need to call scanForDevices() before doing this + return 0; + } - if (evt->xselection.property != 0) - { - StringArray lines; + bool hasSeparateInputsAndOutputs() const { return true; } - { - MemoryBlock dropData; + int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this - for (;;) - { - Atom actual; - uint8* data = 0; - unsigned long count = 0, remaining = 0; - int format = 0; + ALSAAudioIODevice* const d = dynamic_cast (device); + if (d == 0) + return -1; - if (XGetWindowProperty (display, evt->xany.window, evt->xselection.property, - dropData.getSize() / 4, 65536, 1, AnyPropertyType, &actual, - &format, &count, &remaining, &data) == Success) - { - dropData.append (data, count * format / 8); - XFree (data); + return asInput ? inputIds.indexOf (d->inputId) + : outputIds.indexOf (d->outputId); + } - if (remaining == 0) - break; - } - else - { - XFree (data); - break; - } - } + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) + { + jassert (hasScanned); // need to call scanForDevices() before doing this - lines.addLines (dropData.toString()); - } + const int inputIndex = inputNames.indexOf (inputDeviceName); + const int outputIndex = outputNames.indexOf (outputDeviceName); - for (int i = 0; i < lines.size(); ++i) - dragAndDropFiles.add (URL::removeEscapeChars (lines[i].fromFirstOccurrenceOf (T("file://"), false, true))); + String deviceName (outputDeviceName); + if (deviceName.isEmpty()) + deviceName = inputDeviceName; - dragAndDropFiles.trim(); - dragAndDropFiles.removeEmptyStrings(); - } + if (index >= 0) + return new ALSAAudioIODevice (deviceName, + inputIds [inputIndex], + outputIds [outputIndex]); + + return 0; } - void updateDraggedFileList (const XClientMessageEvent* const clientMsg) + juce_UseDebuggingNewOperator + +private: + StringArray inputNames, outputNames, inputIds, outputIds; + bool hasScanned; + + static bool testDevice (const String& id, bool& isInput, bool& isOutput) { - dragAndDropFiles.clear(); + unsigned int minChansOut = 0, maxChansOut = 0; + unsigned int minChansIn = 0, maxChansIn = 0; + Array rates; - if (dragAndDropSourceWindow != None - && dragAndDropCurrentMimeType != 0) - { - dragAndDropTimestamp = clientMsg->data.l[2]; + getDeviceProperties (id, minChansOut, maxChansOut, minChansIn, maxChansIn, rates); - XConvertSelection (display, - XA_XdndSelection, - dragAndDropCurrentMimeType, - XA_JXSelectionWindowProperty, - windowH, - dragAndDropTimestamp); - } - } + DBG (T("ALSA device: ") + id + + T(" outs=") + String ((int) minChansOut) + T("-") + String ((int) maxChansOut) + + T(" ins=") + String ((int) minChansIn) + T("-") + String ((int) maxChansIn) + + T(" rates=") + String (rates.size())); - StringArray dragAndDropFiles; - int dragAndDropTimestamp, lastDropX, lastDropY; + isInput = maxChansIn > 0; + isOutput = maxChansOut > 0; - Atom XA_OtherMime, dragAndDropCurrentMimeType; - Window dragAndDropSourceWindow; + return (isInput || isOutput) && rates.size() > 0; + } - unsigned int allowedActions [5]; - unsigned int allowedMimeTypeAtoms [3]; - Array srcMimeTypeAtomList; + ALSAAudioIODeviceType (const ALSAAudioIODeviceType&); + const ALSAAudioIODeviceType& operator= (const ALSAAudioIODeviceType&); }; -void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars) +AudioIODeviceType* juce_createDefaultAudioIODeviceType() { - if (enableOrDisable) - kioskModeComponent->setBounds (Desktop::getInstance().getMainMonitorArea (false)); + return new ALSAAudioIODeviceType(); } -ComponentPeer* Component::createNewPeer (int styleFlags, void* /*nativeWindowToAttachTo*/) +#else // if ALSA is turned off.. + +AudioIODeviceType* juce_createDefaultAudioIODeviceType() { - return new LinuxComponentPeer (this, styleFlags); + return 0; } -// (this callback is hooked up in the messaging code) -void juce_windowMessageReceive (XEvent* event) -{ - if (event->xany.window != None) - { - LinuxComponentPeer* const peer = LinuxComponentPeer::getPeerFor (event->xany.window); +#endif +#endif +/********* End of inlined file: juce_linux_Audio.cpp *********/ - if (ComponentPeer::isValidPeer (peer)) - peer->handleWindowMessage (event); - } - else - { - switch (event->xany.type) - { - case KeymapNotify: - { - const XKeymapEvent* const keymapEvent = (const XKeymapEvent*) &event->xkeymap; - memcpy (keyStates, keymapEvent->key_vector, 32); - break; - } +/********* Start of inlined file: juce_linux_Midi.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - default: - break; - } - } -} +#if JUCE_ALSA -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool /*clipToWorkArea*/) throw() +static snd_seq_t* iterateDevices (const bool forInput, + StringArray& deviceNamesFound, + const int deviceIndexToOpen) { -#if JUCE_USE_XINERAMA - int major_opcode, first_event, first_error; + snd_seq_t* returnedHandle = 0; + snd_seq_t* seqHandle; - if (XQueryExtension (display, "XINERAMA", &major_opcode, &first_event, &first_error) - && XineramaIsActive (display)) + if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT + : SND_SEQ_OPEN_OUTPUT, 0) == 0) { - int numMonitors = 0; - XineramaScreenInfo* const screens = XineramaQueryScreens (display, &numMonitors); + snd_seq_system_info_t* systemInfo; + snd_seq_client_info_t* clientInfo; - if (screens != 0) + if (snd_seq_system_info_malloc (&systemInfo) == 0) { - for (int i = numMonitors; --i >= 0;) + if (snd_seq_system_info (seqHandle, systemInfo) == 0 + && snd_seq_client_info_malloc (&clientInfo) == 0) { - int index = screens[i].screen_number; + int numClients = snd_seq_system_info_get_cur_clients (systemInfo); - if (index >= 0) + while (--numClients >= 0 && returnedHandle == 0) { - while (monitorCoords.size() < index) - monitorCoords.add (Rectangle (0, 0, 0, 0)); - - monitorCoords.set (index, Rectangle (screens[i].x_org, - screens[i].y_org, - screens[i].width, - screens[i].height)); - } - } + if (snd_seq_query_next_client (seqHandle, clientInfo) == 0) + { + snd_seq_port_info_t* portInfo; + if (snd_seq_port_info_malloc (&portInfo) == 0) + { + int numPorts = snd_seq_client_info_get_num_ports (clientInfo); + const int client = snd_seq_client_info_get_client (clientInfo); - XFree (screens); - } - } + snd_seq_port_info_set_client (portInfo, client); + snd_seq_port_info_set_port (portInfo, -1); - if (monitorCoords.size() == 0) -#endif - { - Atom hints = XInternAtom (display, "_NET_WORKAREA", True); + while (--numPorts >= 0) + { + if (snd_seq_query_next_port (seqHandle, portInfo) == 0 + && (snd_seq_port_info_get_capability (portInfo) + & (forInput ? SND_SEQ_PORT_CAP_READ + : SND_SEQ_PORT_CAP_WRITE)) != 0) + { + deviceNamesFound.add (snd_seq_client_info_get_name (clientInfo)); - if (hints != None) - { - const int numMonitors = ScreenCount (display); + if (deviceNamesFound.size() == deviceIndexToOpen + 1) + { + const int sourcePort = snd_seq_port_info_get_port (portInfo); + const int sourceClient = snd_seq_client_info_get_client (clientInfo); - for (int i = 0; i < numMonitors; ++i) - { - Window root = RootWindow (display, i); + if (sourcePort != -1) + { + snd_seq_set_client_name (seqHandle, + forInput ? "Juce Midi Input" + : "Juce Midi Output"); - unsigned long nitems, bytesLeft; - Atom actualType; - int actualFormat; - unsigned char* data = 0; + const int portId + = snd_seq_create_simple_port (seqHandle, + forInput ? "Juce Midi In Port" + : "Juce Midi Out Port", + forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) + : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), + SND_SEQ_PORT_TYPE_MIDI_GENERIC); - if (XGetWindowProperty (display, root, hints, 0, 4, False, - XA_CARDINAL, &actualType, &actualFormat, &nitems, &bytesLeft, - &data) == Success) - { - const long* const position = (const long*) data; + snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); - if (actualType == XA_CARDINAL && actualFormat == 32 && nitems == 4) - monitorCoords.add (Rectangle (position[0], position[1], - position[2], position[3])); + returnedHandle = seqHandle; + } + } + } + } - XFree (data); + snd_seq_port_info_free (portInfo); + } + } } + + snd_seq_client_info_free (clientInfo); } - } - if (monitorCoords.size() == 0) - { - monitorCoords.add (Rectangle (0, 0, - DisplayWidth (display, DefaultScreen (display)), - DisplayHeight (display, DefaultScreen (display)))); + snd_seq_system_info_free (systemInfo); } + + if (returnedHandle == 0) + snd_seq_close (seqHandle); } -} -bool Desktop::canUseSemiTransparentWindows() throw() -{ - return false; -} + deviceNamesFound.appendNumbersToDuplicates (true, true); -void Desktop::getMousePosition (int& x, int& y) throw() -{ - int mouseMods; - getMousePos (x, y, mouseMods); + return returnedHandle; } -void Desktop::setMousePosition (int x, int y) throw() +static snd_seq_t* createDevice (const bool forInput, + const String& deviceNameToOpen) { - Window root = RootWindow (display, DefaultScreen (display)); - XWarpPointer (display, None, root, 0, 0, 0, 0, x, y); -} - -static bool screenSaverAllowed = true; + snd_seq_t* seqHandle = 0; -void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() -{ - if (screenSaverAllowed != isEnabled) + if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT + : SND_SEQ_OPEN_OUTPUT, 0) == 0) { - screenSaverAllowed = isEnabled; + snd_seq_set_client_name (seqHandle, + (const char*) (forInput ? (deviceNameToOpen + T(" Input")) + : (deviceNameToOpen + T(" Output")))); - typedef void (*tXScreenSaverSuspend) (Display*, Bool); - static tXScreenSaverSuspend xScreenSaverSuspend = 0; + const int portId + = snd_seq_create_simple_port (seqHandle, + forInput ? "in" + : "out", + forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) + : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), + forInput ? SND_SEQ_PORT_TYPE_APPLICATION + : SND_SEQ_PORT_TYPE_MIDI_GENERIC); - if (xScreenSaverSuspend == 0) + if (portId < 0) { - void* h = dlopen ("libXss.so", RTLD_GLOBAL | RTLD_NOW); - - if (h != 0) - xScreenSaverSuspend = (tXScreenSaverSuspend) dlsym (h, "XScreenSaverSuspend"); + snd_seq_close (seqHandle); + seqHandle = 0; } - - if (xScreenSaverSuspend != 0) - xScreenSaverSuspend (display, ! isEnabled); } -} -bool Desktop::isScreenSaverEnabled() throw() -{ - return screenSaverAllowed; + return seqHandle; } -void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() +class MidiOutputDevice { - Window root = RootWindow (display, DefaultScreen (display)); - const unsigned int imageW = image.getWidth(); - const unsigned int imageH = image.getHeight(); - unsigned int cursorW, cursorH; - - if (! XQueryBestCursor (display, root, imageW, imageH, &cursorW, &cursorH)) - return 0; - - Image im (Image::ARGB, cursorW, cursorH, true); - Graphics g (im); - - if (imageW > cursorW || imageH > cursorH) +public: + MidiOutputDevice (MidiOutput* const midiOutput_, + snd_seq_t* const seqHandle_) + : + midiOutput (midiOutput_), + seqHandle (seqHandle_), + maxEventSize (16 * 1024) { - hotspotX = (hotspotX * cursorW) / imageW; - hotspotY = (hotspotY * cursorH) / imageH; - - g.drawImageWithin (&image, 0, 0, imageW, imageH, - RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, - false); + jassert (seqHandle != 0 && midiOutput != 0); + snd_midi_event_new (maxEventSize, &midiParser); } - else + + ~MidiOutputDevice() { - g.drawImageAt (&image, 0, 0); + snd_midi_event_free (midiParser); + snd_seq_close (seqHandle); } - const int stride = (cursorW + 7) >> 3; - uint8* const maskPlane = (uint8*) juce_calloc (stride * cursorH); - uint8* const sourcePlane = (uint8*) juce_calloc (stride * cursorH); - - const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); - - for (int y = cursorH; --y >= 0;) + void sendMessageNow (const MidiMessage& message) { - for (int x = cursorW; --x >= 0;) + if (message.getRawDataSize() > maxEventSize) { - const uint8 mask = (uint8) (1 << (msbfirst ? (7 - (x & 7)) : (x & 7))); - const int offset = y * stride + (x >> 3); + maxEventSize = message.getRawDataSize(); + snd_midi_event_free (midiParser); + snd_midi_event_new (maxEventSize, &midiParser); + } - const Colour c (im.getPixelAt (x, y)); + snd_seq_event_t event; + snd_seq_ev_clear (&event); - if (c.getAlpha() >= 128) - maskPlane[offset] |= mask; + snd_midi_event_encode (midiParser, + message.getRawData(), + message.getRawDataSize(), + &event); - if (c.getBrightness() >= 0.5f) - sourcePlane[offset] |= mask; - } - } + snd_midi_event_reset_encode (midiParser); - Pixmap sourcePixmap = XCreatePixmapFromBitmapData (display, root, (char*) sourcePlane, cursorW, cursorH, 0xffff, 0, 1); - Pixmap maskPixmap = XCreatePixmapFromBitmapData (display, root, (char*) maskPlane, cursorW, cursorH, 0xffff, 0, 1); + snd_seq_ev_set_source (&event, 0); + snd_seq_ev_set_subs (&event); + snd_seq_ev_set_direct (&event); - juce_free (maskPlane); - juce_free (sourcePlane); + snd_seq_event_output (seqHandle, &event); + snd_seq_drain_output (seqHandle); + } - XColor white, black; - black.red = black.green = black.blue = 0; - white.red = white.green = white.blue = 0xffff; + juce_UseDebuggingNewOperator - void* result = (void*) XCreatePixmapCursor (display, sourcePixmap, maskPixmap, &white, &black, hotspotX, hotspotY); +private: + MidiOutput* const midiOutput; + snd_seq_t* const seqHandle; + snd_midi_event_t* midiParser; + int maxEventSize; +}; - XFreePixmap (display, sourcePixmap); - XFreePixmap (display, maskPixmap); +const StringArray MidiOutput::getDevices() +{ + StringArray devices; + iterateDevices (false, devices, -1); + return devices; +} - return result; +int MidiOutput::getDefaultDeviceIndex() +{ + return 0; } -void juce_deleteMouseCursor (void* const cursorHandle, const bool) throw() +MidiOutput* MidiOutput::openDevice (int deviceIndex) { - if (cursorHandle != None) - XFreeCursor (display, (Cursor) cursorHandle); + MidiOutput* newDevice = 0; + + StringArray devices; + snd_seq_t* const handle = iterateDevices (false, devices, deviceIndex); + + if (handle != 0) + { + newDevice = new MidiOutput(); + newDevice->internal = new MidiOutputDevice (newDevice, handle); + } + + return newDevice; } -void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() +MidiOutput* MidiOutput::createNewDevice (const String& deviceName) { - unsigned int shape; + MidiOutput* newDevice = 0; - switch (type) + snd_seq_t* const handle = createDevice (false, deviceName); + + if (handle != 0) { - case MouseCursor::NoCursor: - { - const Image im (Image::ARGB, 16, 16, true); - return juce_createMouseCursorFromImage (im, 0, 0); - } + newDevice = new MidiOutput(); + newDevice->internal = new MidiOutputDevice (newDevice, handle); + } - case MouseCursor::NormalCursor: - return (void*) None; // Use parent cursor + return newDevice; +} - case MouseCursor::DraggingHandCursor: - { - static unsigned char dragHandData[] = {71,73,70,56,57,97,16,0,16,0,145,2,0,0,0,0,255,255,255,0, - 0,0,0,0,0,33,249,4,1,0,0,2,0,44,0,0,0,0,16,0, - 16,0,0,2,52,148,47,0,200,185,16,130,90,12,74,139,107,84,123,39, - 132,117,151,116,132,146,248,60,209,138,98,22,203,114,34,236,37,52,77,217, - 247,154,191,119,110,240,193,128,193,95,163,56,60,234,98,135,2,0,59 }; - const int dragHandDataSize = 99; +MidiOutput::~MidiOutput() +{ + MidiOutputDevice* const device = (MidiOutputDevice*) internal; + delete device; +} - Image* const im = ImageFileFormat::loadFrom ((const char*) dragHandData, dragHandDataSize); - void* const dragHandCursor = juce_createMouseCursorFromImage (*im, 8, 7); - delete im; +void MidiOutput::reset() +{ +} - return dragHandCursor; - } +bool MidiOutput::getVolume (float& leftVol, float& rightVol) +{ + return false; +} - case MouseCursor::CopyingCursor: - { - static unsigned char copyCursorData[] = {71,73,70,56,57,97,21,0,21,0,145,0,0,0,0,0,255,255,255,0, - 128,128,255,255,255,33,249,4,1,0,0,3,0,44,0,0,0,0,21,0, - 21,0,0,2,72,4,134,169,171,16,199,98,11,79,90,71,161,93,56,111, - 78,133,218,215,137,31,82,154,100,200,86,91,202,142,12,108,212,87,235,174, - 15,54,214,126,237,226,37,96,59,141,16,37,18,201,142,157,230,204,51,112, - 252,114,147,74,83,5,50,68,147,208,217,16,71,149,252,124,5,0,59,0,0 }; - const int copyCursorSize = 119; +void MidiOutput::setVolume (float leftVol, float rightVol) +{ +} - Image* const im = ImageFileFormat::loadFrom ((const char*) copyCursorData, copyCursorSize); - void* const copyCursor = juce_createMouseCursorFromImage (*im, 1, 3); - delete im; +void MidiOutput::sendMessageNow (const MidiMessage& message) +{ + ((MidiOutputDevice*) internal)->sendMessageNow (message); +} - return copyCursor; - } +class MidiInputThread : public Thread +{ +public: + MidiInputThread (MidiInput* const midiInput_, + snd_seq_t* const seqHandle_, + MidiInputCallback* const callback_) + : Thread (T("Juce MIDI Input")), + midiInput (midiInput_), + seqHandle (seqHandle_), + callback (callback_) + { + jassert (seqHandle != 0 && callback != 0 && midiInput != 0); + } - case MouseCursor::WaitCursor: - shape = XC_watch; - break; + ~MidiInputThread() + { + snd_seq_close (seqHandle); + } - case MouseCursor::IBeamCursor: - shape = XC_xterm; - break; + void run() + { + const int maxEventSize = 16 * 1024; + snd_midi_event_t* midiParser; - case MouseCursor::PointingHandCursor: - shape = XC_hand2; - break; + if (snd_midi_event_new (maxEventSize, &midiParser) >= 0) + { + uint8* const buffer = (uint8*) juce_malloc (maxEventSize); - case MouseCursor::LeftRightResizeCursor: - shape = XC_sb_h_double_arrow; - break; + const int numPfds = snd_seq_poll_descriptors_count (seqHandle, POLLIN); + struct pollfd* const pfd = (struct pollfd*) alloca (numPfds * sizeof (struct pollfd)); - case MouseCursor::UpDownResizeCursor: - shape = XC_sb_v_double_arrow; - break; + snd_seq_poll_descriptors (seqHandle, pfd, numPfds, POLLIN); - case MouseCursor::UpDownLeftRightResizeCursor: - shape = XC_fleur; - break; + while (! threadShouldExit()) + { + if (poll (pfd, numPfds, 500) > 0) + { + snd_seq_event_t* inputEvent = 0; - case MouseCursor::TopEdgeResizeCursor: - shape = XC_top_side; - break; + snd_seq_nonblock (seqHandle, 1); - case MouseCursor::BottomEdgeResizeCursor: - shape = XC_bottom_side; - break; + do + { + if (snd_seq_event_input (seqHandle, &inputEvent) >= 0) + { + // xxx what about SYSEXes that are too big for the buffer? + const int numBytes = snd_midi_event_decode (midiParser, buffer, maxEventSize, inputEvent); - case MouseCursor::LeftEdgeResizeCursor: - shape = XC_left_side; - break; + snd_midi_event_reset_decode (midiParser); - case MouseCursor::RightEdgeResizeCursor: - shape = XC_right_side; - break; + if (numBytes > 0) + { + const MidiMessage message ((const uint8*) buffer, + numBytes, + Time::getMillisecondCounter() * 0.001); - case MouseCursor::TopLeftCornerResizeCursor: - shape = XC_top_left_corner; - break; + callback->handleIncomingMidiMessage (midiInput, message); + } - case MouseCursor::TopRightCornerResizeCursor: - shape = XC_top_right_corner; - break; + snd_seq_free_event (inputEvent); + } + } + while (snd_seq_event_input_pending (seqHandle, 0) > 0); - case MouseCursor::BottomLeftCornerResizeCursor: - shape = XC_bottom_left_corner; - break; + snd_seq_free_event (inputEvent); + } + } - case MouseCursor::BottomRightCornerResizeCursor: - shape = XC_bottom_right_corner; - break; + snd_midi_event_free (midiParser); + juce_free (buffer); + } + }; - case MouseCursor::CrosshairCursor: - shape = XC_crosshair; - break; + juce_UseDebuggingNewOperator - default: - return (void*) None; // Use parent cursor - } +private: + MidiInput* const midiInput; + snd_seq_t* const seqHandle; + MidiInputCallback* const callback; +}; - return (void*) XCreateFontCursor (display, shape); +MidiInput::MidiInput (const String& name_) + : name (name_), + internal (0) +{ } -void MouseCursor::showInWindow (ComponentPeer* peer) const throw() +MidiInput::~MidiInput() { - LinuxComponentPeer* const lp = dynamic_cast (peer); + stop(); + MidiInputThread* const thread = (MidiInputThread*) internal; + delete thread; +} - if (lp != 0) - lp->showMouseCursor ((Cursor) getHandle()); +void MidiInput::start() +{ + ((MidiInputThread*) internal)->startThread(); } -void MouseCursor::showInAllWindows() const throw() +void MidiInput::stop() { - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - showInWindow (ComponentPeer::getPeer (i)); + ((MidiInputThread*) internal)->stopThread (3000); } -Image* juce_createIconForFile (const File& file) +int MidiInput::getDefaultDeviceIndex() { return 0; } -#if JUCE_OPENGL - -class WindowedGLContext : public OpenGLContext +const StringArray MidiInput::getDevices() { -public: - WindowedGLContext (Component* const component, - const OpenGLPixelFormat& pixelFormat_, - GLXContext sharedContext) - : renderContext (0), - embeddedWindow (0), - pixelFormat (pixelFormat_) - { - jassert (component != 0); - LinuxComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); - if (peer == 0) - return; - - XSync (display, False); - - GLint attribs [64]; - int n = 0; - attribs[n++] = GLX_RGBA; - attribs[n++] = GLX_DOUBLEBUFFER; - attribs[n++] = GLX_RED_SIZE; - attribs[n++] = pixelFormat.redBits; - attribs[n++] = GLX_GREEN_SIZE; - attribs[n++] = pixelFormat.greenBits; - attribs[n++] = GLX_BLUE_SIZE; - attribs[n++] = pixelFormat.blueBits; - attribs[n++] = GLX_ALPHA_SIZE; - attribs[n++] = pixelFormat.alphaBits; - attribs[n++] = GLX_DEPTH_SIZE; - attribs[n++] = pixelFormat.depthBufferBits; - attribs[n++] = GLX_STENCIL_SIZE; - attribs[n++] = pixelFormat.stencilBufferBits; - attribs[n++] = GLX_ACCUM_RED_SIZE; - attribs[n++] = pixelFormat.accumulationBufferRedBits; - attribs[n++] = GLX_ACCUM_GREEN_SIZE; - attribs[n++] = pixelFormat.accumulationBufferGreenBits; - attribs[n++] = GLX_ACCUM_BLUE_SIZE; - attribs[n++] = pixelFormat.accumulationBufferBlueBits; - attribs[n++] = GLX_ACCUM_ALPHA_SIZE; - attribs[n++] = pixelFormat.accumulationBufferAlphaBits; - - // xxx not sure how to do fullSceneAntiAliasingNumSamples on linux.. - - attribs[n++] = None; - - XVisualInfo* const bestVisual = glXChooseVisual (display, DefaultScreen (display), attribs); - - if (bestVisual == 0) - return; - - renderContext = glXCreateContext (display, bestVisual, sharedContext, GL_TRUE); - - Window windowH = (Window) peer->getNativeHandle(); - - Colormap colourMap = XCreateColormap (display, windowH, bestVisual->visual, AllocNone); - XSetWindowAttributes swa; - swa.colormap = colourMap; - swa.border_pixel = 0; - swa.event_mask = ExposureMask | StructureNotifyMask; - - embeddedWindow = XCreateWindow (display, windowH, - 0, 0, 1, 1, 0, - bestVisual->depth, - InputOutput, - bestVisual->visual, - CWBorderPixel | CWColormap | CWEventMask, - &swa); - - XSaveContext (display, (XID) embeddedWindow, improbableNumber, (XPointer) peer); + StringArray devices; + iterateDevices (true, devices, -1); + return devices; +} - XMapWindow (display, embeddedWindow); - XFreeColormap (display, colourMap); +MidiInput* MidiInput::openDevice (int deviceIndex, MidiInputCallback* callback) +{ + MidiInput* newDevice = 0; - XFree (bestVisual); - XSync (display, False); - } + StringArray devices; + snd_seq_t* const handle = iterateDevices (true, devices, deviceIndex); - ~WindowedGLContext() + if (handle != 0) { - makeInactive(); - - glXDestroyContext (display, renderContext); - - XUnmapWindow (display, embeddedWindow); - XDestroyWindow (display, embeddedWindow); + newDevice = new MidiInput (devices [deviceIndex]); + newDevice->internal = new MidiInputThread (newDevice, handle, callback); } - bool makeActive() const throw() - { - jassert (renderContext != 0); + return newDevice; +} - return glXMakeCurrent (display, embeddedWindow, renderContext) - && XSync (display, False); - } +MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallback* callback) +{ + MidiInput* newDevice = 0; - bool makeInactive() const throw() - { - return (! isActive()) || glXMakeCurrent (display, None, 0); - } + snd_seq_t* const handle = createDevice (true, deviceName); - bool isActive() const throw() + if (handle != 0) { - return glXGetCurrentContext() == renderContext; + newDevice = new MidiInput (deviceName); + newDevice->internal = new MidiInputThread (newDevice, handle, callback); } - const OpenGLPixelFormat getPixelFormat() const - { - return pixelFormat; - } + return newDevice; +} - void* getRawContext() const throw() - { - return renderContext; - } +#else - void updateWindowPosition (int x, int y, int w, int h, int) - { - XMoveResizeWindow (display, embeddedWindow, - x, y, jmax (1, w), jmax (1, h)); - } +// (These are just stub functions if ALSA is unavailable...) - void swapBuffers() - { - glXSwapBuffers (display, embeddedWindow); - } +const StringArray MidiOutput::getDevices() { return StringArray(); } +int MidiOutput::getDefaultDeviceIndex() { return 0; } +MidiOutput* MidiOutput::openDevice (int) { return 0; } +MidiOutput* MidiOutput::createNewDevice (const String&) { return 0; } +MidiOutput::~MidiOutput() {} +void MidiOutput::reset() {} +bool MidiOutput::getVolume (float&, float&) { return false; } +void MidiOutput::setVolume (float, float) {} +void MidiOutput::sendMessageNow (const MidiMessage&) {} - bool setSwapInterval (const int numFramesPerSwap) - { - // xxx needs doing.. - return false; - } +MidiInput::MidiInput (const String& name_) : name (name_), internal (0) {} +MidiInput::~MidiInput() {} +void MidiInput::start() {} +void MidiInput::stop() {} +int MidiInput::getDefaultDeviceIndex() { return 0; } +const StringArray MidiInput::getDevices() { return StringArray(); } +MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return 0; } +MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return 0; } - int getSwapInterval() const - { - // xxx needs doing.. - return 0; - } +#endif +#endif +/********* End of inlined file: juce_linux_Midi.cpp *********/ - void repaint() - { - } +/********* Start of inlined file: juce_linux_AudioCDReader.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - juce_UseDebuggingNewOperator +AudioCDReader::AudioCDReader() + : AudioFormatReader (0, T("CD Audio")) +{ +} - GLXContext renderContext; +const StringArray AudioCDReader::getAvailableCDNames() +{ + StringArray names; + return names; +} -private: - Window embeddedWindow; - OpenGLPixelFormat pixelFormat; +AudioCDReader* AudioCDReader::createReaderForCD (const int index) +{ + return 0; +} - WindowedGLContext (const WindowedGLContext&); - const WindowedGLContext& operator= (const WindowedGLContext&); -}; +AudioCDReader::~AudioCDReader() +{ +} -OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, - const OpenGLPixelFormat& pixelFormat, - const OpenGLContext* const contextToShareWith) +void AudioCDReader::refreshTrackLengths() { - WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, - contextToShareWith != 0 ? (GLXContext) contextToShareWith->getRawContext() : 0); +} - if (c->renderContext == 0) - deleteAndZero (c); +bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer, + int64 startSampleInFile, int numSamples) +{ + return false; +} - return c; +bool AudioCDReader::isCDStillPresent() const +{ + return false; } -void juce_glViewport (const int w, const int h) +int AudioCDReader::getNumTracks() const { - glViewport (0, 0, w, h); + return 0; } -void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, - OwnedArray & results) +int AudioCDReader::getPositionOfTrackStart (int trackNum) const { - results.add (new OpenGLPixelFormat()); // xxx + return 0; } -#endif +bool AudioCDReader::isTrackAudio (int trackNum) const +{ + return false; +} -static void initClipboard (Window root, Atom* cutBuffers) throw() +void AudioCDReader::enableIndexScanning (bool b) { - static bool init = false; +} - if (! init) - { - init = true; +int AudioCDReader::getLastIndex() const +{ + return 0; +} - // Make sure all cut buffers exist before use - for (int i = 0; i < 8; i++) - { - XChangeProperty (display, root, cutBuffers[i], - XA_STRING, 8, PropModeAppend, NULL, 0); - } - } +const Array AudioCDReader::findIndexesInTrack (const int trackNumber) +{ + return Array(); } -// Clipboard implemented currently using cut buffers -// rather than the more powerful selection method -void SystemClipboard::copyTextToClipboard (const String& clipText) throw() +int AudioCDReader::getCDDBId() { - Window root = RootWindow (display, DefaultScreen (display)); - Atom cutBuffers[8] = { XA_CUT_BUFFER0, XA_CUT_BUFFER1, XA_CUT_BUFFER2, XA_CUT_BUFFER3, - XA_CUT_BUFFER4, XA_CUT_BUFFER5, XA_CUT_BUFFER6, XA_CUT_BUFFER7 }; + return 0; +} - initClipboard (root, cutBuffers); +#endif +/********* End of inlined file: juce_linux_AudioCDReader.cpp *********/ - XRotateWindowProperties (display, root, cutBuffers, 8, 1); - XChangeProperty (display, root, cutBuffers[0], - XA_STRING, 8, PropModeReplace, (const unsigned char*) (const char*) clipText, - clipText.length()); -} +/********* Start of inlined file: juce_linux_FileChooser.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -const String SystemClipboard::getTextFromClipboard() throw() +void FileChooser::showPlatformDialog (OwnedArray& results, + const String& title, + const File& file, + const String& filters, + bool isDirectory, + bool isSave, + bool warnAboutOverwritingExistingFiles, + bool selectMultipleFiles, + FilePreviewComponent* previewComponent) { - const int bufSize = 64; // in words - String returnData; - int byteOffset = 0; + //xxx ain't got one! + jassertfalse +} - Window root = RootWindow (display, DefaultScreen (display)); +#endif +/********* End of inlined file: juce_linux_FileChooser.cpp *********/ - Atom cutBuffers[8] = { XA_CUT_BUFFER0, XA_CUT_BUFFER1, XA_CUT_BUFFER2, XA_CUT_BUFFER3, - XA_CUT_BUFFER4, XA_CUT_BUFFER5, XA_CUT_BUFFER6, XA_CUT_BUFFER7 }; +/********* Start of inlined file: juce_linux_WebBrowserComponent.cpp *********/ +// (This file gets included by juce_linux_NativeCode.cpp, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - initClipboard (root, cutBuffers); +#if JUCE_WEB_BROWSER - for (;;) - { - unsigned long bytesLeft = 0, nitems = 0; - unsigned char* clipData = 0; - int actualFormat = 0; - Atom actualType; +/* + Sorry.. This class isn't implemented on Linux! +*/ - if (XGetWindowProperty (display, root, cutBuffers[0], byteOffset >> 2, bufSize, - False, XA_STRING, &actualType, &actualFormat, &nitems, &bytesLeft, - &clipData) == Success) - { - if (actualType == XA_STRING && actualFormat == 8) - { - byteOffset += nitems; - returnData += String ((const char*) clipData, nitems); - } - else - { - bytesLeft = 0; - } +WebBrowserComponent::WebBrowserComponent() + : browser (0), + blankPageShown (false) +{ + setOpaque (true); +} - if (clipData != 0) - XFree (clipData); - } +WebBrowserComponent::~WebBrowserComponent() +{ +} - if (bytesLeft == 0) - break; - } +void WebBrowserComponent::goToURL (const String& url, + const StringArray* headers, + const MemoryBlock* postData) +{ + lastURL = url; + + lastHeaders.clear(); + if (headers != 0) + lastHeaders = *headers; + + lastPostData.setSize (0); + if (postData != 0) + lastPostData = *postData; + + blankPageShown = false; - return returnData; } -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +void WebBrowserComponent::stop() { - jassertfalse // not implemented! - return false; } -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +void WebBrowserComponent::goBack() { - jassertfalse // not implemented! - return false; + lastURL = String::empty; + blankPageShown = false; + } -void SystemTrayIconComponent::setIconImage (const Image& newImage) +void WebBrowserComponent::goForward() { - if (! isOnDesktop ()) - addToDesktop (0); + lastURL = String::empty; - LinuxComponentPeer* const wp = dynamic_cast (getPeer()); +} - if (wp != 0) - { - wp->setTaskBarIcon (newImage); +void WebBrowserComponent::refresh() +{ +} - setVisible (true); - toFront (false); - repaint(); - } +void WebBrowserComponent::paint (Graphics& g) +{ + g.fillAll (Colours::white); } -void SystemTrayIconComponent::paint (Graphics& g) +void WebBrowserComponent::checkWindowAssociation() { - LinuxComponentPeer* const wp = dynamic_cast (getPeer()); +} - if (wp != 0) +void WebBrowserComponent::reloadLastURL() +{ + if (lastURL.isNotEmpty()) { - const Image* const image = wp->getTaskbarIcon(); - - if (image != 0) - { - g.drawImageWithin (image, 0, 0, getWidth(), getHeight(), - RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, - false); - } + goToURL (lastURL, &lastHeaders, &lastPostData); + lastURL = String::empty; } } -void SystemTrayIconComponent::setIconTooltip (const String& tooltip) +void WebBrowserComponent::parentHierarchyChanged() { - // xxx not yet implemented! + checkWindowAssociation(); } -void PlatformUtilities::beep() +void WebBrowserComponent::resized() { - fprintf (stdout, "\a"); - fflush (stdout); } -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) +void WebBrowserComponent::visibilityChanged() { - // xxx this is supposed to pop up an alert! - Logger::outputDebugString (title + ": " + bodyText); - - // use a non-native one for the time being.. - if (isOkCancel) - return AlertWindow::showOkCancelBox (AlertWindow::NoIcon, title, bodyText); - else - AlertWindow::showMessageBox (AlertWindow::NoIcon, title, bodyText); + checkWindowAssociation(); +} +bool WebBrowserComponent::pageAboutToLoad (const String& url) +{ return true; } -const int KeyPress::spaceKey = XK_space & 0xff; -const int KeyPress::returnKey = XK_Return & 0xff; -const int KeyPress::escapeKey = XK_Escape & 0xff; -const int KeyPress::backspaceKey = XK_BackSpace & 0xff; -const int KeyPress::leftKey = (XK_Left & 0xff) | extendedKeyModifier; -const int KeyPress::rightKey = (XK_Right & 0xff) | extendedKeyModifier; -const int KeyPress::upKey = (XK_Up & 0xff) | extendedKeyModifier; -const int KeyPress::downKey = (XK_Down & 0xff) | extendedKeyModifier; -const int KeyPress::pageUpKey = (XK_Page_Up & 0xff) | extendedKeyModifier; -const int KeyPress::pageDownKey = (XK_Page_Down & 0xff) | extendedKeyModifier; -const int KeyPress::endKey = (XK_End & 0xff) | extendedKeyModifier; -const int KeyPress::homeKey = (XK_Home & 0xff) | extendedKeyModifier; -const int KeyPress::insertKey = (XK_Insert & 0xff) | extendedKeyModifier; -const int KeyPress::deleteKey = (XK_Delete & 0xff) | extendedKeyModifier; -const int KeyPress::tabKey = XK_Tab & 0xff; -const int KeyPress::F1Key = (XK_F1 & 0xff) | extendedKeyModifier; -const int KeyPress::F2Key = (XK_F2 & 0xff) | extendedKeyModifier; -const int KeyPress::F3Key = (XK_F3 & 0xff) | extendedKeyModifier; -const int KeyPress::F4Key = (XK_F4 & 0xff) | extendedKeyModifier; -const int KeyPress::F5Key = (XK_F5 & 0xff) | extendedKeyModifier; -const int KeyPress::F6Key = (XK_F6 & 0xff) | extendedKeyModifier; -const int KeyPress::F7Key = (XK_F7 & 0xff) | extendedKeyModifier; -const int KeyPress::F8Key = (XK_F8 & 0xff) | extendedKeyModifier; -const int KeyPress::F9Key = (XK_F9 & 0xff) | extendedKeyModifier; -const int KeyPress::F10Key = (XK_F10 & 0xff) | extendedKeyModifier; -const int KeyPress::F11Key = (XK_F11 & 0xff) | extendedKeyModifier; -const int KeyPress::F12Key = (XK_F12 & 0xff) | extendedKeyModifier; -const int KeyPress::F13Key = (XK_F13 & 0xff) | extendedKeyModifier; -const int KeyPress::F14Key = (XK_F14 & 0xff) | extendedKeyModifier; -const int KeyPress::F15Key = (XK_F15 & 0xff) | extendedKeyModifier; -const int KeyPress::F16Key = (XK_F16 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad0 = (XK_KP_0 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad1 = (XK_KP_1 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad2 = (XK_KP_2 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad3 = (XK_KP_3 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad4 = (XK_KP_4 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad5 = (XK_KP_5 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad6 = (XK_KP_6 & 0xff) | extendedKeyModifier; -const int KeyPress::numberPad7 = (XK_KP_7 & 0xff)| extendedKeyModifier; -const int KeyPress::numberPad8 = (XK_KP_8 & 0xff)| extendedKeyModifier; -const int KeyPress::numberPad9 = (XK_KP_9 & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadAdd = (XK_KP_Add & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadSubtract = (XK_KP_Subtract & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadMultiply = (XK_KP_Multiply & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadDivide = (XK_KP_Divide & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadSeparator = (XK_KP_Separator & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadDecimalPoint = (XK_KP_Decimal & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadEquals = (XK_KP_Equal & 0xff)| extendedKeyModifier; -const int KeyPress::numberPadDelete = (XK_KP_Delete & 0xff)| extendedKeyModifier; -const int KeyPress::playKey = (0xffeeff00) | extendedKeyModifier; -const int KeyPress::stopKey = (0xffeeff01) | extendedKeyModifier; -const int KeyPress::fastForwardKey = (0xffeeff02) | extendedKeyModifier; -const int KeyPress::rewindKey = (0xffeeff03) | extendedKeyModifier; - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_linux_Windowing.cpp *********/ +#endif +#endif +/********* End of inlined file: juce_linux_WebBrowserComponent.cpp *********/ #endif +END_JUCE_NAMESPACE +/********* End of inlined file: juce_linux_NativeCode.cpp *********/ + #endif //============================================================================== @@ -266218,6 +255175,196 @@ int juce_seekInInternetFile (void* handle, int newPosition) #endif /********* End of inlined file: juce_mac_Network.mm *********/ +/********* Start of inlined file: juce_mac_NamedPipe.cpp *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +struct NamedPipeInternal +{ + String pipeInName, pipeOutName; + int pipeIn, pipeOut; + + bool volatile createdPipe, blocked, stopReadOperation; + + static void signalHandler (int) {} +}; + +void NamedPipe::cancelPendingReads() +{ + while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) + { + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + + intern->stopReadOperation = true; + + char buffer [1] = { 0 }; + int bytesWritten = ::write (intern->pipeIn, buffer, 1); + (void) bytesWritten; + + int timeout = 2000; + while (intern->blocked && --timeout >= 0) + Thread::sleep (2); + + intern->stopReadOperation = false; + } +} + +void NamedPipe::close() +{ + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + + if (intern != 0) + { + internal = 0; + + if (intern->pipeIn != -1) + ::close (intern->pipeIn); + + if (intern->pipeOut != -1) + ::close (intern->pipeOut); + + if (intern->createdPipe) + { + unlink (intern->pipeInName); + unlink (intern->pipeOutName); + } + + delete intern; + } +} + +bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) +{ + close(); + + NamedPipeInternal* const intern = new NamedPipeInternal(); + internal = intern; + intern->createdPipe = createPipe; + intern->blocked = false; + intern->stopReadOperation = false; + + signal (SIGPIPE, NamedPipeInternal::signalHandler); + siginterrupt (SIGPIPE, 1); + + const String pipePath (T("/tmp/") + File::createLegalFileName (pipeName)); + + intern->pipeInName = pipePath + T("_in"); + intern->pipeOutName = pipePath + T("_out"); + intern->pipeIn = -1; + intern->pipeOut = -1; + + if (createPipe) + { + if ((mkfifo (intern->pipeInName, 0666) && errno != EEXIST) + || (mkfifo (intern->pipeOutName, 0666) && errno != EEXIST)) + { + delete intern; + internal = 0; + + return false; + } + } + + return true; +} + +int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) +{ + int bytesRead = -1; + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + + if (intern != 0) + { + intern->blocked = true; + + if (intern->pipeIn == -1) + { + if (intern->createdPipe) + intern->pipeIn = ::open (intern->pipeInName, O_RDWR); + else + intern->pipeIn = ::open (intern->pipeOutName, O_RDWR); + + if (intern->pipeIn == -1) + { + intern->blocked = false; + return -1; + } + } + + bytesRead = 0; + + char* p = (char*) destBuffer; + + while (bytesRead < maxBytesToRead) + { + const int bytesThisTime = maxBytesToRead - bytesRead; + const int numRead = ::read (intern->pipeIn, p, bytesThisTime); + + if (numRead <= 0 || intern->stopReadOperation) + { + bytesRead = -1; + break; + } + + bytesRead += numRead; + p += bytesRead; + } + + intern->blocked = false; + } + + return bytesRead; +} + +int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) +{ + int bytesWritten = -1; + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + + if (intern != 0) + { + if (intern->pipeOut == -1) + { + if (intern->createdPipe) + intern->pipeOut = ::open (intern->pipeOutName, O_WRONLY); + else + intern->pipeOut = ::open (intern->pipeInName, O_WRONLY); + + if (intern->pipeOut == -1) + { + return -1; + } + } + + const char* p = (const char*) sourceBuffer; + bytesWritten = 0; + + const uint32 timeOutTime = Time::getMillisecondCounter() + timeOutMilliseconds; + + while (bytesWritten < numBytesToWrite + && (timeOutMilliseconds < 0 || Time::getMillisecondCounter() < timeOutTime)) + { + const int bytesThisTime = numBytesToWrite - bytesWritten; + const int numWritten = ::write (intern->pipeOut, p, bytesThisTime); + + if (numWritten <= 0) + { + bytesWritten = -1; + break; + } + + bytesWritten += numWritten; + p += bytesWritten; + } + } + + return bytesWritten; +} + +#endif +/********* End of inlined file: juce_mac_NamedPipe.cpp *********/ + /********* Start of inlined file: juce_mac_Threads.mm *********/ // (This file gets included by juce_mac_NativeCode.mm, rather than being // compiled on its own). @@ -266682,7 +255829,8 @@ const String juce_getVolumeLabel (const String& filenameOnVolume, void juce_runSystemCommand (const String& command) { - system ((const char*) command.toUTF8()); + int result = system ((const char*) command.toUTF8()); + (void) result; } const String juce_getOutputFromCommand (const String& command) @@ -274450,205 +263598,4 @@ CameraDevice* CameraDevice::openDevice (int index, END_JUCE_NAMESPACE /********* End of inlined file: juce_mac_NativeCode.mm *********/ -/********* Start of inlined file: juce_mac_NamedPipe.cpp *********/ - -#include -#include -#include - -// As well as being for the mac, this file is included by the linux build. - -#if ! JUCE_MAC - #include - #include - #include -#endif - -BEGIN_JUCE_NAMESPACE - -struct NamedPipeInternal -{ - String pipeInName, pipeOutName; - int pipeIn, pipeOut; - - bool volatile createdPipe, blocked, stopReadOperation; - - static void signalHandler (int) {} -}; - -void NamedPipe::cancelPendingReads() -{ - while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) - { - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - intern->stopReadOperation = true; - - char buffer [1] = { 0 }; - int bytesWritten = ::write (intern->pipeIn, buffer, 1); - (void) bytesWritten; - - int timeout = 2000; - while (intern->blocked && --timeout >= 0) - Thread::sleep (2); - - intern->stopReadOperation = false; - } -} - -void NamedPipe::close() -{ - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - if (intern != 0) - { - internal = 0; - - if (intern->pipeIn != -1) - ::close (intern->pipeIn); - - if (intern->pipeOut != -1) - ::close (intern->pipeOut); - - if (intern->createdPipe) - { - unlink (intern->pipeInName); - unlink (intern->pipeOutName); - } - - delete intern; - } -} - -bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) -{ - close(); - - NamedPipeInternal* const intern = new NamedPipeInternal(); - internal = intern; - intern->createdPipe = createPipe; - intern->blocked = false; - intern->stopReadOperation = false; - - signal (SIGPIPE, NamedPipeInternal::signalHandler); - siginterrupt (SIGPIPE, 1); - - const String pipePath (T("/tmp/") + File::createLegalFileName (pipeName)); - - intern->pipeInName = pipePath + T("_in"); - intern->pipeOutName = pipePath + T("_out"); - intern->pipeIn = -1; - intern->pipeOut = -1; - - if (createPipe) - { - if ((mkfifo (intern->pipeInName, 0666) && errno != EEXIST) - || (mkfifo (intern->pipeOutName, 0666) && errno != EEXIST)) - { - delete intern; - internal = 0; - - return false; - } - } - - return true; -} - -int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) -{ - int bytesRead = -1; - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - if (intern != 0) - { - intern->blocked = true; - - if (intern->pipeIn == -1) - { - if (intern->createdPipe) - intern->pipeIn = ::open (intern->pipeInName, O_RDWR); - else - intern->pipeIn = ::open (intern->pipeOutName, O_RDWR); - - if (intern->pipeIn == -1) - { - intern->blocked = false; - return -1; - } - } - - bytesRead = 0; - - char* p = (char*) destBuffer; - - while (bytesRead < maxBytesToRead) - { - const int bytesThisTime = maxBytesToRead - bytesRead; - const int numRead = ::read (intern->pipeIn, p, bytesThisTime); - - if (numRead <= 0 || intern->stopReadOperation) - { - bytesRead = -1; - break; - } - - bytesRead += numRead; - p += bytesRead; - } - - intern->blocked = false; - } - - return bytesRead; -} - -int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) -{ - int bytesWritten = -1; - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - if (intern != 0) - { - if (intern->pipeOut == -1) - { - if (intern->createdPipe) - intern->pipeOut = ::open (intern->pipeOutName, O_WRONLY); - else - intern->pipeOut = ::open (intern->pipeInName, O_WRONLY); - - if (intern->pipeOut == -1) - { - return -1; - } - } - - const char* p = (const char*) sourceBuffer; - bytesWritten = 0; - - const uint32 timeOutTime = Time::getMillisecondCounter() + timeOutMilliseconds; - - while (bytesWritten < numBytesToWrite - && (timeOutMilliseconds < 0 || Time::getMillisecondCounter() < timeOutTime)) - { - const int bytesThisTime = numBytesToWrite - bytesWritten; - const int numWritten = ::write (intern->pipeOut, p, bytesThisTime); - - if (numWritten <= 0) - { - bytesWritten = -1; - break; - } - - bytesWritten += numWritten; - p += bytesWritten; - } - } - - return bytesWritten; -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_NamedPipe.cpp *********/ - #endif diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 4f4715e7ae..0615874acd 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -80,7 +80,7 @@ /********* Start of inlined file: juce_Config.h *********/ #ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) +#define __JUCE_CONFIG_JUCEHEADER__ /* This file contains macros that enable/disable various JUCE features. @@ -638,10 +638,6 @@ #include #include -#if JUCE_MAC || JUCE_LINUX - #include -#endif - #if JUCE_USE_INTRINSICS #include #endif @@ -2742,9 +2738,6 @@ BEGIN_JUCE_NAMESPACE #endif // __JUCE_ATOMIC_JUCEHEADER__ /********* End of inlined file: juce_Atomic.h *********/ -#endif -#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ - #endif #ifndef __JUCE_FILELOGGER_JUCEHEADER__ @@ -7465,6 +7458,9 @@ private: #endif // __JUCE_RANDOM_JUCEHEADER__ /********* End of inlined file: juce_Random.h *********/ +#endif +#ifndef __JUCE_TIME_JUCEHEADER__ + #endif #ifndef __JUCE_RELATIVETIME_JUCEHEADER__ @@ -7996,10 +7992,10 @@ public: /********* End of inlined file: juce_SystemStats.h *********/ #endif -#ifndef __JUCE_TIME_JUCEHEADER__ +#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ #endif -#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ +#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ #endif #ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ diff --git a/src/juce_amalgamated_template.cpp b/src/juce_amalgamated_template.cpp index 76607ba9ce..c0003a7ef6 100644 --- a/src/juce_amalgamated_template.cpp +++ b/src/juce_amalgamated_template.cpp @@ -44,13 +44,13 @@ #error #endif -#include "../juce_Config.h" +#include "../juce_Config.h" // FORCE_AMALGAMATOR_INCLUDE //============================================================================== #ifdef _WIN32 #include "../build/win32/platform_specific_code/juce_win32_NativeIncludes.h" #elif defined (LINUX) - // + #include "../build/linux/platform_specific_code/juce_linux_NativeIncludes.h" #else #include "../build/macosx/platform_specific_code/juce_mac_NativeIncludes.h" #endif @@ -333,46 +333,24 @@ #include "juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp" #if ! JUCE_ONLY_BUILD_CORE_LIBRARY -#include "juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp" -#include "juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp" -#include "juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp" -#include "juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp" + #include "juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp" + #include "juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp" + #include "juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp" + #include "juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp" #endif //============================================================================== #if JUCE_WIN32 - -#include "../build/win32/platform_specific_code/juce_win32_NativeCode.cpp" -#include "../build/win32/platform_specific_code/juce_win32_AutoLinkLibraries.h" - + #include "../build/win32/platform_specific_code/juce_win32_NativeCode.cpp" + #include "../build/win32/platform_specific_code/juce_win32_AutoLinkLibraries.h" #endif //============================================================================== #if JUCE_LINUX - -#include "../build/linux/platform_specific_code/juce_linux_Files.cpp" -#include "../build/linux/platform_specific_code/juce_linux_NamedPipe.cpp" -#include "../build/linux/platform_specific_code/juce_linux_Network.cpp" -#include "../build/linux/platform_specific_code/juce_linux_SystemStats.cpp" -#include "../build/linux/platform_specific_code/juce_linux_Threads.cpp" - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - #include "../build/linux/platform_specific_code/juce_linux_Audio.cpp" - #include "../build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp" - #include "../build/linux/platform_specific_code/juce_linux_FileChooser.cpp" - #include "../build/linux/platform_specific_code/juce_linux_Fonts.cpp" - #include "../build/linux/platform_specific_code/juce_linux_Messaging.cpp" - #include "../build/linux/platform_specific_code/juce_linux_Midi.cpp" - #include "../build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp" - #include "../build/linux/platform_specific_code/juce_linux_Windowing.cpp" -#endif - + #include "../build/linux/platform_specific_code/juce_linux_NativeCode.cpp" #endif //============================================================================== #if JUCE_MAC - -#include "../build/macosx/platform_specific_code/juce_mac_NativeCode.mm" -#include "../build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp" - + #include "../build/macosx/platform_specific_code/juce_mac_NativeCode.mm" #endif diff --git a/src/juce_appframework/audio/audio_file_formats/oggvorbis/codec.h b/src/juce_appframework/audio/audio_file_formats/oggvorbis/codec.h index 7a87a4a27c..bdc5b4a32f 100644 --- a/src/juce_appframework/audio/audio_file_formats/oggvorbis/codec.h +++ b/src/juce_appframework/audio/audio_file_formats/oggvorbis/codec.h @@ -168,7 +168,7 @@ extern int vorbis_info_blocksize(vorbis_info *vi,int zo); extern void vorbis_comment_init(vorbis_comment *vc); extern void vorbis_comment_add(vorbis_comment *vc, char *comment); extern void vorbis_comment_add_tag(vorbis_comment *vc, - char *tag, char *contents); + const char *tag, char *contents); extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); extern void vorbis_comment_clear(vorbis_comment *vc); diff --git a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/analysis.c b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/analysis.c index d1102db93c..a8d244dee2 100644 --- a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/analysis.c +++ b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/analysis.c @@ -69,7 +69,7 @@ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){ } /* there was no great place to put this.... */ -void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ +void _analysis_output_always(const char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ int j; FILE *of; char buffer[80]; diff --git a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/info.c b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/info.c index 7743a8937b..16b6629c22 100644 --- a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/info.c +++ b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/info.c @@ -35,7 +35,7 @@ #include "os.h" -static void _v_writestring(oggpack_buffer *o,char *s, int bytes){ +static void _v_writestring(oggpack_buffer *o, const char *s, int bytes){ while(bytes--){ oggpack_write(o,*s++,8); @@ -64,7 +64,7 @@ void vorbis_comment_add(vorbis_comment *vc,char *comment){ vc->user_comments[vc->comments]=NULL; } -void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents){ +void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, char *contents){ char *comment=(char*)alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */ strcpy(comment, tag); strcat(comment, "="); diff --git a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c index 0d17eed8a8..ad101fc4a8 100644 --- a/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c +++ b/src/juce_appframework/audio/audio_file_formats/oggvorbis/libvorbis-1.1.2/lib/vorbisfile.c @@ -1704,7 +1704,7 @@ long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int length, } extern float *vorbis_window(vorbis_dsp_state *v,int W); -extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, +extern void _analysis_output_always(const char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off); static void _ov_splice(float **pcm,float **lappcm, diff --git a/src/juce_core/basics/juce_StandardHeader.h b/src/juce_core/basics/juce_StandardHeader.h index 8223bad724..15aa457a2f 100644 --- a/src/juce_core/basics/juce_StandardHeader.h +++ b/src/juce_core/basics/juce_StandardHeader.h @@ -83,10 +83,6 @@ #include #include -#if JUCE_MAC || JUCE_LINUX - #include -#endif - #if JUCE_USE_INTRINSICS #include #endif diff --git a/src/juce_core/io/streams/zlib/zutil.c b/src/juce_core/io/streams/zlib/zutil.c index 74593c24b6..33964c2d6e 100644 --- a/src/juce_core/io/streams/zlib/zutil.c +++ b/src/juce_core/io/streams/zlib/zutil.c @@ -119,7 +119,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int z_verbose = verbose; -void z_error (char *m) +void z_error (const char *m) { fprintf(stderr, "%s\n", m); exit(1); diff --git a/src/juce_core/io/streams/zlib/zutil.h b/src/juce_core/io/streams/zlib/zutil.h index a8a0b12890..776f10718d 100644 --- a/src/juce_core/io/streams/zlib/zutil.h +++ b/src/juce_core/io/streams/zlib/zutil.h @@ -241,7 +241,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #ifdef DEBUG # include extern int z_verbose; - extern void z_error OF((char *m)); + extern void z_error OF((const char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} diff --git a/src/juce_core_includes.h b/src/juce_core_includes.h index ddbb467fc5..fb95996a83 100644 --- a/src/juce_core_includes.h +++ b/src/juce_core_includes.h @@ -35,9 +35,6 @@ #ifndef __JUCE_ATOMIC_JUCEHEADER__ #include "juce_core/basics/juce_Atomic.h" #endif -#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ - #include "juce_core/basics/juce_StandardHeader.h" -#endif #ifndef __JUCE_FILELOGGER_JUCEHEADER__ #include "juce_core/basics/juce_FileLogger.h" #endif @@ -59,6 +56,9 @@ #ifndef __JUCE_RANDOM_JUCEHEADER__ #include "juce_core/basics/juce_Random.h" #endif +#ifndef __JUCE_TIME_JUCEHEADER__ + #include "juce_core/basics/juce_Time.h" +#endif #ifndef __JUCE_RELATIVETIME_JUCEHEADER__ #include "juce_core/basics/juce_RelativeTime.h" #endif @@ -68,12 +68,12 @@ #ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ #include "juce_core/basics/juce_SystemStats.h" #endif -#ifndef __JUCE_TIME_JUCEHEADER__ - #include "juce_core/basics/juce_Time.h" -#endif #ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ #include "juce_core/basics/juce_DataConversions.h" #endif +#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ + #include "juce_core/basics/juce_StandardHeader.h" +#endif #ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ #include "juce_core/containers/juce_ArrayAllocationBase.h" #endif