From 47cf2369e5fdac60ffd4161ca542faa7fc1c3a46 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 27 Oct 2008 17:51:24 +0000 Subject: [PATCH] --- build/linux/JUCE.make | 702 +- .../juce_linux_Audio.cpp | 12 +- .../juce_linux_Messaging.cpp | 14 +- .../juce_linux_Network.cpp | 390 +- .../juce_linux_Threads.cpp | 11 +- .../juce_linux_WebBrowserComponent.cpp | 7 +- .../juce_linux_Windowing.cpp | 6 +- build/macosx/Juce.xcodeproj/project.pbxproj | 213 +- build/macosx/juce.xcconfig | 28 +- .../juce_mac_AppleRemote.mm | 278 + .../juce_mac_AudioCDBurner.mm | 880 +- .../juce_mac_CoreAudio.cpp | 2590 +- .../juce_mac_CoreMidi.cpp | 1175 +- .../juce_mac_Debugging.mm | 74 + .../juce_mac_FileChooser.mm | 306 +- .../platform_specific_code/juce_mac_Files.mm | 541 + .../platform_specific_code/juce_mac_Fonts.mm | 19 +- .../juce_mac_MainMenu.mm | 414 + .../juce_mac_MessageManager.mm | 275 + .../juce_mac_Messaging.mm | 503 - .../juce_mac_MiscUtilities.mm | 238 + .../juce_mac_MouseCursor.mm | 196 + .../juce_mac_NSViewComponent.mm | 149 + .../juce_mac_NSViewComponentPeer.mm | 1258 + .../juce_mac_NamedPipe.cpp | 472 +- .../juce_mac_NativeCode.mm | 111 + .../juce_mac_NativeHeaders.h | 2 +- .../juce_mac_NativeIncludes.h | 73 + .../juce_mac_Network.mm | 918 +- .../juce_mac_OpenGLComponent.mm | 235 + .../juce_mac_QuickTimeMovieComponent.mm | 294 + .../juce_mac_Strings.mm | 186 + .../juce_mac_SystemStats.mm | 148 +- .../juce_mac_Threads.cpp | 404 +- .../juce_mac_Threads.mm | 129 + .../juce_mac_WebBrowserComponent.mm | 701 +- .../juce_mac_Windowing.mm | 3551 -- .../juce_win32_ASIO.cpp | 59 +- .../juce_win32_ActiveXComponent.cpp | 552 + .../juce_win32_AudioCDReader.cpp | 37 +- .../juce_win32_DirectSound.cpp | 41 +- .../juce_win32_DynamicLibraryLoader.cpp | 11 +- .../juce_win32_FileChooser.cpp | 23 +- .../juce_win32_Files.cpp | 90 +- .../juce_win32_Fonts.cpp | 15 +- .../juce_win32_Messaging.cpp | 16 +- .../juce_win32_Midi.cpp | 23 +- .../juce_win32_Misc.cpp | 41 +- .../juce_win32_NativeIncludes.h | 156 + .../juce_win32_Network.cpp | 28 +- .../juce_win32_PlatformUtils.cpp | 29 +- .../juce_win32_QuickTimeMovieComponent.cpp | 517 + .../juce_win32_SystemStats.cpp | 21 +- .../juce_win32_Threads.cpp | 40 +- .../juce_win32_WebBrowserComponent.cpp | 32 +- .../juce_win32_Windowing.cpp | 1088 +- build/win32/vc8/JUCE.vcproj | 24 +- .../mac/PluginHost.xcodeproj/project.pbxproj | 36 +- extras/audio plugin host/src/HostStartup.cpp | 2 + .../src/host/MainHostWindow.cpp | 14 +- extras/audio plugin host/src/includes.h | 3 +- .../demo/build/AudioUnit/JuceAU.exp | 17 +- .../JuceDemoAU.xcodeproj/project.pbxproj | 56 +- .../juce_RTASDemo.xcodeproj/project.pbxproj | 64 +- .../VST_Mac/JuceVST.xcodeproj/project.pbxproj | 34 +- ...itWrapper.cpp => juce_AudioUnitWrapper.mm} | 370 +- .../formats/AudioUnit/juce_AudioUnitWrapper.r | 13 - .../formats/RTAS/juce_RTASUtilities.mm | 82 + .../wrapper/formats/RTAS/juce_RTASWrapper.cpp | 220 +- .../formats/VST/MacExportedSymbols.txt | 12 + .../wrapper/formats/VST/juce_VstWrapper.cpp | 111 +- .../wrapper/formats/VST/juce_VstWrapper.mm | 111 + .../project.pbxproj | 12 +- extras/juce demo/build/linux/JuceDemo.make | 42 +- extras/juce demo/build/macosx/Info.plist | 18 +- .../macosx/jucedemo.xcodeproj/project.pbxproj | 431 +- extras/juce demo/build/win32_vc8/jucedemo.sln | 3 + extras/juce demo/src/BinaryData.cpp | 14865 +++-- extras/juce demo/src/BinaryData.h | 60 +- .../juce demo/src/binarydata/OpenGLDemo.cpp | 4 - .../src/binarydata/ThreadingDemo.cpp | 2 +- extras/juce demo/src/demos/ThreadingDemo.cpp | 2 +- extras/juce demo/src/juce_AppConfig.h | 4 +- .../build/mac/Jucer.xcodeproj/project.pbxproj | 28 +- extras/the jucer/src/BinaryData.cpp | 1 - extras/the jucer/src/juce_AppConfig.h | 4 +- extras/the jucer/src/jucer_Headers.h | 2 +- extras/the jucer/src/jucer_Main.cpp | 2 +- .../src/utility/jucer_UtilityFunctions.cpp | 3 + juce_Config.h | 10 +- juce_amalgamated.cpp | 45809 +++++++++------- juce_amalgamated.h | 13761 ++--- src/juce_amalgamated_template.cpp | 82 +- src/juce_app_includes.h | 6 +- .../application/juce_Application.cpp | 27 +- .../application/juce_Application.h | 7 +- .../juce_QuickTimeAudioFormat.cpp | 4 +- .../audio/dsp/juce_AudioSampleBuffer.cpp | 21 +- .../audio/dsp/juce_AudioSampleBuffer.h | 3 +- .../formats/juce_AudioUnitPluginFormat.mm | 1332 + .../plugins/formats/juce_VSTPluginFormat.cpp | 349 +- .../plugins/formats/juce_VSTPluginFormat.mm | 35 + .../plugins/juce_PluginListComponent.cpp | 4 +- .../events/juce_MessageManager.cpp | 175 +- .../events/juce_MessageManager.h | 91 +- src/juce_appframework/events/juce_Timer.cpp | 13 - .../gui/components/controls/juce_Slider.cpp | 2784 +- .../gui/components/juce_Component.cpp | 2 +- .../juce_AudioDeviceSelectorComponent.cpp | 8 +- .../components/special/juce_NSViewComponent.h | 96 + .../components/special/juce_OpenGLComponent.h | 7 + .../special/juce_QuickTimeMovieComponent.cpp | 1115 - .../special/juce_QuickTimeMovieComponent.h | 47 +- .../special/juce_WebBrowserComponent.h | 13 +- .../components/windows/juce_ComponentPeer.h | 3 + .../components/windows/juce_SplashScreen.cpp | 2 +- .../components/windows/juce_TooltipWindow.cpp | 28 +- .../components/windows/juce_TooltipWindow.h | 1 + .../juce_LowLevelGraphicsSoftwareRenderer.cpp | 4 +- .../image_file_formats/juce_JPEGLoader.cpp | 2 +- .../image_file_formats/juce_PNGLoader.cpp | 6 +- .../image_file_formats/pnglib/pngrutil.c | 2 +- src/juce_core/basics/juce_SystemStats.cpp | 9 + src/juce_core/io/network/juce_Socket.cpp | 1 - src/juce_core/io/network/juce_URL.cpp | 10 +- src/juce_core/io/network/juce_URL.h | 7 +- .../juce_GZIPCompressorOutputStream.cpp | 2 +- src/juce_core/misc/juce_PlatformUtilities.h | 54 +- src/juce_core/text/juce_XmlElement.cpp | 19 +- src/juce_core/text/juce_XmlElement.h | 16 +- src/juce_core/threads/juce_Process.h | 28 - src/juce_core/threads/juce_ReadWriteLock.cpp | 10 +- src/juce_core/threads/juce_ReadWriteLock.h | 4 +- src/juce_core/threads/juce_Thread.cpp | 4 +- src/juce_core/threads/juce_Thread.h | 7 +- src/juce_core_includes.h | 186 +- 136 files changed, 56419 insertions(+), 46761 deletions(-) create mode 100644 build/macosx/platform_specific_code/juce_mac_AppleRemote.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_Debugging.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_Files.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_MainMenu.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_MessageManager.mm delete mode 100644 build/macosx/platform_specific_code/juce_mac_Messaging.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_MiscUtilities.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_MouseCursor.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_NSViewComponent.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_NativeCode.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_NativeIncludes.h create mode 100644 build/macosx/platform_specific_code/juce_mac_OpenGLComponent.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_QuickTimeMovieComponent.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_Strings.mm create mode 100644 build/macosx/platform_specific_code/juce_mac_Threads.mm delete mode 100644 build/macosx/platform_specific_code/juce_mac_Windowing.mm create mode 100644 build/win32/platform_specific_code/juce_win32_ActiveXComponent.cpp create mode 100644 build/win32/platform_specific_code/juce_win32_NativeIncludes.h create mode 100644 build/win32/platform_specific_code/juce_win32_QuickTimeMovieComponent.cpp rename extras/audio plugins/wrapper/formats/AudioUnit/{juce_AudioUnitWrapper.cpp => juce_AudioUnitWrapper.mm} (77%) create mode 100644 extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.mm create mode 100644 extras/audio plugins/wrapper/formats/VST/MacExportedSymbols.txt create mode 100644 extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.mm create mode 100644 src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.mm create mode 100644 src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.mm create mode 100644 src/juce_appframework/gui/components/special/juce_NSViewComponent.h delete mode 100644 src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp diff --git a/build/linux/JUCE.make b/build/linux/JUCE.make index 768e260ef2..40f10985a5 100644 --- a/build/linux/JUCE.make +++ b/build/linux/JUCE.make @@ -36,272 +36,271 @@ ifeq ($(CONFIG),Release) endif OBJECTS := \ + $(OBJDIR)/juce_RelativeTime.o \ $(OBJDIR)/juce_FileLogger.o \ $(OBJDIR)/juce_Logger.o \ $(OBJDIR)/juce_Random.o \ - $(OBJDIR)/juce_RelativeTime.o \ - $(OBJDIR)/juce_SystemStats.o \ $(OBJDIR)/juce_Time.o \ + $(OBJDIR)/juce_SystemStats.o \ $(OBJDIR)/juce_BlowFish.o \ - $(OBJDIR)/juce_MD5.o \ - $(OBJDIR)/juce_Primes.o \ $(OBJDIR)/juce_RSAKey.o \ - $(OBJDIR)/juce_BitArray.o \ - $(OBJDIR)/juce_MemoryBlock.o \ + $(OBJDIR)/juce_Primes.o \ + $(OBJDIR)/juce_MD5.o \ $(OBJDIR)/juce_PropertySet.o \ + $(OBJDIR)/juce_MemoryBlock.o \ + $(OBJDIR)/juce_BitArray.o \ $(OBJDIR)/juce_InputStream.o \ $(OBJDIR)/juce_OutputStream.o \ - $(OBJDIR)/juce_DirectoryIterator.o \ - $(OBJDIR)/juce_File.o \ $(OBJDIR)/juce_FileInputStream.o \ $(OBJDIR)/juce_FileOutputStream.o \ + $(OBJDIR)/juce_DirectoryIterator.o \ $(OBJDIR)/juce_FileSearchPath.o \ $(OBJDIR)/juce_NamedPipe.o \ - $(OBJDIR)/juce_Socket.o \ + $(OBJDIR)/juce_File.o \ $(OBJDIR)/juce_URL.o \ - $(OBJDIR)/juce_BufferedInputStream.o \ - $(OBJDIR)/juce_FileInputSource.o \ - $(OBJDIR)/juce_GZIPCompressorOutputStream.o \ - $(OBJDIR)/juce_GZIPDecompressorInputStream.o \ + $(OBJDIR)/juce_Socket.o \ $(OBJDIR)/juce_MemoryInputStream.o \ $(OBJDIR)/juce_MemoryOutputStream.o \ $(OBJDIR)/juce_SubregionStream.o \ + $(OBJDIR)/juce_BufferedInputStream.o \ + $(OBJDIR)/juce_FileInputSource.o \ + $(OBJDIR)/juce_GZIPDecompressorInputStream.o \ + $(OBJDIR)/juce_GZIPCompressorOutputStream.o \ $(OBJDIR)/juce_PerformanceCounter.o \ - $(OBJDIR)/juce_Uuid.o \ $(OBJDIR)/juce_ZipFile.o \ + $(OBJDIR)/juce_Uuid.o \ + $(OBJDIR)/juce_StringPairArray.o \ $(OBJDIR)/juce_CharacterFunctions.o \ - $(OBJDIR)/juce_LocalisedStrings.o \ - $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_StringArray.o \ - $(OBJDIR)/juce_StringPairArray.o \ - $(OBJDIR)/juce_XmlDocument.o \ + $(OBJDIR)/juce_String.o \ $(OBJDIR)/juce_XmlElement.o \ + $(OBJDIR)/juce_LocalisedStrings.o \ + $(OBJDIR)/juce_XmlDocument.o \ $(OBJDIR)/juce_InterProcessLock.o \ $(OBJDIR)/juce_ReadWriteLock.o \ - $(OBJDIR)/juce_Thread.o \ $(OBJDIR)/juce_ThreadPool.o \ $(OBJDIR)/juce_TimeSliceThread.o \ - $(OBJDIR)/juce_Application.o \ - $(OBJDIR)/juce_ApplicationCommandInfo.o \ + $(OBJDIR)/juce_Thread.o \ $(OBJDIR)/juce_ApplicationCommandManager.o \ + $(OBJDIR)/juce_PropertiesFile.o \ $(OBJDIR)/juce_ApplicationCommandTarget.o \ + $(OBJDIR)/juce_ApplicationCommandInfo.o \ $(OBJDIR)/juce_ApplicationProperties.o \ $(OBJDIR)/juce_DeletedAtShutdown.o \ - $(OBJDIR)/juce_PropertiesFile.o \ - $(OBJDIR)/juce_AudioDataConverters.o \ + $(OBJDIR)/juce_Application.o \ $(OBJDIR)/juce_AudioSampleBuffer.o \ + $(OBJDIR)/juce_AudioDataConverters.o \ $(OBJDIR)/juce_IIRFilter.o \ $(OBJDIR)/juce_MidiBuffer.o \ + $(OBJDIR)/juce_MidiMessageSequence.o \ $(OBJDIR)/juce_MidiFile.o \ $(OBJDIR)/juce_MidiKeyboardState.o \ $(OBJDIR)/juce_MidiMessage.o \ $(OBJDIR)/juce_MidiMessageCollector.o \ - $(OBJDIR)/juce_MidiMessageSequence.o \ - $(OBJDIR)/juce_AudioProcessor.o \ - $(OBJDIR)/juce_AudioProcessorEditor.o \ $(OBJDIR)/juce_AudioProcessorGraph.o \ - $(OBJDIR)/juce_AudioProcessorPlayer.o \ $(OBJDIR)/juce_GenericAudioProcessorEditor.o \ + $(OBJDIR)/juce_AudioProcessorEditor.o \ + $(OBJDIR)/juce_AudioProcessorPlayer.o \ + $(OBJDIR)/juce_AudioProcessor.o \ $(OBJDIR)/juce_AudioPluginFormat.o \ + $(OBJDIR)/juce_PluginDirectoryScanner.o \ + $(OBJDIR)/juce_PluginDescription.o \ $(OBJDIR)/juce_AudioPluginFormatManager.o \ $(OBJDIR)/juce_AudioPluginInstance.o \ $(OBJDIR)/juce_KnownPluginList.o \ - $(OBJDIR)/juce_PluginDescription.o \ - $(OBJDIR)/juce_PluginDirectoryScanner.o \ $(OBJDIR)/juce_PluginListComponent.o \ - $(OBJDIR)/juce_AudioUnitPluginFormat.o \ $(OBJDIR)/juce_VSTPluginFormat.o \ - $(OBJDIR)/juce_AiffAudioFormat.o \ + $(OBJDIR)/juce_AudioUnitPluginFormat.o \ + $(OBJDIR)/juce_WavAudioFormat.o \ + $(OBJDIR)/juce_AudioThumbnailCache.o \ $(OBJDIR)/juce_AudioCDReader.o \ - $(OBJDIR)/juce_AudioFormat.o \ + $(OBJDIR)/juce_AiffAudioFormat.o \ $(OBJDIR)/juce_AudioFormatManager.o \ - $(OBJDIR)/juce_AudioSubsectionReader.o \ $(OBJDIR)/juce_AudioThumbnail.o \ - $(OBJDIR)/juce_AudioThumbnailCache.o \ - $(OBJDIR)/juce_FlacAudioFormat.o \ + $(OBJDIR)/juce_AudioFormat.o \ + $(OBJDIR)/juce_AudioSubsectionReader.o \ $(OBJDIR)/juce_OggVorbisAudioFormat.o \ + $(OBJDIR)/juce_FlacAudioFormat.o \ $(OBJDIR)/juce_QuickTimeAudioFormat.o \ - $(OBJDIR)/juce_WavAudioFormat.o \ - $(OBJDIR)/juce_AudioFormatReaderSource.o \ - $(OBJDIR)/juce_AudioSourcePlayer.o \ $(OBJDIR)/juce_AudioTransportSource.o \ + $(OBJDIR)/juce_ResamplingAudioSource.o \ $(OBJDIR)/juce_BufferingAudioSource.o \ + $(OBJDIR)/juce_AudioFormatReaderSource.o \ $(OBJDIR)/juce_ChannelRemappingAudioSource.o \ - $(OBJDIR)/juce_IIRFilterAudioSource.o \ - $(OBJDIR)/juce_MixerAudioSource.o \ - $(OBJDIR)/juce_ResamplingAudioSource.o \ $(OBJDIR)/juce_ToneGeneratorAudioSource.o \ - $(OBJDIR)/juce_AudioDeviceManager.o \ + $(OBJDIR)/juce_MixerAudioSource.o \ + $(OBJDIR)/juce_IIRFilterAudioSource.o \ + $(OBJDIR)/juce_AudioSourcePlayer.o \ $(OBJDIR)/juce_AudioIODevice.o \ $(OBJDIR)/juce_AudioIODeviceType.o \ $(OBJDIR)/juce_MidiOutput.o \ + $(OBJDIR)/juce_AudioDeviceManager.o \ $(OBJDIR)/juce_Sampler.o \ $(OBJDIR)/juce_Synthesiser.o \ - $(OBJDIR)/juce_FileBasedDocument.o \ $(OBJDIR)/juce_RecentlyOpenedFilesList.o \ $(OBJDIR)/juce_UndoManager.o \ - $(OBJDIR)/juce_ActionBroadcaster.o \ - $(OBJDIR)/juce_ActionListenerList.o \ - $(OBJDIR)/juce_AsyncUpdater.o \ + $(OBJDIR)/juce_FileBasedDocument.o \ + $(OBJDIR)/juce_MessageListener.o \ + $(OBJDIR)/juce_MultiTimer.o \ $(OBJDIR)/juce_ChangeBroadcaster.o \ - $(OBJDIR)/juce_ChangeListenerList.o \ $(OBJDIR)/juce_InterprocessConnection.o \ - $(OBJDIR)/juce_InterprocessConnectionServer.o \ + $(OBJDIR)/juce_AsyncUpdater.o \ + $(OBJDIR)/juce_ActionListenerList.o \ + $(OBJDIR)/juce_Timer.o \ $(OBJDIR)/juce_Message.o \ - $(OBJDIR)/juce_MessageListener.o \ + $(OBJDIR)/juce_InterprocessConnectionServer.o \ + $(OBJDIR)/juce_ChangeListenerList.o \ + $(OBJDIR)/juce_ActionBroadcaster.o \ $(OBJDIR)/juce_MessageManager.o \ - $(OBJDIR)/juce_MultiTimer.o \ - $(OBJDIR)/juce_Timer.o \ - $(OBJDIR)/juce_Brush.o \ $(OBJDIR)/juce_GradientBrush.o \ - $(OBJDIR)/juce_ImageBrush.o \ $(OBJDIR)/juce_SolidColourBrush.o \ - $(OBJDIR)/juce_Colour.o \ + $(OBJDIR)/juce_Brush.o \ + $(OBJDIR)/juce_ImageBrush.o \ $(OBJDIR)/juce_ColourGradient.o \ + $(OBJDIR)/juce_Colour.o \ $(OBJDIR)/juce_Colours.o \ - $(OBJDIR)/juce_EdgeTable.o \ - $(OBJDIR)/juce_Graphics.o \ $(OBJDIR)/juce_Justification.o \ + $(OBJDIR)/juce_EdgeTable.o \ $(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o \ - $(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o \ $(OBJDIR)/juce_RectanglePlacement.o \ - $(OBJDIR)/juce_Drawable.o \ + $(OBJDIR)/juce_Graphics.o \ + $(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o \ $(OBJDIR)/juce_DrawableComposite.o \ $(OBJDIR)/juce_DrawableImage.o \ - $(OBJDIR)/juce_DrawablePath.o \ $(OBJDIR)/juce_DrawableText.o \ $(OBJDIR)/juce_SVGParser.o \ - $(OBJDIR)/juce_DropShadowEffect.o \ - $(OBJDIR)/juce_GlowEffect.o \ + $(OBJDIR)/juce_DrawablePath.o \ + $(OBJDIR)/juce_Drawable.o \ $(OBJDIR)/juce_ReduceOpacityEffect.o \ + $(OBJDIR)/juce_GlowEffect.o \ + $(OBJDIR)/juce_DropShadowEffect.o \ + $(OBJDIR)/juce_Typeface.o \ + $(OBJDIR)/juce_TextLayout.o \ $(OBJDIR)/juce_Font.o \ $(OBJDIR)/juce_GlyphArrangement.o \ - $(OBJDIR)/juce_TextLayout.o \ - $(OBJDIR)/juce_Typeface.o \ - $(OBJDIR)/juce_AffineTransform.o \ - $(OBJDIR)/juce_BorderSize.o \ - $(OBJDIR)/juce_Line.o \ - $(OBJDIR)/juce_Path.o \ - $(OBJDIR)/juce_PathIterator.o \ - $(OBJDIR)/juce_PathStrokeType.o \ $(OBJDIR)/juce_Point.o \ + $(OBJDIR)/juce_Path.o \ + $(OBJDIR)/juce_RectangleList.o \ $(OBJDIR)/juce_PositionedRectangle.o \ $(OBJDIR)/juce_Rectangle.o \ - $(OBJDIR)/juce_RectangleList.o \ - $(OBJDIR)/juce_Image.o \ - $(OBJDIR)/juce_ImageCache.o \ + $(OBJDIR)/juce_PathIterator.o \ + $(OBJDIR)/juce_BorderSize.o \ + $(OBJDIR)/juce_AffineTransform.o \ + $(OBJDIR)/juce_PathStrokeType.o \ + $(OBJDIR)/juce_Line.o \ $(OBJDIR)/juce_ImageConvolutionKernel.o \ $(OBJDIR)/juce_ImageFileFormat.o \ + $(OBJDIR)/juce_Image.o \ + $(OBJDIR)/juce_ImageCache.o \ $(OBJDIR)/juce_GIFLoader.o \ - $(OBJDIR)/juce_JPEGLoader.o \ $(OBJDIR)/juce_PNGLoader.o \ + $(OBJDIR)/juce_JPEGLoader.o \ $(OBJDIR)/juce_Component.o \ $(OBJDIR)/juce_ComponentListener.o \ $(OBJDIR)/juce_Desktop.o \ - $(OBJDIR)/juce_ArrowButton.o \ + $(OBJDIR)/juce_ShapeButton.o \ + $(OBJDIR)/juce_ToolbarButton.o \ + $(OBJDIR)/juce_HyperlinkButton.o \ $(OBJDIR)/juce_Button.o \ $(OBJDIR)/juce_DrawableButton.o \ - $(OBJDIR)/juce_HyperlinkButton.o \ + $(OBJDIR)/juce_ToggleButton.o \ $(OBJDIR)/juce_ImageButton.o \ - $(OBJDIR)/juce_ShapeButton.o \ $(OBJDIR)/juce_TextButton.o \ - $(OBJDIR)/juce_ToggleButton.o \ - $(OBJDIR)/juce_ToolbarButton.o \ - $(OBJDIR)/juce_ComboBox.o \ - $(OBJDIR)/juce_Label.o \ - $(OBJDIR)/juce_ListBox.o \ + $(OBJDIR)/juce_ArrowButton.o \ $(OBJDIR)/juce_ProgressBar.o \ - $(OBJDIR)/juce_Slider.o \ - $(OBJDIR)/juce_TableHeaderComponent.o \ + $(OBJDIR)/juce_TreeView.o \ $(OBJDIR)/juce_TableListBox.o \ - $(OBJDIR)/juce_TextEditor.o \ + $(OBJDIR)/juce_ToolbarItemPalette.o \ + $(OBJDIR)/juce_Label.o \ $(OBJDIR)/juce_Toolbar.o \ $(OBJDIR)/juce_ToolbarItemComponent.o \ - $(OBJDIR)/juce_ToolbarItemPalette.o \ - $(OBJDIR)/juce_TreeView.o \ + $(OBJDIR)/juce_ComboBox.o \ + $(OBJDIR)/juce_Slider.o \ + $(OBJDIR)/juce_TableHeaderComponent.o \ + $(OBJDIR)/juce_ListBox.o \ + $(OBJDIR)/juce_TextEditor.o \ $(OBJDIR)/juce_DirectoryContentsDisplayComponent.o \ - $(OBJDIR)/juce_DirectoryContentsList.o \ - $(OBJDIR)/juce_FileBrowserComponent.o \ - $(OBJDIR)/juce_FileChooser.o \ $(OBJDIR)/juce_FileChooserDialogBox.o \ - $(OBJDIR)/juce_FileFilter.o \ $(OBJDIR)/juce_FileListComponent.o \ - $(OBJDIR)/juce_FilenameComponent.o \ + $(OBJDIR)/juce_WildcardFileFilter.o \ $(OBJDIR)/juce_FileSearchPathListComponent.o \ - $(OBJDIR)/juce_FileTreeComponent.o \ + $(OBJDIR)/juce_FileChooser.o \ + $(OBJDIR)/juce_FilenameComponent.o \ + $(OBJDIR)/juce_FileBrowserComponent.o \ $(OBJDIR)/juce_ImagePreviewComponent.o \ - $(OBJDIR)/juce_WildcardFileFilter.o \ - $(OBJDIR)/juce_KeyboardFocusTraverser.o \ + $(OBJDIR)/juce_DirectoryContentsList.o \ + $(OBJDIR)/juce_FileTreeComponent.o \ + $(OBJDIR)/juce_FileFilter.o \ + $(OBJDIR)/juce_ModifierKeys.o \ + $(OBJDIR)/juce_KeyPressMappingSet.o \ $(OBJDIR)/juce_KeyListener.o \ $(OBJDIR)/juce_KeyMappingEditorComponent.o \ + $(OBJDIR)/juce_KeyboardFocusTraverser.o \ $(OBJDIR)/juce_KeyPress.o \ - $(OBJDIR)/juce_KeyPressMappingSet.o \ - $(OBJDIR)/juce_ModifierKeys.o \ - $(OBJDIR)/juce_ComponentAnimator.o \ - $(OBJDIR)/juce_ComponentBoundsConstrainer.o \ - $(OBJDIR)/juce_ComponentMovementWatcher.o \ - $(OBJDIR)/juce_GroupComponent.o \ - $(OBJDIR)/juce_MultiDocumentPanel.o \ - $(OBJDIR)/juce_ResizableBorderComponent.o \ - $(OBJDIR)/juce_ResizableCornerComponent.o \ - $(OBJDIR)/juce_ScrollBar.o \ $(OBJDIR)/juce_StretchableLayoutManager.o \ - $(OBJDIR)/juce_StretchableLayoutResizerBar.o \ $(OBJDIR)/juce_StretchableObjectResizer.o \ + $(OBJDIR)/juce_ComponentAnimator.o \ + $(OBJDIR)/juce_ResizableBorderComponent.o \ $(OBJDIR)/juce_TabbedButtonBar.o \ $(OBJDIR)/juce_TabbedComponent.o \ + $(OBJDIR)/juce_MultiDocumentPanel.o \ + $(OBJDIR)/juce_ResizableCornerComponent.o \ + $(OBJDIR)/juce_GroupComponent.o \ $(OBJDIR)/juce_Viewport.o \ - $(OBJDIR)/juce_LookAndFeel.o \ + $(OBJDIR)/juce_ScrollBar.o \ + $(OBJDIR)/juce_ComponentBoundsConstrainer.o \ + $(OBJDIR)/juce_StretchableLayoutResizerBar.o \ + $(OBJDIR)/juce_ComponentMovementWatcher.o \ $(OBJDIR)/juce_OldSchoolLookAndFeel.o \ + $(OBJDIR)/juce_LookAndFeel.o \ $(OBJDIR)/juce_MenuBarComponent.o \ $(OBJDIR)/juce_MenuBarModel.o \ $(OBJDIR)/juce_PopupMenu.o \ - $(OBJDIR)/juce_ComponentDragger.o \ $(OBJDIR)/juce_DragAndDropContainer.o \ - $(OBJDIR)/juce_MouseCursor.o \ $(OBJDIR)/juce_MouseEvent.o \ - $(OBJDIR)/juce_MouseHoverDetector.o \ + $(OBJDIR)/juce_ComponentDragger.o \ $(OBJDIR)/juce_MouseListener.o \ - $(OBJDIR)/juce_BooleanPropertyComponent.o \ - $(OBJDIR)/juce_ButtonPropertyComponent.o \ + $(OBJDIR)/juce_MouseCursor.o \ + $(OBJDIR)/juce_MouseHoverDetector.o \ + $(OBJDIR)/juce_SliderPropertyComponent.o \ + $(OBJDIR)/juce_TextPropertyComponent.o \ $(OBJDIR)/juce_ChoicePropertyComponent.o \ + $(OBJDIR)/juce_ButtonPropertyComponent.o \ + $(OBJDIR)/juce_BooleanPropertyComponent.o \ $(OBJDIR)/juce_PropertyComponent.o \ $(OBJDIR)/juce_PropertyPanel.o \ - $(OBJDIR)/juce_SliderPropertyComponent.o \ - $(OBJDIR)/juce_TextPropertyComponent.o \ - $(OBJDIR)/juce_AudioDeviceSelectorComponent.o \ + $(OBJDIR)/juce_DropShadower.o \ + $(OBJDIR)/juce_ColourSelector.o \ + $(OBJDIR)/juce_OpenGLComponent.o \ $(OBJDIR)/juce_BubbleComponent.o \ + $(OBJDIR)/juce_SystemTrayIconComponent.o \ + $(OBJDIR)/juce_PreferencesPanel.o \ $(OBJDIR)/juce_BubbleMessageComponent.o \ - $(OBJDIR)/juce_ColourSelector.o \ - $(OBJDIR)/juce_DropShadower.o \ $(OBJDIR)/juce_MagnifierComponent.o \ $(OBJDIR)/juce_MidiKeyboardComponent.o \ - $(OBJDIR)/juce_OpenGLComponent.o \ - $(OBJDIR)/juce_PreferencesPanel.o \ - $(OBJDIR)/juce_QuickTimeMovieComponent.o \ - $(OBJDIR)/juce_SystemTrayIconComponent.o \ + $(OBJDIR)/juce_AudioDeviceSelectorComponent.o \ + $(OBJDIR)/juce_TopLevelWindow.o \ $(OBJDIR)/juce_AlertWindow.o \ - $(OBJDIR)/juce_ComponentPeer.o \ - $(OBJDIR)/juce_DialogWindow.o \ $(OBJDIR)/juce_DocumentWindow.o \ - $(OBJDIR)/juce_ResizableWindow.o \ - $(OBJDIR)/juce_SplashScreen.o \ $(OBJDIR)/juce_ThreadWithProgressWindow.o \ + $(OBJDIR)/juce_DialogWindow.o \ + $(OBJDIR)/juce_SplashScreen.o \ + $(OBJDIR)/juce_ResizableWindow.o \ + $(OBJDIR)/juce_ComponentPeer.o \ $(OBJDIR)/juce_TooltipWindow.o \ - $(OBJDIR)/juce_TopLevelWindow.o \ $(OBJDIR)/juce_linux_Audio.o \ - $(OBJDIR)/juce_linux_AudioCDReader.o \ $(OBJDIR)/juce_linux_FileChooser.o \ $(OBJDIR)/juce_linux_Files.o \ - $(OBJDIR)/juce_linux_Fonts.o \ - $(OBJDIR)/juce_linux_Messaging.o \ $(OBJDIR)/juce_linux_Midi.o \ $(OBJDIR)/juce_linux_NamedPipe.o \ - $(OBJDIR)/juce_linux_Network.o \ $(OBJDIR)/juce_linux_SystemStats.o \ - $(OBJDIR)/juce_linux_Threads.o \ - $(OBJDIR)/juce_linux_WebBrowserComponent.o \ $(OBJDIR)/juce_linux_Windowing.o \ + $(OBJDIR)/juce_linux_WebBrowserComponent.o \ + $(OBJDIR)/juce_linux_Network.o \ + $(OBJDIR)/juce_linux_Fonts.o \ + $(OBJDIR)/juce_linux_Threads.o \ + $(OBJDIR)/juce_linux_AudioCDReader.o \ + $(OBJDIR)/juce_linux_Messaging.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) @@ -342,32 +341,32 @@ else -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif -$(OBJDIR)/juce_FileLogger.o: ../../src/juce_core/basics/juce_FileLogger.cpp +$(OBJDIR)/juce_RelativeTime.o: ../../src/juce_core/basics/juce_RelativeTime.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Logger.o: ../../src/juce_core/basics/juce_Logger.cpp +$(OBJDIR)/juce_FileLogger.o: ../../src/juce_core/basics/juce_FileLogger.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Random.o: ../../src/juce_core/basics/juce_Random.cpp +$(OBJDIR)/juce_Logger.o: ../../src/juce_core/basics/juce_Logger.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_RelativeTime.o: ../../src/juce_core/basics/juce_RelativeTime.cpp +$(OBJDIR)/juce_Random.o: ../../src/juce_core/basics/juce_Random.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SystemStats.o: ../../src/juce_core/basics/juce_SystemStats.cpp +$(OBJDIR)/juce_Time.o: ../../src/juce_core/basics/juce_Time.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Time.o: ../../src/juce_core/basics/juce_Time.cpp +$(OBJDIR)/juce_SystemStats.o: ../../src/juce_core/basics/juce_SystemStats.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -377,7 +376,7 @@ $(OBJDIR)/juce_BlowFish.o: ../../src/juce_core/cryptography/juce_BlowFish.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MD5.o: ../../src/juce_core/cryptography/juce_MD5.cpp +$(OBJDIR)/juce_RSAKey.o: ../../src/juce_core/cryptography/juce_RSAKey.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -387,12 +386,12 @@ $(OBJDIR)/juce_Primes.o: ../../src/juce_core/cryptography/juce_Primes.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_RSAKey.o: ../../src/juce_core/cryptography/juce_RSAKey.cpp +$(OBJDIR)/juce_MD5.o: ../../src/juce_core/cryptography/juce_MD5.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BitArray.o: ../../src/juce_core/containers/juce_BitArray.cpp +$(OBJDIR)/juce_PropertySet.o: ../../src/juce_core/containers/juce_PropertySet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -402,7 +401,7 @@ $(OBJDIR)/juce_MemoryBlock.o: ../../src/juce_core/containers/juce_MemoryBlock.cp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PropertySet.o: ../../src/juce_core/containers/juce_PropertySet.cpp +$(OBJDIR)/juce_BitArray.o: ../../src/juce_core/containers/juce_BitArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -417,22 +416,17 @@ $(OBJDIR)/juce_OutputStream.o: ../../src/juce_core/io/juce_OutputStream.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DirectoryIterator.o: ../../src/juce_core/io/files/juce_DirectoryIterator.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - -$(OBJDIR)/juce_File.o: ../../src/juce_core/io/files/juce_File.cpp +$(OBJDIR)/juce_FileInputStream.o: ../../src/juce_core/io/files/juce_FileInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileInputStream.o: ../../src/juce_core/io/files/juce_FileInputStream.cpp +$(OBJDIR)/juce_FileOutputStream.o: ../../src/juce_core/io/files/juce_FileOutputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileOutputStream.o: ../../src/juce_core/io/files/juce_FileOutputStream.cpp +$(OBJDIR)/juce_DirectoryIterator.o: ../../src/juce_core/io/files/juce_DirectoryIterator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -447,7 +441,7 @@ $(OBJDIR)/juce_NamedPipe.o: ../../src/juce_core/io/files/juce_NamedPipe.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Socket.o: ../../src/juce_core/io/network/juce_Socket.cpp +$(OBJDIR)/juce_File.o: ../../src/juce_core/io/files/juce_File.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -457,47 +451,47 @@ $(OBJDIR)/juce_URL.o: ../../src/juce_core/io/network/juce_URL.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BufferedInputStream.o: ../../src/juce_core/io/streams/juce_BufferedInputStream.cpp +$(OBJDIR)/juce_Socket.o: ../../src/juce_core/io/network/juce_Socket.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileInputSource.o: ../../src/juce_core/io/streams/juce_FileInputSource.cpp +$(OBJDIR)/juce_MemoryInputStream.o: ../../src/juce_core/io/streams/juce_MemoryInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GZIPCompressorOutputStream.o: ../../src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp +$(OBJDIR)/juce_MemoryOutputStream.o: ../../src/juce_core/io/streams/juce_MemoryOutputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GZIPDecompressorInputStream.o: ../../src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp +$(OBJDIR)/juce_SubregionStream.o: ../../src/juce_core/io/streams/juce_SubregionStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MemoryInputStream.o: ../../src/juce_core/io/streams/juce_MemoryInputStream.cpp +$(OBJDIR)/juce_BufferedInputStream.o: ../../src/juce_core/io/streams/juce_BufferedInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MemoryOutputStream.o: ../../src/juce_core/io/streams/juce_MemoryOutputStream.cpp +$(OBJDIR)/juce_FileInputSource.o: ../../src/juce_core/io/streams/juce_FileInputSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SubregionStream.o: ../../src/juce_core/io/streams/juce_SubregionStream.cpp +$(OBJDIR)/juce_GZIPDecompressorInputStream.o: ../../src/juce_core/io/streams/juce_GZIPDecompressorInputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PerformanceCounter.o: ../../src/juce_core/misc/juce_PerformanceCounter.cpp +$(OBJDIR)/juce_GZIPCompressorOutputStream.o: ../../src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Uuid.o: ../../src/juce_core/misc/juce_Uuid.cpp +$(OBJDIR)/juce_PerformanceCounter.o: ../../src/juce_core/misc/juce_PerformanceCounter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -507,17 +501,17 @@ $(OBJDIR)/juce_ZipFile.o: ../../src/juce_core/misc/juce_ZipFile.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_CharacterFunctions.o: ../../src/juce_core/text/juce_CharacterFunctions.cpp +$(OBJDIR)/juce_Uuid.o: ../../src/juce_core/misc/juce_Uuid.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_LocalisedStrings.o: ../../src/juce_core/text/juce_LocalisedStrings.cpp +$(OBJDIR)/juce_StringPairArray.o: ../../src/juce_core/text/juce_StringPairArray.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_String.o: ../../src/juce_core/text/juce_String.cpp +$(OBJDIR)/juce_CharacterFunctions.o: ../../src/juce_core/text/juce_CharacterFunctions.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -527,32 +521,32 @@ $(OBJDIR)/juce_StringArray.o: ../../src/juce_core/text/juce_StringArray.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_StringPairArray.o: ../../src/juce_core/text/juce_StringPairArray.cpp +$(OBJDIR)/juce_String.o: ../../src/juce_core/text/juce_String.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_XmlDocument.o: ../../src/juce_core/text/juce_XmlDocument.cpp +$(OBJDIR)/juce_XmlElement.o: ../../src/juce_core/text/juce_XmlElement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_XmlElement.o: ../../src/juce_core/text/juce_XmlElement.cpp +$(OBJDIR)/juce_LocalisedStrings.o: ../../src/juce_core/text/juce_LocalisedStrings.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_InterProcessLock.o: ../../src/juce_core/threads/juce_InterProcessLock.cpp +$(OBJDIR)/juce_XmlDocument.o: ../../src/juce_core/text/juce_XmlDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ReadWriteLock.o: ../../src/juce_core/threads/juce_ReadWriteLock.cpp +$(OBJDIR)/juce_InterProcessLock.o: ../../src/juce_core/threads/juce_InterProcessLock.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Thread.o: ../../src/juce_core/threads/juce_Thread.cpp +$(OBJDIR)/juce_ReadWriteLock.o: ../../src/juce_core/threads/juce_ReadWriteLock.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -567,17 +561,17 @@ $(OBJDIR)/juce_TimeSliceThread.o: ../../src/juce_core/threads/juce_TimeSliceThre @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Application.o: ../../src/juce_appframework/application/juce_Application.cpp +$(OBJDIR)/juce_Thread.o: ../../src/juce_core/threads/juce_Thread.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ApplicationCommandInfo.o: ../../src/juce_appframework/application/juce_ApplicationCommandInfo.cpp +$(OBJDIR)/juce_ApplicationCommandManager.o: ../../src/juce_appframework/application/juce_ApplicationCommandManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ApplicationCommandManager.o: ../../src/juce_appframework/application/juce_ApplicationCommandManager.cpp +$(OBJDIR)/juce_PropertiesFile.o: ../../src/juce_appframework/application/juce_PropertiesFile.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -587,6 +581,11 @@ $(OBJDIR)/juce_ApplicationCommandTarget.o: ../../src/juce_appframework/applicati @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< +$(OBJDIR)/juce_ApplicationCommandInfo.o: ../../src/juce_appframework/application/juce_ApplicationCommandInfo.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(OBJDIR)/juce_ApplicationProperties.o: ../../src/juce_appframework/application/juce_ApplicationProperties.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -597,17 +596,17 @@ $(OBJDIR)/juce_DeletedAtShutdown.o: ../../src/juce_appframework/application/juce @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PropertiesFile.o: ../../src/juce_appframework/application/juce_PropertiesFile.cpp +$(OBJDIR)/juce_Application.o: ../../src/juce_appframework/application/juce_Application.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioDataConverters.o: ../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.cpp +$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioSampleBuffer.o: ../../src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp +$(OBJDIR)/juce_AudioDataConverters.o: ../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -622,6 +621,11 @@ $(OBJDIR)/juce_MidiBuffer.o: ../../src/juce_appframework/audio/midi/juce_MidiBuf @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< +$(OBJDIR)/juce_MidiMessageSequence.o: ../../src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(OBJDIR)/juce_MidiFile.o: ../../src/juce_appframework/audio/midi/juce_MidiFile.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @@ -642,12 +646,12 @@ $(OBJDIR)/juce_MidiMessageCollector.o: ../../src/juce_appframework/audio/midi/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MidiMessageSequence.o: ../../src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp +$(OBJDIR)/juce_AudioProcessorGraph.o: ../../src/juce_appframework/audio/processors/juce_AudioProcessorGraph.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioProcessor.o: ../../src/juce_appframework/audio/processors/juce_AudioProcessor.cpp +$(OBJDIR)/juce_GenericAudioProcessorEditor.o: ../../src/juce_appframework/audio/processors/juce_GenericAudioProcessorEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -657,17 +661,12 @@ $(OBJDIR)/juce_AudioProcessorEditor.o: ../../src/juce_appframework/audio/process @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioProcessorGraph.o: ../../src/juce_appframework/audio/processors/juce_AudioProcessorGraph.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - $(OBJDIR)/juce_AudioProcessorPlayer.o: ../../src/juce_appframework/audio/processors/juce_AudioProcessorPlayer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GenericAudioProcessorEditor.o: ../../src/juce_appframework/audio/processors/juce_GenericAudioProcessorEditor.cpp +$(OBJDIR)/juce_AudioProcessor.o: ../../src/juce_appframework/audio/processors/juce_AudioProcessor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -677,27 +676,27 @@ $(OBJDIR)/juce_AudioPluginFormat.o: ../../src/juce_appframework/audio/plugins/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioPluginFormatManager.o: ../../src/juce_appframework/audio/plugins/juce_AudioPluginFormatManager.cpp +$(OBJDIR)/juce_PluginDirectoryScanner.o: ../../src/juce_appframework/audio/plugins/juce_PluginDirectoryScanner.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioPluginInstance.o: ../../src/juce_appframework/audio/plugins/juce_AudioPluginInstance.cpp +$(OBJDIR)/juce_PluginDescription.o: ../../src/juce_appframework/audio/plugins/juce_PluginDescription.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_KnownPluginList.o: ../../src/juce_appframework/audio/plugins/juce_KnownPluginList.cpp +$(OBJDIR)/juce_AudioPluginFormatManager.o: ../../src/juce_appframework/audio/plugins/juce_AudioPluginFormatManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PluginDescription.o: ../../src/juce_appframework/audio/plugins/juce_PluginDescription.cpp +$(OBJDIR)/juce_AudioPluginInstance.o: ../../src/juce_appframework/audio/plugins/juce_AudioPluginInstance.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PluginDirectoryScanner.o: ../../src/juce_appframework/audio/plugins/juce_PluginDirectoryScanner.cpp +$(OBJDIR)/juce_KnownPluginList.o: ../../src/juce_appframework/audio/plugins/juce_KnownPluginList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -707,37 +706,37 @@ $(OBJDIR)/juce_PluginListComponent.o: ../../src/juce_appframework/audio/plugins/ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioUnitPluginFormat.o: ../../src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.cpp +$(OBJDIR)/juce_VSTPluginFormat.o: ../../src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_VSTPluginFormat.o: ../../src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp +$(OBJDIR)/juce_AudioUnitPluginFormat.o: ../../src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AiffAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.cpp +$(OBJDIR)/juce_WavAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioCDReader.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp +$(OBJDIR)/juce_AudioThumbnailCache.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioThumbnailCache.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioFormat.cpp +$(OBJDIR)/juce_AudioCDReader.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioFormatManager.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioFormatManager.cpp +$(OBJDIR)/juce_AiffAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioSubsectionReader.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioSubsectionReader.cpp +$(OBJDIR)/juce_AudioFormatManager.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioFormatManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -747,12 +746,12 @@ $(OBJDIR)/juce_AudioThumbnail.o: ../../src/juce_appframework/audio/audio_file_fo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioThumbnailCache.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioThumbnailCache.cpp +$(OBJDIR)/juce_AudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FlacAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp +$(OBJDIR)/juce_AudioSubsectionReader.o: ../../src/juce_appframework/audio/audio_file_formats/juce_AudioSubsectionReader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -762,32 +761,32 @@ $(OBJDIR)/juce_OggVorbisAudioFormat.o: ../../src/juce_appframework/audio/audio_f @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_QuickTimeAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp +$(OBJDIR)/juce_FlacAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_WavAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.cpp +$(OBJDIR)/juce_QuickTimeAudioFormat.o: ../../src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioFormatReaderSource.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioFormatReaderSource.cpp +$(OBJDIR)/juce_AudioTransportSource.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioTransportSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioSourcePlayer.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioSourcePlayer.cpp +$(OBJDIR)/juce_ResamplingAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_ResamplingAudioSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioTransportSource.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioTransportSource.cpp +$(OBJDIR)/juce_BufferingAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_BufferingAudioSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BufferingAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_BufferingAudioSource.cpp +$(OBJDIR)/juce_AudioFormatReaderSource.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioFormatReaderSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -797,7 +796,7 @@ $(OBJDIR)/juce_ChannelRemappingAudioSource.o: ../../src/juce_appframework/audio/ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_IIRFilterAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_IIRFilterAudioSource.cpp +$(OBJDIR)/juce_ToneGeneratorAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_ToneGeneratorAudioSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -807,32 +806,32 @@ $(OBJDIR)/juce_MixerAudioSource.o: ../../src/juce_appframework/audio/audio_sourc @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ResamplingAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_ResamplingAudioSource.cpp +$(OBJDIR)/juce_IIRFilterAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_IIRFilterAudioSource.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ToneGeneratorAudioSource.o: ../../src/juce_appframework/audio/audio_sources/juce_ToneGeneratorAudioSource.cpp +$(OBJDIR)/juce_AudioSourcePlayer.o: ../../src/juce_appframework/audio/audio_sources/juce_AudioSourcePlayer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioDeviceManager.o: ../../src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp +$(OBJDIR)/juce_AudioIODevice.o: ../../src/juce_appframework/audio/devices/juce_AudioIODevice.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioIODevice.o: ../../src/juce_appframework/audio/devices/juce_AudioIODevice.cpp +$(OBJDIR)/juce_AudioIODeviceType.o: ../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioIODeviceType.o: ../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.cpp +$(OBJDIR)/juce_MidiOutput.o: ../../src/juce_appframework/audio/devices/juce_MidiOutput.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MidiOutput.o: ../../src/juce_appframework/audio/devices/juce_MidiOutput.cpp +$(OBJDIR)/juce_AudioDeviceManager.o: ../../src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -847,27 +846,37 @@ $(OBJDIR)/juce_Synthesiser.o: ../../src/juce_appframework/audio/synthesisers/juc @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< +$(OBJDIR)/juce_RecentlyOpenedFilesList.o: ../../src/juce_appframework/documents/juce_RecentlyOpenedFilesList.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o $@ -c $< + +$(OBJDIR)/juce_UndoManager.o: ../../src/juce_appframework/documents/juce_UndoManager.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(OBJDIR)/juce_FileBasedDocument.o: ../../src/juce_appframework/documents/juce_FileBasedDocument.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_RecentlyOpenedFilesList.o: ../../src/juce_appframework/documents/juce_RecentlyOpenedFilesList.cpp +$(OBJDIR)/juce_MessageListener.o: ../../src/juce_appframework/events/juce_MessageListener.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_UndoManager.o: ../../src/juce_appframework/documents/juce_UndoManager.cpp +$(OBJDIR)/juce_MultiTimer.o: ../../src/juce_appframework/events/juce_MultiTimer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ActionBroadcaster.o: ../../src/juce_appframework/events/juce_ActionBroadcaster.cpp +$(OBJDIR)/juce_ChangeBroadcaster.o: ../../src/juce_appframework/events/juce_ChangeBroadcaster.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ActionListenerList.o: ../../src/juce_appframework/events/juce_ActionListenerList.cpp +$(OBJDIR)/juce_InterprocessConnection.o: ../../src/juce_appframework/events/juce_InterprocessConnection.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -877,17 +886,17 @@ $(OBJDIR)/juce_AsyncUpdater.o: ../../src/juce_appframework/events/juce_AsyncUpda @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ChangeBroadcaster.o: ../../src/juce_appframework/events/juce_ChangeBroadcaster.cpp +$(OBJDIR)/juce_ActionListenerList.o: ../../src/juce_appframework/events/juce_ActionListenerList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ChangeListenerList.o: ../../src/juce_appframework/events/juce_ChangeListenerList.cpp +$(OBJDIR)/juce_Timer.o: ../../src/juce_appframework/events/juce_Timer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_InterprocessConnection.o: ../../src/juce_appframework/events/juce_InterprocessConnection.cpp +$(OBJDIR)/juce_Message.o: ../../src/juce_appframework/events/juce_Message.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -897,12 +906,12 @@ $(OBJDIR)/juce_InterprocessConnectionServer.o: ../../src/juce_appframework/event @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Message.o: ../../src/juce_appframework/events/juce_Message.cpp +$(OBJDIR)/juce_ChangeListenerList.o: ../../src/juce_appframework/events/juce_ChangeListenerList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MessageListener.o: ../../src/juce_appframework/events/juce_MessageListener.cpp +$(OBJDIR)/juce_ActionBroadcaster.o: ../../src/juce_appframework/events/juce_ActionBroadcaster.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -912,12 +921,12 @@ $(OBJDIR)/juce_MessageManager.o: ../../src/juce_appframework/events/juce_Message @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MultiTimer.o: ../../src/juce_appframework/events/juce_MultiTimer.cpp +$(OBJDIR)/juce_GradientBrush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Timer.o: ../../src/juce_appframework/events/juce_Timer.cpp +$(OBJDIR)/juce_SolidColourBrush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -927,17 +936,12 @@ $(OBJDIR)/juce_Brush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_Br @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GradientBrush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_GradientBrush.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - $(OBJDIR)/juce_ImageBrush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_ImageBrush.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SolidColourBrush.o: ../../src/juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.cpp +$(OBJDIR)/juce_ColourGradient.o: ../../src/juce_appframework/gui/graphics/colour/juce_ColourGradient.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -947,12 +951,12 @@ $(OBJDIR)/juce_Colour.o: ../../src/juce_appframework/gui/graphics/colour/juce_Co @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ColourGradient.o: ../../src/juce_appframework/gui/graphics/colour/juce_ColourGradient.cpp +$(OBJDIR)/juce_Colours.o: ../../src/juce_appframework/gui/graphics/colour/juce_Colours.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Colours.o: ../../src/juce_appframework/gui/graphics/colour/juce_Colours.cpp +$(OBJDIR)/juce_Justification.o: ../../src/juce_appframework/gui/graphics/contexts/juce_Justification.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -962,17 +966,17 @@ $(OBJDIR)/juce_EdgeTable.o: ../../src/juce_appframework/gui/graphics/contexts/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Graphics.o: ../../src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp +$(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o: ../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Justification.o: ../../src/juce_appframework/gui/graphics/contexts/juce_Justification.cpp +$(OBJDIR)/juce_RectanglePlacement.o: ../../src/juce_appframework/gui/graphics/contexts/juce_RectanglePlacement.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_LowLevelGraphicsPostScriptRenderer.o: ../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +$(OBJDIR)/juce_Graphics.o: ../../src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -982,22 +986,22 @@ $(OBJDIR)/juce_LowLevelGraphicsSoftwareRenderer.o: ../../src/juce_appframework/g @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_RectanglePlacement.o: ../../src/juce_appframework/gui/graphics/contexts/juce_RectanglePlacement.cpp +$(OBJDIR)/juce_DrawableComposite.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableComposite.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Drawable.o: ../../src/juce_appframework/gui/graphics/drawables/juce_Drawable.cpp +$(OBJDIR)/juce_DrawableImage.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableImage.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DrawableComposite.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableComposite.cpp +$(OBJDIR)/juce_DrawableText.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableText.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DrawableImage.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableImage.cpp +$(OBJDIR)/juce_SVGParser.o: ../../src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1007,12 +1011,17 @@ $(OBJDIR)/juce_DrawablePath.o: ../../src/juce_appframework/gui/graphics/drawable @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DrawableText.o: ../../src/juce_appframework/gui/graphics/drawables/juce_DrawableText.cpp +$(OBJDIR)/juce_Drawable.o: ../../src/juce_appframework/gui/graphics/drawables/juce_Drawable.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SVGParser.o: ../../src/juce_appframework/gui/graphics/drawables/juce_SVGParser.cpp +$(OBJDIR)/juce_ReduceOpacityEffect.o: ../../src/juce_appframework/gui/graphics/effects/juce_ReduceOpacityEffect.cpp + -@$(CMD_MKOBJDIR) + @echo $(notdir $<) + @$(CXX) $(CXXFLAGS) -o $@ -c $< + +$(OBJDIR)/juce_GlowEffect.o: ../../src/juce_appframework/gui/graphics/effects/juce_GlowEffect.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1022,12 +1031,12 @@ $(OBJDIR)/juce_DropShadowEffect.o: ../../src/juce_appframework/gui/graphics/effe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GlowEffect.o: ../../src/juce_appframework/gui/graphics/effects/juce_GlowEffect.cpp +$(OBJDIR)/juce_Typeface.o: ../../src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ReduceOpacityEffect.o: ../../src/juce_appframework/gui/graphics/effects/juce_ReduceOpacityEffect.cpp +$(OBJDIR)/juce_TextLayout.o: ../../src/juce_appframework/gui/graphics/fonts/juce_TextLayout.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1042,62 +1051,62 @@ $(OBJDIR)/juce_GlyphArrangement.o: ../../src/juce_appframework/gui/graphics/font @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TextLayout.o: ../../src/juce_appframework/gui/graphics/fonts/juce_TextLayout.cpp +$(OBJDIR)/juce_Point.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Point.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Typeface.o: ../../src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp +$(OBJDIR)/juce_Path.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Path.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AffineTransform.o: ../../src/juce_appframework/gui/graphics/geometry/juce_AffineTransform.cpp +$(OBJDIR)/juce_RectangleList.o: ../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BorderSize.o: ../../src/juce_appframework/gui/graphics/geometry/juce_BorderSize.cpp +$(OBJDIR)/juce_PositionedRectangle.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PositionedRectangle.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Line.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Line.cpp +$(OBJDIR)/juce_Rectangle.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Rectangle.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Path.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Path.cpp +$(OBJDIR)/juce_PathIterator.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PathIterator.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp +$(OBJDIR)/juce_BorderSize.o: ../../src/juce_appframework/gui/graphics/geometry/juce_BorderSize.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PathStrokeType.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PathStrokeType.cpp +$(OBJDIR)/juce_AffineTransform.o: ../../src/juce_appframework/gui/graphics/geometry/juce_AffineTransform.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Point.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Point.cpp +$(OBJDIR)/juce_PathStrokeType.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PathStrokeType.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PositionedRectangle.o: ../../src/juce_appframework/gui/graphics/geometry/juce_PositionedRectangle.cpp +$(OBJDIR)/juce_Line.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Line.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Rectangle.o: ../../src/juce_appframework/gui/graphics/geometry/juce_Rectangle.cpp +$(OBJDIR)/juce_ImageConvolutionKernel.o: ../../src/juce_appframework/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_RectangleList.o: ../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.cpp +$(OBJDIR)/juce_ImageFileFormat.o: ../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1112,47 +1121,47 @@ $(OBJDIR)/juce_ImageCache.o: ../../src/juce_appframework/gui/graphics/imaging/ju @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ImageConvolutionKernel.o: ../../src/juce_appframework/gui/graphics/imaging/juce_ImageConvolutionKernel.cpp +$(OBJDIR)/juce_GIFLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ImageFileFormat.o: ../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.cpp +$(OBJDIR)/juce_PNGLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GIFLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_GIFLoader.cpp +$(OBJDIR)/juce_JPEGLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_JPEGLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp +$(OBJDIR)/juce_Component.o: ../../src/juce_appframework/gui/components/juce_Component.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PNGLoader.o: ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp +$(OBJDIR)/juce_ComponentListener.o: ../../src/juce_appframework/gui/components/juce_ComponentListener.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Component.o: ../../src/juce_appframework/gui/components/juce_Component.cpp +$(OBJDIR)/juce_Desktop.o: ../../src/juce_appframework/gui/components/juce_Desktop.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ComponentListener.o: ../../src/juce_appframework/gui/components/juce_ComponentListener.cpp +$(OBJDIR)/juce_ShapeButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ShapeButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Desktop.o: ../../src/juce_appframework/gui/components/juce_Desktop.cpp +$(OBJDIR)/juce_ToolbarButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ToolbarButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ArrowButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ArrowButton.cpp +$(OBJDIR)/juce_HyperlinkButton.o: ../../src/juce_appframework/gui/components/buttons/juce_HyperlinkButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1167,7 +1176,7 @@ $(OBJDIR)/juce_DrawableButton.o: ../../src/juce_appframework/gui/components/butt @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_HyperlinkButton.o: ../../src/juce_appframework/gui/components/buttons/juce_HyperlinkButton.cpp +$(OBJDIR)/juce_ToggleButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ToggleButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1177,97 +1186,97 @@ $(OBJDIR)/juce_ImageButton.o: ../../src/juce_appframework/gui/components/buttons @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ShapeButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ShapeButton.cpp +$(OBJDIR)/juce_TextButton.o: ../../src/juce_appframework/gui/components/buttons/juce_TextButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TextButton.o: ../../src/juce_appframework/gui/components/buttons/juce_TextButton.cpp +$(OBJDIR)/juce_ArrowButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ArrowButton.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ToggleButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ToggleButton.cpp +$(OBJDIR)/juce_ProgressBar.o: ../../src/juce_appframework/gui/components/controls/juce_ProgressBar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ToolbarButton.o: ../../src/juce_appframework/gui/components/buttons/juce_ToolbarButton.cpp +$(OBJDIR)/juce_TreeView.o: ../../src/juce_appframework/gui/components/controls/juce_TreeView.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ComboBox.o: ../../src/juce_appframework/gui/components/controls/juce_ComboBox.cpp +$(OBJDIR)/juce_TableListBox.o: ../../src/juce_appframework/gui/components/controls/juce_TableListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Label.o: ../../src/juce_appframework/gui/components/controls/juce_Label.cpp +$(OBJDIR)/juce_ToolbarItemPalette.o: ../../src/juce_appframework/gui/components/controls/juce_ToolbarItemPalette.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ListBox.o: ../../src/juce_appframework/gui/components/controls/juce_ListBox.cpp +$(OBJDIR)/juce_Label.o: ../../src/juce_appframework/gui/components/controls/juce_Label.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ProgressBar.o: ../../src/juce_appframework/gui/components/controls/juce_ProgressBar.cpp +$(OBJDIR)/juce_Toolbar.o: ../../src/juce_appframework/gui/components/controls/juce_Toolbar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Slider.o: ../../src/juce_appframework/gui/components/controls/juce_Slider.cpp +$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/juce_appframework/gui/components/controls/juce_ToolbarItemComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.cpp +$(OBJDIR)/juce_ComboBox.o: ../../src/juce_appframework/gui/components/controls/juce_ComboBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TableListBox.o: ../../src/juce_appframework/gui/components/controls/juce_TableListBox.cpp +$(OBJDIR)/juce_Slider.o: ../../src/juce_appframework/gui/components/controls/juce_Slider.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TextEditor.o: ../../src/juce_appframework/gui/components/controls/juce_TextEditor.cpp +$(OBJDIR)/juce_TableHeaderComponent.o: ../../src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Toolbar.o: ../../src/juce_appframework/gui/components/controls/juce_Toolbar.cpp +$(OBJDIR)/juce_ListBox.o: ../../src/juce_appframework/gui/components/controls/juce_ListBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ToolbarItemComponent.o: ../../src/juce_appframework/gui/components/controls/juce_ToolbarItemComponent.cpp +$(OBJDIR)/juce_TextEditor.o: ../../src/juce_appframework/gui/components/controls/juce_TextEditor.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ToolbarItemPalette.o: ../../src/juce_appframework/gui/components/controls/juce_ToolbarItemPalette.cpp +$(OBJDIR)/juce_DirectoryContentsDisplayComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TreeView.o: ../../src/juce_appframework/gui/components/controls/juce_TreeView.cpp +$(OBJDIR)/juce_FileChooserDialogBox.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileChooserDialogBox.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DirectoryContentsDisplayComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsDisplayComponent.cpp +$(OBJDIR)/juce_FileListComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileListComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DirectoryContentsList.o: ../../src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsList.cpp +$(OBJDIR)/juce_WildcardFileFilter.o: ../../src/juce_appframework/gui/components/filebrowser/juce_WildcardFileFilter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileBrowserComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp +$(OBJDIR)/juce_FileSearchPathListComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1277,57 +1286,57 @@ $(OBJDIR)/juce_FileChooser.o: ../../src/juce_appframework/gui/components/filebro @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileChooserDialogBox.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileChooserDialogBox.cpp +$(OBJDIR)/juce_FilenameComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FilenameComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileFilter.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileFilter.cpp +$(OBJDIR)/juce_FileBrowserComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileListComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileListComponent.cpp +$(OBJDIR)/juce_ImagePreviewComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FilenameComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FilenameComponent.cpp +$(OBJDIR)/juce_DirectoryContentsList.o: ../../src/juce_appframework/gui/components/filebrowser/juce_DirectoryContentsList.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileSearchPathListComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp +$(OBJDIR)/juce_FileTreeComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_FileTreeComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileTreeComponent.cpp +$(OBJDIR)/juce_FileFilter.o: ../../src/juce_appframework/gui/components/filebrowser/juce_FileFilter.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ImagePreviewComponent.o: ../../src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp +$(OBJDIR)/juce_ModifierKeys.o: ../../src/juce_appframework/gui/components/keyboard/juce_ModifierKeys.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_WildcardFileFilter.o: ../../src/juce_appframework/gui/components/filebrowser/juce_WildcardFileFilter.cpp +$(OBJDIR)/juce_KeyPressMappingSet.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyPressMappingSet.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_KeyboardFocusTraverser.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp +$(OBJDIR)/juce_KeyListener.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyListener.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_KeyListener.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyListener.cpp +$(OBJDIR)/juce_KeyMappingEditorComponent.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_KeyMappingEditorComponent.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp +$(OBJDIR)/juce_KeyboardFocusTraverser.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1337,12 +1346,12 @@ $(OBJDIR)/juce_KeyPress.o: ../../src/juce_appframework/gui/components/keyboard/j @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_KeyPressMappingSet.o: ../../src/juce_appframework/gui/components/keyboard/juce_KeyPressMappingSet.cpp +$(OBJDIR)/juce_StretchableLayoutManager.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ModifierKeys.o: ../../src/juce_appframework/gui/components/keyboard/juce_ModifierKeys.cpp +$(OBJDIR)/juce_StretchableObjectResizer.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableObjectResizer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1352,17 +1361,17 @@ $(OBJDIR)/juce_ComponentAnimator.o: ../../src/juce_appframework/gui/components/l @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/juce_appframework/gui/components/layout/juce_ComponentBoundsConstrainer.cpp +$(OBJDIR)/juce_ResizableBorderComponent.o: ../../src/juce_appframework/gui/components/layout/juce_ResizableBorderComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ComponentMovementWatcher.o: ../../src/juce_appframework/gui/components/layout/juce_ComponentMovementWatcher.cpp +$(OBJDIR)/juce_TabbedButtonBar.o: ../../src/juce_appframework/gui/components/layout/juce_TabbedButtonBar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_GroupComponent.o: ../../src/juce_appframework/gui/components/layout/juce_GroupComponent.cpp +$(OBJDIR)/juce_TabbedComponent.o: ../../src/juce_appframework/gui/components/layout/juce_TabbedComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1372,72 +1381,72 @@ $(OBJDIR)/juce_MultiDocumentPanel.o: ../../src/juce_appframework/gui/components/ @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ResizableBorderComponent.o: ../../src/juce_appframework/gui/components/layout/juce_ResizableBorderComponent.cpp +$(OBJDIR)/juce_ResizableCornerComponent.o: ../../src/juce_appframework/gui/components/layout/juce_ResizableCornerComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ResizableCornerComponent.o: ../../src/juce_appframework/gui/components/layout/juce_ResizableCornerComponent.cpp +$(OBJDIR)/juce_GroupComponent.o: ../../src/juce_appframework/gui/components/layout/juce_GroupComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ScrollBar.o: ../../src/juce_appframework/gui/components/layout/juce_ScrollBar.cpp +$(OBJDIR)/juce_Viewport.o: ../../src/juce_appframework/gui/components/layout/juce_Viewport.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_StretchableLayoutManager.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableLayoutManager.cpp +$(OBJDIR)/juce_ScrollBar.o: ../../src/juce_appframework/gui/components/layout/juce_ScrollBar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_StretchableLayoutResizerBar.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableLayoutResizerBar.cpp +$(OBJDIR)/juce_ComponentBoundsConstrainer.o: ../../src/juce_appframework/gui/components/layout/juce_ComponentBoundsConstrainer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_StretchableObjectResizer.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableObjectResizer.cpp +$(OBJDIR)/juce_StretchableLayoutResizerBar.o: ../../src/juce_appframework/gui/components/layout/juce_StretchableLayoutResizerBar.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TabbedButtonBar.o: ../../src/juce_appframework/gui/components/layout/juce_TabbedButtonBar.cpp +$(OBJDIR)/juce_ComponentMovementWatcher.o: ../../src/juce_appframework/gui/components/layout/juce_ComponentMovementWatcher.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TabbedComponent.o: ../../src/juce_appframework/gui/components/layout/juce_TabbedComponent.cpp +$(OBJDIR)/juce_OldSchoolLookAndFeel.o: ../../src/juce_appframework/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_Viewport.o: ../../src/juce_appframework/gui/components/layout/juce_Viewport.cpp +$(OBJDIR)/juce_LookAndFeel.o: ../../src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_LookAndFeel.o: ../../src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +$(OBJDIR)/juce_MenuBarComponent.o: ../../src/juce_appframework/gui/components/menus/juce_MenuBarComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_OldSchoolLookAndFeel.o: ../../src/juce_appframework/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp +$(OBJDIR)/juce_MenuBarModel.o: ../../src/juce_appframework/gui/components/menus/juce_MenuBarModel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MenuBarComponent.o: ../../src/juce_appframework/gui/components/menus/juce_MenuBarComponent.cpp +$(OBJDIR)/juce_PopupMenu.o: ../../src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MenuBarModel.o: ../../src/juce_appframework/gui/components/menus/juce_MenuBarModel.cpp +$(OBJDIR)/juce_DragAndDropContainer.o: ../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_PopupMenu.o: ../../src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp +$(OBJDIR)/juce_MouseEvent.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseEvent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1447,7 +1456,7 @@ $(OBJDIR)/juce_ComponentDragger.o: ../../src/juce_appframework/gui/components/mo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DragAndDropContainer.o: ../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.cpp +$(OBJDIR)/juce_MouseListener.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseListener.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1457,22 +1466,22 @@ $(OBJDIR)/juce_MouseCursor.o: ../../src/juce_appframework/gui/components/mouse/j @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MouseEvent.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseEvent.cpp +$(OBJDIR)/juce_MouseHoverDetector.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseHoverDetector.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MouseHoverDetector.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseHoverDetector.cpp +$(OBJDIR)/juce_SliderPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_SliderPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_MouseListener.o: ../../src/juce_appframework/gui/components/mouse/juce_MouseListener.cpp +$(OBJDIR)/juce_TextPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_TextPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BooleanPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_BooleanPropertyComponent.cpp +$(OBJDIR)/juce_ChoicePropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_ChoicePropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1482,7 +1491,7 @@ $(OBJDIR)/juce_ButtonPropertyComponent.o: ../../src/juce_appframework/gui/compon @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ChoicePropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_ChoicePropertyComponent.cpp +$(OBJDIR)/juce_BooleanPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_BooleanPropertyComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1497,17 +1506,17 @@ $(OBJDIR)/juce_PropertyPanel.o: ../../src/juce_appframework/gui/components/prope @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SliderPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_SliderPropertyComponent.cpp +$(OBJDIR)/juce_DropShadower.o: ../../src/juce_appframework/gui/components/special/juce_DropShadower.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TextPropertyComponent.o: ../../src/juce_appframework/gui/components/properties/juce_TextPropertyComponent.cpp +$(OBJDIR)/juce_ColourSelector.o: ../../src/juce_appframework/gui/components/special/juce_ColourSelector.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AudioDeviceSelectorComponent.o: ../../src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +$(OBJDIR)/juce_OpenGLComponent.o: ../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1517,17 +1526,17 @@ $(OBJDIR)/juce_BubbleComponent.o: ../../src/juce_appframework/gui/components/spe @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_BubbleMessageComponent.o: ../../src/juce_appframework/gui/components/special/juce_BubbleMessageComponent.cpp +$(OBJDIR)/juce_SystemTrayIconComponent.o: ../../src/juce_appframework/gui/components/special/juce_SystemTrayIconComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ColourSelector.o: ../../src/juce_appframework/gui/components/special/juce_ColourSelector.cpp +$(OBJDIR)/juce_PreferencesPanel.o: ../../src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DropShadower.o: ../../src/juce_appframework/gui/components/special/juce_DropShadower.cpp +$(OBJDIR)/juce_BubbleMessageComponent.o: ../../src/juce_appframework/gui/components/special/juce_BubbleMessageComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1542,32 +1551,27 @@ $(OBJDIR)/juce_MidiKeyboardComponent.o: ../../src/juce_appframework/gui/componen @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_OpenGLComponent.o: ../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - -$(OBJDIR)/juce_PreferencesPanel.o: ../../src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp +$(OBJDIR)/juce_AudioDeviceSelectorComponent.o: ../../src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_QuickTimeMovieComponent.o: ../../src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp +$(OBJDIR)/juce_TopLevelWindow.o: ../../src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SystemTrayIconComponent.o: ../../src/juce_appframework/gui/components/special/juce_SystemTrayIconComponent.cpp +$(OBJDIR)/juce_AlertWindow.o: ../../src/juce_appframework/gui/components/windows/juce_AlertWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_AlertWindow.o: ../../src/juce_appframework/gui/components/windows/juce_AlertWindow.cpp +$(OBJDIR)/juce_DocumentWindow.o: ../../src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_ComponentPeer.o: ../../src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp +$(OBJDIR)/juce_ThreadWithProgressWindow.o: ../../src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1577,7 +1581,7 @@ $(OBJDIR)/juce_DialogWindow.o: ../../src/juce_appframework/gui/components/window @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_DocumentWindow.o: ../../src/juce_appframework/gui/components/windows/juce_DocumentWindow.cpp +$(OBJDIR)/juce_SplashScreen.o: ../../src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1587,12 +1591,7 @@ $(OBJDIR)/juce_ResizableWindow.o: ../../src/juce_appframework/gui/components/win @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_SplashScreen.o: ../../src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - -$(OBJDIR)/juce_ThreadWithProgressWindow.o: ../../src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp +$(OBJDIR)/juce_ComponentPeer.o: ../../src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1602,47 +1601,42 @@ $(OBJDIR)/juce_TooltipWindow.o: ../../src/juce_appframework/gui/components/windo @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_TopLevelWindow.o: ../../src/juce_appframework/gui/components/windows/juce_TopLevelWindow.cpp - -@$(CMD_MKOBJDIR) - @echo $(notdir $<) - @$(CXX) $(CXXFLAGS) -o $@ -c $< - $(OBJDIR)/juce_linux_Audio.o: platform_specific_code/juce_linux_Audio.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_AudioCDReader.o: platform_specific_code/juce_linux_AudioCDReader.cpp +$(OBJDIR)/juce_linux_FileChooser.o: platform_specific_code/juce_linux_FileChooser.cpp -@$(CMD_MKOBJDIR) @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_Files.o: platform_specific_code/juce_linux_Files.cpp +$(OBJDIR)/juce_linux_Midi.o: platform_specific_code/juce_linux_Midi.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_Fonts.o: platform_specific_code/juce_linux_Fonts.cpp +$(OBJDIR)/juce_linux_NamedPipe.o: platform_specific_code/juce_linux_NamedPipe.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_Messaging.o: platform_specific_code/juce_linux_Messaging.cpp +$(OBJDIR)/juce_linux_SystemStats.o: platform_specific_code/juce_linux_SystemStats.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_Midi.o: platform_specific_code/juce_linux_Midi.cpp +$(OBJDIR)/juce_linux_Windowing.o: platform_specific_code/juce_linux_Windowing.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_NamedPipe.o: platform_specific_code/juce_linux_NamedPipe.cpp +$(OBJDIR)/juce_linux_WebBrowserComponent.o: platform_specific_code/juce_linux_WebBrowserComponent.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1652,7 +1646,7 @@ $(OBJDIR)/juce_linux_Network.o: platform_specific_code/juce_linux_Network.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/juce_linux_SystemStats.o: platform_specific_code/juce_linux_SystemStats.cpp +$(OBJDIR)/juce_linux_Fonts.o: platform_specific_code/juce_linux_Fonts.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -1662,12 +1656,12 @@ $(OBJDIR)/juce_linux_Threads.o: platform_specific_code/juce_linux_Threads.cpp @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_Windowing.o: platform_specific_code/juce_linux_Windowing.cpp +$(OBJDIR)/juce_linux_Messaging.o: platform_specific_code/juce_linux_Messaging.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 3a592f7d0d..3414176133 100644 --- a/build/linux/platform_specific_code/juce_linux_Audio.cpp +++ b/build/linux/platform_specific_code/juce_linux_Audio.cpp @@ -367,7 +367,7 @@ private: class ALSAThread : public Thread { public: - ALSAThread (const String& inputId_, + ALSAThread (const String& inputId_, const String& outputId_) : Thread ("Juce ALSA"), sampleRate (0), @@ -446,7 +446,7 @@ public: return; } - if (! outputDevice->setParameters ((unsigned int) sampleRate, + if (! outputDevice->setParameters ((unsigned int) sampleRate, currentOutputChans.getHighestBit() + 1, bufferSize)) { @@ -467,7 +467,7 @@ public: return; } - if (! inputDevice->setParameters ((unsigned int) sampleRate, + if (! inputDevice->setParameters ((unsigned int) sampleRate, currentInputChans.getHighestBit() + 1, bufferSize)) { @@ -673,7 +673,7 @@ class ALSAAudioIODevice : public AudioIODevice { public: ALSAAudioIODevice (const String& deviceName, - const String& inputId_, + const String& inputId_, const String& outputId_) : AudioIODevice (deviceName, T("ALSA")), inputId (inputId_), @@ -980,8 +980,8 @@ public: deviceName = inputDeviceName; if (index >= 0) - return new ALSAAudioIODevice (deviceName, - inputIds [inputIndex], + return new ALSAAudioIODevice (deviceName, + inputIds [inputIndex], outputIds [outputIndex]); return 0; diff --git a/build/linux/platform_specific_code/juce_linux_Messaging.cpp b/build/linux/platform_specific_code/juce_linux_Messaging.cpp index 1215def31f..87a848e5c2 100644 --- a/build/linux/platform_specific_code/juce_linux_Messaging.cpp +++ b/build/linux/platform_specific_code/juce_linux_Messaging.cpp @@ -157,7 +157,7 @@ static void sig_handler (int sig) void MessageManager::doPlatformSpecificInitialisation() { // Initialise xlib for multiple thread support - static bool initThreadCalled = false; + static bool initThreadCalled = false; if (! initThreadCalled) { @@ -168,10 +168,10 @@ void MessageManager::doPlatformSpecificInitialisation() if (juce_isRunningAsApplication()) Process::terminate(); - + return; } - + initThreadCalled = true; } @@ -212,7 +212,7 @@ void MessageManager::doPlatformSpecificInitialisation() if (juce_isRunningAsApplication()) Process::terminate(); - + return; } @@ -247,11 +247,11 @@ void MessageManager::doPlatformSpecificShutdown() { XDestroyWindow (display, juce_messageWindowHandle); XCloseDisplay (display); - + // reset pointers juce_messageWindowHandle = 0; display = 0; - + // Restore original error handlers XSetIOErrorHandler (oldIOErrorHandler); oldIOErrorHandler = 0; @@ -350,7 +350,7 @@ bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) if (juce_isRunningAsApplication()) Process::terminate(); - + return false; } diff --git a/build/linux/platform_specific_code/juce_linux_Network.cpp b/build/linux/platform_specific_code/juce_linux_Network.cpp index 1b1df98a7d..1fa968902b 100644 --- a/build/linux/platform_specific_code/juce_linux_Network.cpp +++ b/build/linux/platform_specific_code/juce_linux_Network.cpp @@ -49,9 +49,6 @@ BEGIN_JUCE_NAMESPACE #include "../../../src/juce_core/misc/juce_PlatformUtilities.h" #include "../../../src/juce_core/io/network/juce_URL.h" -// we'll borrow the mac's socket-based http streaming code.. -#include "../../macosx/platform_specific_code/juce_mac_HTTPStream.h" - //============================================================================== int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() @@ -103,5 +100,392 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd return false; } +//============================================================================== +/** A HTTP input stream that uses sockets. + */ +class JUCE_HTTPSocketStream + { + public: + //============================================================================== + JUCE_HTTPSocketStream() + : readPosition (0), + socketHandle (-1), + levelsOfRedirection (0), + timeoutSeconds (15) + { + } + + ~JUCE_HTTPSocketStream() + { + closeSocket(); + } + + //============================================================================== + bool open (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) + { + closeSocket(); + + uint32 timeOutTime = Time::getMillisecondCounter(); + + if (timeOutMs == 0) + timeOutTime += 60000; + else if (timeOutMs < 0) + timeOutTime = 0xffffffff; + else + timeOutTime += timeOutMs; + + String hostName, hostPath; + int hostPort; + + if (! decomposeURL (url, hostName, hostPath, hostPort)) + return false; + + const struct hostent* host = 0; + int port = 0; + + String proxyName, proxyPath; + int proxyPort = 0; + + String proxyURL (getenv ("http_proxy")); + if (proxyURL.startsWithIgnoreCase (T("http://"))) + { + if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort)) + return false; + + host = gethostbyname ((const char*) proxyName.toUTF8()); + port = proxyPort; + } + else + { + host = gethostbyname ((const char*) hostName.toUTF8()); + port = hostPort; + } + + if (host == 0) + return false; + + struct sockaddr_in address; + zerostruct (address); + memcpy ((void*) &address.sin_addr, (const void*) host->h_addr, host->h_length); + address.sin_family = host->h_addrtype; + address.sin_port = htons (port); + + socketHandle = socket (host->h_addrtype, SOCK_STREAM, 0); + + if (socketHandle == -1) + return false; + + int receiveBufferSize = 16384; + setsockopt (socketHandle, SOL_SOCKET, SO_RCVBUF, (char*) &receiveBufferSize, sizeof (receiveBufferSize)); + setsockopt (socketHandle, SOL_SOCKET, SO_KEEPALIVE, 0, 0); + +#if JUCE_MAC + setsockopt (socketHandle, SOL_SOCKET, SO_NOSIGPIPE, 0, 0); +#endif + + if (connect (socketHandle, (struct sockaddr*) &address, sizeof (address)) == -1) + { + closeSocket(); + return false; + } + + const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, + proxyName, proxyPort, + hostPath, url, + headers, postData, + isPost)); + int totalHeaderSent = 0; + + while (totalHeaderSent < requestHeader.getSize()) + { + if (Time::getMillisecondCounter() > timeOutTime) + { + closeSocket(); + return false; + } + + const int numToSend = jmin (1024, requestHeader.getSize() - totalHeaderSent); + + if (send (socketHandle, + ((const char*) requestHeader.getData()) + totalHeaderSent, + numToSend, 0) + != numToSend) + { + closeSocket(); + return false; + } + + totalHeaderSent += numToSend; + + if (callback != 0 && ! callback (callbackContext, totalHeaderSent, requestHeader.getSize())) + { + closeSocket(); + return false; + } + } + + const String responseHeader (readResponse (timeOutTime)); + + if (responseHeader.isNotEmpty()) + { + //DBG (responseHeader); + + StringArray lines; + lines.addLines (responseHeader); + + // NB - using charToString() here instead of just T(" "), because that was + // causing a mysterious gcc internal compiler error... + const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) + .substring (0, 3) + .getIntValue(); + + //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); + //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); + + String location (findHeaderItem (lines, T("Location:"))); + + if (statusCode >= 300 && statusCode < 400 + && location.isNotEmpty()) + { + if (! location.startsWithIgnoreCase (T("http://"))) + location = T("http://") + location; + + if (levelsOfRedirection++ < 3) + return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); + } + else + { + levelsOfRedirection = 0; + return true; + } + } + + closeSocket(); + return false; + } + + //============================================================================== + int read (void* buffer, int bytesToRead) + { + fd_set readbits; + FD_ZERO (&readbits); + FD_SET (socketHandle, &readbits); + + struct timeval tv; + tv.tv_sec = timeoutSeconds; + tv.tv_usec = 0; + + if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) + return 0; // (timeout) + + const int bytesRead = jmax (0, recv (socketHandle, buffer, bytesToRead, MSG_WAITALL)); + readPosition += bytesRead; + return bytesRead; + } + + //============================================================================== + int readPosition; + + //============================================================================== + juce_UseDebuggingNewOperator + + private: + int socketHandle, levelsOfRedirection; + const int timeoutSeconds; + + //============================================================================== + void closeSocket() + { + if (socketHandle >= 0) + close (socketHandle); + + socketHandle = -1; + } + + const MemoryBlock createRequestHeader (const String& hostName, + const int hostPort, + const String& proxyName, + const int proxyPort, + const String& hostPath, + const String& originalURL, + const String& headers, + const MemoryBlock& postData, + const bool isPost) + { + String header (isPost ? "POST " : "GET "); + + if (proxyName.isEmpty()) + { + header << hostPath << " HTTP/1.0\r\nHost: " + << hostName << ':' << hostPort; + } + else + { + header << originalURL << " HTTP/1.0\r\nHost: " + << proxyName << ':' << proxyPort; + } + + header << "\r\nUser-Agent: JUCE/" + << JUCE_MAJOR_VERSION << '.' << JUCE_MINOR_VERSION + << "\r\nConnection: Close\r\nContent-Length: " + << postData.getSize() << "\r\n" + << headers << "\r\n"; + + MemoryBlock mb; + mb.append (header.toUTF8(), (int) strlen (header.toUTF8())); + mb.append (postData.getData(), postData.getSize()); + + return mb; + } + + const String readResponse (const uint32 timeOutTime) + { + int bytesRead = 0, numConsecutiveLFs = 0; + MemoryBlock buffer (1024, true); + + while (numConsecutiveLFs < 2 && bytesRead < 32768 + && Time::getMillisecondCounter() <= timeOutTime) + { + fd_set readbits; + FD_ZERO (&readbits); + FD_SET (socketHandle, &readbits); + + struct timeval tv; + tv.tv_sec = timeoutSeconds; + tv.tv_usec = 0; + + if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) + return String::empty; // (timeout) + + buffer.ensureSize (bytesRead + 8, true); + char* const dest = (char*) buffer.getData() + bytesRead; + + if (recv (socketHandle, dest, 1, 0) == -1) + return String::empty; + + const char lastByte = *dest; + ++bytesRead; + + if (lastByte == '\n') + ++numConsecutiveLFs; + else if (lastByte != '\r') + numConsecutiveLFs = 0; + } + + const String header (String::fromUTF8 ((const uint8*) buffer.getData())); + + if (header.startsWithIgnoreCase (T("HTTP/"))) + return header.trimEnd(); + + return String::empty; + } + + //============================================================================== + static bool decomposeURL (const String& url, + String& host, String& path, int& port) + { + if (! url.startsWithIgnoreCase (T("http://"))) + return false; + + const int nextSlash = url.indexOfChar (7, '/'); + int nextColon = url.indexOfChar (7, ':'); + if (nextColon > nextSlash && nextSlash > 0) + nextColon = -1; + + if (nextColon >= 0) + { + host = url.substring (7, nextColon); + + if (nextSlash >= 0) + port = url.substring (nextColon + 1, nextSlash).getIntValue(); + else + port = url.substring (nextColon + 1).getIntValue(); + } + else + { + port = 80; + + if (nextSlash >= 0) + host = url.substring (7, nextSlash); + else + host = url.substring (7); + } + + if (nextSlash >= 0) + path = url.substring (nextSlash); + else + path = T("/"); + + return true; + } + + //============================================================================== + static const String findHeaderItem (const StringArray& lines, const String& itemName) + { + for (int i = 0; i < lines.size(); ++i) + if (lines[i].startsWithIgnoreCase (itemName)) + return lines[i].substring (itemName.length()).trim(); + + return String::empty; + } + }; + +//============================================================================== +bool juce_isOnLine() +{ + return true; +} + +void* juce_openInternetFile (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) +{ + JUCE_HTTPSocketStream* const s = new JUCE_HTTPSocketStream(); + + if (s->open (url, headers, postData, isPost, + callback, callbackContext, timeOutMs)) + return s; + + delete s; + return 0; +} + +void juce_closeInternetFile (void* handle) +{ + JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + + if (s != 0) + delete s; +} + +int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) +{ + JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + + if (s != 0) + return s->read (buffer, bytesToRead); + + return 0; +} + +int juce_seekInInternetFile (void* handle, int newPosition) +{ + JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + + if (s != 0) + return s->readPosition; + + return 0; +} END_JUCE_NAMESPACE diff --git a/build/linux/platform_specific_code/juce_linux_Threads.cpp b/build/linux/platform_specific_code/juce_linux_Threads.cpp index 24016fa10e..f09002c65b 100644 --- a/build/linux/platform_specific_code/juce_linux_Threads.cpp +++ b/build/linux/platform_specific_code/juce_linux_Threads.cpp @@ -44,6 +44,7 @@ BEGIN_JUCE_NAMESPACE #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" //============================================================================== /* @@ -90,9 +91,9 @@ void juce_setCurrentThreadName (const String& /*name*/) throw() { } -int Thread::getCurrentThreadId() throw() +int64 Thread::getCurrentThreadId() throw() { - return (int) pthread_self(); + return pthread_self(); } /* @@ -255,17 +256,17 @@ void Process::lowerPrivilege() } #if JUCE_BUILD_GUI_CLASSES -void* Process::loadDynamicLibrary (const String& name) +void* PlatformUtilities::loadDynamicLibrary (const String& name) { return dlopen ((const char*) name.toUTF8(), RTLD_LOCAL | RTLD_NOW); } -void Process::freeDynamicLibrary (void* handle) +void PlatformUtilities::freeDynamicLibrary (void* handle) { dlclose(handle); } -void* Process::getProcedureEntryPoint (void* libraryHandle, const String& procedureName) +void* PlatformUtilities::getProcedureEntryPoint (void* libraryHandle, const String& procedureName) { return dlsym (libraryHandle, (const char*) procedureName); } diff --git a/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp b/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp index d5c7acf9ca..e77bf2d905 100644 --- a/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp +++ b/build/linux/platform_specific_code/juce_linux_WebBrowserComponent.cpp @@ -35,6 +35,7 @@ BEGIN_JUCE_NAMESPACE #include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" +#if JUCE_WEB_BROWSER /* Sorry.. This class isn't implemented on Linux! @@ -113,10 +114,6 @@ void WebBrowserComponent::parentHierarchyChanged() checkWindowAssociation(); } -void WebBrowserComponent::moved() -{ -} - void WebBrowserComponent::resized() { } @@ -131,5 +128,5 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) return true; } - +#endif END_JUCE_NAMESPACE diff --git a/build/linux/platform_specific_code/juce_linux_Windowing.cpp b/build/linux/platform_specific_code/juce_linux_Windowing.cpp index 58b0bfd6df..2e80f6743b 100644 --- a/build/linux/platform_specific_code/juce_linux_Windowing.cpp +++ b/build/linux/platform_specific_code/juce_linux_Windowing.cpp @@ -467,7 +467,7 @@ static Pixmap juce_createColourPixmapFromImage (Display* display, const Image& i XImage* ximage = XCreateImage (display, CopyFromParent, 24, ZPixmap, 0, (char*) colour, width, height, 32, 0); - Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), + Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), width, height, 24); GC gc = XCreateGC (display, pixmap, 0, 0); @@ -1184,7 +1184,7 @@ public: wmHints->icon_mask = juce_createMaskPixmapFromImage (display, newIcon); XSetWMHints (display, windowH, wmHints); - XFree (wmHints); + XFree (wmHints); XSync (display, False); } @@ -1754,7 +1754,7 @@ public: 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 + // 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; diff --git a/build/macosx/Juce.xcodeproj/project.pbxproj b/build/macosx/Juce.xcodeproj/project.pbxproj index fcb24f9d88..f8bd94fe0a 100644 --- a/build/macosx/Juce.xcodeproj/project.pbxproj +++ b/build/macosx/Juce.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 84022DFD0DAE4CB9004CF59A /* juce_mac_HTTPStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 84022DFB0DAE4CB9004CF59A /* juce_mac_HTTPStream.h */; }; 84052DE408D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84052DE208D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.cpp */; }; 84052DE508D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84052DE308D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.h */; }; 8406AA5A0C4BDF90003A0D6A /* juce_MidiOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8406AA590C4BDF90003A0D6A /* juce_MidiOutput.cpp */; }; @@ -34,11 +33,10 @@ 84198B14096D8E2B0022A439 /* juce_MidiOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = 84198B0E096D8E2B0022A439 /* juce_MidiOutput.h */; }; 84198BB5096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84198BB3096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.cpp */; }; 84198BB6096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 84198BB4096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.h */; }; - 841B22E20D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.cpp */; }; + 841B22E20D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.mm in Sources */ = {isa = PBXBuildFile; fileRef = 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.mm */; }; 841B22E30D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 841B22CF0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.h */; }; 841B22E40D2E7FE3009D01AA /* juce_DirectXPluginFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 841B22D00D2E7FE3009D01AA /* juce_DirectXPluginFormat.h */; }; 841B22E50D2E7FE3009D01AA /* juce_LADSPAPluginFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 841B22D10D2E7FE3009D01AA /* juce_LADSPAPluginFormat.h */; }; - 841B22E60D2E7FE3009D01AA /* juce_VSTPluginFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841B22D20D2E7FE3009D01AA /* juce_VSTPluginFormat.cpp */; }; 841B22E70D2E7FE3009D01AA /* juce_VSTPluginFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 841B22D30D2E7FE3009D01AA /* juce_VSTPluginFormat.h */; }; 841B22E80D2E7FE3009D01AA /* juce_AudioPluginFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841B22D40D2E7FE3009D01AA /* juce_AudioPluginFormat.cpp */; }; 841B22E90D2E7FE3009D01AA /* juce_AudioPluginFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 841B22D50D2E7FE3009D01AA /* juce_AudioPluginFormat.h */; }; @@ -79,18 +77,19 @@ 842F9D6E0A19C9AF00B1358D /* juce_TextPropertyComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 842F9D620A19C9AF00B1358D /* juce_TextPropertyComponent.h */; }; 842F9DE20A19D2AF00B1358D /* juce_PositionedRectangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 842F9DE00A19D2AF00B1358D /* juce_PositionedRectangle.cpp */; }; 842F9DE30A19D2AF00B1358D /* juce_PositionedRectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 842F9DE10A19D2AF00B1358D /* juce_PositionedRectangle.h */; }; + 8435D90D0E9406D2008FBD1C /* juce_mac_Strings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8435D90C0E9406D2008FBD1C /* juce_mac_Strings.mm */; }; + 8435D9650E940A3E008FBD1C /* juce_mac_MiscUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8435D9640E940A3E008FBD1C /* juce_mac_MiscUtilities.mm */; }; + 8435DA420E95527D008FBD1C /* juce_mac_Debugging.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8435DA410E95527D008FBD1C /* juce_mac_Debugging.mm */; }; 8440CD3E0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8440CD3C0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.cpp */; }; 8440CD3F0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8440CD3D0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.h */; }; 8440CD620ACD112E0086FFD7 /* juce_SliderListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 8440CD610ACD112E0086FFD7 /* juce_SliderListener.h */; }; + 8457783E0E8947C8006D9E4E /* juce_NSViewComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 8457783D0E8947C8006D9E4E /* juce_NSViewComponent.h */; }; 84581EEA0D9148C500AE1A4C /* juce_QuickTimeAudioFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84581EE80D9148C500AE1A4C /* juce_QuickTimeAudioFormat.cpp */; }; 84581EEB0D9148C500AE1A4C /* juce_QuickTimeAudioFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 84581EE90D9148C500AE1A4C /* juce_QuickTimeAudioFormat.h */; }; 846034DE09CB374E00E255CF /* juce_InterprocessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846034DA09CB374E00E255CF /* juce_InterprocessConnection.cpp */; }; 846034DF09CB374E00E255CF /* juce_InterprocessConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 846034DB09CB374E00E255CF /* juce_InterprocessConnection.h */; }; 846034E009CB374E00E255CF /* juce_InterprocessConnectionServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846034DC09CB374E00E255CF /* juce_InterprocessConnectionServer.cpp */; }; 846034E109CB374E00E255CF /* juce_InterprocessConnectionServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 846034DD09CB374E00E255CF /* juce_InterprocessConnectionServer.h */; }; - 8463D3220E1FC25A003B46B2 /* juce_mac_Fonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8463D31F0E1FC25A003B46B2 /* juce_mac_Fonts.mm */; }; - 8463D3230E1FC25A003B46B2 /* juce_mac_Messaging.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8463D3200E1FC25A003B46B2 /* juce_mac_Messaging.mm */; }; - 8463D3240E1FC25A003B46B2 /* juce_mac_Windowing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8463D3210E1FC25A003B46B2 /* juce_mac_Windowing.mm */; }; 8463D5C1098BD2DD00F9AEC2 /* juce_MidiBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8463D5B5098BD2DD00F9AEC2 /* juce_MidiBuffer.cpp */; }; 8463D5C2098BD2DD00F9AEC2 /* juce_MidiBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8463D5B6098BD2DD00F9AEC2 /* juce_MidiBuffer.h */; }; 8463D5C3098BD2DD00F9AEC2 /* juce_MidiFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8463D5B7098BD2DD00F9AEC2 /* juce_MidiFile.cpp */; }; @@ -115,12 +114,10 @@ 846927DF0A49ABE600314975 /* juce_RectanglePlacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 846927DD0A49ABE600314975 /* juce_RectanglePlacement.h */; }; 846927E10A49ABFD00314975 /* juce_SVGParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846927E00A49ABFD00314975 /* juce_SVGParser.cpp */; }; 847824810D7816A00082A5C5 /* juce_AudioCDBurner.h in Headers */ = {isa = PBXBuildFile; fileRef = 8478247F0D7816A00082A5C5 /* juce_AudioCDBurner.h */; }; - 847D06470DD88D1100DF6A61 /* juce_mac_Network.mm in Sources */ = {isa = PBXBuildFile; fileRef = 847D06460DD88D1100DF6A61 /* juce_mac_Network.mm */; }; 847F72DB0C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F72D70C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.cpp */; }; 847F72DC0C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 847F72D80C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.h */; }; 847F72DD0C2702A000CBECEC /* juce_FileTreeComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F72D90C2702A000CBECEC /* juce_FileTreeComponent.cpp */; }; 847F72DE0C2702A000CBECEC /* juce_FileTreeComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 847F72DA0C2702A000CBECEC /* juce_FileTreeComponent.h */; }; - 848A560B0DDDD3E40041C706 /* juce_mac_WebBrowserComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 848A560A0DDDD3E40041C706 /* juce_mac_WebBrowserComponent.mm */; }; 848A560E0DDDD3FB0041C706 /* juce_WebBrowserComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 848A560D0DDDD3FB0041C706 /* juce_WebBrowserComponent.h */; }; 8495BB8C0D8067B2001D9C0B /* juce_AudioThumbnail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8495BB880D8067B2001D9C0B /* juce_AudioThumbnail.cpp */; }; 8495BB8D0D8067B2001D9C0B /* juce_AudioThumbnail.h in Headers */ = {isa = PBXBuildFile; fileRef = 8495BB890D8067B2001D9C0B /* juce_AudioThumbnail.h */; }; @@ -132,11 +129,6 @@ 84A06BAD09CAD6A3006A43BD /* juce_AudioIODevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A06BAA09CAD6A3006A43BD /* juce_AudioIODevice.cpp */; }; 84A06BAE09CAD6A3006A43BD /* juce_AudioIODeviceType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A06BAB09CAD6A3006A43BD /* juce_AudioIODeviceType.cpp */; }; 84A06BAF09CAD6A3006A43BD /* juce_AudioIODeviceType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A06BAC09CAD6A3006A43BD /* juce_AudioIODeviceType.h */; }; - 84A06BE309CADB06006A43BD /* juce_mac_NamedPipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A06BE209CADB06006A43BD /* juce_mac_NamedPipe.cpp */; }; - 84A4882908A22E2400752A2B /* juce_mac_CoreAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4881E08A22E2400752A2B /* juce_mac_CoreAudio.cpp */; }; - 84A4882A08A22E2400752A2B /* juce_mac_CoreMidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4881F08A22E2400752A2B /* juce_mac_CoreMidi.cpp */; }; - 84A4882C08A22E2400752A2B /* juce_mac_Files.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4882108A22E2400752A2B /* juce_mac_Files.cpp */; }; - 84A4883108A22E2400752A2B /* juce_mac_Threads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4882608A22E2400752A2B /* juce_mac_Threads.cpp */; }; 84A48A2808A22E4B00752A2B /* juce_Application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4883508A22E4900752A2B /* juce_Application.cpp */; }; 84A48A2908A22E4B00752A2B /* juce_Application.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A4883608A22E4900752A2B /* juce_Application.h */; }; 84A48A2A08A22E4B00752A2B /* juce_DeletedAtShutdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A4883708A22E4900752A2B /* juce_DeletedAtShutdown.cpp */; }; @@ -288,7 +280,6 @@ 84A48ACE08A22E4B00752A2B /* juce_OpenGLComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A488E908A22E4900752A2B /* juce_OpenGLComponent.h */; }; 84A48ACF08A22E4B00752A2B /* juce_PreferencesPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A488EA08A22E4900752A2B /* juce_PreferencesPanel.cpp */; }; 84A48AD008A22E4B00752A2B /* juce_PreferencesPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A488EB08A22E4900752A2B /* juce_PreferencesPanel.h */; }; - 84A48AD108A22E4B00752A2B /* juce_QuickTimeMovieComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A488EC08A22E4900752A2B /* juce_QuickTimeMovieComponent.cpp */; }; 84A48AD208A22E4B00752A2B /* juce_QuickTimeMovieComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A488ED08A22E4900752A2B /* juce_QuickTimeMovieComponent.h */; }; 84A48AD308A22E4B00752A2B /* juce_AlertWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A488EF08A22E4900752A2B /* juce_AlertWindow.cpp */; }; 84A48AD408A22E4B00752A2B /* juce_AlertWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A488F008A22E4900752A2B /* juce_AlertWindow.h */; }; @@ -490,12 +481,32 @@ 84BC4E2E0C8DD38C00FA249B /* juce_AudioProcessorListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BC4E260C8DD38C00FA249B /* juce_AudioProcessorListener.h */; }; 84BC4E2F0C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BC4E270C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.cpp */; }; 84BC4E300C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BC4E280C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.h */; }; - 84BE9E1C0DE56DEB00AB8F23 /* juce_mac_SystemStats.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84BE9E1B0DE56DEB00AB8F23 /* juce_mac_SystemStats.mm */; }; 84C0EA5E0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C0EA5C0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.cpp */; }; 84C0EA5F0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C0EA5D0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.h */; }; - 84CE8A410DC5D7D600799A0E /* juce_mac_AudioCDBurner.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84CE8A400DC5D7D600799A0E /* juce_mac_AudioCDBurner.mm */; }; + 84CA4AF40E9BF8B6004CCC0E /* juce_VSTPluginFormat.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84CA4AF30E9BF8B6004CCC0E /* juce_VSTPluginFormat.mm */; }; 84D296BD09B763190026C535 /* juce_PropertiesFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D296BB09B763190026C535 /* juce_PropertiesFile.cpp */; }; 84D296BE09B763190026C535 /* juce_PropertiesFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D296BC09B763190026C535 /* juce_PropertiesFile.h */; }; + 84E024F10E94028C003E41AF /* juce_mac_AppleRemote.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024DB0E94028C003E41AF /* juce_mac_AppleRemote.mm */; }; + 84E024F20E94028C003E41AF /* juce_mac_AudioCDBurner.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024DC0E94028C003E41AF /* juce_mac_AudioCDBurner.mm */; }; + 84E024F30E94028C003E41AF /* juce_mac_CoreAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E024DD0E94028C003E41AF /* juce_mac_CoreAudio.cpp */; }; + 84E024F40E94028C003E41AF /* juce_mac_CoreMidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E024DE0E94028C003E41AF /* juce_mac_CoreMidi.cpp */; }; + 84E024F50E94028C003E41AF /* juce_mac_FileChooser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024DF0E94028C003E41AF /* juce_mac_FileChooser.mm */; }; + 84E024F60E94028C003E41AF /* juce_mac_Files.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E00E94028C003E41AF /* juce_mac_Files.mm */; }; + 84E024F70E94028C003E41AF /* juce_mac_Fonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E10E94028C003E41AF /* juce_mac_Fonts.mm */; }; + 84E024F80E94028C003E41AF /* juce_mac_MainMenu.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E20E94028C003E41AF /* juce_mac_MainMenu.mm */; }; + 84E024F90E94028C003E41AF /* juce_mac_MessageManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E30E94028C003E41AF /* juce_mac_MessageManager.mm */; }; + 84E024FA0E94028C003E41AF /* juce_mac_MouseCursor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E40E94028C003E41AF /* juce_mac_MouseCursor.mm */; }; + 84E024FB0E94028C003E41AF /* juce_mac_NamedPipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E50E94028C003E41AF /* juce_mac_NamedPipe.cpp */; }; + 84E024FC0E94028C003E41AF /* juce_mac_NativeCode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E60E94028C003E41AF /* juce_mac_NativeCode.mm */; }; + 84E024FE0E94028C003E41AF /* juce_mac_Network.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E80E94028C003E41AF /* juce_mac_Network.mm */; }; + 84E024FF0E94028C003E41AF /* juce_mac_NSViewComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024E90E94028C003E41AF /* juce_mac_NSViewComponent.mm */; }; + 84E025000E94028C003E41AF /* juce_mac_NSViewComponentPeer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024EA0E94028C003E41AF /* juce_mac_NSViewComponentPeer.mm */; }; + 84E025010E94028C003E41AF /* juce_mac_OpenGLComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024EB0E94028C003E41AF /* juce_mac_OpenGLComponent.mm */; }; + 84E025020E94028C003E41AF /* juce_mac_QuickTimeMovieComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024EC0E94028C003E41AF /* juce_mac_QuickTimeMovieComponent.mm */; }; + 84E025030E94028C003E41AF /* juce_mac_SystemStats.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024ED0E94028C003E41AF /* juce_mac_SystemStats.mm */; }; + 84E025040E94028C003E41AF /* juce_mac_Threads.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024EE0E94028C003E41AF /* juce_mac_Threads.mm */; }; + 84E025050E94028C003E41AF /* juce_mac_WebBrowserComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E024EF0E94028C003E41AF /* juce_mac_WebBrowserComponent.mm */; }; + 84E025060E94028C003E41AF /* juce_posix_SharedCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E024F00E94028C003E41AF /* juce_posix_SharedCode.h */; }; 84E8209409729D2A0097675B /* juce_AudioFormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E8209209729D2A0097675B /* juce_AudioFormatManager.cpp */; }; 84E8209509729D2A0097675B /* juce_AudioFormatManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 84E8209309729D2A0097675B /* juce_AudioFormatManager.h */; }; 84F1B8DA09499F1400AD8EDE /* juce_MidiKeyboardComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1B8D809499F1400AD8EDE /* juce_MidiKeyboardComponent.cpp */; }; @@ -529,10 +540,8 @@ 84F593AE09855679008153BA /* juce_DocumentWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F593AC09855679008153BA /* juce_DocumentWindow.cpp */; }; 84F593AF09855679008153BA /* juce_DocumentWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F593AD09855679008153BA /* juce_DocumentWindow.h */; }; 84F593B109855693008153BA /* juce_LassoComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F593B009855693008153BA /* juce_LassoComponent.h */; }; - 84F597000E23DDBB00E92E85 /* juce_mac_NativeHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F596FF0E23DDBB00E92E85 /* juce_mac_NativeHeaders.h */; }; 84F6B7540C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F6B7520C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.cpp */; }; 84F6B7550C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F6B7530C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.h */; }; - 84F703230E1E56FB00EB338A /* juce_mac_FileChooser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84F703220E1E56FB00EB338A /* juce_mac_FileChooser.mm */; }; 84F7A7AF0A8383A100D36246 /* juce_ToolbarButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F7A7AD0A8383A100D36246 /* juce_ToolbarButton.cpp */; }; 84F7A7B00A8383A100D36246 /* juce_ToolbarButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F7A7AE0A8383A100D36246 /* juce_ToolbarButton.h */; }; 84F7A7B80A8383C200D36246 /* juce_Toolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F7A7B10A8383C200D36246 /* juce_Toolbar.cpp */; }; @@ -546,6 +555,7 @@ 84F7A7C20A8383E000D36246 /* juce_MultiTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F7A7C00A8383E000D36246 /* juce_MultiTimer.h */; }; 84F7A7EF0A838CC900D36246 /* juce_ComponentAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F7A7ED0A838CC900D36246 /* juce_ComponentAnimator.cpp */; }; 84F7A7F00A838CC900D36246 /* juce_ComponentAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F7A7EE0A838CC900D36246 /* juce_ComponentAnimator.h */; }; + 84F8B60D0EB5B9230020D98D /* juce_mac_NativeIncludes.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F8B60C0EB5B9230020D98D /* juce_mac_NativeIncludes.h */; }; 84F8DAD0099C963A00E911ED /* juce_ComponentPeer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F8DACE099C963A00E911ED /* juce_ComponentPeer.cpp */; }; 84F8DAD1099C963A00E911ED /* juce_ComponentPeer.h in Headers */ = {isa = PBXBuildFile; fileRef = 84F8DACF099C963A00E911ED /* juce_ComponentPeer.h */; }; 84FC318F09B749FD00B75141 /* juce_FileBasedDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FC318709B749FD00B75141 /* juce_FileBasedDocument.cpp */; }; @@ -582,7 +592,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 84022DFB0DAE4CB9004CF59A /* juce_mac_HTTPStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_mac_HTTPStream.h; sourceTree = ""; }; 84052DE208D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ToneGeneratorAudioSource.cpp; sourceTree = ""; }; 84052DE308D095D200BEC0F0 /* juce_ToneGeneratorAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ToneGeneratorAudioSource.h; sourceTree = ""; }; 8406AA590C4BDF90003A0D6A /* juce_MidiOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_MidiOutput.cpp; sourceTree = ""; }; @@ -609,11 +618,10 @@ 84198B0E096D8E2B0022A439 /* juce_MidiOutput.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_MidiOutput.h; sourceTree = ""; }; 84198BB3096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioDeviceSelectorComponent.cpp; sourceTree = ""; }; 84198BB4096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioDeviceSelectorComponent.h; sourceTree = ""; }; - 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioUnitPluginFormat.cpp; sourceTree = ""; }; + 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 2; path = juce_AudioUnitPluginFormat.mm; sourceTree = ""; }; 841B22CF0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioUnitPluginFormat.h; sourceTree = ""; }; 841B22D00D2E7FE3009D01AA /* juce_DirectXPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_DirectXPluginFormat.h; sourceTree = ""; }; 841B22D10D2E7FE3009D01AA /* juce_LADSPAPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_LADSPAPluginFormat.h; sourceTree = ""; }; - 841B22D20D2E7FE3009D01AA /* juce_VSTPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_VSTPluginFormat.cpp; sourceTree = ""; }; 841B22D30D2E7FE3009D01AA /* juce_VSTPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_VSTPluginFormat.h; sourceTree = ""; }; 841B22D40D2E7FE3009D01AA /* juce_AudioPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioPluginFormat.cpp; sourceTree = ""; }; 841B22D50D2E7FE3009D01AA /* juce_AudioPluginFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioPluginFormat.h; sourceTree = ""; }; @@ -639,7 +647,6 @@ 842B63B709D8508F00255DC7 /* juce_FlacAudioFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_FlacAudioFormat.h; sourceTree = ""; }; 842B63B809D8508F00255DC7 /* juce_OggVorbisAudioFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_OggVorbisAudioFormat.cpp; sourceTree = ""; }; 842B63B909D8508F00255DC7 /* juce_OggVorbisAudioFormat.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_OggVorbisAudioFormat.h; sourceTree = ""; }; - 842B64EA09D87B7900255DC7 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = juce.xcconfig; sourceTree = ""; }; 842D3D0D0C0D7CF200E9FFE4 /* juce_MenuBarModel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_MenuBarModel.cpp; sourceTree = ""; }; 842F9D570A19C9AF00B1358D /* juce_ButtonPropertyComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ButtonPropertyComponent.cpp; sourceTree = ""; }; 842F9D580A19C9AF00B1358D /* juce_ButtonPropertyComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ButtonPropertyComponent.h; sourceTree = ""; }; @@ -655,20 +662,21 @@ 842F9D620A19C9AF00B1358D /* juce_TextPropertyComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_TextPropertyComponent.h; sourceTree = ""; }; 842F9DE00A19D2AF00B1358D /* juce_PositionedRectangle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_PositionedRectangle.cpp; sourceTree = ""; }; 842F9DE10A19D2AF00B1358D /* juce_PositionedRectangle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_PositionedRectangle.h; sourceTree = ""; }; + 8435D90C0E9406D2008FBD1C /* juce_mac_Strings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Strings.mm; sourceTree = ""; }; + 8435D9640E940A3E008FBD1C /* juce_mac_MiscUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_MiscUtilities.mm; sourceTree = ""; }; + 8435DA410E95527D008FBD1C /* juce_mac_Debugging.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Debugging.mm; sourceTree = ""; }; 8440CD3C0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ComponentMovementWatcher.cpp; sourceTree = ""; }; 8440CD3D0ACD0FFC0086FFD7 /* juce_ComponentMovementWatcher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ComponentMovementWatcher.h; sourceTree = ""; }; 8440CD610ACD112E0086FFD7 /* juce_SliderListener.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_SliderListener.h; sourceTree = ""; }; 8456EC6508A2A6C80087C412 /* juce_Config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_Config.h; path = ../../juce_Config.h; sourceTree = SOURCE_ROOT; }; 8456EC6908A2A6F00087C412 /* JUCE changelist.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "JUCE changelist.txt"; path = "../../docs/JUCE changelist.txt"; sourceTree = SOURCE_ROOT; }; + 8457783D0E8947C8006D9E4E /* juce_NSViewComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_NSViewComponent.h; sourceTree = ""; }; 84581EE80D9148C500AE1A4C /* juce_QuickTimeAudioFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_QuickTimeAudioFormat.cpp; sourceTree = ""; }; 84581EE90D9148C500AE1A4C /* juce_QuickTimeAudioFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_QuickTimeAudioFormat.h; sourceTree = ""; }; 846034DA09CB374E00E255CF /* juce_InterprocessConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_InterprocessConnection.cpp; sourceTree = ""; }; 846034DB09CB374E00E255CF /* juce_InterprocessConnection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_InterprocessConnection.h; sourceTree = ""; }; 846034DC09CB374E00E255CF /* juce_InterprocessConnectionServer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_InterprocessConnectionServer.cpp; sourceTree = ""; }; 846034DD09CB374E00E255CF /* juce_InterprocessConnectionServer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_InterprocessConnectionServer.h; sourceTree = ""; }; - 8463D31F0E1FC25A003B46B2 /* juce_mac_Fonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Fonts.mm; sourceTree = ""; }; - 8463D3200E1FC25A003B46B2 /* juce_mac_Messaging.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Messaging.mm; sourceTree = ""; }; - 8463D3210E1FC25A003B46B2 /* juce_mac_Windowing.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Windowing.mm; sourceTree = ""; }; 8463D5B5098BD2DD00F9AEC2 /* juce_MidiBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_MidiBuffer.cpp; path = midi/juce_MidiBuffer.cpp; sourceTree = ""; }; 8463D5B6098BD2DD00F9AEC2 /* juce_MidiBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_MidiBuffer.h; path = midi/juce_MidiBuffer.h; sourceTree = ""; }; 8463D5B7098BD2DD00F9AEC2 /* juce_MidiFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_MidiFile.cpp; path = midi/juce_MidiFile.cpp; sourceTree = ""; }; @@ -693,12 +701,10 @@ 846927DD0A49ABE600314975 /* juce_RectanglePlacement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_RectanglePlacement.h; sourceTree = ""; }; 846927E00A49ABFD00314975 /* juce_SVGParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_SVGParser.cpp; sourceTree = ""; }; 8478247F0D7816A00082A5C5 /* juce_AudioCDBurner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioCDBurner.h; sourceTree = ""; }; - 847D06460DD88D1100DF6A61 /* juce_mac_Network.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Network.mm; sourceTree = ""; }; 847F72D70C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_DirectoryContentsDisplayComponent.cpp; path = filebrowser/juce_DirectoryContentsDisplayComponent.cpp; sourceTree = ""; }; 847F72D80C2702A000CBECEC /* juce_DirectoryContentsDisplayComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_DirectoryContentsDisplayComponent.h; path = filebrowser/juce_DirectoryContentsDisplayComponent.h; sourceTree = ""; }; 847F72D90C2702A000CBECEC /* juce_FileTreeComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_FileTreeComponent.cpp; path = filebrowser/juce_FileTreeComponent.cpp; sourceTree = ""; }; 847F72DA0C2702A000CBECEC /* juce_FileTreeComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_FileTreeComponent.h; path = filebrowser/juce_FileTreeComponent.h; sourceTree = ""; }; - 848A560A0DDDD3E40041C706 /* juce_mac_WebBrowserComponent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_WebBrowserComponent.mm; sourceTree = ""; }; 848A560D0DDDD3FB0041C706 /* juce_WebBrowserComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_WebBrowserComponent.h; sourceTree = ""; }; 8495BB880D8067B2001D9C0B /* juce_AudioThumbnail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioThumbnail.cpp; sourceTree = ""; }; 8495BB890D8067B2001D9C0B /* juce_AudioThumbnail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_AudioThumbnail.h; sourceTree = ""; }; @@ -710,11 +716,6 @@ 84A06BAA09CAD6A3006A43BD /* juce_AudioIODevice.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioIODevice.cpp; sourceTree = ""; }; 84A06BAB09CAD6A3006A43BD /* juce_AudioIODeviceType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioIODeviceType.cpp; sourceTree = ""; }; 84A06BAC09CAD6A3006A43BD /* juce_AudioIODeviceType.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioIODeviceType.h; sourceTree = ""; }; - 84A06BE209CADB06006A43BD /* juce_mac_NamedPipe.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_mac_NamedPipe.cpp; sourceTree = ""; }; - 84A4881E08A22E2400752A2B /* juce_mac_CoreAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_mac_CoreAudio.cpp; path = platform_specific_code/juce_mac_CoreAudio.cpp; sourceTree = SOURCE_ROOT; }; - 84A4881F08A22E2400752A2B /* juce_mac_CoreMidi.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_mac_CoreMidi.cpp; path = platform_specific_code/juce_mac_CoreMidi.cpp; sourceTree = SOURCE_ROOT; }; - 84A4882108A22E2400752A2B /* juce_mac_Files.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_mac_Files.cpp; path = platform_specific_code/juce_mac_Files.cpp; sourceTree = SOURCE_ROOT; }; - 84A4882608A22E2400752A2B /* juce_mac_Threads.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_mac_Threads.cpp; path = platform_specific_code/juce_mac_Threads.cpp; sourceTree = SOURCE_ROOT; }; 84A4883508A22E4900752A2B /* juce_Application.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Application.cpp; path = ../../src/juce_appframework/application/juce_Application.cpp; sourceTree = SOURCE_ROOT; }; 84A4883608A22E4900752A2B /* juce_Application.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_Application.h; path = ../../src/juce_appframework/application/juce_Application.h; sourceTree = SOURCE_ROOT; }; 84A4883708A22E4900752A2B /* juce_DeletedAtShutdown.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_DeletedAtShutdown.cpp; path = ../../src/juce_appframework/application/juce_DeletedAtShutdown.cpp; sourceTree = SOURCE_ROOT; }; @@ -866,7 +867,6 @@ 84A488E908A22E4900752A2B /* juce_OpenGLComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_OpenGLComponent.h; path = ../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h; sourceTree = SOURCE_ROOT; }; 84A488EA08A22E4900752A2B /* juce_PreferencesPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_PreferencesPanel.cpp; path = ../../src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp; sourceTree = SOURCE_ROOT; }; 84A488EB08A22E4900752A2B /* juce_PreferencesPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_PreferencesPanel.h; path = ../../src/juce_appframework/gui/components/special/juce_PreferencesPanel.h; sourceTree = SOURCE_ROOT; }; - 84A488EC08A22E4900752A2B /* juce_QuickTimeMovieComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_QuickTimeMovieComponent.cpp; path = ../../src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp; sourceTree = SOURCE_ROOT; }; 84A488ED08A22E4900752A2B /* juce_QuickTimeMovieComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_QuickTimeMovieComponent.h; path = ../../src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h; sourceTree = SOURCE_ROOT; }; 84A488EF08A22E4900752A2B /* juce_AlertWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_AlertWindow.cpp; path = ../../src/juce_appframework/gui/components/windows/juce_AlertWindow.cpp; sourceTree = SOURCE_ROOT; }; 84A488F008A22E4900752A2B /* juce_AlertWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_AlertWindow.h; path = ../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h; sourceTree = SOURCE_ROOT; }; @@ -1061,19 +1061,40 @@ 84A48A2608A22E4A00752A2B /* juce_TimeSliceThread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_TimeSliceThread.h; path = ../../src/juce_core/threads/juce_TimeSliceThread.h; sourceTree = SOURCE_ROOT; }; 84A48A2708A22E4A00752A2B /* juce_WaitableEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_WaitableEvent.h; path = ../../src/juce_core/threads/juce_WaitableEvent.h; sourceTree = SOURCE_ROOT; }; 84BC4E210C8DD38C00FA249B /* juce_AudioPlayHead.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioPlayHead.h; sourceTree = ""; }; - 84BC4E220C8DD38C00FA249B /* juce_AudioProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioProcessor.cpp; sourceTree = ""; }; + 84BC4E220C8DD38C00FA249B /* juce_AudioProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 2; path = juce_AudioProcessor.cpp; sourceTree = ""; }; 84BC4E230C8DD38C00FA249B /* juce_AudioProcessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioProcessor.h; sourceTree = ""; }; 84BC4E240C8DD38C00FA249B /* juce_AudioProcessorEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioProcessorEditor.cpp; sourceTree = ""; }; 84BC4E250C8DD38C00FA249B /* juce_AudioProcessorEditor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioProcessorEditor.h; sourceTree = ""; }; 84BC4E260C8DD38C00FA249B /* juce_AudioProcessorListener.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioProcessorListener.h; sourceTree = ""; }; 84BC4E270C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_GenericAudioProcessorEditor.cpp; sourceTree = ""; }; 84BC4E280C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_GenericAudioProcessorEditor.h; sourceTree = ""; }; - 84BE9E1B0DE56DEB00AB8F23 /* juce_mac_SystemStats.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_SystemStats.mm; sourceTree = ""; }; 84C0EA5C0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_IIRFilterAudioSource.cpp; path = ../../src/juce_appframework/audio/audio_sources/juce_IIRFilterAudioSource.cpp; sourceTree = SOURCE_ROOT; }; 84C0EA5D0B3DDF2400EDF9D9 /* juce_IIRFilterAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_IIRFilterAudioSource.h; path = ../../src/juce_appframework/audio/audio_sources/juce_IIRFilterAudioSource.h; sourceTree = SOURCE_ROOT; }; - 84CE8A400DC5D7D600799A0E /* juce_mac_AudioCDBurner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_AudioCDBurner.mm; sourceTree = ""; }; + 84CA4AF30E9BF8B6004CCC0E /* juce_VSTPluginFormat.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_VSTPluginFormat.mm; sourceTree = ""; }; + 84CA4AFA0E9BF9EC004CCC0E /* juce_VSTPluginFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_VSTPluginFormat.cpp; sourceTree = ""; }; 84D296BB09B763190026C535 /* juce_PropertiesFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_PropertiesFile.cpp; sourceTree = ""; }; 84D296BC09B763190026C535 /* juce_PropertiesFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_PropertiesFile.h; sourceTree = ""; }; + 84E024DB0E94028C003E41AF /* juce_mac_AppleRemote.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_AppleRemote.mm; sourceTree = ""; }; + 84E024DC0E94028C003E41AF /* juce_mac_AudioCDBurner.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_AudioCDBurner.mm; sourceTree = ""; }; + 84E024DD0E94028C003E41AF /* juce_mac_CoreAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_mac_CoreAudio.cpp; sourceTree = ""; }; + 84E024DE0E94028C003E41AF /* juce_mac_CoreMidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_mac_CoreMidi.cpp; sourceTree = ""; }; + 84E024DF0E94028C003E41AF /* juce_mac_FileChooser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_FileChooser.mm; sourceTree = ""; }; + 84E024E00E94028C003E41AF /* juce_mac_Files.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Files.mm; sourceTree = ""; }; + 84E024E10E94028C003E41AF /* juce_mac_Fonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Fonts.mm; sourceTree = ""; }; + 84E024E20E94028C003E41AF /* juce_mac_MainMenu.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_MainMenu.mm; sourceTree = ""; }; + 84E024E30E94028C003E41AF /* juce_mac_MessageManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_MessageManager.mm; sourceTree = ""; }; + 84E024E40E94028C003E41AF /* juce_mac_MouseCursor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_MouseCursor.mm; sourceTree = ""; }; + 84E024E50E94028C003E41AF /* juce_mac_NamedPipe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = juce_mac_NamedPipe.cpp; sourceTree = ""; }; + 84E024E60E94028C003E41AF /* juce_mac_NativeCode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_NativeCode.mm; sourceTree = ""; }; + 84E024E80E94028C003E41AF /* juce_mac_Network.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Network.mm; sourceTree = ""; }; + 84E024E90E94028C003E41AF /* juce_mac_NSViewComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_NSViewComponent.mm; sourceTree = ""; }; + 84E024EA0E94028C003E41AF /* juce_mac_NSViewComponentPeer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_NSViewComponentPeer.mm; sourceTree = ""; }; + 84E024EB0E94028C003E41AF /* juce_mac_OpenGLComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_OpenGLComponent.mm; sourceTree = ""; }; + 84E024EC0E94028C003E41AF /* juce_mac_QuickTimeMovieComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_QuickTimeMovieComponent.mm; sourceTree = ""; }; + 84E024ED0E94028C003E41AF /* juce_mac_SystemStats.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_SystemStats.mm; sourceTree = ""; }; + 84E024EE0E94028C003E41AF /* juce_mac_Threads.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_Threads.mm; sourceTree = ""; }; + 84E024EF0E94028C003E41AF /* juce_mac_WebBrowserComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_WebBrowserComponent.mm; sourceTree = ""; }; + 84E024F00E94028C003E41AF /* juce_posix_SharedCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_posix_SharedCode.h; sourceTree = ""; }; 84E8209209729D2A0097675B /* juce_AudioFormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_AudioFormatManager.cpp; sourceTree = ""; }; 84E8209309729D2A0097675B /* juce_AudioFormatManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_AudioFormatManager.h; sourceTree = ""; }; 84F1B8D809499F1400AD8EDE /* juce_MidiKeyboardComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_MidiKeyboardComponent.cpp; sourceTree = ""; }; @@ -1107,10 +1128,8 @@ 84F593AC09855679008153BA /* juce_DocumentWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_DocumentWindow.cpp; sourceTree = ""; }; 84F593AD09855679008153BA /* juce_DocumentWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_DocumentWindow.h; sourceTree = ""; }; 84F593B009855693008153BA /* juce_LassoComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_LassoComponent.h; sourceTree = ""; }; - 84F596FF0E23DDBB00E92E85 /* juce_mac_NativeHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_mac_NativeHeaders.h; sourceTree = ""; }; 84F6B7520C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ChannelRemappingAudioSource.cpp; sourceTree = ""; }; 84F6B7530C06E29D00BB8791 /* juce_ChannelRemappingAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ChannelRemappingAudioSource.h; sourceTree = ""; }; - 84F703220E1E56FB00EB338A /* juce_mac_FileChooser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = juce_mac_FileChooser.mm; sourceTree = ""; }; 84F7A7AD0A8383A100D36246 /* juce_ToolbarButton.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ToolbarButton.cpp; sourceTree = ""; }; 84F7A7AE0A8383A100D36246 /* juce_ToolbarButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ToolbarButton.h; sourceTree = ""; }; 84F7A7B10A8383C200D36246 /* juce_Toolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_Toolbar.cpp; sourceTree = ""; }; @@ -1124,6 +1143,7 @@ 84F7A7C00A8383E000D36246 /* juce_MultiTimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_MultiTimer.h; sourceTree = ""; }; 84F7A7ED0A838CC900D36246 /* juce_ComponentAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ComponentAnimator.cpp; sourceTree = ""; }; 84F7A7EE0A838CC900D36246 /* juce_ComponentAnimator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ComponentAnimator.h; sourceTree = ""; }; + 84F8B60C0EB5B9230020D98D /* juce_mac_NativeIncludes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = juce_mac_NativeIncludes.h; sourceTree = ""; }; 84F8DACE099C963A00E911ED /* juce_ComponentPeer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = juce_ComponentPeer.cpp; sourceTree = ""; }; 84F8DACF099C963A00E911ED /* juce_ComponentPeer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_ComponentPeer.h; sourceTree = ""; }; 84FC318709B749FD00B75141 /* juce_FileBasedDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_FileBasedDocument.cpp; path = documents/juce_FileBasedDocument.cpp; sourceTree = ""; }; @@ -1157,7 +1177,7 @@ 84FED3C80CAA96DA00003997 /* juce_FileDragAndDropTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = juce_FileDragAndDropTarget.h; sourceTree = ""; }; 84FFAF290C6C8F2B009F6E72 /* juce_FileSearchPathListComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_FileSearchPathListComponent.cpp; path = filebrowser/juce_FileSearchPathListComponent.cpp; sourceTree = ""; }; 84FFAF2A0C6C8F2B009F6E72 /* juce_FileSearchPathListComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_FileSearchPathListComponent.h; path = filebrowser/juce_FileSearchPathListComponent.h; sourceTree = ""; }; - D2AAC046055464E500DB518D /* libjuce.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjuce.a; sourceTree = BUILT_PRODUCTS_DIR; }; + D2AAC046055464E500DB518D /* libjucedebug.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjucedebug.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1177,7 +1197,6 @@ 08FB7795FE84155DC02AAC07 /* Source */, 8456EC6508A2A6C80087C412 /* juce_Config.h */, 840F80BB092B399D005E7B4E /* juce.h */, - 842B64EA09D87B7900255DC7 /* juce.xcconfig */, 8456EC6908A2A6F00087C412 /* JUCE changelist.txt */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); @@ -1197,7 +1216,7 @@ 1AB674ADFE9D54B511CA2CBB /* Products */ = { isa = PBXGroup; children = ( - D2AAC046055464E500DB518D /* libjuce.a */, + D2AAC046055464E500DB518D /* libjucedebug.a */, ); name = Products; sourceTree = ""; @@ -1254,11 +1273,12 @@ 841B22CD0D2E7FE3009D01AA /* formats */ = { isa = PBXGroup; children = ( - 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.cpp */, + 841B22CE0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.mm */, 841B22CF0D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.h */, 841B22D00D2E7FE3009D01AA /* juce_DirectXPluginFormat.h */, 841B22D10D2E7FE3009D01AA /* juce_LADSPAPluginFormat.h */, - 841B22D20D2E7FE3009D01AA /* juce_VSTPluginFormat.cpp */, + 84CA4AFA0E9BF9EC004CCC0E /* juce_VSTPluginFormat.cpp */, + 84CA4AF30E9BF8B6004CCC0E /* juce_VSTPluginFormat.mm */, 841B22D30D2E7FE3009D01AA /* juce_VSTPluginFormat.h */, ); path = formats; @@ -1320,21 +1340,31 @@ 84A4881C08A22E2400752A2B /* mac specific code */ = { isa = PBXGroup; children = ( - 84F596FF0E23DDBB00E92E85 /* juce_mac_NativeHeaders.h */, - 8463D31F0E1FC25A003B46B2 /* juce_mac_Fonts.mm */, - 8463D3200E1FC25A003B46B2 /* juce_mac_Messaging.mm */, - 8463D3210E1FC25A003B46B2 /* juce_mac_Windowing.mm */, - 84CE8A400DC5D7D600799A0E /* juce_mac_AudioCDBurner.mm */, - 84A4881E08A22E2400752A2B /* juce_mac_CoreAudio.cpp */, - 84A4881F08A22E2400752A2B /* juce_mac_CoreMidi.cpp */, - 84F703220E1E56FB00EB338A /* juce_mac_FileChooser.mm */, - 84A4882108A22E2400752A2B /* juce_mac_Files.cpp */, - 84022DFB0DAE4CB9004CF59A /* juce_mac_HTTPStream.h */, - 84A06BE209CADB06006A43BD /* juce_mac_NamedPipe.cpp */, - 847D06460DD88D1100DF6A61 /* juce_mac_Network.mm */, - 84BE9E1B0DE56DEB00AB8F23 /* juce_mac_SystemStats.mm */, - 84A4882608A22E2400752A2B /* juce_mac_Threads.cpp */, - 848A560A0DDDD3E40041C706 /* juce_mac_WebBrowserComponent.mm */, + 84E024DB0E94028C003E41AF /* juce_mac_AppleRemote.mm */, + 84E024DC0E94028C003E41AF /* juce_mac_AudioCDBurner.mm */, + 84E024DD0E94028C003E41AF /* juce_mac_CoreAudio.cpp */, + 84E024DE0E94028C003E41AF /* juce_mac_CoreMidi.cpp */, + 8435DA410E95527D008FBD1C /* juce_mac_Debugging.mm */, + 84E024DF0E94028C003E41AF /* juce_mac_FileChooser.mm */, + 84E024E00E94028C003E41AF /* juce_mac_Files.mm */, + 84E024E10E94028C003E41AF /* juce_mac_Fonts.mm */, + 84E024E20E94028C003E41AF /* juce_mac_MainMenu.mm */, + 84E024E30E94028C003E41AF /* juce_mac_MessageManager.mm */, + 8435D9640E940A3E008FBD1C /* juce_mac_MiscUtilities.mm */, + 84E024E40E94028C003E41AF /* juce_mac_MouseCursor.mm */, + 84E024E50E94028C003E41AF /* juce_mac_NamedPipe.cpp */, + 84E024E60E94028C003E41AF /* juce_mac_NativeCode.mm */, + 84F8B60C0EB5B9230020D98D /* juce_mac_NativeIncludes.h */, + 84E024E80E94028C003E41AF /* juce_mac_Network.mm */, + 84E024E90E94028C003E41AF /* juce_mac_NSViewComponent.mm */, + 84E024EA0E94028C003E41AF /* juce_mac_NSViewComponentPeer.mm */, + 84E024EB0E94028C003E41AF /* juce_mac_OpenGLComponent.mm */, + 84E024EC0E94028C003E41AF /* juce_mac_QuickTimeMovieComponent.mm */, + 8435D90C0E9406D2008FBD1C /* juce_mac_Strings.mm */, + 84E024ED0E94028C003E41AF /* juce_mac_SystemStats.mm */, + 84E024EE0E94028C003E41AF /* juce_mac_Threads.mm */, + 84E024EF0E94028C003E41AF /* juce_mac_WebBrowserComponent.mm */, + 84E024F00E94028C003E41AF /* juce_posix_SharedCode.h */, ); name = "mac specific code"; path = platform_specific_code; @@ -1694,8 +1724,6 @@ 84A488DF08A22E4900752A2B /* special */ = { isa = PBXGroup; children = ( - 84F1F0630A36CF31008CCC5E /* juce_MagnifierComponent.cpp */, - 84F1F0640A36CF31008CCC5E /* juce_MagnifierComponent.h */, 84198BB3096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.cpp */, 84198BB4096EB9E40022A439 /* juce_AudioDeviceSelectorComponent.h */, 84A488E008A22E4900752A2B /* juce_BubbleComponent.cpp */, @@ -1706,13 +1734,15 @@ 84A488E508A22E4900752A2B /* juce_ColourSelector.h */, 84A488E608A22E4900752A2B /* juce_DropShadower.cpp */, 84A488E708A22E4900752A2B /* juce_DropShadower.h */, + 84F1F0630A36CF31008CCC5E /* juce_MagnifierComponent.cpp */, + 84F1F0640A36CF31008CCC5E /* juce_MagnifierComponent.h */, 84F1B8D809499F1400AD8EDE /* juce_MidiKeyboardComponent.cpp */, 84F1B8D909499F1400AD8EDE /* juce_MidiKeyboardComponent.h */, + 8457783D0E8947C8006D9E4E /* juce_NSViewComponent.h */, 84A488E808A22E4900752A2B /* juce_OpenGLComponent.cpp */, 84A488E908A22E4900752A2B /* juce_OpenGLComponent.h */, 84A488EA08A22E4900752A2B /* juce_PreferencesPanel.cpp */, 84A488EB08A22E4900752A2B /* juce_PreferencesPanel.h */, - 84A488EC08A22E4900752A2B /* juce_QuickTimeMovieComponent.cpp */, 84A488ED08A22E4900752A2B /* juce_QuickTimeMovieComponent.h */, 848A560D0DDDD3FB0041C706 /* juce_WebBrowserComponent.h */, ); @@ -2510,11 +2540,12 @@ 8495BB950D806BDA001D9C0B /* juce_FileInputSource.h in Headers */, 8495BB960D806BDA001D9C0B /* juce_InputSource.h in Headers */, 84581EEB0D9148C500AE1A4C /* juce_QuickTimeAudioFormat.h in Headers */, - 84022DFD0DAE4CB9004CF59A /* juce_mac_HTTPStream.h in Headers */, 848A560E0DDDD3FB0041C706 /* juce_WebBrowserComponent.h in Headers */, 84688AFC0DED58820077FDEA /* juce_AudioProcessorGraph.h in Headers */, 84688AFE0DED58820077FDEA /* juce_AudioProcessorPlayer.h in Headers */, - 84F597000E23DDBB00E92E85 /* juce_mac_NativeHeaders.h in Headers */, + 8457783E0E8947C8006D9E4E /* juce_NSViewComponent.h in Headers */, + 84E025060E94028C003E41AF /* juce_posix_SharedCode.h in Headers */, + 84F8B60D0EB5B9230020D98D /* juce_mac_NativeIncludes.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2535,7 +2566,7 @@ ); name = Juce; productName = Juce; - productReference = D2AAC046055464E500DB518D /* libjuce.a */; + productReference = D2AAC046055464E500DB518D /* libjucedebug.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -2560,10 +2591,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 84A4882908A22E2400752A2B /* juce_mac_CoreAudio.cpp in Sources */, - 84A4882A08A22E2400752A2B /* juce_mac_CoreMidi.cpp in Sources */, - 84A4882C08A22E2400752A2B /* juce_mac_Files.cpp in Sources */, - 84A4883108A22E2400752A2B /* juce_mac_Threads.cpp in Sources */, 84A48A2808A22E4B00752A2B /* juce_Application.cpp in Sources */, 84A48A2A08A22E4B00752A2B /* juce_DeletedAtShutdown.cpp in Sources */, 84A48A2E08A22E4B00752A2B /* juce_AiffAudioFormat.cpp in Sources */, @@ -2634,7 +2661,6 @@ 84A48ACB08A22E4B00752A2B /* juce_DropShadower.cpp in Sources */, 84A48ACD08A22E4B00752A2B /* juce_OpenGLComponent.cpp in Sources */, 84A48ACF08A22E4B00752A2B /* juce_PreferencesPanel.cpp in Sources */, - 84A48AD108A22E4B00752A2B /* juce_QuickTimeMovieComponent.cpp in Sources */, 84A48AD308A22E4B00752A2B /* juce_AlertWindow.cpp in Sources */, 84A48AD508A22E4B00752A2B /* juce_DialogWindow.cpp in Sources */, 84A48ADB08A22E4B00752A2B /* juce_ResizableWindow.cpp in Sources */, @@ -2752,7 +2778,6 @@ 84F5598809CACFF700AC5000 /* juce_NamedPipe.cpp in Sources */, 84A06BAD09CAD6A3006A43BD /* juce_AudioIODevice.cpp in Sources */, 84A06BAE09CAD6A3006A43BD /* juce_AudioIODeviceType.cpp in Sources */, - 84A06BE309CADB06006A43BD /* juce_mac_NamedPipe.cpp in Sources */, 846034DE09CB374E00E255CF /* juce_InterprocessConnection.cpp in Sources */, 846034E009CB374E00E255CF /* juce_InterprocessConnectionServer.cpp in Sources */, 842B63BA09D8508F00255DC7 /* juce_FlacAudioFormat.cpp in Sources */, @@ -2802,8 +2827,7 @@ 84BC4E2A0C8DD38C00FA249B /* juce_AudioProcessor.cpp in Sources */, 84BC4E2C0C8DD38C00FA249B /* juce_AudioProcessorEditor.cpp in Sources */, 84BC4E2F0C8DD38C00FA249B /* juce_GenericAudioProcessorEditor.cpp in Sources */, - 841B22E20D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.cpp in Sources */, - 841B22E60D2E7FE3009D01AA /* juce_VSTPluginFormat.cpp in Sources */, + 841B22E20D2E7FE3009D01AA /* juce_AudioUnitPluginFormat.mm in Sources */, 841B22E80D2E7FE3009D01AA /* juce_AudioPluginFormat.cpp in Sources */, 841B22EA0D2E7FE3009D01AA /* juce_AudioPluginFormatManager.cpp in Sources */, 841B22EC0D2E7FE3009D01AA /* juce_AudioPluginInstance.cpp in Sources */, @@ -2815,16 +2839,32 @@ 8495BB8E0D8067B2001D9C0B /* juce_AudioThumbnailCache.cpp in Sources */, 8495BB940D806BDA001D9C0B /* juce_FileInputSource.cpp in Sources */, 84581EEA0D9148C500AE1A4C /* juce_QuickTimeAudioFormat.cpp in Sources */, - 84CE8A410DC5D7D600799A0E /* juce_mac_AudioCDBurner.mm in Sources */, - 847D06470DD88D1100DF6A61 /* juce_mac_Network.mm in Sources */, - 848A560B0DDDD3E40041C706 /* juce_mac_WebBrowserComponent.mm in Sources */, - 84BE9E1C0DE56DEB00AB8F23 /* juce_mac_SystemStats.mm in Sources */, 84688AFB0DED58820077FDEA /* juce_AudioProcessorGraph.cpp in Sources */, 84688AFD0DED58820077FDEA /* juce_AudioProcessorPlayer.cpp in Sources */, - 84F703230E1E56FB00EB338A /* juce_mac_FileChooser.mm in Sources */, - 8463D3220E1FC25A003B46B2 /* juce_mac_Fonts.mm in Sources */, - 8463D3230E1FC25A003B46B2 /* juce_mac_Messaging.mm in Sources */, - 8463D3240E1FC25A003B46B2 /* juce_mac_Windowing.mm in Sources */, + 84E024F10E94028C003E41AF /* juce_mac_AppleRemote.mm in Sources */, + 84E024F20E94028C003E41AF /* juce_mac_AudioCDBurner.mm in Sources */, + 84E024F30E94028C003E41AF /* juce_mac_CoreAudio.cpp in Sources */, + 84E024F40E94028C003E41AF /* juce_mac_CoreMidi.cpp in Sources */, + 84E024F50E94028C003E41AF /* juce_mac_FileChooser.mm in Sources */, + 84E024F60E94028C003E41AF /* juce_mac_Files.mm in Sources */, + 84E024F70E94028C003E41AF /* juce_mac_Fonts.mm in Sources */, + 84E024F80E94028C003E41AF /* juce_mac_MainMenu.mm in Sources */, + 84E024F90E94028C003E41AF /* juce_mac_MessageManager.mm in Sources */, + 84E024FA0E94028C003E41AF /* juce_mac_MouseCursor.mm in Sources */, + 84E024FB0E94028C003E41AF /* juce_mac_NamedPipe.cpp in Sources */, + 84E024FC0E94028C003E41AF /* juce_mac_NativeCode.mm in Sources */, + 84E024FE0E94028C003E41AF /* juce_mac_Network.mm in Sources */, + 84E024FF0E94028C003E41AF /* juce_mac_NSViewComponent.mm in Sources */, + 84E025000E94028C003E41AF /* juce_mac_NSViewComponentPeer.mm in Sources */, + 84E025010E94028C003E41AF /* juce_mac_OpenGLComponent.mm in Sources */, + 84E025020E94028C003E41AF /* juce_mac_QuickTimeMovieComponent.mm in Sources */, + 84E025030E94028C003E41AF /* juce_mac_SystemStats.mm in Sources */, + 84E025040E94028C003E41AF /* juce_mac_Threads.mm in Sources */, + 84E025050E94028C003E41AF /* juce_mac_WebBrowserComponent.mm in Sources */, + 8435D90D0E9406D2008FBD1C /* juce_mac_Strings.mm in Sources */, + 8435D9650E940A3E008FBD1C /* juce_mac_MiscUtilities.mm in Sources */, + 8435DA420E95527D008FBD1C /* juce_mac_Debugging.mm in Sources */, + 84CA4AF40E9BF8B6004CCC0E /* juce_VSTPluginFormat.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2834,25 +2874,32 @@ 84A487F808A22DD800752A2B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; name = Debug; }; 84A487F908A22DD800752A2B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; + MACOSX_DEPLOYMENT_TARGET_ppc = 10.3; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; STRIP_STYLE = "non-global"; }; name = Release; }; 84A487FC08A22DD800752A2B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 842B64EA09D87B7900255DC7 /* juce.xcconfig */; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; COPY_PHASE_STRIP = NO; DEPLOYMENT_LOCATION = YES; DSTROOT = ../../bin; - GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "_DEBUG=1", @@ -2869,13 +2916,11 @@ }; 84A487FD08A22DD800752A2B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 842B64EA09D87B7900255DC7 /* juce.xcconfig */; buildSettings = { CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; DEPLOYMENT_LOCATION = YES; DSTROOT = ../../bin; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; GCC_PREPROCESSOR_DEFINITIONS = ( "_NDEBUG=1", "NDEBUG=1", diff --git a/build/macosx/juce.xcconfig b/build/macosx/juce.xcconfig index 8956b4872e..f1a05766fa 100644 --- a/build/macosx/juce.xcconfig +++ b/build/macosx/juce.xcconfig @@ -1,14 +1,14 @@ - -ARCHS = i386 ppc - -// These settings let you build for compatibility with 10.3 onwards. - -MACOSX_DEPLOYMENT_TARGET_ppc = 10.3 -MACOSX_DEPLOYMENT_TARGET = 10.4 - -// In XCode 3, this is the best SDK to use.. -SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk - -// (if you're building in XCode 2.5, you might need to use this line -// instead of the 10.5 line above..) -//SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk + +ARCHS = i386 ppc + +// These settings let you build for compatibility with 10.3 onwards. + +MACOSX_DEPLOYMENT_TARGET_ppc = 10.3 +MACOSX_DEPLOYMENT_TARGET = 10.4 + +// In XCode 3, this is the best SDK to use.. +SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk + +// (if you're building in XCode 2.5, you might need to use this line +// instead of the 10.5 line above..) +//SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk diff --git a/build/macosx/platform_specific_code/juce_mac_AppleRemote.mm b/build/macosx/platform_specific_code/juce_mac_AppleRemote.mm new file mode 100644 index 0000000000..8d6ae47359 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_AppleRemote.mm @@ -0,0 +1,278 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +AppleRemoteDevice::AppleRemoteDevice() + : device (0), + queue (0), + remoteId (0) +{ +} + +AppleRemoteDevice::~AppleRemoteDevice() +{ + stop(); +} + +static io_object_t getAppleRemoteDevice() throw() +{ + CFMutableDictionaryRef dict = IOServiceMatching ("AppleIRController"); + + io_iterator_t iter = 0; + io_object_t iod = 0; + + if (IOServiceGetMatchingServices (kIOMasterPortDefault, dict, &iter) == kIOReturnSuccess + && iter != 0) + { + iod = IOIteratorNext (iter); + } + + IOObjectRelease (iter); + return iod; +} + +static bool createAppleRemoteInterface (io_object_t iod, void** device) throw() +{ + jassert (*device == 0); + io_name_t classname; + + if (IOObjectGetClass (iod, classname) == kIOReturnSuccess) + { + IOCFPlugInInterface** cfPlugInInterface = 0; + SInt32 score = 0; + + if (IOCreatePlugInInterfaceForService (iod, + kIOHIDDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, + &cfPlugInInterface, + &score) == kIOReturnSuccess) + { + HRESULT hr = (*cfPlugInInterface)->QueryInterface (cfPlugInInterface, + CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), + device); + + (void) hr; + + (*cfPlugInInterface)->Release (cfPlugInInterface); + } + } + + return *device != 0; +} + +bool AppleRemoteDevice::start (const bool inExclusiveMode) throw() +{ + if (queue != 0) + return true; + + stop(); + + bool result = false; + io_object_t iod = getAppleRemoteDevice(); + + if (iod != 0) + { + if (createAppleRemoteInterface (iod, &device) && open (inExclusiveMode)) + result = true; + else + stop(); + + IOObjectRelease (iod); + } + + return result; +} + +void AppleRemoteDevice::stop() throw() +{ + if (queue != 0) + { + (*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue); + (*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue); + (*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue); + queue = 0; + } + + if (device != 0) + { + (*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device); + (*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device); + device = 0; + } +} + +bool AppleRemoteDevice::isActive() const throw() +{ + return queue != 0; +} + +static void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*) +{ + if (result == kIOReturnSuccess) + ((AppleRemoteDevice*) target)->handleCallbackInternal(); +} + +bool AppleRemoteDevice::open (const bool openInExclusiveMode) throw() +{ +#if ! MACOS_10_2_OR_EARLIER + Array cookies; + + CFArrayRef elements; + IOHIDDeviceInterface122** const device122 = (IOHIDDeviceInterface122**) device; + + if ((*device122)->copyMatchingElements (device122, 0, &elements) != kIOReturnSuccess) + return false; + + for (int i = 0; i < CFArrayGetCount (elements); ++i) + { + CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); + + // get the cookie + CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); + + if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID()) + continue; + + long number; + if (! CFNumberGetValue ((CFNumberRef) object, kCFNumberLongType, &number)) + continue; + + cookies.add ((int) number); + } + + CFRelease (elements); + + if ((*(IOHIDDeviceInterface**) device) + ->open ((IOHIDDeviceInterface**) device, + openInExclusiveMode ? kIOHIDOptionsTypeSeizeDevice + : kIOHIDOptionsTypeNone) == KERN_SUCCESS) + { + queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); + + if (queue != 0) + { + (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); + + for (int i = 0; i < cookies.size(); ++i) + { + IOHIDElementCookie cookie = (IOHIDElementCookie) cookies.getUnchecked(i); + (*(IOHIDQueueInterface**) queue)->addElement ((IOHIDQueueInterface**) queue, cookie, 0); + } + + CFRunLoopSourceRef eventSource; + + if ((*(IOHIDQueueInterface**) queue) + ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) + { + if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, + appleRemoteQueueCallback, this, 0) == KERN_SUCCESS) + { + CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); + + (*(IOHIDQueueInterface**) queue)->start ((IOHIDQueueInterface**) queue); + + return true; + } + } + } + } +#endif + + return false; +} + +void AppleRemoteDevice::handleCallbackInternal() +{ +#if ! MACOS_10_2_OR_EARLIER + int totalValues = 0; + AbsoluteTime nullTime = { 0, 0 }; + char cookies [12]; + int numCookies = 0; + + while (numCookies < numElementsInArray (cookies)) + { + IOHIDEventStruct e; + + if ((*(IOHIDQueueInterface**) queue)->getNextEvent ((IOHIDQueueInterface**) queue, &e, nullTime, 0) != kIOReturnSuccess) + break; + + if ((int) e.elementCookie == 19) + { + remoteId = e.value; + buttonPressed (switched, false); + } + else + { + totalValues += e.value; + cookies [numCookies++] = (char) (pointer_sized_int) e.elementCookie; + } + } + + cookies [numCookies++] = 0; + //DBG (String::toHexString ((uint8*) cookies, numCookies, 1) + " " + String (totalValues)); + + static const char buttonPatterns[] = + { + 0x1f, 0x14, 0x12, 0x1f, 0x14, 0x12, 0, + 0x1f, 0x15, 0x12, 0x1f, 0x15, 0x12, 0, + 0x1f, 0x1d, 0x1c, 0x12, 0, + 0x1f, 0x1e, 0x1c, 0x12, 0, + 0x1f, 0x16, 0x12, 0x1f, 0x16, 0x12, 0, + 0x1f, 0x17, 0x12, 0x1f, 0x17, 0x12, 0, + 0x1f, 0x12, 0x04, 0x02, 0, + 0x1f, 0x12, 0x03, 0x02, 0, + 0x1f, 0x12, 0x1f, 0x12, 0, + 0x23, 0x1f, 0x12, 0x23, 0x1f, 0x12, 0, + 19, 0 + }; + + int buttonNum = (int) menuButton; + int i = 0; + + while (i < numElementsInArray (buttonPatterns)) + { + if (strcmp (cookies, buttonPatterns + i) == 0) + { + buttonPressed ((ButtonType) buttonNum, totalValues > 0); + break; + } + + i += strlen (buttonPatterns + i) + 1; + ++buttonNum; + } +#endif +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm b/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm index a8752bf1f3..5b371ff47a 100644 --- a/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm +++ b/build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm @@ -1,448 +1,432 @@ -/* - ============================================================================== - - 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 "juce_mac_NativeHeaders.h" - -#if JUCE_USE_CDBURNER - -#import - -BEGIN_JUCE_NAMESPACE - #include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h" - #include "../../../src/juce_appframework/audio/audio_sources/juce_AudioSource.h" - #include "../../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.h" - #include "../../../src/juce_core/threads/juce_Thread.h" -END_JUCE_NAMESPACE - - -//============================================================================== -@interface OpenDiskDevice : NSObject -{ - DRDevice* device; - - NSMutableArray* tracks; -} - -- (OpenDiskDevice*) initWithDevice: (DRDevice*) device; -- (void) dealloc; -- (bool) isDiskPresent; -- (int) getNumAvailableAudioBlocks; -- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; -- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error - ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; -@end - -//============================================================================== -@interface AudioTrackProducer : NSObject -{ - JUCE_NAMESPACE::AudioSource* source; - int readPosition, lengthInFrames; -} - -- (AudioTrackProducer*) init: (int) lengthInFrames; -- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; -- (void) dealloc; -- (void) setupTrackProperties: (DRTrack*) track; - -- (void) cleanupTrackAfterBurn: (DRTrack*) track; -- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track; -- (uint64_t) estimateLengthOfTrack:(DRTrack*)track; -- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn - toMedia:(NSDictionary*)mediaInfo; -- (BOOL) prepareTrackForVerification:(DRTrack*)track; -- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags; -- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags; -@end - -//============================================================================== -@implementation OpenDiskDevice - -- (OpenDiskDevice*) initWithDevice: (DRDevice*) device_ -{ - [super init]; - - device = device_; - tracks = [[NSMutableArray alloc] init]; - return self; -} - -- (void) dealloc -{ - [tracks release]; - [super dealloc]; -} - -- (bool) isDiskPresent -{ - return [device isValid] - && [[[device status] objectForKey: DRDeviceMediaStateKey] - isEqualTo: DRDeviceMediaStateMediaPresent]; -} - -- (int) getNumAvailableAudioBlocks -{ - return [[[[device status] objectForKey: DRDeviceMediaInfoKey] - objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; -} - -- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ -{ - AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; - DRTrack* t = [[DRTrack alloc] initWithProducer: p]; - [p setupTrackProperties: t]; - - [tracks addObject: t]; - - [t release]; - [p release]; -} - -- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error - ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting -{ - DRBurn* burn = [DRBurn burnForDevice: device]; - - if (! [device acquireExclusiveAccess]) - { - *error = "Couldn't open or write to the CD device"; - return; - } - - [device acquireMediaReservation]; - - NSMutableDictionary* d = [[burn properties] mutableCopy]; - [d autorelease]; - [d setObject: [NSNumber numberWithBool: peformFakeBurnForTesting] forKey: DRBurnTestingKey]; - [d setObject: [NSNumber numberWithBool: false] forKey: DRBurnVerifyDiscKey]; - [d setObject: (shouldEject ? DRBurnCompletionActionEject : DRBurnCompletionActionMount) - forKey: DRBurnCompletionActionKey]; - [burn setProperties: d]; - - [burn writeLayout: tracks]; - - for (;;) - { - JUCE_NAMESPACE::Thread::sleep (300); - float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; - -NSLog ([[burn status] description]); - - if (listener != 0 && listener->audioCDBurnProgress (progress)) - { - [burn abort]; - *error = "User cancelled the write operation"; - break; - } - - if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateFailed]) - { - *error = "Write operation failed"; - break; - } - else if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateDone]) - { - break; - } - - NSString* err = (NSString*) [[[burn status] objectForKey: DRErrorStatusKey] - objectForKey: DRErrorStatusErrorStringKey]; - - if ([err length] > 0) - { - *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); - break; - } - } - - [device releaseMediaReservation]; - [device releaseExclusiveAccess]; -} -@end - -//============================================================================== -@implementation AudioTrackProducer - -- (AudioTrackProducer*) init: (int) lengthInFrames_ -{ - lengthInFrames = lengthInFrames_; - readPosition = 0; - return self; -} - -- (void) setupTrackProperties: (DRTrack*) track -{ - NSMutableDictionary* p = [[track properties] mutableCopy]; - [p setObject:[DRMSF msfWithFrames: lengthInFrames] forKey: DRTrackLengthKey]; - [p setObject:[NSNumber numberWithUnsignedShort:2352] forKey: DRBlockSizeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRDataFormKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRBlockTypeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRTrackModeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRSessionFormatKey]; - - - [track setProperties: p]; - [p release]; -} - -- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples -{ - AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; - - if (s != nil) - s->source = source_; - - return s; -} - -- (void) dealloc -{ - if (source != 0) - { - source->releaseResources(); - delete source; - } - - [super dealloc]; -} - -- (void) cleanupTrackAfterBurn: (DRTrack*) track -{ -} - -- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track -{ - return true; -} - -- (uint64_t) estimateLengthOfTrack:(DRTrack*)track -{ - return lengthInFrames; -} - -- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn - toMedia:(NSDictionary*)mediaInfo -{ - if (source != 0) - source->prepareToPlay (44100 / 75, 44100); - - readPosition = 0; - return true; -} - -- (BOOL) prepareTrackForVerification:(DRTrack*)track -{ - if (source != 0) - source->prepareToPlay (44100 / 75, 44100); - - return true; -} - -- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags -{ - if (source != 0) - { - const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); - - if (numSamples > 0) - { - JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); - - JUCE_NAMESPACE::AudioSourceChannelInfo info; - info.buffer = &tempBuffer; - info.startSample = 0; - info.numSamples = numSamples; - - source->getNextAudioBlock (info); - - JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), - buffer, numSamples, 4); - JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), - buffer + 2, numSamples, 4); - - readPosition += numSamples; - } - - return numSamples * 4; - } - - return 0; -} - -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags -{ - zeromem (buffer, bufferLength); - return bufferLength; -} - -- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags -{ - return true; -} - -@end - - -BEGIN_JUCE_NAMESPACE - -//============================================================================== -AudioCDBurner::AudioCDBurner (const int deviceIndex) - : internal (0) -{ - const AutoPool pool; - OpenDiskDevice* dev = [[OpenDiskDevice alloc] initWithDevice: [[DRDevice devices] objectAtIndex: deviceIndex]]; - - internal = (void*) dev; -} - -AudioCDBurner::~AudioCDBurner() -{ - const AutoPool pool; - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - if (dev != 0) - [dev release]; -} - -AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) -{ - const AutoPool pool; - AudioCDBurner* b = new AudioCDBurner (deviceIndex); - - if (b->internal == 0) - deleteAndZero (b); - - return b; -} - -static NSArray* findDiskBurnerDevices() -{ - NSMutableArray* results = [NSMutableArray array]; - NSArray* devs = [DRDevice devices]; - - if (devs != 0) - { - int num = [devs count]; - int i; - for (i = 0; i < num; ++i) - { - NSDictionary* dic = [[devs objectAtIndex: i] info]; - NSString* name = [dic valueForKey: DRDeviceProductNameKey]; - if (name != nil) - [results addObject: name]; - } - } - - return results; -} - -const StringArray AudioCDBurner::findAvailableDevices() -{ - const AutoPool pool; - NSArray* names = findDiskBurnerDevices(); - StringArray s; - - for (int i = 0; i < [names count]; ++i) - s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); - - return s; -} - -bool AudioCDBurner::isDiskPresent() const -{ - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - return dev != 0 && [dev isDiskPresent]; -} - -int AudioCDBurner::getNumAvailableAudioBlocks() const -{ - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - return [dev getNumAvailableAudioBlocks]; -} - -bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) -{ - const AutoPool pool; - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - if (dev != 0) - { - [dev addSourceTrack: source numSamples: numSamps]; - return true; - } - - return false; -} - -const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, - const bool ejectDiscAfterwards, - const bool peformFakeBurnForTesting) -{ - const AutoPool pool; - JUCE_NAMESPACE::String error ("Couldn't open or write to the CD device"); - - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - if (dev != 0) - { - error = JUCE_NAMESPACE::String::empty; - [dev burn: listener - errorString: &error - ejectAfterwards: ejectDiscAfterwards - isFake: peformFakeBurnForTesting]; - } - - return error; -} - -END_JUCE_NAMESPACE - -#endif +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_USE_CDBURNER + +//============================================================================== +END_JUCE_NAMESPACE + +@interface OpenDiskDevice : NSObject +{ + DRDevice* device; + + NSMutableArray* tracks; +} + +- (OpenDiskDevice*) initWithDevice: (DRDevice*) device; +- (void) dealloc; +- (bool) isDiskPresent; +- (int) getNumAvailableAudioBlocks; +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error + ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; +@end + +//============================================================================== +@interface AudioTrackProducer : NSObject +{ + JUCE_NAMESPACE::AudioSource* source; + int readPosition, lengthInFrames; +} + +- (AudioTrackProducer*) init: (int) lengthInFrames; +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; +- (void) dealloc; +- (void) setupTrackProperties: (DRTrack*) track; + +- (void) cleanupTrackAfterBurn: (DRTrack*) track; +- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track; +- (uint64_t) estimateLengthOfTrack:(DRTrack*)track; +- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn + toMedia:(NSDictionary*)mediaInfo; +- (BOOL) prepareTrackForVerification:(DRTrack*)track; +- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer + length:(uint32_t)bufferLength atAddress:(uint64_t)address + blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; +- (uint32_t) producePreGapForTrack:(DRTrack*)track + intoBuffer:(char*)buffer length:(uint32_t)bufferLength + atAddress:(uint64_t)address blockSize:(uint32_t)blockSize + ioFlags:(uint32_t*)flags; +- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer + length:(uint32_t)bufferLength atAddress:(uint64_t)address + blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; +- (uint32_t) producePreGapForTrack:(DRTrack*)track + intoBuffer:(char*)buffer length:(uint32_t)bufferLength + atAddress:(uint64_t)address blockSize:(uint32_t)blockSize + ioFlags:(uint32_t*)flags; +@end + +//============================================================================== +@implementation OpenDiskDevice + +- (OpenDiskDevice*) initWithDevice: (DRDevice*) device_ +{ + [super init]; + + device = device_; + tracks = [[NSMutableArray alloc] init]; + return self; +} + +- (void) dealloc +{ + [tracks release]; + [super dealloc]; +} + +- (bool) isDiskPresent +{ + return [device isValid] + && [[[device status] objectForKey: DRDeviceMediaStateKey] + isEqualTo: DRDeviceMediaStateMediaPresent]; +} + +- (int) getNumAvailableAudioBlocks +{ + return [[[[device status] objectForKey: DRDeviceMediaInfoKey] + objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; +} + +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ +{ + AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; + DRTrack* t = [[DRTrack alloc] initWithProducer: p]; + [p setupTrackProperties: t]; + + [tracks addObject: t]; + + [t release]; + [p release]; +} + +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error + ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting +{ + DRBurn* burn = [DRBurn burnForDevice: device]; + + if (! [device acquireExclusiveAccess]) + { + *error = "Couldn't open or write to the CD device"; + return; + } + + [device acquireMediaReservation]; + + NSMutableDictionary* d = [[burn properties] mutableCopy]; + [d autorelease]; + [d setObject: [NSNumber numberWithBool: peformFakeBurnForTesting] forKey: DRBurnTestingKey]; + [d setObject: [NSNumber numberWithBool: false] forKey: DRBurnVerifyDiscKey]; + [d setObject: (shouldEject ? DRBurnCompletionActionEject : DRBurnCompletionActionMount) + forKey: DRBurnCompletionActionKey]; + [burn setProperties: d]; + + [burn writeLayout: tracks]; + + for (;;) + { + JUCE_NAMESPACE::Thread::sleep (300); + float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; + +NSLog ([[burn status] description]); + + if (listener != 0 && listener->audioCDBurnProgress (progress)) + { + [burn abort]; + *error = "User cancelled the write operation"; + break; + } + + if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateFailed]) + { + *error = "Write operation failed"; + break; + } + else if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateDone]) + { + break; + } + + NSString* err = (NSString*) [[[burn status] objectForKey: DRErrorStatusKey] + objectForKey: DRErrorStatusErrorStringKey]; + + if ([err length] > 0) + { + *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); + break; + } + } + + [device releaseMediaReservation]; + [device releaseExclusiveAccess]; +} +@end + +//============================================================================== +@implementation AudioTrackProducer + +- (AudioTrackProducer*) init: (int) lengthInFrames_ +{ + lengthInFrames = lengthInFrames_; + readPosition = 0; + return self; +} + +- (void) setupTrackProperties: (DRTrack*) track +{ + NSMutableDictionary* p = [[track properties] mutableCopy]; + [p setObject:[DRMSF msfWithFrames: lengthInFrames] forKey: DRTrackLengthKey]; + [p setObject:[NSNumber numberWithUnsignedShort:2352] forKey: DRBlockSizeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRDataFormKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRBlockTypeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRTrackModeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRSessionFormatKey]; + + + [track setProperties: p]; + [p release]; +} + +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples +{ + AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; + + if (s != nil) + s->source = source_; + + return s; +} + +- (void) dealloc +{ + if (source != 0) + { + source->releaseResources(); + delete source; + } + + [super dealloc]; +} + +- (void) cleanupTrackAfterBurn: (DRTrack*) track +{ +} + +- (BOOL) cleanupTrackAfterVerification: (DRTrack*) track +{ + return true; +} + +- (uint64_t) estimateLengthOfTrack: (DRTrack*) track +{ + return lengthInFrames; +} + +- (BOOL) prepareTrack: (DRTrack*) track forBurn: (DRBurn*) burn + toMedia: (NSDictionary*) mediaInfo +{ + if (source != 0) + source->prepareToPlay (44100 / 75, 44100); + + readPosition = 0; + return true; +} + +- (BOOL) prepareTrackForVerification: (DRTrack*) track +{ + if (source != 0) + source->prepareToPlay (44100 / 75, 44100); + + return true; +} + +- (uint32_t) produceDataForTrack: (DRTrack*) track intoBuffer: (char*) buffer + length: (uint32_t) bufferLength atAddress: (uint64_t) address + blockSize: (uint32_t) blockSize ioFlags: (uint32_t*) flags +{ + if (source != 0) + { + const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); + + if (numSamples > 0) + { + JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); + + JUCE_NAMESPACE::AudioSourceChannelInfo info; + info.buffer = &tempBuffer; + info.startSample = 0; + info.numSamples = numSamples; + + source->getNextAudioBlock (info); + + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), + buffer, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), + buffer + 2, numSamples, 4); + + readPosition += numSamples; + } + + return numSamples * 4; + } + + return 0; +} + +- (uint32_t) producePreGapForTrack: (DRTrack*) track + intoBuffer: (char*) buffer length: (uint32_t) bufferLength + atAddress: (uint64_t) address blockSize: (uint32_t) blockSize + ioFlags: (uint32_t*) flags +{ + zeromem (buffer, bufferLength); + return bufferLength; +} + +- (BOOL) verifyDataForTrack: (DRTrack*) track inBuffer: (const char*) buffer + length: (uint32_t) bufferLength atAddress: (uint64_t) address + blockSize: (uint32_t) blockSize ioFlags: (uint32_t*) flags +{ + return true; +} + +@end + + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +AudioCDBurner::AudioCDBurner (const int deviceIndex) + : internal (0) +{ + OpenDiskDevice* dev = [[OpenDiskDevice alloc] initWithDevice: [[DRDevice devices] objectAtIndex: deviceIndex]]; + + internal = (void*) dev; +} + +AudioCDBurner::~AudioCDBurner() +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + if (dev != 0) + [dev release]; +} + +AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) +{ + AudioCDBurner* b = new AudioCDBurner (deviceIndex); + + if (b->internal == 0) + deleteAndZero (b); + + return b; +} + +static NSArray* findDiskBurnerDevices() +{ + NSMutableArray* results = [NSMutableArray array]; + NSArray* devs = [DRDevice devices]; + + if (devs != 0) + { + int num = [devs count]; + int i; + for (i = 0; i < num; ++i) + { + NSDictionary* dic = [[devs objectAtIndex: i] info]; + NSString* name = [dic valueForKey: DRDeviceProductNameKey]; + if (name != nil) + [results addObject: name]; + } + } + + return results; +} + +const StringArray AudioCDBurner::findAvailableDevices() +{ + NSArray* names = findDiskBurnerDevices(); + StringArray s; + + for (int i = 0; i < [names count]; ++i) + s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); + + return s; +} + +bool AudioCDBurner::isDiskPresent() const +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + return dev != 0 && [dev isDiskPresent]; +} + +int AudioCDBurner::getNumAvailableAudioBlocks() const +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + return [dev getNumAvailableAudioBlocks]; +} + +bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + if (dev != 0) + { + [dev addSourceTrack: source numSamples: numSamps]; + return true; + } + + return false; +} + +const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, + const bool ejectDiscAfterwards, + const bool peformFakeBurnForTesting) +{ + String error ("Couldn't open or write to the CD device"); + + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + if (dev != 0) + { + error = String::empty; + [dev burn: listener + errorString: &error + ejectAfterwards: ejectDiscAfterwards + isFake: peformFakeBurnForTesting]; + } + + return error; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp b/build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp index 196c69de2a..998a813dc1 100644 --- a/build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp +++ b/build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp @@ -1,1291 +1,1299 @@ -/* - ============================================================================== - - 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 "../../../src/juce_core/basics/juce_StandardHeader.h" -#include - -BEGIN_JUCE_NAMESPACE - - -#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/text/juce_LocalisedStrings.h" -#include "../../../src/juce_appframework/gui/components/buttons/juce_TextButton.h" -#include "../../../src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h" -#include "../../../src/juce_appframework/gui/components/controls/juce_ComboBox.h" -#include "../../../src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.h" -#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" - - -//============================================================================== -#ifndef JUCE_COREAUDIO_ERROR_LOGGING_ENABLED - #define JUCE_COREAUDIO_ERROR_LOGGING_ENABLED 1 -#endif - -//============================================================================== -#undef log -#if JUCE_COREAUDIO_LOGGING_ENABLED - #define log(a) Logger::writeToLog (a) -#else - #define log(a) -#endif - -#undef OK -#if JUCE_COREAUDIO_ERROR_LOGGING_ENABLED - static bool logAnyErrors_CoreAudio (const OSStatus err, const int lineNum) - { - if (err == noErr) - return true; - - Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); - jassertfalse - return false; - } - - #define OK(a) logAnyErrors_CoreAudio (a, __LINE__) -#else - #define OK(a) (a == noErr) -#endif - -//============================================================================== -static const int maxNumChans = 96; - - -//============================================================================== -class CoreAudioInternal : public Timer -{ -public: - //============================================================================== - CoreAudioInternal (AudioDeviceID id) - : deviceID (id), - started (false), - audioBuffer (0), - numInputChans (0), - numOutputChans (0), - callbacksAllowed (true), - numInputChannelInfos (0), - numOutputChannelInfos (0), - inputLatency (0), - outputLatency (0), - callback (0), - inputDevice (0), - isSlaveDevice (false) - { - sampleRate = 0; - bufferSize = 512; - - if (deviceID == 0) - { - error = TRANS("can't open device"); - } - else - { - updateDetailsFromDevice(); - - AudioDeviceAddPropertyListener (deviceID, - kAudioPropertyWildcardChannel, - kAudioPropertyWildcardSection, - kAudioPropertyWildcardPropertyID, - deviceListenerProc, this); - } - } - - ~CoreAudioInternal() - { - AudioDeviceRemovePropertyListener (deviceID, - kAudioPropertyWildcardChannel, - kAudioPropertyWildcardSection, - kAudioPropertyWildcardPropertyID, - deviceListenerProc); - - stop (false); - - juce_free (audioBuffer); - delete inputDevice; - } - - void setTempBufferSize (const int numChannels, const int numSamples) - { - juce_free (audioBuffer); - - audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float)); - - zeromem (tempInputBuffers, sizeof (tempInputBuffers)); - zeromem (tempOutputBuffers, sizeof (tempOutputBuffers)); - - int count = 0; - int i; - for (i = 0; i < numInputChans; ++i) - tempInputBuffers[i] = audioBuffer + count++ * numSamples; - - for (i = 0; i < numOutputChans; ++i) - tempOutputBuffers[i] = audioBuffer + count++ * numSamples; - } - - // returns the number of actual available channels - void fillInChannelInfo (bool input) - { - int chanNum = 0, activeChans = 0; - UInt32 size; - - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) - { - AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) - { - const int numStreams = bufList->mNumberBuffers; - - for (int i = 0; i < numStreams; ++i) - { - const AudioBuffer& b = bufList->mBuffers[i]; - - for (unsigned int j = 0; j < b.mNumberChannels; ++j) - { - if (input) - { - if (activeInputChans[chanNum]) - { - inputChannelInfo [activeChans].sourceChannelNum = chanNum; - inputChannelInfo [activeChans].streamNum = i; - inputChannelInfo [activeChans].dataOffsetSamples = j; - inputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; - ++activeChans; - numInputChannelInfos = activeChans; - } - - inChanNames.add (T("input ") + String (chanNum + 1)); - } - else - { - if (activeOutputChans[chanNum]) - { - outputChannelInfo [activeChans].sourceChannelNum = chanNum; - outputChannelInfo [activeChans].streamNum = i; - outputChannelInfo [activeChans].dataOffsetSamples = j; - outputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; - ++activeChans; - numOutputChannelInfos = activeChans; - } - - outChanNames.add (T("output ") + String (chanNum + 1)); - } - - ++chanNum; - } - } - } - - juce_free (bufList); - } - } - - void updateDetailsFromDevice() - { - stopTimer(); - - if (deviceID == 0) - return; - - const ScopedLock sl (callbackLock); - - Float64 sr; - UInt32 size = sizeof (Float64); - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyNominalSampleRate, &size, &sr))) - sampleRate = sr; - - UInt32 framesPerBuf; - size = sizeof (framesPerBuf); - - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf))) - { - bufferSize = framesPerBuf; - - if (bufferSize > 0) - setTempBufferSize (numInputChans + numOutputChans, bufferSize); - } - - bufferSizes.clear(); - - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, 0))) - { - AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, ranges))) - { - bufferSizes.add ((int) ranges[0].mMinimum); - - for (int i = 32; i < 8192; i += 32) - { - for (int j = size / sizeof (AudioValueRange); --j >= 0;) - { - if (i >= ranges[j].mMinimum && i <= ranges[j].mMaximum) - { - bufferSizes.addIfNotAlreadyThere (i); - break; - } - } - } - - if (bufferSize > 0) - bufferSizes.addIfNotAlreadyThere (bufferSize); - } - - juce_free (ranges); - } - - if (bufferSizes.size() == 0 && bufferSize > 0) - bufferSizes.add (bufferSize); - - sampleRates.clear(); - const double possibleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; - String rates; - - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, 0))) - { - AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, ranges))) - { - for (int i = 0; i < numElementsInArray (possibleRates); ++i) - { - bool ok = false; - - for (int j = size / sizeof (AudioValueRange); --j >= 0;) - if (possibleRates[i] >= ranges[j].mMinimum - 2 && possibleRates[i] <= ranges[j].mMaximum + 2) - ok = true; - - if (ok) - { - sampleRates.add (possibleRates[i]); - rates << possibleRates[i] << T(" "); - } - } - } - - juce_free (ranges); - } - - if (sampleRates.size() == 0 && sampleRate > 0) - { - sampleRates.add (sampleRate); - rates << sampleRate; - } - - log (T("sr: ") + rates); - - inputLatency = 0; - outputLatency = 0; - UInt32 lat; - size = sizeof (UInt32); - if (AudioDeviceGetProperty (deviceID, 0, true, kAudioDevicePropertyLatency, &size, &lat) == noErr) - inputLatency = (int) lat; - - if (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyLatency, &size, &lat) == noErr) - outputLatency = (int) lat; - - log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); - - inChanNames.clear(); - outChanNames.clear(); - - zeromem (inputChannelInfo, sizeof (inputChannelInfo)); - zeromem (outputChannelInfo, sizeof (outputChannelInfo)); - - fillInChannelInfo (true); - fillInChannelInfo (false); - } - - //============================================================================== - const StringArray getSources (bool input) - { - StringArray s; - int num = 0; - OSType* types = getAllDataSourcesForDevice (deviceID, input, num); - - if (types != 0) - { - for (int i = 0; i < num; ++i) - { - AudioValueTranslation avt; - char buffer[256]; - - avt.mInputData = (void*) &(types[i]); - avt.mInputDataSize = sizeof (UInt32); - avt.mOutputData = buffer; - avt.mOutputDataSize = 256; - - UInt32 transSize = sizeof (avt); - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSourceNameForID, &transSize, &avt))) - { - DBG (buffer); - s.add (buffer); - } - } - - juce_free (types); - } - - return s; - } - - int getCurrentSourceIndex (bool input) const - { - OSType currentSourceID = 0; - UInt32 size = 0; - int result = -1; - - if (deviceID != 0 - && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, 0))) - { - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, ¤tSourceID))) - { - int num = 0; - OSType* const types = getAllDataSourcesForDevice (deviceID, input, num); - - if (types != 0) - { - for (int i = 0; i < num; ++i) - { - if (types[num] == currentSourceID) - { - result = i; - break; - } - } - - juce_free (types); - } - } - } - - return result; - } - - void setCurrentSourceIndex (int index, bool input) - { - if (deviceID != 0) - { - int num = 0; - OSType* types = getAllDataSourcesForDevice (deviceID, input, num); - - if (types != 0) - { - if (((unsigned int) index) < num) - { - OSType typeId = types[index]; - AudioDeviceSetProperty (deviceID, 0, 0, input, kAudioDevicePropertyDataSource, sizeof (typeId), &typeId); - } - - juce_free (types); - } - } - } - - //============================================================================== - const String reopen (const BitArray& inputChannels, - const BitArray& outputChannels, - double newSampleRate, - int bufferSizeSamples) - { - error = String::empty; - log ("CoreAudio reopen"); - callbacksAllowed = false; - stopTimer(); - - stop (false); - - activeInputChans = inputChannels; - activeOutputChans = outputChannels; - - activeInputChans.setRange (inChanNames.size(), - activeInputChans.getHighestBit() + 1 - inChanNames.size(), - false); - - activeOutputChans.setRange (outChanNames.size(), - activeOutputChans.getHighestBit() + 1 - outChanNames.size(), - false); - - numInputChans = activeInputChans.countNumberOfSetBits(); - numOutputChans = activeOutputChans.countNumberOfSetBits(); - - // set sample rate - Float64 sr = newSampleRate; - UInt32 size = sizeof (sr); - OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyNominalSampleRate, size, &sr)); - OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyNominalSampleRate, size, &sr)); - - // change buffer size - UInt32 framesPerBuf = bufferSizeSamples; - size = sizeof (framesPerBuf); - - OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); - OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); - - // wait for the changes to happen (on some devices) - int i = 30; - while (--i >= 0) - { - updateDetailsFromDevice(); - - if (sampleRate == newSampleRate && bufferSizeSamples == bufferSize) - break; - - Thread::sleep (100); - } - - if (i < 0) - error = "Couldn't change sample rate/buffer size"; - - if (sampleRates.size() == 0) - error = "Device has no available sample-rates"; - - if (bufferSizes.size() == 0) - error = "Device has no available buffer-sizes"; - - if (inputDevice != 0 && error.isEmpty()) - error = inputDevice->reopen (inputChannels, - outputChannels, - newSampleRate, - bufferSizeSamples); - - callbacksAllowed = true; - - return error; - } - - bool start (AudioIODeviceCallback* cb) - { - if (! started) - { - callback = 0; - - if (deviceID != 0) - { - if (OK (AudioDeviceAddIOProc (deviceID, audioIOProc, (void*) this))) - { - if (OK (AudioDeviceStart (deviceID, audioIOProc))) - { - started = true; - } - else - { - OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); - } - } - } - } - - if (started) - { - const ScopedLock sl (callbackLock); - callback = cb; - } - - if (inputDevice != 0) - return started && inputDevice->start (cb); - else - return started; - } - - void stop (bool leaveInterruptRunning) - { - callbackLock.enter(); - callback = 0; - callbackLock.exit(); - - if (started - && (deviceID != 0) - && ! leaveInterruptRunning) - { - OK (AudioDeviceStop (deviceID, audioIOProc)); - OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); - started = false; - - callbackLock.enter(); - callbackLock.exit(); - - // wait until it's definately stopped calling back.. - for (int i = 40; --i >= 0;) - { - Thread::sleep (50); - - UInt32 running = 0; - UInt32 size = sizeof (running); - OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyDeviceIsRunning, &size, &running)); - if (running == 0) - break; - } - - callbackLock.enter(); - callbackLock.exit(); - } - - if (inputDevice != 0) - inputDevice->stop (leaveInterruptRunning); - } - - double getSampleRate() const - { - return sampleRate; - } - - int getBufferSize() const - { - return bufferSize; - } - - void audioCallback (const AudioBufferList* inInputData, - AudioBufferList* outOutputData) - { - int i; - const ScopedLock sl (callbackLock); - - if (callback != 0) - { - if (inputDevice == 0) - { - for (i = numInputChans; --i >= 0;) - { - const CallbackDetailsForChannel& info = inputChannelInfo[i]; - float* dest = tempInputBuffers [info.sourceChannelNum]; - const float* src = ((const float*) inInputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; - - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest++ = *src; - src += stride; - } - } - } - } - - if (! isSlaveDevice) - { - if (inputDevice == 0) - { - callback->audioDeviceIOCallback ((const float**) tempInputBuffers, - numInputChans, - tempOutputBuffers, - numOutputChans, - bufferSize); - } - else - { - jassert (inputDevice->bufferSize == bufferSize); - - callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers, - inputDevice->numInputChans, - tempOutputBuffers, - numOutputChans, - bufferSize); - } - - for (i = numOutputChans; --i >= 0;) - { - const CallbackDetailsForChannel& info = outputChannelInfo[i]; - const float* src = tempOutputBuffers [i]; - float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; - - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest = *src++; - dest += stride; - } - } - } - } - } - else - { - for (i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) - { - const CallbackDetailsForChannel& info = outputChannelInfo[i]; - float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; - - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest = 0.0f; - dest += stride; - } - } - } - } - } - - // called by callbacks - void deviceDetailsChanged() - { - if (callbacksAllowed) - startTimer (100); - } - - void timerCallback() - { - stopTimer(); - log ("CoreAudio device changed callback"); - - const double oldSampleRate = sampleRate; - const int oldBufferSize = bufferSize; - updateDetailsFromDevice(); - - if (oldBufferSize != bufferSize || oldSampleRate != sampleRate) - { - callbacksAllowed = false; - stop (false); - updateDetailsFromDevice(); - callbacksAllowed = true; - } - } - - CoreAudioInternal* getRelatedDevice() const - { - UInt32 size = 0; - CoreAudioInternal* result = 0; - - if (deviceID != 0 - && AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, 0) == noErr - && size > 0) - { - AudioDeviceID* devs = (AudioDeviceID*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, devs))) - { - for (unsigned int i = 0; i < size / sizeof (AudioDeviceID); ++i) - { - if (devs[i] != deviceID && devs[i] != 0) - { - result = new CoreAudioInternal (devs[i]); - - if (result->error.isEmpty()) - { - const bool thisIsInput = inChanNames.size() > 0 && outChanNames.size() == 0; - const bool otherIsInput = result->inChanNames.size() > 0 && result->outChanNames.size() == 0; - - if (thisIsInput != otherIsInput - || (inChanNames.size() + outChanNames.size() == 0) - || (result->inChanNames.size() + result->outChanNames.size()) == 0) - break; - } - - deleteAndZero (result); - } - } - } - - juce_free (devs); - } - - return result; - } - - //============================================================================== - juce_UseDebuggingNewOperator - - String error; - int inputLatency, outputLatency; - BitArray activeInputChans, activeOutputChans; - StringArray inChanNames, outChanNames; - Array sampleRates; - Array bufferSizes; - AudioIODeviceCallback* callback; - - CoreAudioInternal* inputDevice; - bool isSlaveDevice; - -private: - CriticalSection callbackLock; - AudioDeviceID deviceID; - bool started; - double sampleRate; - int bufferSize; - float* audioBuffer; - int numInputChans, numOutputChans; - bool callbacksAllowed; - - struct CallbackDetailsForChannel - { - int sourceChannelNum; - int streamNum; - int dataOffsetSamples; - int dataStrideSamples; - }; - - int numInputChannelInfos, numOutputChannelInfos; - CallbackDetailsForChannel inputChannelInfo [maxNumChans]; - CallbackDetailsForChannel outputChannelInfo [maxNumChans]; - float* tempInputBuffers [maxNumChans]; - float* tempOutputBuffers [maxNumChans]; - - CoreAudioInternal (const CoreAudioInternal&); - const CoreAudioInternal& operator= (const CoreAudioInternal&); - - //============================================================================== - static OSStatus audioIOProc (AudioDeviceID inDevice, - const AudioTimeStamp* inNow, - const AudioBufferList* inInputData, - const AudioTimeStamp* inInputTime, - AudioBufferList* outOutputData, - const AudioTimeStamp* inOutputTime, - void* device) - { - ((CoreAudioInternal*) device)->audioCallback (inInputData, outOutputData); - return noErr; - } - - static OSStatus deviceListenerProc (AudioDeviceID inDevice, - UInt32 inLine, - Boolean isInput, - AudioDevicePropertyID inPropertyID, - void* inClientData) - { - CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; - - switch (inPropertyID) - { - case kAudioDevicePropertyBufferSize: - case kAudioDevicePropertyBufferFrameSize: - case kAudioDevicePropertyNominalSampleRate: - case kAudioDevicePropertyStreamFormat: - case kAudioDevicePropertyDeviceIsAlive: - intern->deviceDetailsChanged(); - break; - - case kAudioDevicePropertyBufferSizeRange: - case kAudioDevicePropertyVolumeScalar: - case kAudioDevicePropertyMute: - case kAudioDevicePropertyPlayThru: - case kAudioDevicePropertyDataSource: - case kAudioDevicePropertyDeviceIsRunning: - break; - } - - return noErr; - } - - //============================================================================== - static OSType* getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, int& num) - { - OSType* types = 0; - UInt32 size = 0; - num = 0; - - if (deviceID != 0 - && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, 0))) - { - types = (OSType*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, types))) - { - num = size / sizeof (OSType); - } - else - { - juce_free (types); - types = 0; - } - } - - return types; - } -}; - - -//============================================================================== -class CoreAudioIODevice : public AudioIODevice -{ -public: - CoreAudioIODevice (const String& deviceName, - AudioDeviceID inputDeviceId, - const int inputIndex_, - AudioDeviceID outputDeviceId, - const int outputIndex_) - : AudioIODevice (deviceName, "CoreAudio"), - inputIndex (inputIndex_), - outputIndex (outputIndex_), - isOpen_ (false), - isStarted (false) - { - internal = 0; - CoreAudioInternal* device = 0; - - if (outputDeviceId == 0 || outputDeviceId == inputDeviceId) - { - jassert (inputDeviceId != 0); - - device = new CoreAudioInternal (inputDeviceId); - lastError = device->error; - - if (lastError.isNotEmpty()) - deleteAndZero (device); - } - else - { - device = new CoreAudioInternal (outputDeviceId); - lastError = device->error; - - if (lastError.isNotEmpty()) - { - deleteAndZero (device); - } - else if (inputDeviceId != 0) - { - CoreAudioInternal* secondDevice = new CoreAudioInternal (inputDeviceId); - lastError = device->error; - - if (lastError.isNotEmpty()) - { - delete secondDevice; - } - else - { - device->inputDevice = secondDevice; - secondDevice->isSlaveDevice = true; - } - } - } - - internal = device; - - AudioHardwareAddPropertyListener (kAudioPropertyWildcardPropertyID, - hardwareListenerProc, internal); - } - - ~CoreAudioIODevice() - { - AudioHardwareRemovePropertyListener (kAudioPropertyWildcardPropertyID, - hardwareListenerProc); - - delete internal; - } - - const StringArray getOutputChannelNames() - { - return internal->outChanNames; - } - - const StringArray getInputChannelNames() - { - if (internal->inputDevice != 0) - return internal->inputDevice->inChanNames; - else - return internal->inChanNames; - } - - int getNumSampleRates() - { - return internal->sampleRates.size(); - } - - double getSampleRate (int index) - { - return internal->sampleRates [index]; - } - - int getNumBufferSizesAvailable() - { - return internal->bufferSizes.size(); - } - - int getBufferSizeSamples (int index) - { - return internal->bufferSizes [index]; - } - - int getDefaultBufferSize() - { - for (int i = 0; i < getNumBufferSizesAvailable(); ++i) - if (getBufferSizeSamples(i) >= 512) - return getBufferSizeSamples(i); - - return 512; - } - - const String open (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate, - int bufferSizeSamples) - { - isOpen_ = true; - - if (bufferSizeSamples <= 0) - bufferSizeSamples = getDefaultBufferSize(); - - internal->reopen (inputChannels, outputChannels, sampleRate, bufferSizeSamples); - lastError = internal->error; - return lastError; - } - - void close() - { - isOpen_ = false; - } - - bool isOpen() - { - return isOpen_; - } - - int getCurrentBufferSizeSamples() - { - return internal != 0 ? internal->getBufferSize() : 512; - } - - double getCurrentSampleRate() - { - return internal != 0 ? internal->getSampleRate() : 0; - } - - int getCurrentBitDepth() - { - return 32; // no way to find out, so just assume it's high.. - } - - const BitArray getActiveOutputChannels() const - { - return internal != 0 ? internal->activeOutputChans : BitArray(); - } - - const BitArray getActiveInputChannels() const - { - BitArray chans; - - if (internal != 0) - { - chans = internal->activeInputChans; - - if (internal->inputDevice != 0) - chans.orWith (internal->inputDevice->activeInputChans); - } - - return chans; - } - - int getOutputLatencyInSamples() - { - if (internal == 0) - return 0; - - // this seems like a good guess at getting the latency right - comparing - // this with a round-trip measurement, it gets it to within a few millisecs - // for the built-in mac soundcard - return internal->outputLatency + internal->getBufferSize() * 2; - } - - int getInputLatencyInSamples() - { - if (internal == 0) - return 0; - - return internal->inputLatency + internal->getBufferSize() * 2; - } - - void start (AudioIODeviceCallback* callback) - { - if (internal != 0 && ! isStarted) - { - if (callback != 0) - callback->audioDeviceAboutToStart (this); - - isStarted = true; - internal->start (callback); - } - } - - void stop() - { - if (isStarted && internal != 0) - { - AudioIODeviceCallback* const lastCallback = internal->callback; - - isStarted = false; - internal->stop (true); - - if (lastCallback != 0) - lastCallback->audioDeviceStopped(); - } - } - - bool isPlaying() - { - if (internal->callback == 0) - isStarted = false; - - return isStarted; - } - - const String getLastError() - { - return lastError; - } - - int inputIndex, outputIndex; - - juce_UseDebuggingNewOperator - -private: - CoreAudioInternal* internal; - bool isOpen_, isStarted; - String lastError; - - static OSStatus hardwareListenerProc (AudioHardwarePropertyID inPropertyID, void* inClientData) - { - CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; - - switch (inPropertyID) - { - case kAudioHardwarePropertyDevices: - intern->deviceDetailsChanged(); - break; - - case kAudioHardwarePropertyDefaultOutputDevice: - case kAudioHardwarePropertyDefaultInputDevice: - case kAudioHardwarePropertyDefaultSystemOutputDevice: - break; - } - - return noErr; - } - - CoreAudioIODevice (const CoreAudioIODevice&); - const CoreAudioIODevice& operator= (const CoreAudioIODevice&); -}; - -//============================================================================== -class CoreAudioIODeviceType : public AudioIODeviceType -{ -public: - //============================================================================== - CoreAudioIODeviceType() - : AudioIODeviceType (T("CoreAudio")), - hasScanned (false) - { - } - - ~CoreAudioIODeviceType() - { - } - - //============================================================================== - void scanForDevices() - { - hasScanned = true; - - inputDeviceNames.clear(); - outputDeviceNames.clear(); - inputIds.clear(); - outputIds.clear(); - - UInt32 size; - if (OK (AudioHardwareGetPropertyInfo (kAudioHardwarePropertyDevices, &size, 0))) - { - AudioDeviceID* const devs = (AudioDeviceID*) juce_calloc (size); - - if (OK (AudioHardwareGetProperty (kAudioHardwarePropertyDevices, &size, devs))) - { - static bool alreadyLogged = false; - const int num = size / sizeof (AudioDeviceID); - for (int i = 0; i < num; ++i) - { - char name[1024]; - size = sizeof (name); - if (OK (AudioDeviceGetProperty (devs[i], 0, false, kAudioDevicePropertyDeviceName, &size, name))) - { - const String nameString (String::fromUTF8 ((const uint8*) name, strlen (name))); - - if (! alreadyLogged) - log (T("CoreAudio device: ") + nameString); - - const int numIns = getNumChannels (devs[i], true); - const int numOuts = getNumChannels (devs[i], false); - - if (numIns > 0) - { - inputDeviceNames.add (nameString); - inputIds.add (devs[i]); - } - - if (numOuts > 0) - { - outputDeviceNames.add (nameString); - outputIds.add (devs[i]); - } - } - } - - alreadyLogged = true; - } - - juce_free (devs); - } - - inputDeviceNames.appendNumbersToDuplicates (false, true); - outputDeviceNames.appendNumbersToDuplicates (false, true); - } - - const StringArray getDeviceNames (const bool wantInputNames) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this - - if (wantInputNames) - return inputDeviceNames; - else - return outputDeviceNames; - } - - int getDefaultDeviceIndex (const bool forInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this - - AudioDeviceID deviceID; - UInt32 size = sizeof (deviceID); - - // if they're asking for any input channels at all, use the default input, so we - // get the built-in mic rather than the built-in output with no inputs.. - if (AudioHardwareGetProperty (forInput ? kAudioHardwarePropertyDefaultInputDevice - : kAudioHardwarePropertyDefaultOutputDevice, - &size, &deviceID) == noErr) - { - if (forInput) - { - for (int i = inputIds.size(); --i >= 0;) - if (inputIds[i] == deviceID) - return i; - } - else - { - for (int i = outputIds.size(); --i >= 0;) - if (outputIds[i] == deviceID) - return i; - } - } - - return 0; - } - - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this - - CoreAudioIODevice* const d = dynamic_cast (device); - if (d == 0) - return -1; - - return asInput ? d->inputIndex - : d->outputIndex; - } - - bool hasSeparateInputsAndOutputs() const { return true; } - - AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) - { - jassert (hasScanned); // need to call scanForDevices() before doing this - - const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); - const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); - - String deviceName (outputDeviceName); - if (deviceName.isEmpty()) - deviceName = inputDeviceName; - - if (index >= 0) - return new CoreAudioIODevice (deviceName, - inputIds [inputIndex], - inputIndex, - outputIds [outputIndex], - outputIndex); - - return 0; - } - - //============================================================================== - juce_UseDebuggingNewOperator - -private: - StringArray inputDeviceNames, outputDeviceNames; - Array inputIds, outputIds; - - bool hasScanned; - - static int getNumChannels (AudioDeviceID deviceID, bool input) - { - int total = 0; - UInt32 size; - - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) - { - AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); - - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) - { - const int numStreams = bufList->mNumberBuffers; - - for (int i = 0; i < numStreams; ++i) - { - const AudioBuffer& b = bufList->mBuffers[i]; - total += b.mNumberChannels; - } - } - - juce_free (bufList); - } - - return total; - } - - CoreAudioIODeviceType (const CoreAudioIODeviceType&); - const CoreAudioIODeviceType& operator= (const CoreAudioIODeviceType&); -}; - -//============================================================================== -AudioIODeviceType* juce_createDefaultAudioIODeviceType() -{ - return new CoreAudioIODeviceType(); -} - -#undef log - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + + +//============================================================================== +#ifndef JUCE_COREAUDIO_ERROR_LOGGING_ENABLED + #define JUCE_COREAUDIO_ERROR_LOGGING_ENABLED 1 +#endif + +//============================================================================== +#undef log +#if JUCE_COREAUDIO_LOGGING_ENABLED + #define log(a) Logger::writeToLog (a) +#else + #define log(a) +#endif + +#undef OK +#if JUCE_COREAUDIO_ERROR_LOGGING_ENABLED + static bool logAnyErrors_CoreAudio (const OSStatus err, const int lineNum) + { + if (err == noErr) + return true; + + Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + jassertfalse + return false; + } + + #define OK(a) logAnyErrors_CoreAudio (a, __LINE__) +#else + #define OK(a) (a == noErr) +#endif + +//============================================================================== +static const int maxNumChans = 96; + + +//============================================================================== +class CoreAudioInternal : public Timer +{ +public: + //============================================================================== + CoreAudioInternal (AudioDeviceID id) + : deviceID (id), + started (false), + audioBuffer (0), + numInputChans (0), + numOutputChans (0), + callbacksAllowed (true), + numInputChannelInfos (0), + numOutputChannelInfos (0), + inputLatency (0), + outputLatency (0), + callback (0), +#if ! MACOS_10_4_OR_EARLIER + audioProcID (0), +#endif + inputDevice (0), + isSlaveDevice (false) + { + sampleRate = 0; + bufferSize = 512; + + if (deviceID == 0) + { + error = TRANS("can't open device"); + } + else + { + updateDetailsFromDevice(); + + AudioDeviceAddPropertyListener (deviceID, + kAudioPropertyWildcardChannel, + kAudioPropertyWildcardSection, + kAudioPropertyWildcardPropertyID, + deviceListenerProc, this); + } + } + + ~CoreAudioInternal() + { + AudioDeviceRemovePropertyListener (deviceID, + kAudioPropertyWildcardChannel, + kAudioPropertyWildcardSection, + kAudioPropertyWildcardPropertyID, + deviceListenerProc); + + stop (false); + + juce_free (audioBuffer); + delete inputDevice; + } + + void setTempBufferSize (const int numChannels, const int numSamples) + { + juce_free (audioBuffer); + + audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float)); + + zeromem (tempInputBuffers, sizeof (tempInputBuffers)); + zeromem (tempOutputBuffers, sizeof (tempOutputBuffers)); + + int count = 0; + int i; + for (i = 0; i < numInputChans; ++i) + tempInputBuffers[i] = audioBuffer + count++ * numSamples; + + for (i = 0; i < numOutputChans; ++i) + tempOutputBuffers[i] = audioBuffer + count++ * numSamples; + } + + // returns the number of actual available channels + void fillInChannelInfo (bool input) + { + int chanNum = 0, activeChans = 0; + UInt32 size; + + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) + { + AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) + { + const int numStreams = bufList->mNumberBuffers; + + for (int i = 0; i < numStreams; ++i) + { + const AudioBuffer& b = bufList->mBuffers[i]; + + for (unsigned int j = 0; j < b.mNumberChannels; ++j) + { + if (input) + { + if (activeInputChans[chanNum]) + { + inputChannelInfo [activeChans].sourceChannelNum = chanNum; + inputChannelInfo [activeChans].streamNum = i; + inputChannelInfo [activeChans].dataOffsetSamples = j; + inputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; + ++activeChans; + numInputChannelInfos = activeChans; + } + + inChanNames.add (T("input ") + String (chanNum + 1)); + } + else + { + if (activeOutputChans[chanNum]) + { + outputChannelInfo [activeChans].sourceChannelNum = chanNum; + outputChannelInfo [activeChans].streamNum = i; + outputChannelInfo [activeChans].dataOffsetSamples = j; + outputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; + ++activeChans; + numOutputChannelInfos = activeChans; + } + + outChanNames.add (T("output ") + String (chanNum + 1)); + } + + ++chanNum; + } + } + } + + juce_free (bufList); + } + } + + void updateDetailsFromDevice() + { + stopTimer(); + + if (deviceID == 0) + return; + + const ScopedLock sl (callbackLock); + + Float64 sr; + UInt32 size = sizeof (Float64); + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyNominalSampleRate, &size, &sr))) + sampleRate = sr; + + UInt32 framesPerBuf; + size = sizeof (framesPerBuf); + + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf))) + { + bufferSize = framesPerBuf; + + if (bufferSize > 0) + setTempBufferSize (numInputChans + numOutputChans, bufferSize); + } + + bufferSizes.clear(); + + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, 0))) + { + AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, ranges))) + { + bufferSizes.add ((int) ranges[0].mMinimum); + + for (int i = 32; i < 8192; i += 32) + { + for (int j = size / sizeof (AudioValueRange); --j >= 0;) + { + if (i >= ranges[j].mMinimum && i <= ranges[j].mMaximum) + { + bufferSizes.addIfNotAlreadyThere (i); + break; + } + } + } + + if (bufferSize > 0) + bufferSizes.addIfNotAlreadyThere (bufferSize); + } + + juce_free (ranges); + } + + if (bufferSizes.size() == 0 && bufferSize > 0) + bufferSizes.add (bufferSize); + + sampleRates.clear(); + const double possibleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; + String rates; + + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, 0))) + { + AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, ranges))) + { + for (int i = 0; i < numElementsInArray (possibleRates); ++i) + { + bool ok = false; + + for (int j = size / sizeof (AudioValueRange); --j >= 0;) + if (possibleRates[i] >= ranges[j].mMinimum - 2 && possibleRates[i] <= ranges[j].mMaximum + 2) + ok = true; + + if (ok) + { + sampleRates.add (possibleRates[i]); + rates << possibleRates[i] << T(" "); + } + } + } + + juce_free (ranges); + } + + if (sampleRates.size() == 0 && sampleRate > 0) + { + sampleRates.add (sampleRate); + rates << sampleRate; + } + + log (T("sr: ") + rates); + + inputLatency = 0; + outputLatency = 0; + UInt32 lat; + size = sizeof (UInt32); + if (AudioDeviceGetProperty (deviceID, 0, true, kAudioDevicePropertyLatency, &size, &lat) == noErr) + inputLatency = (int) lat; + + if (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyLatency, &size, &lat) == noErr) + outputLatency = (int) lat; + + log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); + + inChanNames.clear(); + outChanNames.clear(); + + zeromem (inputChannelInfo, sizeof (inputChannelInfo)); + zeromem (outputChannelInfo, sizeof (outputChannelInfo)); + + fillInChannelInfo (true); + fillInChannelInfo (false); + } + + //============================================================================== + const StringArray getSources (bool input) + { + StringArray s; + int num = 0; + OSType* types = getAllDataSourcesForDevice (deviceID, input, num); + + if (types != 0) + { + for (int i = 0; i < num; ++i) + { + AudioValueTranslation avt; + char buffer[256]; + + avt.mInputData = (void*) &(types[i]); + avt.mInputDataSize = sizeof (UInt32); + avt.mOutputData = buffer; + avt.mOutputDataSize = 256; + + UInt32 transSize = sizeof (avt); + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSourceNameForID, &transSize, &avt))) + { + DBG (buffer); + s.add (buffer); + } + } + + juce_free (types); + } + + return s; + } + + int getCurrentSourceIndex (bool input) const + { + OSType currentSourceID = 0; + UInt32 size = 0; + int result = -1; + + if (deviceID != 0 + && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, 0))) + { + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, ¤tSourceID))) + { + int num = 0; + OSType* const types = getAllDataSourcesForDevice (deviceID, input, num); + + if (types != 0) + { + for (int i = 0; i < num; ++i) + { + if (types[num] == currentSourceID) + { + result = i; + break; + } + } + + juce_free (types); + } + } + } + + return result; + } + + void setCurrentSourceIndex (int index, bool input) + { + if (deviceID != 0) + { + int num = 0; + OSType* types = getAllDataSourcesForDevice (deviceID, input, num); + + if (types != 0) + { + if (((unsigned int) index) < num) + { + OSType typeId = types[index]; + AudioDeviceSetProperty (deviceID, 0, 0, input, kAudioDevicePropertyDataSource, sizeof (typeId), &typeId); + } + + juce_free (types); + } + } + } + + //============================================================================== + const String reopen (const BitArray& inputChannels, + const BitArray& outputChannels, + double newSampleRate, + int bufferSizeSamples) + { + error = String::empty; + log ("CoreAudio reopen"); + callbacksAllowed = false; + stopTimer(); + + stop (false); + + activeInputChans = inputChannels; + activeOutputChans = outputChannels; + + activeInputChans.setRange (inChanNames.size(), + activeInputChans.getHighestBit() + 1 - inChanNames.size(), + false); + + activeOutputChans.setRange (outChanNames.size(), + activeOutputChans.getHighestBit() + 1 - outChanNames.size(), + false); + + numInputChans = activeInputChans.countNumberOfSetBits(); + numOutputChans = activeOutputChans.countNumberOfSetBits(); + + // set sample rate + Float64 sr = newSampleRate; + UInt32 size = sizeof (sr); + OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyNominalSampleRate, size, &sr)); + OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyNominalSampleRate, size, &sr)); + + // change buffer size + UInt32 framesPerBuf = bufferSizeSamples; + size = sizeof (framesPerBuf); + + OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); + OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); + + // wait for the changes to happen (on some devices) + int i = 30; + while (--i >= 0) + { + updateDetailsFromDevice(); + + if (sampleRate == newSampleRate && bufferSizeSamples == bufferSize) + break; + + Thread::sleep (100); + } + + if (i < 0) + error = "Couldn't change sample rate/buffer size"; + + if (sampleRates.size() == 0) + error = "Device has no available sample-rates"; + + if (bufferSizes.size() == 0) + error = "Device has no available buffer-sizes"; + + if (inputDevice != 0 && error.isEmpty()) + error = inputDevice->reopen (inputChannels, + outputChannels, + newSampleRate, + bufferSizeSamples); + + callbacksAllowed = true; + + return error; + } + + bool start (AudioIODeviceCallback* cb) + { + if (! started) + { + callback = 0; + + if (deviceID != 0) + { +#if MACOS_10_4_OR_EARLIER + if (OK (AudioDeviceAddIOProc (deviceID, audioIOProc, (void*) this))) +#else + if (OK (AudioDeviceCreateIOProcID (deviceID, audioIOProc, (void*) this, &audioProcID))) +#endif + { + if (OK (AudioDeviceStart (deviceID, audioIOProc))) + { + started = true; + } + else + { +#if MACOS_10_4_OR_EARLIER + OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); +#else + OK (AudioDeviceDestroyIOProcID (deviceID, audioProcID)); + audioProcID = 0; +#endif + } + } + } + } + + if (started) + { + const ScopedLock sl (callbackLock); + callback = cb; + } + + if (inputDevice != 0) + return started && inputDevice->start (cb); + else + return started; + } + + void stop (bool leaveInterruptRunning) + { + callbackLock.enter(); + callback = 0; + callbackLock.exit(); + + if (started + && (deviceID != 0) + && ! leaveInterruptRunning) + { + OK (AudioDeviceStop (deviceID, audioIOProc)); + +#if MACOS_10_4_OR_EARLIER + OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); +#else + OK (AudioDeviceDestroyIOProcID (deviceID, audioProcID)); + audioProcID = 0; +#endif + started = false; + + callbackLock.enter(); + callbackLock.exit(); + + // wait until it's definately stopped calling back.. + for (int i = 40; --i >= 0;) + { + Thread::sleep (50); + + UInt32 running = 0; + UInt32 size = sizeof (running); + OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyDeviceIsRunning, &size, &running)); + if (running == 0) + break; + } + + callbackLock.enter(); + callbackLock.exit(); + } + + if (inputDevice != 0) + inputDevice->stop (leaveInterruptRunning); + } + + double getSampleRate() const + { + return sampleRate; + } + + int getBufferSize() const + { + return bufferSize; + } + + void audioCallback (const AudioBufferList* inInputData, + AudioBufferList* outOutputData) + { + int i; + const ScopedLock sl (callbackLock); + + if (callback != 0) + { + if (inputDevice == 0) + { + for (i = numInputChans; --i >= 0;) + { + const CallbackDetailsForChannel& info = inputChannelInfo[i]; + float* dest = tempInputBuffers [info.sourceChannelNum]; + const float* src = ((const float*) inInputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; + + if (stride != 0) // if this is zero, info is invalid + { + for (int j = bufferSize; --j >= 0;) + { + *dest++ = *src; + src += stride; + } + } + } + } + + if (! isSlaveDevice) + { + if (inputDevice == 0) + { + callback->audioDeviceIOCallback ((const float**) tempInputBuffers, + numInputChans, + tempOutputBuffers, + numOutputChans, + bufferSize); + } + else + { + jassert (inputDevice->bufferSize == bufferSize); + + callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers, + inputDevice->numInputChans, + tempOutputBuffers, + numOutputChans, + bufferSize); + } + + for (i = numOutputChans; --i >= 0;) + { + const CallbackDetailsForChannel& info = outputChannelInfo[i]; + const float* src = tempOutputBuffers [i]; + float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; + + if (stride != 0) // if this is zero, info is invalid + { + for (int j = bufferSize; --j >= 0;) + { + *dest = *src++; + dest += stride; + } + } + } + } + } + else + { + for (i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) + { + const CallbackDetailsForChannel& info = outputChannelInfo[i]; + float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; + + if (stride != 0) // if this is zero, info is invalid + { + for (int j = bufferSize; --j >= 0;) + { + *dest = 0.0f; + dest += stride; + } + } + } + } + } + + // called by callbacks + void deviceDetailsChanged() + { + if (callbacksAllowed) + startTimer (100); + } + + void timerCallback() + { + stopTimer(); + log ("CoreAudio device changed callback"); + + const double oldSampleRate = sampleRate; + const int oldBufferSize = bufferSize; + updateDetailsFromDevice(); + + if (oldBufferSize != bufferSize || oldSampleRate != sampleRate) + { + callbacksAllowed = false; + stop (false); + updateDetailsFromDevice(); + callbacksAllowed = true; + } + } + + CoreAudioInternal* getRelatedDevice() const + { + UInt32 size = 0; + CoreAudioInternal* result = 0; + + if (deviceID != 0 + && AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, 0) == noErr + && size > 0) + { + AudioDeviceID* devs = (AudioDeviceID*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, devs))) + { + for (unsigned int i = 0; i < size / sizeof (AudioDeviceID); ++i) + { + if (devs[i] != deviceID && devs[i] != 0) + { + result = new CoreAudioInternal (devs[i]); + + if (result->error.isEmpty()) + { + const bool thisIsInput = inChanNames.size() > 0 && outChanNames.size() == 0; + const bool otherIsInput = result->inChanNames.size() > 0 && result->outChanNames.size() == 0; + + if (thisIsInput != otherIsInput + || (inChanNames.size() + outChanNames.size() == 0) + || (result->inChanNames.size() + result->outChanNames.size()) == 0) + break; + } + + deleteAndZero (result); + } + } + } + + juce_free (devs); + } + + return result; + } + + //============================================================================== + juce_UseDebuggingNewOperator + + String error; + int inputLatency, outputLatency; + BitArray activeInputChans, activeOutputChans; + StringArray inChanNames, outChanNames; + Array sampleRates; + Array bufferSizes; + AudioIODeviceCallback* callback; +#if ! MACOS_10_4_OR_EARLIER + AudioDeviceIOProcID audioProcID; +#endif + + CoreAudioInternal* inputDevice; + bool isSlaveDevice; + +private: + CriticalSection callbackLock; + AudioDeviceID deviceID; + bool started; + double sampleRate; + int bufferSize; + float* audioBuffer; + int numInputChans, numOutputChans; + bool callbacksAllowed; + + struct CallbackDetailsForChannel + { + int sourceChannelNum; + int streamNum; + int dataOffsetSamples; + int dataStrideSamples; + }; + + int numInputChannelInfos, numOutputChannelInfos; + CallbackDetailsForChannel inputChannelInfo [maxNumChans]; + CallbackDetailsForChannel outputChannelInfo [maxNumChans]; + float* tempInputBuffers [maxNumChans]; + float* tempOutputBuffers [maxNumChans]; + + CoreAudioInternal (const CoreAudioInternal&); + const CoreAudioInternal& operator= (const CoreAudioInternal&); + + //============================================================================== + static OSStatus audioIOProc (AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* device) + { + ((CoreAudioInternal*) device)->audioCallback (inInputData, outOutputData); + return noErr; + } + + static OSStatus deviceListenerProc (AudioDeviceID inDevice, + UInt32 inLine, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData) + { + CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; + + switch (inPropertyID) + { + case kAudioDevicePropertyBufferSize: + case kAudioDevicePropertyBufferFrameSize: + case kAudioDevicePropertyNominalSampleRate: + case kAudioDevicePropertyStreamFormat: + case kAudioDevicePropertyDeviceIsAlive: + intern->deviceDetailsChanged(); + break; + + case kAudioDevicePropertyBufferSizeRange: + case kAudioDevicePropertyVolumeScalar: + case kAudioDevicePropertyMute: + case kAudioDevicePropertyPlayThru: + case kAudioDevicePropertyDataSource: + case kAudioDevicePropertyDeviceIsRunning: + break; + } + + return noErr; + } + + //============================================================================== + static OSType* getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, int& num) + { + OSType* types = 0; + UInt32 size = 0; + num = 0; + + if (deviceID != 0 + && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, 0))) + { + types = (OSType*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, types))) + { + num = size / sizeof (OSType); + } + else + { + juce_free (types); + types = 0; + } + } + + return types; + } +}; + + +//============================================================================== +class CoreAudioIODevice : public AudioIODevice +{ +public: + CoreAudioIODevice (const String& deviceName, + AudioDeviceID inputDeviceId, + const int inputIndex_, + AudioDeviceID outputDeviceId, + const int outputIndex_) + : AudioIODevice (deviceName, "CoreAudio"), + inputIndex (inputIndex_), + outputIndex (outputIndex_), + isOpen_ (false), + isStarted (false) + { + internal = 0; + CoreAudioInternal* device = 0; + + if (outputDeviceId == 0 || outputDeviceId == inputDeviceId) + { + jassert (inputDeviceId != 0); + + device = new CoreAudioInternal (inputDeviceId); + lastError = device->error; + + if (lastError.isNotEmpty()) + deleteAndZero (device); + } + else + { + device = new CoreAudioInternal (outputDeviceId); + lastError = device->error; + + if (lastError.isNotEmpty()) + { + deleteAndZero (device); + } + else if (inputDeviceId != 0) + { + CoreAudioInternal* secondDevice = new CoreAudioInternal (inputDeviceId); + lastError = device->error; + + if (lastError.isNotEmpty()) + { + delete secondDevice; + } + else + { + device->inputDevice = secondDevice; + secondDevice->isSlaveDevice = true; + } + } + } + + internal = device; + + AudioHardwareAddPropertyListener (kAudioPropertyWildcardPropertyID, + hardwareListenerProc, internal); + } + + ~CoreAudioIODevice() + { + AudioHardwareRemovePropertyListener (kAudioPropertyWildcardPropertyID, + hardwareListenerProc); + + delete internal; + } + + const StringArray getOutputChannelNames() + { + return internal->outChanNames; + } + + const StringArray getInputChannelNames() + { + if (internal->inputDevice != 0) + return internal->inputDevice->inChanNames; + else + return internal->inChanNames; + } + + int getNumSampleRates() + { + return internal->sampleRates.size(); + } + + double getSampleRate (int index) + { + return internal->sampleRates [index]; + } + + int getNumBufferSizesAvailable() + { + return internal->bufferSizes.size(); + } + + int getBufferSizeSamples (int index) + { + return internal->bufferSizes [index]; + } + + int getDefaultBufferSize() + { + for (int i = 0; i < getNumBufferSizesAvailable(); ++i) + if (getBufferSizeSamples(i) >= 512) + return getBufferSizeSamples(i); + + return 512; + } + + const String open (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate, + int bufferSizeSamples) + { + isOpen_ = true; + + if (bufferSizeSamples <= 0) + bufferSizeSamples = getDefaultBufferSize(); + + internal->reopen (inputChannels, outputChannels, sampleRate, bufferSizeSamples); + lastError = internal->error; + return lastError; + } + + void close() + { + isOpen_ = false; + } + + bool isOpen() + { + return isOpen_; + } + + int getCurrentBufferSizeSamples() + { + return internal != 0 ? internal->getBufferSize() : 512; + } + + double getCurrentSampleRate() + { + return internal != 0 ? internal->getSampleRate() : 0; + } + + int getCurrentBitDepth() + { + return 32; // no way to find out, so just assume it's high.. + } + + const BitArray getActiveOutputChannels() const + { + return internal != 0 ? internal->activeOutputChans : BitArray(); + } + + const BitArray getActiveInputChannels() const + { + BitArray chans; + + if (internal != 0) + { + chans = internal->activeInputChans; + + if (internal->inputDevice != 0) + chans.orWith (internal->inputDevice->activeInputChans); + } + + return chans; + } + + int getOutputLatencyInSamples() + { + if (internal == 0) + return 0; + + // this seems like a good guess at getting the latency right - comparing + // this with a round-trip measurement, it gets it to within a few millisecs + // for the built-in mac soundcard + return internal->outputLatency + internal->getBufferSize() * 2; + } + + int getInputLatencyInSamples() + { + if (internal == 0) + return 0; + + return internal->inputLatency + internal->getBufferSize() * 2; + } + + void start (AudioIODeviceCallback* callback) + { + if (internal != 0 && ! isStarted) + { + if (callback != 0) + callback->audioDeviceAboutToStart (this); + + isStarted = true; + internal->start (callback); + } + } + + void stop() + { + if (isStarted && internal != 0) + { + AudioIODeviceCallback* const lastCallback = internal->callback; + + isStarted = false; + internal->stop (true); + + if (lastCallback != 0) + lastCallback->audioDeviceStopped(); + } + } + + bool isPlaying() + { + if (internal->callback == 0) + isStarted = false; + + return isStarted; + } + + const String getLastError() + { + return lastError; + } + + int inputIndex, outputIndex; + + juce_UseDebuggingNewOperator + +private: + CoreAudioInternal* internal; + bool isOpen_, isStarted; + String lastError; + + static OSStatus hardwareListenerProc (AudioHardwarePropertyID inPropertyID, void* inClientData) + { + CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; + + switch (inPropertyID) + { + case kAudioHardwarePropertyDevices: + intern->deviceDetailsChanged(); + break; + + case kAudioHardwarePropertyDefaultOutputDevice: + case kAudioHardwarePropertyDefaultInputDevice: + case kAudioHardwarePropertyDefaultSystemOutputDevice: + break; + } + + return noErr; + } + + CoreAudioIODevice (const CoreAudioIODevice&); + const CoreAudioIODevice& operator= (const CoreAudioIODevice&); +}; + +//============================================================================== +class CoreAudioIODeviceType : public AudioIODeviceType +{ +public: + //============================================================================== + CoreAudioIODeviceType() + : AudioIODeviceType (T("CoreAudio")), + hasScanned (false) + { + } + + ~CoreAudioIODeviceType() + { + } + + //============================================================================== + void scanForDevices() + { + hasScanned = true; + + inputDeviceNames.clear(); + outputDeviceNames.clear(); + inputIds.clear(); + outputIds.clear(); + + UInt32 size; + if (OK (AudioHardwareGetPropertyInfo (kAudioHardwarePropertyDevices, &size, 0))) + { + AudioDeviceID* const devs = (AudioDeviceID*) juce_calloc (size); + + if (OK (AudioHardwareGetProperty (kAudioHardwarePropertyDevices, &size, devs))) + { + static bool alreadyLogged = false; + const int num = size / sizeof (AudioDeviceID); + for (int i = 0; i < num; ++i) + { + char name[1024]; + size = sizeof (name); + if (OK (AudioDeviceGetProperty (devs[i], 0, false, kAudioDevicePropertyDeviceName, &size, name))) + { + const String nameString (String::fromUTF8 ((const uint8*) name, strlen (name))); + + if (! alreadyLogged) + log (T("CoreAudio device: ") + nameString); + + const int numIns = getNumChannels (devs[i], true); + const int numOuts = getNumChannels (devs[i], false); + + if (numIns > 0) + { + inputDeviceNames.add (nameString); + inputIds.add (devs[i]); + } + + if (numOuts > 0) + { + outputDeviceNames.add (nameString); + outputIds.add (devs[i]); + } + } + } + + alreadyLogged = true; + } + + juce_free (devs); + } + + inputDeviceNames.appendNumbersToDuplicates (false, true); + outputDeviceNames.appendNumbersToDuplicates (false, true); + } + + const StringArray getDeviceNames (const bool wantInputNames) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this + + if (wantInputNames) + return inputDeviceNames; + else + return outputDeviceNames; + } + + int getDefaultDeviceIndex (const bool forInput) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this + + AudioDeviceID deviceID; + UInt32 size = sizeof (deviceID); + + // if they're asking for any input channels at all, use the default input, so we + // get the built-in mic rather than the built-in output with no inputs.. + if (AudioHardwareGetProperty (forInput ? kAudioHardwarePropertyDefaultInputDevice + : kAudioHardwarePropertyDefaultOutputDevice, + &size, &deviceID) == noErr) + { + if (forInput) + { + for (int i = inputIds.size(); --i >= 0;) + if (inputIds[i] == deviceID) + return i; + } + else + { + for (int i = outputIds.size(); --i >= 0;) + if (outputIds[i] == deviceID) + return i; + } + } + + return 0; + } + + int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this + + CoreAudioIODevice* const d = dynamic_cast (device); + if (d == 0) + return -1; + + return asInput ? d->inputIndex + : d->outputIndex; + } + + bool hasSeparateInputsAndOutputs() const { return true; } + + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) + { + jassert (hasScanned); // need to call scanForDevices() before doing this + + const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); + const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); + + String deviceName (outputDeviceName); + if (deviceName.isEmpty()) + deviceName = inputDeviceName; + + if (index >= 0) + return new CoreAudioIODevice (deviceName, + inputIds [inputIndex], + inputIndex, + outputIds [outputIndex], + outputIndex); + + return 0; + } + + //============================================================================== + juce_UseDebuggingNewOperator + +private: + StringArray inputDeviceNames, outputDeviceNames; + Array inputIds, outputIds; + + bool hasScanned; + + static int getNumChannels (AudioDeviceID deviceID, bool input) + { + int total = 0; + UInt32 size; + + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) + { + AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); + + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) + { + const int numStreams = bufList->mNumberBuffers; + + for (int i = 0; i < numStreams; ++i) + { + const AudioBuffer& b = bufList->mBuffers[i]; + total += b.mNumberChannels; + } + } + + juce_free (bufList); + } + + return total; + } + + CoreAudioIODeviceType (const CoreAudioIODeviceType&); + const CoreAudioIODeviceType& operator= (const CoreAudioIODeviceType&); +}; + +//============================================================================== +AudioIODeviceType* juce_createDefaultAudioIODeviceType() +{ + return new CoreAudioIODeviceType(); +} + +#undef log + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp b/build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp index d585d8bc02..8f8ee00d4c 100644 --- a/build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp +++ b/build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp @@ -1,592 +1,583 @@ -/* - ============================================================================== - - 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 -#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" -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/containers/juce_MemoryBlock.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" - -//============================================================================== -#undef log -#define log(a) Logger::writeToLog(a) - -static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) -{ - if (err == noErr) - return true; - - log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); - jassertfalse - return false; -} - -#undef OK -#define OK(a) logAnyErrorsMidi(a, __LINE__) - - -//============================================================================== -static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) -{ - String result; - CFStringRef str = 0; - - MIDIObjectGetStringProperty (endpoint, kMIDIPropertyName, &str); - - if (str != 0) - { - result = PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - str = 0; - } - - MIDIEntityRef entity = 0; - MIDIEndpointGetEntity (endpoint, &entity); - - if (entity == 0) - return result; // probably virtual - - if (result.isEmpty()) - { - // endpoint name has zero length - try the entity - MIDIObjectGetStringProperty (entity, kMIDIPropertyName, &str); - - if (str != 0) - { - result += PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - str = 0; - } - } - - // now consider the device's name - MIDIDeviceRef device = 0; - MIDIEntityGetDevice (entity, &device); - if (device == 0) - return result; - - MIDIObjectGetStringProperty (device, kMIDIPropertyName, &str); - - if (str != 0) - { - const String s (PlatformUtilities::cfStringToJuceString (str)); - CFRelease (str); - - // if an external device has only one entity, throw away - // the endpoint name and just use the device name - if (isExternal && MIDIDeviceGetNumberOfEntities (device) < 2) - { - result = s; - } - else if (! result.startsWithIgnoreCase (s)) - { - // prepend the device name to the entity name - result = (s + T(" ") + result).trimEnd(); - } - } - - return result; -} - -static const String getConnectedEndpointName (MIDIEndpointRef endpoint) -{ - String result; - - // Does the endpoint have connections? - CFDataRef connections = 0; - int numConnections = 0; - - MIDIObjectGetDataProperty (endpoint, kMIDIPropertyConnectionUniqueID, &connections); - - if (connections != 0) - { - numConnections = CFDataGetLength (connections) / sizeof (MIDIUniqueID); - - if (numConnections > 0) - { - const SInt32* pid = reinterpret_cast (CFDataGetBytePtr (connections)); - - for (int i = 0; i < numConnections; ++i, ++pid) - { - MIDIUniqueID uid = EndianS32_BtoN (*pid); - MIDIObjectRef connObject; - MIDIObjectType connObjectType; - OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); - - if (err == noErr) - { - String s; - - if (connObjectType == kMIDIObjectType_ExternalSource - || connObjectType == kMIDIObjectType_ExternalDestination) - { - // Connected to an external device's endpoint (10.3 and later). - s = getEndpointName (static_cast (connObject), true); - } - else - { - // Connected to an external device (10.2) (or something else, catch-all) - CFStringRef str = 0; - MIDIObjectGetStringProperty (connObject, kMIDIPropertyName, &str); - - if (str != 0) - { - s = PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - } - } - - if (s.isNotEmpty()) - { - if (result.isNotEmpty()) - result += (", "); - - result += s; - } - } - } - } - - CFRelease (connections); - } - - if (result.isNotEmpty()) - return result; - - // Here, either the endpoint had no connections, or we failed to obtain names for any of them. - return getEndpointName (endpoint, false); -} - -//============================================================================== -const StringArray MidiOutput::getDevices() -{ - StringArray s; - - const ItemCount num = MIDIGetNumberOfDestinations(); - for (ItemCount i = 0; i < num; ++i) - { - MIDIEndpointRef dest = MIDIGetDestination (i); - - if (dest != 0) - { - String name (getConnectedEndpointName (dest)); - - if (name.isEmpty()) - name = ""; - - s.add (name); - } - else - { - s.add (""); - } - } - - return s; -} - -int MidiOutput::getDefaultDeviceIndex() -{ - return 0; -} - -static MIDIClientRef globalMidiClient; -static bool hasGlobalClientBeenCreated = false; - -static bool makeSureClientExists() -{ - if (! hasGlobalClientBeenCreated) - { - String name (T("JUCE")); - - if (JUCEApplication::getInstance() != 0) - name = JUCEApplication::getInstance()->getApplicationName(); - - CFStringRef appName = PlatformUtilities::juceStringToCFString (name); - - hasGlobalClientBeenCreated = OK (MIDIClientCreate (appName, 0, 0, &globalMidiClient)); - CFRelease (appName); - } - - return hasGlobalClientBeenCreated; -} - -struct MidiPortAndEndpoint -{ - MIDIPortRef port; - MIDIEndpointRef endPoint; -}; - -MidiOutput* MidiOutput::openDevice (int index) -{ - MidiOutput* mo = 0; - - if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfDestinations()) - { - MIDIEndpointRef endPoint = MIDIGetDestination (index); - - CFStringRef pname; - if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) - { - log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); - - if (makeSureClientExists()) - { - MIDIPortRef port; - - if (OK (MIDIOutputPortCreate (globalMidiClient, pname, &port))) - { - MidiPortAndEndpoint* mpe = new MidiPortAndEndpoint(); - mpe->port = port; - mpe->endPoint = endPoint; - - mo = new MidiOutput(); - mo->internal = (void*)mpe; - } - } - - CFRelease (pname); - } - } - - return mo; -} - -MidiOutput::~MidiOutput() -{ - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; - MIDIPortDispose (mpe->port); - delete mpe; -} - -void MidiOutput::reset() -{ -} - -bool MidiOutput::getVolume (float& leftVol, float& rightVol) -{ - return false; -} - -void MidiOutput::setVolume (float leftVol, float rightVol) -{ -} - -void MidiOutput::sendMessageNow (const MidiMessage& message) -{ - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; - - if (message.isSysEx()) - { - MIDIPacketList* const packets = (MIDIPacketList*) juce_malloc (32 + message.getRawDataSize()); - packets->numPackets = 1; - packets->packet[0].timeStamp = 0; - packets->packet[0].length = message.getRawDataSize(); - memcpy (packets->packet[0].data, message.getRawData(), message.getRawDataSize()); - - MIDISend (mpe->port, mpe->endPoint, packets); - juce_free (packets); - } - else - { - MIDIPacketList packets; - packets.numPackets = 1; - packets.packet[0].timeStamp = 0; - packets.packet[0].length = message.getRawDataSize(); - *(int*) (packets.packet[0].data) = *(const int*) message.getRawData(); - - MIDISend (mpe->port, mpe->endPoint, &packets); - } -} - -//============================================================================== -const StringArray MidiInput::getDevices() -{ - StringArray s; - - const ItemCount num = MIDIGetNumberOfSources(); - for (ItemCount i = 0; i < num; ++i) - { - MIDIEndpointRef source = MIDIGetSource (i); - - if (source != 0) - { - String name (getConnectedEndpointName (source)); - - if (name.isEmpty()) - name = ""; - - s.add (name); - } - else - { - s.add (""); - } - } - - return s; -} - -int MidiInput::getDefaultDeviceIndex() -{ - return 0; -} - -//============================================================================== -struct MidiPortAndCallback -{ - MidiInput* input; - MIDIPortRef port; - MIDIEndpointRef endPoint; - MidiInputCallback* callback; - MemoryBlock pendingData; - int pendingBytes; - double pendingDataTime; - bool active; -}; - -static CriticalSection callbackLock; -static VoidArray activeCallbacks; - -static void processSysex (MidiPortAndCallback* const mpe, const uint8*& d, int& size, const double time) -{ - if (*d == 0xf0) - { - mpe->pendingBytes = 0; - mpe->pendingDataTime = time; - } - - mpe->pendingData.ensureSize (mpe->pendingBytes + size, false); - uint8* totalMessage = (uint8*) mpe->pendingData.getData(); - - uint8* dest = totalMessage + mpe->pendingBytes; - - while (size > 0) - { - if (mpe->pendingBytes > 0 && *d >= 0x80) - { - if (*d >= 0xfa || *d == 0xf8) - { - mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time)); - ++d; - --size; - } - else - { - if (*d == 0xf7) - { - *dest++ = *d++; - mpe->pendingBytes++; - --size; - } - - break; - } - } - else - { - *dest++ = *d++; - mpe->pendingBytes++; - --size; - } - } - - if (totalMessage [mpe->pendingBytes - 1] == 0xf7) - { - mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (totalMessage, - mpe->pendingBytes, - mpe->pendingDataTime)); - mpe->pendingBytes = 0; - } - else - { - mpe->callback->handlePartialSysexMessage (mpe->input, - totalMessage, - mpe->pendingBytes, - mpe->pendingDataTime); - } -} - -static void midiInputProc (const MIDIPacketList* pktlist, - void* readProcRefCon, - void* srcConnRefCon) -{ - double time = Time::getMillisecondCounterHiRes() * 0.001; - const double originalTime = time; - - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) readProcRefCon; - const ScopedLock sl (callbackLock); - - if (activeCallbacks.contains (mpe) && mpe->active) - { - const MIDIPacket* packet = &pktlist->packet[0]; - - for (unsigned int i = 0; i < pktlist->numPackets; ++i) - { - const uint8* d = (const uint8*) (packet->data); - int size = packet->length; - - while (size > 0) - { - time = originalTime; - - if (mpe->pendingBytes > 0 || d[0] == 0xf0) - { - processSysex (mpe, d, size, time); - } - else - { - int used = 0; - const MidiMessage m (d, size, used, 0, time); - - if (used <= 0) - { - jassertfalse // malformed midi message - break; - } - else - { - mpe->callback->handleIncomingMidiMessage (mpe->input, m); - } - - size -= used; - d += used; - } - } - - packet = MIDIPacketNext (packet); - } - } -} - -MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) -{ - MidiInput* mi = 0; - - if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfSources()) - { - MIDIEndpointRef endPoint = MIDIGetSource (index); - - if (endPoint != 0) - { - CFStringRef pname; - - if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) - { - log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); - - if (makeSureClientExists()) - { - MIDIPortRef port; - - MidiPortAndCallback* const mpe = new MidiPortAndCallback(); - mpe->active = false; - - if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpe, &port))) - { - if (OK (MIDIPortConnectSource (port, endPoint, 0))) - { - mpe->port = port; - mpe->endPoint = endPoint; - mpe->callback = callback; - mpe->pendingBytes = 0; - mpe->pendingData.ensureSize (128); - - mi = new MidiInput (getDevices() [index]); - mpe->input = mi; - mi->internal = (void*) mpe; - - const ScopedLock sl (callbackLock); - activeCallbacks.add (mpe); - } - else - { - OK (MIDIPortDispose (port)); - delete mpe; - } - } - else - { - delete mpe; - } - } - } - - CFRelease (pname); - } - } - - return mi; -} - -MidiInput::MidiInput (const String& name_) - : name (name_) -{ -} - -MidiInput::~MidiInput() -{ - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - mpe->active = false; - - callbackLock.enter(); - activeCallbacks.removeValue (mpe); - callbackLock.exit(); - - OK (MIDIPortDisconnectSource (mpe->port, mpe->endPoint)); - OK (MIDIPortDispose (mpe->port)); - delete mpe; -} - -void MidiInput::start() -{ - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - const ScopedLock sl (callbackLock); - mpe->active = true; -} - -void MidiInput::stop() -{ - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - const ScopedLock sl (callbackLock); - mpe->active = false; -} - -#undef log - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +#undef log +#define log(a) Logger::writeToLog(a) + +static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) +{ + if (err == noErr) + return true; + + log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + jassertfalse + return false; +} + +#undef OK +#define OK(a) logAnyErrorsMidi(a, __LINE__) + + +//============================================================================== +static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) +{ + String result; + CFStringRef str = 0; + + MIDIObjectGetStringProperty (endpoint, kMIDIPropertyName, &str); + + if (str != 0) + { + result = PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + str = 0; + } + + MIDIEntityRef entity = 0; + MIDIEndpointGetEntity (endpoint, &entity); + + if (entity == 0) + return result; // probably virtual + + if (result.isEmpty()) + { + // endpoint name has zero length - try the entity + MIDIObjectGetStringProperty (entity, kMIDIPropertyName, &str); + + if (str != 0) + { + result += PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + str = 0; + } + } + + // now consider the device's name + MIDIDeviceRef device = 0; + MIDIEntityGetDevice (entity, &device); + if (device == 0) + return result; + + MIDIObjectGetStringProperty (device, kMIDIPropertyName, &str); + + if (str != 0) + { + const String s (PlatformUtilities::cfStringToJuceString (str)); + CFRelease (str); + + // if an external device has only one entity, throw away + // the endpoint name and just use the device name + if (isExternal && MIDIDeviceGetNumberOfEntities (device) < 2) + { + result = s; + } + else if (! result.startsWithIgnoreCase (s)) + { + // prepend the device name to the entity name + result = (s + T(" ") + result).trimEnd(); + } + } + + return result; +} + +static const String getConnectedEndpointName (MIDIEndpointRef endpoint) +{ + String result; + + // Does the endpoint have connections? + CFDataRef connections = 0; + int numConnections = 0; + + MIDIObjectGetDataProperty (endpoint, kMIDIPropertyConnectionUniqueID, &connections); + + if (connections != 0) + { + numConnections = CFDataGetLength (connections) / sizeof (MIDIUniqueID); + + if (numConnections > 0) + { + const SInt32* pid = reinterpret_cast (CFDataGetBytePtr (connections)); + + for (int i = 0; i < numConnections; ++i, ++pid) + { + MIDIUniqueID uid = EndianS32_BtoN (*pid); + MIDIObjectRef connObject; + MIDIObjectType connObjectType; + OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); + + if (err == noErr) + { + String s; + + if (connObjectType == kMIDIObjectType_ExternalSource + || connObjectType == kMIDIObjectType_ExternalDestination) + { + // Connected to an external device's endpoint (10.3 and later). + s = getEndpointName (static_cast (connObject), true); + } + else + { + // Connected to an external device (10.2) (or something else, catch-all) + CFStringRef str = 0; + MIDIObjectGetStringProperty (connObject, kMIDIPropertyName, &str); + + if (str != 0) + { + s = PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + } + } + + if (s.isNotEmpty()) + { + if (result.isNotEmpty()) + result += (", "); + + result += s; + } + } + } + } + + CFRelease (connections); + } + + if (result.isNotEmpty()) + return result; + + // Here, either the endpoint had no connections, or we failed to obtain names for any of them. + return getEndpointName (endpoint, false); +} + +//============================================================================== +const StringArray MidiOutput::getDevices() +{ + StringArray s; + + const ItemCount num = MIDIGetNumberOfDestinations(); + for (ItemCount i = 0; i < num; ++i) + { + MIDIEndpointRef dest = MIDIGetDestination (i); + + if (dest != 0) + { + String name (getConnectedEndpointName (dest)); + + if (name.isEmpty()) + name = ""; + + s.add (name); + } + else + { + s.add (""); + } + } + + return s; +} + +int MidiOutput::getDefaultDeviceIndex() +{ + return 0; +} + +static MIDIClientRef globalMidiClient; +static bool hasGlobalClientBeenCreated = false; + +static bool makeSureClientExists() +{ + if (! hasGlobalClientBeenCreated) + { + String name (T("JUCE")); + + if (JUCEApplication::getInstance() != 0) + name = JUCEApplication::getInstance()->getApplicationName(); + + CFStringRef appName = PlatformUtilities::juceStringToCFString (name); + + hasGlobalClientBeenCreated = OK (MIDIClientCreate (appName, 0, 0, &globalMidiClient)); + CFRelease (appName); + } + + return hasGlobalClientBeenCreated; +} + +struct MidiPortAndEndpoint +{ + MIDIPortRef port; + MIDIEndpointRef endPoint; +}; + +MidiOutput* MidiOutput::openDevice (int index) +{ + MidiOutput* mo = 0; + + if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfDestinations()) + { + MIDIEndpointRef endPoint = MIDIGetDestination (index); + + CFStringRef pname; + if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) + { + log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); + + if (makeSureClientExists()) + { + MIDIPortRef port; + + if (OK (MIDIOutputPortCreate (globalMidiClient, pname, &port))) + { + MidiPortAndEndpoint* mpe = new MidiPortAndEndpoint(); + mpe->port = port; + mpe->endPoint = endPoint; + + mo = new MidiOutput(); + mo->internal = (void*)mpe; + } + } + + CFRelease (pname); + } + } + + return mo; +} + +MidiOutput::~MidiOutput() +{ + MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; + MIDIPortDispose (mpe->port); + delete mpe; +} + +void MidiOutput::reset() +{ +} + +bool MidiOutput::getVolume (float& leftVol, float& rightVol) +{ + return false; +} + +void MidiOutput::setVolume (float leftVol, float rightVol) +{ +} + +void MidiOutput::sendMessageNow (const MidiMessage& message) +{ + MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; + + if (message.isSysEx()) + { + MIDIPacketList* const packets = (MIDIPacketList*) juce_malloc (32 + message.getRawDataSize()); + packets->numPackets = 1; + packets->packet[0].timeStamp = 0; + packets->packet[0].length = message.getRawDataSize(); + memcpy (packets->packet[0].data, message.getRawData(), message.getRawDataSize()); + + MIDISend (mpe->port, mpe->endPoint, packets); + juce_free (packets); + } + else + { + MIDIPacketList packets; + packets.numPackets = 1; + packets.packet[0].timeStamp = 0; + packets.packet[0].length = message.getRawDataSize(); + *(int*) (packets.packet[0].data) = *(const int*) message.getRawData(); + + MIDISend (mpe->port, mpe->endPoint, &packets); + } +} + +//============================================================================== +const StringArray MidiInput::getDevices() +{ + StringArray s; + + const ItemCount num = MIDIGetNumberOfSources(); + for (ItemCount i = 0; i < num; ++i) + { + MIDIEndpointRef source = MIDIGetSource (i); + + if (source != 0) + { + String name (getConnectedEndpointName (source)); + + if (name.isEmpty()) + name = ""; + + s.add (name); + } + else + { + s.add (""); + } + } + + return s; +} + +int MidiInput::getDefaultDeviceIndex() +{ + return 0; +} + +//============================================================================== +struct MidiPortAndCallback +{ + MidiInput* input; + MIDIPortRef port; + MIDIEndpointRef endPoint; + MidiInputCallback* callback; + MemoryBlock pendingData; + int pendingBytes; + double pendingDataTime; + bool active; +}; + +static CriticalSection callbackLock; +static VoidArray activeCallbacks; + +static void processSysex (MidiPortAndCallback* const mpe, const uint8*& d, int& size, const double time) +{ + if (*d == 0xf0) + { + mpe->pendingBytes = 0; + mpe->pendingDataTime = time; + } + + mpe->pendingData.ensureSize (mpe->pendingBytes + size, false); + uint8* totalMessage = (uint8*) mpe->pendingData.getData(); + + uint8* dest = totalMessage + mpe->pendingBytes; + + while (size > 0) + { + if (mpe->pendingBytes > 0 && *d >= 0x80) + { + if (*d >= 0xfa || *d == 0xf8) + { + mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time)); + ++d; + --size; + } + else + { + if (*d == 0xf7) + { + *dest++ = *d++; + mpe->pendingBytes++; + --size; + } + + break; + } + } + else + { + *dest++ = *d++; + mpe->pendingBytes++; + --size; + } + } + + if (totalMessage [mpe->pendingBytes - 1] == 0xf7) + { + mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (totalMessage, + mpe->pendingBytes, + mpe->pendingDataTime)); + mpe->pendingBytes = 0; + } + else + { + mpe->callback->handlePartialSysexMessage (mpe->input, + totalMessage, + mpe->pendingBytes, + mpe->pendingDataTime); + } +} + +static void midiInputProc (const MIDIPacketList* pktlist, + void* readProcRefCon, + void* srcConnRefCon) +{ + double time = Time::getMillisecondCounterHiRes() * 0.001; + const double originalTime = time; + + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) readProcRefCon; + const ScopedLock sl (callbackLock); + + if (activeCallbacks.contains (mpe) && mpe->active) + { + const MIDIPacket* packet = &pktlist->packet[0]; + + for (unsigned int i = 0; i < pktlist->numPackets; ++i) + { + const uint8* d = (const uint8*) (packet->data); + int size = packet->length; + + while (size > 0) + { + time = originalTime; + + if (mpe->pendingBytes > 0 || d[0] == 0xf0) + { + processSysex (mpe, d, size, time); + } + else + { + int used = 0; + const MidiMessage m (d, size, used, 0, time); + + if (used <= 0) + { + jassertfalse // malformed midi message + break; + } + else + { + mpe->callback->handleIncomingMidiMessage (mpe->input, m); + } + + size -= used; + d += used; + } + } + + packet = MIDIPacketNext (packet); + } + } +} + +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) +{ + MidiInput* mi = 0; + + if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfSources()) + { + MIDIEndpointRef endPoint = MIDIGetSource (index); + + if (endPoint != 0) + { + CFStringRef pname; + + if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) + { + log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); + + if (makeSureClientExists()) + { + MIDIPortRef port; + + MidiPortAndCallback* const mpe = new MidiPortAndCallback(); + mpe->active = false; + + if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpe, &port))) + { + if (OK (MIDIPortConnectSource (port, endPoint, 0))) + { + mpe->port = port; + mpe->endPoint = endPoint; + mpe->callback = callback; + mpe->pendingBytes = 0; + mpe->pendingData.ensureSize (128); + + mi = new MidiInput (getDevices() [index]); + mpe->input = mi; + mi->internal = (void*) mpe; + + const ScopedLock sl (callbackLock); + activeCallbacks.add (mpe); + } + else + { + OK (MIDIPortDispose (port)); + delete mpe; + } + } + else + { + delete mpe; + } + } + } + + CFRelease (pname); + } + } + + return mi; +} + +MidiInput::MidiInput (const String& name_) + : name (name_) +{ +} + +MidiInput::~MidiInput() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + mpe->active = false; + + callbackLock.enter(); + activeCallbacks.removeValue (mpe); + callbackLock.exit(); + + OK (MIDIPortDisconnectSource (mpe->port, mpe->endPoint)); + OK (MIDIPortDispose (mpe->port)); + delete mpe; +} + +void MidiInput::start() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + const ScopedLock sl (callbackLock); + mpe->active = true; +} + +void MidiInput::stop() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + const ScopedLock sl (callbackLock); + mpe->active = false; +} + +#undef log + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Debugging.mm b/build/macosx/platform_specific_code/juce_mac_Debugging.mm new file mode 100644 index 0000000000..6a2e1184ef --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_Debugging.mm @@ -0,0 +1,74 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +void Logger::outputDebugString (const String& text) throw() +{ + const ScopedAutoReleasePool pool; + NSLog (juceStringToNS (text + T("\n"))); +} + +void Logger::outputDebugPrintf (const tchar* format, ...) throw() +{ + String text; + va_list args; + va_start (args, format); + text.vprintf(format, args); + outputDebugString (text); +} + +bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw() +{ + static char testResult = 0; + + if (testResult == 0) + { + struct kinfo_proc info; + int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; + size_t sz = sizeof (info); + sysctl (m, 4, &info, &sz, 0, 0); + testResult = ((info.kp_proc.p_flag & P_TRACED) != 0) ? 1 : -1; + } + + return testResult > 0; +} + +bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw() +{ + return juce_isRunningUnderDebugger(); +} + + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm index 5d8739b241..94fafaed2e 100644 --- a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm +++ b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm @@ -1,156 +1,150 @@ -/* - ============================================================================== - - 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 "juce_mac_NativeHeaders.h" -#include - -BEGIN_JUCE_NAMESPACE -#include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" -END_JUCE_NAMESPACE - - -//============================================================================== -@interface JuceFileChooserDelegate : NSObject -{ - JUCE_NAMESPACE::StringArray* filters; -} - -- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_; -- (void) dealloc; -- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename; - -@end - -@implementation JuceFileChooserDelegate -- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_ -{ - [super init]; - filters = filters_; - return self; -} - -- (void) dealloc -{ - delete filters; - [super dealloc]; -} - -- (BOOL) panel:(id) sender shouldShowFilename: (NSString*) filename -{ - const JUCE_NAMESPACE::String fname (nsStringToJuce (filename)); - - for (int i = filters->size(); --i >= 0;) - { - const JUCE_NAMESPACE::String wildcard ((*filters)[i]); - - if (fnmatch (wildcard.toLowerCase().toUTF8(), - fname.toLowerCase().toUTF8(), 0) == 0) - return true; - } - - return JUCE_NAMESPACE::File (fname).isDirectory(); -} -@end - -BEGIN_JUCE_NAMESPACE - - -void FileChooser::showPlatformDialog (OwnedArray& results, - const String& title, - const File& currentFileOrDirectory, - const String& filter, - bool selectsDirectory, - bool isSaveDialogue, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, - FilePreviewComponent* extraInfoComponent) -{ - const AutoPool pool; - - StringArray* filters = new StringArray(); - filters->addTokens (filter.replaceCharacters (T(",:"), T(";;")), T(";"), 0); - filters->trim(); - filters->removeEmptyStrings(); - - JuceFileChooserDelegate* delegate = [[JuceFileChooserDelegate alloc] initWithFilters: filters]; - [delegate autorelease]; - - NSSavePanel* panel = isSaveDialogue ? [NSSavePanel savePanel] - : [NSOpenPanel openPanel]; - - [panel setTitle: juceStringToNS (title)]; - - if (! isSaveDialogue) - { - NSOpenPanel* openPanel = (NSOpenPanel*) panel; - [openPanel setCanChooseDirectories: selectsDirectory]; - [openPanel setCanChooseFiles: ! selectsDirectory]; - [openPanel setAllowsMultipleSelection: selectMultipleFiles]; - } - - [panel setDelegate: delegate]; - - String directory, filename; - - if (currentFileOrDirectory.isDirectory()) - { - directory = currentFileOrDirectory.getFullPathName(); - } - else - { - directory = currentFileOrDirectory.getParentDirectory().getFullPathName(); - filename = currentFileOrDirectory.getFileName(); - } - - if ([panel runModalForDirectory: juceStringToNS (directory) - file: juceStringToNS (filename)] - == NSOKButton) - { - if (isSaveDialogue) - { - results.add (new File (nsStringToJuce ([panel filename]))); - } - else - { - NSOpenPanel* openPanel = (NSOpenPanel*) panel; - NSArray* urls = [openPanel filenames]; - for (int i = 0; i < [urls count]; ++i) - { - NSString* f = [urls objectAtIndex: i]; - results.add (new File (nsStringToJuce (f))); - } - } - } - - [panel setDelegate: nil]; -} - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +END_JUCE_NAMESPACE +using namespace JUCE_NAMESPACE; + +@interface JuceFileChooserDelegate : NSObject +{ + StringArray* filters; +} + +- (JuceFileChooserDelegate*) initWithFilters: (StringArray*) filters_; +- (void) dealloc; +- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename; + +@end + +@implementation JuceFileChooserDelegate +- (JuceFileChooserDelegate*) initWithFilters: (StringArray*) filters_ +{ + [super init]; + filters = filters_; + return self; +} + +- (void) dealloc +{ + delete filters; + [super dealloc]; +} + +- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename +{ + const String fname (nsStringToJuce (filename)); + + for (int i = filters->size(); --i >= 0;) + if (fname.matchesWildcard ((*filters)[i], true)) + return true; + + return File (fname).isDirectory(); +} +@end + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +void FileChooser::showPlatformDialog (OwnedArray& results, + const String& title, + const File& currentFileOrDirectory, + const String& filter, + bool selectsDirectory, + bool isSaveDialogue, + bool warnAboutOverwritingExistingFiles, + bool selectMultipleFiles, + FilePreviewComponent* extraInfoComponent) +{ + const ScopedAutoReleasePool pool; + + StringArray* filters = new StringArray(); + filters->addTokens (filter.replaceCharacters (T(",:"), T(";;")), T(";"), 0); + filters->trim(); + filters->removeEmptyStrings(); + + JuceFileChooserDelegate* delegate = [[JuceFileChooserDelegate alloc] initWithFilters: filters]; + [delegate autorelease]; + + NSSavePanel* panel = isSaveDialogue ? [NSSavePanel savePanel] + : [NSOpenPanel openPanel]; + + [panel setTitle: juceStringToNS (title)]; + + if (! isSaveDialogue) + { + NSOpenPanel* openPanel = (NSOpenPanel*) panel; + [openPanel setCanChooseDirectories: selectsDirectory]; + [openPanel setCanChooseFiles: ! selectsDirectory]; + [openPanel setAllowsMultipleSelection: selectMultipleFiles]; + } + + [panel setDelegate: delegate]; + + String directory, filename; + + if (currentFileOrDirectory.isDirectory()) + { + directory = currentFileOrDirectory.getFullPathName(); + } + else + { + directory = currentFileOrDirectory.getParentDirectory().getFullPathName(); + filename = currentFileOrDirectory.getFileName(); + } + + if ([panel runModalForDirectory: juceStringToNS (directory) + file: juceStringToNS (filename)] + == NSOKButton) + { + if (isSaveDialogue) + { + results.add (new File (nsStringToJuce ([panel filename]))); + } + else + { + NSOpenPanel* openPanel = (NSOpenPanel*) panel; + NSArray* urls = [openPanel filenames]; + for (int i = 0; i < [urls count]; ++i) + { + NSString* f = [urls objectAtIndex: i]; + results.add (new File (nsStringToJuce (f))); + } + } + } + + [panel setDelegate: nil]; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Files.mm b/build/macosx/platform_specific_code/juce_mac_Files.mm new file mode 100644 index 0000000000..0c13ddcc52 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_Files.mm @@ -0,0 +1,541 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, 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! +*/ + +//============================================================================== +static File executableFile; + +const unsigned int macTimeToUnixTimeDiff = 0x7c25be90; + +static uint64 utcDateTimeToUnixTime (const UTCDateTime& d) throw() +{ + if (d.highSeconds == 0 && d.lowSeconds == 0 && d.fraction == 0) + return 0; + + return (((((uint64) d.highSeconds) << 32) | (uint64) d.lowSeconds) * 1000) + + ((d.fraction * 1000) >> 16) + - 2082844800000ll; +} + +static void unixTimeToUtcDateTime (uint64 t, UTCDateTime& d) throw() +{ + if (t != 0) + t += 2082844800000ll; + + d.highSeconds = (t / 1000) >> 32; + d.lowSeconds = (t / 1000) & (uint64) 0xffffffff; + d.fraction = ((t % 1000) << 16) / 1000; +} + +void juce_getFileTimes (const String& fileName, + int64& modificationTime, + int64& accessTime, + int64& creationTime) throw() +{ + modificationTime = 0; + accessTime = 0; + creationTime = 0; + + FSRef fileRef; + if (PlatformUtilities::makeFSRefFromPath (&fileRef, fileName)) + { + FSRefParam info; + zerostruct (info); + + info.ref = &fileRef; + info.whichInfo = kFSCatInfoAllDates; + + FSCatalogInfo catInfo; + info.catInfo = &catInfo; + + if (PBGetCatalogInfoSync (&info) == noErr) + { + creationTime = utcDateTimeToUnixTime (catInfo.createDate); + accessTime = utcDateTimeToUnixTime (catInfo.accessDate); + modificationTime = utcDateTimeToUnixTime (catInfo.contentModDate); + } + } +} + +bool juce_setFileTimes (const String& fileName, + int64 modificationTime, + int64 accessTime, + int64 creationTime) throw() +{ + FSRef fileRef; + if (PlatformUtilities::makeFSRefFromPath (&fileRef, fileName)) + { + FSRefParam info; + zerostruct (info); + + info.ref = &fileRef; + info.whichInfo = kFSCatInfoAllDates; + + FSCatalogInfo catInfo; + info.catInfo = &catInfo; + + if (PBGetCatalogInfoSync (&info) == noErr) + { + if (creationTime != 0) + unixTimeToUtcDateTime (creationTime, catInfo.createDate); + + if (modificationTime != 0) + unixTimeToUtcDateTime (modificationTime, catInfo.contentModDate); + + if (accessTime != 0) + unixTimeToUtcDateTime (accessTime, catInfo.accessDate); + + return PBSetCatalogInfoSync (&info) == noErr; + } + } + + return false; +} + +bool juce_setFileReadOnly (const String& fileName, bool isReadOnly) throw() +{ + const char* const fileNameUTF8 = fileName.toUTF8(); + + struct stat info; + const int res = stat (fileNameUTF8, &info); + + bool ok = false; + + if (res == 0) + { + info.st_mode &= 0777; // Just permissions + + if (isReadOnly) + info.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + else + // Give everybody write permission? + info.st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + + ok = chmod (fileNameUTF8, info.st_mode) == 0; + } + + return ok; +} + +bool juce_copyFile (const String& src, const String& dst) throw() +{ + const ScopedAutoReleasePool pool; + NSFileManager* fm = [NSFileManager defaultManager]; + + return [fm fileExistsAtPath: juceStringToNS (src)] + && [fm copyPath: juceStringToNS (src) + toPath: juceStringToNS (dst) + handler: nil]; +} + +const StringArray juce_getFileSystemRoots() throw() +{ + StringArray s; + s.add (T("/")); + return s; +} + +//============================================================================== +static bool isFileOnDriveType (const File* const f, const char** types) throw() +{ + struct statfs buf; + + if (doStatFS (f, buf)) + { + const String type (buf.f_fstypename); + + while (*types != 0) + if (type.equalsIgnoreCase (*types++)) + return true; + } + + return false; +} + +bool File::isOnCDRomDrive() const throw() +{ + static const char* const cdTypes[] = { "cd9660", "cdfs", "cddafs", "udf", 0 }; + + return isFileOnDriveType (this, (const char**) cdTypes); +} + +bool File::isOnHardDisk() const throw() +{ + static const char* const nonHDTypes[] = { "nfs", "smbfs", "ramfs", 0 }; + + return ! (isOnCDRomDrive() || isFileOnDriveType (this, (const char**) nonHDTypes)); +} + +bool File::isOnRemovableDrive() const throw() +{ + jassertfalse // xxx not implemented for mac! + return false; +} + +static bool juce_isHiddenFile (const String& path) throw() +{ + FSRef ref; + if (! PlatformUtilities::makeFSRefFromPath (&ref, path)) + return false; + + FSCatalogInfo info; + FSGetCatalogInfo (&ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &info, 0, 0, 0); + + if ((info.nodeFlags & kFSNodeIsDirectoryBit) != 0) + return (((FolderInfo*) &info.finderInfo)->finderFlags & kIsInvisible) != 0; + + return (((FileInfo*) &info.finderInfo)->finderFlags & kIsInvisible) != 0; +} + +bool File::isHidden() const throw() +{ + return juce_isHiddenFile (getFullPathName()); +} + +//============================================================================== +const File File::getSpecialLocation (const SpecialLocationType type) +{ + const char* resultPath = 0; + + switch (type) + { + case userHomeDirectory: + resultPath = nsStringToJuce (NSHomeDirectory()); + break; + + case userDocumentsDirectory: + resultPath = "~/Documents"; + break; + + case userDesktopDirectory: + resultPath = "~/Desktop"; + break; + + case userApplicationDataDirectory: + resultPath = "~/Library"; + break; + + case commonApplicationDataDirectory: + resultPath = "/Library"; + break; + + case globalApplicationsDirectory: + resultPath = "/Applications"; + break; + + case userMusicDirectory: + resultPath = "~/Music"; + break; + + case userMoviesDirectory: + resultPath = "~/Movies"; + break; + + case tempDirectory: + { + File tmp (T("~/Library/Caches/") + executableFile.getFileNameWithoutExtension()); + + tmp.createDirectory(); + return tmp.getFullPathName(); + } + + case currentExecutableFile: + return executableFile; + + case currentApplicationFile: + { + const File parent (executableFile.getParentDirectory()); + + return parent.getFullPathName().endsWithIgnoreCase (T("Contents/MacOS")) + ? parent.getParentDirectory().getParentDirectory() + : executableFile; + } + + default: + jassertfalse // unknown type? + break; + } + + if (resultPath != 0) + return File (PlatformUtilities::convertToPrecomposedUnicode (resultPath)); + + return File::nonexistent; +} + +void juce_setCurrentExecutableFileName (const String& filename) throw() +{ + executableFile = File::getCurrentWorkingDirectory() + .getChildFile (PlatformUtilities::convertToPrecomposedUnicode (filename)); +} + +void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId) throw() +{ + const ScopedAutoReleasePool pool; + + NSBundle* b = [NSBundle bundleWithIdentifier: juceStringToNS (bundleId)]; + + if (b != nil) + executableFile = nsStringToJuce ([b executablePath]); +} + +//============================================================================== +const File File::getCurrentWorkingDirectory() throw() +{ + char buf [2048]; + getcwd (buf, sizeof(buf)); + + return File (PlatformUtilities::convertToPrecomposedUnicode (buf)); +} + +bool File::setAsCurrentWorkingDirectory() const throw() +{ + return chdir (getFullPathName().toUTF8()) == 0; +} + +//============================================================================== +struct FindFileStruct +{ + String parentDir, wildCard; + DIR* dir; + + bool getNextMatch (String& result, bool* const isDir, bool* const isHidden, int64* const fileSize, + Time* const modTime, Time* const creationTime, bool* const isReadOnly) throw() + { + const char* const wildCardUTF8 = wildCard.toUTF8(); + + for (;;) + { + struct dirent* const de = readdir (dir); + + if (de == 0) + break; + + if (fnmatch (wildCardUTF8, de->d_name, 0) == 0) + { + result = PlatformUtilities::convertToPrecomposedUnicode (String::fromUTF8 ((const uint8*) de->d_name)); + + const String path (parentDir + result); + + if (isDir != 0 || fileSize != 0) + { + struct stat info; + const bool statOk = juce_stat (path, info); + + if (isDir != 0) + *isDir = path.isEmpty() || (statOk && ((info.st_mode & S_IFDIR) != 0)); + + if (isHidden != 0) + *isHidden = (de->d_name[0] == '.') + || juce_isHiddenFile (path); + + if (fileSize != 0) + *fileSize = statOk ? info.st_size : 0; + } + + if (modTime != 0 || creationTime != 0) + { + int64 m, a, c; + juce_getFileTimes (path, m, a, c); + + if (modTime != 0) + *modTime = m; + + if (creationTime != 0) + *creationTime = c; + } + + if (isReadOnly != 0) + *isReadOnly = ! juce_canWriteToFile (path); + + return true; + } + } + + return false; + } +}; + +// returns 0 on failure +void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile, + bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, + Time* creationTime, bool* isReadOnly) throw() +{ + DIR* const d = opendir (directory.toUTF8()); + + if (d != 0) + { + FindFileStruct* const ff = new FindFileStruct(); + ff->parentDir = directory; + + if (!ff->parentDir.endsWithChar (File::separator)) + ff->parentDir += File::separator; + + ff->wildCard = wildCard; + ff->dir = d; + + if (ff->getNextMatch (firstResultFile, isDir, isHidden, fileSize, modTime, creationTime, isReadOnly)) + { + return ff; + } + else + { + firstResultFile = String::empty; + isDir = false; + closedir (d); + delete ff; + } + } + + return 0; +} + +bool juce_findFileNext (void* handle, String& resultFile, + bool* isDir, bool* isHidden, int64* fileSize, Time* modTime, Time* creationTime, bool* isReadOnly) throw() +{ + FindFileStruct* const ff = (FindFileStruct*) handle; + + if (ff != 0) + return ff->getNextMatch (resultFile, isDir, isHidden, fileSize, modTime, creationTime, isReadOnly); + + return false; +} + +void juce_findFileClose (void* handle) throw() +{ + FindFileStruct* const ff = (FindFileStruct*)handle; + + if (ff != 0) + { + closedir (ff->dir); + delete ff; + } +} + +//============================================================================== +bool juce_launchExecutable (const String& pathAndArguments) throw() +{ + char* const argv[4] = { "/bin/sh", "-c", (char*) (const char*) pathAndArguments, 0 }; + + const int cpid = fork(); + + if (cpid == 0) + { + // Child process + if (execve (argv[0], argv, 0) < 0) + exit (0); + } + else + { + if (cpid < 0) + return false; + } + + return true; +} + +bool juce_launchFile (const String& fileName, + const String& parameters) throw() +{ + const ScopedAutoReleasePool pool; + + if (parameters.isEmpty()) + return [[NSWorkspace sharedWorkspace] openFile: juceStringToNS (fileName)]; + + bool ok = false; + + FSRef ref; + if (PlatformUtilities::makeFSRefFromPath (&ref, fileName)) + { + if (PlatformUtilities::isBundle (fileName)) + { + NSMutableArray* urls = [NSMutableArray array]; + + StringArray docs; + docs.addTokens (parameters, true); + for (int i = 0; i < docs.size(); ++i) + [urls addObject: juceStringToNS (docs[i])]; + + ok = [[NSWorkspace sharedWorkspace] openURLs: urls + withAppBundleIdentifier: [[NSBundle bundleWithPath: juceStringToNS (fileName)] bundleIdentifier] + options: nil + additionalEventParamDescriptor: nil + launchIdentifiers: nil]; + } + else + { + ok = juce_launchExecutable (T("\"") + fileName + T("\" ") + parameters); + } + } + + return ok; +} + +//============================================================================== +bool PlatformUtilities::makeFSRefFromPath (FSRef* destFSRef, const String& path) +{ + return FSPathMakeRef ((const UInt8*) path.toUTF8(), destFSRef, 0) == noErr; +} + +const String PlatformUtilities::makePathFromFSRef (FSRef* file) +{ + uint8 path [2048]; + zeromem (path, sizeof (path)); + + String result; + + if (FSRefMakePath (file, (UInt8*) path, sizeof (path) - 1) == noErr) + result = String::fromUTF8 (path); + + return PlatformUtilities::convertToPrecomposedUnicode (result); +} + +//============================================================================== +OSType PlatformUtilities::getTypeOfFile (const String& filename) +{ + const ScopedAutoReleasePool pool; + return NSHFSTypeCodeFromFileType (NSHFSTypeOfFile (juceStringToNS (filename))); +} + +bool PlatformUtilities::isBundle (const String& filename) +{ + const ScopedAutoReleasePool pool; + return [[NSWorkspace sharedWorkspace] isFilePackageAtPath: juceStringToNS (filename)]; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Fonts.mm b/build/macosx/platform_specific_code/juce_mac_Fonts.mm index 6be237db02..022ac32591 100644 --- a/build/macosx/platform_specific_code/juce_mac_Fonts.mm +++ b/build/macosx/platform_specific_code/juce_mac_Fonts.mm @@ -29,19 +29,9 @@ ============================================================================== */ -#include "../../../src/juce_core/basics/juce_StandardHeader.h" -#include - -BEGIN_JUCE_NAMESPACE - - -#include "../../../src/juce_appframework/gui/graphics/fonts/juce_Font.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_core/basics/juce_Singleton.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" - +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE //============================================================================== static OSStatus pascal CubicMoveTo (const Float32Point *pt, @@ -539,5 +529,4 @@ void Font::getDefaultFontNames (String& defaultSans, String& defaultSerif, Strin defaultFixed = "Monaco"; } - -END_JUCE_NAMESPACE +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_MainMenu.mm b/build/macosx/platform_specific_code/juce_mac_MainMenu.mm new file mode 100644 index 0000000000..c5f5ee7459 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_MainMenu.mm @@ -0,0 +1,414 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +class JuceMainMenuHandler; + +END_JUCE_NAMESPACE +using namespace JUCE_NAMESPACE; + +@interface JuceMenuCallback : NSObject +{ + JuceMainMenuHandler* owner; +} + +- (JuceMenuCallback*) initWithOwner: (JuceMainMenuHandler*) owner_; +- (void) dealloc; +- (void) menuItemInvoked: (id) menu; + +@end +BEGIN_JUCE_NAMESPACE + + +//============================================================================== +class JuceMainMenuHandler : private MenuBarModelListener, + private DeletedAtShutdown +{ +public: + static JuceMainMenuHandler* instance; + + //============================================================================== + JuceMainMenuHandler() throw() + : currentModel (0) + { + callback = [[JuceMenuCallback alloc] initWithOwner: this]; + } + + ~JuceMainMenuHandler() throw() + { + setMenu (0); + + jassert (instance == this); + instance = 0; + + [callback release]; + } + + void setMenu (MenuBarModel* const newMenuBarModel) throw() + { + if (currentModel != newMenuBarModel) + { + if (currentModel != 0) + currentModel->removeListener (this); + + currentModel = newMenuBarModel; + + if (currentModel != 0) + currentModel->addListener (this); + + menuBarItemsChanged (0); + } + } + + void addSubMenu (NSMenu* parent, const PopupMenu& child, + const String& name, int& menuId, int& tag) + { + NSMenuItem* item = [parent addItemWithTitle: juceStringToNS (name) + action: nil + keyEquivalent: @""]; + [item setTag: tag]; + + NSMenu* sub = createMenu (child, name, menuId, tag); + + [parent setSubmenu: sub forItem: item]; + [sub setAutoenablesItems: false]; + [sub release]; + } + + void menuBarItemsChanged (MenuBarModel*) + { + NSMenu* menuBar = [NSApp mainMenu]; + while ([menuBar numberOfItems] > 1) + [menuBar removeItemAtIndex: 1]; + + if (currentModel != 0) + { + const StringArray menuNames (currentModel->getMenuBarNames()); + int menuId = 1; + + for (int i = 0; i < menuNames.size(); ++i) + { + const PopupMenu menu (currentModel->getMenuForIndex (i, menuNames [i])); + addSubMenu (menuBar, menu, menuNames [i], menuId, i); + } + } + } + + static void flashMenuBar (NSMenu* menu) + { + const unichar f35Key = NSF35FunctionKey; + NSString* f35String = [NSString stringWithCharacters: &f35Key length: 1]; + + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"x" + action: nil + keyEquivalent: f35String]; + [item setTarget: nil]; + [menu insertItem: item atIndex: [menu numberOfItems]]; + [item release]; + + NSEvent* f35Event = [NSEvent keyEventWithType: NSKeyDown + location: NSZeroPoint + modifierFlags: NSCommandKeyMask + timestamp: 0 + windowNumber: 0 + context: [NSGraphicsContext currentContext] + characters: f35String + charactersIgnoringModifiers: f35String + isARepeat: NO + keyCode: 0]; + + [menu performKeyEquivalent: f35Event]; + [menu removeItem: item]; + } + + void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) + { + NSMenuItem* item = [[NSApp mainMenu] itemWithTag: info.commandID]; + + if (item != 0) + flashMenuBar ([item menu]); + } + + void invoke (const int commandId, ApplicationCommandManager* const commandManager, const int topLevelIndex) const + { + if (currentModel != 0) + { + if (commandManager != 0) + { + ApplicationCommandTarget::InvocationInfo info (commandId); + info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu; + + commandManager->invoke (info, true); + } + + currentModel->menuItemSelected (commandId, topLevelIndex); + } + } + + MenuBarModel* currentModel; + +private: + JuceMenuCallback* callback; + + NSMenu* createMenu (const PopupMenu menu, + const String& menuName, + int& id, + const int topLevelIndex) + { + NSMenu* m = [[NSMenu alloc] initWithTitle: juceStringToNS (menuName)]; + + [m setAutoenablesItems: false]; + + PopupMenu::MenuItemIterator iter (menu); + + while (iter.next()) + { + NSString* text = juceStringToNS (iter.itemName.upToFirstOccurrenceOf (T(""), false, true)); + + if (iter.isSeparator) + { + [m addItem: [NSMenuItem separatorItem]]; + } + else if (iter.isSectionHeader) + { + NSMenuItem* item = [m addItemWithTitle: text + action: nil + keyEquivalent: @""]; + + [item setEnabled: iter.isEnabled]; + } + else if (iter.subMenu != 0) + { + NSMenuItem* item = [m addItemWithTitle: text + action: nil + keyEquivalent: @""]; + + [item setTag: iter.itemId]; + [item setEnabled: iter.isEnabled]; + + NSMenu* sub = createMenu (*iter.subMenu, iter.itemName, id, topLevelIndex); + [m setSubmenu: sub forItem: item]; + [sub release]; + } + else + { + NSMenuItem* item = [m addItemWithTitle: text + action: @selector (menuItemInvoked:) + keyEquivalent: @""]; + + [item setTag: iter.itemId]; + [item setEnabled: iter.isEnabled]; + [item setState: iter.isTicked ? NSOnState : NSOffState]; + [item setTarget: (id) callback]; + + NSMutableArray* info = [NSMutableArray arrayWithObject: [NSNumber numberWithUnsignedLongLong: (pointer_sized_int) (void*) iter.commandManager]]; + [info addObject: [NSNumber numberWithInt: topLevelIndex]]; + [item setRepresentedObject: info]; + + if (iter.commandManager != 0) + { + const Array keyPresses (iter.commandManager->getKeyMappings() + ->getKeyPressesAssignedToCommand (iter.itemId)); + + if (keyPresses.size() > 0) + { + const KeyPress& kp = keyPresses.getReference(0); + + juce_wchar key = kp.getTextCharacter(); + + if (kp.getKeyCode() == KeyPress::backspaceKey) + key = NSBackspaceCharacter; + else if (kp.getKeyCode() == KeyPress::deleteKey) + key = NSDeleteCharacter; + else if (key == 0) + key = (juce_wchar) kp.getKeyCode(); + + unsigned int mods = 0; + if (kp.getModifiers().isShiftDown()) + mods |= NSShiftKeyMask; + if (kp.getModifiers().isCtrlDown()) + mods |= NSControlKeyMask; + if (kp.getModifiers().isAltDown()) + mods |= NSAlternateKeyMask; + if (kp.getModifiers().isCommandDown()) + mods |= NSCommandKeyMask; + + [item setKeyEquivalent: juceStringToNS (String::charToString (key))]; + [item setKeyEquivalentModifierMask: mods]; + } + } + } + } + + [m update]; + return m; + } +}; + +JuceMainMenuHandler* JuceMainMenuHandler::instance = 0; + +END_JUCE_NAMESPACE +@implementation JuceMenuCallback + +- (JuceMenuCallback*) initWithOwner: (JuceMainMenuHandler*) owner_ +{ + [super init]; + owner = owner_; + return self; +} + +- (void) dealloc +{ + [super dealloc]; +} + +- (void) menuItemInvoked: (id) menu +{ + NSMenuItem* item = (NSMenuItem*) menu; + + if ([[item representedObject] isKindOfClass: [NSArray class]]) + { + NSArray* info = (NSArray*) [item representedObject]; + + owner->invoke ([item tag], + (ApplicationCommandManager*) (pointer_sized_int) + [((NSNumber*) [info objectAtIndex: 0]) unsignedLongLongValue], + (int) [((NSNumber*) [info objectAtIndex: 1]) intValue]); + } +} + +@end + +BEGIN_JUCE_NAMESPACE + +void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel) throw() +{ + if (getMacMainMenu() != newMenuBarModel) + { + if (newMenuBarModel == 0) + { + delete JuceMainMenuHandler::instance; + jassert (JuceMainMenuHandler::instance == 0); // should be zeroed in the destructor + } + else + { + if (JuceMainMenuHandler::instance == 0) + JuceMainMenuHandler::instance = new JuceMainMenuHandler(); + + JuceMainMenuHandler::instance->setMenu (newMenuBarModel); + } + } +} + +MenuBarModel* MenuBarModel::getMacMainMenu() throw() +{ + return JuceMainMenuHandler::instance != 0 + ? JuceMainMenuHandler::instance->currentModel : 0; +} + + +//============================================================================== +static NSMenu* createStandardAppMenu (const String& appName) +{ + NSMenu* menu = [[NSMenu alloc] initWithTitle: @"Apple"]; + NSMenuItem* item; + + // xxx should allow the 'about' and 'preferences' items to be turned on programatically... +/* item = [menu addItemWithTitle: juceStringToNS ("About " + appName)] + action: @selector(orderFrontStandardAboutPanel:) keyEquivalent: @""]; + [item setTarget: NSApp]; + [menu addItem: [NSMenuItem separatorItem]]; +*/ + +/* item = [menu addItemWithTitle: NSLocalizedString (@"Preferences...", nil) + action: nil keyEquivalent: @","]; + [menu addItem: [NSMenuItem separatorItem]]; +*/ + + // Services... + item = [menu addItemWithTitle: NSLocalizedString (@"Services", nil) + action: nil keyEquivalent: @""]; + NSMenu* servicesMenu = [[NSMenu alloc] initWithTitle: @"Services"]; + [menu setSubmenu: servicesMenu forItem: item]; + [NSApp setServicesMenu: servicesMenu]; + [servicesMenu release]; + [menu addItem: [NSMenuItem separatorItem]]; + + // Hide + Show stuff... + item = [menu addItemWithTitle: juceStringToNS ("Hide " + appName) + action: @selector (hide:) keyEquivalent: @"h"]; + [item setTarget: NSApp]; + + item = [menu addItemWithTitle: NSLocalizedString (@"Hide Others", nil) + action: @selector (hideOtherApplications:) keyEquivalent: @"h"]; + [item setKeyEquivalentModifierMask: NSCommandKeyMask | NSAlternateKeyMask]; + [item setTarget: NSApp]; + + item = [menu addItemWithTitle: NSLocalizedString (@"Show All", nil) + action: @selector (unhideAllApplications:) keyEquivalent: @""]; + [item setTarget: NSApp]; + [menu addItem: [NSMenuItem separatorItem]]; + + // Quit item.... + item = [menu addItemWithTitle: juceStringToNS ("Quit " + appName) + action: @selector (terminate:) keyEquivalent: @"q"]; + [item setTarget: NSApp]; + + return menu; +} + +// Since our app has no NIB, this initialises a standard app menu... +void initialiseMainMenu() +{ + if (JUCEApplication::getInstance() != 0) // only needed in an app + { + const ScopedAutoReleasePool pool; + + NSMenu* mainMenu = [[NSMenu alloc] initWithTitle: @"MainMenu"]; + NSMenuItem* item = [mainMenu addItemWithTitle: @"Apple" action: nil keyEquivalent: @""]; + + NSMenu* appMenu = createStandardAppMenu (JUCEApplication::getInstance()->getApplicationName()); + + [NSApp performSelector: @selector (setAppleMenu:) withObject: appMenu]; + [mainMenu setSubmenu: appMenu forItem: item]; + + [NSApp setMainMenu: mainMenu]; + [appMenu release]; + [mainMenu release]; + } +} + + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_MessageManager.mm b/build/macosx/platform_specific_code/juce_mac_MessageManager.mm new file mode 100644 index 0000000000..850025fb11 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_MessageManager.mm @@ -0,0 +1,275 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +struct CallbackMessagePayload +{ + MessageCallbackFunction* function; + void* parameter; + void* volatile result; + bool volatile hasBeenExecuted; +}; + +END_JUCE_NAMESPACE +using namespace JUCE_NAMESPACE; + +@interface JuceAppDelegate : NSObject +{ + id oldDelegate; +} + +- (JuceAppDelegate*) init; +- (void) dealloc; +- (BOOL) application: (NSApplication*) theApplication openFile: (NSString*) filename; +- (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames; +- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app; +- (void) applicationDidBecomeActive: (NSNotification*) aNotification; +- (void) applicationDidResignActive: (NSNotification*) aNotification; +- (void) applicationWillUnhide: (NSNotification*) aNotification; +- (void) customEvent: (id) data; +- (void) performCallback: (id) info; +@end + +@implementation JuceAppDelegate + +- (JuceAppDelegate*) init +{ + [super init]; + + NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; + + if (JUCEApplication::getInstance() != 0) + { + oldDelegate = [NSApp delegate]; + [NSApp setDelegate: self]; + } + else + { + oldDelegate = 0; + [center addObserver: self selector: @selector (applicationDidResignActive:) + name: NSApplicationDidResignActiveNotification object: NSApp]; + + [center addObserver: self selector: @selector (applicationDidBecomeActive:) + name: NSApplicationDidBecomeActiveNotification object: NSApp]; + + [center addObserver: self selector: @selector (applicationWillUnhide:) + name: NSApplicationWillUnhideNotification object: NSApp]; + + } + + return self; +} + +- (void) dealloc +{ + if (oldDelegate != 0) + [NSApp setDelegate: oldDelegate]; + + [super dealloc]; +} + +- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app +{ + if (JUCEApplication::getInstance() != 0) + { + JUCEApplication::getInstance()->systemRequestedQuit(); + + if (! MessageManager::getInstance()->hasStopMessageBeenSent()) + return NSTerminateCancel; + } + + return NSTerminateNow; +} + +- (BOOL) application: (NSApplication*) app openFile: (NSString*) filename +{ + if (JUCEApplication::getInstance() != 0) + { + JUCEApplication::getInstance()->anotherInstanceStarted (nsStringToJuce (filename)); + return YES; + } + + return NO; +} + +- (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames +{ + StringArray files; + for (int i = 0; i < [filenames count]; ++i) + files.add (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); + + if (files.size() > 0 && JUCEApplication::getInstance() != 0) + JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); +} + +- (void) applicationDidBecomeActive: (NSNotification*) aNotification +{ + juce_HandleProcessFocusChange(); +} + +- (void) applicationDidResignActive: (NSNotification*) aNotification +{ + juce_HandleProcessFocusChange(); +} + +- (void) applicationWillUnhide: (NSNotification*) aNotification +{ + juce_HandleProcessFocusChange(); +} + +- (void) customEvent: (id) n +{ + NSData* data = (NSData*) n; + void* message = 0; + [data getBytes: &message length: sizeof (message)]; + + if (message != 0) + MessageManager::getInstance()->deliverMessage (message); + + [data release]; +} + +- (void) performCallback: (id) info +{ + CallbackMessagePayload* pl = (CallbackMessagePayload*) info; + + if (pl != 0) + { + pl->result = (*pl->function) (pl->parameter); + pl->hasBeenExecuted = true; + } +} + +@end + +BEGIN_JUCE_NAMESPACE + +static JuceAppDelegate* juceAppDelegate = 0; + +void MessageManager::runDispatchLoop() +{ + const ScopedAutoReleasePool pool; + MessageManagerLock mml; + + // must only be called by the message thread! + jassert (isThisTheMessageThread()); + + [NSApp run]; +} + +void MessageManager::stopDispatchLoop() +{ + quitMessagePosted = true; + [NSApp stop: nil]; +} + +bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) +{ + const ScopedAutoReleasePool pool; + jassert (isThisTheMessageThread()); // must only be called by the message thread + + uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor; + NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow: millisecondsToRunFor * 0.001]; + + while (Time::getMillisecondCounter() < endTime) + { + const ScopedAutoReleasePool pool; + + [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode + beforeDate: endDate]; + + NSEvent* e = [NSApp nextEventMatchingMask: NSAnyEventMask + untilDate: endDate + inMode: NSDefaultRunLoopMode + dequeue: YES]; + [NSApp sendEvent: e]; + } + + return ! quitMessagePosted; +} + +//============================================================================== +void MessageManager::doPlatformSpecificInitialisation() +{ + if (juceAppDelegate == 0) + juceAppDelegate = [[JuceAppDelegate alloc] init]; + + initialiseMainMenu(); +} + +void MessageManager::doPlatformSpecificShutdown() +{ + [[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget: juceAppDelegate]; + [[NSNotificationCenter defaultCenter] removeObserver: juceAppDelegate]; + [juceAppDelegate release]; + juceAppDelegate = 0; +} + +bool juce_postMessageToSystemQueue (void* message) +{ + [juceAppDelegate performSelectorOnMainThread: @selector (customEvent:) + withObject: (id) [[NSData alloc] initWithBytes: &message + length: (int) sizeof (message)] + waitUntilDone: NO]; + return true; +} + +void MessageManager::broadcastMessage (const String& value) throw() +{ +} + +void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback, + void* data) +{ + if (isThisTheMessageThread()) + { + return (*callback) (data); + } + else + { + CallbackMessagePayload cmp; + cmp.function = callback; + cmp.parameter = data; + cmp.result = 0; + cmp.hasBeenExecuted = false; + + [juceAppDelegate performSelectorOnMainThread: @selector (performCallback:) + withObject: (id) &cmp + waitUntilDone: YES]; + + return cmp.result; + } +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Messaging.mm b/build/macosx/platform_specific_code/juce_mac_Messaging.mm deleted file mode 100644 index 18c5f2eb7d..0000000000 --- a/build/macosx/platform_specific_code/juce_mac_Messaging.mm +++ /dev/null @@ -1,503 +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. - - ============================================================================== -*/ - -#include "juce_mac_NativeHeaders.h" -#include - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" -#include "../../../src/juce_core/text/juce_StringArray.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" - -#undef Point - -extern void juce_HandleProcessFocusChange(); -extern void juce_maximiseAllMinimisedWindows(); -extern void juce_InvokeMainMenuCommand (const HICommand& command); -extern void juce_MainMenuAboutToBeUsed(); - -struct CallbackMessagePayload -{ - MessageCallbackFunction* function; - void* parameter; - void* volatile result; - bool volatile hasBeenExecuted; -}; - -END_JUCE_NAMESPACE - -#if JUCE_COCOA - -NSString* juceMessageName = 0; - -@interface JuceAppDelegate : NSObject -id oldDelegate; -- (JuceAppDelegate*) init; -- (void) dealloc; -- (BOOL) application: (NSApplication*) theApplication openFile: (NSString*) filename; -- (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames; -- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app; -- (void) applicationDidBecomeActive: (NSNotification*) aNotification; -- (void) applicationDidResignActive: (NSNotification*) aNotification; -- (void) applicationWillUnhide: (NSNotification*) aNotification; -- (void) customEvent: (NSNotification*) aNotification; -- (void) performCallback: (id) info; -@end - -@implementation JuceAppDelegate - -- (JuceAppDelegate*) init -{ - [super init]; - - NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; - - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - { - oldDelegate = [NSApp delegate]; - [NSApp setDelegate: self]; - } - else - { - oldDelegate = 0; - [center addObserver: self selector: @selector (applicationDidResignActive:) - name: NSApplicationDidResignActiveNotification object: NSApp]; - - [center addObserver: self selector: @selector (applicationDidBecomeActive:) - name: NSApplicationDidBecomeActiveNotification object: NSApp]; - - [center addObserver: self selector: @selector (applicationWillUnhide:) - name: NSApplicationWillUnhideNotification object: NSApp]; - - } - - [center addObserver: self selector: @selector (customEvent:) - name: juceMessageName object: nil]; - - return self; -} - -- (void) dealloc -{ - if (oldDelegate != 0) - [NSApp setDelegate: oldDelegate]; - - [[NSNotificationCenter defaultCenter] removeObserver: self]; - [super dealloc]; -} - -- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app -{ - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - JUCE_NAMESPACE::JUCEApplication::getInstance()->systemRequestedQuit(); - - return NSTerminateLater; -} - -- (BOOL) application: (NSApplication*) app openFile: (NSString*) filename -{ - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - { - JUCE_NAMESPACE::JUCEApplication::getInstance()->anotherInstanceStarted (nsStringToJuce (filename)); - return YES; - } - - return NO; -} - -- (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames -{ - JUCE_NAMESPACE::StringArray files; - for (int i = 0; i < [filenames count]; ++i) - files.add (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - - if (files.size() > 0 && JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - JUCE_NAMESPACE::JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); -} - -- (void) applicationDidBecomeActive: (NSNotification*) aNotification -{ - JUCE_NAMESPACE::juce_HandleProcessFocusChange(); -} - -- (void) applicationDidResignActive: (NSNotification*) aNotification -{ - JUCE_NAMESPACE::juce_HandleProcessFocusChange(); -} - -- (void) applicationWillUnhide: (NSNotification*) aNotification -{ - JUCE_NAMESPACE::juce_maximiseAllMinimisedWindows(); -} - -- (void) customEvent: (NSNotification*) n -{ - void* message = 0; - [((NSData*) [n object]) getBytes: &message length: sizeof (message)]; - - if (message != 0) - JUCE_NAMESPACE::MessageManager::getInstance()->deliverMessage (message); -} - -- (void) performCallback: (id) info -{ - JUCE_NAMESPACE::CallbackMessagePayload* pl = (JUCE_NAMESPACE::CallbackMessagePayload*) info; - - if (pl != 0) - { - pl->result = (*pl->function) (pl->parameter); - pl->hasBeenExecuted = true; - } -} - -@end -#endif - -BEGIN_JUCE_NAMESPACE - - -#if JUCE_COCOA -static JuceAppDelegate* juceAppDelegate = 0; - -#else -static int kJUCEClass = FOUR_CHAR_CODE ('JUCE'); -const int kJUCEKind = 1; -const int kCallbackKind = 2; - - -static pascal OSStatus EventHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - void* event = 0; - GetEventParameter (theEvent, 'mess', typeVoidPtr, 0, sizeof (void*), 0, &event); - - if (event != 0) - MessageManager::getInstance()->deliverMessage (event); - - return noErr; -} - -static pascal OSStatus CallbackHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - CallbackMessagePayload* pl = 0; - GetEventParameter (theEvent, 'mess', typeVoidPtr, 0, sizeof(pl), 0, &pl); - - if (pl != 0) - { - pl->result = (*pl->function) (pl->parameter); - pl->hasBeenExecuted = true; - } - - return noErr; -} - -static pascal OSStatus MouseClickHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof(::Point), 0, &where); - WindowRef window; - if (FindWindow (where, &window) == inMenuBar) - { - // turn off the wait cursor before going in here.. - const int oldTimeBeforeWaitCursor = MessageManager::getInstance()->getTimeBeforeShowingWaitCursor(); - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); - - if (Component::getCurrentlyModalComponent() != 0) - Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); - - juce_MainMenuAboutToBeUsed(); - MenuSelect (where); - HiliteMenu (0); - - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (oldTimeBeforeWaitCursor); - return noErr; - } - - return eventNotHandledErr; -} - -static pascal OSErr QuitAppleEventHandler (const AppleEvent *appleEvt, AppleEvent* reply, long refcon) -{ - if (JUCEApplication::getInstance() != 0) - JUCEApplication::getInstance()->systemRequestedQuit(); - - return noErr; -} - -static pascal OSErr OpenDocEventHandler (const AppleEvent *appleEvt, AppleEvent* reply, long refcon) -{ - AEDescList docs; - StringArray files; - - if (AEGetParamDesc (appleEvt, keyDirectObject, typeAEList, &docs) == noErr) - { - long num; - if (AECountItems (&docs, &num) == noErr) - { - for (int i = 1; i <= num; ++i) - { - FSRef file; - AEKeyword keyword; - DescType type; - Size size; - - if (AEGetNthPtr (&docs, i, typeFSRef, &keyword, &type, - &file, sizeof (file), &size) == noErr) - { - const String path (PlatformUtilities::makePathFromFSRef (&file)); - - if (path.isNotEmpty()) - files.add (path.quoted()); - } - } - - if (files.size() > 0 - && JUCEApplication::getInstance() != 0) - { - JUCE_TRY - { - JUCEApplication::getInstance() - ->anotherInstanceStarted (files.joinIntoString (T(" "))); - } - JUCE_CATCH_ALL - } - } - - AEDisposeDesc (&docs); - }; - - return noErr; -} - -static pascal OSStatus AppEventHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - const UInt32 eventClass = GetEventClass (theEvent); - - if (eventClass == kEventClassCommand) - { - HICommand command; - - if (GetEventParameter (theEvent, kEventParamHICommand, typeHICommand, 0, sizeof (command), 0, &command) == noErr - || GetEventParameter (theEvent, kEventParamDirectObject, typeHICommand, 0, sizeof (command), 0, &command) == noErr) - { - if (command.commandID == kHICommandQuit) - { - if (JUCEApplication::getInstance() != 0) - JUCEApplication::getInstance()->systemRequestedQuit(); - - return noErr; - } - else if (command.commandID == kHICommandMaximizeAll - || command.commandID == kHICommandMaximizeWindow - || command.commandID == kHICommandBringAllToFront) - { - juce_maximiseAllMinimisedWindows(); - return noErr; - } - else - { - juce_InvokeMainMenuCommand (command); - } - } - } - else if (eventClass == kEventClassApplication) - { - if (GetEventKind (theEvent) == kEventAppFrontSwitched) - { - juce_HandleProcessFocusChange(); - } - else if (GetEventKind (theEvent) == kEventAppShown) - { - // this seems to blank the windows, so we need to do a repaint.. - for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) - { - Component* const c = Desktop::getInstance().getComponent (i); - - if (c != 0) - c->repaint(); - } - } - } - - return eventNotHandledErr; -} - -static EventQueueRef mainQueue; -static EventHandlerRef juceEventHandler = 0; -static EventHandlerRef callbackEventHandler = 0; - -#endif - -//============================================================================== -void MessageManager::doPlatformSpecificInitialisation() -{ - static bool initialised = false; - - if (! initialised) - { - initialised = true; - -#if JUCE_COCOA - // if we're linking a Juce app to one or more dynamic libraries, we'll need different values - // for this so each module doesn't interfere with the others. - UnsignedWide t; - Microseconds (&t); - kJUCEClass ^= t.lo; - - juceMessageName = juceStringToNS ("juce_" + String::toHexString ((int) t.lo)); - - juceAppDelegate = [[JuceAppDelegate alloc] init]; -#else - mainQueue = GetMainEventQueue(); -#endif - } - -#if ! JUCE_COCOA - const EventTypeSpec type1 = { kJUCEClass, kJUCEKind }; - InstallApplicationEventHandler (NewEventHandlerUPP (EventHandlerProc), 1, &type1, 0, &juceEventHandler); - - const EventTypeSpec type2 = { kJUCEClass, kCallbackKind }; - InstallApplicationEventHandler (NewEventHandlerUPP (CallbackHandlerProc), 1, &type2, 0, &callbackEventHandler); - - // only do this stuff if we're running as an application rather than a library.. - if (JUCEApplication::getInstance() != 0) - { - const EventTypeSpec type3 = { kEventClassMouse, kEventMouseDown }; - InstallApplicationEventHandler (NewEventHandlerUPP (MouseClickHandlerProc), 1, &type3, 0, 0); - - const EventTypeSpec type4[] = { { kEventClassApplication, kEventAppShown }, - { kEventClassApplication, kEventAppFrontSwitched }, - { kEventClassCommand, kEventProcessCommand } }; - - InstallApplicationEventHandler (NewEventHandlerUPP (AppEventHandlerProc), 3, type4, 0, 0); - - AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerUPP (QuitAppleEventHandler), 0, false); - - AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerUPP (OpenDocEventHandler), 0, false); - } -#endif -} - -void MessageManager::doPlatformSpecificShutdown() -{ - if (juceEventHandler != 0) - { - RemoveEventHandler (juceEventHandler); - juceEventHandler = 0; - } - - if (callbackEventHandler != 0) - { - RemoveEventHandler (callbackEventHandler); - callbackEventHandler = 0; - } -} - -bool juce_postMessageToSystemQueue (void* message) -{ -#if JUCE_COCOA - [[NSNotificationCenter defaultCenter] postNotificationName: juceMessageName - object: [NSData dataWithBytes: &message - length: (int) sizeof (message)]]; - - return true; - -#else - jassert (mainQueue == GetMainEventQueue()); - - EventRef event; - if (CreateEvent (0, kJUCEClass, kJUCEKind, 0, kEventAttributeUserEvent, &event) == noErr) - { - SetEventParameter (event, 'mess', typeVoidPtr, sizeof (void*), &message); - const bool ok = PostEventToQueue (mainQueue, event, kEventPriorityStandard) == noErr; - ReleaseEvent (event); - return ok; - } - - return false; -#endif -} - -void MessageManager::broadcastMessage (const String& value) throw() -{ -} - -void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback, - void* data) -{ - if (isThisTheMessageThread()) - { - return (*callback) (data); - } - else - { - CallbackMessagePayload cmp; - cmp.function = callback; - cmp.parameter = data; - cmp.result = 0; - cmp.hasBeenExecuted = false; - -#if JUCE_COCOA - [juceAppDelegate performSelectorOnMainThread: @selector (performCallback:) - withObject: (id) &cmp - waitUntilDone: YES]; - - return cmp.result; - -#else - jassert (mainQueue == GetMainEventQueue()); - - EventRef event; - if (CreateEvent (0, kJUCEClass, kCallbackKind, 0, kEventAttributeUserEvent, &event) == noErr) - { - void* v = &cmp; - SetEventParameter (event, 'mess', typeVoidPtr, sizeof (void*), &v); - - if (PostEventToQueue (mainQueue, event, kEventPriorityStandard) == noErr) - { - while (! cmp.hasBeenExecuted) - Thread::yield(); - - return cmp.result; - } - } - - return 0; -#endif - } -} - -END_JUCE_NAMESPACE diff --git a/build/macosx/platform_specific_code/juce_mac_MiscUtilities.mm b/build/macosx/platform_specific_code/juce_mac_MiscUtilities.mm new file mode 100644 index 0000000000..8eb3d3e9aa --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_MiscUtilities.mm @@ -0,0 +1,238 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + + +//============================================================================== +ScopedAutoReleasePool::ScopedAutoReleasePool() +{ + pool = [[NSAutoreleasePool alloc] init]; +} + +ScopedAutoReleasePool::~ScopedAutoReleasePool() +{ + [((NSAutoreleasePool*) pool) release]; +} + +//============================================================================== +void PlatformUtilities::beep() +{ + NSBeep(); +} + +//============================================================================== +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) +{ + const ScopedAutoReleasePool pool; + return NSRunAlertPanel (juceStringToNS (title), + juceStringToNS (bodyText), + @"Ok", + isOkCancel ? @"Cancel" : nil, + nil) == 0; +} + +//============================================================================== +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +{ + if (files.size() == 0) + return false; + + Component* sourceComp = Component::getComponentUnderMouse(); + + if (sourceComp == 0) + { + jassertfalse // this method must be called in response to a + // component's mouseDrag event! + return false; + } + + const ScopedAutoReleasePool pool; + + NSView* view = (NSView*) sourceComp->getWindowHandle(); + + if (view == 0) + return false; + + NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; + [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] + owner: nil]; + + NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4]; + for (int i = 0; i < files.size(); ++i) + [filesArray addObject: juceStringToNS (files[i])]; + + [pboard setPropertyList: filesArray + forType: NSFilenamesPboardType]; + + NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow] + fromView: nil]; + dragPosition.x -= 16; + dragPosition.y -= 16; + + [view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])] + at: dragPosition + offset: NSMakeSize (0, 0) + event: [[view window] currentEvent] + pasteboard: pboard + source: view + slideBack: YES]; + + return true; +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +{ + jassertfalse // not implemented! + return false; +} + +//============================================================================== +bool Desktop::canUseSemiTransparentWindows() throw() +{ + return true; +} + +void Desktop::getMousePosition (int& x, int& y) throw() +{ + const ScopedAutoReleasePool pool; + const NSPoint p ([NSEvent mouseLocation]); + x = roundFloatToInt (p.x); + y = roundFloatToInt ([[NSScreen mainScreen] frame].size.height - p.y); +} + +void Desktop::setMousePosition (int x, int y) throw() +{ + // this rubbish needs to be done around the warp call, to avoid causing a + // bizarre glitch.. + CGAssociateMouseAndMouseCursorPosition (false); + CGSetLocalEventsSuppressionInterval (0); + + CGPoint pos = { x, y }; + CGWarpMouseCursorPosition (pos); + + CGAssociateMouseAndMouseCursorPosition (true); +} + +//============================================================================== +#if MACOS_10_4_OR_EARLIER +class ScreenSaverDefeater : public Timer, + public DeletedAtShutdown +{ +public: + ScreenSaverDefeater() throw() + { + startTimer (10000); + timerCallback(); + } + + ~ScreenSaverDefeater() {} + + void timerCallback() + { + if (Process::isForegroundProcess()) + UpdateSystemActivity (UsrActivity); + } +}; + +static ScreenSaverDefeater* screenSaverDefeater = 0; + +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() +{ + if (screenSaverDefeater == 0) + screenSaverDefeater = new ScreenSaverDefeater(); +} + +bool Desktop::isScreenSaverEnabled() throw() +{ + return screenSaverDefeater == 0; +} + +#else +//============================================================================== +static IOPMAssertionID screenSaverDisablerID = 0; + +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() +{ + if (isEnabled) + { + if (screenSaverDisablerID != 0) + { + IOPMAssertionRelease (screenSaverDisablerID); + screenSaverDisablerID = 0; + } + } + else + { + if (screenSaverDisablerID == 0) + { + IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, + kIOPMAssertionLevelOn, &screenSaverDisablerID); + } + } +} + +bool Desktop::isScreenSaverEnabled() throw() +{ + return screenSaverDisablerID == 0; +} + +#endif + +//============================================================================== +void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() +{ + const ScopedAutoReleasePool pool; + monitorCoords.clear(); + NSArray* screens = [NSScreen screens]; + const float mainScreenBottom = [[NSScreen mainScreen] frame].size.height; + + for (int i = 0; i < [screens count]; ++i) + { + NSScreen* s = (NSScreen*) [screens objectAtIndex: i]; + + NSRect r = clipToWorkArea ? [s visibleFrame] + : [s frame]; + + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) (mainScreenBottom - (r.origin.y + r.size.height)), + (int) r.size.width, + (int) r.size.height)); + } + + jassert (monitorCoords.size() > 0); +} + +#endif \ No newline at end of file diff --git a/build/macosx/platform_specific_code/juce_mac_MouseCursor.mm b/build/macosx/platform_specific_code/juce_mac_MouseCursor.mm new file mode 100644 index 0000000000..3cc5aaf711 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_MouseCursor.mm @@ -0,0 +1,196 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +static NSImage* juceImageToNSImage (const Image& image) +{ + const ScopedAutoReleasePool pool; + int lineStride, pixelStride; + const uint8* pixels = image.lockPixelDataReadOnly (0, 0, image.getWidth(), image.getHeight(), + lineStride, pixelStride); + + NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes: NULL + pixelsWide: image.getWidth() + pixelsHigh: image.getHeight() + bitsPerSample: 8 + samplesPerPixel: image.hasAlphaChannel() ? 4 : 3 + hasAlpha: image.hasAlphaChannel() + isPlanar: NO + colorSpaceName: NSCalibratedRGBColorSpace + bitmapFormat: (NSBitmapFormat) 0 + bytesPerRow: lineStride + bitsPerPixel: pixelStride * 8]; + + unsigned char* newData = [rep bitmapData]; + memcpy (newData, pixels, lineStride * image.getHeight()); + image.releasePixelDataReadOnly (pixels); + + NSImage* im = [[NSImage alloc] init]; + [im addRepresentation: rep]; + [rep release]; + + return im; +} + +//============================================================================== +void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() +{ + NSImage* im = juceImageToNSImage (image); + NSCursor* c = [[NSCursor alloc] initWithImage: im + hotSpot: NSMakePoint (hotspotX, hotspotY)]; + [im release]; + + return (void*) c; +} + +static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() +{ + Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); + jassert (im != 0); + + if (im == 0) + return 0; + + void* const curs = juce_createMouseCursorFromImage (*im, + (int) (hx * im->getWidth()), + (int) (hy * im->getHeight())); + delete im; + return curs; +} + +static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) +{ + File f ("/System/Library/Frameworks/WebKit.framework/Frameworks/WebCore.framework/Resources"); + + MemoryBlock mb; + if (f.getChildFile (filename).loadFileAsData (mb)) + return juce_cursorFromData ((const unsigned char*) mb.getData(), mb.getSize(), hx, hy); + + return 0; +} + +void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() +{ + const ScopedAutoReleasePool pool; + NSCursor* c = 0; + + switch (type) + { + case MouseCursor::NormalCursor: + c = [NSCursor arrowCursor]; + break; + + case MouseCursor::NoCursor: + { + Image blank (Image::ARGB, 8, 8, true); + return juce_createMouseCursorFromImage (blank, 0, 0); + } + + case MouseCursor::DraggingHandCursor: + c = [NSCursor openHandCursor]; + break; + + case MouseCursor::CopyingCursor: + return juce_cursorFromWebKitFile ("copyCursor.png", 0, 0); + + case MouseCursor::WaitCursor: + c = [NSCursor arrowCursor]; // avoid this on the mac, let the OS provide the beachball + break; + //return juce_cursorFromWebKitFile ("waitCursor.png", 0.5f, 0.5f); + + case MouseCursor::IBeamCursor: + c = [NSCursor IBeamCursor]; + break; + + case MouseCursor::PointingHandCursor: + c = [NSCursor pointingHandCursor]; + break; + + case MouseCursor::LeftRightResizeCursor: + c = [NSCursor resizeLeftRightCursor]; + break; + + case MouseCursor::LeftEdgeResizeCursor: + c = [NSCursor resizeLeftCursor]; + break; + + case MouseCursor::RightEdgeResizeCursor: + c = [NSCursor resizeRightCursor]; + break; + + case MouseCursor::UpDownResizeCursor: + case MouseCursor::TopEdgeResizeCursor: + case MouseCursor::BottomEdgeResizeCursor: + return juce_cursorFromWebKitFile ("northSouthResizeCursor.png", 0.5f, 0.5f); + + case MouseCursor::TopLeftCornerResizeCursor: + case MouseCursor::BottomRightCornerResizeCursor: + return juce_cursorFromWebKitFile ("northWestSouthEastResizeCursor.png", 0.5f, 0.5f); + + case MouseCursor::TopRightCornerResizeCursor: + case MouseCursor::BottomLeftCornerResizeCursor: + return juce_cursorFromWebKitFile ("northEastSouthWestResizeCursor.png", 0.5f, 0.5f); + + case MouseCursor::UpDownLeftRightResizeCursor: + return juce_cursorFromWebKitFile ("moveCursor.png", 0.5f, 0.5f); + + case MouseCursor::CrosshairCursor: + c = [NSCursor crosshairCursor]; + break; + } + + [c retain]; + return (void*) c; +} + +void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() +{ + NSCursor* c = (NSCursor*) cursorHandle; + [c release]; +} + +void MouseCursor::showInAllWindows() const throw() +{ + showInWindow (0); +} + +void MouseCursor::showInWindow (ComponentPeer*) const throw() +{ + NSCursor* const c = (NSCursor*) getHandle(); + [c set]; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_NSViewComponent.mm b/build/macosx/platform_specific_code/juce_mac_NSViewComponent.mm new file mode 100644 index 0000000000..d1a24ed03b --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_NSViewComponent.mm @@ -0,0 +1,149 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +class NSViewComponentInternal : public ComponentMovementWatcher +{ + Component* const owner; + NSViewComponentPeer* currentPeer; + bool wasShowing; + +public: + NSView* view; + + //============================================================================== + NSViewComponentInternal (NSView* view_, Component* const owner_) + : ComponentMovementWatcher (owner_), + owner (owner_), + wasShowing (false), + currentPeer (0), + view (view_) + { + [view retain]; + + if (owner_->isShowing()) + componentPeerChanged(); + } + + ~NSViewComponentInternal() + { + [view removeFromSuperview]; + [view release]; + } + + //============================================================================== + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) + { + Component* const topComp = owner->getTopLevelComponent(); + + if (topComp->getPeer() != 0) + { + int x = 0, y = 0; + owner->relativePositionToOtherComponent (topComp, x, y); + + NSRect r; + r.origin.x = (float) x; + r.origin.y = (float) y; + r.size.width = (float) owner->getWidth(); + r.size.height = (float) owner->getHeight(); + r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height); + + [view setFrame: r]; + } + } + + void componentPeerChanged() + { + NSViewComponentPeer* const peer = dynamic_cast (owner->getPeer()); + + if (currentPeer != peer) + { + [view removeFromSuperview]; + currentPeer = peer; + + if (peer != 0) + { + [peer->view addSubview: view]; + componentMovedOrResized (false, false); + } + } + + [view setHidden: ! owner->isShowing()]; + } + + void componentVisibilityChanged (Component&) + { + componentPeerChanged(); + } + + juce_UseDebuggingNewOperator + +private: + NSViewComponentInternal (const NSViewComponentInternal&); + const NSViewComponentInternal& operator= (const NSViewComponentInternal&); +}; + +//============================================================================== +NSViewComponent::NSViewComponent() + : info (0) +{ +} + +NSViewComponent::~NSViewComponent() +{ + delete info; +} + +void NSViewComponent::setView (void* view) +{ + if (view != getView()) + { + deleteAndZero (info); + + if (view != 0) + info = new NSViewComponentInternal ((NSView*) view, this); + } +} + +void* NSViewComponent::getView() const +{ + return info == 0 ? 0 : info->view; +} + +void NSViewComponent::paint (Graphics& g) +{ +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm b/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm new file mode 100644 index 0000000000..c0b6c3d54a --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_NSViewComponentPeer.mm @@ -0,0 +1,1258 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +class NSViewComponentPeer; + +static int currentModifiers = 0; + +//============================================================================== +END_JUCE_NAMESPACE + +static void updateModifiers (NSEvent* e); + +using namespace JUCE_NAMESPACE; + +@interface JuceNSView : NSView +{ +@public + NSViewComponentPeer* owner; +} + +- (JuceNSView*) initWithOwner: (NSViewComponentPeer*) owner withFrame: (NSRect) frame; +- (void) dealloc; + +- (BOOL) isOpaque; +- (void) drawRect: (NSRect) r; + +- (void) mouseDown: (NSEvent*) ev; +- (void) mouseUp: (NSEvent*) ev; +- (void) mouseDragged: (NSEvent*) ev; +- (void) mouseMoved: (NSEvent*) ev; +- (void) mouseEntered: (NSEvent*) ev; +- (void) mouseExited: (NSEvent*) ev; +- (void) rightMouseDown: (NSEvent*) ev; +- (void) rightMouseDragged: (NSEvent*) ev; +- (void) rightMouseUp: (NSEvent*) ev; +- (void) scrollWheel: (NSEvent*) ev; +- (BOOL) acceptsFirstMouse: (NSEvent*) ev; +- (void) frameChanged: (NSNotification*) n; + +- (void) keyDown: (NSEvent*) ev; +- (void) keyUp: (NSEvent*) ev; +- (void) flagsChanged: (NSEvent*) ev; +#if MACOS_10_4_OR_EARLIER +- (BOOL) performKeyEquivalent: (NSEvent*) ev; +#endif + +- (BOOL) becomeFirstResponder; +- (BOOL) resignFirstResponder; + +- (NSArray*) getSupportedDragTypes; +- (BOOL) sendDragCallback: (int) type sender: (id ) sender; +- (NSDragOperation) draggingEntered: (id ) sender; +- (NSDragOperation) draggingUpdated: (id ) sender; +- (void) draggingEnded: (id ) sender; +- (void) draggingExited: (id ) sender; +- (BOOL) prepareForDragOperation: (id ) sender; +- (BOOL) performDragOperation: (id ) sender; +- (void) concludeDragOperation: (id ) sender; + +@end + +//============================================================================== +@interface JuceNSWindow : NSWindow +{ + NSViewComponentPeer* owner; +} + +- (void) setOwner: (NSViewComponentPeer*) owner; +- (BOOL) canBecomeKeyWindow; +- (BOOL) windowShouldClose: (id) window; + +@end + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +class NSViewComponentPeer : public ComponentPeer +{ +public: + NSViewComponentPeer (Component* const component, + const int windowStyleFlags, + NSView* viewToAttachTo); + + ~NSViewComponentPeer(); + + //============================================================================== + void* getNativeHandle() const; + void setVisible (bool shouldBeVisible); + void setTitle (const String& title); + void setPosition (int x, int y); + void setSize (int w, int h); + void setBounds (int x, int y, int w, int h, const bool isNowFullScreen); + void getBounds (int& x, int& y, int& w, int& h, const bool global) const; + void getBounds (int& x, int& y, int& w, int& h) const; + int getScreenX() const; + int getScreenY() const; + void relativePositionToGlobal (int& x, int& y); + void globalPositionToRelative (int& x, int& y); + void setMinimised (bool shouldBeMinimised); + bool isMinimised() const; + void setFullScreen (bool shouldBeFullScreen); + bool isFullScreen() const; + bool contains (int x, int y, bool trueIfInAChildWindow) const; + const BorderSize getFrameSize() const; + bool setAlwaysOnTop (bool alwaysOnTop); + void toFront (bool makeActiveWindow); + void toBehind (ComponentPeer* other); + void setIcon (const Image& newIcon); + bool handleKeyEvent (NSEvent* ev, bool isKeyDown); + + //============================================================================== + void viewFocusGain(); + void viewFocusLoss(); + bool isFocused() const; + void grabFocus(); + void textInputRequired (int x, int y); + + //============================================================================== + void repaint (int x, int y, int w, int h); + void performAnyPendingRepaintsNow(); + + //============================================================================== + juce_UseDebuggingNewOperator + + NSWindow* window; + JuceNSView* view; + bool isSharedWindow, fullScreen; +}; + +//============================================================================== +class JuceNSImage +{ +public: + JuceNSImage (const int width, const int height, const bool hasAlpha) + : juceImage (hasAlpha ? Image::ARGB : Image::RGB, + width, height, hasAlpha) + { + lineStride = 0; + pixelStride = 0; + imageData = juceImage.lockPixelDataReadWrite (0, 0, width, height, + lineStride, pixelStride); + + imageRep = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes: &imageData + pixelsWide: width + pixelsHigh: height + bitsPerSample: 8 + samplesPerPixel: pixelStride + hasAlpha: hasAlpha + isPlanar: NO + colorSpaceName: NSCalibratedRGBColorSpace + bitmapFormat: /*NSAlphaFirstBitmapFormat*/ (NSBitmapFormat) 0 + bytesPerRow: lineStride + bitsPerPixel: 8 * pixelStride ]; + + juceImage.releasePixelDataReadWrite (imageData); + } + + ~JuceNSImage() + { + [imageRep release]; + } + + Image& getJuceImage() throw() { return juceImage; } + + void draw (const float x, const float y, + const RectangleList& clip, + const int originX, const int originY) const + { + // Our data is BGRA and the damned image rep only takes RGBA, so + // we need to byte-swap the active areas if there's an alpha channel... + if (juceImage.hasAlphaChannel()) + { + RectangleList::Iterator iter (clip); + while (iter.next()) + { + const Rectangle* const r = iter.getRectangle(); + + swapRGBOrder (r->getX() + originX, + r->getY() + originY, + r->getWidth(), + r->getHeight()); + } + } + + NSPoint p; + p.x = x; + p.y = y; + [imageRep drawAtPoint: p]; + } + + void drawNSImage (NSImage* imageToDraw) + { + const ScopedAutoReleasePool pool; + + [NSGraphicsContext setCurrentContext: + [NSGraphicsContext graphicsContextWithBitmapImageRep: imageRep]]; + + [imageToDraw drawAtPoint: NSZeroPoint + fromRect: NSMakeRect (0, 0, [imageToDraw size].width, [imageToDraw size].height) + operation: NSCompositeSourceOver + fraction: 1.0f]; + + [[NSGraphicsContext currentContext] flushGraphics]; + + if (juceImage.hasAlphaChannel()) + swapRGBOrder (0, 0, juceImage.getWidth(), juceImage.getHeight()); + } + +private: + Image juceImage; + NSBitmapImageRep* imageRep; + uint8* imageData; + int pixelStride, lineStride; + + void swapRGBOrder (const int x, const int y, const int w, int h) const + { + jassert (Rectangle (0, 0, juceImage.getWidth(), juceImage.getHeight()) + .contains (Rectangle (x, y, w, h))); + + uint8* start = imageData + x * pixelStride + y * lineStride; + + while (--h >= 0) + { + uint8* p = start; + start += lineStride; + + for (int i = w; --i >= 0;) + { + const uint8 temp = p[0]; + p[0] = p[2]; + p[2] = temp; + + p += pixelStride; + } + } + } +}; + +//============================================================================== +static ComponentPeer* currentlyFocusedPeer = 0; +static VoidArray keysCurrentlyDown; + +bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +{ + if (keysCurrentlyDown.contains ((void*) keyCode)) + return true; + + if (keyCode >= 'A' && keyCode <= 'Z' + && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toLowerCase ((tchar) keyCode))) + return true; + + if (keyCode >= 'a' && keyCode <= 'z' + && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toUpperCase ((tchar) keyCode))) + return true; + + return false; +} + +static int getKeyCodeFromEvent (NSEvent* ev) +{ + String unicode (nsStringToJuce ([ev characters])); + String unmodified (nsStringToJuce ([ev charactersIgnoringModifiers])); + int keyCode = unmodified[0]; + + if (keyCode == 0x19) // (backwards-tab) + keyCode = 9; + + return keyCode; +} + +static void updateKeysDown (NSEvent* ev, bool isKeyDown) +{ + updateModifiers (ev); + int keyCode = getKeyCodeFromEvent (ev); + + if (keyCode != 0) + { + if (isKeyDown) + keysCurrentlyDown.addIfNotAlreadyThere ((void*) keyCode); + else + keysCurrentlyDown.removeValue ((void*) keyCode); + } +} + +const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() +{ + return ModifierKeys (currentModifiers); +} + +void ModifierKeys::updateCurrentModifiers() throw() +{ + currentModifierFlags = currentModifiers; +} + +//============================================================================== +END_JUCE_NAMESPACE + +@implementation JuceNSView + +- (JuceNSView*) initWithOwner: (NSViewComponentPeer*) owner_ + withFrame: (NSRect) frame +{ + [super initWithFrame: frame]; + owner = owner_; + + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector (frameChanged:) + name: NSViewFrameDidChangeNotification + object: self]; + + if (! owner_->isSharedWindow) + { + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector (frameChanged:) + name: NSWindowDidMoveNotification + object: owner_->window]; + } + + [self registerForDraggedTypes: [self getSupportedDragTypes]]; + + return self; +} + +- (void) dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver: self]; + [super dealloc]; +} + +//============================================================================== +- (void) drawRect: (NSRect) r +{ + if (r.size.width < 1.0f || r.size.height < 1.0f || owner == 0) + return; + + const float y = [self frame].size.height - (r.origin.y + r.size.height); + + JuceNSImage temp ((int) (r.size.width + 0.5f), + (int) (r.size.height + 0.5f), + ! owner->getComponent()->isOpaque()); + + LowLevelGraphicsSoftwareRenderer context (temp.getJuceImage()); + const int originX = -roundFloatToInt (r.origin.x); + const int originY = -roundFloatToInt (y); + context.setOrigin (originX, originY); + + const NSRect* rects = 0; + NSInteger numRects = 0; + [self getRectsBeingDrawn: &rects count: &numRects]; + + RectangleList clip; + for (int i = 0; i < numRects; ++i) + { + clip.addWithoutMerging (Rectangle (roundFloatToInt (rects[i].origin.x), + roundFloatToInt ([self frame].size.height - (rects[i].origin.y + rects[i].size.height)), + roundFloatToInt (rects[i].size.width), + roundFloatToInt (rects[i].size.height))); + } + + if (context.reduceClipRegion (clip)) + { + owner->handlePaint (context); + temp.draw (r.origin.x, r.origin.y, clip, originX, originY); + } +} + +- (BOOL) isOpaque +{ + if (owner == 0) + return true; + + if (! owner->getComponent()->isValidComponent()) + return false; + + return owner->getComponent()->isOpaque(); +} + +//============================================================================== +static int64 getMouseTime (NSEvent* e) { return (int64) [e timestamp] * 1000.0; } + +static void getMousePos (NSEvent* e, NSView* view, int& x, int& y) +{ + NSPoint p = [view convertPoint: [e locationInWindow] fromView: nil]; + x = roundFloatToInt (p.x); + y = roundFloatToInt ([view frame].size.height - p.y); +} + +static void updateModifiers (NSEvent* e) +{ + int m = currentModifiers & ~(ModifierKeys::shiftModifier | ModifierKeys::ctrlModifier + | ModifierKeys::altModifier | ModifierKeys::commandModifier); + + if ((e.modifierFlags & NSShiftKeyMask) != 0) + m |= ModifierKeys::shiftModifier; + + if ((e.modifierFlags & NSControlKeyMask) != 0) + m |= ModifierKeys::ctrlModifier; + + if ((e.modifierFlags & NSAlternateKeyMask) != 0) + m |= ModifierKeys::altModifier; + + if ((e.modifierFlags & NSCommandKeyMask) != 0) + m |= ModifierKeys::commandModifier; + + currentModifiers = m; +} + +static int getModifierForButtonNumber (const int num) throw() +{ + return num == 0 ? ModifierKeys::leftButtonModifier + : (num == 1 ? ModifierKeys::rightButtonModifier + : (num == 2 ? ModifierKeys::middleButtonModifier : 0)); +} + +- (void) mouseDown: (NSEvent*) ev +{ + updateModifiers (ev); + currentModifiers |= getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseDown (x, y, getMouseTime (ev)); +} + +- (void) mouseUp: (NSEvent*) ev +{ + const int oldMods = currentModifiers; + updateModifiers (ev); + currentModifiers &= ~getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseUp (oldMods, x, y, getMouseTime (ev)); +} + +- (void) mouseDragged: (NSEvent*) ev +{ + updateModifiers (ev); + currentModifiers |= getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseDrag (x, y, getMouseTime (ev)); +} + +- (void) mouseMoved: (NSEvent*) ev +{ + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseMove (x, y, getMouseTime (ev)); +} + +- (void) mouseEntered: (NSEvent*) ev +{ + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseEnter (x, y, getMouseTime (ev)); +} + +- (void) mouseExited: (NSEvent*) ev +{ + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseExit (x, y, getMouseTime (ev)); +} + +- (void) rightMouseDown: (NSEvent*) ev +{ + [self mouseDown: ev]; +} + +- (void) rightMouseDragged: (NSEvent*) ev +{ + [self mouseDragged: ev]; +} + +- (void) rightMouseUp: (NSEvent*) ev +{ + [self mouseUp: ev]; +} + +- (void) scrollWheel: (NSEvent*) ev +{ + updateModifiers (ev); + + if (owner != 0) + owner->handleMouseWheel (roundFloatToInt ([ev deltaX] * 10.0f), + roundFloatToInt ([ev deltaY] * 10.0f), + getMouseTime (ev)); +} + +- (BOOL) acceptsFirstMouse: (NSEvent*) ev +{ + return YES; +} + +- (void) frameChanged: (NSNotification*) n +{ + if (owner != 0) + owner->handleMovedOrResized(); +} + +//============================================================================== +- (void) keyDown: (NSEvent*) ev +{ + bool used = false; + + if (owner != 0) + { + updateKeysDown (ev, true); + used = owner->handleKeyEvent (ev, true); + + if ((ev.modifierFlags & NSCommandKeyMask) != 0) + { + // for command keys, the key-up event is thrown away, so simulate one.. + updateKeysDown (ev, false); + used = owner->handleKeyEvent (ev, false) || used; + } + } + + if (! used) + [super keyDown: ev]; +} + +- (void) keyUp: (NSEvent*) ev +{ + updateKeysDown (ev, false); + + if (owner == 0 || ! owner->handleKeyEvent (ev, false)) + [super keyUp: ev]; +} + +- (void) flagsChanged: (NSEvent*) ev +{ + updateModifiers (ev); + + if (owner != 0) + owner->handleModifierKeysChange(); +} + +#if MACOS_10_4_OR_EARLIER +- (BOOL) performKeyEquivalent: (NSEvent*) ev +{ + if (owner != 0) + { + updateKeysDown (ev, true); + const bool used1 = owner->handleKeyEvent (ev, true); + updateKeysDown (ev, false); + const bool used2 = owner->handleKeyEvent (ev, false); + + if (used1 || used2) + return true; + } + + return [super performKeyEquivalent: ev]; +} +#endif + +- (BOOL) becomeFirstResponder +{ + if (owner != 0) + owner->viewFocusGain(); + + return true; +} + +- (BOOL) resignFirstResponder +{ + if (owner != 0) + owner->viewFocusLoss(); + + return true; +} + +//============================================================================== +- (NSArray*) getSupportedDragTypes +{ + return [NSArray arrayWithObjects: NSFilenamesPboardType, /*NSFilesPromisePboardType, NSStringPboardType,*/ nil]; +} + +- (BOOL) sendDragCallback: (int) type sender: (id ) sender +{ + NSString* bestType + = [[sender draggingPasteboard] availableTypeFromArray: [self getSupportedDragTypes]]; + + if (bestType == nil) + return false; + + NSPoint p = [self convertPoint: [sender draggingLocation] fromView: nil]; + int x = (int) p.x; + int y = (int) ([self frame].size.height - p.y); + + StringArray files; + + id list = [[sender draggingPasteboard] propertyListForType: bestType]; + if (list == nil) + return false; + + if ([list isKindOfClass: [NSArray class]]) + { + NSArray* items = (NSArray*) list; + + for (int i = 0; i < [items count]; ++i) + files.add (nsStringToJuce ((NSString*) [items objectAtIndex: i])); + } + + if (files.size() == 0) + return false; + + if (type == 0) + owner->handleFileDragMove (files, x, y); + else if (type == 1) + owner->handleFileDragExit (files); + else if (type == 2) + owner->handleFileDragDrop (files, x, y); + + return true; +} + +- (NSDragOperation) draggingEntered: (id ) sender +{ + if ([self sendDragCallback: 0 sender: sender]) + return NSDragOperationCopy | NSDragOperationMove | NSDragOperationGeneric; + else + return NSDragOperationNone; +} + +- (NSDragOperation) draggingUpdated: (id ) sender +{ + if ([self sendDragCallback: 0 sender: sender]) + return NSDragOperationCopy | NSDragOperationMove | NSDragOperationGeneric; + else + return NSDragOperationNone; +} + +- (void) draggingEnded: (id ) sender +{ + [self sendDragCallback: 1 sender: sender]; +} + +- (void) draggingExited: (id ) sender +{ + [self sendDragCallback: 1 sender: sender]; +} + +- (BOOL) prepareForDragOperation: (id ) sender +{ + return YES; +} + +- (BOOL) performDragOperation: (id ) sender +{ + return [self sendDragCallback: 2 sender: sender]; +} + +- (void) concludeDragOperation: (id ) sender +{ +} + +@end + +//============================================================================== +@implementation JuceNSWindow + +- (void) setOwner: (NSViewComponentPeer*) owner_ +{ + owner = owner_; +} + +- (BOOL) canBecomeKeyWindow +{ + // If runnin as a plugin, let the component decide whether it's + // going to allow the window to get focused. + return JUCEApplication::getInstance() != 0 + || (ComponentPeer::isValidPeer (owner) + && owner->getComponent()->getWantsKeyboardFocus()); +} + +- (BOOL) windowShouldClose: (id) window +{ + if (! ComponentPeer::isValidPeer (owner)) + return YES; + + owner->handleUserClosingWindow(); + return NO; +} + +@end + +//============================================================================== +BEGIN_JUCE_NAMESPACE + +//============================================================================== +NSViewComponentPeer::NSViewComponentPeer (Component* const component, + const int windowStyleFlags, + NSView* viewToAttachTo) + : ComponentPeer (component, windowStyleFlags), + view (0), + window (0) +{ + NSRect r; + r.origin.x = 0; + r.origin.y = 0; + r.size.width = (float) component->getWidth(); + r.size.height = (float) component->getHeight(); + + view = [[JuceNSView alloc] initWithOwner: this withFrame: r]; + [view setPostsFrameChangedNotifications: YES]; + + if (viewToAttachTo != 0) + { + window = [viewToAttachTo window]; + [viewToAttachTo addSubview: view]; + isSharedWindow = true; + } + else + { + isSharedWindow = false; + r.origin.x = (float) component->getX(); + r.origin.y = (float) component->getY(); + + unsigned int style = 0; + if ((windowStyleFlags & windowHasTitleBar) == 0) + style = NSBorderlessWindowMask; + else + style = NSTitledWindowMask; + + if ((windowStyleFlags & windowHasMinimiseButton) != 0) + style |= NSMiniaturizableWindowMask; + + if ((windowStyleFlags & windowHasCloseButton) != 0) + style |= NSClosableWindowMask; + + if ((windowStyleFlags & windowIsResizable) != 0) + style |= NSResizableWindowMask; + + window = [[JuceNSWindow alloc] initWithContentRect: r + styleMask: style + backing: NSBackingStoreBuffered + defer: YES ]; + + [((JuceNSWindow*) window) setOwner: this]; + [window setDelegate: window]; + [window setOpaque: component->isOpaque()]; + [window setHasShadow: ((windowStyleFlags & windowHasDropShadow) != 0)]; + + if (component->isAlwaysOnTop()) + [window setLevel: NSFloatingWindowLevel]; + + [window setContentView: view]; + [window setAutodisplay: YES]; + [window setAcceptsMouseMovedEvents: YES]; + [window setReleasedWhenClosed: YES]; + [window setExcludedFromWindowsMenu: (windowStyleFlags & windowIsTemporary) != 0]; + [window setIgnoresMouseEvents: (windowStyleFlags & windowIgnoresMouseClicks) != 0]; + } + + setVisible (component->isVisible()); +} + +NSViewComponentPeer::~NSViewComponentPeer() +{ + view->owner = 0; + [view removeFromSuperview]; + [view release]; + + if (! isSharedWindow) + [window close]; +} + +//============================================================================== +void* NSViewComponentPeer::getNativeHandle() const +{ + return view; +} + +void NSViewComponentPeer::setVisible (bool shouldBeVisible) +{ + if (isSharedWindow) + { + [view setHidden: ! shouldBeVisible]; + } + else + { + if (shouldBeVisible) + [window orderFront: nil]; + else + [window orderOut: nil]; + } +} + +void NSViewComponentPeer::setTitle (const String& title) +{ + const ScopedAutoReleasePool pool; + + if (! isSharedWindow) + [window setTitle: juceStringToNS (title)]; +} + +void NSViewComponentPeer::setPosition (int x, int y) +{ + setBounds (x, y, component->getWidth(), component->getHeight(), false); +} + +void NSViewComponentPeer::setSize (int w, int h) +{ + setBounds (component->getX(), component->getY(), w, h, false); +} + +void NSViewComponentPeer::setBounds (int x, int y, int w, int h, const bool isNowFullScreen) +{ + fullScreen = isNowFullScreen; + w = jmax (0, w); + h = jmax (0, h); + + NSRect r; + r.origin.x = (float) x; + r.origin.y = (float) y; + r.size.width = (float) w; + r.size.height = (float) h; + + if (isSharedWindow) + { + r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height); + + if ([view frame].size.width != r.size.width + || [view frame].size.height != r.size.height) + [view setNeedsDisplay: true]; + + [view setFrame: r]; + } + else + { + r.origin.y = [[NSScreen mainScreen] frame].size.height - (r.origin.y + r.size.height); + [window setFrame: r + display: true]; + } +} + +void NSViewComponentPeer::getBounds (int& x, int& y, int& w, int& h, const bool global) const +{ + NSRect r = [view frame]; + + if (global && [view window] != 0) + { + r = [view convertRect: r toView: nil]; + + NSRect wr = [[view window] frame]; + r.origin.x += wr.origin.x; + r.origin.y += wr.origin.y; + y = (int) ([[NSScreen mainScreen] frame].size.height - r.origin.y - r.size.height); + } + else + { + y = (int) ([[view superview] frame].size.height - r.origin.y - r.size.height); + } + + x = (int) r.origin.x; + w = (int) r.size.width; + h = (int) r.size.height; +} + +void NSViewComponentPeer::getBounds (int& x, int& y, int& w, int& h) const +{ + getBounds (x, y, w, h, ! isSharedWindow); +} + +int NSViewComponentPeer::getScreenX() const +{ + int x, y, w, h; + getBounds (x, y, w, h, true); + return x; +} + +int NSViewComponentPeer::getScreenY() const +{ + int x, y, w, h; + getBounds (x, y, w, h, true); + return y; +} + +void NSViewComponentPeer::relativePositionToGlobal (int& x, int& y) +{ + int wx, wy, ww, wh; + getBounds (wx, wy, ww, wh, true); + x += wx; + y += wy; +} + +void NSViewComponentPeer::globalPositionToRelative (int& x, int& y) +{ + int wx, wy, ww, wh; + getBounds (wx, wy, ww, wh, true); + x -= wx; + y -= wy; +} + +void NSViewComponentPeer::setMinimised (bool shouldBeMinimised) +{ + if (! isSharedWindow) + { + if (shouldBeMinimised) + [window miniaturize: nil]; + else + [window deminiaturize: nil]; + } +} + +bool NSViewComponentPeer::isMinimised() const +{ + return window != 0 && [window isMiniaturized]; +} + +void NSViewComponentPeer::setFullScreen (bool shouldBeFullScreen) +{ + if (! isSharedWindow) + { + Rectangle r (lastNonFullscreenBounds); + + setMinimised (false); + + if (fullScreen != shouldBeFullScreen) + { + if (shouldBeFullScreen) + r = Desktop::getInstance().getMainMonitorArea(); + + // (can't call the component's setBounds method because that'll reset our fullscreen flag) + if (r != getComponent()->getBounds() && ! r.isEmpty()) + setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); + } + } +} + +bool NSViewComponentPeer::isFullScreen() const +{ + return fullScreen; +} + +bool NSViewComponentPeer::contains (int x, int y, bool trueIfInAChildWindow) const +{ + if (((unsigned int) x) >= (unsigned int) component->getWidth() + || ((unsigned int) y) >= (unsigned int) component->getHeight()) + return false; + + NSPoint p; + p.x = (float) x; + p.y = (float) y; + + NSView* v = [view hitTest: p]; + + if (trueIfInAChildWindow) + return v != nil; + + return v == view; +} + +const BorderSize NSViewComponentPeer::getFrameSize() const +{ + BorderSize b; + + if (! isSharedWindow) + { + NSRect v = [view convertRect: [view frame] toView: nil]; + NSRect w = [window frame]; + + b.setTop ((int) (w.size.height - (v.origin.y + v.size.height))); + b.setBottom ((int) v.origin.y); + b.setLeft ((int) v.origin.x); + b.setRight ((int) (w.size.width - (v.origin.x + v.size.width))); + } + + return b; +} + +bool NSViewComponentPeer::setAlwaysOnTop (bool alwaysOnTop) +{ + if (! isSharedWindow) + { + [window setLevel: alwaysOnTop ? NSFloatingWindowLevel + : NSNormalWindowLevel]; + } + + return true; +} + +void NSViewComponentPeer::toFront (bool makeActiveWindow) +{ + if (isSharedWindow) + { + [[view superview] addSubview: view + positioned: NSWindowAbove + relativeTo: nil]; + } + + if (window != 0) + { + if (makeActiveWindow) + [window makeKeyAndOrderFront: nil]; + else + [window orderFront: nil]; + } +} + +void NSViewComponentPeer::toBehind (ComponentPeer* other) +{ + NSViewComponentPeer* o = (NSViewComponentPeer*) other; + + if (isSharedWindow) + { + [[view superview] addSubview: view + positioned: NSWindowBelow + relativeTo: o->view]; + } + else + { + [window orderWindow: NSWindowBelow + relativeTo: o->window != 0 ? [o->window windowNumber] + : nil ]; + } +} + +void NSViewComponentPeer::setIcon (const Image& /*newIcon*/) +{ + // to do.. +} + +//============================================================================== +void NSViewComponentPeer::viewFocusGain() +{ + const MessageManagerLock messLock; + + if (currentlyFocusedPeer != this) + { + if (ComponentPeer::isValidPeer (currentlyFocusedPeer)) + currentlyFocusedPeer->handleFocusLoss(); + + currentlyFocusedPeer = this; + + handleFocusGain(); + } +} + +void NSViewComponentPeer::viewFocusLoss() +{ + if (currentlyFocusedPeer == this) + { + currentlyFocusedPeer = 0; + handleFocusLoss(); + } +} + +void juce_HandleProcessFocusChange() +{ + keysCurrentlyDown.clear(); + + if (NSViewComponentPeer::isValidPeer (currentlyFocusedPeer)) + { + if (Process::isForegroundProcess()) + currentlyFocusedPeer->handleFocusGain(); + else + currentlyFocusedPeer->handleFocusLoss(); + } +} + +bool NSViewComponentPeer::isFocused() const +{ + return window != 0 && [window isKeyWindow]; +} + +void NSViewComponentPeer::grabFocus() +{ + if (window != 0) + { + [window makeKeyWindow]; + [window makeFirstResponder: view]; + } +} + +void NSViewComponentPeer::textInputRequired (int /*x*/, int /*y*/) +{ +} + +bool NSViewComponentPeer::handleKeyEvent (NSEvent* ev, bool isKeyDown) +{ + String unicode (nsStringToJuce ([ev characters])); + String unmodified (nsStringToJuce ([ev charactersIgnoringModifiers])); + int keyCode = getKeyCodeFromEvent (ev); + + //DBG ("unicode: " + unicode + " " + String::toHexString ((int) unicode[0])); + //DBG ("unmodified: " + unmodified + " " + String::toHexString ((int) unmodified[0])); + + if (unicode.isNotEmpty() || keyCode != 0) + { + if (isKeyDown) + { + bool used = false; + + while (unicode.length() > 0) + { + juce_wchar textCharacter = unicode[0]; + unicode = unicode.substring (1); + + used = handleKeyUpOrDown() || used; + used = handleKeyPress (keyCode, textCharacter) || used; + } + + return used; + } + else + { + if (handleKeyUpOrDown()) + return true; + } + } + + return false; +} + +//============================================================================== +void NSViewComponentPeer::repaint (int x, int y, int w, int h) +{ + [view setNeedsDisplayInRect: + NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), + (float) w, (float) h)]; +} + +void NSViewComponentPeer::performAnyPendingRepaintsNow() +{ + [view displayIfNeeded]; +} + +ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) +{ + return new NSViewComponentPeer (this, styleFlags, (NSView*) windowToAttachTo); +} + +//============================================================================== +static Image* NSImageToJuceImage (NSImage* image) +{ + JuceNSImage juceIm ((int) [image size].width, + (int) [image size].height, + true); + + juceIm.drawNSImage (image); + return juceIm.getJuceImage().createCopy(); +} + +Image* juce_createIconForFile (const File& file) +{ + const ScopedAutoReleasePool pool; + + NSImage* im = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; + return NSImageToJuceImage (im); +} + +//============================================================================== +const int KeyPress::spaceKey = ' '; +const int KeyPress::returnKey = 0x0d; +const int KeyPress::escapeKey = 0x1b; +const int KeyPress::backspaceKey = 0x7f; +const int KeyPress::leftKey = NSLeftArrowFunctionKey; +const int KeyPress::rightKey = NSRightArrowFunctionKey; +const int KeyPress::upKey = NSUpArrowFunctionKey; +const int KeyPress::downKey = NSDownArrowFunctionKey; +const int KeyPress::pageUpKey = NSPageUpFunctionKey; +const int KeyPress::pageDownKey = NSPageDownFunctionKey; +const int KeyPress::endKey = NSEndFunctionKey; +const int KeyPress::homeKey = NSHomeFunctionKey; +const int KeyPress::deleteKey = NSDeleteFunctionKey; +const int KeyPress::insertKey = -1; +const int KeyPress::tabKey = 9; +const int KeyPress::F1Key = NSF1FunctionKey; +const int KeyPress::F2Key = NSF2FunctionKey; +const int KeyPress::F3Key = NSF3FunctionKey; +const int KeyPress::F4Key = NSF4FunctionKey; +const int KeyPress::F5Key = NSF5FunctionKey; +const int KeyPress::F6Key = NSF6FunctionKey; +const int KeyPress::F7Key = NSF7FunctionKey; +const int KeyPress::F8Key = NSF8FunctionKey; +const int KeyPress::F9Key = NSF9FunctionKey; +const int KeyPress::F10Key = NSF10FunctionKey; +const int KeyPress::F11Key = NSF1FunctionKey; +const int KeyPress::F12Key = NSF12FunctionKey; +const int KeyPress::F13Key = NSF13FunctionKey; +const int KeyPress::F14Key = NSF14FunctionKey; +const int KeyPress::F15Key = NSF15FunctionKey; +const int KeyPress::F16Key = NSF16FunctionKey; +const int KeyPress::numberPad0 = 0x30020; +const int KeyPress::numberPad1 = 0x30021; +const int KeyPress::numberPad2 = 0x30022; +const int KeyPress::numberPad3 = 0x30023; +const int KeyPress::numberPad4 = 0x30024; +const int KeyPress::numberPad5 = 0x30025; +const int KeyPress::numberPad6 = 0x30026; +const int KeyPress::numberPad7 = 0x30027; +const int KeyPress::numberPad8 = 0x30028; +const int KeyPress::numberPad9 = 0x30029; +const int KeyPress::numberPadAdd = 0x3002a; +const int KeyPress::numberPadSubtract = 0x3002b; +const int KeyPress::numberPadMultiply = 0x3002c; +const int KeyPress::numberPadDivide = 0x3002d; +const int KeyPress::numberPadSeparator = 0x3002e; +const int KeyPress::numberPadDecimalPoint = 0x3002f; +const int KeyPress::numberPadEquals = 0x30030; +const int KeyPress::numberPadDelete = 0x30031; +const int KeyPress::playKey = 0x30000; +const int KeyPress::stopKey = 0x30001; +const int KeyPress::fastForwardKey = 0x30002; +const int KeyPress::rewindKey = 0x30003; + +#endif \ No newline at end of file diff --git a/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp b/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp index bfe5bc1aa1..56dd468787 100644 --- a/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp +++ b/build/macosx/platform_specific_code/juce_mac_NamedPipe.cpp @@ -1,236 +1,236 @@ -/* - ============================================================================== - - 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 "../../../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" - - -//============================================================================== -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 }; - ::write (intern->pipeIn, buffer, 1); - - 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 +/* + ============================================================================== + + 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 "../../../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" + + +//============================================================================== +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 }; + ::write (intern->pipeIn, buffer, 1); + + 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 diff --git a/build/macosx/platform_specific_code/juce_mac_NativeCode.mm b/build/macosx/platform_specific_code/juce_mac_NativeCode.mm new file mode 100644 index 0000000000..62201da71e --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_NativeCode.mm @@ -0,0 +1,111 @@ +/* + ============================================================================== + + 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_mac_NativeIncludes.h" + + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +#include "../../../src/juce_core/basics/juce_Singleton.h" +#include "../../../src/juce_core/basics/juce_Random.h" +#include "../../../src/juce_core/basics/juce_SystemStats.h" +#include "../../../src/juce_core/threads/juce_Process.h" +#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/network/juce_URL.h" +#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +#include "../../../src/juce_core/text/juce_LocalisedStrings.h" +#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" +#include "../../../src/juce_appframework/application/juce_Application.h" +#include "../../../src/juce_appframework/application/juce_SystemClipboard.h" +#include "../../../src/juce_appframework/events/juce_MessageManager.h" +#include "../../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" +#include "../../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.h" +#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" +#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" +#include "../../../src/juce_appframework/gui/components/menus/juce_MenuBarModel.h" +#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h" +#include "../../../src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h" +#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h" +#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPressMappingSet.h" +#include "../../../src/juce_appframework/gui/components/special/juce_NSViewComponent.h" +#include "../../../src/juce_appframework/gui/components/layout/juce_ComponentMovementWatcher.h" +#include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" +#include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" +#include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h" +#include "../../../src/juce_appframework/audio/audio_sources/juce_AudioSource.h" +#include "../../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.h" +#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" +#include "../../../src/juce_appframework/audio/devices/juce_MidiOutput.h" +#include "../../../src/juce_appframework/audio/devices/juce_MidiInput.h" +#undef Point + +//============================================================================== +#define JUCE_INCLUDED_FILE 1 + +// Now include the actual code files.. + +#include "juce_mac_Strings.mm" +#include "juce_mac_SystemStats.mm" +#include "juce_mac_Network.mm" +#include "juce_mac_Threads.mm" +#include "juce_posix_SharedCode.h" +#include "juce_mac_Files.mm" +#include "juce_mac_MiscUtilities.mm" +#include "juce_mac_Debugging.mm" + +#if ! JUCE_ONLY_BUILD_CORE_LIBRARY +#include "juce_mac_NSViewComponentPeer.mm" +#include "juce_mac_MouseCursor.mm" +#include "juce_mac_NSViewComponent.mm" +#include "juce_mac_AppleRemote.mm" +#include "juce_mac_OpenGLComponent.mm" +#include "juce_mac_MainMenu.mm" +#include "juce_mac_FileChooser.mm" +#include "juce_mac_QuickTimeMovieComponent.mm" +#include "juce_mac_AudioCDBurner.mm" +#include "juce_mac_Fonts.mm" +#include "juce_mac_MessageManager.mm" +#include "juce_mac_WebBrowserComponent.mm" +#include "juce_mac_CoreAudio.cpp" +#include "juce_mac_CoreMidi.cpp" +#endif + +END_JUCE_NAMESPACE diff --git a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h index 21923aa8ae..f9a9f97cbe 100644 --- a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h +++ b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h @@ -64,4 +64,4 @@ static NSString* juceStringToNS (const JUCE_NAMESPACE::String& s) } -#endif +#endif // __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ diff --git a/build/macosx/platform_specific_code/juce_mac_NativeIncludes.h b/build/macosx/platform_specific_code/juce_mac_NativeIncludes.h new file mode 100644 index 0000000000..304d122b10 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_NativeIncludes.h @@ -0,0 +1,73 @@ +/* + ============================================================================== + + 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_MAC_NATIVEINCLUDES_JUCEHEADER__ +#define __JUCE_MAC_NATIVEINCLUDES_JUCEHEADER__ + +/* + 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 "../../../src/juce_core/basics/juce_StandardHeader.h" + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#include +#include +#include +#include +#include +#include +#include + +#if MACOS_10_4_OR_EARLIER + #include +#endif + +#endif // __JUCE_MAC_NATIVEINCLUDES_JUCEHEADER__ diff --git a/build/macosx/platform_specific_code/juce_mac_Network.mm b/build/macosx/platform_specific_code/juce_mac_Network.mm index 15eefcda5e..d21ecc32e3 100644 --- a/build/macosx/platform_specific_code/juce_mac_Network.mm +++ b/build/macosx/platform_specific_code/juce_mac_Network.mm @@ -1,469 +1,449 @@ -/* - ============================================================================== - - 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 "juce_mac_NativeHeaders.h" - -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/text/juce_String.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/basics/juce_Logger.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" -#include "../../../src/juce_core/threads/juce_WaitableEvent.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/containers/juce_MemoryBlock.h" -#include "../../../src/juce_core/text/juce_StringArray.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/io/network/juce_URL.h" - -//#include "juce_mac_HTTPStream.h" - -//============================================================================== -static bool GetEthernetIterator (io_iterator_t* matchingServices) throw() -{ - mach_port_t masterPort; - - if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS) - { - CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass); - - if (dict != 0) - { - CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault, - 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - if (propDict != 0) - { - CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue); - - CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict); - CFRelease (propDict); - } - } - - return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS; - } - - return false; -} - -int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() -{ - int numResults = 0; - io_iterator_t it; - - if (GetEthernetIterator (&it)) - { - io_object_t i; - - while ((i = IOIteratorNext (it)) != 0) - { - io_object_t controller; - - if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS) - { - CFTypeRef data = IORegistryEntryCreateCFProperty (controller, - CFSTR (kIOMACAddress), - kCFAllocatorDefault, - 0); - if (data != 0) - { - UInt8 addr [kIOEthernetAddressSize]; - zeromem (addr, sizeof (addr)); - - CFDataGetBytes ((CFDataRef) data, CFRangeMake (0, sizeof (addr)), addr); - CFRelease (data); - - int64 a = 0; - for (int i = 6; --i >= 0;) - a = (a << 8) | addr[i]; - - if (! littleEndian) - a = (int64) swapByteOrder ((uint64) a); - - if (numResults < maxNum) - { - *addresses++ = a; - ++numResults; - } - } - - IOObjectRelease (controller); - } - - IOObjectRelease (i); - } - - IOObjectRelease (it); - } - - return numResults; -} - -//============================================================================== -bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, - const String& emailSubject, - const String& bodyText, - const StringArray& filesToAttach) -{ - const AutoPool pool; - - String script; - script << "tell application \"Mail\"\r\n" - "set newMessage to make new outgoing message with properties {subject:\"" - << emailSubject.replace (T("\""), T("\\\"")) - << "\", content:\"" - << bodyText.replace (T("\""), T("\\\"")) - << "\" & return & return}\r\n" - "tell newMessage\r\n" - "set visible to true\r\n" - "set sender to \"sdfsdfsdfewf\"\r\n" - "make new to recipient at end of to recipients with properties {address:\"" - << targetEmailAddress - << "\"}\r\n"; - - for (int i = 0; i < filesToAttach.size(); ++i) - { - script << "tell content\r\n" - "make new attachment with properties {file name:\"" - << filesToAttach[i].replace (T("\""), T("\\\"")) - << "\"} at after the last paragraph\r\n" - "end tell\r\n"; - } - - script << "end tell\r\n" - "end tell\r\n"; - - NSAppleScript* s = [[NSAppleScript alloc] - initWithSource: [NSString stringWithUTF8String: (const char*) script.toUTF8()]]; - NSDictionary* error = 0; - const bool ok = [s executeAndReturnError: &error] != nil; - [s release]; - - return ok; -} - -//============================================================================== -END_JUCE_NAMESPACE - -using namespace JUCE_NAMESPACE; - -//============================================================================== -@interface JuceURLConnection : NSObject -{ - NSURLRequest* request; - NSURLConnection* connection; - NSMutableData* data; - Thread* runLoopThread; - bool initialised, hasFailed, hasFinished; - int position; - NSLock* dataLock; -} - -- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req withCallback: (URL::OpenStreamProgressCallback*) callback withContext: (void*) context; -- (void) dealloc; -- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response; -- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error; -- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) data; -- (void) connectionDidFinishLoading: (NSURLConnection*) connection; - -- (BOOL) isOpen; -- (int) read: (char*) dest numBytes: (int) num; -- (int) readPosition; -- (void) stop; -- (void) createConnection; - -@end - -class JuceURLConnectionMessageThread : public Thread -{ - JuceURLConnection* owner; - -public: - JuceURLConnectionMessageThread (JuceURLConnection* owner_) - : Thread (T("http connection")), - owner (owner_) - { - startThread(); - } - - ~JuceURLConnectionMessageThread() - { - stopThread (5000); - } - - void run() - { - AutoPool pool; - [owner createConnection]; - - while (! threadShouldExit()) - { - AutoPool pool; - [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; - } - } -}; - -@implementation JuceURLConnection - -- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req - withCallback: (URL::OpenStreamProgressCallback*) callback - withContext: (void*) context; -{ - [super init]; - request = req; - [request retain]; - data = [[NSMutableData data] retain]; - dataLock = [[NSLock alloc] init]; - connection = 0; - initialised = false; - hasFailed = false; - hasFinished = false; - - runLoopThread = new JuceURLConnectionMessageThread (self); - - while (runLoopThread->isThreadRunning() && ! initialised) - { - if (callback != 0) - callback (context, -1, [[request HTTPBody] length]); - - Thread::sleep (1); - } - - return self; -} - -- (void) dealloc -{ - [self stop]; - - delete runLoopThread; - [connection release]; - [data release]; - [dataLock release]; - [request release]; - [super dealloc]; -} - -- (void) createConnection -{ - connection = [[NSURLConnection alloc] initWithRequest: request - delegate: self]; - - if (connection == nil) - runLoopThread->signalThreadShouldExit(); -} - -- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response -{ - [dataLock lock]; - [data setLength: 0]; - [dataLock unlock]; - initialised = true; -} - -- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error -{ - NSLog ([error description]); - hasFailed = true; - initialised = true; - runLoopThread->signalThreadShouldExit(); -} - -- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) newData -{ - [dataLock lock]; - [data appendData: newData]; - [dataLock unlock]; - initialised = true; -} - -- (void) connectionDidFinishLoading: (NSURLConnection*) connection -{ - hasFinished = true; - initialised = true; - runLoopThread->signalThreadShouldExit(); -} - -- (BOOL) isOpen -{ - return connection != 0 && ! hasFailed; -} - -- (int) readPosition -{ - return position; -} - -- (int) read: (char*) dest numBytes: (int) numNeeded -{ - int numDone = 0; - - while (numNeeded > 0) - { - int available = jmin (numNeeded, [data length]); - - if (available > 0) - { - [dataLock lock]; - [data getBytes: dest length: available]; - [data replaceBytesInRange: NSMakeRange (0, available) withBytes: nil length: 0]; - [dataLock unlock]; - - numDone += available; - numNeeded -= available; - dest += available; - } - else - { - if (hasFailed || hasFinished) - break; - - Thread::sleep (1); - } - } - - position += numDone; - return numDone; -} - -- (void) stop -{ - [connection cancel]; - runLoopThread->stopThread (5000); -} - -@end -BEGIN_JUCE_NAMESPACE - - -bool juce_isOnLine() -{ - return true; -} - -void* juce_openInternetFile (const String& url, - const String& headers, - const MemoryBlock& postData, - const bool isPost, - URL::OpenStreamProgressCallback* callback, - void* callbackContext, - int timeOutMs) -{ - AutoPool pool; - - NSMutableURLRequest* req = [NSMutableURLRequest - requestWithURL: [NSURL URLWithString: juceStringToNS (url)] - cachePolicy: NSURLRequestUseProtocolCachePolicy - timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)]; - - if (req == nil) - return 0; - - [req setHTTPMethod: isPost ? @"POST" : @"GET"]; - //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; - - StringArray headerLines; - headerLines.addLines (headers); - headerLines.removeEmptyStrings (true); - - for (int i = 0; i < headerLines.size(); ++i) - { - const String key (headerLines[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); - const String value (headerLines[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); - - if (key.isNotEmpty() && value.isNotEmpty()) - [req addValue: juceStringToNS (value) forHTTPHeaderField: juceStringToNS (key)]; - } - - if (isPost && postData.getSize() > 0) - { - [req setHTTPBody: [NSData dataWithBytes: postData.getData() - length: postData.getSize()]]; - } - - JuceURLConnection* const s = [[JuceURLConnection alloc] initWithRequest: req - withCallback: callback - withContext: callbackContext]; - - if ([s isOpen]) - return s; - - [s release]; - return 0; -} - -void juce_closeInternetFile (void* handle) -{ - JuceURLConnection* const s = (JuceURLConnection*) handle; - - if (s != 0) - { - AutoPool pool; - [s stop]; - [s release]; - } -} - -int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) -{ - JuceURLConnection* const s = (JuceURLConnection*) handle; - - if (s != 0) - { - AutoPool pool; - return [s read: (char*) buffer numBytes: bytesToRead]; - } - - return 0; -} - -int juce_seekInInternetFile (void* handle, int newPosition) -{ - JuceURLConnection* const s = (JuceURLConnection*) handle; - - if (s != 0) - return [s readPosition]; - - return 0; -} - - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +//============================================================================== +static bool getEthernetIterator (io_iterator_t* matchingServices) throw() +{ + mach_port_t masterPort; + + if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS) + { + CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass); + + if (dict != 0) + { + CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault, + 0, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + if (propDict != 0) + { + CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue); + + CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict); + CFRelease (propDict); + } + } + + return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS; + } + + return false; +} + +int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() +{ + int numResults = 0; + io_iterator_t it; + + if (getEthernetIterator (&it)) + { + io_object_t i; + + while ((i = IOIteratorNext (it)) != 0) + { + io_object_t controller; + + if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS) + { + CFTypeRef data = IORegistryEntryCreateCFProperty (controller, + CFSTR (kIOMACAddress), + kCFAllocatorDefault, + 0); + if (data != 0) + { + UInt8 addr [kIOEthernetAddressSize]; + zeromem (addr, sizeof (addr)); + + CFDataGetBytes ((CFDataRef) data, CFRangeMake (0, sizeof (addr)), addr); + CFRelease (data); + + int64 a = 0; + for (int i = 6; --i >= 0;) + a = (a << 8) | addr[i]; + + if (! littleEndian) + a = (int64) swapByteOrder ((uint64) a); + + if (numResults < maxNum) + { + *addresses++ = a; + ++numResults; + } + } + + IOObjectRelease (controller); + } + + IOObjectRelease (i); + } + + IOObjectRelease (it); + } + + return numResults; +} + +//============================================================================== +bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, + const String& emailSubject, + const String& bodyText, + const StringArray& filesToAttach) +{ + const ScopedAutoReleasePool pool; + + String script; + script << "tell application \"Mail\"\r\n" + "set newMessage to make new outgoing message with properties {subject:\"" + << emailSubject.replace (T("\""), T("\\\"")) + << "\", content:\"" + << bodyText.replace (T("\""), T("\\\"")) + << "\" & return & return}\r\n" + "tell newMessage\r\n" + "set visible to true\r\n" + "set sender to \"sdfsdfsdfewf\"\r\n" + "make new to recipient at end of to recipients with properties {address:\"" + << targetEmailAddress + << "\"}\r\n"; + + for (int i = 0; i < filesToAttach.size(); ++i) + { + script << "tell content\r\n" + "make new attachment with properties {file name:\"" + << filesToAttach[i].replace (T("\""), T("\\\"")) + << "\"} at after the last paragraph\r\n" + "end tell\r\n"; + } + + script << "end tell\r\n" + "end tell\r\n"; + + NSAppleScript* s = [[NSAppleScript alloc] + initWithSource: juceStringToNS (script)]; + NSDictionary* error = 0; + const bool ok = [s executeAndReturnError: &error] != nil; + [s release]; + + return ok; +} + +//============================================================================== +END_JUCE_NAMESPACE + +using namespace JUCE_NAMESPACE; + +//============================================================================== +@interface JuceURLConnection : NSObject +{ + NSURLRequest* request; + NSURLConnection* connection; + NSMutableData* data; + Thread* runLoopThread; + bool initialised, hasFailed, hasFinished; + int position; + NSLock* dataLock; +} + +- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req withCallback: (URL::OpenStreamProgressCallback*) callback withContext: (void*) context; +- (void) dealloc; +- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response; +- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error; +- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) data; +- (void) connectionDidFinishLoading: (NSURLConnection*) connection; + +- (BOOL) isOpen; +- (int) read: (char*) dest numBytes: (int) num; +- (int) readPosition; +- (void) stop; +- (void) createConnection; + +@end + +class JuceURLConnectionMessageThread : public Thread +{ + JuceURLConnection* owner; + +public: + JuceURLConnectionMessageThread (JuceURLConnection* owner_) + : Thread (T("http connection")), + owner (owner_) + { + startThread(); + } + + ~JuceURLConnectionMessageThread() + { + stopThread (10000); + } + + void run() + { + [owner createConnection]; + + while (! threadShouldExit()) + { + const ScopedAutoReleasePool pool; + [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; + } + } +}; + + +@implementation JuceURLConnection + +- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req + withCallback: (URL::OpenStreamProgressCallback*) callback + withContext: (void*) context; +{ + [super init]; + request = req; + [request retain]; + data = [[NSMutableData data] retain]; + dataLock = [[NSLock alloc] init]; + connection = 0; + initialised = false; + hasFailed = false; + hasFinished = false; + + runLoopThread = new JuceURLConnectionMessageThread (self); + + while (runLoopThread->isThreadRunning() && ! initialised) + { + if (callback != 0) + callback (context, -1, [[request HTTPBody] length]); + + Thread::sleep (1); + } + + return self; +} + +- (void) dealloc +{ + [self stop]; + + delete runLoopThread; + [connection release]; + [data release]; + [dataLock release]; + [request release]; + [super dealloc]; +} + +- (void) createConnection +{ + connection = [[NSURLConnection alloc] initWithRequest: request + delegate: self]; + + if (connection == nil) + runLoopThread->signalThreadShouldExit(); +} + +- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response +{ + [dataLock lock]; + [data setLength: 0]; + [dataLock unlock]; + initialised = true; +} + +- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error +{ + NSLog ([error description]); + hasFailed = true; + initialised = true; + runLoopThread->signalThreadShouldExit(); +} + +- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) newData +{ + [dataLock lock]; + [data appendData: newData]; + [dataLock unlock]; + initialised = true; +} + +- (void) connectionDidFinishLoading: (NSURLConnection*) connection +{ + hasFinished = true; + initialised = true; + runLoopThread->signalThreadShouldExit(); +} + +- (BOOL) isOpen +{ + return connection != 0 && ! hasFailed; +} + +- (int) readPosition +{ + return position; +} + +- (int) read: (char*) dest numBytes: (int) numNeeded +{ + int numDone = 0; + + while (numNeeded > 0) + { + int available = jmin (numNeeded, [data length]); + + if (available > 0) + { + [dataLock lock]; + [data getBytes: dest length: available]; + [data replaceBytesInRange: NSMakeRange (0, available) withBytes: nil length: 0]; + [dataLock unlock]; + + numDone += available; + numNeeded -= available; + dest += available; + } + else + { + if (hasFailed || hasFinished) + break; + + Thread::sleep (1); + } + } + + position += numDone; + return numDone; +} + +- (void) stop +{ + [connection cancel]; + runLoopThread->stopThread (10000); +} + +@end +BEGIN_JUCE_NAMESPACE + + +bool juce_isOnLine() +{ + return true; +} + +void* juce_openInternetFile (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) +{ + const ScopedAutoReleasePool pool; + + NSMutableURLRequest* req = [NSMutableURLRequest + requestWithURL: [NSURL URLWithString: juceStringToNS (url)] + cachePolicy: NSURLRequestUseProtocolCachePolicy + timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)]; + + if (req == nil) + return 0; + + [req setHTTPMethod: isPost ? @"POST" : @"GET"]; + //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; + + StringArray headerLines; + headerLines.addLines (headers); + headerLines.removeEmptyStrings (true); + + for (int i = 0; i < headerLines.size(); ++i) + { + const String key (headerLines[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); + const String value (headerLines[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); + + if (key.isNotEmpty() && value.isNotEmpty()) + [req addValue: juceStringToNS (value) forHTTPHeaderField: juceStringToNS (key)]; + } + + if (isPost && postData.getSize() > 0) + { + [req setHTTPBody: [NSData dataWithBytes: postData.getData() + length: postData.getSize()]]; + } + + JuceURLConnection* const s = [[JuceURLConnection alloc] initWithRequest: req + withCallback: callback + withContext: callbackContext]; + + if ([s isOpen]) + return s; + + [s release]; + return 0; +} + +void juce_closeInternetFile (void* handle) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + { + const ScopedAutoReleasePool pool; + [s stop]; + [s release]; + } +} + +int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + { + const ScopedAutoReleasePool pool; + return [s read: (char*) buffer numBytes: bytesToRead]; + } + + return 0; +} + +int juce_seekInInternetFile (void* handle, int newPosition) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + return [s readPosition]; + + return 0; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_OpenGLComponent.mm b/build/macosx/platform_specific_code/juce_mac_OpenGLComponent.mm new file mode 100644 index 0000000000..7d8221566d --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_OpenGLComponent.mm @@ -0,0 +1,235 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_OPENGL + + +//============================================================================== +class WindowedGLContext : public OpenGLContext +{ +public: + WindowedGLContext (Component* const component, + const OpenGLPixelFormat& pixelFormat_, + NSOpenGLContext* sharedContext) + : renderContext (0), + pixelFormat (pixelFormat_) + { + jassert (component != 0); + + NSOpenGLPixelFormatAttribute attribs [64]; + int n = 0; + attribs[n++] = NSOpenGLPFADoubleBuffer; + attribs[n++] = NSOpenGLPFAAccelerated; + attribs[n++] = NSOpenGLPFAColorSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.redBits, + pixelFormat.greenBits, + pixelFormat.blueBits); + attribs[n++] = NSOpenGLPFAAlphaSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits; + attribs[n++] = NSOpenGLPFADepthSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits; + attribs[n++] = NSOpenGLPFAStencilSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits; + attribs[n++] = NSOpenGLPFAAccumSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.accumulationBufferRedBits, + pixelFormat.accumulationBufferGreenBits, + pixelFormat.accumulationBufferBlueBits, + pixelFormat.accumulationBufferAlphaBits); + + // xxx not sure how to do fullSceneAntiAliasingNumSamples.. + + attribs[n++] = NSOpenGLPFASampleBuffers; + attribs[n++] = (NSOpenGLPixelFormatAttribute) 1; + attribs[n++] = NSOpenGLPFAClosestPolicy; + attribs[n++] = NSOpenGLPFANoRecovery; + attribs[n++] = (NSOpenGLPixelFormatAttribute) 0; + + NSOpenGLPixelFormat* format + = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; + + NSOpenGLView* view + = [[NSOpenGLView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) + pixelFormat: format]; + + renderContext = [view openGLContext]; + [format release]; + + viewHolder = new NSViewComponentInternal (view, component); + } + + ~WindowedGLContext() + { + makeInactive(); + [renderContext setView: nil]; + delete viewHolder; + } + + bool makeActive() const throw() + { + jassert (renderContext != 0); + [renderContext makeCurrentContext]; + return renderContext != 0; + } + + bool makeInactive() const throw() + { + if (! isActive()) + [NSOpenGLContext clearCurrentContext]; + + return true; + } + + bool isActive() const throw() + { + return [NSOpenGLContext currentContext] == renderContext; + } + + const OpenGLPixelFormat getPixelFormat() const { return pixelFormat; } + void* getRawContext() const throw() { return renderContext; } + + void updateWindowPosition (int x, int y, int w, int h, int outerWindowHeight) + { + } + + void swapBuffers() + { + glFlush(); + [renderContext flushBuffer]; + } + + bool setSwapInterval (const int numFramesPerSwap) + { + [renderContext setValues: (const GLint*) &numFramesPerSwap + forParameter: NSOpenGLCPSwapInterval]; + return true; + } + + int getSwapInterval() const + { + GLint numFrames = 0; + [renderContext getValues: &numFrames + forParameter: NSOpenGLCPSwapInterval]; + return numFrames; + } + + void repaint() + { + // we need to invalidate the juce view that holds this gl view, to make it + // cause a repaint callback + NSView* v = (NSView*) viewHolder->view; + NSRect r = [v frame]; + + // bit of a bodge here.. if we only invalidate the area of the gl component, + // it's completely covered by the NSOpenGLView, so the OS throws away the + // repaint message, thus never causing our paint() callback, and never repainting + // the comp. So invalidating just a little bit around the edge helps.. + [[v superview] setNeedsDisplayInRect: NSInsetRect (r, -2.0f, -2.0f)]; + } + + void* getNativeWindowHandle() const { return viewHolder->view; } + + //============================================================================== + juce_UseDebuggingNewOperator + + NSOpenGLContext* renderContext; + +private: + OpenGLPixelFormat pixelFormat; + NSViewComponentInternal* viewHolder; + + //============================================================================== + WindowedGLContext (const WindowedGLContext&); + const WindowedGLContext& operator= (const WindowedGLContext&); +}; + +//============================================================================== +OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, + const OpenGLPixelFormat& pixelFormat, + const OpenGLContext* const contextToShareWith) +{ + WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, + contextToShareWith != 0 ? (NSOpenGLContext*) contextToShareWith->getRawContext() : 0); + + if (c->renderContext == 0) + deleteAndZero (c); + + return c; +} + +void* OpenGLComponent::getNativeWindowHandle() const +{ + return context != 0 ? ((WindowedGLContext*) context)->getNativeWindowHandle() + : 0; +} + +void juce_glViewport (const int w, const int h) +{ + glViewport (0, 0, w, h); +} + +void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, + OwnedArray & results) +{ +/* GLint attribs [64]; + int n = 0; + attribs[n++] = AGL_RGBA; + attribs[n++] = AGL_DOUBLEBUFFER; + attribs[n++] = AGL_ACCELERATED; + attribs[n++] = AGL_NO_RECOVERY; + attribs[n++] = AGL_NONE; + + AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); + + while (p != 0) + { + OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); + pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); + pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); + pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); + pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); + pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); + pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); + pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); + pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); + pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); + pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); + + results.add (pf); + + p = aglNextPixelFormat (p); + }*/ + + //jassertfalse //xxx can't see how you do this in cocoa! +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_QuickTimeMovieComponent.mm b/build/macosx/platform_specific_code/juce_mac_QuickTimeMovieComponent.mm new file mode 100644 index 0000000000..6c12dfa46f --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_QuickTimeMovieComponent.mm @@ -0,0 +1,294 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_QUICKTIME + +#define theMovie ((QTMovie*) movie) + +//============================================================================== +QuickTimeMovieComponent::QuickTimeMovieComponent() + : movie (0) +{ + setOpaque (true); + setVisible (true); + + QTMovieView* view = [[QTMovieView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f)]; + setView (view); +} + +QuickTimeMovieComponent::~QuickTimeMovieComponent() +{ + closeMovie(); + setView (0); +} + +bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() +{ + return true; +} + +bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, + const bool controllerVisible) +{ + closeMovie(); + + if (getPeer() == 0) + { + // To open a movie, this component must be visible inside a functioning window, so that + // the QT control can be assigned to the window. + jassertfalse + return false; + } + + FileInputStream* const fin = dynamic_cast (movieStream); + + if (fin != 0) + { + movieFile = fin->getFile(); + movie = [QTMovie movieWithFile: juceStringToNS (movieFile.getFullPathName()) + error: nil]; + } + else + { + MemoryBlock temp; + movieStream->readIntoMemoryBlock (temp); + + movie = [QTMovie movieWithData: [NSData dataWithBytes: temp.getData() + length: temp.getSize()] + error: nil]; + } + + [theMovie retain]; + QTMovieView* view = (QTMovieView*) getView(); + [view setMovie: theMovie]; + [view setControllerVisible: controllerVisible]; + setLooping (looping); + + return movie != nil; +} + +void QuickTimeMovieComponent::closeMovie() +{ + stop(); + QTMovieView* view = (QTMovieView*) getView(); + [view setMovie: nil]; + [theMovie release]; + movie = 0; + movieFile = File::nonexistent; +} + +bool QuickTimeMovieComponent::isMovieOpen() const +{ + return movie != nil; +} + +const File QuickTimeMovieComponent::getCurrentMovieFile() const +{ + return movieFile; +} + +void QuickTimeMovieComponent::play() +{ + [theMovie play]; +} + +void QuickTimeMovieComponent::stop() +{ + [theMovie stop]; +} + +bool QuickTimeMovieComponent::isPlaying() const +{ + return movie != 0 && [theMovie rate] != 0; +} + +void QuickTimeMovieComponent::setPosition (const double seconds) +{ + if (movie != 0) + { + QTTime t; + t.timeValue = (uint64) (100000.0 * seconds); + t.timeScale = 100000; + t.flags = 0; + + [theMovie setCurrentTime: t]; + } +} + +double QuickTimeMovieComponent::getPosition() const +{ + if (movie == 0) + return 0.0; + + QTTime t = [theMovie currentTime]; + return t.timeValue / (double) t.timeScale; +} + +void QuickTimeMovieComponent::setSpeed (const float newSpeed) +{ + [theMovie setRate: newSpeed]; +} + +double QuickTimeMovieComponent::getMovieDuration() const +{ + if (movie == 0) + return 0.0; + + QTTime t = [theMovie duration]; + return t.timeValue / (double) t.timeScale; +} + +void QuickTimeMovieComponent::setLooping (const bool shouldLoop) +{ + looping = shouldLoop; + + [theMovie setAttribute: [NSNumber numberWithBool: shouldLoop] + forKey: QTMovieLoopsAttribute]; +} + +bool QuickTimeMovieComponent::isLooping() const +{ + return looping; +} + +void QuickTimeMovieComponent::setMovieVolume (const float newVolume) +{ + [theMovie setVolume: newVolume]; +} + +float QuickTimeMovieComponent::getMovieVolume() const +{ + return movie != 0 ? [theMovie volume] : 0.0f; +} + +void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const +{ + width = 0; + height = 0; + + if (movie != 0) + { + NSSize s = [[theMovie attributeForKey: QTMovieNaturalSizeAttribute] sizeValue]; + width = s.width; + height = s.height; + } +} + +void QuickTimeMovieComponent::paint (Graphics& g) +{ + if (movie == 0) + g.fillAll (Colours::black); +} + +bool QuickTimeMovieComponent::isControllerVisible() const +{ + return controllerVisible; +} + +//============================================================================== +bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, + const bool isControllerVisible) +{ + const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); + movieFile = movieFile_; + return ok; +} + +void QuickTimeMovieComponent::goToStart() +{ + setPosition (0.0); +} + +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + const RectanglePlacement& placement) +{ + int normalWidth, normalHeight; + getMovieNormalSize (normalWidth, normalHeight); + + if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) + { + double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; + + placement.applyTo (x, y, w, h, + spaceToFitWithin.getX(), spaceToFitWithin.getY(), + spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); + + if (w > 0 && h > 0) + { + setBounds (roundDoubleToInt (x), roundDoubleToInt (y), + roundDoubleToInt (w), roundDoubleToInt (h)); + } + } + else + { + setBounds (spaceToFitWithin); + } +} + + +//============================================================================== +#if ! (JUCE_MAC && JUCE_64BIT) + +bool juce_OpenQuickTimeMovieFromStream (InputStream* movieStream, Movie& result, Handle& dataHandle) +{ + if (movieStream == 0) + return false; + + QTMovie* movie = nil; + + FileInputStream* const fin = dynamic_cast (movieStream); + + if (fin != 0) + { + movie = [QTMovie movieWithFile: juceStringToNS (fin->getFile().getFullPathName()) + error: nil]; + } + else + { + MemoryBlock temp; + movieStream->readIntoMemoryBlock (temp); + + movie = [QTMovie movieWithData: [NSData dataWithBytes: temp.getData() + length: temp.getSize()] + error: nil]; + } + + if (movie != nil) + result = [movie quickTimeMovie]; + + return movie != nil; +} + +#endif + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Strings.mm b/build/macosx/platform_specific_code/juce_mac_Strings.mm new file mode 100644 index 0000000000..132f214af3 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_Strings.mm @@ -0,0 +1,186 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +//============================================================================== +static const String nsStringToJuce (NSString* s) +{ + return String::fromUTF8 ((uint8*) [s UTF8String]); +} + +static NSString* juceStringToNS (const String& s) +{ + return [NSString stringWithUTF8String: (const char*) s.toUTF8()]; +} + + +//============================================================================== +static const String convertUTF16ToString (const UniChar* utf16) +{ + String s; + + while (*utf16 != 0) + s += (juce_wchar) *utf16++; + + return s; +} + +const String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) +{ + String result; + + if (cfString != 0) + { +#if JUCE_STRINGS_ARE_UNICODE + CFRange range = { 0, CFStringGetLength (cfString) }; + UniChar* const u = (UniChar*) juce_malloc (sizeof (UniChar) * (range.length + 1)); + + CFStringGetCharacters (cfString, range, u); + u[range.length] = 0; + + result = convertUTF16ToString (u); + + juce_free (u); +#else + const int len = CFStringGetLength (cfString); + char* buffer = (char*) juce_malloc (len + 1); + CFStringGetCString (cfString, buffer, len + 1, CFStringGetSystemEncoding()); + result = buffer; + juce_free (buffer); +#endif + } + + return result; +} + +CFStringRef PlatformUtilities::juceStringToCFString (const String& s) +{ +#if JUCE_STRINGS_ARE_UNICODE + const int len = s.length(); + const juce_wchar* t = (const juce_wchar*) s; + + UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); + + for (int i = 0; i <= len; ++i) + temp[i] = t[i]; + + CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); + juce_free (temp); + + return result; + +#else + return CFStringCreateWithCString (kCFAllocatorDefault, + (const char*) s, + CFStringGetSystemEncoding()); +#endif +} + +const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) +{ + UnicodeMapping map; + + map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, + kUnicodeNoSubset, + kTextEncodingDefaultFormat); + + map.otherEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, + kUnicodeCanonicalCompVariant, + kTextEncodingDefaultFormat); + + map.mappingVersion = kUnicodeUseLatestMapping; + + UnicodeToTextInfo conversionInfo = 0; + String result; + + if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr) + { + const int len = s.length(); + + UniChar* const tempIn = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); + UniChar* const tempOut = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); + + for (int i = 0; i <= len; ++i) + tempIn[i] = s[i]; + + ByteCount bytesRead = 0; + ByteCount outputBufferSize = 0; + + if (ConvertFromUnicodeToText (conversionInfo, + len * sizeof (UniChar), tempIn, + kUnicodeDefaultDirectionMask, + 0, 0, 0, 0, + len * sizeof (UniChar), &bytesRead, + &outputBufferSize, tempOut) == noErr) + { + result.preallocateStorage (bytesRead / sizeof (UniChar) + 2); + + tchar* t = const_cast ((const tchar*) result); + + int i; + for (i = 0; i < bytesRead / sizeof (UniChar); ++i) + t[i] = (tchar) tempOut[i]; + + t[i] = 0; + } + + juce_free (tempIn); + juce_free (tempOut); + + DisposeUnicodeToTextInfo (&conversionInfo); + } + + return result; +} + +//============================================================================== +void SystemClipboard::copyTextToClipboard (const String& text) throw() +{ + [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] + owner: nil]; + + [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) + forType: NSStringPboardType]; +} + +const String SystemClipboard::getTextFromClipboard() throw() +{ + NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; + + return text == 0 ? String::empty + : nsStringToJuce (text); +} + + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_SystemStats.mm b/build/macosx/platform_specific_code/juce_mac_SystemStats.mm index 075e66619f..c7e2bbff1b 100644 --- a/build/macosx/platform_specific_code/juce_mac_SystemStats.mm +++ b/build/macosx/platform_specific_code/juce_mac_SystemStats.mm @@ -29,18 +29,9 @@ ============================================================================== */ -#include "juce_mac_NativeHeaders.h" -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE static int64 highResTimerFrequency; @@ -90,29 +81,74 @@ static CPUFlags cpuFlags; #endif //============================================================================== -void Logger::outputDebugString (const String& text) throw() +void SystemStats::initialiseStats() throw() { - String withLineFeed (text + T("\n")); - const char* const utf8 = withLineFeed.toUTF8(); - fwrite (utf8, strlen (utf8), 1, stdout); -} + static bool initialised = false; -void Logger::outputDebugPrintf (const tchar* format, ...) throw() -{ - String text; - va_list args; - va_start (args, format); - text.vprintf(format, args); - outputDebugString (text); + if (! initialised) + { + initialised = true; + + NSApplicationLoad(); + [NSApplication sharedApplication]; + +#if JUCE_INTEL + { + unsigned int familyModel, extFeatures; + const unsigned int features = getCPUIDWord (familyModel, extFeatures); + + cpuFlags.hasMMX = ((features & (1 << 23)) != 0); + cpuFlags.hasSSE = ((features & (1 << 25)) != 0); + cpuFlags.hasSSE2 = ((features & (1 << 26)) != 0); + cpuFlags.has3DNow = ((extFeatures & (1 << 31)) != 0); + } +#endif + + highResTimerFrequency = (int64) AudioGetHostClockFrequency(); + + String s (SystemStats::getJUCEVersion()); + + rlimit lim; + getrlimit (RLIMIT_NOFILE, &lim); + lim.rlim_cur = lim.rlim_max = RLIM_INFINITY; + setrlimit (RLIMIT_NOFILE, &lim); + } } -int SystemStats::getMemorySizeInMegabytes() throw() +static const String getCpuInfo (const char* key, bool lastOne = false) throw() { - long bytes; - if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr) - return (int) (((unsigned long) bytes) / (1024 * 1024)); + String info; + char buf [256]; - return 0; + FILE* f = fopen ("/proc/cpuinfo", "r"); + + while (f != 0 && fgets (buf, sizeof(buf), f)) + { + if (strncmp (buf, key, strlen (key)) == 0) + { + char* p = buf; + + while (*p && *p != '\n') + ++p; + + if (*p != 0) + *p = 0; + + p = buf; + + while (*p != 0 && *p != ':') + ++p; + + if (*p != 0 && *(p + 1) != 0) + info = p + 2; + + if (! lastOne) + break; + } + } + + fclose (f); + return info; } //============================================================================== @@ -136,39 +172,17 @@ bool SystemStats::isOperatingSystem64Bit() throw() #endif } -//============================================================================== -void SystemStats::initialiseStats() throw() +int SystemStats::getMemorySizeInMegabytes() throw() { - static bool initialised = false; - - if (! initialised) - { - initialised = true; - - //[NSApplication sharedApplication]; - NSApplicationLoad(); - -#if JUCE_INTEL - { - unsigned int familyModel, extFeatures; - const unsigned int features = getCPUIDWord (familyModel, extFeatures); - - cpuFlags.hasMMX = ((features & (1 << 23)) != 0); - cpuFlags.hasSSE = ((features & (1 << 25)) != 0); - cpuFlags.hasSSE2 = ((features & (1 << 26)) != 0); - cpuFlags.has3DNow = ((extFeatures & (1 << 31)) != 0); - } +#if MACOS_10_4_OR_EARLIER + long bytes; + if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr) + return (int) (((unsigned long) bytes) / (1024 * 1024)); + + return 0; +#else + return (int) ([[NSProcessInfo processInfo] physicalMemory] / (1024 * 1024)); #endif - - highResTimerFrequency = (int64) AudioGetHostClockFrequency(); - - String s (SystemStats::getJUCEVersion()); - - rlimit lim; - getrlimit (RLIMIT_NOFILE, &lim); - lim.rlim_cur = lim.rlim_max = RLIM_INFINITY; - setrlimit (RLIMIT_NOFILE, &lim); - } } bool SystemStats::hasMMX() throw() @@ -220,12 +234,20 @@ const String SystemStats::getCpuVendor() throw() int SystemStats::getCpuSpeedInMegaherz() throw() { +#if MACOS_10_4_OR_EARLIER return GetCPUSpeed(); +#else + return roundDoubleToInt (getCpuInfo ("cpu MHz").getDoubleValue()); +#endif } int SystemStats::getNumCpus() throw() { +#if MACOS_10_4_OR_EARLIER return MPProcessors(); +#else + return [[NSProcessInfo processInfo] activeProcessorCount]; +#endif } //============================================================================== @@ -272,12 +294,12 @@ bool Time::setSystemTimeToThisTime() const throw() //============================================================================== int SystemStats::getPageSize() throw() { - jassertfalse - return 512; //xxx + return NSPageSize(); } void PlatformUtilities::fpuReset() { } -END_JUCE_NAMESPACE + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Threads.cpp b/build/macosx/platform_specific_code/juce_mac_Threads.cpp index 6bc35cb236..9e5c282d6b 100644 --- a/build/macosx/platform_specific_code/juce_mac_Threads.cpp +++ b/build/macosx/platform_specific_code/juce_mac_Threads.cpp @@ -1,202 +1,202 @@ -/* - ============================================================================== - - 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 "../../../src/juce_core/basics/juce_StandardHeader.h" -#include -#include -#include -#include -#include - -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/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/io/files/juce_File.h" - -//============================================================================== -/* - Note that a lot of methods that you'd expect to find in this file actually - live in juce_posix_SharedCode.h! -*/ - -//============================================================================== -void JUCE_API juce_threadEntryPoint (void*); - -void* threadEntryProc (void* userData) throw() -{ - juce_threadEntryPoint (userData); - return 0; -} - -void* juce_createThread (void* userData) throw() -{ - pthread_t handle = 0; - - if (pthread_create (&handle, 0, threadEntryProc, userData) == 0) - { - pthread_detach (handle); - return (void*) handle; - } - - return 0; -} - -void juce_killThread (void* handle) throw() -{ - if (handle != 0) - pthread_cancel ((pthread_t) handle); -} - -void juce_setCurrentThreadName (const String& /*name*/) throw() -{ -} - -int Thread::getCurrentThreadId() throw() -{ - return (int) pthread_self(); -} - -void juce_setThreadPriority (void* handle, int priority) throw() -{ - if (handle == 0) - handle = (void*) pthread_self(); - - struct sched_param param; - int policy; - pthread_getschedparam ((pthread_t) handle, &policy, ¶m); - param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11); - pthread_setschedparam ((pthread_t) handle, policy, ¶m); -} - -void Thread::yield() throw() -{ - sched_yield(); -} - -void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) throw() -{ - // xxx - jassertfalse -} - -//============================================================================== -bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw() -{ - static char testResult = 0; - - if (testResult == 0) - { - struct kinfo_proc info; - int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; - size_t sz = sizeof (info); - sysctl (m, 4, &info, &sz, 0, 0); - testResult = ((info.kp_proc.p_flag & P_TRACED) != 0) ? 1 : -1; - } - - return testResult > 0; -} - -bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw() -{ - return juce_isRunningUnderDebugger(); -} - -void Process::raisePrivilege() -{ - jassertfalse -} - -void Process::lowerPrivilege() -{ - jassertfalse -} - -void Process::terminate() -{ - exit (0); -} - -void Process::setPriority (ProcessPriority p) -{ - // xxx -} - -void* Process::loadDynamicLibrary (const String& name) -{ - // xxx needs to use bundles - - FSSpec fs; - if (PlatformUtilities::makeFSSpecFromPath (&fs, name)) - { - CFragConnectionID connID; - Ptr mainPtr; - Str255 errorMessage; - Str63 nm; - PlatformUtilities::copyToStr63 (nm, name); - - const OSErr err = GetDiskFragment (&fs, 0, kCFragGoesToEOF, nm, kReferenceCFrag, &connID, &mainPtr, errorMessage); - if (err == noErr) - return (void*)connID; - } - - return 0; -} - -void Process::freeDynamicLibrary (void* handle) -{ - if (handle != 0) - CloseConnection ((CFragConnectionID*)&handle); -} - -void* Process::getProcedureEntryPoint (void* h, const String& procedureName) -{ - if (h != 0) - { - CFragSymbolClass cl; - Ptr ptr; - Str255 name; - PlatformUtilities::copyToStr255 (name, procedureName); - - if (FindSymbol ((CFragConnectionID) h, name, &ptr, &cl) == noErr) - { - return ptr; - } - } - - return 0; -} - - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 "../../../src/juce_core/basics/juce_StandardHeader.h" +#include +#include +#include +#include +#include + +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/misc/juce_PlatformUtilities.h" +#include "../../../src/juce_core/io/files/juce_File.h" + +//============================================================================== +/* + Note that a lot of methods that you'd expect to find in this file actually + live in juce_posix_SharedCode.h! +*/ + +//============================================================================== +void JUCE_API juce_threadEntryPoint (void*); + +void* threadEntryProc (void* userData) throw() +{ + juce_threadEntryPoint (userData); + return 0; +} + +void* juce_createThread (void* userData) throw() +{ + pthread_t handle = 0; + + if (pthread_create (&handle, 0, threadEntryProc, userData) == 0) + { + pthread_detach (handle); + return (void*) handle; + } + + return 0; +} + +void juce_killThread (void* handle) throw() +{ + if (handle != 0) + pthread_cancel ((pthread_t) handle); +} + +void juce_setCurrentThreadName (const String& /*name*/) throw() +{ +} + +int Thread::getCurrentThreadId() throw() +{ + return (int) pthread_self(); +} + +void juce_setThreadPriority (void* handle, int priority) throw() +{ + if (handle == 0) + handle = (void*) pthread_self(); + + struct sched_param param; + int policy; + pthread_getschedparam ((pthread_t) handle, &policy, ¶m); + param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11); + pthread_setschedparam ((pthread_t) handle, policy, ¶m); +} + +void Thread::yield() throw() +{ + sched_yield(); +} + +void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) throw() +{ + // xxx + jassertfalse +} + +//============================================================================== +bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw() +{ + static char testResult = 0; + + if (testResult == 0) + { + struct kinfo_proc info; + int m[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; + size_t sz = sizeof (info); + sysctl (m, 4, &info, &sz, 0, 0); + testResult = ((info.kp_proc.p_flag & P_TRACED) != 0) ? 1 : -1; + } + + return testResult > 0; +} + +bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw() +{ + return juce_isRunningUnderDebugger(); +} + +void Process::raisePrivilege() +{ + jassertfalse +} + +void Process::lowerPrivilege() +{ + jassertfalse +} + +void Process::terminate() +{ + exit (0); +} + +void Process::setPriority (ProcessPriority p) +{ + // xxx +} + +void* Process::loadDynamicLibrary (const String& name) +{ + // xxx needs to use bundles + + FSSpec fs; + if (PlatformUtilities::makeFSSpecFromPath (&fs, name)) + { + CFragConnectionID connID; + Ptr mainPtr; + Str255 errorMessage; + Str63 nm; + PlatformUtilities::copyToStr63 (nm, name); + + const OSErr err = GetDiskFragment (&fs, 0, kCFragGoesToEOF, nm, kReferenceCFrag, &connID, &mainPtr, errorMessage); + if (err == noErr) + return (void*)connID; + } + + return 0; +} + +void Process::freeDynamicLibrary (void* handle) +{ + if (handle != 0) + CloseConnection ((CFragConnectionID*)&handle); +} + +void* Process::getProcedureEntryPoint (void* h, const String& procedureName) +{ + if (h != 0) + { + CFragSymbolClass cl; + Ptr ptr; + Str255 name; + PlatformUtilities::copyToStr255 (name, procedureName); + + if (FindSymbol ((CFragConnectionID) h, name, &ptr, &cl) == noErr) + { + return ptr; + } + } + + return 0; +} + + +END_JUCE_NAMESPACE diff --git a/build/macosx/platform_specific_code/juce_mac_Threads.mm b/build/macosx/platform_specific_code/juce_mac_Threads.mm new file mode 100644 index 0000000000..595d190663 --- /dev/null +++ b/build/macosx/platform_specific_code/juce_mac_Threads.mm @@ -0,0 +1,129 @@ +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, 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! +*/ + +//============================================================================== +void JUCE_API juce_threadEntryPoint (void*); + +void* threadEntryProc (void* userData) throw() +{ + const ScopedAutoReleasePool pool; + juce_threadEntryPoint (userData); + return 0; +} + +void* juce_createThread (void* userData) throw() +{ + pthread_t handle = 0; + + if (pthread_create (&handle, 0, threadEntryProc, userData) == 0) + { + pthread_detach (handle); + return (void*) handle; + } + + return 0; +} + +void juce_killThread (void* handle) throw() +{ + if (handle != 0) + pthread_cancel ((pthread_t) handle); +} + +void juce_setCurrentThreadName (const String& /*name*/) throw() +{ +} + +int64 Thread::getCurrentThreadId() throw() +{ + return (int64) pthread_self(); +} + +void juce_setThreadPriority (void* handle, int priority) throw() +{ + if (handle == 0) + handle = (void*) pthread_self(); + + struct sched_param param; + int policy; + pthread_getschedparam ((pthread_t) handle, &policy, ¶m); + param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11); + pthread_setschedparam ((pthread_t) handle, policy, ¶m); +} + +void Thread::yield() throw() +{ + sched_yield(); +} + +void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) throw() +{ + // xxx + jassertfalse +} + +//============================================================================== +bool Process::isForegroundProcess() throw() +{ + return [NSApp isActive]; +} + +void Process::raisePrivilege() +{ + jassertfalse +} + +void Process::lowerPrivilege() +{ + jassertfalse +} + +void Process::terminate() +{ + exit (0); +} + +void Process::setPriority (ProcessPriority p) +{ + // xxx +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm b/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm index 508de302ab..fe05bf578c 100644 --- a/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm +++ b/build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm @@ -1,443 +1,258 @@ -/* - ============================================================================== - - 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 "../../../src/juce_core/basics/juce_StandardHeader.h" - -#include -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" -END_JUCE_NAMESPACE - -//============================================================================== -@interface DownloadClickDetector : NSObject -{ - JUCE_NAMESPACE::WebBrowserComponent* ownerComponent; -} - -- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; - -- (void) webView: (WebView*) webView decidePolicyForNavigationAction: (NSDictionary*) actionInformation - request: (NSURLRequest*) request - frame: (WebFrame*) frame - decisionListener: (id) listener; -@end - -//============================================================================== -@implementation DownloadClickDetector - -- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ -{ - [super init]; - ownerComponent = ownerComponent_; - return self; -} - -- (void) webView: (WebView*) sender decidePolicyForNavigationAction: (NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener -{ - NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; - - if (ownerComponent->pageAboutToLoad (JUCE_NAMESPACE::String::fromUTF8 ((const JUCE_NAMESPACE::uint8*) [[url absoluteString] UTF8String]))) - [listener use]; - else - [listener ignore]; -} - -@end - -BEGIN_JUCE_NAMESPACE - -//============================================================================== -class WebBrowserComponentInternal : public Timer -{ -public: - WebBrowserComponentInternal (WebBrowserComponent* owner_) - : owner (owner_), - view (0), - webView (0) - { - HIWebViewCreate (&view); - - ComponentPeer* const peer = owner_->getPeer(); - jassert (peer != 0); - - if (view != 0 && peer != 0) - { - WindowRef parentWindow = (WindowRef) peer->getNativeHandle(); - - WindowAttributes attributes; - GetWindowAttributes (parentWindow, &attributes); - - HIViewRef parentView = 0; - - if ((attributes & kWindowCompositingAttribute) != 0) - { - HIViewRef root = HIViewGetRoot (parentWindow); - HIViewFindByID (root, kHIViewWindowContentID, &parentView); - - if (parentView == 0) - parentView = root; - } - else - { - GetRootControl (parentWindow, (ControlRef*) &parentView); - - if (parentView == 0) - CreateRootControl (parentWindow, (ControlRef*) &parentView); - } - - HIViewAddSubview (parentView, view); - updateBounds(); - show(); - - webView = HIWebViewGetWebView (view); - - clickListener = [[DownloadClickDetector alloc] initWithOwner: owner_]; - [webView setPolicyDelegate: clickListener]; - } - - startTimer (500); - } - - ~WebBrowserComponentInternal() - { - [webView setPolicyDelegate: nil]; - [clickListener release]; - - if (view != 0) - CFRelease (view); - } - - // Horrific bodge-workaround for the fact that the webview somehow hangs onto key - // focus when you pop up a new window, no matter what that window does to - // try to grab focus for itself. This catches such a situation and forces - // focus away from the webview, then back to the place it should be.. - void timerCallback() - { - WindowRef viewWindow = HIViewGetWindow (view); - WindowRef focusedWindow = GetUserFocusWindow(); - - if (focusedWindow != viewWindow) - { - if (HIViewSubtreeContainsFocus (view)) - { - HIViewAdvanceFocus (HIViewGetRoot (viewWindow), 0); - HIViewAdvanceFocus (HIViewGetRoot (focusedWindow), 0); - } - } - } - - void show() - { - HIViewSetVisible (view, true); - } - - void hide() - { - HIViewSetVisible (view, false); - } - - void goToURL (const String& url, - const StringArray* headers, - const MemoryBlock* postData) - { - char** headerNamesAsChars = 0; - char** headerValuesAsChars = 0; - int numHeaders = 0; - - if (headers != 0) - { - numHeaders = headers->size(); - - headerNamesAsChars = (char**) juce_malloc (sizeof (char*) * numHeaders); - headerValuesAsChars = (char**) juce_malloc (sizeof (char*) * numHeaders); - - int i; - for (i = 0; i < numHeaders; ++i) - { - const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); - headerNamesAsChars[i] = (char*) juce_calloc (headerName.copyToUTF8 (0)); - headerName.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerNamesAsChars[i]); - - const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); - headerValuesAsChars[i] = (char*) juce_calloc (headerValue.copyToUTF8 (0)); - headerValue.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerValuesAsChars[i]); - } - } - - sendWebViewToURL ((const char*) url.toUTF8(), - (const char**) headerNamesAsChars, - (const char**) headerValuesAsChars, - numHeaders, - postData != 0 ? (const char*) postData->getData() : 0, - postData != 0 ? postData->getSize() : 0); - - for (int i = 0; i < numHeaders; ++i) - { - juce_free (headerNamesAsChars[i]); - juce_free (headerValuesAsChars[i]); - } - - juce_free (headerNamesAsChars); - juce_free (headerValuesAsChars); - } - - void goBack() - { - [webView goBack]; - } - - void goForward() - { - [webView goForward]; - } - - void stop() - { - [webView stopLoading: nil]; - } - - void updateBounds() - { - HIRect r; - r.origin.x = (float) owner->getScreenX() - owner->getTopLevelComponent()->getScreenX(); - r.origin.y = (float) owner->getScreenY() - owner->getTopLevelComponent()->getScreenY(); - r.size.width = (float) owner->getWidth(); - r.size.height = (float) owner->getHeight(); - HIViewSetFrame (view, &r); - } - -private: - WebBrowserComponent* const owner; - HIViewRef view; - WebView* webView; - DownloadClickDetector* clickListener; - - void sendWebViewToURL (const char* utf8URL, - const char** headerNames, - const char** headerValues, - int numHeaders, - const char* postData, - int postDataSize) - { - NSMutableURLRequest* r = [NSMutableURLRequest - requestWithURL: [NSURL URLWithString: [NSString stringWithUTF8String: utf8URL]] - cachePolicy: NSURLRequestUseProtocolCachePolicy - timeoutInterval: 30.0]; - - if (postDataSize > 0) - { - [ r setHTTPMethod: @"POST"]; - [ r setHTTPBody: [NSData dataWithBytes: postData length: postDataSize]]; - } - - int i; - for (i = 0; i < numHeaders; ++i) - { - [ r setValue: [NSString stringWithUTF8String: headerValues[i]] - forHTTPHeaderField: [NSString stringWithUTF8String: headerNames[i]]]; - } - - [[webView mainFrame] stopLoading ]; - [[webView mainFrame] loadRequest: r]; - } - - WebBrowserComponentInternal (const WebBrowserComponentInternal&); - const WebBrowserComponentInternal& operator= (const WebBrowserComponentInternal&); -}; - -//============================================================================== -WebBrowserComponent::WebBrowserComponent() - : browser (0), - associatedWindow (0), - blankPageShown (false) -{ - setOpaque (true); -} - -WebBrowserComponent::~WebBrowserComponent() -{ - deleteBrowser(); -} - -//============================================================================== -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; - - if (browser != 0) - browser->goToURL (url, headers, postData); -} - -void WebBrowserComponent::stop() -{ - if (browser != 0) - browser->stop(); -} - -void WebBrowserComponent::goBack() -{ - lastURL = String::empty; - blankPageShown = false; - - if (browser != 0) - browser->goBack(); -} - -void WebBrowserComponent::goForward() -{ - lastURL = String::empty; - - if (browser != 0) - browser->goForward(); -} - -//============================================================================== -void WebBrowserComponent::paint (Graphics& g) -{ - if (browser == 0) - g.fillAll (Colours::white); -} - -void WebBrowserComponent::checkWindowAssociation() -{ - void* const window = getWindowHandle(); - - if (window != associatedWindow - || (browser == 0 && window != 0)) - { - associatedWindow = window; - - deleteBrowser(); - createBrowser(); - } - - if (browser != 0) - { - if (associatedWindow != 0 && isShowing()) - { - browser->show(); - - if (blankPageShown) - goBack(); - } - else - { - if (! blankPageShown) - { - // when the component becomes invisible, some stuff like flash - // carries on playing audio, so we need to force it onto a blank - // page to avoid this.. - - blankPageShown = true; - browser->goToURL ("about:blank", 0, 0); - } - - browser->hide(); - } - } -} - -void WebBrowserComponent::createBrowser() -{ - deleteBrowser(); - - if (isShowing()) - { - WebInitForCarbon(); - browser = new WebBrowserComponentInternal (this); - reloadLastURL(); - } -} - -void WebBrowserComponent::deleteBrowser() -{ - deleteAndZero (browser); -} - -void WebBrowserComponent::reloadLastURL() -{ - if (lastURL.isNotEmpty()) - { - goToURL (lastURL, &lastHeaders, &lastPostData); - lastURL = String::empty; - } -} - -void WebBrowserComponent::updateBrowserPosition() -{ - if (getPeer() != 0 && browser != 0) - browser->updateBounds(); -} - -void WebBrowserComponent::parentHierarchyChanged() -{ - checkWindowAssociation(); -} - -void WebBrowserComponent::moved() -{ - updateBrowserPosition(); -} - -void WebBrowserComponent::resized() -{ - updateBrowserPosition(); -} - -void WebBrowserComponent::visibilityChanged() -{ - checkWindowAssociation(); -} - -bool WebBrowserComponent::pageAboutToLoad (const String& url) -{ - return true; -} - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER + +//============================================================================== +END_JUCE_NAMESPACE + +@interface DownloadClickDetector : NSObject +{ + JUCE_NAMESPACE::WebBrowserComponent* ownerComponent; +} + +- (DownloadClickDetector*) initWithWebBrowserOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; + +- (void) webView: (WebView*) webView decidePolicyForNavigationAction: (NSDictionary*) actionInformation + request: (NSURLRequest*) request + frame: (WebFrame*) frame + decisionListener: (id) listener; +@end + +//============================================================================== +@implementation DownloadClickDetector + +- (DownloadClickDetector*) initWithWebBrowserOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ +{ + [super init]; + ownerComponent = ownerComponent_; + return self; +} + +- (void) webView: (WebView*) sender decidePolicyForNavigationAction: (NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener +{ + NSURL* url = [actionInformation valueForKey: @"WebActionOriginalURLKey"]; + + if (ownerComponent->pageAboutToLoad (JUCE_NAMESPACE::String::fromUTF8 ((const JUCE_NAMESPACE::uint8*) [[url absoluteString] UTF8String]))) + [listener use]; + else + [listener ignore]; +} + +@end + +BEGIN_JUCE_NAMESPACE + +//============================================================================== +class WebBrowserComponentInternal : public NSViewComponent +{ +public: + WebBrowserComponentInternal (WebBrowserComponent* owner) + { + webView = [[WebView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) + frameName: @"" + groupName: @""]; + setView (webView); + + clickListener = [[DownloadClickDetector alloc] initWithWebBrowserOwner: owner]; + [webView setPolicyDelegate: clickListener]; + } + + ~WebBrowserComponentInternal() + { + [webView setPolicyDelegate: nil]; + [clickListener release]; + setView (0); + } + + void goToURL (const String& url, + const StringArray* headers, + const MemoryBlock* postData) + { + NSMutableURLRequest* r + = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: juceStringToNS (url)] + cachePolicy: NSURLRequestUseProtocolCachePolicy + timeoutInterval: 30.0]; + + if (postData != 0 && postData->getSize() > 0) + { + [r setHTTPMethod: @"POST"]; + [r setHTTPBody: [NSData dataWithBytes: postData->getData() + length: postData->getSize()]]; + } + + if (headers != 0) + { + for (int i = 0; i < headers->size(); ++i) + { + const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); + const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); + + [r setValue: juceStringToNS (headerValue) + forHTTPHeaderField: juceStringToNS (headerName)]; + } + } + + stop(); + [[webView mainFrame] loadRequest: r]; + } + + void goBack() + { + [webView goBack]; + } + + void goForward() + { + [webView goForward]; + } + + void stop() + { + [webView stopLoading: nil]; + } + +private: + WebView* webView; + DownloadClickDetector* clickListener; +}; + +//============================================================================== +WebBrowserComponent::WebBrowserComponent() + : browser (0), + blankPageShown (false) +{ + setOpaque (true); + + addAndMakeVisible (browser = new WebBrowserComponentInternal (this)); +} + +WebBrowserComponent::~WebBrowserComponent() +{ + deleteAndZero (browser); +} + +//============================================================================== +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; + + browser->goToURL (url, headers, postData); +} + +void WebBrowserComponent::stop() +{ + browser->stop(); +} + +void WebBrowserComponent::goBack() +{ + lastURL = String::empty; + blankPageShown = false; + browser->goBack(); +} + +void WebBrowserComponent::goForward() +{ + lastURL = String::empty; + browser->goForward(); +} + +//============================================================================== +void WebBrowserComponent::paint (Graphics& g) +{ +} + +void WebBrowserComponent::checkWindowAssociation() +{ + // when the component becomes invisible, some stuff like flash + // carries on playing audio, so we need to force it onto a blank + // page to avoid this, (and send it back when it's made visible again). + + if (isShowing()) + { + if (blankPageShown) + goBack(); + } + else + { + if (! blankPageShown) + { + blankPageShown = true; + browser->goToURL ("about:blank", 0, 0); + } + } +} + +void WebBrowserComponent::reloadLastURL() +{ + if (lastURL.isNotEmpty()) + { + goToURL (lastURL, &lastHeaders, &lastPostData); + lastURL = String::empty; + } +} + +void WebBrowserComponent::parentHierarchyChanged() +{ + checkWindowAssociation(); +} + +void WebBrowserComponent::resized() +{ + browser->setSize (getWidth(), getHeight()); +} + +void WebBrowserComponent::visibilityChanged() +{ + checkWindowAssociation(); +} + +bool WebBrowserComponent::pageAboutToLoad (const String& url) +{ + return true; +} + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Windowing.mm b/build/macosx/platform_specific_code/juce_mac_Windowing.mm deleted file mode 100644 index 16c9ea718d..0000000000 --- a/build/macosx/platform_specific_code/juce_mac_Windowing.mm +++ /dev/null @@ -1,3551 +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. - - ============================================================================== -*/ - -#include "juce_mac_NativeHeaders.h" -#include -#include -#include -#include -#include -#include - -#if JUCE_OPENGL -#include -#endif - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_appframework/events/juce_AsyncUpdater.h" -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_core/basics/juce_Singleton.h" -#include "../../../src/juce_core/basics/juce_Random.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_appframework/application/juce_SystemClipboard.h" -#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPress.h" -#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" -#include "../../../src/juce_appframework/gui/graphics/geometry/juce_RectangleList.h" -#include "../../../src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h" -#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" -#include "../../../src/juce_appframework/gui/components/menus/juce_MenuBarModel.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h" -#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h" -#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPressMappingSet.h" -#include "../../../src/juce_appframework/gui/graphics/imaging/juce_ImageFileFormat.h" -#include "../../../src/juce_core/containers/juce_MemoryBlock.h" - -#undef Point - -const WindowRegionCode windowRegionToUse = kWindowContentRgn; - -static HIObjectClassRef viewClassRef = 0; -static CFStringRef juceHiViewClassNameCFString = 0; -static ComponentPeer* juce_currentMouseTrackingPeer = 0; - - -//============================================================================== -static VoidArray keysCurrentlyDown; - -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() -{ - if (keysCurrentlyDown.contains ((void*) keyCode)) - return true; - - if (keyCode >= 'A' && keyCode <= 'Z' - && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toLowerCase ((tchar) keyCode))) - return true; - - if (keyCode >= 'a' && keyCode <= 'z' - && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toUpperCase ((tchar) keyCode))) - return true; - - return false; -} - -//============================================================================== -static VoidArray minimisedWindows; - -static void setWindowMinimised (WindowRef ref, const bool isMinimised) -{ - if (isMinimised != minimisedWindows.contains (ref)) - CollapseWindow (ref, isMinimised); -} - -void juce_maximiseAllMinimisedWindows() -{ - const VoidArray minWin (minimisedWindows); - - for (int i = minWin.size(); --i >= 0;) - setWindowMinimised ((WindowRef) (minWin[i]), false); -} - -//============================================================================== -class HIViewComponentPeer; -static HIViewComponentPeer* currentlyFocusedPeer = 0; - - -//============================================================================== -static int currentModifiers = 0; - -static void updateModifiers (EventRef theEvent) -{ - currentModifiers &= ~ (ModifierKeys::shiftModifier | ModifierKeys::ctrlModifier - | ModifierKeys::altModifier | ModifierKeys::commandModifier); - - UInt32 m; - - if (theEvent != 0) - GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, 0, sizeof(m), 0, &m); - else - m = GetCurrentEventKeyModifiers(); - - if ((m & (shiftKey | rightShiftKey)) != 0) - currentModifiers |= ModifierKeys::shiftModifier; - - if ((m & (controlKey | rightControlKey)) != 0) - currentModifiers |= ModifierKeys::ctrlModifier; - - if ((m & (optionKey | rightOptionKey)) != 0) - currentModifiers |= ModifierKeys::altModifier; - - if ((m & cmdKey) != 0) - currentModifiers |= ModifierKeys::commandModifier; -} - -void ModifierKeys::updateCurrentModifiers() throw() -{ - currentModifierFlags = currentModifiers; -} - -static int64 getEventTime (EventRef event) -{ - const int64 millis = (int64) (1000.0 * (event != 0 ? GetEventTime (event) - : GetCurrentEventTime())); - - static int64 offset = 0; - if (offset == 0) - offset = Time::currentTimeMillis() - millis; - - return offset + millis; -} - - -//============================================================================== -class MacBitmapImage : public Image -{ -public: - //============================================================================== - CGColorSpaceRef colourspace; - CGDataProviderRef provider; - - //============================================================================== - MacBitmapImage (const PixelFormat format_, - const int w, const int h, const bool clearImage) - : Image (format_, w, h) - { - jassert (format_ == RGB || format_ == ARGB); - - pixelStride = (format_ == RGB) ? 3 : 4; - - lineStride = (w * pixelStride + 3) & ~3; - const int imageSize = lineStride * h; - - if (clearImage) - imageData = (uint8*) juce_calloc (imageSize); - else - imageData = (uint8*) juce_malloc (imageSize); - - //colourspace = CGColorSpaceCreateWithName (kCGColorSpaceUserRGB); - - CMProfileRef prof; - CMGetSystemProfile (&prof); - colourspace = CGColorSpaceCreateWithPlatformColorSpace (prof); - provider = CGDataProviderCreateWithData (0, imageData, h * lineStride, 0); - CMCloseProfile (prof); - } - - MacBitmapImage::~MacBitmapImage() - { - CGDataProviderRelease (provider); - CGColorSpaceRelease (colourspace); - - juce_free (imageData); - imageData = 0; // to stop the base class freeing this - } - - void blitToContext (CGContextRef context, const float dx, const float dy) - { - CGImageRef tempImage = CGImageCreate (getWidth(), getHeight(), - 8, pixelStride << 3, lineStride, colourspace, -#if MACOS_10_3_OR_EARLIER || JUCE_BIG_ENDIAN - hasAlphaChannel() ? kCGImageAlphaPremultipliedFirst - : kCGImageAlphaNone, -#else - hasAlphaChannel() ? kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst - : kCGImageAlphaNone, -#endif - provider, 0, false, - kCGRenderingIntentDefault); - - HIRect r; - r.origin.x = dx; - r.origin.y = dy; - r.size.width = (float) getWidth(); - r.size.height = (float) getHeight(); - - HIViewDrawCGImage (context, &r, tempImage); - - CGImageRelease (tempImage); - } - - juce_UseDebuggingNewOperator -}; - - -//============================================================================== -class MouseCheckTimer : private Timer, - private DeletedAtShutdown -{ -public: - MouseCheckTimer() - : lastX (0), - lastY (0) - { - lastPeerUnderMouse = 0; - resetMouseMoveChecker(); - -#if ! MACOS_10_2_OR_EARLIER - // Just putting this in here because it's a convenient object that'll get deleted at shutdown - CGDisplayRegisterReconfigurationCallback (&displayChangeCallback, 0); -#endif - } - - ~MouseCheckTimer() - { -#if ! MACOS_10_2_OR_EARLIER - CGDisplayRemoveReconfigurationCallback (&displayChangeCallback, 0); -#endif - - clearSingletonInstance(); - } - - juce_DeclareSingleton_SingleThreaded_Minimal (MouseCheckTimer) - - bool hasEverHadAMouseMove; - - void moved (HIViewComponentPeer* const peer) - { - if (hasEverHadAMouseMove) - startTimer (200); - - lastPeerUnderMouse = peer; - } - - void resetMouseMoveChecker() - { - hasEverHadAMouseMove = false; - startTimer (1000 / 16); - } - - void timerCallback(); - -private: - HIViewComponentPeer* lastPeerUnderMouse; - int lastX, lastY; - -#if ! MACOS_10_2_OR_EARLIER - static void displayChangeCallback (CGDirectDisplayID, CGDisplayChangeSummaryFlags flags, void*) - { - Desktop::getInstance().refreshMonitorSizes(); - } -#endif -}; - -juce_ImplementSingleton_SingleThreaded (MouseCheckTimer) - -//============================================================================== -#if JUCE_QUICKTIME -extern void OfferMouseClickToQuickTime (WindowRef window, ::Point where, long when, long modifiers, - Component* topLevelComp); -#endif - - -//============================================================================== -class HIViewComponentPeer : public ComponentPeer, - private Timer -{ -public: - //============================================================================== - HIViewComponentPeer (Component* const component, - const int windowStyleFlags, - HIViewRef viewToAttachTo) - : ComponentPeer (component, windowStyleFlags), - fullScreen (false), - isCompositingWindow (false), - windowRef (0), - viewRef (0) - { - repainter = new RepaintManager (this); - - eventHandlerRef = 0; - - if (viewToAttachTo != 0) - { - isSharedWindow = true; - } - else - { - isSharedWindow = false; - - WindowRef newWindow = createNewWindow (windowStyleFlags); - - GetRootControl (newWindow, (ControlRef*) &viewToAttachTo); - jassert (viewToAttachTo != 0); - - HIViewRef growBox = 0; - HIViewFindByID (HIViewGetRoot (newWindow), kHIViewWindowGrowBoxID, &growBox); - - if (growBox != 0) - HIGrowBoxViewSetTransparent (growBox, true); - } - - createNewHIView(); - - HIViewAddSubview (viewToAttachTo, viewRef); - HIViewSetVisible (viewRef, component->isVisible()); - - setTitle (component->getName()); - - if (component->isVisible() && ! isSharedWindow) - { - ShowWindow (windowRef); - ActivateWindow (windowRef, component->getWantsKeyboardFocus()); - } - } - - ~HIViewComponentPeer() - { - minimisedWindows.removeValue (windowRef); - - if (IsValidWindowPtr (windowRef)) - { - if (! isSharedWindow) - { - CFRelease (viewRef); - viewRef = 0; - - DisposeWindow (windowRef); - } - else - { - if (eventHandlerRef != 0) - RemoveEventHandler (eventHandlerRef); - - CFRelease (viewRef); - viewRef = 0; - } - - windowRef = 0; - } - - if (currentlyFocusedPeer == this) - currentlyFocusedPeer = 0; - - delete repainter; - } - - //============================================================================== - void* getNativeHandle() const - { - return windowRef; - } - - void setVisible (bool shouldBeVisible) - { - HIViewSetVisible (viewRef, shouldBeVisible); - - if ((! isSharedWindow) && IsValidWindowPtr (windowRef)) - { - if (shouldBeVisible) - ShowWindow (windowRef); - else - HideWindow (windowRef); - - resizeViewToFitWindow(); - - // If nothing else is focused, then grab the focus too - if (shouldBeVisible - && Component::getCurrentlyFocusedComponent() == 0 - && Process::isForegroundProcess()) - { - component->toFront (true); - } - } - } - - void setTitle (const String& title) - { - if ((! isSharedWindow) && IsValidWindowPtr (windowRef)) - { - CFStringRef t = PlatformUtilities::juceStringToCFString (title); - SetWindowTitleWithCFString (windowRef, t); - CFRelease (t); - } - } - - void setPosition (int x, int y) - { - if (isSharedWindow) - { - HIViewPlaceInSuperviewAt (viewRef, x, y); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - r.right += x - r.left; - r.bottom += y - r.top; - r.left = x; - r.top = y; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void setSize (int w, int h) - { - w = jmax (0, w); - h = jmax (0, h); - - if (w != getComponent()->getWidth() - || h != getComponent()->getHeight()) - { - repainter->repaint (0, 0, w, h); - } - - if (isSharedWindow) - { - HIRect r; - HIViewGetFrame (viewRef, &r); - r.size.width = (float) w; - r.size.height = (float) h; - HIViewSetFrame (viewRef, &r); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - r.right = r.left + w; - r.bottom = r.top + h; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) - { - fullScreen = isNowFullScreen; - w = jmax (0, w); - h = jmax (0, h); - - if (w != getComponent()->getWidth() - || h != getComponent()->getHeight()) - { - repainter->repaint (0, 0, w, h); - } - - if (isSharedWindow) - { - HIRect r; - r.origin.x = (float) x; - r.origin.y = (float) y; - r.size.width = (float) w; - r.size.height = (float) h; - HIViewSetFrame (viewRef, &r); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - r.left = x; - r.top = y; - r.right = x + w; - r.bottom = y + h; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void getBounds (int& x, int& y, int& w, int& h, const bool global) const - { - HIRect hiViewPos; - HIViewGetFrame (viewRef, &hiViewPos); - - if (global) - { - HIViewRef content = 0; - HIViewFindByID (HIViewGetRoot (windowRef), kHIViewWindowContentID, &content); - HIPoint p = { 0.0f, 0.0f }; - HIViewConvertPoint (&p, viewRef, content); - - x = (int) p.x; - y = (int) p.y; - - if (IsValidWindowPtr (windowRef)) - { - Rect windowPos; - GetWindowBounds (windowRef, kWindowContentRgn, &windowPos); - - x += windowPos.left; - y += windowPos.top; - } - } - else - { - x = (int) hiViewPos.origin.x; - y = (int) hiViewPos.origin.y; - } - - w = (int) hiViewPos.size.width; - h = (int) hiViewPos.size.height; - } - - void getBounds (int& x, int& y, int& w, int& h) const - { - getBounds (x, y, w, h, ! isSharedWindow); - } - - int getScreenX() const - { - int x, y, w, h; - getBounds (x, y, w, h, true); - return x; - } - - int getScreenY() const - { - int x, y, w, h; - getBounds (x, y, w, h, true); - return y; - } - - void relativePositionToGlobal (int& x, int& y) - { - int wx, wy, ww, wh; - getBounds (wx, wy, ww, wh, true); - - x += wx; - y += wy; - } - - void globalPositionToRelative (int& x, int& y) - { - int wx, wy, ww, wh; - getBounds (wx, wy, ww, wh, true); - - x -= wx; - y -= wy; - } - - void setMinimised (bool shouldBeMinimised) - { - if (! isSharedWindow) - setWindowMinimised (windowRef, shouldBeMinimised); - } - - bool isMinimised() const - { - return minimisedWindows.contains (windowRef); - } - - void setFullScreen (bool shouldBeFullScreen) - { - if (! isSharedWindow) - { - Rectangle r (lastNonFullscreenBounds); - - setMinimised (false); - - if (fullScreen != shouldBeFullScreen) - { - if (shouldBeFullScreen) - r = Desktop::getInstance().getMainMonitorArea(); - - // (can't call the component's setBounds method because that'll reset our fullscreen flag) - if (r != getComponent()->getBounds() && ! r.isEmpty()) - setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); - } - } - } - - bool isFullScreen() const - { - return fullScreen; - } - - bool contains (int x, int y, bool trueIfInAChildWindow) const - { - if (((unsigned int) x) >= (unsigned int) component->getWidth() - || ((unsigned int) y) >= (unsigned int) component->getHeight() - || ! IsValidWindowPtr (windowRef)) - return false; - - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - - ::Point p; - p.h = r.left + x; - p.v = r.top + y; - - WindowRef ref2 = 0; - FindWindow (p, &ref2); - - if (windowRef != ref2) - return false; - - if (trueIfInAChildWindow) - return true; - - HIPoint p2; - p2.x = (float) x; - p2.y = (float) y; - HIViewRef hit; - - HIViewGetSubviewHit (viewRef, &p2, true, &hit); - return hit == 0 || hit == viewRef; - } - - const BorderSize getFrameSize() const - { - return BorderSize(); - } - - bool setAlwaysOnTop (bool alwaysOnTop) - { - // can't do this so return false and let the component create a new window - return false; - } - - void toFront (bool makeActiveWindow) - { - makeActiveWindow = makeActiveWindow - && component->isValidComponent() - && (component->getWantsKeyboardFocus() - || component->isCurrentlyModal()); - - if (windowRef != FrontWindow() - || (makeActiveWindow && ! IsWindowActive (windowRef)) - || ! Process::isForegroundProcess()) - { - if (! Process::isForegroundProcess()) - { - ProcessSerialNumber psn; - GetCurrentProcess (&psn); - SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly); - } - - if (IsValidWindowPtr (windowRef)) - { - if (makeActiveWindow) - { - SelectWindow (windowRef); - SetUserFocusWindow (windowRef); - HIViewAdvanceFocus (viewRef, 0); - } - else - { - BringToFront (windowRef); - } - - handleBroughtToFront(); - } - } - } - - void toBehind (ComponentPeer* other) - { - HIViewComponentPeer* const otherWindow = dynamic_cast (other); - - if (other != 0 && windowRef != 0 && otherWindow->windowRef != 0) - { - if (windowRef == otherWindow->windowRef) - { - HIViewSetZOrder (viewRef, kHIViewZOrderBelow, otherWindow->viewRef); - } - else - { - SendBehind (windowRef, otherWindow->windowRef); - } - } - } - - void setIcon (const Image& /*newIcon*/) - { - // to do.. - } - - //============================================================================== - void viewFocusGain() - { - const MessageManagerLock messLock; - - if (currentlyFocusedPeer != this) - { - if (ComponentPeer::isValidPeer (currentlyFocusedPeer)) - currentlyFocusedPeer->handleFocusLoss(); - - currentlyFocusedPeer = this; - - handleFocusGain(); - } - } - - void viewFocusLoss() - { - if (currentlyFocusedPeer == this) - { - currentlyFocusedPeer = 0; - handleFocusLoss(); - } - } - - bool isFocused() const - { - return windowRef == GetUserFocusWindow() - && HIViewSubtreeContainsFocus (viewRef); - } - - void grabFocus() - { - if ((! isFocused()) && IsValidWindowPtr (windowRef)) - { - SetUserFocusWindow (windowRef); - HIViewAdvanceFocus (viewRef, 0); - } - } - - void textInputRequired (int /*x*/, int /*y*/) - { - } - - //============================================================================== - void repaint (int x, int y, int w, int h) - { - if (Rectangle::intersectRectangles (x, y, w, h, - 0, 0, - getComponent()->getWidth(), - getComponent()->getHeight())) - { - if ((getStyleFlags() & windowRepaintedExplictly) == 0) - { - if (isCompositingWindow) - { -#if MACOS_10_3_OR_EARLIER - RgnHandle rgn = NewRgn(); - SetRectRgn (rgn, x, y, x + w, y + h); - HIViewSetNeedsDisplayInRegion (viewRef, rgn, true); - DisposeRgn (rgn); -#else - HIRect r; - r.origin.x = x; - r.origin.y = y; - r.size.width = w; - r.size.height = h; - - HIViewSetNeedsDisplayInRect (viewRef, &r, true); -#endif - } - else - { - if (! isTimerRunning()) - startTimer (20); - } - } - - repainter->repaint (x, y, w, h); - } - } - - void timerCallback() - { - performAnyPendingRepaintsNow(); - } - - void performAnyPendingRepaintsNow() - { - stopTimer(); - - if (component->isVisible()) - { -#if MACOS_10_2_OR_EARLIER - if (! isCompositingWindow) - { - Rect w; - GetWindowBounds (windowRef, windowRegionToUse, &w); - - const int offsetInWindowX = component->getScreenX() - getScreenX(); - const int offsetInWindowY = component->getScreenY() - getScreenY(); - - for (RectangleList::Iterator i (repainter->getRegionsNeedingRepaint()); i.next();) - { - const Rectangle& r = *i.getRectangle(); - w.left = offsetInWindowX + r.getX(); - w.top = offsetInWindowY + r.getY(); - w.right = offsetInWindowX + r.getRight(); - w.bottom = offsetInWindowY + r.getBottom(); - InvalWindowRect (windowRef, &w); - } - } - else - { - EventRef theEvent; - - EventTypeSpec eventTypes[1]; - eventTypes[0].eventClass = kEventClassControl; - eventTypes[0].eventKind = kEventControlDraw; - - int n = 3; - while (--n >= 0 - && ReceiveNextEvent (1, eventTypes, kEventDurationNoWait, true, &theEvent) == noErr) - { - if (GetEventClass (theEvent) == kEventClassAppleEvent) - { - EventRecord eventRec; - if (ConvertEventRefToEventRecord (theEvent, &eventRec)) - AEProcessAppleEvent (&eventRec); - } - else - { - EventTargetRef theTarget = GetEventDispatcherTarget(); - SendEventToEventTarget (theEvent, theTarget); - } - - ReleaseEvent (theEvent); - } - } -#else - if (HIViewGetNeedsDisplay (viewRef) || repainter->isRepaintNeeded()) - HIViewRender (viewRef); -#endif - } - } - - //============================================================================== - juce_UseDebuggingNewOperator - - WindowRef windowRef; - HIViewRef viewRef; - -private: - EventHandlerRef eventHandlerRef; - bool fullScreen, isSharedWindow, isCompositingWindow; - StringArray dragAndDropFiles; - - //============================================================================== - class RepaintManager : public Timer - { -public: - RepaintManager (HIViewComponentPeer* const peer_) - : peer (peer_), - image (0) - { - } - - ~RepaintManager() - { - delete image; - } - - void timerCallback() - { - stopTimer(); - deleteAndZero (image); - } - - void repaint (int x, int y, int w, int h) - { - regionsNeedingRepaint.add (x, y, w, h); - } - - bool isRepaintNeeded() const throw() - { - return ! regionsNeedingRepaint.isEmpty(); - } - - void repaintAnyRemainingRegions() - { - // if any regions have been invaldated during the paint callback, - // we need to repaint them explicitly because the mac throws this - // stuff away - for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) - { - const Rectangle& r = *i.getRectangle(); - peer->repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight()); - } - } - - void paint (CGContextRef cgContext, int x, int y, int w, int h) - { - if (w > 0 && h > 0) - { - bool refresh = false; - int imW = image != 0 ? image->getWidth() : 0; - int imH = image != 0 ? image->getHeight() : 0; - - if (imW < w || imH < h) - { - imW = jmin (peer->getComponent()->getWidth(), (w + 31) & ~31); - imH = jmin (peer->getComponent()->getHeight(), (h + 31) & ~31); - - delete image; - image = new MacBitmapImage (peer->getComponent()->isOpaque() ? Image::RGB - : Image::ARGB, - imW, imH, false); - - refresh = true; - } - else if (imageX > x || imageY > y - || imageX + imW < x + w - || imageY + imH < y + h) - { - refresh = true; - } - - if (refresh) - { - regionsNeedingRepaint.clear(); - regionsNeedingRepaint.addWithoutMerging (Rectangle (x, y, imW, imH)); - imageX = x; - imageY = y; - } - - LowLevelGraphicsSoftwareRenderer context (*image); - context.setOrigin (-imageX, -imageY); - - if (context.reduceClipRegion (regionsNeedingRepaint)) - { - regionsNeedingRepaint.clear(); - - if (! peer->getComponent()->isOpaque()) - { - for (RectangleList::Iterator i (*context.getRawClipRegion()); i.next();) - { - const Rectangle& r = *i.getRectangle(); - image->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); - } - } - - regionsNeedingRepaint.clear(); - peer->clearMaskedRegion(); - peer->handlePaint (context); - } - else - { - regionsNeedingRepaint.clear(); - } - - if (! peer->maskedRegion.isEmpty()) - { - RectangleList total (Rectangle (x, y, w, h)); - total.subtract (peer->maskedRegion); - - CGRect* rects = (CGRect*) juce_malloc (sizeof (CGRect) * total.getNumRectangles()); - int n = 0; - - for (RectangleList::Iterator i (total); i.next();) - { - const Rectangle& r = *i.getRectangle(); - rects[n].origin.x = (int) r.getX(); - rects[n].origin.y = (int) r.getY(); - rects[n].size.width = roundFloatToInt (r.getWidth()); - rects[n++].size.height = roundFloatToInt (r.getHeight()); - } - - CGContextClipToRects (cgContext, rects, n); - juce_free (rects); - } - - if (peer->isSharedWindow) - { - CGRect clip; - clip.origin.x = x; - clip.origin.y = y; - clip.size.width = jmin (w, peer->getComponent()->getWidth() - x); - clip.size.height = jmin (h, peer->getComponent()->getHeight() - y); - - CGContextClipToRect (cgContext, clip); - } - - image->blitToContext (cgContext, imageX, imageY); - } - - startTimer (3000); - } - - private: - HIViewComponentPeer* const peer; - MacBitmapImage* image; - int imageX, imageY; - RectangleList regionsNeedingRepaint; - - RepaintManager (const RepaintManager&); - const RepaintManager& operator= (const RepaintManager&); - }; - - RepaintManager* repainter; - - friend class RepaintManager; - - //============================================================================== - static OSStatus handleFrameRepaintEvent (EventHandlerCallRef myHandler, - EventRef theEvent, - void* userData) - { - // don't draw the frame.. - return noErr; - } - - //============================================================================== - OSStatus handleKeyEvent (EventRef theEvent, juce_wchar textCharacter) - { - updateModifiers (theEvent); - - UniChar unicodeChars [4]; - zeromem (unicodeChars, sizeof (unicodeChars)); - GetEventParameter (theEvent, kEventParamKeyUnicodes, typeUnicodeText, 0, sizeof (unicodeChars), 0, unicodeChars); - - int keyCode = (int) (unsigned int) unicodeChars[0]; - - UInt32 rawKey = 0; - GetEventParameter (theEvent, kEventParamKeyCode, typeUInt32, 0, sizeof (UInt32), 0, &rawKey); - - if ((currentModifiers & ModifierKeys::ctrlModifier) != 0 - && keyCode >= 1 && keyCode <= 26) - { - keyCode += ('A' - 1); - } - else - { - static const int keyTranslations[] = - { - 0, 's', 'd', 'f', 'h', 'g', 'z', 'x', 'c', 'v', 0xa7, 'b', - 'q', 'w', 'e', 'r', 'y', 't', '1', '2', '3', '4', '6', '5', - '=', '9', '7', '-', '8', '0', ']', 'o', 'u', '[', 'i', 'p', - KeyPress::returnKey, 'l', 'j', '\'', 'k', ';', '\\', ',', '/', - 'n', 'm', '.', 0, KeyPress::spaceKey, '`', KeyPress::backspaceKey, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, KeyPress::numberPadDecimalPoint, - 0, KeyPress::numberPadMultiply, 0, KeyPress::numberPadAdd, - 0, KeyPress::numberPadDelete, 0, 0, 0, KeyPress::numberPadDivide, KeyPress::returnKey, - 0, KeyPress::numberPadSubtract, 0, 0, KeyPress::numberPadEquals, KeyPress::numberPad0, - KeyPress::numberPad1, KeyPress::numberPad2, KeyPress::numberPad3, - KeyPress::numberPad4, KeyPress::numberPad5, KeyPress::numberPad6, - KeyPress::numberPad7, 0, KeyPress::numberPad8, KeyPress::numberPad9, - 0, 0, 0, KeyPress::F5Key, KeyPress::F6Key, KeyPress::F7Key, KeyPress::F3Key, - KeyPress::F8Key, KeyPress::F9Key, 0, KeyPress::F11Key, 0, KeyPress::F13Key, - KeyPress::F16Key, KeyPress::F14Key, 0, KeyPress::F10Key, 0, KeyPress::F12Key, - 0, KeyPress::F15Key, 0, KeyPress::homeKey, KeyPress::pageUpKey, 0, KeyPress::F4Key, - KeyPress::endKey, KeyPress::F2Key, KeyPress::pageDownKey, KeyPress::F1Key, - KeyPress::leftKey, KeyPress::rightKey, KeyPress::downKey, KeyPress::upKey, 0 - }; - - if (((unsigned int) rawKey) < (unsigned int) numElementsInArray (keyTranslations) - && keyTranslations [rawKey] != 0) - { - keyCode = keyTranslations [rawKey]; - } - - if ((rawKey == 0 && textCharacter != 0) - || (CharacterFunctions::isLetterOrDigit ((juce_wchar) keyCode) - && CharacterFunctions::isLetterOrDigit (textCharacter))) // correction for azerty-type layouts.. - { - keyCode = CharacterFunctions::toLowerCase (textCharacter); - } - } - - if ((currentModifiers & (ModifierKeys::commandModifier | ModifierKeys::ctrlModifier)) != 0) - textCharacter = 0; - - static juce_wchar lastTextCharacter = 0; - - switch (GetEventKind (theEvent)) - { - case kEventRawKeyDown: - { - keysCurrentlyDown.addIfNotAlreadyThere ((void*) keyCode); - lastTextCharacter = textCharacter; - - const bool used1 = handleKeyUpOrDown(); - const bool used2 = handleKeyPress (keyCode, textCharacter); - - if (used1 || used2) - return noErr; - - break; - } - - case kEventRawKeyUp: - keysCurrentlyDown.removeValue ((void*) keyCode); - lastTextCharacter = 0; - if (handleKeyUpOrDown()) - return noErr; - - break; - - case kEventRawKeyRepeat: - if (handleKeyPress (keyCode, lastTextCharacter)) - return noErr; - - break; - - case kEventRawKeyModifiersChanged: - handleModifierKeysChange(); - break; - - default: - jassertfalse - break; - } - - return eventNotHandledErr; - } - - OSStatus handleTextInputEvent (EventRef theEvent) - { - UInt32 numBytesRequired = 0; - GetEventParameter (theEvent, kEventParamTextInputSendText, typeUnicodeText, 0, 0, &numBytesRequired, 0); - - MemoryBlock buffer (numBytesRequired, true); - UniChar* const uc = (UniChar*) buffer.getData(); - GetEventParameter (theEvent, kEventParamTextInputSendText, typeUnicodeText, 0, numBytesRequired, &numBytesRequired, uc); - - EventRef originalEvent; - GetEventParameter (theEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, 0, sizeof (originalEvent), 0, &originalEvent); - - OSStatus res = noErr; - for (int i = 0; i < numBytesRequired / sizeof (UniChar); ++i) - res = handleKeyEvent (originalEvent, (juce_wchar) uc[i]); - - return res; - } - - //============================================================================== - OSStatus handleMouseEvent (EventHandlerCallRef callRef, EventRef theEvent) - { - MouseCheckTimer::getInstance()->moved (this); - - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof (::Point), 0, &where); - int x = where.h; - int y = where.v; - globalPositionToRelative (x, y); - - int64 time = getEventTime (theEvent); - - switch (GetEventKind (theEvent)) - { - case kEventMouseMoved: - MouseCheckTimer::getInstance()->hasEverHadAMouseMove = true; - updateModifiers (theEvent); - handleMouseMove (x, y, time); - break; - - case kEventMouseDragged: - updateModifiers (theEvent); - handleMouseDrag (x, y, time); - break; - - case kEventMouseDown: - { - if (! Process::isForegroundProcess()) - { - ProcessSerialNumber psn; - GetCurrentProcess (&psn); - SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly); - - toFront (true); - } - -#if JUCE_QUICKTIME - { - long mods; - GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, 0, sizeof (mods), 0, &mods); - - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof (::Point), 0, &where); - - OfferMouseClickToQuickTime (windowRef, where, EventTimeToTicks (GetEventTime (theEvent)), mods, component); - } -#endif - - if (component->isBroughtToFrontOnMouseClick() - && ! component->isCurrentlyBlockedByAnotherModalComponent()) - { - //ActivateWindow (windowRef, true); - SelectWindow (windowRef); - } - - EventMouseButton button; - GetEventParameter (theEvent, kEventParamMouseButton, typeMouseButton, 0, sizeof (EventMouseButton), 0, &button); - - // need to clear all these flags because sometimes the mac can swallow (right) mouse-up events and - // this makes a button get stuck down. Since there's no other way to tell what buttons are down, - // this is all I can think of doing about it.. - currentModifiers &= ~(ModifierKeys::leftButtonModifier | ModifierKeys::rightButtonModifier | ModifierKeys::middleButtonModifier); - - if (button == kEventMouseButtonPrimary) - currentModifiers |= ModifierKeys::leftButtonModifier; - else if (button == kEventMouseButtonSecondary) - currentModifiers |= ModifierKeys::rightButtonModifier; - else if (button == kEventMouseButtonTertiary) - currentModifiers |= ModifierKeys::middleButtonModifier; - - updateModifiers (theEvent); - - juce_currentMouseTrackingPeer = this; // puts the message dispatcher into mouse-tracking mode.. - handleMouseDown (x, y, time); - break; - } - - case kEventMouseUp: - { - const int oldModifiers = currentModifiers; - - EventMouseButton button; - GetEventParameter (theEvent, kEventParamMouseButton, typeMouseButton, 0, sizeof (EventMouseButton), 0, &button); - - if (button == kEventMouseButtonPrimary) - currentModifiers &= ~ModifierKeys::leftButtonModifier; - else if (button == kEventMouseButtonSecondary) - currentModifiers &= ~ModifierKeys::rightButtonModifier; - - updateModifiers (theEvent); - - juce_currentMouseTrackingPeer = 0; - handleMouseUp (oldModifiers, x, y, time); - break; - } - - case kEventMouseWheelMoved: - { - EventMouseWheelAxis axis; - GetEventParameter (theEvent, kEventParamMouseWheelAxis, typeMouseWheelAxis, 0, sizeof (axis), 0, &axis); - - SInt32 delta; - GetEventParameter (theEvent, kEventParamMouseWheelDelta, - typeLongInteger, 0, sizeof (delta), 0, &delta); - - updateModifiers (theEvent); - - handleMouseWheel (axis == kEventMouseWheelAxisX ? delta * 10 : 0, - axis == kEventMouseWheelAxisX ? 0 : delta * 10, - time); - - break; - } - } - - return noErr; - } - - //============================================================================== - void doDragDropEnter (EventRef theEvent) - { - updateDragAndDropFileList (theEvent); - - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragMove (dragAndDropFiles, x, y); - } - } - - void doDragDropMove (EventRef theEvent) - { - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragMove (dragAndDropFiles, x, y); - } - } - - void doDragDropExit (EventRef theEvent) - { - if (dragAndDropFiles.size() > 0) - handleFileDragExit (dragAndDropFiles); - } - - void doDragDrop (EventRef theEvent) - { - updateDragAndDropFileList (theEvent); - - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragDrop (dragAndDropFiles, x, y); - } - } - - void updateDragAndDropFileList (EventRef theEvent) - { - dragAndDropFiles.clear(); - - DragRef dragRef; - if (GetEventParameter (theEvent, kEventParamDragRef, typeDragRef, 0, sizeof (dragRef), 0, &dragRef) == noErr) - { - UInt16 numItems = 0; - if (CountDragItems (dragRef, &numItems) == noErr) - { - for (int i = 0; i < (int) numItems; ++i) - { - DragItemRef ref; - - if (GetDragItemReferenceNumber (dragRef, i + 1, &ref) == noErr) - { - const FlavorType flavorType = kDragFlavorTypeHFS; - - Size size = 0; - if (GetFlavorDataSize (dragRef, ref, flavorType, &size) == noErr) - { - void* data = juce_calloc (size); - - if (GetFlavorData (dragRef, ref, flavorType, data, &size, 0) == noErr) - { - HFSFlavor* f = (HFSFlavor*) data; - FSRef fsref; - - if (FSpMakeFSRef (&f->fileSpec, &fsref) == noErr) - { - const String path (PlatformUtilities::makePathFromFSRef (&fsref)); - - if (path.isNotEmpty()) - dragAndDropFiles.add (path); - } - } - - juce_free (data); - } - } - } - - dragAndDropFiles.trim(); - dragAndDropFiles.removeEmptyStrings(); - } - } - } - - //============================================================================== - void resizeViewToFitWindow() - { - HIRect r; - - if (isSharedWindow) - { - HIViewGetFrame (viewRef, &r); - r.size.width = (float) component->getWidth(); - r.size.height = (float) component->getHeight(); - } - else - { - r.origin.x = 0; - r.origin.y = 0; - - Rect w; - GetWindowBounds (windowRef, windowRegionToUse, &w); - - r.size.width = (float) (w.right - w.left); - r.size.height = (float) (w.bottom - w.top); - } - - HIViewSetFrame (viewRef, &r); - -#if MACOS_10_3_OR_EARLIER - component->repaint(); -#endif - } - - //============================================================================== - OSStatus hiViewDraw (EventRef theEvent) - { - CGContextRef context = 0; - GetEventParameter (theEvent, kEventParamCGContextRef, typeCGContextRef, 0, sizeof (CGContextRef), 0, &context); - - CGrafPtr oldPort; - CGrafPtr port = 0; - - if (context == 0) - { - GetEventParameter (theEvent, kEventParamGrafPort, typeGrafPtr, 0, sizeof (CGrafPtr), 0, &port); - - GetPort (&oldPort); - SetPort (port); - - if (port != 0) - QDBeginCGContext (port, &context); - - if (! isCompositingWindow) - { - Rect bounds; - GetWindowBounds (windowRef, windowRegionToUse, &bounds); - CGContextTranslateCTM (context, 0, bounds.bottom - bounds.top); - CGContextScaleCTM (context, 1.0, -1.0); - } - - if (isSharedWindow) - { - // NB - Had terrible problems trying to correctly get the position - // of this view relative to the window, and this seems wrong, but - // works better than any other method I've tried.. - HIRect hiViewPos; - HIViewGetFrame (viewRef, &hiViewPos); - CGContextTranslateCTM (context, hiViewPos.origin.x, hiViewPos.origin.y); - } - } - -#if MACOS_10_2_OR_EARLIER - RgnHandle rgn = 0; - GetEventParameter (theEvent, kEventParamRgnHandle, typeQDRgnHandle, 0, sizeof (RgnHandle), 0, &rgn); - - CGRect clip; - - // (avoid doing this in plugins because of some strange redraw bugs..) - if (rgn != 0 && JUCEApplication::getInstance() != 0) - { - Rect bounds; - GetRegionBounds (rgn, &bounds); - clip.origin.x = bounds.left; - clip.origin.y = bounds.top; - clip.size.width = bounds.right - bounds.left; - clip.size.height = bounds.bottom - bounds.top; - } - else - { - HIViewGetBounds (viewRef, &clip); - clip.origin.x = 0; - clip.origin.y = 0; - } -#else - CGRect clip (CGContextGetClipBoundingBox (context)); -#endif - - clip = CGRectIntegral (clip); - - if (clip.origin.x < 0) - { - clip.size.width += clip.origin.x; - clip.origin.x = 0; - } - - if (clip.origin.y < 0) - { - clip.size.height += clip.origin.y; - clip.origin.y = 0; - } - - if (! component->isOpaque()) - CGContextClearRect (context, clip); - - repainter->paint (context, - (int) clip.origin.x, (int) clip.origin.y, - (int) clip.size.width, (int) clip.size.height); - - if (port != 0) - { - CGContextFlush (context); - QDEndCGContext (port, &context); - - SetPort (oldPort); - } - - repainter->repaintAnyRemainingRegions(); - - return noErr; - } - - //============================================================================== - OSStatus handleWindowClassEvent (EventRef theEvent) - { - switch (GetEventKind (theEvent)) - { - case kEventWindowBoundsChanged: - resizeViewToFitWindow(); - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowBoundsChanging: - if ((styleFlags & (windowIsResizable | windowHasTitleBar)) == (windowIsResizable | windowHasTitleBar)) - { - UInt32 atts = 0; - GetEventParameter (theEvent, kEventParamAttributes, typeUInt32, - 0, sizeof (UInt32), 0, &atts); - - if ((atts & (kWindowBoundsChangeUserDrag | kWindowBoundsChangeUserResize)) != 0) - { - if (component->isCurrentlyBlockedByAnotherModalComponent()) - { - Component* const modal = Component::getCurrentlyModalComponent(); - if (modal != 0) - { - static uint32 lastDragTime = 0; - const uint32 now = Time::currentTimeMillis(); - - if (now > lastDragTime + 1000) - { - lastDragTime = now; - modal->inputAttemptWhenModal(); - } - - const Rectangle currentRect (getComponent()->getBounds()); - Rect current; - current.left = currentRect.getX(); - current.top = currentRect.getY(); - current.right = currentRect.getRight(); - current.bottom = currentRect.getBottom(); - - // stop the window getting dragged.. - SetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - sizeof (Rect), ¤t); - - return noErr; - } - } - - if ((atts & kWindowBoundsChangeUserResize) != 0 - && constrainer != 0 && ! isSharedWindow) - { - Rect current; - GetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - 0, sizeof (Rect), 0, ¤t); - - int x = current.left; - int y = current.top; - int w = current.right - current.left; - int h = current.bottom - current.top; - - const Rectangle currentRect (getComponent()->getBounds()); - - constrainer->checkBounds (x, y, w, h, currentRect, - Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), - y != currentRect.getY() && y + h == currentRect.getBottom(), - x != currentRect.getX() && x + w == currentRect.getRight(), - y == currentRect.getY() && y + h != currentRect.getBottom(), - x == currentRect.getX() && x + w != currentRect.getRight()); - - current.left = x; - current.top = y; - current.right = x + w; - current.bottom = y + h; - - SetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - sizeof (Rect), ¤t); - - return noErr; - } - } - } - break; - - case kEventWindowFocusAcquired: - keysCurrentlyDown.clear(); - - if ((! isSharedWindow) || HIViewSubtreeContainsFocus (viewRef)) - viewFocusGain(); - - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowFocusRelinquish: - keysCurrentlyDown.clear(); - viewFocusLoss(); - - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowCollapsed: - minimisedWindows.addIfNotAlreadyThere (windowRef); - handleMovedOrResized(); - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowExpanded: - minimisedWindows.removeValue (windowRef); - handleMovedOrResized(); - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowShown: - break; // allow other handlers in the event chain to also get a look at the events - - case kEventWindowClose: - if (isSharedWindow) - break; // break to let the OS delete the window - - handleUserClosingWindow(); - return noErr; // avoids letting the OS to delete the window, we'll do that ourselves. - - default: - break; - } - - return eventNotHandledErr; - } - - OSStatus handleWindowEventForPeer (EventHandlerCallRef callRef, EventRef theEvent) - { - switch (GetEventClass (theEvent)) - { - case kEventClassMouse: - { - static HIViewComponentPeer* lastMouseDownPeer = 0; - - const UInt32 eventKind = GetEventKind (theEvent); - HIViewRef view = 0; - - if (eventKind == kEventMouseDragged) - { - view = viewRef; - } - else - { - HIViewGetViewForMouseEvent (HIViewGetRoot (windowRef), theEvent, &view); - - if (view != viewRef) - { - if ((eventKind == kEventMouseUp - || eventKind == kEventMouseExited) - && ComponentPeer::isValidPeer (lastMouseDownPeer)) - { - return lastMouseDownPeer->handleMouseEvent (callRef, theEvent); - } - - return eventNotHandledErr; - } - } - - if (eventKind == kEventMouseDown - || eventKind == kEventMouseDragged - || eventKind == kEventMouseEntered) - { - lastMouseDownPeer = this; - } - - return handleMouseEvent (callRef, theEvent); - } - break; - - case kEventClassWindow: - return handleWindowClassEvent (theEvent); - - case kEventClassKeyboard: - if (isFocused()) - return handleKeyEvent (theEvent, 0); - - break; - - case kEventClassTextInput: - if (isFocused()) - return handleTextInputEvent (theEvent); - - break; - - default: - break; - } - - return eventNotHandledErr; - } - - static pascal OSStatus handleWindowEvent (EventHandlerCallRef callRef, EventRef theEvent, void* userData) - { - MessageManager::delayWaitCursor(); - - HIViewComponentPeer* const peer = (HIViewComponentPeer*) userData; - - const MessageManagerLock messLock; - - if (ComponentPeer::isValidPeer (peer)) - return peer->handleWindowEventForPeer (callRef, theEvent); - - return eventNotHandledErr; - } - - //============================================================================== - static pascal OSStatus hiViewEventHandler (EventHandlerCallRef myHandler, EventRef theEvent, void* userData) - { - MessageManager::delayWaitCursor(); - - const UInt32 eventKind = GetEventKind (theEvent); - const UInt32 eventClass = GetEventClass (theEvent); - - if (eventClass == kEventClassHIObject) - { - switch (eventKind) - { - case kEventHIObjectConstruct: - { - void* data = juce_calloc (sizeof (void*)); - SetEventParameter (theEvent, kEventParamHIObjectInstance, - typeVoidPtr, sizeof (void*), &data); - - return noErr; - } - - case kEventHIObjectInitialize: - GetEventParameter (theEvent, 'peer', typeVoidPtr, 0, sizeof (void*), 0, (void**) userData); - return noErr; - - case kEventHIObjectDestruct: - juce_free (userData); - return noErr; - - default: - break; - } - } - else if (eventClass == kEventClassControl) - { - HIViewComponentPeer* const peer = *(HIViewComponentPeer**) userData; - const MessageManagerLock messLock; - - if (! ComponentPeer::isValidPeer (peer)) - return eventNotHandledErr; - - switch (eventKind) - { - case kEventControlDraw: - return peer->hiViewDraw (theEvent); - - case kEventControlBoundsChanged: - { - HIRect bounds; - HIViewGetBounds (peer->viewRef, &bounds); - peer->repaint (0, 0, roundFloatToInt (bounds.size.width), roundFloatToInt (bounds.size.height)); - - peer->handleMovedOrResized(); - return noErr; - } - - case kEventControlHitTest: - { - HIPoint where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeHIPoint, 0, sizeof (HIPoint), 0, &where); - - HIRect bounds; - HIViewGetBounds (peer->viewRef, &bounds); - - ControlPartCode part = kControlNoPart; - - if (CGRectContainsPoint (bounds, where)) - part = 1; - - SetEventParameter (theEvent, kEventParamControlPart, typeControlPartCode, sizeof (ControlPartCode), &part); - return noErr; - } - break; - - case kEventControlSetFocusPart: - { - ControlPartCode desiredFocus; - if (GetEventParameter (theEvent, kEventParamControlPart, typeControlPartCode, 0, sizeof (ControlPartCode), 0, &desiredFocus) != noErr) - break; - - if (desiredFocus == kControlNoPart) - peer->viewFocusLoss(); - else - peer->viewFocusGain(); - - return noErr; - } - break; - - case kEventControlDragEnter: - { -#if MACOS_10_2_OR_EARLIER - enum { kEventParamControlWouldAcceptDrop = 'cldg' }; -#endif - Boolean accept = true; - SetEventParameter (theEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof (accept), &accept); - - peer->doDragDropEnter (theEvent); - return noErr; - } - - case kEventControlDragWithin: - peer->doDragDropMove (theEvent); - return noErr; - - case kEventControlDragLeave: - peer->doDragDropExit (theEvent); - return noErr; - - case kEventControlDragReceive: - peer->doDragDrop (theEvent); - return noErr; - - case kEventControlOwningWindowChanged: - return peer->ownerWindowChanged (theEvent); - -#if ! MACOS_10_2_OR_EARLIER - case kEventControlGetFrameMetrics: - { - CallNextEventHandler (myHandler, theEvent); - HIViewFrameMetrics metrics; - GetEventParameter (theEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, 0, sizeof (metrics), 0, &metrics); - metrics.top = metrics.bottom = 0; - SetEventParameter (theEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, sizeof (metrics), &metrics); - return noErr; - } -#endif - - case kEventControlInitialize: - { - UInt32 features = kControlSupportsDragAndDrop - | kControlSupportsFocus - | kControlHandlesTracking - | kControlSupportsEmbedding - | (1 << 8) /*kHIViewFeatureGetsFocusOnClick*/; - - SetEventParameter (theEvent, kEventParamControlFeatures, typeUInt32, sizeof (UInt32), &features); - return noErr; - } - - default: - break; - } - } - - return eventNotHandledErr; - } - - //============================================================================== - WindowRef createNewWindow (const int windowStyleFlags) - { - jassert (windowRef == 0); - - static ToolboxObjectClassRef customWindowClass = 0; - - if (customWindowClass == 0) - { - // Register our window class - const EventTypeSpec customTypes[] = { { kEventClassWindow, kEventWindowDrawFrame } }; - - UnsignedWide t; - Microseconds (&t); - const String randomString ((int) (t.lo & 0x7ffffff)); - const String juceWindowClassName (T("JUCEWindowClass_") + randomString); - CFStringRef juceWindowClassNameCFString = PlatformUtilities::juceStringToCFString (juceWindowClassName); - - RegisterToolboxObjectClass (juceWindowClassNameCFString, - 0, 1, customTypes, - NewEventHandlerUPP (handleFrameRepaintEvent), - 0, &customWindowClass); - - CFRelease (juceWindowClassNameCFString); - } - - Rect pos; - pos.left = getComponent()->getX(); - pos.top = getComponent()->getY(); - pos.right = getComponent()->getRight(); - pos.bottom = getComponent()->getBottom(); - - int attributes = kWindowStandardHandlerAttribute | kWindowCompositingAttribute; - if ((windowStyleFlags & windowHasDropShadow) == 0) - attributes |= kWindowNoShadowAttribute; - - if ((windowStyleFlags & windowIgnoresMouseClicks) != 0) - attributes |= kWindowIgnoreClicksAttribute; - -#if ! MACOS_10_3_OR_EARLIER - if ((windowStyleFlags & windowIsTemporary) != 0) - attributes |= kWindowDoesNotCycleAttribute; -#endif - - WindowRef newWindow = 0; - - if ((windowStyleFlags & windowHasTitleBar) == 0) - { - attributes |= kWindowCollapseBoxAttribute; - - WindowDefSpec customWindowSpec; - customWindowSpec.defType = kWindowDefObjectClass; - customWindowSpec.u.classRef = customWindowClass; - - CreateCustomWindow (&customWindowSpec, - ((windowStyleFlags & windowIsTemporary) != 0) ? kUtilityWindowClass : - (getComponent()->isAlwaysOnTop() ? kUtilityWindowClass - : kDocumentWindowClass), - attributes, - &pos, - &newWindow); - } - else - { - if ((windowStyleFlags & windowHasCloseButton) != 0) - attributes |= kWindowCloseBoxAttribute; - - if ((windowStyleFlags & windowHasMinimiseButton) != 0) - attributes |= kWindowCollapseBoxAttribute; - - if ((windowStyleFlags & windowHasMaximiseButton) != 0) - attributes |= kWindowFullZoomAttribute; - - if ((windowStyleFlags & windowIsResizable) != 0) - attributes |= kWindowResizableAttribute | kWindowLiveResizeAttribute; - - CreateNewWindow (kDocumentWindowClass, attributes, &pos, &newWindow); - } - - jassert (newWindow != 0); - if (newWindow != 0) - { - HideWindow (newWindow); - - SetAutomaticControlDragTrackingEnabledForWindow (newWindow, true); - - if (! getComponent()->isOpaque()) - SetWindowAlpha (newWindow, 0.9999999f); // to fool it into giving the window an alpha-channel - } - - return newWindow; - } - - OSStatus ownerWindowChanged (EventRef theEvent) - { - WindowRef newWindow = 0; - GetEventParameter (theEvent, kEventParamControlCurrentOwningWindow, typeWindowRef, 0, sizeof (newWindow), 0, &newWindow); - - if (windowRef != newWindow) - { - if (eventHandlerRef != 0) - { - RemoveEventHandler (eventHandlerRef); - eventHandlerRef = 0; - } - - windowRef = newWindow; - - if (windowRef != 0) - { - const EventTypeSpec eventTypes[] = - { - { kEventClassWindow, kEventWindowBoundsChanged }, - { kEventClassWindow, kEventWindowBoundsChanging }, - { kEventClassWindow, kEventWindowFocusAcquired }, - { kEventClassWindow, kEventWindowFocusRelinquish }, - { kEventClassWindow, kEventWindowCollapsed }, - { kEventClassWindow, kEventWindowExpanded }, - { kEventClassWindow, kEventWindowShown }, - { kEventClassWindow, kEventWindowClose }, - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassMouse, kEventMouseDragged }, - { kEventClassMouse, kEventMouseEntered }, - { kEventClassMouse, kEventMouseExited }, - { kEventClassMouse, kEventMouseWheelMoved }, - { kEventClassKeyboard, kEventRawKeyUp }, - { kEventClassKeyboard, kEventRawKeyRepeat }, - { kEventClassKeyboard, kEventRawKeyModifiersChanged }, - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } - }; - - static EventHandlerUPP handleWindowEventUPP = 0; - - if (handleWindowEventUPP == 0) - handleWindowEventUPP = NewEventHandlerUPP (handleWindowEvent); - - InstallWindowEventHandler (windowRef, handleWindowEventUPP, - GetEventTypeCount (eventTypes), eventTypes, - (void*) this, (EventHandlerRef*) &eventHandlerRef); - - WindowAttributes attributes; - GetWindowAttributes (windowRef, &attributes); - -#if MACOS_10_3_OR_EARLIER - isCompositingWindow = ((attributes & kWindowCompositingAttribute) != 0); -#else - isCompositingWindow = HIViewIsCompositingEnabled (viewRef); -#endif - - SetAutomaticControlDragTrackingEnabledForWindow (newWindow, true); - - MouseCheckTimer::getInstance()->resetMouseMoveChecker(); - } - } - - resizeViewToFitWindow(); - return noErr; - } - - void createNewHIView() - { - jassert (viewRef == 0); - - if (viewClassRef == 0) - { - // Register our HIView class - EventTypeSpec viewEvents[] = - { - { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassControl, kEventControlInitialize }, - { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlBoundsChanged }, - { kEventClassControl, kEventControlSetFocusPart }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlDragEnter }, - { kEventClassControl, kEventControlDragLeave }, - { kEventClassControl, kEventControlDragWithin }, - { kEventClassControl, kEventControlDragReceive }, - { kEventClassControl, kEventControlOwningWindowChanged } - }; - - UnsignedWide t; - Microseconds (&t); - const String randomString ((int) (t.lo & 0x7ffffff)); - const String juceHiViewClassName (T("JUCEHIViewClass_") + randomString); - juceHiViewClassNameCFString = PlatformUtilities::juceStringToCFString (juceHiViewClassName); - - HIObjectRegisterSubclass (juceHiViewClassNameCFString, - kHIViewClassID, 0, - NewEventHandlerUPP (hiViewEventHandler), - GetEventTypeCount (viewEvents), - viewEvents, 0, - &viewClassRef); - } - - EventRef event; - CreateEvent (0, kEventClassHIObject, kEventHIObjectInitialize, GetCurrentEventTime(), kEventAttributeNone, &event); - - void* thisPointer = this; - SetEventParameter (event, 'peer', typeVoidPtr, sizeof (void*), &thisPointer); - - HIObjectCreate (juceHiViewClassNameCFString, event, (HIObjectRef*) &viewRef); - - SetControlDragTrackingEnabled (viewRef, true); - - if (isSharedWindow) - { - setBounds (component->getX(), component->getY(), - component->getWidth(), component->getHeight(), false); - } - } -}; - -//============================================================================== -bool juce_isHIViewCreatedByJuce (HIViewRef view) -{ - return juceHiViewClassNameCFString != 0 - && HIObjectIsOfClass ((HIObjectRef) view, juceHiViewClassNameCFString); -} - -bool juce_isWindowCreatedByJuce (WindowRef window) -{ - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - if (ComponentPeer::getPeer(i)->getNativeHandle() == window) - return true; - - return false; -} - -static void trackNextMouseEvent() -{ - UInt32 mods; - MouseTrackingResult result; - ::Point where; - - if (TrackMouseLocationWithOptions ((GrafPtr) -1, 0, 0.01, //kEventDurationForever, - &where, &mods, &result) != noErr - || ! ComponentPeer::isValidPeer (juce_currentMouseTrackingPeer)) - { - juce_currentMouseTrackingPeer = 0; - return; - } - - if (result == kMouseTrackingTimedOut) - return; - -#if MACOS_10_3_OR_EARLIER - const int x = where.h - juce_currentMouseTrackingPeer->getScreenX(); - const int y = where.v - juce_currentMouseTrackingPeer->getScreenY(); -#else - HIPoint p; - p.x = where.h; - p.y = where.v; - HIPointConvert (&p, kHICoordSpaceScreenPixel, 0, - kHICoordSpaceView, ((HIViewComponentPeer*) juce_currentMouseTrackingPeer)->viewRef); - const int x = p.x; - const int y = p.y; -#endif - - if (result == kMouseTrackingMouseDragged) - { - updateModifiers (0); - juce_currentMouseTrackingPeer->handleMouseDrag (x, y, getEventTime (0)); - - if (! ComponentPeer::isValidPeer (juce_currentMouseTrackingPeer)) - { - juce_currentMouseTrackingPeer = 0; - return; - } - } - else if (result == kMouseTrackingMouseUp - || result == kMouseTrackingUserCancelled - || result == kMouseTrackingMouseMoved) - { - ComponentPeer* const oldPeer = juce_currentMouseTrackingPeer; - juce_currentMouseTrackingPeer = 0; - - if (ComponentPeer::isValidPeer (oldPeer)) - { - const int oldModifiers = currentModifiers; - currentModifiers &= ~(ModifierKeys::leftButtonModifier | ModifierKeys::rightButtonModifier | ModifierKeys::middleButtonModifier); - updateModifiers (0); - - oldPeer->handleMouseUp (oldModifiers, x, y, getEventTime (0)); - } - } -} - -bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) -{ - if (juce_currentMouseTrackingPeer != 0) - trackNextMouseEvent(); - -/* [[NSRunLoop mainRunLoop] acceptInputForMode: NSDefaultRunLoopMode - beforeDate: returnIfNoPendingMessages - ? [[NSDate date] addTimeInterval: 0.01] - : [NSDate distantFuture]]; -*/ - EventRef theEvent; - - if (ReceiveNextEvent (0, 0, (returnIfNoPendingMessages) ? kEventDurationNoWait - : kEventDurationForever, - true, &theEvent) == noErr) - { - if (GetEventClass (theEvent) == kEventClassAppleEvent) - { - EventRecord eventRec; - if (ConvertEventRefToEventRecord (theEvent, &eventRec)) - AEProcessAppleEvent (&eventRec); - } - else - { - EventTargetRef theTarget = GetEventDispatcherTarget(); - SendEventToEventTarget (theEvent, theTarget); - } - - ReleaseEvent (theEvent); - return true; - } - - return false; -} - -//============================================================================== -ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) -{ - return new HIViewComponentPeer (this, styleFlags, (HIViewRef) windowToAttachTo); -} - -//============================================================================== -void MouseCheckTimer::timerCallback() -{ - if (ModifierKeys::getCurrentModifiersRealtime().isAnyMouseButtonDown()) - return; - - if (Process::isForegroundProcess()) - { - bool stillOver = false; - int x = 0, y = 0, w = 0, h = 0; - int mx = 0, my = 0; - const bool validWindow = ComponentPeer::isValidPeer (lastPeerUnderMouse); - - if (validWindow) - { - lastPeerUnderMouse->getBounds (x, y, w, h, true); - Desktop::getMousePosition (mx, my); - - stillOver = (mx >= x && my >= y && mx < x + w && my < y + h); - - if (stillOver) - { - // check if it's over an embedded HIView - int rx = mx, ry = my; - lastPeerUnderMouse->globalPositionToRelative (rx, ry); - HIPoint hipoint; - hipoint.x = rx; - hipoint.y = ry; - - HIViewRef root; - GetRootControl ((WindowRef) lastPeerUnderMouse->getNativeHandle(), &root); - - HIViewRef hitview; - if (HIViewGetSubviewHit (root, &hipoint, true, &hitview) == noErr && hitview != 0) - { - stillOver = HIObjectIsOfClass ((HIObjectRef) hitview, juceHiViewClassNameCFString); - } - } - } - - if (! stillOver) - { - // mouse is outside our windows so set a normal cursor (only - // if we're running as an app, not a plugin) - if (JUCEApplication::getInstance() != 0) - SetThemeCursor (kThemeArrowCursor); - - if (validWindow) - lastPeerUnderMouse->handleMouseExit (mx - x, my - y, Time::currentTimeMillis()); - - if (hasEverHadAMouseMove) - stopTimer(); - } - - if ((! hasEverHadAMouseMove) && validWindow - && (mx != lastX || my != lastY)) - { - lastX = mx; - lastY = my; - - if (stillOver) - lastPeerUnderMouse->handleMouseMove (mx - x, my - y, Time::currentTimeMillis()); - } - } -} - -//============================================================================== -// called from juce_Messaging.cpp -void juce_HandleProcessFocusChange() -{ - keysCurrentlyDown.clear(); - - if (HIViewComponentPeer::isValidPeer (currentlyFocusedPeer)) - { - if (Process::isForegroundProcess()) - currentlyFocusedPeer->handleFocusGain(); - else - currentlyFocusedPeer->handleFocusLoss(); - } -} - -static bool performDrag (DragRef drag) -{ - EventRecord event; - event.what = mouseDown; - event.message = 0; - event.when = TickCount(); - - int x, y; - Desktop::getMousePosition (x, y); - event.where.h = x; - event.where.v = y; - - event.modifiers = GetCurrentKeyModifiers(); - - RgnHandle rgn = NewRgn(); - RgnHandle rgn2 = NewRgn(); - SetRectRgn (rgn, - event.where.h - 8, event.where.v - 8, - event.where.h + 8, event.where.v + 8); - CopyRgn (rgn, rgn2); - InsetRgn (rgn2, 1, 1); - DiffRgn (rgn, rgn2, rgn); - DisposeRgn (rgn2); - - bool result = TrackDrag (drag, &event, rgn) == noErr; - - DisposeRgn (rgn); - return result; -} - -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) -{ - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - ComponentPeer::getPeer (i)->performAnyPendingRepaintsNow(); - - DragRef drag; - bool result = false; - - if (NewDrag (&drag) == noErr) - { - for (int i = 0; i < files.size(); ++i) - { - HFSFlavor hfsData; - - if (PlatformUtilities::makeFSSpecFromPath (&hfsData.fileSpec, files[i])) - { - FInfo info; - if (FSpGetFInfo (&hfsData.fileSpec, &info) == noErr) - { - hfsData.fileType = info.fdType; - hfsData.fileCreator = info.fdCreator; - hfsData.fdFlags = info.fdFlags; - - AddDragItemFlavor (drag, i + 1, kDragFlavorTypeHFS, &hfsData, sizeof (hfsData), 0); - result = true; - } - } - } - - SetDragAllowableActions (drag, canMoveFiles ? kDragActionAll - : kDragActionCopy, false); - - if (result) - result = performDrag (drag); - - DisposeDrag (drag); - } - - return result; -} - -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) -{ - jassertfalse // not implemented! - return false; -} - - -//============================================================================== -bool Process::isForegroundProcess() throw() -{ - ProcessSerialNumber psn, front; - GetCurrentProcess (&psn); - GetFrontProcess (&front); - - Boolean b; - return (SameProcess (&psn, &front, &b) == noErr) && b; -} - -//============================================================================== -bool Desktop::canUseSemiTransparentWindows() throw() -{ - return true; -} - - -//============================================================================== -void Desktop::getMousePosition (int& x, int& y) throw() -{ - CGrafPtr currentPort; - GetPort (¤tPort); - - if (! IsValidPort (currentPort)) - { - WindowRef front = FrontWindow(); - - if (front != 0) - { - SetPortWindowPort (front); - } - else - { - x = y = 0; - return; - } - } - - ::Point p; - GetMouse (&p); - LocalToGlobal (&p); - x = p.h; - y = p.v; - - SetPort (currentPort); -} - -void Desktop::setMousePosition (int x, int y) throw() -{ - // this rubbish needs to be done around the warp call, to avoid causing a - // bizarre glitch.. - CGAssociateMouseAndMouseCursorPosition (false); - CGSetLocalEventsSuppressionInterval (0); - - CGPoint pos = { x, y }; - CGWarpMouseCursorPosition (pos); - - CGAssociateMouseAndMouseCursorPosition (true); -} - -const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() -{ - return ModifierKeys (currentModifiers); -} - -//============================================================================== -class ScreenSaverDefeater : public Timer, - public DeletedAtShutdown -{ -public: - ScreenSaverDefeater() throw() - { - startTimer (10000); - timerCallback(); - } - - ~ScreenSaverDefeater() - { - } - - void timerCallback() - { - if (Process::isForegroundProcess()) - UpdateSystemActivity (UsrActivity); - } -}; - -static ScreenSaverDefeater* screenSaverDefeater = 0; - -void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() -{ - if (screenSaverDefeater == 0) - screenSaverDefeater = new ScreenSaverDefeater(); -} - -bool Desktop::isScreenSaverEnabled() throw() -{ - return screenSaverDefeater == 0; -} - -//============================================================================== -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() -{ - int mainMonitorIndex = 0; - CGDirectDisplayID mainDisplayID = CGMainDisplayID(); - - CGDisplayCount count = 0; - CGDirectDisplayID disps [8]; - - if (CGGetOnlineDisplayList (numElementsInArray (disps), disps, &count) == noErr) - { - for (int i = 0; i < count; ++i) - { - if (mainDisplayID == disps[i]) - mainMonitorIndex = monitorCoords.size(); - - GDHandle hGDevice; - - if (clipToWorkArea - && DMGetGDeviceByDisplayID ((DisplayIDType) disps[i], &hGDevice, false) == noErr) - { - Rect rect; - GetAvailableWindowPositioningBounds (hGDevice, &rect); - - monitorCoords.add (Rectangle (rect.left, - rect.top, - rect.right - rect.left, - rect.bottom - rect.top)); - } - else - { - const CGRect r (CGDisplayBounds (disps[i])); - - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) r.origin.y, - (int) r.size.width, - (int) r.size.height)); - } - } - } - - // make sure the first in the list is the main monitor - if (mainMonitorIndex > 0) - monitorCoords.swap (mainMonitorIndex, 0); - - jassert (monitorCoords.size() > 0); - - if (monitorCoords.size() == 0) - monitorCoords.add (Rectangle (0, 0, 1024, 768)); -} - -//============================================================================== -static NSImage* juceImageToNSImage (const Image& image) -{ - int lineStride, pixelStride; - const uint8* pixels = image.lockPixelDataReadOnly (0, 0, image.getWidth(), image.getHeight(), - lineStride, pixelStride); - - NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes: NULL - pixelsWide: image.getWidth() - pixelsHigh: image.getHeight() - bitsPerSample: 8 - samplesPerPixel: image.hasAlphaChannel() ? 4 : 3 - hasAlpha: image.hasAlphaChannel() - isPlanar: NO - colorSpaceName: NSCalibratedRGBColorSpace - bitmapFormat: (NSBitmapFormat) 0 - bytesPerRow: lineStride - bitsPerPixel: pixelStride * 8]; - - unsigned char* newData = [rep bitmapData]; - memcpy (newData, pixels, lineStride * image.getHeight()); - image.releasePixelDataReadOnly (pixels); - - NSImage* im = [[NSImage alloc] init]; - [im addRepresentation: rep]; - [rep release]; - - return im; -} - -void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() -{ - NSImage* im = juceImageToNSImage (image); - [im autorelease]; - - NSPoint hs; - hs.x = (int) hotspotX; - hs.y = (int) hotspotY; - - NSCursor* c = [[NSCursor alloc] initWithImage: im hotSpot: hs]; - return (void*) c; -} - -static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() -{ - Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); - jassert (im != 0); - - if (im == 0) - return 0; - - void* const curs = juce_createMouseCursorFromImage (*im, - (int) (hx * im->getWidth()), - (int) (hy * im->getHeight())); - delete im; - return curs; -} - -static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) -{ - File f ("/System/Library/Frameworks/WebKit.framework/Frameworks/WebCore.framework/Resources"); - - MemoryBlock mb; - if (f.getChildFile (filename).loadFileAsData (mb)) - return juce_cursorFromData ((const unsigned char*) mb.getData(), mb.getSize(), hx, hy); - - return 0; -} - -void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() -{ - NSCursor* c = 0; - - switch (type) - { - case MouseCursor::NormalCursor: - c = [NSCursor arrowCursor]; - break; - - case MouseCursor::NoCursor: - { - Image blank (Image::ARGB, 8, 8, true); - return juce_createMouseCursorFromImage (blank, 0, 0); - } - - case MouseCursor::DraggingHandCursor: - c = [NSCursor openHandCursor]; - break; - - case MouseCursor::CopyingCursor: - return juce_cursorFromWebKitFile ("copyCursor.png", 0, 0); - - case MouseCursor::WaitCursor: - c = [NSCursor arrowCursor]; // avoid this on the mac, let the OS provide the beachball - break; - //return juce_cursorFromWebKitFile ("waitCursor.png", 0.5f, 0.5f); - - case MouseCursor::IBeamCursor: - c = [NSCursor IBeamCursor]; - break; - - case MouseCursor::PointingHandCursor: - c = [NSCursor pointingHandCursor]; - break; - - case MouseCursor::LeftRightResizeCursor: - c = [NSCursor resizeLeftRightCursor]; - break; - - case MouseCursor::LeftEdgeResizeCursor: - c = [NSCursor resizeLeftCursor]; - break; - - case MouseCursor::RightEdgeResizeCursor: - c = [NSCursor resizeRightCursor]; - break; - - case MouseCursor::UpDownResizeCursor: - case MouseCursor::TopEdgeResizeCursor: - case MouseCursor::BottomEdgeResizeCursor: - return juce_cursorFromWebKitFile ("northSouthResizeCursor.png", 0.5f, 0.5f); - - case MouseCursor::TopLeftCornerResizeCursor: - case MouseCursor::BottomRightCornerResizeCursor: - return juce_cursorFromWebKitFile ("northWestSouthEastResizeCursor.png", 0.5f, 0.5f); - - case MouseCursor::TopRightCornerResizeCursor: - case MouseCursor::BottomLeftCornerResizeCursor: - return juce_cursorFromWebKitFile ("northEastSouthWestResizeCursor.png", 0.5f, 0.5f); - - case MouseCursor::UpDownLeftRightResizeCursor: - return juce_cursorFromWebKitFile ("moveCursor.png", 0.5f, 0.5f); - - case MouseCursor::CrosshairCursor: - c = [NSCursor crosshairCursor]; - break; - } - - [c retain]; - return (void*) c; -} - -void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() -{ - NSCursor* c = (NSCursor*) cursorHandle; - [c release]; -} - -void MouseCursor::showInAllWindows() const throw() -{ - showInWindow (0); -} - -void MouseCursor::showInWindow (ComponentPeer*) const throw() -{ - NSCursor* const c = (NSCursor*) getHandle(); - - if (c != 0) - [c set]; -} - - -//============================================================================== -Image* juce_createIconForFile (const File& file) -{ - return 0; -} - - -//============================================================================== -class MainMenuHandler; -static MainMenuHandler* mainMenu = 0; - -class MainMenuHandler : private MenuBarModelListener, - private DeletedAtShutdown -{ -public: - MainMenuHandler() throw() - : currentModel (0) - { - } - - ~MainMenuHandler() throw() - { - setMenu (0); - - jassert (mainMenu == this); - mainMenu = 0; - } - - void setMenu (MenuBarModel* const newMenuBarModel) throw() - { - if (currentModel != newMenuBarModel) - { - if (currentModel != 0) - currentModel->removeListener (this); - - currentModel = newMenuBarModel; - - if (currentModel != 0) - currentModel->addListener (this); - - menuBarItemsChanged (0); - } - } - - void menuBarItemsChanged (MenuBarModel*) - { - ClearMenuBar(); - - if (currentModel != 0) - { - int menuId = 1000; - const StringArray menuNames (currentModel->getMenuBarNames()); - - for (int i = 0; i < menuNames.size(); ++i) - { - const PopupMenu menu (currentModel->getMenuForIndex (i, menuNames [i])); - - MenuRef m = createMenu (menu, menuNames [i], menuId, i); - - InsertMenu (m, 0); - CFRelease (m); - } - } - } - - void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) - { - MenuRef menu = 0; - MenuItemIndex index = 0; - GetIndMenuItemWithCommandID (0, info.commandID, 1, &menu, &index); - - if (menu != 0) - { - FlashMenuBar (GetMenuID (menu)); - FlashMenuBar (GetMenuID (menu)); - } - } - - void invoke (const int commandId, ApplicationCommandManager* const commandManager, const int topLevelIndex) const - { - if (currentModel != 0) - { - if (commandManager != 0) - { - ApplicationCommandTarget::InvocationInfo info (commandId); - info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu; - - commandManager->invoke (info, true); - } - - currentModel->menuItemSelected (commandId, topLevelIndex); - } - } - - MenuBarModel* currentModel; - -private: - static MenuRef createMenu (const PopupMenu menu, - const String& menuName, - int& id, - const int topLevelIndex) - { - MenuRef m = 0; - - if (CreateNewMenu (id++, kMenuAttrAutoDisable, &m) == noErr) - { - CFStringRef name = PlatformUtilities::juceStringToCFString (menuName); - SetMenuTitleWithCFString (m, name); - CFRelease (name); - - PopupMenu::MenuItemIterator iter (menu); - - while (iter.next()) - { - MenuItemIndex index = 0; - - int flags = kMenuAttrAutoDisable | kMenuItemAttrIgnoreMeta | kMenuItemAttrNotPreviousAlternate; - if (! iter.isEnabled) - flags |= kMenuItemAttrDisabled; - - CFStringRef text = PlatformUtilities::juceStringToCFString (iter.itemName.upToFirstOccurrenceOf (T(""), false, true)); - - if (iter.isSeparator) - { - AppendMenuItemTextWithCFString (m, text, kMenuItemAttrSeparator, 0, &index); - } - else if (iter.isSectionHeader) - { - AppendMenuItemTextWithCFString (m, text, kMenuItemAttrSectionHeader, 0, &index); - } - else if (iter.subMenu != 0) - { - AppendMenuItemTextWithCFString (m, text, flags, id++, &index); - - MenuRef sub = createMenu (*iter.subMenu, iter.itemName, id, topLevelIndex); - SetMenuItemHierarchicalMenu (m, index, sub); - CFRelease (sub); - } - else - { - AppendMenuItemTextWithCFString (m, text, flags, iter.itemId, &index); - - if (iter.isTicked) - CheckMenuItem (m, index, true); - - SetMenuItemProperty (m, index, 'juce', 'apcm', sizeof (void*), &iter.commandManager); - SetMenuItemProperty (m, index, 'juce', 'topi', sizeof (int), &topLevelIndex); - - if (iter.commandManager != 0) - { - const Array keyPresses (iter.commandManager->getKeyMappings() - ->getKeyPressesAssignedToCommand (iter.itemId)); - - if (keyPresses.size() > 0) - { - const KeyPress& kp = keyPresses.getReference(0); - int mods = 0; - - if (kp.getModifiers().isShiftDown()) - mods |= kMenuShiftModifier; - if (kp.getModifiers().isCtrlDown()) - mods |= kMenuControlModifier; - if (kp.getModifiers().isAltDown()) - mods |= kMenuOptionModifier; - if (! kp.getModifiers().isCommandDown()) - mods |= kMenuNoCommandModifier; - - tchar keyCode = (tchar) kp.getKeyCode(); - - if (kp.getKeyCode() >= KeyPress::numberPad0 - && kp.getKeyCode() <= KeyPress::numberPad9) - { - keyCode = (tchar) ((T('0') - KeyPress::numberPad0) + kp.getKeyCode()); - } - - SetMenuItemCommandKey (m, index, true, 255); - - if (CharacterFunctions::isLetterOrDigit (keyCode) - || CharacterFunctions::indexOfChar (T(",.;/\\'[]=-+_<>?{}\":"), keyCode, false) >= 0) - { - SetMenuItemModifiers (m, index, mods); - SetMenuItemCommandKey (m, index, false, CharacterFunctions::toUpperCase (keyCode)); - } - else - { - const SInt16 glyph = getGlyphForKeyCode (kp.getKeyCode()); - - if (glyph != 0) - { - SetMenuItemModifiers (m, index, mods); - SetMenuItemKeyGlyph (m, index, glyph); - } - } - - // if we set the key glyph to be a text char, and enable virtual - // key triggering, it stops the menu automatically triggering the callback - ChangeMenuItemAttributes (m, index, kMenuItemAttrUseVirtualKey, 0); - } - } - } - - CFRelease (text); - } - } - - return m; - } - - static SInt16 getGlyphForKeyCode (const int keyCode) throw() - { - if (keyCode == KeyPress::spaceKey) - return kMenuSpaceGlyph; - else if (keyCode == KeyPress::returnKey) - return kMenuReturnGlyph; - else if (keyCode == KeyPress::escapeKey) - return kMenuEscapeGlyph; - else if (keyCode == KeyPress::backspaceKey) - return kMenuDeleteLeftGlyph; - else if (keyCode == KeyPress::leftKey) - return kMenuLeftArrowGlyph; - else if (keyCode == KeyPress::rightKey) - return kMenuRightArrowGlyph; - else if (keyCode == KeyPress::upKey) - return kMenuUpArrowGlyph; - else if (keyCode == KeyPress::downKey) - return kMenuDownArrowGlyph; - else if (keyCode == KeyPress::pageUpKey) - return kMenuPageUpGlyph; - else if (keyCode == KeyPress::pageDownKey) - return kMenuPageDownGlyph; - else if (keyCode == KeyPress::endKey) - return kMenuSoutheastArrowGlyph; - else if (keyCode == KeyPress::homeKey) - return kMenuNorthwestArrowGlyph; - else if (keyCode == KeyPress::deleteKey) - return kMenuDeleteRightGlyph; - else if (keyCode == KeyPress::tabKey) - return kMenuTabRightGlyph; - else if (keyCode == KeyPress::F1Key) - return kMenuF1Glyph; - else if (keyCode == KeyPress::F2Key) - return kMenuF2Glyph; - else if (keyCode == KeyPress::F3Key) - return kMenuF3Glyph; - else if (keyCode == KeyPress::F4Key) - return kMenuF4Glyph; - else if (keyCode == KeyPress::F5Key) - return kMenuF5Glyph; - else if (keyCode == KeyPress::F6Key) - return kMenuF6Glyph; - else if (keyCode == KeyPress::F7Key) - return kMenuF7Glyph; - else if (keyCode == KeyPress::F8Key) - return kMenuF8Glyph; - else if (keyCode == KeyPress::F9Key) - return kMenuF9Glyph; - else if (keyCode == KeyPress::F10Key) - return kMenuF10Glyph; - else if (keyCode == KeyPress::F11Key) - return kMenuF11Glyph; - else if (keyCode == KeyPress::F12Key) - return kMenuF12Glyph; - else if (keyCode == KeyPress::F13Key) - return kMenuF13Glyph; - else if (keyCode == KeyPress::F14Key) - return kMenuF14Glyph; - else if (keyCode == KeyPress::F15Key) - return kMenuF15Glyph; - - return 0; - } -}; - -void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel) throw() -{ - if (getMacMainMenu() != newMenuBarModel) - { - if (newMenuBarModel == 0) - { - delete mainMenu; - jassert (mainMenu == 0); // should be zeroed in the destructor - } - else - { - if (mainMenu == 0) - mainMenu = new MainMenuHandler(); - - mainMenu->setMenu (newMenuBarModel); - } - } -} - -MenuBarModel* MenuBarModel::getMacMainMenu() throw() -{ - return mainMenu != 0 ? mainMenu->currentModel : 0; -} - -// these functions are called externally from the message handling code -void juce_MainMenuAboutToBeUsed() -{ - // force an update of the items just before the menu appears.. - if (mainMenu != 0) - mainMenu->menuBarItemsChanged (0); -} - -void juce_InvokeMainMenuCommand (const HICommand& command) -{ - if (mainMenu != 0) - { - ApplicationCommandManager* commandManager = 0; - int topLevelIndex = 0; - - if (GetMenuItemProperty (command.menu.menuRef, command.menu.menuItemIndex, - 'juce', 'apcm', sizeof (commandManager), 0, &commandManager) == noErr - && GetMenuItemProperty (command.menu.menuRef, command.menu.menuItemIndex, - 'juce', 'topi', sizeof (topLevelIndex), 0, &topLevelIndex) == noErr) - { - mainMenu->invoke (command.commandID, commandManager, topLevelIndex); - } - } -} - -//============================================================================== -void PlatformUtilities::beep() -{ - SysBeep (30); -} - -//============================================================================== -void SystemClipboard::copyTextToClipboard (const String& text) throw() -{ - ClearCurrentScrap(); - ScrapRef ref; - GetCurrentScrap (&ref); - - const int len = text.length(); - const int numBytes = sizeof (UniChar) * len; - UniChar* const temp = (UniChar*) juce_calloc (numBytes); - - for (int i = 0; i < len; ++i) - temp[i] = (UniChar) text[i]; - - PutScrapFlavor (ref, - kScrapFlavorTypeUnicode, - kScrapFlavorMaskNone, - numBytes, - temp); - - juce_free (temp); -} - -const String SystemClipboard::getTextFromClipboard() throw() -{ - String result; - - ScrapRef ref; - GetCurrentScrap (&ref); - Size size = 0; - - if (GetScrapFlavorSize (ref, kScrapFlavorTypeUnicode, &size) == noErr - && size > 0) - { - void* const data = juce_calloc (size + 8); - - if (GetScrapFlavorData (ref, kScrapFlavorTypeUnicode, &size, data) == noErr) - { - result = PlatformUtilities::convertUTF16ToString ((UniChar*) data); - } - - juce_free (data); - } - - return result; -} - - -//============================================================================== -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) -{ - Str255 tit, txt; - PlatformUtilities::copyToStr255 (tit, title); - PlatformUtilities::copyToStr255 (txt, bodyText); - - AlertStdAlertParamRec ar; - ar.movable = true; - ar.helpButton = false; - ar.filterProc = 0; - ar.defaultText = (const unsigned char*)-1; - ar.cancelText = (const unsigned char*)((isOkCancel) ? -1 : 0); - ar.otherText = 0; - ar.defaultButton = kAlertStdAlertOKButton; - ar.cancelButton = 0; - ar.position = kWindowDefaultPosition; - - SInt16 result; - StandardAlert (kAlertNoteAlert, tit, txt, &ar, &result); - return result == kAlertStdAlertOKButton; -} - -//============================================================================== -const int KeyPress::spaceKey = ' '; -const int KeyPress::returnKey = kReturnCharCode; -const int KeyPress::escapeKey = kEscapeCharCode; -const int KeyPress::backspaceKey = kBackspaceCharCode; -const int KeyPress::leftKey = kLeftArrowCharCode; -const int KeyPress::rightKey = kRightArrowCharCode; -const int KeyPress::upKey = kUpArrowCharCode; -const int KeyPress::downKey = kDownArrowCharCode; -const int KeyPress::pageUpKey = kPageUpCharCode; -const int KeyPress::pageDownKey = kPageDownCharCode; -const int KeyPress::endKey = kEndCharCode; -const int KeyPress::homeKey = kHomeCharCode; -const int KeyPress::deleteKey = kDeleteCharCode; -const int KeyPress::insertKey = -1; -const int KeyPress::tabKey = kTabCharCode; -const int KeyPress::F1Key = 0x10110; -const int KeyPress::F2Key = 0x10111; -const int KeyPress::F3Key = 0x10112; -const int KeyPress::F4Key = 0x10113; -const int KeyPress::F5Key = 0x10114; -const int KeyPress::F6Key = 0x10115; -const int KeyPress::F7Key = 0x10116; -const int KeyPress::F8Key = 0x10117; -const int KeyPress::F9Key = 0x10118; -const int KeyPress::F10Key = 0x10119; -const int KeyPress::F11Key = 0x1011a; -const int KeyPress::F12Key = 0x1011b; -const int KeyPress::F13Key = 0x1011c; -const int KeyPress::F14Key = 0x1011d; -const int KeyPress::F15Key = 0x1011e; -const int KeyPress::F16Key = 0x1011f; -const int KeyPress::numberPad0 = 0x30020; -const int KeyPress::numberPad1 = 0x30021; -const int KeyPress::numberPad2 = 0x30022; -const int KeyPress::numberPad3 = 0x30023; -const int KeyPress::numberPad4 = 0x30024; -const int KeyPress::numberPad5 = 0x30025; -const int KeyPress::numberPad6 = 0x30026; -const int KeyPress::numberPad7 = 0x30027; -const int KeyPress::numberPad8 = 0x30028; -const int KeyPress::numberPad9 = 0x30029; -const int KeyPress::numberPadAdd = 0x3002a; -const int KeyPress::numberPadSubtract = 0x3002b; -const int KeyPress::numberPadMultiply = 0x3002c; -const int KeyPress::numberPadDivide = 0x3002d; -const int KeyPress::numberPadSeparator = 0x3002e; -const int KeyPress::numberPadDecimalPoint = 0x3002f; -const int KeyPress::numberPadEquals = 0x30030; -const int KeyPress::numberPadDelete = 0x30031; -const int KeyPress::playKey = 0x30000; -const int KeyPress::stopKey = 0x30001; -const int KeyPress::fastForwardKey = 0x30002; -const int KeyPress::rewindKey = 0x30003; - - -//============================================================================== -AppleRemoteDevice::AppleRemoteDevice() - : device (0), - queue (0), - remoteId (0) -{ -} - -AppleRemoteDevice::~AppleRemoteDevice() -{ - stop(); -} - -static io_object_t getAppleRemoteDevice() throw() -{ - CFMutableDictionaryRef dict = IOServiceMatching ("AppleIRController"); - - io_iterator_t iter = 0; - io_object_t iod = 0; - - if (IOServiceGetMatchingServices (kIOMasterPortDefault, dict, &iter) == kIOReturnSuccess - && iter != 0) - { - iod = IOIteratorNext (iter); - } - - IOObjectRelease (iter); - return iod; -} - -static bool createAppleRemoteInterface (io_object_t iod, void** device) throw() -{ - jassert (*device == 0); - io_name_t classname; - - if (IOObjectGetClass (iod, classname) == kIOReturnSuccess) - { - IOCFPlugInInterface** cfPlugInInterface = 0; - SInt32 score = 0; - - if (IOCreatePlugInInterfaceForService (iod, - kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, - &cfPlugInInterface, - &score) == kIOReturnSuccess) - { - HRESULT hr = (*cfPlugInInterface)->QueryInterface (cfPlugInInterface, - CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), - device); - - (void) hr; - - (*cfPlugInInterface)->Release (cfPlugInInterface); - } - } - - return *device != 0; -} - -bool AppleRemoteDevice::start (const bool inExclusiveMode) throw() -{ - if (queue != 0) - return true; - - stop(); - - bool result = false; - io_object_t iod = getAppleRemoteDevice(); - - if (iod != 0) - { - if (createAppleRemoteInterface (iod, &device) && open (inExclusiveMode)) - result = true; - else - stop(); - - IOObjectRelease (iod); - } - - return result; -} - -void AppleRemoteDevice::stop() throw() -{ - if (queue != 0) - { - (*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue); - (*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue); - (*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue); - queue = 0; - } - - if (device != 0) - { - (*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device); - (*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device); - device = 0; - } -} - -bool AppleRemoteDevice::isActive() const throw() -{ - return queue != 0; -} - -static void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*) -{ - if (result == kIOReturnSuccess) - ((AppleRemoteDevice*) target)->handleCallbackInternal(); -} - -bool AppleRemoteDevice::open (const bool openInExclusiveMode) throw() -{ -#if ! MACOS_10_2_OR_EARLIER - Array cookies; - - CFArrayRef elements; - IOHIDDeviceInterface122** const device122 = (IOHIDDeviceInterface122**) device; - - if ((*device122)->copyMatchingElements (device122, 0, &elements) != kIOReturnSuccess) - return false; - - for (int i = 0; i < CFArrayGetCount (elements); ++i) - { - CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); - - // get the cookie - CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); - - if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID()) - continue; - - long number; - if (! CFNumberGetValue ((CFNumberRef) object, kCFNumberLongType, &number)) - continue; - - cookies.add ((int) number); - } - - CFRelease (elements); - - if ((*(IOHIDDeviceInterface**) device) - ->open ((IOHIDDeviceInterface**) device, - openInExclusiveMode ? kIOHIDOptionsTypeSeizeDevice - : kIOHIDOptionsTypeNone) == KERN_SUCCESS) - { - queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); - - if (queue != 0) - { - (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); - - for (int i = 0; i < cookies.size(); ++i) - { - IOHIDElementCookie cookie = (IOHIDElementCookie) cookies.getUnchecked(i); - (*(IOHIDQueueInterface**) queue)->addElement ((IOHIDQueueInterface**) queue, cookie, 0); - } - - CFRunLoopSourceRef eventSource; - - if ((*(IOHIDQueueInterface**) queue) - ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) - { - if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, - appleRemoteQueueCallback, this, 0) == KERN_SUCCESS) - { - CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); - - (*(IOHIDQueueInterface**) queue)->start ((IOHIDQueueInterface**) queue); - - return true; - } - } - } - } -#endif - - return false; -} - -void AppleRemoteDevice::handleCallbackInternal() -{ - int totalValues = 0; - AbsoluteTime nullTime = { 0, 0 }; - char cookies [12]; - int numCookies = 0; - - while (numCookies < numElementsInArray (cookies)) - { - IOHIDEventStruct e; - - if ((*(IOHIDQueueInterface**) queue)->getNextEvent ((IOHIDQueueInterface**) queue, &e, nullTime, 0) != kIOReturnSuccess) - break; - - if ((int) e.elementCookie == 19) - { - remoteId = e.value; - buttonPressed (switched, false); - } - else - { - totalValues += e.value; - cookies [numCookies++] = (char) (pointer_sized_int) e.elementCookie; - } - } - - cookies [numCookies++] = 0; - - static const char buttonPatterns[] = - { - 14, 7, 6, 5, 14, 7, 6, 5, 0, - 14, 8, 6, 5, 14, 8, 6, 5, 0, - 14, 12, 11, 6, 5, 0, - 14, 13, 11, 6, 5, 0, - 14, 9, 6, 5, 14, 9, 6, 5, 0, - 14, 10, 6, 5, 14, 10, 6, 5, 0, - 14, 6, 5, 4, 2, 0, - 14, 6, 5, 3, 2, 0, - 14, 6, 5, 14, 6, 5, 0, - 18, 14, 6, 5, 18, 14, 6, 5, 0, - 19, 0 - }; - - int buttonNum = (int) menuButton; - int i = 0; - - while (i < numElementsInArray (buttonPatterns)) - { - if (strcmp (cookies, buttonPatterns + i) == 0) - { - buttonPressed ((ButtonType) buttonNum, totalValues > 0); - break; - } - - i += strlen (buttonPatterns + i) + 1; - ++buttonNum; - } -} - - -//============================================================================== -#if JUCE_OPENGL - -//============================================================================== -class WindowedGLContext : public OpenGLContext -{ -public: - WindowedGLContext (Component* const component, - const OpenGLPixelFormat& pixelFormat_, - AGLContext sharedContext) - : renderContext (0), - pixelFormat (pixelFormat_) - { - jassert (component != 0); - - HIViewComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); - if (peer == 0) - return; - - GLint attribs [64]; - int n = 0; - attribs[n++] = AGL_RGBA; - attribs[n++] = AGL_DOUBLEBUFFER; - attribs[n++] = AGL_ACCELERATED; - attribs[n++] = AGL_RED_SIZE; - attribs[n++] = pixelFormat.redBits; - attribs[n++] = AGL_GREEN_SIZE; - attribs[n++] = pixelFormat.greenBits; - attribs[n++] = AGL_BLUE_SIZE; - attribs[n++] = pixelFormat.blueBits; - attribs[n++] = AGL_ALPHA_SIZE; - attribs[n++] = pixelFormat.alphaBits; - attribs[n++] = AGL_DEPTH_SIZE; - attribs[n++] = pixelFormat.depthBufferBits; - attribs[n++] = AGL_STENCIL_SIZE; - attribs[n++] = pixelFormat.stencilBufferBits; - attribs[n++] = AGL_ACCUM_RED_SIZE; - attribs[n++] = pixelFormat.accumulationBufferRedBits; - attribs[n++] = AGL_ACCUM_GREEN_SIZE; - attribs[n++] = pixelFormat.accumulationBufferGreenBits; - attribs[n++] = AGL_ACCUM_BLUE_SIZE; - attribs[n++] = pixelFormat.accumulationBufferBlueBits; - attribs[n++] = AGL_ACCUM_ALPHA_SIZE; - attribs[n++] = pixelFormat.accumulationBufferAlphaBits; - - // xxx not sure how to do fullSceneAntiAliasingNumSamples.. - - attribs[n++] = AGL_SAMPLE_BUFFERS_ARB; - attribs[n++] = 1; - attribs[n++] = AGL_SAMPLES_ARB; - attribs[n++] = 4; - attribs[n++] = AGL_CLOSEST_POLICY; - attribs[n++] = AGL_NO_RECOVERY; - attribs[n++] = AGL_NONE; - - renderContext = aglCreateContext (aglChoosePixelFormat (0, 0, attribs), - sharedContext); - - aglSetDrawable (renderContext, GetWindowPort (peer->windowRef)); - } - - ~WindowedGLContext() - { - makeInactive(); - aglSetDrawable (renderContext, 0); - aglDestroyContext (renderContext); - } - - bool makeActive() const throw() - { - jassert (renderContext != 0); - - return aglSetCurrentContext (renderContext); - } - - bool makeInactive() const throw() - { - return (! isActive()) || aglSetCurrentContext (0); - } - - bool isActive() const throw() - { - return aglGetCurrentContext() == renderContext; - } - - const OpenGLPixelFormat getPixelFormat() const - { - return pixelFormat; - } - - void* getRawContext() const throw() - { - return renderContext; - } - - void updateWindowPosition (int x, int y, int w, int h, int outerWindowHeight) - { - GLint bufferRect[4]; - bufferRect[0] = x; - bufferRect[1] = outerWindowHeight - (y + h); - bufferRect[2] = w; - bufferRect[3] = h; - - aglSetInteger (renderContext, AGL_BUFFER_RECT, bufferRect); - aglEnable (renderContext, AGL_BUFFER_RECT); - } - - void swapBuffers() - { - aglSwapBuffers (renderContext); - } - - bool setSwapInterval (const int numFramesPerSwap) - { - return aglSetInteger (renderContext, AGL_SWAP_INTERVAL, (const GLint*) &numFramesPerSwap); - } - - int getSwapInterval() const - { - GLint numFrames = 0; - aglGetInteger (renderContext, AGL_SWAP_INTERVAL, &numFrames); - return numFrames; - } - - void repaint() - { - } - - //============================================================================== - juce_UseDebuggingNewOperator - - AGLContext renderContext; - -private: - OpenGLPixelFormat pixelFormat; - - //============================================================================== - WindowedGLContext (const WindowedGLContext&); - const WindowedGLContext& operator= (const WindowedGLContext&); -}; - -//============================================================================== -OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, - const OpenGLPixelFormat& pixelFormat, - const OpenGLContext* const contextToShareWith) -{ - WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, - contextToShareWith != 0 ? (AGLContext) contextToShareWith->getRawContext() : 0); - - if (c->renderContext == 0) - deleteAndZero (c); - - return c; -} - -void juce_glViewport (const int w, const int h) -{ - glViewport (0, 0, w, h); -} - -static int getAGLAttribute (AGLPixelFormat p, const GLint attrib) -{ - GLint result = 0; - aglDescribePixelFormat (p, attrib, &result); - return result; -} - -void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, - OwnedArray & results) -{ - GLint attribs [64]; - int n = 0; - attribs[n++] = AGL_RGBA; - attribs[n++] = AGL_DOUBLEBUFFER; - attribs[n++] = AGL_ACCELERATED; - attribs[n++] = AGL_NO_RECOVERY; - attribs[n++] = AGL_NONE; - - AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); - - while (p != 0) - { - OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); - pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); - pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); - pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); - pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); - pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); - pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); - pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); - pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); - pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); - pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); - - results.add (pf); - - p = aglNextPixelFormat (p); - } -} - - -#endif - -END_JUCE_NAMESPACE diff --git a/build/win32/platform_specific_code/juce_win32_ASIO.cpp b/build/win32/platform_specific_code/juce_win32_ASIO.cpp index 81043ec29d..eee14d1fac 100644 --- a/build/win32/platform_specific_code/juce_win32_ASIO.cpp +++ b/build/win32/platform_specific_code/juce_win32_ASIO.cpp @@ -29,55 +29,11 @@ ============================================================================== */ -#include "win32_headers.h" -#undef WINDOWS - -#if JUCE_ASIO - -//============================================================================== -/* - This is very frustrating - we only need to use a handful of definitions from - a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy - about 30 lines of code into this cpp file to create a fully stand-alone ASIO - implementation... - - ..unfortunately that would break Steinberg's license agreement for use of - their SDK, so I'm not allowed to do this. - - This means that anyone who wants to use JUCE's ASIO abilities will have to: - - 1) Agree to Steinberg's licensing terms and download the ASIO SDK - (see www.steinberg.net/Steinberg/Developers.asp). - - 2) Rebuild the whole of JUCE, setting the global definition JUCE_ASIO (you - can un-comment the "#define JUCE_ASIO" line in juce_Config.h - if you prefer). Make sure that your header search path will find the - iasiodrv.h file that comes with the SDK. (Only about 2-3 of the SDK header - files are actually needed - so to simplify things, you could just copy - these into your JUCE directory). -*/ -#include "iasiodrv.h" // if you're compiling and this line causes an error because - // you don't have the ASIO SDK installed, you can disable ASIO - // support by commenting-out the "#define JUCE_ASIO" line in - // juce_Config.h - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/devices/juce_AudioIODeviceType.h" -#include "../../../src/juce_appframework/audio/devices/juce_AudioDeviceManager.h" -#include "../../../src/juce_appframework/gui/components/buttons/juce_TextButton.h" -#include "../../../src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h" -#include "../../../src/juce_core/threads/juce_ScopedLock.h" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" -#include "../../../src/juce_appframework/gui/components/controls/juce_ListBox.h" -#include "../../../src/juce_core/text/juce_LocalisedStrings.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_ASIO +#undef WINDOWS //============================================================================== // #define ASIO_DEBUGGING @@ -1806,7 +1762,7 @@ public: #if JUCE_DEBUG if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase (T("digidesign"))) - return 1; // (the digi m-box driver crashes the app when you run + return 1; // (the digi m-box driver crashes the app when you run // it in the debugger, which can be a bit annoying) #endif @@ -1974,7 +1930,7 @@ AudioIODeviceType* juce_createASIOAudioIODeviceType() return new ASIOAudioIODeviceType(); } -AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, +AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, void* guid) { const int freeSlot = ASIOAudioIODeviceType::findFreeSlot(); @@ -1985,9 +1941,6 @@ AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, return new ASIOAudioIODevice (name, *(CLSID*) guid, freeSlot); } - -END_JUCE_NAMESPACE - #undef log #endif diff --git a/build/win32/platform_specific_code/juce_win32_ActiveXComponent.cpp b/build/win32/platform_specific_code/juce_win32_ActiveXComponent.cpp new file mode 100644 index 0000000000..51e757da1b --- /dev/null +++ b/build/win32/platform_specific_code/juce_win32_ActiveXComponent.cpp @@ -0,0 +1,552 @@ +/* + ============================================================================== + + 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 gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + + +//============================================================================== +class JuceIStorage : public IStorage +{ + int refCount; + +public: + JuceIStorage() : refCount (1) {} + + virtual ~JuceIStorage() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IStorage) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall CreateStream (const WCHAR*, DWORD, DWORD, DWORD, IStream**) { return E_NOTIMPL; } + HRESULT __stdcall OpenStream (const WCHAR*, void*, DWORD, DWORD, IStream**) { return E_NOTIMPL; } + HRESULT __stdcall CreateStorage (const WCHAR*, DWORD, DWORD, DWORD, IStorage**) { return E_NOTIMPL; } + HRESULT __stdcall OpenStorage (const WCHAR*, IStorage*, DWORD, SNB, DWORD, IStorage**) { return E_NOTIMPL; } + HRESULT __stdcall CopyTo (DWORD, IID const*, SNB, IStorage*) { return E_NOTIMPL; } + HRESULT __stdcall MoveElementTo (const OLECHAR*,IStorage*, const OLECHAR*, DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Commit (DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Revert() { return E_NOTIMPL; } + HRESULT __stdcall EnumElements (DWORD, void*, DWORD, IEnumSTATSTG**) { return E_NOTIMPL; } + HRESULT __stdcall DestroyElement (const OLECHAR*) { return E_NOTIMPL; } + HRESULT __stdcall RenameElement (const WCHAR*, const WCHAR*) { return E_NOTIMPL; } + HRESULT __stdcall SetElementTimes (const WCHAR*, FILETIME const*, FILETIME const*, FILETIME const*) { return E_NOTIMPL; } + HRESULT __stdcall SetClass (REFCLSID) { return S_OK; } + HRESULT __stdcall SetStateBits (DWORD, DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Stat (STATSTG*, DWORD) { return E_NOTIMPL; } + + juce_UseDebuggingNewOperator +}; + + +class JuceOleInPlaceFrame : public IOleInPlaceFrame +{ + int refCount; + HWND window; + +public: + JuceOleInPlaceFrame (HWND window_) + : refCount (1), + window (window_) + { + } + + virtual ~JuceOleInPlaceFrame() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleInPlaceFrame) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } + HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall GetBorder (LPRECT) { return E_NOTIMPL; } + HRESULT __stdcall RequestBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetActiveObject (IOleInPlaceActiveObject*, LPCOLESTR) { return S_OK; } + HRESULT __stdcall InsertMenus (HMENU, LPOLEMENUGROUPWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetMenu (HMENU, HOLEMENU, HWND) { return S_OK; } + HRESULT __stdcall RemoveMenus (HMENU) { return E_NOTIMPL; } + HRESULT __stdcall SetStatusText (LPCOLESTR) { return S_OK; } + HRESULT __stdcall EnableModeless (BOOL) { return S_OK; } + HRESULT __stdcall TranslateAccelerator(LPMSG, WORD) { return E_NOTIMPL; } + + juce_UseDebuggingNewOperator +}; + + +class JuceIOleInPlaceSite : public IOleInPlaceSite +{ + int refCount; + HWND window; + JuceOleInPlaceFrame* frame; + +public: + JuceIOleInPlaceSite (HWND window_) + : refCount (1), + window (window_) + { + frame = new JuceOleInPlaceFrame (window); + } + + virtual ~JuceIOleInPlaceSite() + { + jassert (refCount == 0); + frame->Release(); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleInPlaceSite) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } + HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall CanInPlaceActivate() { return S_OK; } + HRESULT __stdcall OnInPlaceActivate() { return S_OK; } + HRESULT __stdcall OnUIActivate() { return S_OK; } + + HRESULT __stdcall GetWindowContext (LPOLEINPLACEFRAME* lplpFrame, LPOLEINPLACEUIWINDOW* lplpDoc, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO lpFrameInfo) + { + frame->AddRef(); + *lplpFrame = frame; + *lplpDoc = 0; + lpFrameInfo->fMDIApp = FALSE; + lpFrameInfo->hwndFrame = window; + lpFrameInfo->haccel = 0; + lpFrameInfo->cAccelEntries = 0; + return S_OK; + } + + HRESULT __stdcall Scroll (SIZE) { return E_NOTIMPL; } + HRESULT __stdcall OnUIDeactivate (BOOL) { return S_OK; } + HRESULT __stdcall OnInPlaceDeactivate() { return S_OK; } + HRESULT __stdcall DiscardUndoState() { return E_NOTIMPL; } + HRESULT __stdcall DeactivateAndUndo() { return E_NOTIMPL; } + HRESULT __stdcall OnPosRectChange (LPCRECT) { return S_OK; } + + juce_UseDebuggingNewOperator +}; + + +class JuceIOleClientSite : public IOleClientSite +{ + int refCount; + JuceIOleInPlaceSite* inplaceSite; + +public: + JuceIOleClientSite (HWND window) + : refCount (1) + { + inplaceSite = new JuceIOleInPlaceSite (window); + } + + virtual ~JuceIOleClientSite() + { + jassert (refCount == 0); + inplaceSite->Release(); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleClientSite) + { + AddRef(); + *result = this; + return S_OK; + } + else if (id == IID_IOleInPlaceSite) + { + inplaceSite->AddRef(); + *result = inplaceSite; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall SaveObject() { return E_NOTIMPL; } + HRESULT __stdcall GetMoniker (DWORD, DWORD, IMoniker**) { return E_NOTIMPL; } + HRESULT __stdcall GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = 0; return E_NOINTERFACE; } + HRESULT __stdcall ShowObject() { return S_OK; } + HRESULT __stdcall OnShowWindow (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall RequestNewObjectLayout() { return E_NOTIMPL; } + + juce_UseDebuggingNewOperator +}; + +//============================================================================== +class ActiveXControlData : public ComponentMovementWatcher +{ + ActiveXControlComponent* const owner; + bool wasShowing; + +public: + HWND controlHWND; + IStorage* storage; + IOleClientSite* clientSite; + IOleObject* control; + + //============================================================================== + ActiveXControlData (HWND hwnd, + ActiveXControlComponent* const owner_) + : ComponentMovementWatcher (owner_), + owner (owner_), + wasShowing (owner_ != 0 && owner_->isShowing()), + controlHWND (0), + storage (new JuceIStorage()), + clientSite (new JuceIOleClientSite (hwnd)), + control (0) + { + } + + ~ActiveXControlData() + { + if (control != 0) + { + control->Close (OLECLOSE_NOSAVE); + control->Release(); + } + + clientSite->Release(); + storage->Release(); + } + + //============================================================================== + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) + { + Component* const topComp = owner->getTopLevelComponent(); + + if (topComp->getPeer() != 0) + { + int x = 0, y = 0; + owner->relativePositionToOtherComponent (topComp, x, y); + + owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); + } + } + + void componentPeerChanged() + { + const bool isShowingNow = owner->isShowing(); + + if (wasShowing != isShowingNow) + { + wasShowing = isShowingNow; + + owner->setControlVisible (isShowingNow); + } + } + + void componentVisibilityChanged (Component&) + { + componentPeerChanged(); + } + + static bool doesWindowMatch (const ActiveXControlComponent* const ax, HWND hwnd) + { + return ((ActiveXControlData*) ax->control) != 0 + && ((ActiveXControlData*) ax->control)->controlHWND == hwnd; + } +}; + +//============================================================================== +static VoidArray activeXComps; + +static HWND getHWND (const ActiveXControlComponent* const component) +{ + HWND hwnd = 0; + + const IID iid = IID_IOleWindow; + IOleWindow* const window = (IOleWindow*) component->queryInterface (&iid); + + if (window != 0) + { + window->GetWindow (&hwnd); + window->Release(); + } + + return hwnd; +} + +static void offerActiveXMouseEventToPeer (ComponentPeer* const peer, HWND hwnd, UINT message, LPARAM lParam) +{ + RECT activeXRect, peerRect; + GetWindowRect (hwnd, &activeXRect); + GetWindowRect ((HWND) peer->getNativeHandle(), &peerRect); + + const int mx = GET_X_LPARAM (lParam) + activeXRect.left - peerRect.left; + const int my = GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top; + const int64 mouseEventTime = getMouseEventTime(); + + const int oldModifiers = currentModifiers; + ModifierKeys::getCurrentModifiersRealtime(); // to update the mouse button flags + + switch (message) + { + case WM_MOUSEMOVE: + if (ModifierKeys (currentModifiers).isAnyMouseButtonDown()) + peer->handleMouseDrag (mx, my, mouseEventTime); + else + peer->handleMouseMove (mx, my, mouseEventTime); + break; + + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + peer->handleMouseDown (mx, my, mouseEventTime); + break; + + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + peer->handleMouseUp (oldModifiers, mx, my, mouseEventTime); + break; + + default: + break; + } +} + +// intercepts events going to an activeX control, so we can sneakily use the mouse events +static LRESULT CALLBACK activeXHookWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + for (int i = activeXComps.size(); --i >= 0;) + { + const ActiveXControlComponent* const ax = (const ActiveXControlComponent*) activeXComps.getUnchecked(i); + + if (ActiveXControlData::doesWindowMatch (ax, hwnd)) + { + switch (message) + { + case WM_MOUSEMOVE: + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_MBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + if (ax->isShowing()) + { + ComponentPeer* const peer = ax->getPeer(); + + if (peer != 0) + { + offerActiveXMouseEventToPeer (peer, hwnd, message, lParam); + + if (! ax->areMouseEventsAllowed()) + return 0; + } + } + break; + + default: + break; + } + + return CallWindowProc ((WNDPROC) (ax->originalWndProc), hwnd, message, wParam, lParam); + } + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} + +ActiveXControlComponent::ActiveXControlComponent() + : originalWndProc (0), + control (0), + mouseEventsAllowed (true) +{ + activeXComps.add (this); +} + +ActiveXControlComponent::~ActiveXControlComponent() +{ + deleteControl(); + activeXComps.removeValue (this); +} + +void ActiveXControlComponent::paint (Graphics& g) +{ + if (control == 0) + g.fillAll (Colours::lightgrey); +} + +bool ActiveXControlComponent::createControl (const void* controlIID) +{ + deleteControl(); + ComponentPeer* const peer = getPeer(); + + // the component must have already been added to a real window when you call this! + jassert (dynamic_cast (peer) != 0); + + if (dynamic_cast (peer) != 0) + { + int x = 0, y = 0; + relativePositionToOtherComponent (getTopLevelComponent(), x, y); + + HWND hwnd = (HWND) peer->getNativeHandle(); + + ActiveXControlData* const info = new ActiveXControlData (hwnd, this); + + HRESULT hr; + if ((hr = OleCreate (*(const IID*) controlIID, IID_IOleObject, 1 /*OLERENDER_DRAW*/, 0, + info->clientSite, info->storage, + (void**) &(info->control))) == S_OK) + { + info->control->SetHostNames (L"Juce", 0); + + if (OleSetContainedObject (info->control, TRUE) == S_OK) + { + RECT rect; + rect.left = x; + rect.top = y; + rect.right = x + getWidth(); + rect.bottom = y + getHeight(); + + if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) + { + control = info; + setControlBounds (Rectangle (x, y, getWidth(), getHeight())); + + info->controlHWND = getHWND (this); + + if (info->controlHWND != 0) + { + originalWndProc = (void*) GetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC); + SetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); + } + + return true; + } + } + } + + delete info; + } + + return false; +} + +void ActiveXControlComponent::deleteControl() +{ + ActiveXControlData* const info = (ActiveXControlData*) control; + + if (info != 0) + { + delete info; + control = 0; + originalWndProc = 0; + } +} + +void* ActiveXControlComponent::queryInterface (const void* iid) const +{ + ActiveXControlData* const info = (ActiveXControlData*) control; + + void* result = 0; + + if (info != 0 && info->control != 0 + && info->control->QueryInterface (*(const IID*) iid, &result) == S_OK) + return result; + + return 0; +} + +void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const +{ + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; + + if (hwnd != 0) + MoveWindow (hwnd, newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight(), TRUE); +} + +void ActiveXControlComponent::setControlVisible (const bool shouldBeVisible) const +{ + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; + + if (hwnd != 0) + ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); +} + +void ActiveXControlComponent::setMouseEventsAllowed (const bool eventsCanReachControl) +{ + mouseEventsAllowed = eventsCanReachControl; +} + +#endif diff --git a/build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp b/build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp index 4dcdc17de3..d6ce635bfa 100644 --- a/build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp +++ b/build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp @@ -29,37 +29,10 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include - -#include "../../../juce_Config.h" - -#if JUCE_USE_CDBURNER - // you'll need the Platform SDK for these headers - if you don't have it and don't - // need to use CD-burning, then you might just want to disable the JUCE_USE_CDBURNER - // flag in juce_Config.h to avoid these includes. - #include - #include -#endif - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_USE_CDBURNER -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.h" -#include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_appframework/audio/dsp/juce_AudioDataConverters.h" - -#ifdef _MSC_VER - #pragma warning (pop) -#endif //*************************************************************************** // %%% TARGET STATUS VALUES %%% @@ -2122,8 +2095,6 @@ void AudioCDReader::ejectDisk() } -#if JUCE_USE_CDBURNER - //============================================================================== static IDiscRecorder* enumCDBurners (StringArray* list, int indexToOpen, IDiscMaster** master) { @@ -2445,5 +2416,3 @@ bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamples) } #endif - -END_JUCE_NAMESPACE diff --git a/build/win32/platform_specific_code/juce_win32_DirectSound.cpp b/build/win32/platform_specific_code/juce_win32_DirectSound.cpp index bf5158186c..31e52dd956 100644 --- a/build/win32/platform_specific_code/juce_win32_DirectSound.cpp +++ b/build/win32/platform_specific_code/juce_win32_DirectSound.cpp @@ -29,10 +29,13 @@ ============================================================================== */ -#include "win32_headers.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== +END_JUCE_NAMESPACE + extern "C" { @@ -524,7 +527,7 @@ public: bytesPerBuffer, (void**) &lpbuf1, &dwSize1, (void**) &lpbuf2, &dwSize2, 0); - } + } if (hr == S_OK) { @@ -1216,41 +1219,17 @@ private: void resync() { - int i; - for (i = outChans.size(); --i >= 0;) - outChans.getUnchecked(i)->close(); - - for (i = inChans.size(); --i >= 0;) - inChans.getUnchecked(i)->close(); - - if (threadShouldExit()) - return; - - // boost our priority while opening the devices to try to get better sync between them - const int oldThreadPri = GetThreadPriority (GetCurrentThread()); - const int oldProcPri = GetPriorityClass (GetCurrentProcess()); - SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); - SetPriorityClass (GetCurrentProcess(), REALTIME_PRIORITY_CLASS); - - for (i = outChans.size(); --i >= 0;) - outChans.getUnchecked(i)->open(); - - for (i = inChans.size(); --i >= 0;) - inChans.getUnchecked(i)->open(); - if (! threadShouldExit()) { sleep (5); + int i; for (i = 0; i < outChans.size(); ++i) outChans.getUnchecked(i)->synchronisePosition(); for (i = 0; i < inChans.size(); ++i) inChans.getUnchecked(i)->synchronisePosition(); } - - SetThreadPriority (GetCurrentThread(), oldThreadPri); - SetPriorityClass (GetCurrentProcess(), oldProcPri); } public: @@ -1435,8 +1414,8 @@ public: const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); if (outputIndex >= 0 || inputIndex >= 0) - return new DSoundAudioIODevice (outputDeviceName.isNotEmpty() ? outputDeviceName - : inputDeviceName, + return new DSoundAudioIODevice (outputDeviceName.isNotEmpty() ? outputDeviceName + : inputDeviceName, outputIndex, inputIndex); return 0; @@ -1676,4 +1655,4 @@ const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels, #undef log -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_DynamicLibraryLoader.cpp b/build/win32/platform_specific_code/juce_win32_DynamicLibraryLoader.cpp index f191fd5342..e244035e21 100644 --- a/build/win32/platform_specific_code/juce_win32_DynamicLibraryLoader.cpp +++ b/build/win32/platform_specific_code/juce_win32_DynamicLibraryLoader.cpp @@ -29,12 +29,10 @@ ============================================================================== */ -#include "win32_headers.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/text/juce_String.h" #include "juce_win32_DynamicLibraryLoader.h" @@ -54,4 +52,5 @@ void* DynamicLibraryLoader::findProcAddress (const String& functionName) return (void*) GetProcAddress ((HMODULE) libHandle, functionName); } -END_JUCE_NAMESPACE + +#endif diff --git a/build/win32/platform_specific_code/juce_win32_FileChooser.cpp b/build/win32/platform_specific_code/juce_win32_FileChooser.cpp index 131f8102a1..8a77924918 100644 --- a/build/win32/platform_specific_code/juce_win32_FileChooser.cpp +++ b/build/win32/platform_specific_code/juce_win32_FileChooser.cpp @@ -29,25 +29,10 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -#include "../../../src/juce_appframework/gui/components/filebrowser/juce_FileChooser.h" -#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" - -#ifdef _MSC_VER - #pragma warning (pop) -#endif //============================================================================== static const void* defaultDirPath = 0; @@ -355,4 +340,4 @@ void FileChooser::showPlatformDialog (OwnedArray& results, } } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Files.cpp b/build/win32/platform_specific_code/juce_win32_Files.cpp index e730354be7..2c1314d47e 100644 --- a/build/win32/platform_specific_code/juce_win32_Files.cpp +++ b/build/win32/platform_specific_code/juce_win32_Files.cpp @@ -29,21 +29,12 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -#include - -#ifndef _WIN32_IE - #define _WIN32_IE 0x0400 -#endif -#include +//============================================================================== #ifndef CSIDL_MYMUSIC #define CSIDL_MYMUSIC 0x000d #endif @@ -52,19 +43,6 @@ #define CSIDL_MYVIDEO 0x000e #endif - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/io/network/juce_URL.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/io/files/juce_NamedPipe.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" - -#ifdef _MSC_VER - #pragma warning (pop) -#endif - //============================================================================== const tchar File::separator = T('\\'); const tchar* File::separatorString = T("\\"); @@ -711,7 +689,8 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) if (createPipe) { intern->pipeH = CreateNamedPipe (file, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, 0, - 1, 64, 64, 0, NULL); + PIPE_UNLIMITED_INSTANCES, + 4096, 4096, 0, NULL); } else { @@ -758,20 +737,24 @@ int NamedPipe::read (void* destBuffer, int maxBytesToRead, int timeOutMillisecon else if (GetLastError() == ERROR_IO_PENDING) { HANDLE handles[] = { over.hEvent, intern->cancelEvent }; + DWORD waitResult = WaitForMultipleObjects (2, handles, FALSE, + timeOutMilliseconds >= 0 ? timeOutMilliseconds + : INFINITE); + if (waitResult != WAIT_OBJECT_0) + { + // if the operation timed out, let's cancel it... + CancelIo (intern->pipeH); + WaitForSingleObject (over.hEvent, INFINITE); // makes sure cancel is complete + } - if (WaitForMultipleObjects (2, handles, FALSE, - timeOutMilliseconds >= 0 ? timeOutMilliseconds - : INFINITE) == WAIT_OBJECT_0) + if (GetOverlappedResult (intern->pipeH, &over, &numRead, FALSE)) { - if (GetOverlappedResult (intern->pipeH, &over, &numRead, FALSE)) - { - bytesRead = (int) numRead; - } - else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) - { - intern->disconnect(); - waitAgain = true; - } + bytesRead = (int) numRead; + } + else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) + { + intern->disconnect(); + waitAgain = true; } } else @@ -810,18 +793,25 @@ int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOut else if (GetLastError() == ERROR_IO_PENDING) { HANDLE handles[] = { over.hEvent, intern->cancelEvent }; + DWORD waitResult; + + waitResult = WaitForMultipleObjects (2, handles, FALSE, + timeOutMilliseconds >= 0 ? timeOutMilliseconds + : INFINITE); - if (WaitForMultipleObjects (2, handles, FALSE, timeOutMilliseconds >= 0 ? timeOutMilliseconds - : INFINITE) == WAIT_OBJECT_0) + if (waitResult != WAIT_OBJECT_0) { - if (GetOverlappedResult (intern->pipeH, &over, &numWritten, FALSE)) - { - bytesWritten = (int) numWritten; - } - else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) - { - intern->disconnect(); - } + CancelIo (intern->pipeH); + WaitForSingleObject (over.hEvent, INFINITE); + } + + if (GetOverlappedResult (intern->pipeH, &over, &numWritten, FALSE)) + { + bytesWritten = (int) numWritten; + } + else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) + { + intern->disconnect(); } } @@ -840,4 +830,4 @@ void NamedPipe::cancelPendingReads() } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Fonts.cpp b/build/win32/platform_specific_code/juce_win32_Fonts.cpp index 7c201903c8..2980bba299 100644 --- a/build/win32/platform_specific_code/juce_win32_Fonts.cpp +++ b/build/win32/platform_specific_code/juce_win32_Fonts.cpp @@ -29,16 +29,9 @@ ============================================================================== */ -#include "win32_headers.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_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/basics/juce_Singleton.h" -#include "../../../src/juce_appframework/gui/graphics/imaging/juce_Image.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== @@ -506,4 +499,4 @@ void Typeface::initialiseTypefaceCharacteristics (const String& fontName, } } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Messaging.cpp b/build/win32/platform_specific_code/juce_win32_Messaging.cpp index c953ed5088..6e7333b74c 100644 --- a/build/win32/platform_specific_code/juce_win32_Messaging.cpp +++ b/build/win32/platform_specific_code/juce_win32_Messaging.cpp @@ -29,16 +29,9 @@ ============================================================================== */ -#include "win32_headers.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/application/juce_Application.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/basics/juce_Time.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== @@ -250,4 +243,5 @@ void MessageManager::doPlatformSpecificShutdown() OleUninitialize(); } -END_JUCE_NAMESPACE + +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Midi.cpp b/build/win32/platform_specific_code/juce_win32_Midi.cpp index da89220d82..c0896629e3 100644 --- a/build/win32/platform_specific_code/juce_win32_Midi.cpp +++ b/build/win32/platform_specific_code/juce_win32_Midi.cpp @@ -29,22 +29,9 @@ ============================================================================== */ -#include "win32_headers.h" -#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" -#include "../../../src/juce_core/basics/juce_Time.h" -#include "../../../src/juce_core/threads/juce_Thread.h" -#include "../../../src/juce_core/containers/juce_MemoryBlock.h" - -#if JUCE_MSVC - #pragma warning (disable: 4312) -#endif - -using ::free; +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== static const int midiBufferSize = 1024 * 10; @@ -52,6 +39,8 @@ static const int numInHeaders = 32; static const int inBufferSize = 256; static Array activeMidiThreads; +using ::free; + class MidiInThread : public Thread { public: @@ -644,4 +633,4 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) } } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Misc.cpp b/build/win32/platform_specific_code/juce_win32_Misc.cpp index cabbe0e6f6..8bdb2c675e 100644 --- a/build/win32/platform_specific_code/juce_win32_Misc.cpp +++ b/build/win32/platform_specific_code/juce_win32_Misc.cpp @@ -29,44 +29,12 @@ ============================================================================== */ -#include "win32_headers.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_appframework/application/juce_SystemClipboard.h" -#include "../../../src/juce_appframework/gui/components/windows/juce_AlertWindow.h" - - -//============================================================================== -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) -{ - return MessageBox (0, bodyText, title, - MB_SETFOREGROUND | (isOkCancel ? MB_OKCANCEL - : MB_OK)) == IDOK; -} - -#endif //============================================================================== -void PlatformUtilities::beep() -{ - MessageBeep (MB_OK); -} - - -//============================================================================== -#if JUCE_MSVC - #pragma warning (disable : 4127) // "Conditional expression is constant" warning -#endif - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - void SystemClipboard::copyTextToClipboard (const String& text) throw() { if (OpenClipboard (0) != 0) @@ -121,6 +89,5 @@ const String SystemClipboard::getTextFromClipboard() throw() return result; } -#endif -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_NativeIncludes.h b/build/win32/platform_specific_code/juce_win32_NativeIncludes.h new file mode 100644 index 0000000000..bb3a7c5895 --- /dev/null +++ b/build/win32/platform_specific_code/juce_win32_NativeIncludes.h @@ -0,0 +1,156 @@ +/* + ============================================================================== + + 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_WIN32_NATIVEINCLUDES_JUCEHEADER__ +#define __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__ + + +#include "../../../juce_Config.h" + +#ifndef STRICT + #define STRICT 1 +#endif + +#undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 + +#ifdef _MSC_VER + #pragma warning (push) + #pragma warning (disable : 4100 4201 4514 4312) +#endif + +#define _WIN32_WINNT 0x0500 +#define _UNICODE 1 +#define UNICODE 1 + +#ifndef _WIN32_IE + #define _WIN32_IE 0x0400 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if JUCE_OPENGL + #include +#endif + +#undef PACKED + +//============================================================================== +#if JUCE_ASIO +/* + This is very frustrating - we only need to use a handful of definitions from + a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy + about 30 lines of code into this cpp file to create a fully stand-alone ASIO + implementation... + + ..unfortunately that would break Steinberg's license agreement for use of + their SDK, so I'm not allowed to do this. + + This means that anyone who wants to use JUCE's ASIO abilities will have to: + + 1) Agree to Steinberg's licensing terms and download the ASIO SDK + (see www.steinberg.net/Steinberg/Developers.asp). + + 2) Rebuild the whole of JUCE, setting the global definition JUCE_ASIO (you + can un-comment the "#define JUCE_ASIO" line in juce_Config.h + if you prefer). Make sure that your header search path will find the + iasiodrv.h file that comes with the SDK. (Only about 2-3 of the SDK header + files are actually needed - so to simplify things, you could just copy + these into your JUCE directory). + + If you're compiling and you get an error here because you don't have the + ASIO SDK installed, you can disable ASIO support by commenting-out the + "#define JUCE_ASIO" line in juce_Config.h, and rebuild your Juce library. + */ + #include "iasiodrv.h" +#endif + +//============================================================================== +#if JUCE_USE_CDBURNER + + /* You'll need the Platform SDK for these headers - if you don't have it and don't + need to use CD-burning, then you might just want to disable the JUCE_USE_CDBURNER + flag in juce_Config.h to avoid these includes. + */ + #include + #include +#endif + + +//============================================================================== +#if JUCE_QUICKTIME + + /* If you've got an include error here, you probably need to install the QuickTime SDK and + add its header directory to your include path. + + Alternatively, if you don't need any QuickTime services, just turn off the JUCE_QUICKTIME + flag in juce_Config.h + */ + #include + #include + #include + #include + #include + + /* If you've got QuickTime 7 installed, then these COM objects should be found in + the "\Program Files\Quicktime" directory. You'll need to add this directory to + your include search path to make these import statements work. + */ + #import + #import +#endif + +//============================================================================== +#ifdef _MSC_VER + #pragma warning (pop) +#endif + +#endif // __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__ diff --git a/build/win32/platform_specific_code/juce_win32_Network.cpp b/build/win32/platform_specific_code/juce_win32_Network.cpp index c281b551bb..d6e3853d1d 100644 --- a/build/win32/platform_specific_code/juce_win32_Network.cpp +++ b/build/win32/platform_specific_code/juce_win32_Network.cpp @@ -29,35 +29,15 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include -#include -#include -#include -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -#include "../../../src/juce_core/text/juce_String.h" -#include "juce_win32_DynamicLibraryLoader.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" #ifndef INTERNET_FLAG_NEED_FILE #define INTERNET_FLAG_NEED_FILE 0x00000010 #endif -#ifdef _MSC_VER - #pragma warning (pop) -#endif - //============================================================================== bool juce_isOnLine() { @@ -417,4 +397,4 @@ bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAdd } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp b/build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp index 2cf4a874d8..d84871b75f 100644 --- a/build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp +++ b/build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp @@ -29,23 +29,9 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" - -#ifdef _MSC_VER - #pragma warning (pop) -#endif +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE //============================================================================== @@ -219,4 +205,11 @@ void PlatformUtilities::fpuReset() #endif } -END_JUCE_NAMESPACE +//============================================================================== +void PlatformUtilities::beep() +{ + MessageBeep (MB_OK); +} + + +#endif diff --git a/build/win32/platform_specific_code/juce_win32_QuickTimeMovieComponent.cpp b/build/win32/platform_specific_code/juce_win32_QuickTimeMovieComponent.cpp new file mode 100644 index 0000000000..8e8a981653 --- /dev/null +++ b/build/win32/platform_specific_code/juce_win32_QuickTimeMovieComponent.cpp @@ -0,0 +1,517 @@ +/* + ============================================================================== + + 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 gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_QUICKTIME + +using namespace QTOLibrary; +using namespace QTOControlLib; + +bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle); + +static bool hasLoadedQT = false; +static bool isQTAvailable = false; + + +//============================================================================== +struct QTMovieCompInternal +{ + QTMovieCompInternal() + : dataHandle (0) + { + } + + ~QTMovieCompInternal() + { + clearHandle(); + } + + IQTControlPtr qtControlInternal; + IQTMoviePtr qtMovieInternal; + + Handle dataHandle; + + void clearHandle() + { + if (dataHandle != 0) + { + DisposeHandle (dataHandle); + dataHandle = 0; + } + } +}; + +#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal) +#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal) + +//============================================================================== +QuickTimeMovieComponent::QuickTimeMovieComponent() + : movieLoaded (false), + controllerVisible (true) +{ + internal = new QTMovieCompInternal(); + setMouseEventsAllowed (false); +} + +QuickTimeMovieComponent::~QuickTimeMovieComponent() +{ + closeMovie(); + qtControl = 0; + + deleteControl(); + + delete internal; + internal = 0; +} + +bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() +{ + if (! hasLoadedQT) + { + hasLoadedQT = true; + + isQTAvailable = (InitializeQTML (0) == noErr) + && (EnterMovies() == noErr); + } + + return isQTAvailable; +} + +//============================================================================== +void QuickTimeMovieComponent::createControlIfNeeded() +{ + if (isShowing() && ! isControlCreated()) + { + const IID qtIID = __uuidof (QTControl); + + if (createControl (&qtIID)) + { + const IID qtInterfaceIID = __uuidof (IQTControl); + qtControl = (IQTControl*) queryInterface (&qtInterfaceIID); + + if (qtControl != 0) + { + qtControl->Release(); // it has one ref too many at this point + + qtControl->QuickTimeInitialize(); + qtControl->PutSizing (qtMovieFitsControl); + + if (movieFile != File::nonexistent) + loadMovie (movieFile, controllerVisible); + } + } + } +} + +bool QuickTimeMovieComponent::isControlCreated() const +{ + return isControlOpen(); +} + +bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, + const bool isControllerVisible) +{ + movieFile = File::nonexistent; + movieLoaded = false; + qtMovie = 0; + controllerVisible = isControllerVisible; + createControlIfNeeded(); + + if (isControlCreated()) + { + if (qtControl != 0) + { + qtControl->Put_MovieHandle (0); + ((QTMovieCompInternal*) internal)->clearHandle(); + + Movie movie; + if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, ((QTMovieCompInternal*) internal)->dataHandle)) + { + qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie); + + qtMovie = qtControl->GetMovie(); + + if (qtMovie != 0) + qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard + : qtMovieControllerTypeNone); + } + + if (movie == 0) + ((QTMovieCompInternal*) internal)->clearHandle(); + } + + movieLoaded = (qtMovie != 0); + } + else + { + // You're trying to open a movie when the control hasn't yet been created, probably because + // you've not yet added this component to a Window and made the whole component hierarchy visible. + jassertfalse + } + + delete movieStream; + return movieLoaded; +} + +void QuickTimeMovieComponent::closeMovie() +{ + stop(); + movieFile = File::nonexistent; + movieLoaded = false; + qtMovie = 0; + + if (qtControl != 0) + qtControl->Put_MovieHandle (0); + + ((QTMovieCompInternal*) internal)->clearHandle(); +} + +const File QuickTimeMovieComponent::getCurrentMovieFile() const +{ + return movieFile; +} + +bool QuickTimeMovieComponent::isMovieOpen() const +{ + return movieLoaded; +} + +double QuickTimeMovieComponent::getMovieDuration() const +{ + if (qtMovie != 0) + return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale(); + + return 0.0; +} + +void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const +{ + if (qtMovie != 0) + { + struct QTRECT r = qtMovie->GetNaturalRect(); + + width = r.right - r.left; + height = r.bottom - r.top; + } + else + { + width = height = 0; + } +} + +void QuickTimeMovieComponent::play() +{ + if (qtMovie != 0) + qtMovie->Play(); +} + +void QuickTimeMovieComponent::stop() +{ + if (qtMovie != 0) + qtMovie->Stop(); +} + +bool QuickTimeMovieComponent::isPlaying() const +{ + return qtMovie != 0 && qtMovie->GetRate() != 0.0f; +} + +void QuickTimeMovieComponent::setPosition (const double seconds) +{ + if (qtMovie != 0) + qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale())); +} + +double QuickTimeMovieComponent::getPosition() const +{ + if (qtMovie != 0) + return qtMovie->GetTime() / (double) qtMovie->GetTimeScale(); + + return 0.0; +} + +void QuickTimeMovieComponent::setSpeed (const float newSpeed) +{ + if (qtMovie != 0) + qtMovie->PutRate (newSpeed); +} + +void QuickTimeMovieComponent::setMovieVolume (const float newVolume) +{ + if (qtMovie != 0) + { + qtMovie->PutAudioVolume (newVolume); + qtMovie->PutAudioMute (newVolume <= 0); + } +} + +float QuickTimeMovieComponent::getMovieVolume() const +{ + if (qtMovie != 0) + return qtMovie->GetAudioVolume(); + + return 0.0f; +} + +void QuickTimeMovieComponent::setLooping (const bool shouldLoop) +{ + if (qtMovie != 0) + qtMovie->PutLoop (shouldLoop); +} + +bool QuickTimeMovieComponent::isLooping() const +{ + return qtMovie != 0 && qtMovie->GetLoop(); +} + +bool QuickTimeMovieComponent::isControllerVisible() const +{ + return controllerVisible; +} + +void QuickTimeMovieComponent::parentHierarchyChanged() +{ + createControlIfNeeded(); + QTCompBaseClass::parentHierarchyChanged(); +} + +void QuickTimeMovieComponent::visibilityChanged() +{ + createControlIfNeeded(); + QTCompBaseClass::visibilityChanged(); +} + +void QuickTimeMovieComponent::paint (Graphics& g) +{ + if (! isControlCreated()) + g.fillAll (Colours::black); +} + + +//============================================================================== +static Handle createHandleDataRef (Handle dataHandle, const char* fileName) +{ + Handle dataRef = 0; + OSStatus err = PtrToHand (&dataHandle, &dataRef, sizeof (Handle)); + if (err == noErr) + { + Str255 suffix; + + CharacterFunctions::copy ((char*) suffix, fileName, 128); + + StringPtr name = suffix; + err = PtrAndHand (name, dataRef, name[0] + 1); + + if (err == noErr) + { + long atoms[3]; + atoms[0] = EndianU32_NtoB (3 * sizeof (long)); + atoms[1] = EndianU32_NtoB (kDataRefExtensionMacOSFileType); + atoms[2] = EndianU32_NtoB (MovieFileType); + + err = PtrAndHand (atoms, dataRef, 3 * sizeof (long)); + + if (err == noErr) + return dataRef; + } + + DisposeHandle (dataRef); + } + + return 0; +} + +static CFStringRef juceStringToCFString (const String& s) +{ + const int len = s.length(); + const juce_wchar* const t = (const juce_wchar*) s; + + UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); + + for (int i = 0; i <= len; ++i) + temp[i] = t[i]; + + CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); + juce_free (temp); + + return result; +} + +static bool openMovie (QTNewMoviePropertyElement* props, int prop, Movie& movie) +{ + Boolean trueBool = true; + props[prop].propClass = kQTPropertyClass_MovieInstantiation; + props[prop].propID = kQTMovieInstantiationPropertyID_DontResolveDataRefs; + props[prop].propValueSize = sizeof (trueBool); + props[prop].propValueAddress = &trueBool; + ++prop; + + props[prop].propClass = kQTPropertyClass_MovieInstantiation; + props[prop].propID = kQTMovieInstantiationPropertyID_AsyncOK; + props[prop].propValueSize = sizeof (trueBool); + props[prop].propValueAddress = &trueBool; + ++prop; + + Boolean isActive = true; + props[prop].propClass = kQTPropertyClass_NewMovieProperty; + props[prop].propID = kQTNewMoviePropertyID_Active; + props[prop].propValueSize = sizeof (isActive); + props[prop].propValueAddress = &isActive; + ++prop; + + MacSetPort (0); + + jassert (prop <= 5); + OSStatus err = NewMovieFromProperties (prop, props, 0, 0, &movie); + + return err == noErr; +} + +bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle) +{ + if (input == 0) + return false; + + dataHandle = 0; + bool ok = false; + + QTNewMoviePropertyElement props[5]; + zeromem (props, sizeof (props)); + int prop = 0; + + DataReferenceRecord dr; + props[prop].propClass = kQTPropertyClass_DataLocation; + props[prop].propID = kQTDataLocationPropertyID_DataReference; + props[prop].propValueSize = sizeof (dr); + props[prop].propValueAddress = (void*) &dr; + ++prop; + + FileInputStream* const fin = dynamic_cast (input); + + if (fin != 0) + { + CFStringRef filePath = juceStringToCFString (fin->getFile().getFullPathName()); + + QTNewDataReferenceFromFullPathCFString (filePath, (QTPathStyle) kQTNativeDefaultPathStyle, 0, + &dr.dataRef, &dr.dataRefType); + + + ok = openMovie (props, prop, movie); + + DisposeHandle (dr.dataRef); + CFRelease (filePath); + } + else + { + // sanity-check because this currently needs to load the whole stream into memory.. + jassert (input->getTotalLength() < 50 * 1024 * 1024); + + dataHandle = NewHandle ((Size) input->getTotalLength()); + HLock (dataHandle); + // read the entire stream into memory - this is a pain, but can't get it to work + // properly using a custom callback to supply the data. + input->read (*dataHandle, (int) input->getTotalLength()); + HUnlock (dataHandle); + + // different types to get QT to try. (We should really be a bit smarter here by + // working out in advance which one the stream contains, rather than just trying + // each one) + const char* const suffixesToTry[] = { "\04.mov", "\04.mp3", + "\04.avi", "\04.m4a" }; + + for (int i = 0; i < numElementsInArray (suffixesToTry) && ! ok; ++i) + { + /* // this fails for some bizarre reason - it can be bodged to work with + // movies, but can't seem to do it for other file types.. + QTNewMovieUserProcRecord procInfo; + procInfo.getMovieUserProc = NewGetMovieUPP (readMovieStreamProc); + procInfo.getMovieUserProcRefcon = this; + procInfo.defaultDataRef.dataRef = dataRef; + procInfo.defaultDataRef.dataRefType = HandleDataHandlerSubType; + + props[prop].propClass = kQTPropertyClass_DataLocation; + props[prop].propID = kQTDataLocationPropertyID_MovieUserProc; + props[prop].propValueSize = sizeof (procInfo); + props[prop].propValueAddress = (void*) &procInfo; + ++prop; */ + + dr.dataRef = createHandleDataRef (dataHandle, suffixesToTry [i]); + dr.dataRefType = HandleDataHandlerSubType; + ok = openMovie (props, prop, movie); + + DisposeHandle (dr.dataRef); + } + } + + return ok; +} + +bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, + const bool isControllerVisible) +{ + const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); + movieFile = movieFile_; + return ok; +} + +void QuickTimeMovieComponent::goToStart() +{ + setPosition (0.0); +} + +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + const RectanglePlacement& placement) +{ + int normalWidth, normalHeight; + getMovieNormalSize (normalWidth, normalHeight); + + if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) + { + double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; + + placement.applyTo (x, y, w, h, + spaceToFitWithin.getX(), spaceToFitWithin.getY(), + spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); + + if (w > 0 && h > 0) + { + setBounds (roundDoubleToInt (x), roundDoubleToInt (y), + roundDoubleToInt (w), roundDoubleToInt (h)); + } + } + else + { + setBounds (spaceToFitWithin); + } +} + +#endif diff --git a/build/win32/platform_specific_code/juce_win32_SystemStats.cpp b/build/win32/platform_specific_code/juce_win32_SystemStats.cpp index 168b5ffe6f..fcb8fff880 100644 --- a/build/win32/platform_specific_code/juce_win32_SystemStats.cpp +++ b/build/win32/platform_specific_code/juce_win32_SystemStats.cpp @@ -29,22 +29,9 @@ ============================================================================== */ -#include "win32_headers.h" -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - - -//============================================================================== -// Auto-link the other win32 libs that are needed by library calls.. -#if defined (JUCE_DLL_BUILD) && JUCE_MSVC - #include "juce_win32_AutoLinkLibraries.h" -#endif - - -//============================================================================== -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/io/files/juce_File.h" -#include "../../../src/juce_core/basics/juce_SystemStats.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE extern void juce_updateMultiMonitorInfo() throw(); extern void juce_initialiseThreadEvents() throw(); @@ -487,4 +474,4 @@ int SystemStats::getPageSize() throw() return systemInfo.dwPageSize; } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Threads.cpp b/build/win32/platform_specific_code/juce_win32_Threads.cpp index 56a79fbc16..edc78ccdc7 100644 --- a/build/win32/platform_specific_code/juce_win32_Threads.cpp +++ b/build/win32/platform_specific_code/juce_win32_Threads.cpp @@ -29,34 +29,14 @@ ============================================================================== */ -#include "win32_headers.h" - -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) - #include -#endif - -#include -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_core/text/juce_String.h" -#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/threads/juce_InterProcessLock.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE #if ! JUCE_ONLY_BUILD_CORE_LIBRARY extern HWND juce_messageWindowHandle; #endif -#ifdef _MSC_VER - #pragma warning (pop) -#endif - //============================================================================== CriticalSection::CriticalSection() throw() @@ -129,7 +109,7 @@ static unsigned int __stdcall threadEntryProc (void* userData) throw() juce_threadEntryPoint (userData); - _endthreadex(0); + _endthreadex (0); return 0; } @@ -188,7 +168,7 @@ void juce_setCurrentThreadName (const String& name) throw() #endif } -int Thread::getCurrentThreadId() throw() +int64 Thread::getCurrentThreadId() throw() { return (int) GetCurrentThreadId(); } @@ -335,7 +315,8 @@ void Process::terminate() ExitProcess (0); } -void* Process::loadDynamicLibrary (const String& name) +//============================================================================== +void* PlatformUtilities::loadDynamicLibrary (const String& name) { void* result = 0; @@ -348,7 +329,7 @@ void* Process::loadDynamicLibrary (const String& name) return result; } -void Process::freeDynamicLibrary (void* h) +void PlatformUtilities::freeDynamicLibrary (void* h) { JUCE_TRY { @@ -358,7 +339,7 @@ void Process::freeDynamicLibrary (void* h) JUCE_CATCH_ALL } -void* Process::getProcedureEntryPoint (void* h, const String& name) +void* PlatformUtilities::getProcedureEntryPoint (void* h, const String& name) { return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name) : 0; @@ -411,5 +392,4 @@ void InterProcessLock::exit() throw() } - -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_WebBrowserComponent.cpp b/build/win32/platform_specific_code/juce_win32_WebBrowserComponent.cpp index 83202d8b83..d2af8556a7 100644 --- a/build/win32/platform_specific_code/juce_win32_WebBrowserComponent.cpp +++ b/build/win32/platform_specific_code/juce_win32_WebBrowserComponent.cpp @@ -29,29 +29,9 @@ ============================================================================== */ -//============================================================================== -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include -#include -#include - -#ifdef _MSC_VER - #pragma warning (pop) - #pragma warning (disable: 4312 4244) -#endif - - -#include "../../../src/juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h" -#include "../../../src/juce_appframework/gui/components/special/juce_ActiveXControlComponent.h" +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER //============================================================================== @@ -342,10 +322,6 @@ void WebBrowserComponent::parentHierarchyChanged() checkWindowAssociation(); } -void WebBrowserComponent::moved() -{ -} - void WebBrowserComponent::resized() { browser->setSize (getWidth(), getHeight()); @@ -361,4 +337,4 @@ bool WebBrowserComponent::pageAboutToLoad (const String&) return true; } -END_JUCE_NAMESPACE +#endif diff --git a/build/win32/platform_specific_code/juce_win32_Windowing.cpp b/build/win32/platform_specific_code/juce_win32_Windowing.cpp index 74f38c73d5..839f071d8d 100644 --- a/build/win32/platform_specific_code/juce_win32_Windowing.cpp +++ b/build/win32/platform_specific_code/juce_win32_Windowing.cpp @@ -29,25 +29,12 @@ ============================================================================== */ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include "win32_headers.h" -#include -#include -#include - -#if JUCE_OPENGL - #include -#endif +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -#ifdef _MSC_VER - #pragma warning (pop) - #pragma warning (disable: 4312 4244) -#endif +//============================================================================== #undef GetSystemMetrics // multimon overrides this for some reason and causes a mess.. // these are in the windows SDK, but need to be repeated here for GCC.. @@ -61,35 +48,6 @@ #define WM_APPCOMMAND 0x0319 #endif - -#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/basics/juce_Singleton.h" -#include "../../../src/juce_core/threads/juce_Process.h" -#include "../../../src/juce_core/misc/juce_PlatformUtilities.h" -#include "../../../src/juce_appframework/events/juce_Timer.h" -#include "../../../src/juce_appframework/events/juce_MessageManager.h" -#include "../../../src/juce_appframework/application/juce_DeletedAtShutdown.h" -#include "../../../src/juce_appframework/gui/components/keyboard/juce_KeyPress.h" -#include "../../../src/juce_appframework/gui/components/mouse/juce_DragAndDropContainer.h" -#include "../../../src/juce_appframework/gui/components/juce_Desktop.h" -#include "../../../src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.h" -#include "../../../src/juce_appframework/gui/components/special/juce_OpenGLComponent.h" -#include "../../../src/juce_appframework/gui/components/special/juce_DropShadower.h" -#include "../../../src/juce_appframework/gui/components/special/juce_ActiveXControlComponent.h" -#include "../../../src/juce_appframework/gui/components/special/juce_SystemTrayIconComponent.h" -#include "../../../src/juce_appframework/gui/components/juce_ComponentDeletionWatcher.h" -#include "../../../src/juce_appframework/gui/components/layout/juce_ComponentBoundsConstrainer.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/graphics/geometry/juce_PathIterator.h" -#include "../../../src/juce_appframework/gui/components/layout/juce_ComponentMovementWatcher.h" -#include "../../../src/juce_appframework/application/juce_Application.h" - extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.cpp extern bool juce_IsRunningInWine() throw(); @@ -218,6 +176,7 @@ public: bitmapInfo.bV4Width = w; bitmapInfo.bV4Height = h; bitmapInfo.bV4Planes = 1; + bitmapInfo.bV4CSType = 1; bitmapInfo.bV4BitCount = (unsigned short) (pixelStride * 8); if (format_ == ARGB) @@ -1452,7 +1411,7 @@ private: doMouseUp (GET_X_LPARAM (mp) - wr.left - windowBorder.getLeft(), GET_Y_LPARAM (mp) - wr.top - windowBorder.getTop(), - getMouseEventTime()); + (WPARAM) getMouseEventTime()); } } @@ -2037,6 +1996,10 @@ private: } handleBroughtToFront(); + + if (component->isCurrentlyBlockedByAnotherModalComponent()) + Component::getCurrentlyModalComponent()->toFront (true); + return 0; } @@ -2300,6 +2263,17 @@ bool Process::isForegroundProcess() throw() return processId == GetCurrentProcessId(); } +//============================================================================== +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) +{ + return MessageBox (0, bodyText, title, + MB_SETFOREGROUND | (isOkCancel ? MB_OKCANCEL + : MB_OK)) == IDOK; +} + + //============================================================================== void Desktop::getMousePosition (int& x, int& y) throw() { @@ -3013,1024 +2987,4 @@ bool DragAndDropContainer::performExternalDragDropOfText (const String& text) } -//============================================================================== -//============================================================================== -#if JUCE_OPENGL - -#define WGL_EXT_FUNCTION_INIT(extType, extFunc) \ - ((extFunc = (extType) wglGetProcAddress (#extFunc)) != 0) - -typedef const char* (WINAPI* PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); -typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); - -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_STEREO_ARB 0x2012 -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 -#define WGL_TYPE_RGBA_ARB 0x202B - -static void getWglExtensions (HDC dc, StringArray& result) throw() -{ - PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0; - - if (WGL_EXT_FUNCTION_INIT (PFNWGLGETEXTENSIONSSTRINGARBPROC, wglGetExtensionsStringARB)) - result.addTokens (String (wglGetExtensionsStringARB (dc)), false); - else - jassertfalse // If this fails, it may be because you didn't activate the openGL context -} - - -//============================================================================== -class WindowedGLContext : public OpenGLContext -{ -public: - WindowedGLContext (Component* const component_, - HGLRC contextToShareWith, - const OpenGLPixelFormat& pixelFormat) - : renderContext (0), - nativeWindow (0), - dc (0), - component (component_) - { - jassert (component != 0); - - createNativeWindow(); - - // Use a default pixel format that should be supported everywhere - PIXELFORMATDESCRIPTOR pfd; - zerostruct (pfd); - pfd.nSize = sizeof (pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 24; - pfd.cDepthBits = 16; - - const int format = ChoosePixelFormat (dc, &pfd); - - if (format != 0) - SetPixelFormat (dc, format, &pfd); - - renderContext = wglCreateContext (dc); - makeActive(); - - setPixelFormat (pixelFormat); - - if (contextToShareWith != 0 && renderContext != 0) - wglShareLists (contextToShareWith, renderContext); - } - - ~WindowedGLContext() - { - makeInactive(); - - wglDeleteContext (renderContext); - - ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); - delete nativeWindow; - } - - bool makeActive() const throw() - { - jassert (renderContext != 0); - return wglMakeCurrent (dc, renderContext) != 0; - } - - bool makeInactive() const throw() - { - return (! isActive()) || (wglMakeCurrent (0, 0) != 0); - } - - bool isActive() const throw() - { - return wglGetCurrentContext() == renderContext; - } - - const OpenGLPixelFormat getPixelFormat() const - { - OpenGLPixelFormat pf; - - makeActive(); - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - fillInPixelFormatDetails (GetPixelFormat (dc), pf, availableExtensions); - return pf; - } - - void* getRawContext() const throw() - { - return renderContext; - } - - bool setPixelFormat (const OpenGLPixelFormat& pixelFormat) - { - makeActive(); - - PIXELFORMATDESCRIPTOR pfd; - zerostruct (pfd); - pfd.nSize = sizeof (pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.iLayerType = PFD_MAIN_PLANE; - pfd.cColorBits = pixelFormat.redBits + pixelFormat.greenBits + pixelFormat.blueBits; - pfd.cRedBits = pixelFormat.redBits; - pfd.cGreenBits = pixelFormat.greenBits; - pfd.cBlueBits = pixelFormat.blueBits; - pfd.cAlphaBits = pixelFormat.alphaBits; - pfd.cDepthBits = pixelFormat.depthBufferBits; - pfd.cStencilBits = pixelFormat.stencilBufferBits; - pfd.cAccumBits = pixelFormat.accumulationBufferRedBits + pixelFormat.accumulationBufferGreenBits - + pixelFormat.accumulationBufferBlueBits + pixelFormat.accumulationBufferAlphaBits; - pfd.cAccumRedBits = pixelFormat.accumulationBufferRedBits; - pfd.cAccumGreenBits = pixelFormat.accumulationBufferGreenBits; - pfd.cAccumBlueBits = pixelFormat.accumulationBufferBlueBits; - pfd.cAccumAlphaBits = pixelFormat.accumulationBufferAlphaBits; - - int format = 0; - - PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = 0; - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - if (availableExtensions.contains ("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLCHOOSEPIXELFORMATARBPROC, wglChoosePixelFormatARB)) - { - int attributes[64]; - int n = 0; - - attributes[n++] = WGL_DRAW_TO_WINDOW_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_SUPPORT_OPENGL_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_ACCELERATION_ARB; - attributes[n++] = WGL_FULL_ACCELERATION_ARB; - attributes[n++] = WGL_DOUBLE_BUFFER_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_PIXEL_TYPE_ARB; - attributes[n++] = WGL_TYPE_RGBA_ARB; - - attributes[n++] = WGL_COLOR_BITS_ARB; - attributes[n++] = pfd.cColorBits; - attributes[n++] = WGL_RED_BITS_ARB; - attributes[n++] = pixelFormat.redBits; - attributes[n++] = WGL_GREEN_BITS_ARB; - attributes[n++] = pixelFormat.greenBits; - attributes[n++] = WGL_BLUE_BITS_ARB; - attributes[n++] = pixelFormat.blueBits; - attributes[n++] = WGL_ALPHA_BITS_ARB; - attributes[n++] = pixelFormat.alphaBits; - attributes[n++] = WGL_DEPTH_BITS_ARB; - attributes[n++] = pixelFormat.depthBufferBits; - - if (pixelFormat.stencilBufferBits > 0) - { - attributes[n++] = WGL_STENCIL_BITS_ARB; - attributes[n++] = pixelFormat.stencilBufferBits; - } - - attributes[n++] = WGL_ACCUM_RED_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferRedBits; - attributes[n++] = WGL_ACCUM_GREEN_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferGreenBits; - attributes[n++] = WGL_ACCUM_BLUE_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferBlueBits; - attributes[n++] = WGL_ACCUM_ALPHA_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferAlphaBits; - - if (availableExtensions.contains ("WGL_ARB_multisample") - && pixelFormat.fullSceneAntiAliasingNumSamples > 0) - { - attributes[n++] = WGL_SAMPLE_BUFFERS_ARB; - attributes[n++] = 1; - attributes[n++] = WGL_SAMPLES_ARB; - attributes[n++] = pixelFormat.fullSceneAntiAliasingNumSamples; - } - - attributes[n++] = 0; - - UINT formatsCount; - const BOOL ok = wglChoosePixelFormatARB (dc, attributes, 0, 1, &format, &formatsCount); - (void) ok; - jassert (ok); - } - else - { - format = ChoosePixelFormat (dc, &pfd); - } - - if (format != 0) - { - makeInactive(); - - // win32 can't change the pixel format of a window, so need to delete the - // old one and create a new one.. - jassert (nativeWindow != 0); - ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); - delete nativeWindow; - - createNativeWindow(); - - if (SetPixelFormat (dc, format, &pfd)) - { - wglDeleteContext (renderContext); - renderContext = wglCreateContext (dc); - - jassert (renderContext != 0); - return renderContext != 0; - } - } - - return false; - } - - void updateWindowPosition (int x, int y, int w, int h, int) - { - SetWindowPos ((HWND) nativeWindow->getNativeHandle(), 0, - x, y, w, h, - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); - } - - void repaint() - { - int x, y, w, h; - nativeWindow->getBounds (x, y, w, h); - nativeWindow->repaint (0, 0, w, h); - } - - void swapBuffers() - { - SwapBuffers (dc); - } - - bool setSwapInterval (const int numFramesPerSwap) - { - makeActive(); - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0; - - return availableExtensions.contains ("WGL_EXT_swap_control") - && WGL_EXT_FUNCTION_INIT (PFNWGLSWAPINTERVALEXTPROC, wglSwapIntervalEXT) - && wglSwapIntervalEXT (numFramesPerSwap) != FALSE; - } - - int getSwapInterval() const - { - makeActive(); - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0; - - if (availableExtensions.contains ("WGL_EXT_swap_control") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETSWAPINTERVALEXTPROC, wglGetSwapIntervalEXT)) - return wglGetSwapIntervalEXT(); - - return 0; - } - - void findAlternativeOpenGLPixelFormats (OwnedArray & results) - { - jassert (isActive()); - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; - int numTypes = 0; - - if (availableExtensions.contains("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) - { - int attributes = WGL_NUMBER_PIXEL_FORMATS_ARB; - - if (! wglGetPixelFormatAttribivARB (dc, 1, 0, 1, &attributes, &numTypes)) - jassertfalse - } - else - { - numTypes = DescribePixelFormat (dc, 0, 0, 0); - } - - OpenGLPixelFormat pf; - - for (int i = 0; i < numTypes; ++i) - { - if (fillInPixelFormatDetails (i + 1, pf, availableExtensions)) - { - bool alreadyListed = false; - for (int j = results.size(); --j >= 0;) - if (pf == *results.getUnchecked(j)) - alreadyListed = true; - - if (! alreadyListed) - results.add (new OpenGLPixelFormat (pf)); - } - } - } - - //============================================================================== - juce_UseDebuggingNewOperator - - HGLRC renderContext; - -private: - Win32ComponentPeer* nativeWindow; - Component* const component; - HDC dc; - - //============================================================================== - void createNativeWindow() - { - nativeWindow = new Win32ComponentPeer (component, 0); - nativeWindow->dontRepaint = true; - nativeWindow->setVisible (true); - - HWND hwnd = (HWND) nativeWindow->getNativeHandle(); - - Win32ComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); - - if (peer != 0) - { - SetParent (hwnd, (HWND) peer->getNativeHandle()); - juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_CHILD, true); - juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_POPUP, false); - } - - dc = GetDC (hwnd); - } - - bool fillInPixelFormatDetails (const int pixelFormatIndex, - OpenGLPixelFormat& result, - const StringArray& availableExtensions) const throw() - { - PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; - - if (availableExtensions.contains ("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) - { - int attributes[32]; - int numAttributes = 0; - - attributes[numAttributes++] = WGL_DRAW_TO_WINDOW_ARB; - attributes[numAttributes++] = WGL_SUPPORT_OPENGL_ARB; - attributes[numAttributes++] = WGL_ACCELERATION_ARB; - attributes[numAttributes++] = WGL_DOUBLE_BUFFER_ARB; - attributes[numAttributes++] = WGL_PIXEL_TYPE_ARB; - attributes[numAttributes++] = WGL_RED_BITS_ARB; - attributes[numAttributes++] = WGL_GREEN_BITS_ARB; - attributes[numAttributes++] = WGL_BLUE_BITS_ARB; - attributes[numAttributes++] = WGL_ALPHA_BITS_ARB; - attributes[numAttributes++] = WGL_DEPTH_BITS_ARB; - attributes[numAttributes++] = WGL_STENCIL_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_RED_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_GREEN_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_BLUE_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_ALPHA_BITS_ARB; - - if (availableExtensions.contains ("WGL_ARB_multisample")) - attributes[numAttributes++] = WGL_SAMPLES_ARB; - - int values[32]; - zeromem (values, sizeof (values)); - - if (wglGetPixelFormatAttribivARB (dc, pixelFormatIndex, 0, numAttributes, attributes, values)) - { - int n = 0; - bool isValidFormat = (values[n++] == GL_TRUE); // WGL_DRAW_TO_WINDOW_ARB - isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_SUPPORT_OPENGL_ARB - isValidFormat = (values[n++] == WGL_FULL_ACCELERATION_ARB) && isValidFormat; // WGL_ACCELERATION_ARB - isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_DOUBLE_BUFFER_ARB: - isValidFormat = (values[n++] == WGL_TYPE_RGBA_ARB) && isValidFormat; // WGL_PIXEL_TYPE_ARB - result.redBits = values[n++]; // WGL_RED_BITS_ARB - result.greenBits = values[n++]; // WGL_GREEN_BITS_ARB - result.blueBits = values[n++]; // WGL_BLUE_BITS_ARB - result.alphaBits = values[n++]; // WGL_ALPHA_BITS_ARB - result.depthBufferBits = values[n++]; // WGL_DEPTH_BITS_ARB - result.stencilBufferBits = values[n++]; // WGL_STENCIL_BITS_ARB - result.accumulationBufferRedBits = values[n++]; // WGL_ACCUM_RED_BITS_ARB - result.accumulationBufferGreenBits = values[n++]; // WGL_ACCUM_GREEN_BITS_ARB - result.accumulationBufferBlueBits = values[n++]; // WGL_ACCUM_BLUE_BITS_ARB - result.accumulationBufferAlphaBits = values[n++]; // WGL_ACCUM_ALPHA_BITS_ARB - result.fullSceneAntiAliasingNumSamples = values[n++]; // WGL_SAMPLES_ARB - - return isValidFormat; - } - else - { - jassertfalse - } - } - else - { - PIXELFORMATDESCRIPTOR pfd; - - if (DescribePixelFormat (dc, pixelFormatIndex, sizeof (pfd), &pfd)) - { - result.redBits = pfd.cRedBits; - result.greenBits = pfd.cGreenBits; - result.blueBits = pfd.cBlueBits; - result.alphaBits = pfd.cAlphaBits; - result.depthBufferBits = pfd.cDepthBits; - result.stencilBufferBits = pfd.cStencilBits; - result.accumulationBufferRedBits = pfd.cAccumRedBits; - result.accumulationBufferGreenBits = pfd.cAccumGreenBits; - result.accumulationBufferBlueBits = pfd.cAccumBlueBits; - result.accumulationBufferAlphaBits = pfd.cAccumAlphaBits; - result.fullSceneAntiAliasingNumSamples = 0; - - return true; - } - else - { - jassertfalse - } - } - - return false; - } - - WindowedGLContext (const WindowedGLContext&); - const WindowedGLContext& operator= (const WindowedGLContext&); -}; - -//============================================================================== -OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, - const OpenGLPixelFormat& pixelFormat, - const OpenGLContext* const contextToShareWith) -{ - WindowedGLContext* c = new WindowedGLContext (component, - contextToShareWith != 0 ? (HGLRC) contextToShareWith->getRawContext() : 0, - pixelFormat); - - if (c->renderContext == 0) - deleteAndZero (c); - - return c; -} - -void juce_glViewport (const int w, const int h) -{ - glViewport (0, 0, w, h); -} - -void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, - OwnedArray & results) -{ - Component tempComp; - - { - WindowedGLContext wc (component, 0, OpenGLPixelFormat (8, 8, 16, 0)); - wc.makeActive(); - wc.findAlternativeOpenGLPixelFormats (results); - } -} - #endif - - -//============================================================================== -//============================================================================== -class JuceIStorage : public IStorage -{ - int refCount; - -public: - JuceIStorage() : refCount (1) {} - - virtual ~JuceIStorage() - { - jassert (refCount == 0); - } - - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IStorage) - { - AddRef(); - *result = this; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall CreateStream (const WCHAR*, DWORD, DWORD, DWORD, IStream**) { return E_NOTIMPL; } - HRESULT __stdcall OpenStream (const WCHAR*, void*, DWORD, DWORD, IStream**) { return E_NOTIMPL; } - HRESULT __stdcall CreateStorage (const WCHAR*, DWORD, DWORD, DWORD, IStorage**) { return E_NOTIMPL; } - HRESULT __stdcall OpenStorage (const WCHAR*, IStorage*, DWORD, SNB, DWORD, IStorage**) { return E_NOTIMPL; } - HRESULT __stdcall CopyTo (DWORD, IID const*, SNB, IStorage*) { return E_NOTIMPL; } - HRESULT __stdcall MoveElementTo (const OLECHAR*,IStorage*, const OLECHAR*, DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Commit (DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Revert() { return E_NOTIMPL; } - HRESULT __stdcall EnumElements (DWORD, void*, DWORD, IEnumSTATSTG**) { return E_NOTIMPL; } - HRESULT __stdcall DestroyElement (const OLECHAR*) { return E_NOTIMPL; } - HRESULT __stdcall RenameElement (const WCHAR*, const WCHAR*) { return E_NOTIMPL; } - HRESULT __stdcall SetElementTimes (const WCHAR*, FILETIME const*, FILETIME const*, FILETIME const*) { return E_NOTIMPL; } - HRESULT __stdcall SetClass (REFCLSID) { return S_OK; } - HRESULT __stdcall SetStateBits (DWORD, DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Stat (STATSTG*, DWORD) { return E_NOTIMPL; } - - juce_UseDebuggingNewOperator -}; - - -class JuceOleInPlaceFrame : public IOleInPlaceFrame -{ - int refCount; - HWND window; - -public: - JuceOleInPlaceFrame (HWND window_) - : refCount (1), - window (window_) - { - } - - virtual ~JuceOleInPlaceFrame() - { - jassert (refCount == 0); - } - - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IOleInPlaceFrame) - { - AddRef(); - *result = this; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } - HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall GetBorder (LPRECT) { return E_NOTIMPL; } - HRESULT __stdcall RequestBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetActiveObject (IOleInPlaceActiveObject*, LPCOLESTR) { return S_OK; } - HRESULT __stdcall InsertMenus (HMENU, LPOLEMENUGROUPWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetMenu (HMENU, HOLEMENU, HWND) { return S_OK; } - HRESULT __stdcall RemoveMenus (HMENU) { return E_NOTIMPL; } - HRESULT __stdcall SetStatusText (LPCOLESTR) { return S_OK; } - HRESULT __stdcall EnableModeless (BOOL) { return S_OK; } - HRESULT __stdcall TranslateAccelerator(LPMSG, WORD) { return E_NOTIMPL; } - - juce_UseDebuggingNewOperator -}; - - -class JuceIOleInPlaceSite : public IOleInPlaceSite -{ - int refCount; - HWND window; - JuceOleInPlaceFrame* frame; - -public: - JuceIOleInPlaceSite (HWND window_) - : refCount (1), - window (window_) - { - frame = new JuceOleInPlaceFrame (window); - } - - virtual ~JuceIOleInPlaceSite() - { - jassert (refCount == 0); - frame->Release(); - } - - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IOleInPlaceSite) - { - AddRef(); - *result = this; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } - HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall CanInPlaceActivate() { return S_OK; } - HRESULT __stdcall OnInPlaceActivate() { return S_OK; } - HRESULT __stdcall OnUIActivate() { return S_OK; } - - HRESULT __stdcall GetWindowContext (LPOLEINPLACEFRAME* lplpFrame, LPOLEINPLACEUIWINDOW* lplpDoc, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO lpFrameInfo) - { - frame->AddRef(); - *lplpFrame = frame; - *lplpDoc = 0; - lpFrameInfo->fMDIApp = FALSE; - lpFrameInfo->hwndFrame = window; - lpFrameInfo->haccel = 0; - lpFrameInfo->cAccelEntries = 0; - return S_OK; - } - - HRESULT __stdcall Scroll (SIZE) { return E_NOTIMPL; } - HRESULT __stdcall OnUIDeactivate (BOOL) { return S_OK; } - HRESULT __stdcall OnInPlaceDeactivate() { return S_OK; } - HRESULT __stdcall DiscardUndoState() { return E_NOTIMPL; } - HRESULT __stdcall DeactivateAndUndo() { return E_NOTIMPL; } - HRESULT __stdcall OnPosRectChange (LPCRECT) { return S_OK; } - - juce_UseDebuggingNewOperator -}; - - -class JuceIOleClientSite : public IOleClientSite -{ - int refCount; - JuceIOleInPlaceSite* inplaceSite; - -public: - JuceIOleClientSite (HWND window) - : refCount (1) - { - inplaceSite = new JuceIOleInPlaceSite (window); - } - - virtual ~JuceIOleClientSite() - { - jassert (refCount == 0); - inplaceSite->Release(); - } - - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IOleClientSite) - { - AddRef(); - *result = this; - return S_OK; - } - else if (id == IID_IOleInPlaceSite) - { - inplaceSite->AddRef(); - *result = inplaceSite; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall SaveObject() { return E_NOTIMPL; } - HRESULT __stdcall GetMoniker (DWORD, DWORD, IMoniker**) { return E_NOTIMPL; } - HRESULT __stdcall GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = 0; return E_NOINTERFACE; } - HRESULT __stdcall ShowObject() { return S_OK; } - HRESULT __stdcall OnShowWindow (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall RequestNewObjectLayout() { return E_NOTIMPL; } - - juce_UseDebuggingNewOperator -}; - -//============================================================================== -class ActiveXControlData : public ComponentMovementWatcher -{ - ActiveXControlComponent* const owner; - bool wasShowing; - -public: - HWND controlHWND; - IStorage* storage; - IOleClientSite* clientSite; - IOleObject* control; - - //============================================================================== - ActiveXControlData (HWND hwnd, - ActiveXControlComponent* const owner_) - : ComponentMovementWatcher (owner_), - owner (owner_), - wasShowing (owner_ != 0 && owner_->isShowing()), - controlHWND (0), - storage (new JuceIStorage()), - clientSite (new JuceIOleClientSite (hwnd)), - control (0) - { - } - - ~ActiveXControlData() - { - if (control != 0) - { - control->Close (OLECLOSE_NOSAVE); - control->Release(); - } - - clientSite->Release(); - storage->Release(); - } - - //============================================================================== - void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) - { - Component* const topComp = owner->getTopLevelComponent(); - - if (topComp->getPeer() != 0) - { - int x = 0, y = 0; - owner->relativePositionToOtherComponent (topComp, x, y); - - owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); - } - } - - void componentPeerChanged() - { - const bool isShowingNow = owner->isShowing(); - - if (wasShowing != isShowingNow) - { - wasShowing = isShowingNow; - - owner->setControlVisible (isShowingNow); - } - } - - void componentVisibilityChanged (Component&) - { - componentPeerChanged(); - } - - static bool doesWindowMatch (const ActiveXControlComponent* const ax, HWND hwnd) - { - return ((ActiveXControlData*) ax->control) != 0 - && ((ActiveXControlData*) ax->control)->controlHWND == hwnd; - } -}; - -//============================================================================== -static VoidArray activeXComps; - -static HWND getHWND (const ActiveXControlComponent* const component) -{ - HWND hwnd = 0; - - const IID iid = IID_IOleWindow; - IOleWindow* const window = (IOleWindow*) component->queryInterface (&iid); - - if (window != 0) - { - window->GetWindow (&hwnd); - window->Release(); - } - - return hwnd; -} - -static void offerActiveXMouseEventToPeer (ComponentPeer* const peer, HWND hwnd, UINT message, LPARAM lParam) -{ - RECT activeXRect, peerRect; - GetWindowRect (hwnd, &activeXRect); - GetWindowRect ((HWND) peer->getNativeHandle(), &peerRect); - - const int mx = GET_X_LPARAM (lParam) + activeXRect.left - peerRect.left; - const int my = GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top; - const int64 mouseEventTime = getMouseEventTime(); - - const int oldModifiers = currentModifiers; - ModifierKeys::getCurrentModifiersRealtime(); // to update the mouse button flags - - switch (message) - { - case WM_MOUSEMOVE: - if (ModifierKeys (currentModifiers).isAnyMouseButtonDown()) - peer->handleMouseDrag (mx, my, mouseEventTime); - else - peer->handleMouseMove (mx, my, mouseEventTime); - break; - - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - peer->handleMouseDown (mx, my, mouseEventTime); - break; - - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - peer->handleMouseUp (oldModifiers, mx, my, mouseEventTime); - break; - - default: - break; - } -} - -// intercepts events going to an activeX control, so we can sneakily use the mouse events -static LRESULT CALLBACK activeXHookWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - for (int i = activeXComps.size(); --i >= 0;) - { - const ActiveXControlComponent* const ax = (const ActiveXControlComponent*) activeXComps.getUnchecked(i); - - if (ActiveXControlData::doesWindowMatch (ax, hwnd)) - { - switch (message) - { - case WM_MOUSEMOVE: - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - case WM_LBUTTONDBLCLK: - case WM_MBUTTONDBLCLK: - case WM_RBUTTONDBLCLK: - if (ax->isShowing()) - { - ComponentPeer* const peer = ax->getPeer(); - - if (peer != 0) - { - offerActiveXMouseEventToPeer (peer, hwnd, message, lParam); - - if (! ax->areMouseEventsAllowed()) - return 0; - } - } - break; - - default: - break; - } - - return CallWindowProc ((WNDPROC) (ax->originalWndProc), hwnd, message, wParam, lParam); - } - } - - return DefWindowProc (hwnd, message, wParam, lParam); -} - -ActiveXControlComponent::ActiveXControlComponent() - : originalWndProc (0), - control (0), - mouseEventsAllowed (true) -{ - activeXComps.add (this); -} - -ActiveXControlComponent::~ActiveXControlComponent() -{ - deleteControl(); - activeXComps.removeValue (this); -} - -void ActiveXControlComponent::paint (Graphics& g) -{ - if (control == 0) - g.fillAll (Colours::lightgrey); -} - -bool ActiveXControlComponent::createControl (const void* controlIID) -{ - deleteControl(); - ComponentPeer* const peer = getPeer(); - - // the component must have already been added to a real window when you call this! - jassert (dynamic_cast (peer) != 0); - - if (dynamic_cast (peer) != 0) - { - int x = 0, y = 0; - relativePositionToOtherComponent (getTopLevelComponent(), x, y); - - HWND hwnd = (HWND) peer->getNativeHandle(); - - ActiveXControlData* const info = new ActiveXControlData (hwnd, this); - - HRESULT hr; - if ((hr = OleCreate (*(const IID*) controlIID, IID_IOleObject, 1 /*OLERENDER_DRAW*/, 0, - info->clientSite, info->storage, - (void**) &(info->control))) == S_OK) - { - info->control->SetHostNames (L"Juce", 0); - - if (OleSetContainedObject (info->control, TRUE) == S_OK) - { - RECT rect; - rect.left = x; - rect.top = y; - rect.right = x + getWidth(); - rect.bottom = y + getHeight(); - - if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) - { - control = info; - setControlBounds (Rectangle (x, y, getWidth(), getHeight())); - - info->controlHWND = getHWND (this); - - if (info->controlHWND != 0) - { - originalWndProc = (void*) GetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC); - SetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); - } - - return true; - } - } - } - - delete info; - } - - return false; -} - -void ActiveXControlComponent::deleteControl() -{ - ActiveXControlData* const info = (ActiveXControlData*) control; - - if (info != 0) - { - delete info; - control = 0; - originalWndProc = 0; - } -} - -void* ActiveXControlComponent::queryInterface (const void* iid) const -{ - ActiveXControlData* const info = (ActiveXControlData*) control; - - void* result = 0; - - if (info != 0 && info->control != 0 - && info->control->QueryInterface (*(const IID*) iid, &result) == S_OK) - return result; - - return 0; -} - -void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const -{ - HWND hwnd = ((ActiveXControlData*) control)->controlHWND; - - if (hwnd != 0) - MoveWindow (hwnd, newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight(), TRUE); -} - -void ActiveXControlComponent::setControlVisible (const bool shouldBeVisible) const -{ - HWND hwnd = ((ActiveXControlData*) control)->controlHWND; - - if (hwnd != 0) - ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); -} - -void ActiveXControlComponent::setMouseEventsAllowed (const bool eventsCanReachControl) -{ - mouseEventsAllowed = eventsCanReachControl; -} - - -END_JUCE_NAMESPACE diff --git a/build/win32/vc8/JUCE.vcproj b/build/win32/vc8/JUCE.vcproj index 8119180fd8..018bd901cf 100644 --- a/build/win32/vc8/JUCE.vcproj +++ b/build/win32/vc8/JUCE.vcproj @@ -3638,10 +3638,6 @@ RelativePath="..\..\..\src\juce_appframework\gui\components\special\juce_PreferencesPanel.h" > - - @@ -5673,6 +5669,10 @@ + + @@ -5717,14 +5717,30 @@ RelativePath="..\platform_specific_code\juce_win32_Misc.cpp" > + + + + + + + + diff --git a/extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj b/extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj index cf20302b8f..0bbabb651d 100644 --- a/extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj +++ b/extras/audio plugin host/build/mac/PluginHost.xcodeproj/project.pbxproj @@ -8,20 +8,18 @@ /* Begin PBXBuildFile section */ 84B59D6D0DE34F530041FA3D /* juce_LibrarySource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84B59D6C0DE34F530041FA3D /* juce_LibrarySource.mm */; }; - 84C0A38F0DE2D5C700606895 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3810DE2D5C700606895 /* AGL.framework */; }; - 84C0A3900DE2D5C700606895 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3820DE2D5C700606895 /* ApplicationServices.framework */; }; 84C0A3910DE2D5C700606895 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3830DE2D5C700606895 /* AudioUnit.framework */; }; - 84C0A3920DE2D5C700606895 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3840DE2D5C700606895 /* Carbon.framework */; }; 84C0A3930DE2D5C700606895 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3850DE2D5C700606895 /* Cocoa.framework */; }; 84C0A3940DE2D5C700606895 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3860DE2D5C700606895 /* CoreAudio.framework */; }; - 84C0A3950DE2D5C700606895 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3870DE2D5C700606895 /* CoreFoundation.framework */; }; 84C0A3960DE2D5C700606895 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3880DE2D5C700606895 /* CoreMIDI.framework */; }; 84C0A3970DE2D5C700606895 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3890DE2D5C700606895 /* CoreServices.framework */; }; 84C0A3980DE2D5C700606895 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A38A0DE2D5C700606895 /* DiscRecording.framework */; }; 84C0A3990DE2D5C700606895 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A38B0DE2D5C700606895 /* IOKit.framework */; }; 84C0A39A0DE2D5C700606895 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A38C0DE2D5C700606895 /* OpenGL.framework */; }; - 84C0A39B0DE2D5C700606895 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A38D0DE2D5C700606895 /* QuickTime.framework */; }; 84C0A39C0DE2D5C700606895 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A38E0DE2D5C700606895 /* WebKit.framework */; }; + 84D16CFE0E9A58CA00CB8B94 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D16CFD0E9A58CA00CB8B94 /* QTKit.framework */; }; + 84F6F6160E8EDA7100AA911A /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F6F6150E8EDA7100AA911A /* Carbon.framework */; }; + 84F8B6D70EB5FEF70020D98D /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F8B6D60EB5FEF70020D98D /* QuickTime.framework */; }; 84FC4CD90CD8894600850651 /* juce.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 84FC4CD80CD8894600850651 /* juce.xcconfig */; }; 84FFAEAC0C6C8A6F009F6E72 /* FilterGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */; }; 84FFAEAD0C6C8A6F009F6E72 /* GraphEditorPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FFAE940C6C8A6F009F6E72 /* GraphEditorPanel.cpp */; }; @@ -35,20 +33,18 @@ 84B59D6A0DE34F530041FA3D /* includes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = includes.h; path = ../../src/includes.h; sourceTree = SOURCE_ROOT; }; 84B59D6B0DE34F530041FA3D /* juce_AppConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_AppConfig.h; path = ../../src/juce_AppConfig.h; sourceTree = SOURCE_ROOT; }; 84B59D6C0DE34F530041FA3D /* juce_LibrarySource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_LibrarySource.mm; path = ../../src/juce_LibrarySource.mm; sourceTree = SOURCE_ROOT; }; - 84C0A3810DE2D5C700606895 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; - 84C0A3820DE2D5C700606895 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 84C0A3830DE2D5C700606895 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - 84C0A3840DE2D5C700606895 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 84C0A3850DE2D5C700606895 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 84C0A3860DE2D5C700606895 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; - 84C0A3870DE2D5C700606895 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 84C0A3880DE2D5C700606895 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = ""; }; 84C0A3890DE2D5C700606895 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 84C0A38A0DE2D5C700606895 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; 84C0A38B0DE2D5C700606895 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 84C0A38C0DE2D5C700606895 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 84C0A38D0DE2D5C700606895 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 84C0A38E0DE2D5C700606895 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 84D16CFD0E9A58CA00CB8B94 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; + 84F6F6150E8EDA7100AA911A /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 84F8B6D60EB5FEF70020D98D /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 84FC4CD80CD8894600850651 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; 84FFAE920C6C8A6F009F6E72 /* FilterGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FilterGraph.cpp; path = ../../src/host/FilterGraph.cpp; sourceTree = SOURCE_ROOT; }; 84FFAE930C6C8A6F009F6E72 /* FilterGraph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilterGraph.h; path = ../../src/host/FilterGraph.h; sourceTree = SOURCE_ROOT; }; @@ -59,7 +55,7 @@ 84FFAE980C6C8A6F009F6E72 /* MainHostWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MainHostWindow.cpp; path = ../../src/host/MainHostWindow.cpp; sourceTree = SOURCE_ROOT; }; 84FFAE990C6C8A6F009F6E72 /* MainHostWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MainHostWindow.h; path = ../../src/host/MainHostWindow.h; sourceTree = SOURCE_ROOT; }; 84FFAE9A0C6C8A6F009F6E72 /* HostStartup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = HostStartup.cpp; path = ../../src/HostStartup.cpp; sourceTree = SOURCE_ROOT; }; - 8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; + 8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -67,20 +63,18 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 84C0A38F0DE2D5C700606895 /* AGL.framework in Frameworks */, - 84C0A3900DE2D5C700606895 /* ApplicationServices.framework in Frameworks */, 84C0A3910DE2D5C700606895 /* AudioUnit.framework in Frameworks */, - 84C0A3920DE2D5C700606895 /* Carbon.framework in Frameworks */, 84C0A3930DE2D5C700606895 /* Cocoa.framework in Frameworks */, 84C0A3940DE2D5C700606895 /* CoreAudio.framework in Frameworks */, - 84C0A3950DE2D5C700606895 /* CoreFoundation.framework in Frameworks */, 84C0A3960DE2D5C700606895 /* CoreMIDI.framework in Frameworks */, 84C0A3970DE2D5C700606895 /* CoreServices.framework in Frameworks */, 84C0A3980DE2D5C700606895 /* DiscRecording.framework in Frameworks */, 84C0A3990DE2D5C700606895 /* IOKit.framework in Frameworks */, 84C0A39A0DE2D5C700606895 /* OpenGL.framework in Frameworks */, - 84C0A39B0DE2D5C700606895 /* QuickTime.framework in Frameworks */, 84C0A39C0DE2D5C700606895 /* WebKit.framework in Frameworks */, + 84F6F6160E8EDA7100AA911A /* Carbon.framework in Frameworks */, + 84D16CFE0E9A58CA00CB8B94 /* QTKit.framework in Frameworks */, + 84F8B6D70EB5FEF70020D98D /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,19 +131,17 @@ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 84C0A3810DE2D5C700606895 /* AGL.framework */, - 84C0A3820DE2D5C700606895 /* ApplicationServices.framework */, + 84F6F6150E8EDA7100AA911A /* Carbon.framework */, 84C0A3830DE2D5C700606895 /* AudioUnit.framework */, - 84C0A3840DE2D5C700606895 /* Carbon.framework */, 84C0A3850DE2D5C700606895 /* Cocoa.framework */, 84C0A3860DE2D5C700606895 /* CoreAudio.framework */, - 84C0A3870DE2D5C700606895 /* CoreFoundation.framework */, 84C0A3880DE2D5C700606895 /* CoreMIDI.framework */, 84C0A3890DE2D5C700606895 /* CoreServices.framework */, 84C0A38A0DE2D5C700606895 /* DiscRecording.framework */, 84C0A38B0DE2D5C700606895 /* IOKit.framework */, + 84F8B6D60EB5FEF70020D98D /* QuickTime.framework */, 84C0A38C0DE2D5C700606895 /* OpenGL.framework */, - 84C0A38D0DE2D5C700606895 /* QuickTime.framework */, + 84D16CFD0E9A58CA00CB8B94 /* QTKit.framework */, 84C0A38E0DE2D5C700606895 /* WebKit.framework */, ); name = "External Frameworks and Libraries"; @@ -225,6 +217,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; + KEEP_PRIVATE_EXTERNS = YES; + STRIP_INSTALLED_PRODUCT = YES; }; name = Debug; }; diff --git a/extras/audio plugin host/src/HostStartup.cpp b/extras/audio plugin host/src/HostStartup.cpp index 7bcb493ff2..4ac0fe1032 100644 --- a/extras/audio plugin host/src/HostStartup.cpp +++ b/extras/audio plugin host/src/HostStartup.cpp @@ -75,6 +75,8 @@ public: commandManager->registerAllCommandsForTarget (this); commandManager->registerAllCommandsForTarget (mainWindow); + + mainWindow->menuItemsChanged(); } void shutdown() diff --git a/extras/audio plugin host/src/host/MainHostWindow.cpp b/extras/audio plugin host/src/host/MainHostWindow.cpp index 0fc3891af1..d30236f2fc 100644 --- a/extras/audio plugin host/src/host/MainHostWindow.cpp +++ b/extras/audio plugin host/src/host/MainHostWindow.cpp @@ -100,12 +100,6 @@ MainHostWindow::MainHostWindow() restoreWindowStateFromString (ApplicationProperties::getInstance()->getUserSettings()->getValue ("mainWindowPos")); -#if JUCE_MAC - setMacMainMenu (this); -#else - setMenuBar (this); -#endif - setVisible (true); InternalPluginFormat internalFormat; @@ -129,6 +123,12 @@ MainHostWindow::MainHostWindow() addKeyListener (commandManager->getKeyMappings()); Process::setPriority (Process::HighPriority); + +#if JUCE_MAC + setMacMainMenu (this); +#else + setMenuBar (this); +#endif } MainHostWindow::~MainHostWindow() @@ -441,7 +441,7 @@ void MainHostWindow::showAudioSettings() AudioDeviceSelectorComponent audioSettingsComp (deviceManager, 0, 256, 0, 256, - true, true, true); + true, true, true, false); audioSettingsComp.setSize (500, 450); diff --git a/extras/audio plugin host/src/includes.h b/extras/audio plugin host/src/includes.h index f8cbcf733c..d16e4ab20c 100644 --- a/extras/audio plugin host/src/includes.h +++ b/extras/audio plugin host/src/includes.h @@ -1,5 +1,6 @@ #include "juce_AppConfig.h" -#include "../../../juce_amalgamated.h" +//#include "../../../juce_amalgamated.h" +#include "../../../juce.h" using JUCE_NAMESPACE::uint32; diff --git a/extras/audio plugins/demo/build/AudioUnit/JuceAU.exp b/extras/audio plugins/demo/build/AudioUnit/JuceAU.exp index 60e62a5185..dbc8e0c0e9 100644 --- a/extras/audio plugins/demo/build/AudioUnit/JuceAU.exp +++ b/extras/audio plugins/demo/build/AudioUnit/JuceAU.exp @@ -1,9 +1,8 @@ -# -# This file must contain entries for the two AU entry points. -# -# Your JucePluginCharacteristics.h file must define the prefix used for these function names - for -# more info, see the comments in JucePluginCharacteristics.h -# - -_JuceDemoAUEntry -_JuceDemoAUViewEntry +# +# This file must contain the AU component's entry point. +# +# Your JucePluginCharacteristics.h file must define the prefix used for this +# function name - for more info, see the comments in JucePluginCharacteristics.h +# + +_JuceDemoAUEntry diff --git a/extras/audio plugins/demo/build/AudioUnit/JuceDemoAU.xcodeproj/project.pbxproj b/extras/audio plugins/demo/build/AudioUnit/JuceDemoAU.xcodeproj/project.pbxproj index a1f36f846c..f286beb687 100644 --- a/extras/audio plugins/demo/build/AudioUnit/JuceDemoAU.xcodeproj/project.pbxproj +++ b/extras/audio plugins/demo/build/AudioUnit/JuceDemoAU.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 3E8BF11A079CA60300021B09 /* AUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D19A0E03175E1E01CA2136 /* AUBuffer.cpp */; }; 3E8BF11B079CA60300021B09 /* CAAudioChannelLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7967EF8B04D70E7C00C625F7 /* CAAudioChannelLayout.cpp */; }; 3E8BF11C079CA60300021B09 /* CAStreamBasicDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7967EF8D04D70E7C00C625F7 /* CAStreamBasicDescription.cpp */; }; + 840BE1CD0EACFEC400824B1D /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840BE1CC0EACFEC400824B1D /* QTKit.framework */; }; 84581F8F0D917FC700AE1A4C /* AUBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84581F820D917FC700AE1A4C /* AUBase.cpp */; }; 84581F900D917FC700AE1A4C /* AUBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 84581F830D917FC700AE1A4C /* AUBase.h */; }; 84581F910D917FC700AE1A4C /* AUDispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84581F840D917FC700AE1A4C /* AUDispatch.cpp */; }; @@ -27,11 +28,11 @@ 84581F990D917FC700AE1A4C /* AUScopeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 84581F8C0D917FC700AE1A4C /* AUScopeElement.h */; }; 84581F9A0D917FC700AE1A4C /* ComponentBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84581F8D0D917FC700AE1A4C /* ComponentBase.cpp */; }; 84581F9B0D917FC700AE1A4C /* ComponentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 84581F8E0D917FC700AE1A4C /* ComponentBase.h */; }; + 846EC62C0EB601D80080CCFF /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846EC62B0EB601D80080CCFF /* QuickTime.framework */; }; 84B4CDD10C7DD23B0083122F /* MusicDeviceBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84B4CDCF0C7DD23B0083122F /* MusicDeviceBase.cpp */; }; 84B4CDD20C7DD23B0083122F /* MusicDeviceBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B4CDD00C7DD23B0083122F /* MusicDeviceBase.h */; }; 84C09D2A0DE2C52600606895 /* includes.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C09D290DE2C52600606895 /* includes.h */; }; 84C09D3F0DE2C57300606895 /* juce_amalgamated.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84C09D3E0DE2C57300606895 /* juce_amalgamated.mm */; }; - 84C0A2A10DE2C7BD00606895 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2930DE2C7BD00606895 /* AGL.framework */; }; 84C0A2A20DE2C7BD00606895 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2940DE2C7BD00606895 /* ApplicationServices.framework */; }; 84C0A2A30DE2C7BD00606895 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2950DE2C7BD00606895 /* AudioUnit.framework */; }; 84C0A2A40DE2C7BD00606895 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2960DE2C7BD00606895 /* Carbon.framework */; }; @@ -43,16 +44,11 @@ 84C0A2AA0DE2C7BD00606895 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A29C0DE2C7BD00606895 /* DiscRecording.framework */; }; 84C0A2AB0DE2C7BD00606895 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A29D0DE2C7BD00606895 /* IOKit.framework */; }; 84C0A2AC0DE2C7BD00606895 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A29E0DE2C7BD00606895 /* OpenGL.framework */; }; - 84C0A2AD0DE2C7BD00606895 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A29F0DE2C7BD00606895 /* QuickTime.framework */; }; 84C0A2AE0DE2C7BD00606895 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2A00DE2C7BD00606895 /* WebKit.framework */; }; 84C0A2B30DE2C80200606895 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2B20DE2C80200606895 /* AudioToolbox.framework */; }; - 84CFAEFB090964560053C22C /* AUCarbonViewDispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D19AAB03175F3201CA2136 /* AUCarbonViewDispatch.cpp */; }; - 84CFAEFC090964560053C22C /* AUCarbonViewControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D19AA903175F3201CA2136 /* AUCarbonViewControl.cpp */; }; - 84CFAEFD090964560053C22C /* AUCarbonViewBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D19AA703175F3201CA2136 /* AUCarbonViewBase.cpp */; }; - 84CFAF0E090965080053C22C /* CarbonEventHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D19AB003175F3201CA2136 /* CarbonEventHandler.cpp */; }; 84CFAF10090965080053C22C /* CAAUParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EF64FA42057BC39200D99563 /* CAAUParameter.cpp */; }; 84CFB029090968590053C22C /* DemoJuceAudioUnit.component in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3E8BF126079CA60300021B09 /* DemoJuceAudioUnit.component */; }; - 84EB400B090A4A2C008FAC1B /* juce_AudioUnitWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.cpp */; }; + 84EB400B090A4A2C008FAC1B /* juce_AudioUnitWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.mm */; }; 84EB400C090A4A2C008FAC1B /* juce_AudioUnitWrapper.r in Rez */ = {isa = PBXBuildFile; fileRef = 84EB400A090A4A2C008FAC1B /* juce_AudioUnitWrapper.r */; }; 84EB4042090A4F5A008FAC1B /* CAVectorUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4E5DC280898301D00589A5A /* CAVectorUnit.cpp */; }; 84EB404E090A5116008FAC1B /* JucePluginCharacteristics.h in Headers */ = {isa = PBXBuildFile; fileRef = 84EB404D090A5116008FAC1B /* JucePluginCharacteristics.h */; }; @@ -88,6 +84,7 @@ 7967EF8B04D70E7C00C625F7 /* CAAudioChannelLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAAudioChannelLayout.cpp; sourceTree = ""; }; 7967EF8C04D70E7C00C625F7 /* CAAudioChannelLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAAudioChannelLayout.h; sourceTree = ""; }; 7967EF8D04D70E7C00C625F7 /* CAStreamBasicDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CAStreamBasicDescription.cpp; sourceTree = ""; }; + 840BE1CC0EACFEC400824B1D /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 84581F820D917FC700AE1A4C /* AUBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp; sourceTree = ""; }; 84581F830D917FC700AE1A4C /* AUBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h; sourceTree = ""; }; 84581F840D917FC700AE1A4C /* AUDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUDispatch.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp; sourceTree = ""; }; @@ -101,11 +98,11 @@ 84581F8D0D917FC700AE1A4C /* ComponentBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ComponentBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp; sourceTree = ""; }; 84581F8E0D917FC700AE1A4C /* ComponentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ComponentBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h; sourceTree = ""; }; 845FAE5E0A5C0A6A008C94D8 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; + 846EC62B0EB601D80080CCFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 84B4CDCF0C7DD23B0083122F /* MusicDeviceBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MusicDeviceBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp; sourceTree = ""; }; 84B4CDD00C7DD23B0083122F /* MusicDeviceBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MusicDeviceBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h; sourceTree = ""; }; 84C09D290DE2C52600606895 /* includes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = includes.h; path = ../../src/includes.h; sourceTree = SOURCE_ROOT; }; 84C09D3E0DE2C57300606895 /* juce_amalgamated.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_amalgamated.mm; path = ../../../../../juce_amalgamated.mm; sourceTree = SOURCE_ROOT; }; - 84C0A2930DE2C7BD00606895 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 84C0A2940DE2C7BD00606895 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 84C0A2950DE2C7BD00606895 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; 84C0A2960DE2C7BD00606895 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; @@ -117,13 +114,12 @@ 84C0A29C0DE2C7BD00606895 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; 84C0A29D0DE2C7BD00606895 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 84C0A29E0DE2C7BD00606895 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 84C0A29F0DE2C7BD00606895 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 84C0A2A00DE2C7BD00606895 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; 84C0A2B20DE2C80200606895 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; - 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_AudioUnitWrapper.cpp; path = ../../../wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp; sourceTree = SOURCE_ROOT; }; + 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 2; name = juce_AudioUnitWrapper.mm; path = ../../../wrapper/formats/AudioUnit/juce_AudioUnitWrapper.mm; sourceTree = SOURCE_ROOT; }; 84EB400A090A4A2C008FAC1B /* juce_AudioUnitWrapper.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = juce_AudioUnitWrapper.r; path = ../../../wrapper/formats/AudioUnit/juce_AudioUnitWrapper.r; sourceTree = SOURCE_ROOT; }; 84EB404D090A5116008FAC1B /* JucePluginCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JucePluginCharacteristics.h; path = ../../src/JucePluginCharacteristics.h; sourceTree = SOURCE_ROOT; }; - 84F05215090674BB00AEC8DB /* Info-JuceAU.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Info-JuceAU.plist"; sourceTree = ""; }; + 84F05215090674BB00AEC8DB /* Info-JuceAU.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "Info-JuceAU.plist"; sourceTree = ""; }; 84F05217090674BB00AEC8DB /* JuceAU.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = JuceAU.exp; sourceTree = ""; }; 84F054E40906C8DD00AEC8DB /* AUMIDIBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AUMIDIBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp; sourceTree = ""; }; 84F054E50906C8DD00AEC8DB /* AUMIDIBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AUMIDIBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h; sourceTree = ""; }; @@ -146,13 +142,6 @@ F5D19A0E03175E1E01CA2136 /* AUBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AUBuffer.cpp; sourceTree = ""; }; F5D19A0F03175E1E01CA2136 /* AUBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AUBuffer.h; sourceTree = ""; }; F5D19A6903175E8C01CA2136 /* CAStreamBasicDescription.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CAStreamBasicDescription.h; sourceTree = ""; }; - F5D19AA703175F3201CA2136 /* AUCarbonViewBase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AUCarbonViewBase.cpp; sourceTree = ""; }; - F5D19AA803175F3201CA2136 /* AUCarbonViewBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AUCarbonViewBase.h; sourceTree = ""; }; - F5D19AA903175F3201CA2136 /* AUCarbonViewControl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AUCarbonViewControl.cpp; sourceTree = ""; }; - F5D19AAA03175F3201CA2136 /* AUCarbonViewControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AUCarbonViewControl.h; sourceTree = ""; }; - F5D19AAB03175F3201CA2136 /* AUCarbonViewDispatch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AUCarbonViewDispatch.cpp; sourceTree = ""; }; - F5D19AB003175F3201CA2136 /* CarbonEventHandler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CarbonEventHandler.cpp; sourceTree = ""; }; - F5D19AB103175F3201CA2136 /* CarbonEventHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarbonEventHandler.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -160,7 +149,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 84C0A2A10DE2C7BD00606895 /* AGL.framework in Frameworks */, 84C0A2A20DE2C7BD00606895 /* ApplicationServices.framework in Frameworks */, 84C0A2A30DE2C7BD00606895 /* AudioUnit.framework in Frameworks */, 84C0A2A40DE2C7BD00606895 /* Carbon.framework in Frameworks */, @@ -172,9 +160,10 @@ 84C0A2AA0DE2C7BD00606895 /* DiscRecording.framework in Frameworks */, 84C0A2AB0DE2C7BD00606895 /* IOKit.framework in Frameworks */, 84C0A2AC0DE2C7BD00606895 /* OpenGL.framework in Frameworks */, - 84C0A2AD0DE2C7BD00606895 /* QuickTime.framework in Frameworks */, 84C0A2AE0DE2C7BD00606895 /* WebKit.framework in Frameworks */, 84C0A2B30DE2C80200606895 /* AudioToolbox.framework in Frameworks */, + 840BE1CD0EACFEC400824B1D /* QTKit.framework in Frameworks */, + 846EC62C0EB601D80080CCFF /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -184,7 +173,7 @@ 84EB403B090A4ED3008FAC1B /* Juce AU Code */ = { isa = PBXGroup; children = ( - 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.cpp */, + 84EB4009090A4A2C008FAC1B /* juce_AudioUnitWrapper.mm */, 84EB400A090A4A2C008FAC1B /* juce_AudioUnitWrapper.r */, ); name = "Juce AU Code"; @@ -246,7 +235,6 @@ children = ( F5D199EB03175E1E01CA2136 /* AUBase */, A3C2CC6005B4A4BE000F141E /* AUViewBase */, - F5D19AA603175F3201CA2136 /* AUCarbonViewBase */, F5D199FD03175E1E01CA2136 /* OtherBases */, F5D19A0C03175E1E01CA2136 /* Utility */, F5D19A3603175E8C01CA2136 /* PublicUtility */, @@ -259,7 +247,6 @@ isa = PBXGroup; children = ( 84C0A2B20DE2C80200606895 /* AudioToolbox.framework */, - 84C0A2930DE2C7BD00606895 /* AGL.framework */, 84C0A2940DE2C7BD00606895 /* ApplicationServices.framework */, 84C0A2950DE2C7BD00606895 /* AudioUnit.framework */, 84C0A2960DE2C7BD00606895 /* Carbon.framework */, @@ -269,9 +256,10 @@ 84C0A29A0DE2C7BD00606895 /* CoreMIDI.framework */, 84C0A29B0DE2C7BD00606895 /* CoreServices.framework */, 84C0A29C0DE2C7BD00606895 /* DiscRecording.framework */, + 840BE1CC0EACFEC400824B1D /* QTKit.framework */, + 846EC62B0EB601D80080CCFF /* QuickTime.framework */, 84C0A29D0DE2C7BD00606895 /* IOKit.framework */, 84C0A29E0DE2C7BD00606895 /* OpenGL.framework */, - 84C0A29F0DE2C7BD00606895 /* QuickTime.framework */, 84C0A2A00DE2C7BD00606895 /* WebKit.framework */, ); name = Frameworks; @@ -349,20 +337,6 @@ path = /Developer/Examples/CoreAudio/PublicUtility; sourceTree = ""; }; - F5D19AA603175F3201CA2136 /* AUCarbonViewBase */ = { - isa = PBXGroup; - children = ( - F5D19AA703175F3201CA2136 /* AUCarbonViewBase.cpp */, - F5D19AA803175F3201CA2136 /* AUCarbonViewBase.h */, - F5D19AA903175F3201CA2136 /* AUCarbonViewControl.cpp */, - F5D19AAA03175F3201CA2136 /* AUCarbonViewControl.h */, - F5D19AAB03175F3201CA2136 /* AUCarbonViewDispatch.cpp */, - F5D19AB003175F3201CA2136 /* CarbonEventHandler.cpp */, - F5D19AB103175F3201CA2136 /* CarbonEventHandler.h */, - ); - path = AUCarbonViewBase; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -465,17 +439,13 @@ 3E8BF119079CA60300021B09 /* AUEffectBase.cpp in Sources */, 3E8BF11C079CA60300021B09 /* CAStreamBasicDescription.cpp in Sources */, 3E8BF11B079CA60300021B09 /* CAAudioChannelLayout.cpp in Sources */, - 84CFAF0E090965080053C22C /* CarbonEventHandler.cpp in Sources */, - 84CFAEFB090964560053C22C /* AUCarbonViewDispatch.cpp in Sources */, - 84CFAEFC090964560053C22C /* AUCarbonViewControl.cpp in Sources */, - 84CFAEFD090964560053C22C /* AUCarbonViewBase.cpp in Sources */, 84CFAF10090965080053C22C /* CAAUParameter.cpp in Sources */, 3E8BF11A079CA60300021B09 /* AUBuffer.cpp in Sources */, 84F054E80906C8DD00AEC8DB /* AUMIDIBase.cpp in Sources */, 84F054EA0906C8DD00AEC8DB /* AUMIDIEffectBase.cpp in Sources */, 84F055010906E9EA00AEC8DB /* DemoEditorComponent.cpp in Sources */, 84F055030906E9EA00AEC8DB /* DemoJuceFilter.cpp in Sources */, - 84EB400B090A4A2C008FAC1B /* juce_AudioUnitWrapper.cpp in Sources */, + 84EB400B090A4A2C008FAC1B /* juce_AudioUnitWrapper.mm in Sources */, 84EB4042090A4F5A008FAC1B /* CAVectorUnit.cpp in Sources */, 84B4CDD10C7DD23B0083122F /* MusicDeviceBase.cpp in Sources */, 84581F8F0D917FC700AE1A4C /* AUBase.cpp in Sources */, diff --git a/extras/audio plugins/demo/build/RTAS_Mac/juce_RTASDemo.xcodeproj/project.pbxproj b/extras/audio plugins/demo/build/RTAS_Mac/juce_RTASDemo.xcodeproj/project.pbxproj index 5093007a66..079faa5a35 100644 --- a/extras/audio plugins/demo/build/RTAS_Mac/juce_RTASDemo.xcodeproj/project.pbxproj +++ b/extras/audio plugins/demo/build/RTAS_Mac/juce_RTASDemo.xcodeproj/project.pbxproj @@ -7,9 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 84190D1A0EA5320900B939D0 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84190D190EA5320900B939D0 /* Carbon.framework */; }; 841E07300AF9F015005E6FCC /* DemoEditorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841E072B0AF9F015005E6FCC /* DemoEditorComponent.cpp */; }; 841E07310AF9F015005E6FCC /* DemoJuceFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841E072D0AF9F015005E6FCC /* DemoJuceFilter.cpp */; }; - 841E073D0AF9F099005E6FCC /* juce_RTASUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841E073B0AF9F099005E6FCC /* juce_RTASUtilities.cpp */; }; 841E073E0AF9F099005E6FCC /* juce_RTASWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841E073C0AF9F099005E6FCC /* juce_RTASWrapper.cpp */; }; 846444EF0AFA005B00E7B2BE /* juce_Wrapper_CEffectGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846444E20AFA005B00E7B2BE /* juce_Wrapper_CEffectGroup.cpp */; }; 846444F00AFA005B00E7B2BE /* juce_Wrapper_CEffectGroupMIDI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846444E30AFA005B00E7B2BE /* juce_Wrapper_CEffectGroupMIDI.cpp */; }; @@ -21,23 +21,22 @@ 846444F60AFA005B00E7B2BE /* juce_Wrapper_CEffectTypeRTAS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846444E90AFA005B00E7B2BE /* juce_Wrapper_CEffectTypeRTAS.cpp */; }; 846444F70AFA005B00E7B2BE /* juce_Wrapper_ChunkDataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846444EA0AFA005B00E7B2BE /* juce_Wrapper_ChunkDataParser.cpp */; }; 846444FA0AFA005B00E7B2BE /* juce_Wrapper_PlugInUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 846444EE0AFA005B00E7B2BE /* juce_Wrapper_PlugInUtils.cpp */; }; - 84C0A3020DE2CBE500606895 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F40DE2CBE500606895 /* AGL.framework */; }; + 846EC6670EB602B90080CCFF /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846EC6660EB602B90080CCFF /* QuickTime.framework */; }; 84C0A3030DE2CBE500606895 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F50DE2CBE500606895 /* ApplicationServices.framework */; }; 84C0A3040DE2CBE500606895 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F60DE2CBE500606895 /* AudioUnit.framework */; }; - 84C0A3050DE2CBE500606895 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F70DE2CBE500606895 /* Carbon.framework */; }; 84C0A3060DE2CBE500606895 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F80DE2CBE500606895 /* Cocoa.framework */; }; 84C0A3070DE2CBE500606895 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2F90DE2CBE500606895 /* CoreAudio.framework */; }; - 84C0A3080DE2CBE500606895 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FA0DE2CBE500606895 /* CoreFoundation.framework */; }; 84C0A3090DE2CBE500606895 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FB0DE2CBE500606895 /* CoreMIDI.framework */; }; 84C0A30A0DE2CBE500606895 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FC0DE2CBE500606895 /* CoreServices.framework */; }; - 84C0A30B0DE2CBE500606895 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FD0DE2CBE500606895 /* DiscRecording.framework */; }; 84C0A30C0DE2CBE500606895 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FE0DE2CBE500606895 /* IOKit.framework */; }; - 84C0A30D0DE2CBE600606895 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A2FF0DE2CBE500606895 /* OpenGL.framework */; }; - 84C0A30E0DE2CBE600606895 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3000DE2CBE500606895 /* QuickTime.framework */; }; - 84C0A30F0DE2CBE600606895 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3010DE2CBE500606895 /* WebKit.framework */; }; 84C0A3110DE2CC0600606895 /* juce_amalgamated.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84C0A3100DE2CC0600606895 /* juce_amalgamated.mm */; }; 84C9D7FB0AFA3C9C00F1348E /* juce_Wrapper_Dispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C9D7F90AFA3C9C00F1348E /* juce_Wrapper_Dispatcher.cpp */; }; 84C9D7FC0AFA3C9C00F1348E /* juce_Wrapper_PluginInitialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C9D7FA0AFA3C9C00F1348E /* juce_Wrapper_PluginInitialize.cpp */; }; + 84E903C00EA34FD70088E51C /* juce_RTASUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E903BF0EA34FD70088E51C /* juce_RTASUtilities.mm */; }; + 84E904D00EA351E40088E51C /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E904CF0EA351E40088E51C /* QTKit.framework */; }; + 84E907CB0EA396A50088E51C /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E907CA0EA396A50088E51C /* DiscRecording.framework */; }; + 84E90C250EA399090088E51C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E90C240EA399090088E51C /* WebKit.framework */; }; + 84E90C2B0EA39A110088E51C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E90C2A0EA39A110088E51C /* OpenGL.framework */; }; 84EEB4180AFB6679009655FF /* DummyResourceFile.r in Rez */ = {isa = PBXBuildFile; fileRef = 84EEB4170AFB6679009655FF /* DummyResourceFile.r */; }; 84FAD77B0C7C89E100AF3028 /* libPluginLibrary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FAD7770C7C897000AF3028 /* libPluginLibrary.a */; }; /* End PBXBuildFile section */ @@ -54,14 +53,14 @@ /* Begin PBXFileReference section */ 5B521CEB08916D36009C75FE /* PluginLibrary.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PluginLibrary.xcodeproj; path = /Users/jules/stuff/PT_73_SDK/AlturaPorts/TDMPlugIns/PlugInLibrary/MacBuild/PluginLibrary.xcodeproj; sourceTree = ""; }; + 84190D190EA5320900B939D0 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 841E072B0AF9F015005E6FCC /* DemoEditorComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DemoEditorComponent.cpp; path = ../../src/DemoEditorComponent.cpp; sourceTree = SOURCE_ROOT; }; 841E072C0AF9F015005E6FCC /* DemoEditorComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DemoEditorComponent.h; path = ../../src/DemoEditorComponent.h; sourceTree = SOURCE_ROOT; }; 841E072D0AF9F015005E6FCC /* DemoJuceFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DemoJuceFilter.cpp; path = ../../src/DemoJuceFilter.cpp; sourceTree = SOURCE_ROOT; }; 841E072E0AF9F015005E6FCC /* DemoJuceFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DemoJuceFilter.h; path = ../../src/DemoJuceFilter.h; sourceTree = SOURCE_ROOT; }; 841E072F0AF9F015005E6FCC /* JucePluginCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JucePluginCharacteristics.h; path = ../../src/JucePluginCharacteristics.h; sourceTree = SOURCE_ROOT; }; - 841E073B0AF9F099005E6FCC /* juce_RTASUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_RTASUtilities.cpp; path = ../../../wrapper/formats/RTAS/juce_RTASUtilities.cpp; sourceTree = SOURCE_ROOT; }; 841E073C0AF9F099005E6FCC /* juce_RTASWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_RTASWrapper.cpp; path = ../../../wrapper/formats/RTAS/juce_RTASWrapper.cpp; sourceTree = SOURCE_ROOT; }; - 841E07420AF9F126005E6FCC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; + 841E07420AF9F126005E6FCC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 846444E20AFA005B00E7B2BE /* juce_Wrapper_CEffectGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_CEffectGroup.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_CEffectGroup.cpp; sourceTree = SOURCE_ROOT; }; 846444E30AFA005B00E7B2BE /* juce_Wrapper_CEffectGroupMIDI.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_CEffectGroupMIDI.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_CEffectGroupMIDI.cpp; sourceTree = SOURCE_ROOT; }; 846444E40AFA005B00E7B2BE /* juce_Wrapper_CEffectMIDIUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_CEffectMIDIUtils.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_CEffectMIDIUtils.cpp; sourceTree = SOURCE_ROOT; }; @@ -73,26 +72,25 @@ 846444EA0AFA005B00E7B2BE /* juce_Wrapper_ChunkDataParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_ChunkDataParser.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_ChunkDataParser.cpp; sourceTree = SOURCE_ROOT; }; 846444ED0AFA005B00E7B2BE /* juce_Wrapper_Header.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_Wrapper_Header.h; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_Header.h; sourceTree = SOURCE_ROOT; }; 846444EE0AFA005B00E7B2BE /* juce_Wrapper_PlugInUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_PlugInUtils.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_PlugInUtils.cpp; sourceTree = SOURCE_ROOT; }; + 846EC6660EB602B90080CCFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 8498C1430E06D7D200FC76A6 /* includes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = includes.h; path = ../../src/includes.h; sourceTree = SOURCE_ROOT; }; - 84C0A2F40DE2CBE500606895 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 84C0A2F50DE2CBE500606895 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 84C0A2F60DE2CBE500606895 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - 84C0A2F70DE2CBE500606895 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 84C0A2F80DE2CBE500606895 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 84C0A2F90DE2CBE500606895 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; - 84C0A2FA0DE2CBE500606895 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 84C0A2FB0DE2CBE500606895 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = ""; }; 84C0A2FC0DE2CBE500606895 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; - 84C0A2FD0DE2CBE500606895 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; 84C0A2FE0DE2CBE500606895 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - 84C0A2FF0DE2CBE500606895 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 84C0A3000DE2CBE500606895 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; - 84C0A3010DE2CBE500606895 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; 84C0A3100DE2CC0600606895 /* juce_amalgamated.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_amalgamated.mm; path = ../../../../../juce_amalgamated.mm; sourceTree = SOURCE_ROOT; }; 84C442690B306D39003FCBFF /* CommonReleaseSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = CommonReleaseSettings.xcconfig; path = /Users/jules/stuff/PT_73_SDK/AlturaPorts/TDMPlugIns/common/Mac/CommonReleaseSettings.xcconfig; sourceTree = ""; }; 84C4426A0B306D39003FCBFF /* CommonDebugSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = CommonDebugSettings.xcconfig; path = /Users/jules/stuff/PT_73_SDK/AlturaPorts/TDMPlugIns/common/Mac/CommonDebugSettings.xcconfig; sourceTree = ""; }; 84C9D7F90AFA3C9C00F1348E /* juce_Wrapper_Dispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_Dispatcher.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_Dispatcher.cpp; sourceTree = SOURCE_ROOT; }; 84C9D7FA0AFA3C9C00F1348E /* juce_Wrapper_PluginInitialize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_Wrapper_PluginInitialize.cpp; path = ../../../wrapper/formats/RTAS/wrappers/juce_Wrapper_PluginInitialize.cpp; sourceTree = SOURCE_ROOT; }; + 84E903BF0EA34FD70088E51C /* juce_RTASUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_RTASUtilities.mm; path = ../../../wrapper/formats/RTAS/juce_RTASUtilities.mm; sourceTree = SOURCE_ROOT; }; + 84E904CF0EA351E40088E51C /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; + 84E907CA0EA396A50088E51C /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; + 84E90C240EA399090088E51C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 84E90C2A0EA39A110088E51C /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 84EEB4170AFB6679009655FF /* DummyResourceFile.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = DummyResourceFile.r; path = ../../../wrapper/formats/RTAS/DummyResourceFile.r; sourceTree = SOURCE_ROOT; }; 84F5CF5F0B1B705E00A2E279 /* juce_RTASCompileFlags.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = juce_RTASCompileFlags.h; path = ../../../wrapper/formats/RTAS/juce_RTASCompileFlags.h; sourceTree = SOURCE_ROOT; }; 8D01CCD20486CAD60068D4B7 /* JuceRTASDemo.dpm */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JuceRTASDemo.dpm; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -104,20 +102,19 @@ buildActionMask = 2147483647; files = ( 84FAD77B0C7C89E100AF3028 /* libPluginLibrary.a in Frameworks */, - 84C0A3020DE2CBE500606895 /* AGL.framework in Frameworks */, 84C0A3030DE2CBE500606895 /* ApplicationServices.framework in Frameworks */, 84C0A3040DE2CBE500606895 /* AudioUnit.framework in Frameworks */, - 84C0A3050DE2CBE500606895 /* Carbon.framework in Frameworks */, 84C0A3060DE2CBE500606895 /* Cocoa.framework in Frameworks */, 84C0A3070DE2CBE500606895 /* CoreAudio.framework in Frameworks */, - 84C0A3080DE2CBE500606895 /* CoreFoundation.framework in Frameworks */, 84C0A3090DE2CBE500606895 /* CoreMIDI.framework in Frameworks */, 84C0A30A0DE2CBE500606895 /* CoreServices.framework in Frameworks */, - 84C0A30B0DE2CBE500606895 /* DiscRecording.framework in Frameworks */, 84C0A30C0DE2CBE500606895 /* IOKit.framework in Frameworks */, - 84C0A30D0DE2CBE600606895 /* OpenGL.framework in Frameworks */, - 84C0A30E0DE2CBE600606895 /* QuickTime.framework in Frameworks */, - 84C0A30F0DE2CBE600606895 /* WebKit.framework in Frameworks */, + 84E904D00EA351E40088E51C /* QTKit.framework in Frameworks */, + 84E907CB0EA396A50088E51C /* DiscRecording.framework in Frameworks */, + 84E90C250EA399090088E51C /* WebKit.framework in Frameworks */, + 84E90C2B0EA39A110088E51C /* OpenGL.framework in Frameworks */, + 84190D1A0EA5320900B939D0 /* Carbon.framework in Frameworks */, + 846EC6670EB602B90080CCFF /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -140,21 +137,20 @@ 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 84C0A2F40DE2CBE500606895 /* AGL.framework */, + 5B521CEB08916D36009C75FE /* PluginLibrary.xcodeproj */, 84C0A2F50DE2CBE500606895 /* ApplicationServices.framework */, 84C0A2F60DE2CBE500606895 /* AudioUnit.framework */, - 84C0A2F70DE2CBE500606895 /* Carbon.framework */, 84C0A2F80DE2CBE500606895 /* Cocoa.framework */, + 84190D190EA5320900B939D0 /* Carbon.framework */, 84C0A2F90DE2CBE500606895 /* CoreAudio.framework */, - 84C0A2FA0DE2CBE500606895 /* CoreFoundation.framework */, 84C0A2FB0DE2CBE500606895 /* CoreMIDI.framework */, 84C0A2FC0DE2CBE500606895 /* CoreServices.framework */, - 84C0A2FD0DE2CBE500606895 /* DiscRecording.framework */, + 84E907CA0EA396A50088E51C /* DiscRecording.framework */, 84C0A2FE0DE2CBE500606895 /* IOKit.framework */, - 84C0A2FF0DE2CBE500606895 /* OpenGL.framework */, - 84C0A3000DE2CBE500606895 /* QuickTime.framework */, - 84C0A3010DE2CBE500606895 /* WebKit.framework */, - 5B521CEB08916D36009C75FE /* PluginLibrary.xcodeproj */, + 84E904CF0EA351E40088E51C /* QTKit.framework */, + 846EC6660EB602B90080CCFF /* QuickTime.framework */, + 84E90C240EA399090088E51C /* WebKit.framework */, + 84E90C2A0EA39A110088E51C /* OpenGL.framework */, ); name = "External Frameworks and Libraries"; sourceTree = ""; @@ -211,7 +207,7 @@ isa = PBXGroup; children = ( 846444E10AFA003B00E7B2BE /* Digi code wrappers */, - 841E073B0AF9F099005E6FCC /* juce_RTASUtilities.cpp */, + 84E903BF0EA34FD70088E51C /* juce_RTASUtilities.mm */, 841E073C0AF9F099005E6FCC /* juce_RTASWrapper.cpp */, 84F5CF5F0B1B705E00A2E279 /* juce_RTASCompileFlags.h */, ); @@ -318,7 +314,6 @@ files = ( 841E07300AF9F015005E6FCC /* DemoEditorComponent.cpp in Sources */, 841E07310AF9F015005E6FCC /* DemoJuceFilter.cpp in Sources */, - 841E073D0AF9F099005E6FCC /* juce_RTASUtilities.cpp in Sources */, 841E073E0AF9F099005E6FCC /* juce_RTASWrapper.cpp in Sources */, 846444EF0AFA005B00E7B2BE /* juce_Wrapper_CEffectGroup.cpp in Sources */, 846444F00AFA005B00E7B2BE /* juce_Wrapper_CEffectGroupMIDI.cpp in Sources */, @@ -333,6 +328,7 @@ 84C9D7FB0AFA3C9C00F1348E /* juce_Wrapper_Dispatcher.cpp in Sources */, 84C9D7FC0AFA3C9C00F1348E /* juce_Wrapper_PluginInitialize.cpp in Sources */, 84C0A3110DE2CC0600606895 /* juce_amalgamated.mm in Sources */, + 84E903C00EA34FD70088E51C /* juce_RTASUtilities.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/extras/audio plugins/demo/build/VST_Mac/JuceVST.xcodeproj/project.pbxproj b/extras/audio plugins/demo/build/VST_Mac/JuceVST.xcodeproj/project.pbxproj index 41dc7b1698..6e828989d7 100644 --- a/extras/audio plugins/demo/build/VST_Mac/JuceVST.xcodeproj/project.pbxproj +++ b/extras/audio plugins/demo/build/VST_Mac/JuceVST.xcodeproj/project.pbxproj @@ -7,9 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - 845FAE4C0A5C09FA008C94D8 /* juce.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 845FAE4B0A5C09FA008C94D8 /* juce.xcconfig */; }; + 846EC67F0EB603BE0080CCFF /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846EC67E0EB603BE0080CCFF /* QuickTime.framework */; }; 84BACBD20987847C0073300C /* juce_VstWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BACBD10987847C0073300C /* juce_VstWrapper.cpp */; }; - 84C0A3530DE2D1FD00606895 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3450DE2D1FD00606895 /* AGL.framework */; }; 84C0A3540DE2D1FD00606895 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3460DE2D1FD00606895 /* ApplicationServices.framework */; }; 84C0A3550DE2D1FD00606895 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3470DE2D1FD00606895 /* AudioUnit.framework */; }; 84C0A3560DE2D1FD00606895 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3480DE2D1FD00606895 /* Carbon.framework */; }; @@ -21,20 +20,22 @@ 84C0A35C0DE2D1FD00606895 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A34E0DE2D1FD00606895 /* DiscRecording.framework */; }; 84C0A35D0DE2D1FD00606895 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A34F0DE2D1FD00606895 /* IOKit.framework */; }; 84C0A35E0DE2D1FD00606895 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3500DE2D1FD00606895 /* OpenGL.framework */; }; - 84C0A35F0DE2D1FD00606895 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3510DE2D1FD00606895 /* QuickTime.framework */; }; 84C0A3600DE2D1FD00606895 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C0A3520DE2D1FD00606895 /* WebKit.framework */; }; 84C0A3620DE2D24B00606895 /* juce_amalgamated.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84C0A3610DE2D24B00606895 /* juce_amalgamated.mm */; }; + 84E01FC70E9136C6003E41AF /* juce_VstWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84E01FC60E9136C6003E41AF /* juce_VstWrapper.mm */; }; + 84E0200D0E923F75003E41AF /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E0200C0E923F75003E41AF /* QTKit.framework */; }; 84E1AE51089EBAAA00E85E4F /* DemoEditorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E1AE4D089EBAAA00E85E4F /* DemoEditorComponent.cpp */; }; 84E1AE52089EBAAA00E85E4F /* DemoJuceFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84E1AE4F089EBAAA00E85E4F /* DemoJuceFilter.cpp */; }; 84E1AF42089EBFD900E85E4F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84E1AF41089EBFD900E85E4F /* Info.plist */; }; - 84F5CF040B1B66B100A2E279 /* How to use this framework.txt in Resources */ = {isa = PBXBuildFile; fileRef = 84F5CF030B1B66B100A2E279 /* How to use this framework.txt */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 84551AA009BDB8F3009C9F3E /* JucePluginCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = JucePluginCharacteristics.h; path = ../../src/JucePluginCharacteristics.h; sourceTree = SOURCE_ROOT; }; 845FAE4B0A5C09FA008C94D8 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; + 846EC67E0EB603BE0080CCFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + 846EC6820EB603FF0080CCFF /* includes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = includes.h; path = ../../src/includes.h; sourceTree = SOURCE_ROOT; }; 84BACBD10987847C0073300C /* juce_VstWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = juce_VstWrapper.cpp; path = ../../../wrapper/formats/VST/juce_VstWrapper.cpp; sourceTree = SOURCE_ROOT; }; - 84C0A3450DE2D1FD00606895 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; + 84BE92BB0EA61E590079073F /* MacExportedSymbols.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = MacExportedSymbols.txt; path = ../../../wrapper/formats/VST/MacExportedSymbols.txt; sourceTree = SOURCE_ROOT; }; 84C0A3460DE2D1FD00606895 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 84C0A3470DE2D1FD00606895 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; 84C0A3480DE2D1FD00606895 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; @@ -46,15 +47,16 @@ 84C0A34E0DE2D1FD00606895 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; 84C0A34F0DE2D1FD00606895 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 84C0A3500DE2D1FD00606895 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 84C0A3510DE2D1FD00606895 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 84C0A3520DE2D1FD00606895 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; 84C0A3610DE2D24B00606895 /* juce_amalgamated.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_amalgamated.mm; path = ../../../../../juce_amalgamated.mm; sourceTree = SOURCE_ROOT; }; + 84E01FC60E9136C6003E41AF /* juce_VstWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 2; name = juce_VstWrapper.mm; path = ../../../wrapper/formats/VST/juce_VstWrapper.mm; sourceTree = SOURCE_ROOT; }; + 84E0200C0E923F75003E41AF /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 84E1AE47089EBA6A00E85E4F /* JuceVST.vst */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JuceVST.vst; sourceTree = BUILT_PRODUCTS_DIR; }; 84E1AE4D089EBAAA00E85E4F /* DemoEditorComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DemoEditorComponent.cpp; path = ../../src/DemoEditorComponent.cpp; sourceTree = SOURCE_ROOT; }; 84E1AE4E089EBAAA00E85E4F /* DemoEditorComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DemoEditorComponent.h; path = ../../src/DemoEditorComponent.h; sourceTree = SOURCE_ROOT; }; 84E1AE4F089EBAAA00E85E4F /* DemoJuceFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DemoJuceFilter.cpp; path = ../../src/DemoJuceFilter.cpp; sourceTree = SOURCE_ROOT; }; 84E1AE50089EBAAA00E85E4F /* DemoJuceFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DemoJuceFilter.h; path = ../../src/DemoJuceFilter.h; sourceTree = SOURCE_ROOT; }; - 84E1AF41089EBFD900E85E4F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; + 84E1AF41089EBFD900E85E4F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; 84F5CF030B1B66B100A2E279 /* How to use this framework.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "How to use this framework.txt"; path = "../../../How to use this framework.txt"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -63,7 +65,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 84C0A3530DE2D1FD00606895 /* AGL.framework in Frameworks */, 84C0A3540DE2D1FD00606895 /* ApplicationServices.framework in Frameworks */, 84C0A3550DE2D1FD00606895 /* AudioUnit.framework in Frameworks */, 84C0A3560DE2D1FD00606895 /* Carbon.framework in Frameworks */, @@ -75,8 +76,9 @@ 84C0A35C0DE2D1FD00606895 /* DiscRecording.framework in Frameworks */, 84C0A35D0DE2D1FD00606895 /* IOKit.framework in Frameworks */, 84C0A35E0DE2D1FD00606895 /* OpenGL.framework in Frameworks */, - 84C0A35F0DE2D1FD00606895 /* QuickTime.framework in Frameworks */, 84C0A3600DE2D1FD00606895 /* WebKit.framework in Frameworks */, + 84E0200D0E923F75003E41AF /* QTKit.framework in Frameworks */, + 846EC67F0EB603BE0080CCFF /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -98,7 +100,6 @@ 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 84C0A3450DE2D1FD00606895 /* AGL.framework */, 84C0A3460DE2D1FD00606895 /* ApplicationServices.framework */, 84C0A3470DE2D1FD00606895 /* AudioUnit.framework */, 84C0A3480DE2D1FD00606895 /* Carbon.framework */, @@ -109,8 +110,9 @@ 84C0A34D0DE2D1FD00606895 /* CoreServices.framework */, 84C0A34E0DE2D1FD00606895 /* DiscRecording.framework */, 84C0A34F0DE2D1FD00606895 /* IOKit.framework */, + 84E0200C0E923F75003E41AF /* QTKit.framework */, + 846EC67E0EB603BE0080CCFF /* QuickTime.framework */, 84C0A3500DE2D1FD00606895 /* OpenGL.framework */, - 84C0A3510DE2D1FD00606895 /* QuickTime.framework */, 84C0A3520DE2D1FD00606895 /* WebKit.framework */, ); name = "External Frameworks and Libraries"; @@ -151,6 +153,7 @@ 84E1AE50089EBAAA00E85E4F /* DemoJuceFilter.h */, 84551AA009BDB8F3009C9F3E /* JucePluginCharacteristics.h */, 84C0A3610DE2D24B00606895 /* juce_amalgamated.mm */, + 846EC6820EB603FF0080CCFF /* includes.h */, ); name = filter; sourceTree = ""; @@ -158,7 +161,9 @@ 84E1AE53089EBACA00E85E4F /* wrapper code */ = { isa = PBXGroup; children = ( + 84E01FC60E9136C6003E41AF /* juce_VstWrapper.mm */, 84BACBD10987847C0073300C /* juce_VstWrapper.cpp */, + 84BE92BB0EA61E590079073F /* MacExportedSymbols.txt */, ); name = "wrapper code"; sourceTree = ""; @@ -206,8 +211,6 @@ buildActionMask = 2147483647; files = ( 84E1AF42089EBFD900E85E4F /* Info.plist in Resources */, - 845FAE4C0A5C09FA008C94D8 /* juce.xcconfig in Resources */, - 84F5CF040B1B66B100A2E279 /* How to use this framework.txt in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -222,6 +225,7 @@ 84E1AE52089EBAAA00E85E4F /* DemoJuceFilter.cpp in Sources */, 84BACBD20987847C0073300C /* juce_VstWrapper.cpp in Sources */, 84C0A3620DE2D24B00606895 /* juce_amalgamated.mm in Sources */, + 84E01FC70E9136C6003E41AF /* juce_VstWrapper.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -257,12 +261,15 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; + EXPORTED_SYMBOLS_FILE = ../../../wrapper/formats/VST/MacExportedSymbols.txt; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_SYMBOLS_PRIVATE_EXTERN = YES; GENERATE_PKGINFO_FILE = YES; INFOPLIST_FILE = info.plist; INFOPLIST_PREPROCESS = YES; + PRELINK_LIBS = libjucedebug; PRODUCT_NAME = JuceVST; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; SYMROOT = "$(HOME)/Library/Audio/Plug-Ins/VST"; WARNING_CFLAGS = ( "-Wmost", @@ -277,6 +284,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; + EXPORTED_SYMBOLS_FILE = ../../../wrapper/formats/VST/MacExportedSymbols.txt; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_SYMBOLS_PRIVATE_EXTERN = YES; diff --git a/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp b/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.mm similarity index 77% rename from extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp rename to extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.mm index 0f0fd51090..64565d7291 100644 --- a/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.mm @@ -29,12 +29,15 @@ ============================================================================== */ +#include +#include #include +#include #include "AUMIDIEffectBase.h" #include "MusicDeviceBase.h" -#include "AUCarbonViewBase.h" #include "../../juce_IncludeCharacteristics.h" -#include "../../../../../juce_amalgamated.h" +//#include "../../../../../juce_amalgamated.h" +#include "../../../../../juce.h" //============================================================================== #define juceFilterObjectPropertyID 0x1a45ffe9 @@ -60,10 +63,28 @@ END_JUCE_NAMESPACE extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); class JuceAUView; +//============================================================================== +#define CONCAT_MACRO(Part1, Part2) Part1 ## Part2 +#define JuceUICreationClass CONCAT_MACRO (JucePlugin_AUExportPrefix, _UICreationClass) + +@interface JuceUICreationClass : NSObject +{ +} + +- (JuceUICreationClass*) init; +- (void) dealloc; +- (unsigned) interfaceVersion; +- (NSString *) description; +- (NSView*) uiViewForAudioUnit: (AudioUnit) inAudioUnit + withSize: (NSSize) inPreferredSize; +@end + + //============================================================================== class JuceAU : public JuceAUBaseClass, public AudioProcessorListener, - public AudioPlayHead + public AudioPlayHead, + public ComponentListener { public: //============================================================================== @@ -73,14 +94,11 @@ public: #else : AUMIDIEffectBase (component), #endif - currentView (0), juceFilter (0), bufferSpace (2, 16), channels (0), prepared (false) { - CreateElements(); - if (activePlugins.size() == 0) { initialiseJuce_GUI(); @@ -88,8 +106,6 @@ public: #ifdef JucePlugin_CFBundleIdentifier juce_setCurrentExecutableFileNameFromBundleId (JucePlugin_CFBundleIdentifier); #endif - - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); } juceFilter = createPluginFilter(); @@ -143,10 +159,16 @@ public: outDataSize = sizeof (UInt32); return noErr; } - else if (inID == kMusicDeviceProperty_InstrumentCount) + else if (inID == kMusicDeviceProperty_InstrumentCount) + { + outDataSize = sizeof (UInt32); + outWritable = false; + return noErr; + } + else if (inID == kAudioUnitProperty_CocoaUI) { - outDataSize = sizeof (UInt32); - outWritable = false; + outDataSize = sizeof (AudioUnitCocoaViewInfo); + outWritable = true; return noErr; } } @@ -172,11 +194,21 @@ public: *(UInt32*) outData = (juceFilter != 0 && juceFilter->isNonRealtime()) ? 1 : 0; return noErr; } - else if (inID == kMusicDeviceProperty_InstrumentCount) + else if (inID == kMusicDeviceProperty_InstrumentCount) { *(UInt32*) outData = 1; return noErr; } + else if (inID == kAudioUnitProperty_CocoaUI) + { + AudioUnitCocoaViewInfo* info = (AudioUnitCocoaViewInfo*) outData; + NSBundle* b = [NSBundle bundleForClass: [JuceUICreationClass class]]; + + info->mCocoaAUViewClass[0] = (CFStringRef) [[[JuceUICreationClass class] className] retain]; + info->mCocoaAUViewBundleLocation = (CFURLRef) [[NSURL fileURLWithPath: [b bundlePath]] retain]; + + return noErr; + } } return JuceAUBaseClass::GetProperty (inID, inScope, inElement, outData); @@ -370,18 +402,6 @@ public: return juceFilter->getLatencySamples() / GetSampleRate(); } - //============================================================================== - int GetNumCustomUIComponents() { return 1; } - - void GetUIComponentDescs (ComponentDescription* inDescArray) - { - inDescArray[0].componentType = kAudioUnitCarbonViewComponentType; - inDescArray[0].componentSubType = JucePlugin_AUSubType; - inDescArray[0].componentManufacturer = JucePlugin_AUManufacturerCode; - inDescArray[0].componentFlags = 0; - inDescArray[0].componentFlagsMask = 0; - } - //============================================================================== bool getCurrentPosition (AudioPlayHead::CurrentPositionInfo& info) { @@ -472,9 +492,6 @@ public: } } - // (can only be called immediately after sendAUEvent) - void sendOldFashionedGestureEvent (const AudioUnitCarbonViewEventID gestureType); - void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue) { sendAUEvent (kAudioUnitEvent_ParameterValueChange, index); @@ -483,13 +500,11 @@ public: void audioProcessorParameterChangeGestureBegin (AudioProcessor*, int index) { sendAUEvent (kAudioUnitEvent_BeginParameterChangeGesture, index); - sendOldFashionedGestureEvent (kAudioUnitCarbonViewEvent_MouseDownInControl); } void audioProcessorParameterChangeGestureEnd (AudioProcessor*, int index) { sendAUEvent (kAudioUnitEvent_EndParameterChangeGesture, index); - sendOldFashionedGestureEvent (kAudioUnitCarbonViewEvent_MouseUpInControl); } void audioProcessorChanged (AudioProcessor*) @@ -820,10 +835,18 @@ protected: return noErr; } - //============================================================================== -public: - JuceAUView* currentView; + void componentMovedOrResized (Component& component, bool wasMoved, bool wasResized) + { + if (wasResized) + { + NSView* view = (NSView*) component.getWindowHandle(); + [[view superview] setFrameSize: NSMakeSize (component.getWidth(), component.getHeight())]; + [view setFrame: NSMakeRect (0, 0, component.getWidth(), component.getHeight())]; + [view setNeedsDisplay: YES]; + } + } + //============================================================================== private: AudioProcessor* juceFilter; AudioSampleBuffer bufferSpace; @@ -836,221 +859,130 @@ private: mutable MemoryBlock presetsArray; }; - -//============================================================================== -class JuceAUComponentHolder : public Component -{ -public: - JuceAUComponentHolder (Component* const editorComp) - { - addAndMakeVisible (editorComp); - setOpaque (true); - setVisible (true); - setBroughtToFrontOnMouseClick (true); - -#if ! JucePlugin_EditorRequiresKeyboardFocus - setWantsKeyboardFocus (false); -#endif - } - - ~JuceAUComponentHolder() - { - } - - void resized() - { - if (getNumChildComponents() > 0) - getChildComponent (0)->setBounds (0, 0, getWidth(), getHeight()); - } - - void paint (Graphics& g) - { - } -}; - //============================================================================== -class JuceAUView : public AUCarbonViewBase, - public ComponentListener, - public MouseListener, - public Timer +@interface JuceUIViewClass : NSView { - AudioProcessor* juceFilter; + AudioProcessor* filter; + JuceAU* au; AudioProcessorEditor* editorComp; - Component* windowComp; - bool recursive; - int mx, my; - JuceAU* owner; - -public: - JuceAUView (AudioUnitCarbonView auview) - : AUCarbonViewBase (auview), - juceFilter (0), - editorComp (0), - windowComp (0), - recursive (false), - mx (0), - my (0), - owner (0) - { - } - - ~JuceAUView() - { - if (owner->currentView == this) - owner->currentView = 0; - - deleteUI(); - } - - ComponentResult CreateUI (Float32 inXOffset, Float32 inYOffset) - { - if (juceFilter == 0) - { - void* pointers[2]; - UInt32 propertySize = sizeof (pointers); - - AudioUnitGetProperty (GetEditAudioUnit(), - juceFilterObjectPropertyID, - kAudioUnitScope_Global, - 0, - pointers, - &propertySize); +} - juceFilter = (AudioProcessor*) pointers[0]; +- (JuceUIViewClass*) initWithFilter: (AudioProcessor*) filter + withAU: (JuceAU*) au + withComponent: (AudioProcessorEditor*) editorComp; +- (void) dealloc; +- (void) viewDidMoveToWindow; +- (BOOL) mouseDownCanMoveWindow; - owner = (JuceAU*) pointers[1]; - owner->currentView = this; - } +@end - if (juceFilter != 0) - { - deleteUI(); +@implementation JuceUIViewClass - editorComp = juceFilter->createEditorIfNeeded(); +- (JuceUIViewClass*) initWithFilter: (AudioProcessor*) filter_ + withAU: (JuceAU*) au_ + withComponent: (AudioProcessorEditor*) editorComp_ +{ + filter = filter_; + au = au_; + editorComp = editorComp_; - const int w = editorComp->getWidth(); - const int h = editorComp->getHeight(); + [super initWithFrame: NSMakeRect (0, 0, editorComp_->getWidth(), editorComp_->getHeight())]; + [self setHidden: NO]; + [self setPostsFrameChangedNotifications: YES]; - editorComp->setOpaque (true); - editorComp->setVisible (true); + editorComp->addToDesktop (0, (void*) self); + editorComp->setVisible (true); + editorComp->addComponentListener (au); - windowComp = new JuceAUComponentHolder (editorComp); - windowComp->setBounds ((int) inXOffset, (int) inYOffset, w, h); + return self; +} - windowComp->addToDesktop (0, (void*) mCarbonPane); - SizeControl (mCarbonPane, w, h); +- (void) dealloc +{ + // there's some kind of component currently modal, but the host + // is trying to delete our plugin.. + jassert (Component::getCurrentlyModalComponent() == 0); - editorComp->addComponentListener (this); - windowComp->addMouseListener (this, true); + if (editorComp != 0) + filter->editorBeingDeleted (editorComp); - startTimer (20); - } - else - { - jassertfalse // can't get a pointer to our effect - } + deleteAndZero (editorComp); - return noErr; - } + [super dealloc]; +} - void componentMovedOrResized (Component& component, - bool wasMoved, - bool wasResized) +- (void) viewDidMoveToWindow +{ + if ([self window] != 0) { - if (! recursive) - { - recursive = true; - - if (editorComp != 0 && wasResized) - { - const int w = jmax (32, editorComp->getWidth()); - const int h = jmax (32, editorComp->getHeight()); - - SizeControl (mCarbonPane, w, h); - - if (windowComp->getWidth() != w - || windowComp->getHeight() != h) - { - windowComp->setSize (w, h); - } - - editorComp->repaint(); - } - - recursive = false; - } - } + [[self window] setAcceptsMouseMovedEvents: YES]; - void timerCallback() - { - // for some stupid Apple-related reason, mouse move events just don't seem to get sent - // to the windows in an AU, so we have to bodge it here and simulate them with a - // timer.. if (editorComp != 0) - { - int x, y; - Desktop::getInstance().getMousePosition (x, y); - - if (x != mx || y != my) - { - mx = x; - my = y; - - if (! ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown()) - { - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - { - ComponentPeer* const peer = ComponentPeer::getPeer (i); - - int rx = x, ry = y; - peer->getComponent()->globalPositionToRelative (rx, ry); - - if (peer->contains (rx, ry, false) && peer->getComponent()->isShowing()) - { - peer->handleMouseMove (rx, ry, Time::currentTimeMillis()); - break; - } - } - } - } - } + [[self window] makeFirstResponder: (NSView*) editorComp->getWindowHandle()]; } +} - void mouseMove (const MouseEvent& e) - { - Desktop::getInstance().getMousePosition (mx, my); - startTimer (20); - } +- (BOOL) mouseDownCanMoveWindow +{ + return NO; +} - AudioUnitCarbonViewEventListener getEventListener() const throw() { return mEventListener; } - void* getEventListenerUserData() const throw() { return mEventListenerUserData; } +@end -private: - void deleteUI() - { - PopupMenu::dismissAllActiveMenus(); +@implementation JuceUICreationClass - // there's some kind of component currently modal, but the host - // is trying to delete our plugin.. - jassert (Component::getCurrentlyModalComponent() == 0); +- (JuceUICreationClass*) init +{ + return [super init]; +} - if (editorComp != 0) - juceFilter->editorBeingDeleted (editorComp); +- (void) dealloc +{ + [super dealloc]; +} - deleteAndZero (editorComp); - deleteAndZero (windowComp); - } -}; +- (unsigned) interfaceVersion +{ + return 0; +} -void JuceAU::sendOldFashionedGestureEvent (const AudioUnitCarbonViewEventID gestureType) +- (NSString*) description { - if (currentView != 0 && currentView->getEventListener() != 0) - { - (*currentView->getEventListener()) (currentView->getEventListenerUserData(), currentView->GetComponentInstance(), - &(auEvent.mArgument.mParameter), gestureType, 0); - } + return [NSString stringWithString: @JucePlugin_Name]; } +- (NSView*) uiViewForAudioUnit: (AudioUnit) inAudioUnit + withSize: (NSSize) inPreferredSize +{ + void* pointers[2]; + UInt32 propertySize = sizeof (pointers); + + if (AudioUnitGetProperty (inAudioUnit, + juceFilterObjectPropertyID, + kAudioUnitScope_Global, + 0, + pointers, + &propertySize) != noErr) + return 0; + + AudioProcessor* filter = (AudioProcessor*) pointers[0]; + JuceAU* au = (JuceAU*) pointers[1]; + + if (filter == 0) + return 0; + + AudioProcessorEditor* editorComp = filter->createEditorIfNeeded(); + + if (editorComp == 0) + return 0; +DBG (String (inPreferredSize.width) + " " + String (inPreferredSize.height)); +DBG (String (editorComp->getWidth()) + " " + String (editorComp->getHeight())); + + return [[[JuceUIViewClass alloc] initWithFilter: filter + withAU: au + withComponent: editorComp] autorelease]; +} +@end //============================================================================== #define JUCE_COMPONENT_ENTRYX(Class, Name, Suffix) \ @@ -1063,4 +995,4 @@ extern "C" __attribute__((visibility("default"))) ComponentResult Name ## Suffix #define JUCE_COMPONENT_ENTRY(Class, Name, Suffix) JUCE_COMPONENT_ENTRYX(Class, Name, Suffix) JUCE_COMPONENT_ENTRY (JuceAU, JucePlugin_AUExportPrefix, Entry) -JUCE_COMPONENT_ENTRY (JuceAUView, JucePlugin_AUExportPrefix, ViewEntry) +//JUCE_COMPONENT_ENTRY (JuceAUView, JucePlugin_AUExportPrefix, ViewEntry) diff --git a/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.r b/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.r index 5d32214260..ebc3783f78 100644 --- a/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.r +++ b/extras/audio plugins/wrapper/formats/AudioUnit/juce_AudioUnitWrapper.r @@ -30,7 +30,6 @@ */ #include -#include //============================================================================== /* The JucePluginCharacteristics.h file is supposed to live in your plugin-specific @@ -56,15 +55,3 @@ #include "/Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r" -//============================================================================== -// component resources for Audio Unit Carbon View -#define RES_ID 2000 -#define COMP_TYPE kAudioUnitCarbonViewComponentType -#define COMP_SUBTYPE JucePlugin_AUSubType -#define COMP_MANUF JucePlugin_AUManufacturerCode -#define VERSION JucePlugin_VersionCode -#define NAME JucePlugin_Manufacturer ": " JucePlugin_Name " View" -#define DESCRIPTION NAME -#define ENTRY_POINT JucePlugin_AUExportPrefixQuoted "ViewEntry" - -#include "/Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r" diff --git a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.mm b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.mm new file mode 100644 index 0000000000..aa6c95466a --- /dev/null +++ b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.mm @@ -0,0 +1,82 @@ +/* + ============================================================================== + + 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 +#include "../../../../../juce.h" + +//============================================================================== +void* attachSubWindow (void* hostWindowRef, Component* comp) +{ + const ScopedAutoReleasePool pool; + + NSWindow* hostWindow = [[NSWindow alloc] initWithWindowRef: hostWindowRef]; + [hostWindow retain]; + + NSView* content = [hostWindow contentView]; + NSRect f = [content frame]; + f.size.width = comp->getWidth(); + f.size.height = comp->getHeight(); + [content setFrame: f]; + + NSPoint windowPos = [hostWindow convertBaseToScreen: f.origin]; + windowPos.y = [[NSScreen mainScreen] frame].size.height - (windowPos.y + f.size.height); + + comp->setTopLeftPosition ((int) windowPos.x, (int) windowPos.y); + +#if ! JucePlugin_EditorRequiresKeyboardFocus + comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses); +#else + comp->addToDesktop (ComponentPeer::windowIsTemporary); +#endif + + comp->setVisible (true); + + NSView* pluginView = (NSView*) comp->getWindowHandle(); + NSWindow* pluginWindow = [pluginView window]; + + [hostWindow addChildWindow: pluginWindow + ordered: NSWindowAbove]; + [hostWindow orderFront: nil]; + return hostWindow; +} + +void removeSubWindow (void* nsWindow, Component* comp) +{ + const ScopedAutoReleasePool pool; + + NSView* pluginView = (NSView*) comp->getWindowHandle(); + NSWindow* hostWindow = (NSWindow*) nsWindow; + NSWindow* pluginWindow = [pluginView window]; + + [hostWindow removeChildWindow: pluginWindow]; + comp->removeFromDesktop(); + [hostWindow release]; +} diff --git a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp index 38930d715d..d30ca72f0f 100644 --- a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp @@ -93,7 +93,7 @@ #ifdef _MSC_VER #include "../../../../../juce.h" #else - #include "../../../../../juce_amalgamated.h" + #include "../../../../../juce.h" #endif #include "../../juce_IncludeCharacteristics.h" @@ -112,6 +112,9 @@ #if ! JucePlugin_EditorRequiresKeyboardFocus extern void JUCE_CALLTYPE passFocusToHostWindow (void* hostWindow); #endif +#else + extern void* attachSubWindow (void* hostWindowRef, JUCE_NAMESPACE::Component* comp); + extern void removeSubWindow (void* nsWindow, JUCE_NAMESPACE::Component* comp); #endif const int midiBufferSize = 1024; @@ -150,10 +153,10 @@ class JucePlugInProcess : public CEffectProcessMIDI, public: //============================================================================== JucePlugInProcess() - : channels (0), - prepared (false), - midiBufferNode (0), + : midiBufferNode (0), midiTransport (0), + channels (0), + prepared (false), sampleRate (44100.0) { juceFilter = createPluginFilter(); @@ -192,8 +195,8 @@ public: JucePlugInProcess* const process_) : filter (filter_), process (process_), - editorComp (0), - wrapper (0) + wrapper (0), + editorComp (0) { // setting the size in here crashes PT for some reason, so keep it simple.. } @@ -261,35 +264,21 @@ public: void DrawContents (Rect*) { +#if JUCE_WIN32 if (wrapper != 0) { ComponentPeer* const peer = wrapper->getPeer(); if (peer != 0) { -#if JUCE_WIN32 // (seems to be required in PT6.4, but not in 7.x) peer->repaint (0, 0, wrapper->getWidth(), wrapper->getHeight()); - -#elif JUCE_PPC - // This crap is needed because if you resize a window, PT doesn't - // update its clip region, so only part of your new window gets drawn. - // This overrides the clipping region that's being passed into the Draw - // method. - Rect visible; - GetVisibleRect (&visible); - - RestoreFocus(); - Focus (&visible); -#endif - peer->performAnyPendingRepaintsNow(); } } +#endif } - void DrawBackground (Rect* r) - { - } + void DrawBackground (Rect*) {} //============================================================================== private: @@ -300,8 +289,11 @@ public: void deleteEditorComp() { - if (editorComp != 0) + if (editorComp != 0 || wrapper != 0) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif PopupMenu::dismissAllActiveMenus(); JUCE_NAMESPACE::Component* const modalComponent = JUCE_NAMESPACE::Component::getCurrentlyModalComponent(); @@ -309,6 +301,7 @@ public: modalComponent->exitModalState (0); filter->editorBeingDeleted (editorComp); + deleteAndZero (editorComp); deleteAndZero (wrapper); } @@ -317,26 +310,23 @@ public: //============================================================================== // A component to hold the AudioProcessorEditor, and cope with some housekeeping // chores when it changes or repaints. - class EditorCompWrapper : public JUCE_NAMESPACE::Component, -#if JUCE_MAC - public Timer -#else - public FocusChangeListener + class EditorCompWrapper : public JUCE_NAMESPACE::Component +#if ! JUCE_MAC + , public FocusChangeListener #endif { public: EditorCompWrapper (void* const hostWindow_, - AudioProcessorEditor* const editorComp, + Component* const editorComp, JuceCustomUIView* const owner_) : hostWindow (hostWindow_), owner (owner_), titleW (0), titleH (0) -#if JUCE_MAC - , forcedRepaintTimer (0) -#endif { -#if ! JucePlugin_EditorRequiresKeyboardFocus +#if JucePlugin_EditorRequiresKeyboardFocus + setWantsKeyboardFocus (true); +#else setWantsKeyboardFocus (false); #endif setOpaque (true); @@ -347,67 +337,10 @@ public: #if JUCE_WIN32 attachSubWindow (hostWindow, titleW, titleH, this); - setVisible (true); #else - SetAutomaticControlDragTrackingEnabledForWindow ((WindowRef) hostWindow_, true); - - WindowAttributes attributes; - GetWindowAttributes ((WindowRef) hostWindow_, &attributes); - - parentView = 0; - - if ((attributes & kWindowCompositingAttribute) != 0) - { - HIViewRef root = HIViewGetRoot ((WindowRef) hostWindow_); - HIViewFindByID (root, kHIViewWindowContentID, &parentView); - - if (parentView == 0) - parentView = root; - } - else - { - GetRootControl ((WindowRef) hostWindow_, (ControlRef*) &parentView); - - if (parentView == 0) - CreateRootControl ((WindowRef) hostWindow_, (ControlRef*) &parentView); - } - - jassert (parentView != 0); - Rect clientRect; - GetWindowBounds ((WindowRef) hostWindow, kWindowContentRgn, &clientRect); - - titleW = clientRect.right - clientRect.left; - titleH = jmax (0, (clientRect.bottom - clientRect.top) - getHeight()); - setTopLeftPosition (0, 0); - - HIViewSetNeedsDisplay (parentView, true); - - setVisible (true); - addToDesktop (ComponentPeer::windowRepaintedExplictly, (void*) parentView); - - HIViewRef pluginView = HIViewGetFirstSubview (parentView); - - #if ! JucePlugin_EditorRequiresKeyboardFocus - HIViewSetActivated (pluginView, false); - #endif - /* This is a convoluted and desperate workaround for a Digi (or maybe Apple) - layout bug. Until the parent control gets some kind of mouse-move - event, then our plugin's HIView remains stuck at (0, 0) in the - window (despite drawing correctly), which blocks mouse events from - getting to the widgets above it. - - After days of frustration the only hack I can find that works - is to use this arcane function to redirect mouse events to - the parent, while running a timer to spot the moment when our - view mysteriously snaps back to its correct location. - - If anyone at Digi or Apple is reading this and they realise that it's - their fault, could they please give me back the week of my life that - they made me waste on this rubbish. Thankyou. - */ - SetControlSupervisor (pluginView, parentView); - startTimer (150); + nsWindow = attachSubWindow (hostWindow, this); #endif + setVisible (true); #if JUCE_WIN32 && ! JucePlugin_EditorRequiresKeyboardFocus Desktop::getInstance().addFocusChangeListener (this); @@ -421,16 +354,12 @@ public: #endif #if JUCE_MAC - delete forcedRepaintTimer; + removeSubWindow (nsWindow, this); #endif } void paint (Graphics&) { -#if JUCE_MAC - if (forcedRepaintTimer != 0) - forcedRepaintTimer->stopTimer(); -#endif } void resized() @@ -443,38 +372,6 @@ public: repaint(); } -#if JUCE_MAC - void timerCallback() - { - // Wait for the moment when PT deigns to allow our view to - // take up its actual location (see rant above) - HIViewRef content = 0; - HIViewFindByID (HIViewGetRoot ((WindowRef) hostWindow), kHIViewWindowContentID, &content); - HIPoint p = { 0.0f, 0.0f }; - - HIViewRef v = HIViewGetFirstSubview (parentView); - HIViewConvertPoint (&p, v, content); - - if (p.y > 12) - { - if (p.x != titleW || p.y != titleH) - { - GrafPtr oldport; - GetPort (&oldport); - SetPort (owner->GetViewPort()); - SetOrigin (-titleW, -titleH); - SetPort (oldport); - } - - HIViewRef v = HIViewGetFirstSubview (parentView); - SetControlSupervisor (v, 0); - stopTimer(); - - forcedRepaintTimer = new RepaintCheckTimer (*this); - } - } -#endif - #if JUCE_WIN32 void globalFocusChanged (JUCE_NAMESPACE::Component*) { @@ -492,72 +389,22 @@ public: #if JUCE_WIN32 resizeHostWindow (hostWindow, titleW, titleH, this); - owner->updateSize(); -#else - Rect r; - GetWindowBounds ((WindowRef) hostWindow, kWindowContentRgn, &r); - - HIRect p; - zerostruct (p); - HIViewConvertRect (&p, parentView, 0); // find the X position of our view in case there's space to the left of it - - r.right = r.left + jmax (titleW, ((int) p.origin.x) + getWidth()); - r.bottom = r.top + getHeight() + titleH; - - SetWindowBounds ((WindowRef) hostWindow, kWindowContentRgn, &r); - - owner->updateSize(); - owner->Invalidate(); #endif + owner->updateSize(); } - //============================================================================== - juce_UseDebuggingNewOperator - -#if JUCE_MAC - protected: - void internalRepaint (int x, int y, int w, int h) + void userTriedToCloseWindow() { - Component::internalRepaint (x, y, w, h); - owner->Invalidate(); - - if (forcedRepaintTimer != 0 && ! forcedRepaintTimer->isTimerRunning()) - forcedRepaintTimer->startTimer (1000 / 25); } - HIViewRef parentView; -#endif + //============================================================================== + juce_UseDebuggingNewOperator private: void* const hostWindow; + void* nsWindow; JuceCustomUIView* const owner; int titleW, titleH; - -#if JUCE_MAC - // if PT makes us wait too long for a redraw after we've - // asked for one, this should kick in and force one to happen - class RepaintCheckTimer : public Timer - { - public: - RepaintCheckTimer (EditorCompWrapper& owner_) - : owner (owner_) - { - } - - void timerCallback() - { - stopTimer(); - ComponentPeer* const peer = owner.getPeer(); - - if (peer != 0) - peer->performAnyPendingRepaintsNow(); - } - - EditorCompWrapper& owner; - }; - - RepaintCheckTimer* forcedRepaintTimer; -#endif }; }; @@ -705,6 +552,7 @@ protected: #if defined (JUCE_DEBUG) || JUCE_LOG_ASSERTIONS const int numMidiEventsComingIn = midiEvents.getNumEvents(); + (void) numMidiEventsComingIn; #endif { @@ -744,7 +592,7 @@ protected: if (! midiEvents.isEmpty()) { #if JucePlugin_ProducesMidiOutput - const uint8* midiEventData; + const juce::uint8* midiEventData; int midiEventSize, midiEventPosition; MidiBuffer::Iterator i (midiEvents); diff --git a/extras/audio plugins/wrapper/formats/VST/MacExportedSymbols.txt b/extras/audio plugins/wrapper/formats/VST/MacExportedSymbols.txt new file mode 100644 index 0000000000..a71eebdde5 --- /dev/null +++ b/extras/audio plugins/wrapper/formats/VST/MacExportedSymbols.txt @@ -0,0 +1,12 @@ +# +# This file contains a list of the symbols that your VST plugin needs to export. +# +# It's very important that you refer to this file in your linker settings, under +# the "Exported Symbols File" heading. If you don't specify that these are the +# only two symbols exported, the linker will also export all the Obj-C symbols in +# Juce, and this will create all sorts of dynamic link problems when you have +# more than one juce-linked module loaded at the same time. +# + +_VSTPluginMain +_main_macho diff --git a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp index 3d0251a61e..dd90fa1793 100644 --- a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.cpp @@ -30,7 +30,7 @@ */ /* - *** DON't EDIT THIS FILE!! *** + *** DON'T EDIT THIS FILE!! *** The idea is that everyone's plugins should share this same wrapper code, so if you start hacking around in here you're missing the point! @@ -119,7 +119,8 @@ #pragma pack (push, 8) #endif -#include "../../../../../juce_amalgamated.h" +//#include "../../../../../juce_amalgamated.h" +#include "../../../../../juce.h" #ifdef _MSC_VER #pragma pack (pop) @@ -136,6 +137,10 @@ BEGIN_JUCE_NAMESPACE #if JUCE_MAC extern void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId) throw(); + extern void* attachComponentToWindowRef (Component* component, void* windowRef); + extern void detachComponentFromWindowRef (Component* component, void* nsWindow); + extern void setNativeHostWindowSize (void* nsWindow, Component* editorComp, int newWidth, int newHeight); + extern void checkWindowVisibility (void* nsWindow, Component* component); #endif #if JUCE_LINUX @@ -355,7 +360,6 @@ public: outgoingEventSize = 0; chunkMemoryTime = 0; isProcessing = false; - firstResize = true; hasShutdown = false; firstProcessCallback = true; shouldDeleteEditor = false; @@ -438,6 +442,18 @@ public: void open() { + if (editorComp == 0) + { + AudioProcessorEditor* const ed = filter->createEditorIfNeeded(); + + if (ed != 0) + cEffect.flags |= effFlagsHasEditor; + else + cEffect.flags &= ~effFlagsHasEditor; + + delete ed; + } + startTimer (1000 / 4); } @@ -654,7 +670,7 @@ public: { if (outputs[j] == chan) { - chan = juce_malloc (sizeof (float) * blockSize * 2); + chan = (float*) juce_malloc (sizeof (float) * blockSize * 2); tempChannels.set (i, chan); break; } @@ -1062,6 +1078,11 @@ public: chunkMemory.setSize (0); } +#if JUCE_MAC + if (hostWindow != 0) + checkWindowVisibility (hostWindow, editorComp); +#endif + tryMasterIdle(); } @@ -1117,13 +1138,18 @@ public: if (ed != 0) { + cEffect.flags |= effFlagsHasEditor; ed->setOpaque (true); ed->setVisible (true); editorComp = new EditorCompWrapper (this, ed); } + else + { + cEffect.flags &= ~effFlagsHasEditor; + } } - + shouldDeleteEditor = false; } @@ -1144,7 +1170,7 @@ public: if (modalComponent != 0) { modalComponent->exitModalState (0); - + if (canDeleteLaterIfModal) { shouldDeleteEditor = true; @@ -1152,6 +1178,11 @@ public: } } +#if JUCE_MAC + detachComponentFromWindowRef (editorComp, hostWindow); + hostWindow = 0; +#endif + filter->editorBeingDeleted (editorComp->getEditorComp()); deleteAndZero (editorComp); @@ -1161,7 +1192,7 @@ public: jassert (Component::getCurrentlyModalComponent() == 0); } -#if JUCE_MAC || JUCE_LINUX +#if JUCE_LINUX hostWindow = 0; #endif @@ -1196,59 +1227,22 @@ public: #if JUCE_WIN32 editorComp->addToDesktop (0); - hostWindow = (HWND) ptr; HWND editorWnd = (HWND) editorComp->getWindowHandle(); - SetParent (editorWnd, hostWindow); DWORD val = GetWindowLong (editorWnd, GWL_STYLE); val = (val & ~WS_POPUP) | WS_CHILD; SetWindowLong (editorWnd, GWL_STYLE, val); - - editorComp->setVisible (true); #elif JUCE_LINUX editorComp->addToDesktop (0); - hostWindow = (Window) ptr; - Window editorWnd = (Window) editorComp->getWindowHandle(); - XReparentWindow (display, editorWnd, hostWindow, 0, 0); - - editorComp->setVisible (true); #else - hostWindow = (WindowRef) ptr; - firstResize = true; - - SetAutomaticControlDragTrackingEnabledForWindow (hostWindow, true); - - WindowAttributes attributes; - GetWindowAttributes (hostWindow, &attributes); - - HIViewRef parentView = 0; - - if ((attributes & kWindowCompositingAttribute) != 0) - { - HIViewRef root = HIViewGetRoot (hostWindow); - HIViewFindByID (root, kHIViewWindowContentID, &parentView); - - if (parentView == 0) - parentView = root; - } - else - { - GetRootControl (hostWindow, (ControlRef*) &parentView); - - if (parentView == 0) - CreateRootControl (hostWindow, (ControlRef*) &parentView); - } - - jassert (parentView != 0); // agh - the host has to provide a compositing window.. - - editorComp->setVisible (true); - editorComp->addToDesktop (0, (void*) parentView); + hostWindow = attachComponentToWindowRef (editorComp, (WindowRef) ptr); #endif + editorComp->setVisible (true); return 1; } @@ -1292,25 +1286,7 @@ public: { // some hosts don't support the sizeWindow call, so do it manually.. #if JUCE_MAC - Rect r; - GetWindowBounds (hostWindow, kWindowContentRgn, &r); - - if (firstResize) - { - diffW = (r.right - r.left) - editorComp->getWidth(); - diffH = (r.bottom - r.top) - editorComp->getHeight(); - firstResize = false; - } - - r.right = r.left + newWidth + diffW; - r.bottom = r.top + newHeight + diffH; - - SetWindowBounds (hostWindow, kWindowContentRgn, &r); - - r.bottom -= r.top; - r.right -= r.left; - r.left = r.top = 0; - InvalWindowRect (hostWindow, &r); + setNativeHostWindowSize (hostWindow, editorComp, newWidth, newHeight); #elif JUCE_LINUX Window root; int x, y; @@ -1394,7 +1370,6 @@ private: VstEvents* outgoingEvents; int outgoingEventSize; bool isProcessing; - bool firstResize; bool hasShutdown; bool firstProcessCallback; int diffW, diffH; @@ -1452,7 +1427,7 @@ private: } #if JUCE_MAC - WindowRef hostWindow; + void* hostWindow; #elif JUCE_LINUX Window hostWindow; #else @@ -1497,8 +1472,6 @@ static AEffect* pluginEntryPoint (audioMasterCallback audioMaster) juce_setCurrentExecutableFileNameFromBundleId (JucePlugin_CFBundleIdentifier); #endif - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); - try { if (audioMaster (0, audioMasterVersion, 0, 0, 0, 0) != 0) diff --git a/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.mm b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.mm new file mode 100644 index 0000000000..2cc70ace50 --- /dev/null +++ b/extras/audio plugins/wrapper/formats/VST/juce_VstWrapper.mm @@ -0,0 +1,111 @@ +/* + ============================================================================== + + 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 +#include "../../../../../juce.h" + + +BEGIN_JUCE_NAMESPACE + +void* attachComponentToWindowRef (Component* comp, void* windowRef) +{ + const ScopedAutoReleasePool pool; + + NSWindow* hostWindow = [[NSWindow alloc] initWithWindowRef: windowRef]; + [hostWindow retain]; + [hostWindow setCanHide: YES]; + [hostWindow setReleasedWhenClosed: YES]; + + NSView* content = [hostWindow contentView]; + NSRect f = [content frame]; + NSPoint windowPos = [hostWindow convertBaseToScreen: f.origin]; + windowPos.y = [[NSScreen mainScreen] frame].size.height - (windowPos.y + f.size.height); + comp->setTopLeftPosition ((int) windowPos.x, (int) windowPos.y); + +#if ! JucePlugin_EditorRequiresKeyboardFocus + comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses); +#else + comp->addToDesktop (ComponentPeer::windowIsTemporary); +#endif + + comp->setVisible (true); + comp->toFront (false); + + NSView* pluginView = (NSView*) comp->getWindowHandle(); + NSWindow* pluginWindow = [pluginView window]; + [pluginWindow setExcludedFromWindowsMenu: YES]; + + [hostWindow addChildWindow: pluginWindow + ordered: NSWindowAbove]; + [hostWindow orderFront: nil]; + [pluginWindow orderFront: nil]; + return hostWindow; +} + +void detachComponentFromWindowRef (Component* comp, void* nsWindow) +{ + NSWindow* hostWindow = (NSWindow*) nsWindow; + if (hostWindow != 0) + { + const ScopedAutoReleasePool pool; + + NSView* pluginView = (NSView*) comp->getWindowHandle(); + NSWindow* pluginWindow = [pluginView window]; + + [hostWindow removeChildWindow: pluginWindow]; + comp->removeFromDesktop(); + + [hostWindow release]; + } +} + +void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth, int newHeight) +{ + NSWindow* hostWindow = (NSWindow*) nsWindow; + if (hostWindow != 0) + { + ScopedAutoReleasePool pool; + + NSRect f = [hostWindow frame]; + f.size.width += newWidth - component->getWidth(); + f.size.height += newHeight - component->getHeight(); + [hostWindow setFrame: f display: YES]; + } +} + +void checkWindowVisibility (void* nsWindow, Component* comp) +{ + NSWindow* hostWindow = (NSWindow*) nsWindow; + comp->setVisible ([hostWindow isVisible]); +} + +END_JUCE_NAMESPACE diff --git a/extras/example projects/example_project_for_Mac/juce_application.xcodeproj/project.pbxproj b/extras/example projects/example_project_for_Mac/juce_application.xcodeproj/project.pbxproj index 95c4c02fd2..90d8b0f5b7 100644 --- a/extras/example projects/example_project_for_Mac/juce_application.xcodeproj/project.pbxproj +++ b/extras/example projects/example_project_for_Mac/juce_application.xcodeproj/project.pbxproj @@ -7,11 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 84078F3E09E6B42E004E7BCD /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84078F3D09E6B42E004E7BCD /* AGL.framework */; }; 8407902B09E6B5BD004E7BCD /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8407902A09E6B5BD004E7BCD /* QuickTime.framework */; }; 841083D50DB36EA400AB8583 /* MainComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841083D30DB36EA400AB8583 /* MainComponent.cpp */; }; 841084880DB374E700AB8583 /* juce.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 841084870DB374E700AB8583 /* juce.xcconfig */; }; 841136A00D0480DE0054B790 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8411369F0D0480DE0054B790 /* OpenGL.framework */; }; + 846EC7870EB607050080CCFF /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846EC7860EB607050080CCFF /* QTKit.framework */; }; 84F30CD108FEAAA20087E26C /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F30CD008FEAAA20087E26C /* Main.cpp */; }; 84F30CED08FEAD7A0087E26C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F30CEC08FEAD7A0087E26C /* CoreAudio.framework */; }; 84FAD61A0C7C3CCB00AF3028 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FAD6190C7C3CCB00AF3028 /* IOKit.framework */; }; @@ -22,21 +22,19 @@ 84FBB8880E06CCE900B52196 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FBB8870E06CCE900B52196 /* AudioUnit.framework */; }; 84FBB88D0E06CD0100B52196 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FBB88C0E06CD0100B52196 /* WebKit.framework */; }; 8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; }; - 8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; - 84078F3D09E6B42E004E7BCD /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 8407902A09E6B5BD004E7BCD /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 841083D20DB36EA400AB8583 /* includes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = includes.h; path = ../common/includes.h; sourceTree = SOURCE_ROOT; }; 841083D30DB36EA400AB8583 /* MainComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MainComponent.cpp; path = ../common/MainComponent.cpp; sourceTree = SOURCE_ROOT; }; 841083D40DB36EA400AB8583 /* MainComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainComponent.h; path = ../common/MainComponent.h; sourceTree = SOURCE_ROOT; }; 841084870DB374E700AB8583 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; 8411369F0D0480DE0054B790 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; + 846EC7860EB607050080CCFF /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 84F30CD008FEAAA20087E26C /* Main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Main.cpp; path = ../common/Main.cpp; sourceTree = SOURCE_ROOT; }; 84F30CEC08FEAD7A0087E26C /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 84FAD6190C7C3CCB00AF3028 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; @@ -56,9 +54,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8D0C4E920486CD37000505A6 /* Carbon.framework in Frameworks */, 84F30CED08FEAD7A0087E26C /* CoreAudio.framework in Frameworks */, - 84078F3E09E6B42E004E7BCD /* AGL.framework in Frameworks */, 8407902B09E6B5BD004E7BCD /* QuickTime.framework in Frameworks */, 84FAD61A0C7C3CCB00AF3028 /* IOKit.framework in Frameworks */, 841136A00D0480DE0054B790 /* OpenGL.framework in Frameworks */, @@ -67,6 +63,7 @@ 84FBB87B0E06CCC600B52196 /* DiscRecording.framework in Frameworks */, 84FBB8880E06CCE900B52196 /* AudioUnit.framework in Frameworks */, 84FBB88D0E06CD0100B52196 /* WebKit.framework in Frameworks */, + 846EC7870EB607050080CCFF /* QTKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -120,13 +117,12 @@ children = ( 84FBB8870E06CCE900B52196 /* AudioUnit.framework */, 84FBB8720E06CC5D00B52196 /* Cocoa.framework */, - 20286C33FDCF999611CA2CEA /* Carbon.framework */, 4A9504CAFFE6A41611CA0CBA /* CoreServices.framework */, 84F30CEC08FEAD7A0087E26C /* CoreAudio.framework */, 84FBB8760E06CCB200B52196 /* CoreMIDI.framework */, 84FBB87A0E06CCC600B52196 /* DiscRecording.framework */, 4A9504C8FFE6A3BC11CA0CBA /* ApplicationServices.framework */, - 84078F3D09E6B42E004E7BCD /* AGL.framework */, + 846EC7860EB607050080CCFF /* QTKit.framework */, 8407902A09E6B5BD004E7BCD /* QuickTime.framework */, 84FAD6190C7C3CCB00AF3028 /* IOKit.framework */, 8411369F0D0480DE0054B790 /* OpenGL.framework */, diff --git a/extras/juce demo/build/linux/JuceDemo.make b/extras/juce demo/build/linux/JuceDemo.make index 9a1a81d048..a47186570f 100644 --- a/extras/juce demo/build/linux/JuceDemo.make +++ b/extras/juce demo/build/linux/JuceDemo.make @@ -36,21 +36,21 @@ ifeq ($(CONFIG),Release) endif OBJECTS := \ + $(OBJDIR)/MainDemoWindow.o \ $(OBJDIR)/ApplicationStartup.o \ - $(OBJDIR)/BinaryData.o \ $(OBJDIR)/juce_LibrarySource.o \ - $(OBJDIR)/MainDemoWindow.o \ - $(OBJDIR)/AudioDemo.o \ + $(OBJDIR)/BinaryData.o \ + $(OBJDIR)/PathsAndTransformsDemo.o \ $(OBJDIR)/DragAndDropDemo.o \ - $(OBJDIR)/FontsAndTextDemo.o \ - $(OBJDIR)/InterprocessCommsDemo.o \ + $(OBJDIR)/ThreadingDemo.o \ $(OBJDIR)/OpenGLDemo.o \ - $(OBJDIR)/PathsAndTransformsDemo.o \ + $(OBJDIR)/WidgetsDemo.o \ + $(OBJDIR)/TreeViewDemo.o \ $(OBJDIR)/QuickTimeDemo.o \ + $(OBJDIR)/InterprocessCommsDemo.o \ + $(OBJDIR)/AudioDemo.o \ + $(OBJDIR)/FontsAndTextDemo.o \ $(OBJDIR)/TableDemo.o \ - $(OBJDIR)/ThreadingDemo.o \ - $(OBJDIR)/TreeViewDemo.o \ - $(OBJDIR)/WidgetsDemo.o \ MKDIR_TYPE := msdos CMD := $(subst \,\\,$(ComSpec)$(COMSPEC)) @@ -91,12 +91,12 @@ else -@if exist $(subst /,\,$(OBJDIR)) rmdir /s /q $(subst /,\,$(OBJDIR)) endif -$(OBJDIR)/ApplicationStartup.o: ../../src/ApplicationStartup.cpp +$(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/BinaryData.o: ../../src/BinaryData.cpp +$(OBJDIR)/ApplicationStartup.o: ../../src/ApplicationStartup.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -106,12 +106,12 @@ $(OBJDIR)/juce_LibrarySource.o: ../../src/juce_LibrarySource.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/MainDemoWindow.o: ../../src/MainDemoWindow.cpp +$(OBJDIR)/BinaryData.o: ../../src/BinaryData.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/AudioDemo.o: ../../src/demos/AudioDemo.cpp +$(OBJDIR)/PathsAndTransformsDemo.o: ../../src/demos/PathsAndTransformsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -121,22 +121,22 @@ $(OBJDIR)/DragAndDropDemo.o: ../../src/demos/DragAndDropDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/FontsAndTextDemo.o: ../../src/demos/FontsAndTextDemo.cpp +$(OBJDIR)/ThreadingDemo.o: ../../src/demos/ThreadingDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/InterprocessCommsDemo.o: ../../src/demos/InterprocessCommsDemo.cpp +$(OBJDIR)/OpenGLDemo.o: ../../src/demos/OpenGLDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/OpenGLDemo.o: ../../src/demos/OpenGLDemo.cpp +$(OBJDIR)/WidgetsDemo.o: ../../src/demos/WidgetsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/PathsAndTransformsDemo.o: ../../src/demos/PathsAndTransformsDemo.cpp +$(OBJDIR)/TreeViewDemo.o: ../../src/demos/TreeViewDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< @@ -146,22 +146,22 @@ $(OBJDIR)/QuickTimeDemo.o: ../../src/demos/QuickTimeDemo.cpp @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/TableDemo.o: ../../src/demos/TableDemo.cpp +$(OBJDIR)/InterprocessCommsDemo.o: ../../src/demos/InterprocessCommsDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/ThreadingDemo.o: ../../src/demos/ThreadingDemo.cpp +$(OBJDIR)/AudioDemo.o: ../../src/demos/AudioDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/TreeViewDemo.o: ../../src/demos/TreeViewDemo.cpp +$(OBJDIR)/FontsAndTextDemo.o: ../../src/demos/FontsAndTextDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< -$(OBJDIR)/WidgetsDemo.o: ../../src/demos/WidgetsDemo.cpp +$(OBJDIR)/TableDemo.o: ../../src/demos/TableDemo.cpp -@$(CMD_MKOBJDIR) @echo $(notdir $<) @$(CXX) $(CXXFLAGS) -o $@ -c $< diff --git a/extras/juce demo/build/macosx/Info.plist b/extras/juce demo/build/macosx/Info.plist index f47341ab27..1e0ccac15a 100644 --- a/extras/juce demo/build/macosx/Info.plist +++ b/extras/juce demo/build/macosx/Info.plist @@ -1,24 +1,28 @@ - + CFBundleDevelopmentRegion English CFBundleExecutable - jucedemo + ${EXECUTABLE_NAME} CFBundleIconFile - CFBundleIdentifier - com.apple.myCarbonNibApp + CFBundleIdentifier + com.rawmaterialsoftware.${PRODUCT_NAME:identifier} CFBundleInfoDictionaryVersion 6.0 + CFBundleName + ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleSignature ???? CFBundleVersion - 0.1 - CSResourcesFileMapped - + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication diff --git a/extras/juce demo/build/macosx/jucedemo.xcodeproj/project.pbxproj b/extras/juce demo/build/macosx/jucedemo.xcodeproj/project.pbxproj index c85c8cbbaa..1b1494c5be 100644 --- a/extras/juce demo/build/macosx/jucedemo.xcodeproj/project.pbxproj +++ b/extras/juce demo/build/macosx/jucedemo.xcodeproj/project.pbxproj @@ -3,231 +3,180 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ - 8417EE7A0A6E7EB90058E04E /* TableDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8417EE790A6E7EB90058E04E /* TableDemo.cpp */; }; - 842A97B8081060FB0059DBCC /* DragAndDropDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 842A97B6081060FB0059DBCC /* DragAndDropDemo.cpp */; }; - 842A97B9081060FB0059DBCC /* OpenGLDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 842A97B7081060FB0059DBCC /* OpenGLDemo.cpp */; }; - 846929270A49DDE100314975 /* juce.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 846929260A49DDE100314975 /* juce.xcconfig */; }; - 846C10970DE32E6E00E8CCE8 /* juce_AppConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 846C10960DE32E6D00E8CCE8 /* juce_AppConfig.h */; }; - 846C10B20DE32EB500E8CCE8 /* juce_LibrarySource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 846C10B10DE32EB500E8CCE8 /* juce_LibrarySource.mm */; }; - 8480BC1C0DE0BB8200478E44 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC0E0DE0BB8200478E44 /* AGL.framework */; }; - 8480BC1D0DE0BB8200478E44 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC0F0DE0BB8200478E44 /* AudioUnit.framework */; }; - 8480BC1E0DE0BB8200478E44 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC100DE0BB8200478E44 /* IOKit.framework */; }; - 8480BC1F0DE0BB8200478E44 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC110DE0BB8200478E44 /* Cocoa.framework */; }; - 8480BC200DE0BB8200478E44 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC120DE0BB8200478E44 /* CoreAudio.framework */; }; - 8480BC210DE0BB8200478E44 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC130DE0BB8200478E44 /* CoreFoundation.framework */; }; - 8480BC220DE0BB8200478E44 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC140DE0BB8200478E44 /* CoreMIDI.framework */; }; - 8480BC230DE0BB8200478E44 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC150DE0BB8200478E44 /* DiscRecording.framework */; }; - 8480BC240DE0BB8200478E44 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC160DE0BB8200478E44 /* OpenGL.framework */; }; - 8480BC250DE0BB8200478E44 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC170DE0BB8200478E44 /* QuickTime.framework */; }; - 8480BC260DE0BB8200478E44 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC180DE0BB8200478E44 /* WebKit.framework */; }; - 8480BC270DE0BB8200478E44 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC190DE0BB8200478E44 /* Carbon.framework */; }; - 8480BC280DE0BB8200478E44 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC1A0DE0BB8200478E44 /* CoreServices.framework */; }; - 8480BC290DE0BB8200478E44 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8480BC1B0DE0BB8200478E44 /* ApplicationServices.framework */; }; - 849E1BF706C15C330002E024 /* BinaryData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 849E1BF506C15C330002E024 /* BinaryData.cpp */; }; - 849E1BF806C15C330002E024 /* BinaryData.h in Headers */ = {isa = PBXBuildFile; fileRef = 849E1BF606C15C330002E024 /* BinaryData.h */; }; - 84A06BA809CAD661006A43BD /* InterprocessCommsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A06BA709CAD661006A43BD /* InterprocessCommsDemo.cpp */; }; - 84C49E5506C0EE8C0066071B /* ApplicationStartup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E4A06C0EE8C0066071B /* ApplicationStartup.cpp */; }; - 84C49E5606C0EE8C0066071B /* AudioDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E4C06C0EE8C0066071B /* AudioDemo.cpp */; }; - 84C49E5706C0EE8C0066071B /* FontsAndTextDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E4D06C0EE8C0066071B /* FontsAndTextDemo.cpp */; }; - 84C49E5806C0EE8C0066071B /* PathsAndTransformsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E4E06C0EE8C0066071B /* PathsAndTransformsDemo.cpp */; }; - 84C49E5906C0EE8C0066071B /* ThreadingDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E4F06C0EE8C0066071B /* ThreadingDemo.cpp */; }; - 84C49E5A06C0EE8C0066071B /* TreeViewDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E5006C0EE8C0066071B /* TreeViewDemo.cpp */; }; - 84C49E5B06C0EE8C0066071B /* WidgetsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E5106C0EE8C0066071B /* WidgetsDemo.cpp */; }; - 84C49E5C06C0EE8C0066071B /* jucedemo_headers.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C49E5206C0EE8C0066071B /* jucedemo_headers.h */; }; - 84C49E5D06C0EE8C0066071B /* MainDemoWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C49E5306C0EE8C0066071B /* MainDemoWindow.cpp */; }; - 84C49E5E06C0EE8C0066071B /* MainDemoWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C49E5406C0EE8C0066071B /* MainDemoWindow.h */; }; - 84F8DB0B099CA8DD00E911ED /* QuickTimeDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F8DB0A099CA8DD00E911ED /* QuickTimeDemo.cpp */; }; - 8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; }; + 841FE43C0E8ABDD4003C3263 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE4360E8ABDD4003C3263 /* CoreAudio.framework */; }; + 841FE43D0E8ABDD4003C3263 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE4370E8ABDD4003C3263 /* CoreMIDI.framework */; }; + 841FE43E0E8ABDD4003C3263 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE4380E8ABDD4003C3263 /* DiscRecording.framework */; }; + 841FE43F0E8ABDD4003C3263 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE4390E8ABDD4003C3263 /* IOKit.framework */; }; + 841FE4400E8ABDD4003C3263 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE43A0E8ABDD4003C3263 /* OpenGL.framework */; }; + 841FE4410E8ABDD4003C3263 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FE43B0E8ABDD4003C3263 /* WebKit.framework */; }; + 8450577A0EB52CE500029DFF /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 845057790EB52CE500029DFF /* QuickTime.framework */; }; + 847F4D900E8AC35C00F64426 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 847F4D8F0E8AC35C00F64426 /* QTKit.framework */; }; + 847F4EA50E8BA9C300F64426 /* AudioDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9A0E8BA9C300F64426 /* AudioDemo.cpp */; }; + 847F4EA60E8BA9C300F64426 /* DragAndDropDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9B0E8BA9C300F64426 /* DragAndDropDemo.cpp */; }; + 847F4EA70E8BA9C300F64426 /* FontsAndTextDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9C0E8BA9C300F64426 /* FontsAndTextDemo.cpp */; }; + 847F4EA80E8BA9C300F64426 /* InterprocessCommsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9D0E8BA9C300F64426 /* InterprocessCommsDemo.cpp */; }; + 847F4EA90E8BA9C300F64426 /* OpenGLDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9E0E8BA9C300F64426 /* OpenGLDemo.cpp */; }; + 847F4EAA0E8BA9C300F64426 /* PathsAndTransformsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4E9F0E8BA9C300F64426 /* PathsAndTransformsDemo.cpp */; }; + 847F4EAB0E8BA9C300F64426 /* QuickTimeDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EA00E8BA9C300F64426 /* QuickTimeDemo.cpp */; }; + 847F4EAC0E8BA9C300F64426 /* TableDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EA10E8BA9C300F64426 /* TableDemo.cpp */; }; + 847F4EAD0E8BA9C300F64426 /* ThreadingDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EA20E8BA9C300F64426 /* ThreadingDemo.cpp */; }; + 847F4EAE0E8BA9C300F64426 /* TreeViewDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EA30E8BA9C300F64426 /* TreeViewDemo.cpp */; }; + 847F4EAF0E8BA9C300F64426 /* WidgetsDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EA40E8BA9C300F64426 /* WidgetsDemo.cpp */; }; + 847F4EB80E8BA9DD00F64426 /* ApplicationStartup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EB00E8BA9DD00F64426 /* ApplicationStartup.cpp */; }; + 847F4EB90E8BA9DD00F64426 /* BinaryData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EB10E8BA9DD00F64426 /* BinaryData.cpp */; }; + 847F4EBA0E8BA9DD00F64426 /* juce_LibrarySource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EB40E8BA9DD00F64426 /* juce_LibrarySource.mm */; }; + 847F4EBB0E8BA9DD00F64426 /* MainDemoWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 847F4EB60E8BA9DD00F64426 /* MainDemoWindow.cpp */; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 8417EE790A6E7EB90058E04E /* TableDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TableDemo.cpp; sourceTree = ""; }; - 842A97B6081060FB0059DBCC /* DragAndDropDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DragAndDropDemo.cpp; sourceTree = ""; }; - 842A97B7081060FB0059DBCC /* OpenGLDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = OpenGLDemo.cpp; sourceTree = ""; }; - 846929260A49DDE100314975 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; - 846C10960DE32E6D00E8CCE8 /* juce_AppConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_AppConfig.h; path = ../../src/juce_AppConfig.h; sourceTree = SOURCE_ROOT; }; - 846C10B10DE32EB500E8CCE8 /* juce_LibrarySource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_LibrarySource.mm; path = ../../src/juce_LibrarySource.mm; sourceTree = SOURCE_ROOT; }; - 8480BC0E0DE0BB8200478E44 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; - 8480BC0F0DE0BB8200478E44 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - 8480BC100DE0BB8200478E44 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - 8480BC110DE0BB8200478E44 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 8480BC120DE0BB8200478E44 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; - 8480BC130DE0BB8200478E44 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 8480BC140DE0BB8200478E44 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = ""; }; - 8480BC150DE0BB8200478E44 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; - 8480BC160DE0BB8200478E44 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 8480BC170DE0BB8200478E44 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; - 8480BC180DE0BB8200478E44 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; - 8480BC190DE0BB8200478E44 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; - 8480BC1A0DE0BB8200478E44 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; - 8480BC1B0DE0BB8200478E44 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; - 849E1BF506C15C330002E024 /* BinaryData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BinaryData.cpp; path = ../../src/BinaryData.cpp; sourceTree = SOURCE_ROOT; }; - 849E1BF606C15C330002E024 /* BinaryData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BinaryData.h; path = ../../src/BinaryData.h; sourceTree = SOURCE_ROOT; }; - 84A06BA709CAD661006A43BD /* InterprocessCommsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InterprocessCommsDemo.cpp; sourceTree = ""; }; - 84C49E4A06C0EE8C0066071B /* ApplicationStartup.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ApplicationStartup.cpp; path = ../../src/ApplicationStartup.cpp; sourceTree = SOURCE_ROOT; }; - 84C49E4C06C0EE8C0066071B /* AudioDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AudioDemo.cpp; sourceTree = ""; }; - 84C49E4D06C0EE8C0066071B /* FontsAndTextDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontsAndTextDemo.cpp; sourceTree = ""; }; - 84C49E4E06C0EE8C0066071B /* PathsAndTransformsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PathsAndTransformsDemo.cpp; sourceTree = ""; }; - 84C49E4F06C0EE8C0066071B /* ThreadingDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadingDemo.cpp; sourceTree = ""; }; - 84C49E5006C0EE8C0066071B /* TreeViewDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TreeViewDemo.cpp; sourceTree = ""; }; - 84C49E5106C0EE8C0066071B /* WidgetsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetsDemo.cpp; sourceTree = ""; }; - 84C49E5206C0EE8C0066071B /* jucedemo_headers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = jucedemo_headers.h; path = ../../src/jucedemo_headers.h; sourceTree = SOURCE_ROOT; }; - 84C49E5306C0EE8C0066071B /* MainDemoWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MainDemoWindow.cpp; path = ../../src/MainDemoWindow.cpp; sourceTree = SOURCE_ROOT; }; - 84C49E5406C0EE8C0066071B /* MainDemoWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MainDemoWindow.h; path = ../../src/MainDemoWindow.h; sourceTree = SOURCE_ROOT; }; - 84F8DB0A099CA8DD00E911ED /* QuickTimeDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = QuickTimeDemo.cpp; sourceTree = ""; }; - 8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D0C4E970486CD37000505A6 /* jucedemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = jucedemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 841FE4360E8ABDD4003C3263 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; + 841FE4370E8ABDD4003C3263 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = /System/Library/Frameworks/CoreMIDI.framework; sourceTree = ""; }; + 841FE4380E8ABDD4003C3263 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; + 841FE4390E8ABDD4003C3263 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 841FE43A0E8ABDD4003C3263 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; + 841FE43B0E8ABDD4003C3263 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 845057790EB52CE500029DFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + 847F4D8F0E8AC35C00F64426 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; + 847F4E9A0E8BA9C300F64426 /* AudioDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioDemo.cpp; path = ../../src/demos/AudioDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4E9B0E8BA9C300F64426 /* DragAndDropDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DragAndDropDemo.cpp; path = ../../src/demos/DragAndDropDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4E9C0E8BA9C300F64426 /* FontsAndTextDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontsAndTextDemo.cpp; path = ../../src/demos/FontsAndTextDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4E9D0E8BA9C300F64426 /* InterprocessCommsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InterprocessCommsDemo.cpp; path = ../../src/demos/InterprocessCommsDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4E9E0E8BA9C300F64426 /* OpenGLDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenGLDemo.cpp; path = ../../src/demos/OpenGLDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4E9F0E8BA9C300F64426 /* PathsAndTransformsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathsAndTransformsDemo.cpp; path = ../../src/demos/PathsAndTransformsDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EA00E8BA9C300F64426 /* QuickTimeDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuickTimeDemo.cpp; path = ../../src/demos/QuickTimeDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EA10E8BA9C300F64426 /* TableDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TableDemo.cpp; path = ../../src/demos/TableDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EA20E8BA9C300F64426 /* ThreadingDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadingDemo.cpp; path = ../../src/demos/ThreadingDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EA30E8BA9C300F64426 /* TreeViewDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TreeViewDemo.cpp; path = ../../src/demos/TreeViewDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EA40E8BA9C300F64426 /* WidgetsDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WidgetsDemo.cpp; path = ../../src/demos/WidgetsDemo.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EB00E8BA9DD00F64426 /* ApplicationStartup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApplicationStartup.cpp; path = ../../src/ApplicationStartup.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EB10E8BA9DD00F64426 /* BinaryData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BinaryData.cpp; path = ../../src/BinaryData.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EB20E8BA9DD00F64426 /* BinaryData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinaryData.h; path = ../../src/BinaryData.h; sourceTree = SOURCE_ROOT; }; + 847F4EB30E8BA9DD00F64426 /* juce_AppConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_AppConfig.h; path = ../../src/juce_AppConfig.h; sourceTree = SOURCE_ROOT; }; + 847F4EB40E8BA9DD00F64426 /* juce_LibrarySource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_LibrarySource.mm; path = ../../src/juce_LibrarySource.mm; sourceTree = SOURCE_ROOT; }; + 847F4EB50E8BA9DD00F64426 /* jucedemo_headers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jucedemo_headers.h; path = ../../src/jucedemo_headers.h; sourceTree = SOURCE_ROOT; }; + 847F4EB60E8BA9DD00F64426 /* MainDemoWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MainDemoWindow.cpp; path = ../../src/MainDemoWindow.cpp; sourceTree = SOURCE_ROOT; }; + 847F4EB70E8BA9DD00F64426 /* MainDemoWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainDemoWindow.h; path = ../../src/MainDemoWindow.h; sourceTree = SOURCE_ROOT; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* jucedemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = jucedemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8D0C4E910486CD37000505A6 /* Frameworks */ = { + 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8480BC1C0DE0BB8200478E44 /* AGL.framework in Frameworks */, - 8480BC1D0DE0BB8200478E44 /* AudioUnit.framework in Frameworks */, - 8480BC1E0DE0BB8200478E44 /* IOKit.framework in Frameworks */, - 8480BC1F0DE0BB8200478E44 /* Cocoa.framework in Frameworks */, - 8480BC200DE0BB8200478E44 /* CoreAudio.framework in Frameworks */, - 8480BC210DE0BB8200478E44 /* CoreFoundation.framework in Frameworks */, - 8480BC220DE0BB8200478E44 /* CoreMIDI.framework in Frameworks */, - 8480BC230DE0BB8200478E44 /* DiscRecording.framework in Frameworks */, - 8480BC240DE0BB8200478E44 /* OpenGL.framework in Frameworks */, - 8480BC250DE0BB8200478E44 /* QuickTime.framework in Frameworks */, - 8480BC260DE0BB8200478E44 /* WebKit.framework in Frameworks */, - 8480BC270DE0BB8200478E44 /* Carbon.framework in Frameworks */, - 8480BC280DE0BB8200478E44 /* CoreServices.framework in Frameworks */, - 8480BC290DE0BB8200478E44 /* ApplicationServices.framework in Frameworks */, + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 841FE43C0E8ABDD4003C3263 /* CoreAudio.framework in Frameworks */, + 841FE43D0E8ABDD4003C3263 /* CoreMIDI.framework in Frameworks */, + 841FE43E0E8ABDD4003C3263 /* DiscRecording.framework in Frameworks */, + 841FE43F0E8ABDD4003C3263 /* IOKit.framework in Frameworks */, + 841FE4400E8ABDD4003C3263 /* OpenGL.framework in Frameworks */, + 841FE4410E8ABDD4003C3263 /* WebKit.framework in Frameworks */, + 847F4D900E8AC35C00F64426 /* QTKit.framework in Frameworks */, + 8450577A0EB52CE500029DFF /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 195DF8CFFE9D517E11CA2CBB /* Products */ = { + 080E96DDFE201D6D7F000001 /* Source */ = { isa = PBXGroup; children = ( - 8D0C4E970486CD37000505A6 /* jucedemo.app */, + 847F4EB00E8BA9DD00F64426 /* ApplicationStartup.cpp */, + 847F4EB10E8BA9DD00F64426 /* BinaryData.cpp */, + 847F4EB20E8BA9DD00F64426 /* BinaryData.h */, + 847F4EB30E8BA9DD00F64426 /* juce_AppConfig.h */, + 847F4EB40E8BA9DD00F64426 /* juce_LibrarySource.mm */, + 847F4EB50E8BA9DD00F64426 /* jucedemo_headers.h */, + 847F4EB60E8BA9DD00F64426 /* MainDemoWindow.cpp */, + 847F4EB70E8BA9DD00F64426 /* MainDemoWindow.h */, + 847F4D8A0E8AC27A00F64426 /* demos */, ); - name = Products; + name = Source; sourceTree = ""; }; - 20286C29FDCF999611CA2CEA /* jucedemo */ = { + 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 20286C2AFDCF999611CA2CEA /* Sources */, - 841084950DB3759400AB8583 /* Build settings */, - 20286C2CFDCF999611CA2CEA /* Resources */, - 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */, - 195DF8CFFE9D517E11CA2CBB /* Products */, + 8D1107320486CEB800E47090 /* jucedemo.app */, ); - name = jucedemo; + name = Products; sourceTree = ""; }; - 20286C2AFDCF999611CA2CEA /* Sources */ = { + 29B97314FDCFA39411CA2CEA /* jucedemo */ = { isa = PBXGroup; children = ( - 84C49E4B06C0EE8C0066071B /* demos */, - 84C49E4A06C0EE8C0066071B /* ApplicationStartup.cpp */, - 84C49E5306C0EE8C0066071B /* MainDemoWindow.cpp */, - 84C49E5406C0EE8C0066071B /* MainDemoWindow.h */, - 849E1BF506C15C330002E024 /* BinaryData.cpp */, - 849E1BF606C15C330002E024 /* BinaryData.h */, - 84C49E5206C0EE8C0066071B /* jucedemo_headers.h */, - 846C10960DE32E6D00E8CCE8 /* juce_AppConfig.h */, - 846C10B10DE32EB500E8CCE8 /* juce_LibrarySource.mm */, + 080E96DDFE201D6D7F000001 /* Source */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, ); - name = Sources; + name = jucedemo; sourceTree = ""; }; - 20286C2CFDCF999611CA2CEA /* Resources */ = { + 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( - 8D0C4E960486CD37000505A6 /* Info.plist */, - 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */, + 8D1107310486CEB800E47090 /* Info.plist */, ); name = Resources; sourceTree = ""; }; - 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 8480BC0E0DE0BB8200478E44 /* AGL.framework */, - 8480BC1B0DE0BB8200478E44 /* ApplicationServices.framework */, - 8480BC0F0DE0BB8200478E44 /* AudioUnit.framework */, - 8480BC190DE0BB8200478E44 /* Carbon.framework */, - 8480BC110DE0BB8200478E44 /* Cocoa.framework */, - 8480BC120DE0BB8200478E44 /* CoreAudio.framework */, - 8480BC130DE0BB8200478E44 /* CoreFoundation.framework */, - 8480BC140DE0BB8200478E44 /* CoreMIDI.framework */, - 8480BC1A0DE0BB8200478E44 /* CoreServices.framework */, - 8480BC150DE0BB8200478E44 /* DiscRecording.framework */, - 8480BC100DE0BB8200478E44 /* IOKit.framework */, - 8480BC160DE0BB8200478E44 /* OpenGL.framework */, - 8480BC170DE0BB8200478E44 /* QuickTime.framework */, - 8480BC180DE0BB8200478E44 /* WebKit.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 841084950DB3759400AB8583 /* Build settings */ = { + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( - 846929260A49DDE100314975 /* juce.xcconfig */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 841FE4360E8ABDD4003C3263 /* CoreAudio.framework */, + 841FE4370E8ABDD4003C3263 /* CoreMIDI.framework */, + 841FE4380E8ABDD4003C3263 /* DiscRecording.framework */, + 841FE4390E8ABDD4003C3263 /* IOKit.framework */, + 841FE43A0E8ABDD4003C3263 /* OpenGL.framework */, + 847F4D8F0E8AC35C00F64426 /* QTKit.framework */, + 845057790EB52CE500029DFF /* QuickTime.framework */, + 841FE43B0E8ABDD4003C3263 /* WebKit.framework */, + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, ); - name = "Build settings"; + name = Frameworks; sourceTree = ""; }; - 84C49E4B06C0EE8C0066071B /* demos */ = { + 847F4D8A0E8AC27A00F64426 /* demos */ = { isa = PBXGroup; children = ( - 842A97B6081060FB0059DBCC /* DragAndDropDemo.cpp */, - 842A97B7081060FB0059DBCC /* OpenGLDemo.cpp */, - 84C49E4C06C0EE8C0066071B /* AudioDemo.cpp */, - 84C49E4D06C0EE8C0066071B /* FontsAndTextDemo.cpp */, - 84C49E4E06C0EE8C0066071B /* PathsAndTransformsDemo.cpp */, - 84F8DB0A099CA8DD00E911ED /* QuickTimeDemo.cpp */, - 8417EE790A6E7EB90058E04E /* TableDemo.cpp */, - 84C49E4F06C0EE8C0066071B /* ThreadingDemo.cpp */, - 84C49E5006C0EE8C0066071B /* TreeViewDemo.cpp */, - 84C49E5106C0EE8C0066071B /* WidgetsDemo.cpp */, - 84A06BA709CAD661006A43BD /* InterprocessCommsDemo.cpp */, + 847F4E9A0E8BA9C300F64426 /* AudioDemo.cpp */, + 847F4E9B0E8BA9C300F64426 /* DragAndDropDemo.cpp */, + 847F4E9C0E8BA9C300F64426 /* FontsAndTextDemo.cpp */, + 847F4E9D0E8BA9C300F64426 /* InterprocessCommsDemo.cpp */, + 847F4E9E0E8BA9C300F64426 /* OpenGLDemo.cpp */, + 847F4E9F0E8BA9C300F64426 /* PathsAndTransformsDemo.cpp */, + 847F4EA00E8BA9C300F64426 /* QuickTimeDemo.cpp */, + 847F4EA10E8BA9C300F64426 /* TableDemo.cpp */, + 847F4EA20E8BA9C300F64426 /* ThreadingDemo.cpp */, + 847F4EA30E8BA9C300F64426 /* TreeViewDemo.cpp */, + 847F4EA40E8BA9C300F64426 /* WidgetsDemo.cpp */, ); name = demos; - path = ../../src/demos; - sourceTree = SOURCE_ROOT; + sourceTree = ""; }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - 8D0C4E8A0486CD37000505A6 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 84C49E5C06C0EE8C0066071B /* jucedemo_headers.h in Headers */, - 84C49E5E06C0EE8C0066071B /* MainDemoWindow.h in Headers */, - 849E1BF806C15C330002E024 /* BinaryData.h in Headers */, - 846C10970DE32E6E00E8CCE8 /* juce_AppConfig.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ - 8D0C4E890486CD37000505A6 /* jucedemo */ = { + 8D1107260486CEB800E47090 /* jucedemo */ = { isa = PBXNativeTarget; - buildConfigurationList = 84CFBCCB085F14F000C52F85 /* Build configuration list for PBXNativeTarget "jucedemo" */; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "jucedemo" */; buildPhases = ( - 8D0C4E8A0486CD37000505A6 /* Headers */, - 8D0C4E8C0486CD37000505A6 /* Resources */, - 8D0C4E8F0486CD37000505A6 /* Sources */, - 8D0C4E910486CD37000505A6 /* Frameworks */, - 8D0C4E940486CD37000505A6 /* Rez */, + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, ); buildRules = ( ); @@ -236,157 +185,137 @@ name = jucedemo; productInstallPath = "$(HOME)/Applications"; productName = jucedemo; - productReference = 8D0C4E970486CD37000505A6 /* jucedemo.app */; + productReference = 8D1107320486CEB800E47090 /* jucedemo.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 20286C28FDCF999611CA2CEA /* Project object */ = { + 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; - buildConfigurationList = 84CFBCCF085F14F000C52F85 /* Build configuration list for PBXProject "jucedemo" */; - compatibilityVersion = "Xcode 2.4"; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "jucedemo" */; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; - mainGroup = 20286C29FDCF999611CA2CEA /* jucedemo */; + mainGroup = 29B97314FDCFA39411CA2CEA /* jucedemo */; projectDirPath = ""; projectRoot = ""; targets = ( - 8D0C4E890486CD37000505A6 /* jucedemo */, + 8D1107260486CEB800E47090 /* jucedemo */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8D0C4E8C0486CD37000505A6 /* Resources */ = { + 8D1107290486CEB800E47090 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */, - 846929270A49DDE100314975 /* juce.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXRezBuildPhase section */ - 8D0C4E940486CD37000505A6 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ - 8D0C4E8F0486CD37000505A6 /* Sources */ = { + 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 84C49E5506C0EE8C0066071B /* ApplicationStartup.cpp in Sources */, - 84C49E5606C0EE8C0066071B /* AudioDemo.cpp in Sources */, - 84C49E5706C0EE8C0066071B /* FontsAndTextDemo.cpp in Sources */, - 84C49E5806C0EE8C0066071B /* PathsAndTransformsDemo.cpp in Sources */, - 84C49E5906C0EE8C0066071B /* ThreadingDemo.cpp in Sources */, - 84C49E5A06C0EE8C0066071B /* TreeViewDemo.cpp in Sources */, - 84C49E5B06C0EE8C0066071B /* WidgetsDemo.cpp in Sources */, - 84C49E5D06C0EE8C0066071B /* MainDemoWindow.cpp in Sources */, - 849E1BF706C15C330002E024 /* BinaryData.cpp in Sources */, - 842A97B8081060FB0059DBCC /* DragAndDropDemo.cpp in Sources */, - 842A97B9081060FB0059DBCC /* OpenGLDemo.cpp in Sources */, - 84F8DB0B099CA8DD00E911ED /* QuickTimeDemo.cpp in Sources */, - 84A06BA809CAD661006A43BD /* InterprocessCommsDemo.cpp in Sources */, - 8417EE7A0A6E7EB90058E04E /* TableDemo.cpp in Sources */, - 846C10B20DE32EB500E8CCE8 /* juce_LibrarySource.mm in Sources */, + 847F4EA50E8BA9C300F64426 /* AudioDemo.cpp in Sources */, + 847F4EA60E8BA9C300F64426 /* DragAndDropDemo.cpp in Sources */, + 847F4EA70E8BA9C300F64426 /* FontsAndTextDemo.cpp in Sources */, + 847F4EA80E8BA9C300F64426 /* InterprocessCommsDemo.cpp in Sources */, + 847F4EA90E8BA9C300F64426 /* OpenGLDemo.cpp in Sources */, + 847F4EAA0E8BA9C300F64426 /* PathsAndTransformsDemo.cpp in Sources */, + 847F4EAB0E8BA9C300F64426 /* QuickTimeDemo.cpp in Sources */, + 847F4EAC0E8BA9C300F64426 /* TableDemo.cpp in Sources */, + 847F4EAD0E8BA9C300F64426 /* ThreadingDemo.cpp in Sources */, + 847F4EAE0E8BA9C300F64426 /* TreeViewDemo.cpp in Sources */, + 847F4EAF0E8BA9C300F64426 /* WidgetsDemo.cpp in Sources */, + 847F4EB80E8BA9DD00F64426 /* ApplicationStartup.cpp in Sources */, + 847F4EB90E8BA9DD00F64426 /* BinaryData.cpp in Sources */, + 847F4EBA0E8BA9DD00F64426 /* juce_LibrarySource.mm in Sources */, + 847F4EBB0E8BA9DD00F64426 /* MainDemoWindow.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 0867D6ABFE840B52C02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - 84CFBCCC085F14F000C52F85 /* Debug */ = { + C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "_DEBUG=1", - "DEBUG=1", - ); - HEADER_SEARCH_PATHS = "$(SYSTEM_DEVELOPER_DIR)/Headers/FlatCarbon"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ../../../../bin; + INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_NAME = jucedemo; - WRAPPER_EXTENSION = app; }; name = Debug; }; - 84CFBCCD085F14F000C52F85 /* Release */ = { + C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - DEAD_CODE_STRIPPING = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "_NDEBUG=1", - "NDEBUG=1", - ); - HEADER_SEARCH_PATHS = "$(SYSTEM_DEVELOPER_DIR)/Headers/FlatCarbon"; + ALWAYS_SEARCH_USER_PATHS = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; INFOPLIST_FILE = Info.plist; - ONLY_LINK_ESSENTIAL_SYMBOLS = YES; + INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_NAME = jucedemo; - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; }; name = Release; }; - 84CFBCD0085F14F000C52F85 /* Debug */ = { + C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 846929260A49DDE100314975 /* juce.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.4; }; name = Debug; }; - 84CFBCD1085F14F000C52F85 /* Release */ = { + C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 846929260A49DDE100314975 /* juce.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.4; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 84CFBCCB085F14F000C52F85 /* Build configuration list for PBXNativeTarget "jucedemo" */ = { + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "jucedemo" */ = { isa = XCConfigurationList; buildConfigurations = ( - 84CFBCCC085F14F000C52F85 /* Debug */, - 84CFBCCD085F14F000C52F85 /* Release */, + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; - 84CFBCCF085F14F000C52F85 /* Build configuration list for PBXProject "jucedemo" */ = { + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "jucedemo" */ = { isa = XCConfigurationList; buildConfigurations = ( - 84CFBCD0085F14F000C52F85 /* Debug */, - 84CFBCD1085F14F000C52F85 /* Release */, + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 20286C28FDCF999611CA2CEA /* Project object */; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } diff --git a/extras/juce demo/build/win32_vc8/jucedemo.sln b/extras/juce demo/build/win32_vc8/jucedemo.sln index a08814acc5..197f8550c5 100644 --- a/extras/juce demo/build/win32_vc8/jucedemo.sln +++ b/extras/juce demo/build/win32_vc8/jucedemo.sln @@ -2,6 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jucedemo", "jucedemo.vcproj", "{050D65C2-17C4-4EE1-ABCE-BEA9DA83D77A}" + ProjectSection(ProjectDependencies) = postProject + {AE232C11-D91C-4CA1-B24E-8B11A52EFF26} = {AE232C11-D91C-4CA1-B24E-8B11A52EFF26} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JUCE", "..\..\..\..\build\win32\vc8\JUCE.vcproj", "{AE232C11-D91C-4CA1-B24E-8B11A52EFF26}" EndProject diff --git a/extras/juce demo/src/BinaryData.cpp b/extras/juce demo/src/BinaryData.cpp index ac90d49d10..03f82d6219 100644 --- a/extras/juce demo/src/BinaryData.cpp +++ b/extras/juce demo/src/BinaryData.cpp @@ -39,5690 +39,2176 @@ static const unsigned char temp1[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61, 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,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,79,117,114,32,100,101,109,111,32,115,121,110,116,104,32,111,110,108,121,32,104,97,115,32,111,110,101,32,116,121,112,101,32, - 111,102,32,115,111,117,110,100,44,32,97,110,100,32,105,116,39,115,32,118,101,114,121,32,98,97,115,105,99,46,46,13,10,42,47,13,10,99,108,97, - 115,115,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,58,32,112,117,98,108,105,99,32,83,121,110,116,104,101,115,105,115,101,114,83,111,117, - 110,100,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,40,99,111,110,115,116, - 32,66,105,116,65,114,114,97,121,38,32,109,105,100,105,78,111,116,101,115,95,41,13,10,32,32,32,32,32,32,32,32,58,32,109,105,100,105,78,111, - 116,101,115,32,40,109,105,100,105,78,111,116,101,115,95,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111, - 111,108,32,97,112,112,108,105,101,115,84,111,78,111,116,101,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,78,111,116,101,78,117,109,98, - 101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,109,105,100,105,78,111,116,101,115,32,91,109,105, - 100,105,78,111,116,101,78,117,109,98,101,114,93,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111,111,108,32,97,112,112,108,105,101, - 115,84,111,67,104,97,110,110,101,108,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,67,104,97,110,110,101,108,41,32,32,32,32,32,32, - 32,32,32,32,32,123,32,114,101,116,117,114,110,32,116,114,117,101,59,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,47, - 47,32,116,104,105,115,32,119,105,108,108,32,99,111,110,116,97,105,110,32,116,104,101,32,110,111,116,101,115,32,116,104,97,116,32,116,104,105,115,32, - 115,111,117,110,100,32,105,115,32,97,116,116,97,99,104,101,100,32,116,111,46,13,10,32,32,32,32,66,105,116,65,114,114,97,121,32,109,105,100,105, - 78,111,116,101,115,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,47,42,42,32,79,117,114,32,100,101,109,111,32,115,121,110,116,104,32,118,111,105, - 99,101,32,106,117,115,116,32,112,108,97,121,115,32,97,32,115,105,110,101,32,119,97,118,101,46,46,13,10,42,47,13,10,99,108,97,115,115,32,83, - 105,110,101,87,97,118,101,86,111,105,99,101,32,32,58,32,112,117,98,108,105,99,32,83,121,110,116,104,101,115,105,115,101,114,86,111,105,99,101,13, - 10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,83,105,110,101,87,97,118,101,86,111,105,99,101,40,41,13,10,32,32,32,32,32,32, - 32,32,58,32,97,110,103,108,101,68,101,108,116,97,32,40,48,46,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102, - 32,40,48,46,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111,111,108,32,99,97,110,80,108,97,121, - 83,111,117,110,100,32,40,83,121,110,116,104,101,115,105,115,101,114,83,111,117,110,100,42,32,115,111,117,110,100,41,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,100,121,110,97,109,105,99,95,99,97,115,116,32,60,83,105,110,101,87,97,118,101,83,111,117, - 110,100,42,62,32,40,115,111,117,110,100,41,32,33,61,32,48,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,116, - 97,114,116,78,111,116,101,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,78,111,116,101,78,117,109,98,101,114,44,32,99,111,110,115,116, - 32,102,108,111,97,116,32,118,101,108,111,99,105,116,121,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,83,121, - 110,116,104,101,115,105,115,101,114,83,111,117,110,100,42,32,115,111,117,110,100,44,32,99,111,110,115,116,32,105,110,116,32,99,117,114,114,101,110,116, - 80,105,116,99,104,87,104,101,101,108,80,111,115,105,116,105,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,117,114,114, - 101,110,116,65,110,103,108,101,32,61,32,48,46,48,59,13,10,32,32,32,32,32,32,32,32,108,101,118,101,108,32,61,32,118,101,108,111,99,105,116, - 121,32,42,32,48,46,49,53,59,13,10,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,61,32,48,46,48,59,13,10,13,10,32,32,32, - 32,32,32,32,32,100,111,117,98,108,101,32,99,121,99,108,101,115,80,101,114,83,101,99,111,110,100,32,61,32,77,105,100,105,77,101,115,115,97,103, - 101,58,58,103,101,116,77,105,100,105,78,111,116,101,73,110,72,101,114,116,122,32,40,109,105,100,105,78,111,116,101,78,117,109,98,101,114,41,59,13, - 10,32,32,32,32,32,32,32,32,100,111,117,98,108,101,32,99,121,99,108,101,115,80,101,114,83,97,109,112,108,101,32,61,32,99,121,99,108,101,115, - 80,101,114,83,101,99,111,110,100,32,47,32,103,101,116,83,97,109,112,108,101,82,97,116,101,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 97,110,103,108,101,68,101,108,116,97,32,61,32,99,121,99,108,101,115,80,101,114,83,97,109,112,108,101,32,42,32,50,46,48,32,42,32,100,111,117, - 98,108,101,95,80,105,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,116,111,112,78,111,116,101,32,40,99,111,110, - 115,116,32,98,111,111,108,32,97,108,108,111,119,84,97,105,108,79,102,102,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102, - 32,40,97,108,108,111,119,84,97,105,108,79,102,102,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 47,47,32,115,116,97,114,116,32,97,32,116,97,105,108,45,111,102,102,32,98,121,32,115,101,116,116,105,110,103,32,116,104,105,115,32,102,108,97,103, - 46,32,84,104,101,32,114,101,110,100,101,114,32,99,97,108,108,98,97,99,107,32,119,105,108,108,32,112,105,99,107,32,117,112,32,111,110,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,97,110,100,32,100,111,32,97,32,102,97,100,101,32,111,117,116,44,32,99,97, - 108,108,105,110,103,32,99,108,101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,32,119,104,101,110,32,105,116,39,115,32,102,105,110,105,115, - 104,101,100,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,61,61,32,48,46,48,41,32, - 47,47,32,119,101,32,111,110,108,121,32,110,101,101,100,32,116,111,32,98,101,103,105,110,32,97,32,116,97,105,108,45,111,102,102,32,105,102,32,105, - 116,39,115,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,105,110,103,32,115,111,32,45,32,116,104,101,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,32,32,32,32,32,32,32,47,47,32,115,116,111,112,78,111,116,101,32,109,101,116,104, - 111,100,32,99,111,117,108,100,32,98,101,32,99,97,108,108,101,100,32,109,111,114,101,32,116,104,97,110,32,111,110,99,101,46,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,61,32,49,46,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32, - 32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,119, - 101,39,114,101,32,98,101,105,110,103,32,116,111,108,100,32,116,111,32,115,116,111,112,32,112,108,97,121,105,110,103,32,105,109,109,101,100,105,97,116, - 101,108,121,44,32,115,111,32,114,101,115,101,116,32,101,118,101,114,121,116,104,105,110,103,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,99,108,101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,110,103,108,101, - 68,101,108,116,97,32,61,32,48,46,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111, - 105,100,32,112,105,116,99,104,87,104,101,101,108,77,111,118,101,100,32,40,99,111,110,115,116,32,105,110,116,32,110,101,119,86,97,108,117,101,41,13, - 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,110,39,116,32,98,101,32,98,111,116,104,101,114,101,100,32,105,109,112, - 108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,102,111,114,32,116,104,101,32,100,101,109,111,33,13,10,32,32,32,32,125,13,10,13,10,32, - 32,32,32,118,111,105,100,32,99,111,110,116,114,111,108,108,101,114,77,111,118,101,100,32,40,99,111,110,115,116,32,105,110,116,32,99,111,110,116,114, - 111,108,108,101,114,78,117,109,98,101,114,44,32,99,111,110,115,116,32,105,110,116,32,110,101,119,86,97,108,117,101,41,13,10,32,32,32,32,123,13, - 10,32,32,32,32,32,32,32,32,47,47,32,110,111,116,32,105,110,116,101,114,101,115,116,101,100,32,105,110,32,99,111,110,116,114,111,108,108,101,114, - 115,32,105,110,32,116,104,105,115,32,99,97,115,101,46,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,101,110,100,101, - 114,78,101,120,116,66,108,111,99,107,32,40,65,117,100,105,111,83,97,109,112,108,101,66,117,102,102,101,114,38,32,111,117,116,112,117,116,66,117,102, - 102,101,114,44,32,105,110,116,32,115,116,97,114,116,83,97,109,112,108,101,44,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32, - 32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,97,110,103,108,101,68,101,108,116,97,32,33,61,32,48,46,48,41,13,10,32,32, - 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,62,32,48,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,45,45,110, - 117,109,83,97,109,112,108,101,115,32,62,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,99,117,114,114,101,110,116,83,97,109,112,108, - 101,32,61,32,40,102,108,111,97,116,41,32,40,115,105,110,32,40,99,117,114,114,101,110,116,65,110,103,108,101,41,32,42,32,108,101,118,101,108,32, - 42,32,116,97,105,108,79,102,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40, - 105,110,116,32,105,32,61,32,111,117,116,112,117,116,66,117,102,102,101,114,46,103,101,116,78,117,109,67,104,97,110,110,101,108,115,40,41,59,32,45, - 45,105,32,62,61,32,48,59,41,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,42,111,117,116,112, - 117,116,66,117,102,102,101,114,46,103,101,116,83,97,109,112,108,101,68,97,116,97,32,40,105,44,32,115,116,97,114,116,83,97,109,112,108,101,41,32, - 43,61,32,99,117,114,114,101,110,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,99,117,114,114,101,110,116,65,110,103,108,101,32,43,61,32,97,110,103,108,101,68,101,108,116,97,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,43,43,115,116,97,114,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,42,61,32,48,46,57,57,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,60,61,32,48,46,48,48,53,41,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,123,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,99,108, - 101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,59,13,10,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,97,110,103,108,101,68,101,108,116,97,32,61,32,48,46,48,59,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,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,119,104,105,108,101,32,40,45,45,110,117,109,83,97,109,112,108,101,115,32,62,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32, - 99,117,114,114,101,110,116,83,97,109,112,108,101,32,61,32,40,102,108,111,97,116,41,32,40,115,105,110,32,40,99,117,114,114,101,110,116,65,110,103, - 108,101,41,32,42,32,108,101,118,101,108,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114, - 32,40,105,110,116,32,105,32,61,32,111,117,116,112,117,116,66,117,102,102,101,114,46,103,101,116,78,117,109,67,104,97,110,110,101,108,115,40,41,59, - 32,45,45,105,32,62,61,32,48,59,41,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,42,111,117, - 116,112,117,116,66,117,102,102,101,114,46,103,101,116,83,97,109,112,108,101,68,97,116,97,32,40,105,44,32,115,116,97,114,116,83,97,109,112,108,101, - 41,32,43,61,32,99,117,114,114,101,110,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,99,117,114,114,101,110,116,65,110,103,108,101,32,43,61,32,97,110,103,108,101,68,101,108,116,97,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,43,43,115,116,97,114,116,83,97,109,112,108,101,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10, - 13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,100,111,117,98,108,101,32,99,117,114,114,101,110,116,65,110,103,108,101,44,32,97,110,103, - 108,101,68,101,108,116,97,44,32,108,101,118,101,108,44,32,116,97,105,108,79,102,102,59,13,10,125,59,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,84,104, - 105,115,32,105,115,32,97,110,32,97,117,100,105,111,32,115,111,117,114,99,101,32,116,104,97,116,32,115,116,114,101,97,109,115,32,116,104,101,32,111, - 117,116,112,117,116,32,111,102,32,111,117,114,32,100,101,109,111,32,115,121,110,116,104,46,13,10,42,47,13,10,99,108,97,115,115,32,83,121,110,116, - 104,65,117,100,105,111,83,111,117,114,99,101,32,32,58,32,112,117,98,108,105,99,32,65,117,100,105,111,83,111,117,114,99,101,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,47,47,32,116,104,105,115,32,99,111,108,108,101,99,116,115,32,114,101,97,108,45, - 116,105,109,101,32,109,105,100,105,32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,109,105,100,105,32,105,110,112,117,116,32,100, - 101,118,105,99,101,44,32,97,110,100,13,10,32,32,32,32,47,47,32,116,117,114,110,115,32,116,104,101,109,32,105,110,116,111,32,98,108,111,99,107, - 115,32,116,104,97,116,32,119,101,32,99,97,110,32,112,114,111,99,101,115,115,32,105,110,32,111,117,114,32,97,117,100,105,111,32,99,97,108,108,98, - 97,99,107,13,10,32,32,32,32,77,105,100,105,77,101,115,115,97,103,101,67,111,108,108,101,99,116,111,114,32,109,105,100,105,67,111,108,108,101,99, - 116,111,114,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,114,101,112,114,101,115,101,110,116,115,32,116,104,101,32,115,116,97,116,101, - 32,111,102,32,119,104,105,99,104,32,107,101,121,115,32,111,110,32,111,117,114,32,111,110,45,115,99,114,101,101,110,32,107,101,121,98,111,97,114,100, - 32,97,114,101,32,104,101,108,100,13,10,32,32,32,32,47,47,32,100,111,119,110,46,32,87,104,101,110,32,116,104,101,32,109,111,117,115,101,32,105, - 115,32,99,108,105,99,107,101,100,32,111,110,32,116,104,101,32,107,101,121,98,111,97,114,100,32,99,111,109,112,111,110,101,110,116,44,32,116,104,105, - 115,32,111,98,106,101,99,116,32,97,108,115,111,13,10,32,32,32,32,47,47,32,103,101,110,101,114,97,116,101,115,32,109,105,100,105,32,109,101,115, - 115,97,103,101,115,32,102,111,114,32,116,104,105,115,44,32,119,104,105,99,104,32,119,101,32,99,97,110,32,112,97,115,115,32,111,110,32,116,111,32, - 111,117,114,32,115,121,110,116,104,46,13,10,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,83,116,97,116,101,32,107,101,121,98,111,97, - 114,100,83,116,97,116,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,101,32,115,121,110,116,104,32,105,116,115,101,108,102,33,13,10,32,32, - 32,32,83,121,110,116,104,101,115,105,115,101,114,32,115,121,110,116,104,59,13,10,13,10,32,32,32,32,47,47,61,61,61,61,61,61,61,61,61,61, + 61,13,10,115,116,97,116,105,99,32,102,108,111,97,116,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,13,10,123,13,10,32,32,32,32,114, + 101,116,117,114,110,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97, + 116,40,41,32,42,32,51,48,48,46,48,102,32,45,32,49,53,48,46,48,102,59,13,10,125,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,13,10,32,32,32,32,83,121,110,116,104,65, - 117,100,105,111,83,111,117,114,99,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,39,108,108,32,98,101, - 32,109,105,120,105,110,103,32,116,119,111,32,100,105,102,102,101,114,101,110,116,32,116,121,112,101,115,32,111,102,32,115,111,117,110,100,44,32,115,111, - 32,104,101,114,101,32,119,101,39,108,108,32,99,114,101,97,116,101,32,116,119,111,13,10,32,32,32,32,32,32,32,32,47,47,32,115,101,116,115,32, - 111,102,32,110,111,116,101,32,109,97,112,115,44,32,112,117,116,116,105,110,103,32,101,97,99,104,32,115,111,117,110,100,32,111,110,32,97,32,100,105, - 102,102,101,114,101,110,116,32,111,99,116,97,118,101,32,111,102,32,116,104,101,32,107,101,121,98,111,97,114,100,58,13,10,32,32,32,32,32,32,32, - 32,66,105,116,65,114,114,97,121,32,115,105,110,101,119,97,118,101,78,111,116,101,115,44,32,115,97,109,112,108,101,114,78,111,116,101,115,59,13,10, - 13,10,32,32,32,32,32,32,32,32,105,110,116,32,105,59,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32, - 60,32,49,50,56,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40, - 40,40,105,32,47,32,49,50,41,32,38,32,49,41,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,105, - 110,101,119,97,118,101,78,111,116,101,115,46,115,101,116,66,105,116,32,40,105,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115, - 101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,97,109,112,108,101,114,78,111,116,101,115,46,115,101,116,66,105,116,32,40, - 105,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,119,97,118,101,32, - 115,111,117,110,100,44,32,119,104,105,99,104,32,119,105,108,108,32,103,101,116,32,97,112,112,108,105,101,100,32,116,111,32,115,111,109,101,32,111,102, - 32,116,104,101,32,110,111,116,101,115,46,46,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,83,111,117,110,100,32,40,110,101, - 119,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,40,115,105,110,101,119,97,118,101,78,111,116,101,115,41,41,59,13,10,13,10,32,32,32, - 32,32,32,32,32,47,47,32,103,105,118,101,32,111,117,114,32,115,121,110,116,104,32,97,32,102,101,119,32,118,111,105,99,101,115,32,116,104,97,116, - 32,99,97,110,32,112,108,97,121,32,116,104,101,32,119,97,118,101,32,115,111,117,110,100,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32, - 40,105,32,61,32,52,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100, - 100,86,111,105,99,101,32,40,110,101,119,32,83,105,110,101,87,97,118,101,86,111,105,99,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,87,97,118,65,117,100,105,111,70,111,114,109,97,116,32,119,97,118,70,111,114,109,97,116,59,13,10,32,32,32,32,32,32,32,32,65,117,100,105, - 111,70,111,114,109,97,116,82,101,97,100,101,114,42,32,97,117,100,105,111,82,101,97,100,101,114,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 61,32,119,97,118,70,111,114,109,97,116,46,99,114,101,97,116,101,82,101,97,100,101,114,70,111,114,32,40,110,101,119,32,77,101,109,111,114,121,73, - 110,112,117,116,83,116,114,101,97,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,99,101,108,108,111,95,119,97,118,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,66,105,110,97,114,121,68,97,116,97,58,58,99,101,108,108,111,95,119,97, - 118,83,105,122,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,83,111,117,110,100,32,40,110,101,119,32, - 83,97,109,112,108,101,114,83,111,117,110,100,32,40,84,40,34,100,101,109,111,32,115,111,117,110,100,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,42,97,117,100,105,111, - 82,101,97,100,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,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,115,97,109,112,108,101,114,78,111,116,101,115,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,55,52,44,32,32,32,47,47,32,114,111,111, - 116,32,109,105,100,105,32,110,111,116,101,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,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,46,49,44,32,32,47,47,32,97,116,116,97,99,107,32,116,105,109,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48, - 46,49,44,32,32,47,47,32,114,101,108,101,97,115,101,32,116,105,109,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,49,48,46,48,32,32,47,47,32,109,97,120,105,109,117,109, - 32,115,97,109,112,108,101,32,108,101,110,103,116,104,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, - 97,117,100,105,111,82,101,97,100,101,114,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,103,105,118,101,32,116,104,101,32, - 115,121,110,116,104,32,115,111,109,101,32,115,97,109,112,108,101,114,32,118,111,105,99,101,115,32,116,111,32,112,108,97,121,32,116,104,101,32,115,97, - 109,112,108,101,100,32,115,111,117,110,100,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,32,61,32,52,59,32,45,45,105,32,62, - 61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,86,111,105,99,101,32,40,110,101,119,32,83, - 97,109,112,108,101,114,86,111,105,99,101,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,114,101,112,97, - 114,101,84,111,80,108,97,121,32,40,105,110,116,32,115,97,109,112,108,101,115,80,101,114,66,108,111,99,107,69,120,112,101,99,116,101,100,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,100,111,117,98,108,101,32,115,97,109,112,108,101,82,97,116, - 101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,109,105,100,105,67,111,108,108,101,99,116,111,114,46,114,101,115,101,116,32,40, - 115,97,109,112,108,101,82,97,116,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,115,101,116,67,117,114,114,101,110,116, - 80,108,97,121,98,97,99,107,83,97,109,112,108,101,82,97,116,101,32,40,115,97,109,112,108,101,82,97,116,101,41,59,13,10,32,32,32,32,125,13, - 10,13,10,32,32,32,32,118,111,105,100,32,114,101,108,101,97,115,101,82,101,115,111,117,114,99,101,115,40,41,13,10,32,32,32,32,123,13,10,32, - 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,116,78,101,120,116,65,117,100,105,111,66,108,111,99,107,32,40,99,111,110,115, - 116,32,65,117,100,105,111,83,111,117,114,99,101,67,104,97,110,110,101,108,73,110,102,111,38,32,98,117,102,102,101,114,84,111,70,105,108,108,41,13, - 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,115,121,110,116,104,32,97,108,119,97,121,115,32,97,100,100,115, - 32,105,116,115,32,111,117,116,112,117,116,32,116,111,32,116,104,101,32,97,117,100,105,111,32,98,117,102,102,101,114,44,32,115,111,32,119,101,32,104, - 97,118,101,32,116,111,32,99,108,101,97,114,32,105,116,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,114,115,116,46,46,13,10,32,32,32, - 32,32,32,32,32,98,117,102,102,101,114,84,111,70,105,108,108,46,99,108,101,97,114,65,99,116,105,118,101,66,117,102,102,101,114,82,101,103,105,111, - 110,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,108,108,32,97,32,109,105,100,105,32,98,117,102,102,101,114,32,119,105, - 116,104,32,105,110,99,111,109,105,110,103,32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,109,105,100,105,32,105,110,112,117,116, - 46,13,10,32,32,32,32,32,32,32,32,77,105,100,105,66,117,102,102,101,114,32,105,110,99,111,109,105,110,103,77,105,100,105,59,13,10,32,32,32, - 32,32,32,32,32,109,105,100,105,67,111,108,108,101,99,116,111,114,46,114,101,109,111,118,101,78,101,120,116,66,108,111,99,107,79,102,77,101,115,115, - 97,103,101,115,32,40,105,110,99,111,109,105,110,103,77,105,100,105,44,32,98,117,102,102,101,114,84,111,70,105,108,108,46,110,117,109,83,97,109,112, - 108,101,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,112,97,115,115,32,116,104,101,115,101,32,109,101,115,115,97,103,101,115,32, - 116,111,32,116,104,101,32,107,101,121,98,111,97,114,100,32,115,116,97,116,101,32,115,111,32,116,104,97,116,32,105,116,32,99,97,110,32,117,112,100, - 97,116,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,47,47,32,116,111,32,115,104,111,119,32,111,110, - 45,115,99,114,101,101,110,32,119,104,105,99,104,32,107,101,121,115,32,97,114,101,32,98,101,105,110,103,32,112,114,101,115,115,101,100,32,111,110,32, - 116,104,101,32,112,104,121,115,105,99,97,108,32,109,105,100,105,32,107,101,121,98,111,97,114,100,46,13,10,32,32,32,32,32,32,32,32,47,47,32, - 84,104,105,115,32,99,97,108,108,32,119,105,108,108,32,97,108,115,111,32,97,100,100,32,109,105,100,105,32,109,101,115,115,97,103,101,115,32,116,111, - 32,116,104,101,32,98,117,102,102,101,114,32,119,104,105,99,104,32,119,101,114,101,32,103,101,110,101,114,97,116,101,100,32,98,121,13,10,32,32,32, - 32,32,32,32,32,47,47,32,116,104,101,32,109,111,117,115,101,45,99,108,105,99,107,105,110,103,32,111,110,32,116,104,101,32,111,110,45,115,99,114, - 101,101,110,32,107,101,121,98,111,97,114,100,46,13,10,32,32,32,32,32,32,32,32,107,101,121,98,111,97,114,100,83,116,97,116,101,46,112,114,111, - 99,101,115,115,78,101,120,116,77,105,100,105,66,117,102,102,101,114,32,40,105,110,99,111,109,105,110,103,77,105,100,105,44,32,48,44,32,98,117,102, - 102,101,114,84,111,70,105,108,108,46,110,117,109,83,97,109,112,108,101,115,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 47,47,32,97,110,100,32,110,111,119,32,103,101,116,32,116,104,101,32,115,121,110,116,104,32,116,111,32,112,114,111,99,101,115,115,32,116,104,101,32, - 109,105,100,105,32,101,118,101,110,116,115,32,97,110,100,32,103,101,110,101,114,97,116,101,32,105,116,115,32,111,117,116,112,117,116,46,13,10,32,32, - 32,32,32,32,32,32,115,121,110,116,104,46,114,101,110,100,101,114,78,101,120,116,66,108,111,99,107,32,40,42,98,117,102,102,101,114,84,111,70,105, - 108,108,46,98,117,102,102,101,114,44,32,105,110,99,111,109,105,110,103,77,105,100,105,44,32,48,44,32,98,117,102,102,101,114,84,111,70,105,108,108, - 46,110,117,109,83,97,109,112,108,101,115,41,59,13,10,32,32,32,32,125,13,10,125,59,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,13,10,99,108,97,115,115,32,80, + 97,116,104,115,65,110,100,84,114,97,110,115,102,111,114,109,115,68,101,109,111,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,32,32,32,32,32,32,32,112,117,98,108, + 105,99,32,83,108,105,100,101,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,32,32,32,32,32,32,32,112,117,98,108,105,99,32,67,111,109,98,111,66,111,120,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,99,108,97,115,115,32,65,117,100,105, - 111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,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,32,32,32,32,32,32,32,32,32,32,112, - 117,98,108,105,99,32,84,105,109,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,32, - 32,32,32,32,32,32,32,32,32,112,117,98,108,105,99,32,65,117,100,105,111,73,79,68,101,118,105,99,101,67,97,108,108,98,97,99,107,13,10,123, - 13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121, - 40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,98,117,102,102,101,114,80,111,115,32,61,32,48,59,13,10,32,32,32,32,32, - 32,32,32,98,117,102,102,101,114,83,105,122,101,32,61,32,50,48,52,56,59,13,10,32,32,32,32,32,32,32,32,99,105,114,99,117,108,97,114,66, - 117,102,102,101,114,32,61,32,40,102,108,111,97,116,42,41,32,106,117,99,101,95,99,97,108,108,111,99,32,40,115,105,122,101,111,102,32,40,102,108, - 111,97,116,41,32,42,32,98,117,102,102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117, - 116,76,101,118,101,108,32,61,32,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,110,117,109,83,97,109,112,108,101,115,73,110,32,61,32,48, - 59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32, - 115,116,97,114,116,84,105,109,101,114,32,40,49,48,48,48,32,47,32,53,48,41,59,32,32,47,47,32,114,101,112,97,105,110,116,32,101,118,101,114, - 121,32,49,47,53,48,32,111,102,32,97,32,115,101,99,111,110,100,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,65,117,100,105,111,73, - 110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,106,117, - 99,101,95,102,114,101,101,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, - 118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32, - 32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46, - 115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,104,97,108,102,72,101,105,103,104,116,32,61,32,103,101,116,72,101,105,103,104,116,40,41, - 32,42,32,48,46,53,102,59,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,98,112,32,61,32,98,117,102,102,101,114,80,111,115,59,13, - 10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,120,32,61,32,103,101,116,87,105,100,116,104,40,41,59,32,45,45,120,32, - 62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116, - 32,115,97,109,112,108,101,115,65,103,111,32,61,32,103,101,116,87,105,100,116,104,40,41,32,45,32,120,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,108,101,118,101,108,32,61,32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,32,91,40, - 98,112,32,43,32,98,117,102,102,101,114,83,105,122,101,32,45,32,115,97,109,112,108,101,115,65,103,111,41,32,37,32,98,117,102,102,101,114,83,105, - 122,101,93,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,108,101,118,101,108,32,62,32,48,46,48,49,102,41,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,76,105,110,101,32,40,40,102,108,111,97,116,41,32,120,44,32,104, - 97,108,102,72,101,105,103,104,116,32,45,32,104,97,108,102,72,101,105,103,104,116,32,42,32,108,101,118,101,108,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,32,32,32,40,102,108,111,97,116,41,32,120,44,32,104,97,108,102,72,101,105,103, - 104,116,32,43,32,104,97,108,102,72,101,105,103,104,116,32,42,32,108,101,118,101,108,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32, - 32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105,109,101,114,67,97,108,108,98,97,99,107,40,41,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,100, - 100,83,97,109,112,108,101,32,40,99,111,110,115,116,32,102,108,111,97,116,32,115,97,109,112,108,101,41,13,10,32,32,32,32,123,13,10,32,32,32, - 32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,43,61,32,102,97,98,115,102,32,40,115,97,109,112,108,101,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,115,97,109,112,108,101,115,84,111,65,118,101,114,97,103,101,32, - 61,32,49,50,56,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,43,43,110,117,109,83,97,109,112,108,101,115,73,110,32,62,32,115, - 97,109,112,108,101,115,84,111,65,118,101,114,97,103,101,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,32,91,98,117,102,102,101,114,80,111,115,43,43,32,37,32,98,117,102,102,101,114,83,105,122, - 101,93,32,61,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,47,32,115,97,109,112,108,101,115,84,111,65,118,101,114,97,103, - 101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,117,109,83,97,109,112,108,101,115,73,110,32,61,32,48,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,61,32,48,46,48,102,59,13,10,32,32,32,32, - 32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,73,79,67,97, - 108,108,98,97,99,107,32,40,99,111,110,115,116,32,102,108,111,97,116,42,42,32,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,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,32,32,32,32,32,32,32,105,110,116,32,116,111,116, - 97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,102,108,111,97,116,42,42,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97,116,97,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,32,32,32,32,32,32,32,105,110,116,32,116,111,116, - 97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,116,111,116,97,108,78,117,109,73,110,112,117,116,67, - 104,97,110,110,101,108,115,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102, - 32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,32,91,105,93,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,106,32,61,32,48,59,32,106,32,60, - 32,110,117,109,83,97,109,112,108,101,115,59,32,43,43,106,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97, - 100,100,83,97,109,112,108,101,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,32,91,105,93,91,106,93,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, - 32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,65,98, - 111,117,116,84,111,83,116,97,114,116,32,40,65,117,100,105,111,73,79,68,101,118,105,99,101,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,122,101,114,111,109,101,109,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,44,32,115,105,122,101,111,102,32,40,102,108,111, - 97,116,41,32,42,32,98,117,102,102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117, - 100,105,111,68,101,118,105,99,101,83,116,111,112,112,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,122,101,114,111,109, - 101,109,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,44,32,115,105,122,101,111,102,32,40,102,108,111,97,116,41,32,42,32,98,117,102, - 102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,102,108,111,97,116,42, - 32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,59,13,10,32,32,32,32,102,108,111,97,116,32,99,117,114,114,101,110,116,73,110,112,117,116, - 76,101,118,101,108,59,13,10,32,32,32,32,105,110,116,32,118,111,108,97,116,105,108,101,32,98,117,102,102,101,114,80,111,115,44,32,98,117,102,102, - 101,114,83,105,122,101,44,32,110,117,109,83,97,109,112,108,101,115,73,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,99,108,97,115,115,32,65, - 117,100,105,111,68,101,109,111,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,112,117,98,108,105,99,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,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,112,117,98,108,105,99,32,66,117,116,116,111,110,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,112,117,98,108,105,99,32,67,104,97,110,103,101, - 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,112,117,98,108,105,99,32,65,117,100, - 105,111,73,79,68,101,118,105,99,101,67,97,108,108,98,97,99,107,13,10,123,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,70,105,108,101,110,97,109, - 101,67,111,109,112,111,110,101,110,116,42,32,102,105,108,101,67,104,111,111,115,101,114,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110, - 42,32,112,108,97,121,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,115,116,111,112,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,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117,116,116,111,110,59, - 13,10,13,10,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,42,32,107,101,121,98,111,97,114,100,67, - 111,109,112,111,110,101,110,116,59,13,10,32,32,32,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121, - 42,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,59,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,47,47,32,116,104,105, - 115,32,119,114,97,112,115,32,116,104,101,32,97,99,116,117,97,108,32,97,117,100,105,111,32,100,101,118,105,99,101,13,10,32,32,32,32,65,117,100, - 105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,59,13,10,13,10,32, - 32,32,32,47,47,32,116,104,105,115,32,97,108,108,111,119,115,32,97,110,32,97,117,100,105,111,32,115,111,117,114,99,101,32,116,111,32,98,101,32, - 115,116,114,101,97,109,101,100,32,116,111,32,116,104,101,32,73,79,32,100,101,118,105,99,101,13,10,32,32,32,32,65,117,100,105,111,83,111,117,114, - 99,101,80,108,97,121,101,114,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,59,13,10,13,10,32,32,32,32,47,47,32,116,104, - 105,115,32,99,111,110,116,114,111,108,115,32,116,104,101,32,112,108,97,121,98,97,99,107,32,111,102,32,97,32,112,111,115,105,116,105,111,110,97,98, - 108,101,32,97,117,100,105,111,32,115,116,114,101,97,109,44,32,104,97,110,100,108,105,110,103,32,116,104,101,13,10,32,32,32,32,47,47,32,115,116, - 97,114,116,105,110,103,47,115,116,111,112,112,105,110,103,32,97,110,100,32,115,97,109,112,108,101,45,114,97,116,101,32,99,111,110,118,101,114,115,105, - 111,110,13,10,32,32,32,32,65,117,100,105,111,84,114,97,110,115,112,111,114,116,83,111,117,114,99,101,32,116,114,97,110,115,112,111,114,116,83,111, - 117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,115,111,117,114,99,101,32,99,111,110,116,97,105,110,115,32,111,117,114, - 32,115,121,110,116,104,44,32,97,110,100,32,103,101,110,101,114,97,116,101,115,32,105,116,115,32,111,117,116,112,117,116,13,10,32,32,32,32,83,121, - 110,116,104,65,117,100,105,111,83,111,117,114,99,101,32,115,121,110,116,104,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104, - 105,115,32,115,111,117,114,99,101,32,105,115,32,117,115,101,100,32,116,111,32,109,105,120,32,116,111,103,101,116,104,101,114,32,116,104,101,32,111,117, - 116,112,117,116,32,102,114,111,109,32,111,117,114,32,115,121,110,116,104,32,115,111,117,114,99,101,13,10,32,32,32,32,47,47,32,97,110,100,32,119, - 97,118,101,32,112,108,97,121,101,114,32,115,111,117,114,99,101,13,10,32,32,32,32,77,105,120,101,114,65,117,100,105,111,83,111,117,114,99,101,32, - 109,105,120,101,114,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,116,104,101,32,97,99,116,117,97, - 108,32,115,116,114,101,97,109,32,116,104,97,116,39,115,32,103,111,105,110,103,32,116,111,32,114,101,97,100,32,102,114,111,109,32,116,104,101,32,97, - 117,100,105,111,32,102,105,108,101,46,13,10,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114,83,111,117,114,99,101,42, - 32,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,70,105,108,101,32,99,117,114, - 114,101,110,116,70,105,108,101,59,13,10,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,65,117,100,105,111,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,84,40,34,65,117,100,105,111,34,41,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,61,32,48,59, - 13,10,13,10,32,32,32,32,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,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,77,97,110,97,103,101,114, - 32,102,111,114,109,97,116,77,97,110,97,103,101,114,59,13,10,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,114, - 101,103,105,115,116,101,114,66,97,115,105,99,70,111,114,109,97,116,115,40,41,59,13,10,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,105,108,101,67,104,111,111,115,101,114,32,61,32,110,101,119,32,70,105,108,101,110,97,109,101,67, - 111,109,112,111,110,101,110,116,32,40,84,40,34,97,117,100,105,111,102,105,108,101,34,41,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,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,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,110,111,110,101,120,105,115,116,101,110,116,44,13,10,32,32,32,32,32,32,32,32,32, + 61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,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,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,84,40,34,80,97,116,104,115,34,41,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,78,111,32,112,97,114,116,115,32,111,102,32,116,104,105,115,32,99,111,109,112,111,110,101, + 110,116,32,97,114,101,32,115,101,109,105,45,116,114,97,110,115,112,97,114,101,110,116,44,32,115,111,32,99,97,108,108,105,110,103,32,115,101,116,79, + 112,97,113,117,101,40,41,13,10,32,32,32,32,32,32,32,32,47,47,32,97,108,108,111,119,115,32,116,104,101,32,114,101,100,114,97,119,32,115,121, + 115,116,101,109,32,116,111,32,101,120,112,108,111,105,116,32,116,104,105,115,32,102,97,99,116,32,97,110,100,32,111,112,116,105,109,105,115,101,32,114, + 101,112,97,105,110,116,105,110,103,46,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,82,97,110,100,111,109,83,104,97,112,101,40,41,59,13,10,32,32,32,32,32,32,32, + 32,103,101,110,101,114,97,116,101,73,109,97,103,101,40,41,59,13,10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,68,114,97,119,97, + 98,108,101,40,41,59,13,10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,83,86,71,68,114,97,119,97,98,108,101,40,41,59,13,10, + 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,116,121,112,101,67,104,111,111,115,101,114, + 32,32,32,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120,32,40,84,40,34,116,121,112,101,34,41,41,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,115,99,97,108,101,83,108,105,100,101,114,32,32,32,32,61,32,110,101, + 119,32,83,108,105,100,101,114,32,40,84,40,34,115,99,97,108,101,34,41,41,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,97,110,103,108,101,83,108,105,100,101,114,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32, + 40,84,40,34,97,110,103,108,101,34,41,41,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,120,83,108,105,100,101,114,32,32,32,32,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,120,34,41,41,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,121,83,108,105,100,101,114,32,32,32, + 32,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,121,34,41,41,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,111,112,97,99,105,116,121,83,108,105,100,101,114,32,32,61,32,110,101,119,32,83,108, + 105,100,101,114,32,40,84,40,34,111,112,97,99,105,116,121,34,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97, + 98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,116,121,112,101,58,34,41,41,41,32,32,32,32,32,45,62,97, + 116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,116,121,112,101,67,104,111,111,115,101,114,44,32,116,114,117,101,41,59,13,10,32, + 32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,115,99,97, + 108,101,58,34,41,41,41,32,32,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,115,99,97,108,101,83,108,105, + 100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58, + 58,101,109,112,116,121,44,32,84,40,34,97,110,103,108,101,58,34,41,41,41,32,32,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111, + 110,101,110,116,32,40,97,110,103,108,101,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32, + 76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,120,32,111,102,102,115,101,116,58,34,41,41,41,32,45, + 62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,120,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32, + 32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,121,32,111,102,102, + 115,101,116,58,34,41,41,41,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,121,83,108,105,100,101,114,44,32,116, + 114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121, + 44,32,84,40,34,111,112,97,99,105,116,121,58,34,41,41,41,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40, + 111,112,97,99,105,116,121,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111, + 111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,115,111,108,105,100,32,99, + 111,108,111,117,114,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116, + 101,109,32,40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,108,105,110,101,97,114,32,103,114,97,100,105,101,110,116,32,102,105, + 108,108,34,41,44,32,50,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32, + 40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,114,97,100,105,97,108,32,103,114,97,100,105,101,110,116,32,102,105,108,108,34, + 41,44,32,51,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40, + 34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,116,105,108,101,100,32,105,109,97,103,101,32,102,105,108,108,34,41,44,32,56,41,59,13, + 10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32, + 45,32,108,111,119,32,113,117,97,108,105,116,121,34,41,44,32,52,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101, + 114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32,45,32,104,105,103,104,32,113,117,97,108,105,116,121,34,41,44,32,53, + 41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97, + 103,101,32,45,32,99,111,108,111,117,114,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,54,41,59,13, + 10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32, + 45,32,103,114,97,100,105,101,110,116,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,55,41,59,13,10, + 32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32,45, + 32,97,108,112,104,97,109,97,112,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,57,41,59,13,10,32, + 32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,100,114,97,119,97,98,108,101, + 32,111,98,106,101,99,116,34,41,44,32,49,48,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100, + 100,73,116,101,109,32,40,84,40,34,83,86,71,32,111,98,106,101,99,116,34,41,44,32,49,49,41,59,13,10,32,32,32,32,32,32,32,32,116,121, + 112,101,67,104,111,111,115,101,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,49,49,41,59,13,10,32,32,32,32,32,32,32,32, + 116,121,112,101,67,104,111,111,115,101,114,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,115,99,97,108,101,83,108,105,100,101,114,32,32,32,45,62,97,100,100,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,110,103,108,101,83,108,105,100,101,114,32,32,32,45,62,97,100,100,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,120,83,108,105,100,101,114,32,32,32,32,32,32,32,45,62,97,100,100,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,121,83,108,105,100,101,114,32,32,32,32,32,32,32,45,62,97,100,100,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,111,112,97,99,105,116,121,83,108,105,100,101,114,32,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,115,99,97,108,101,83,108,105,100, + 101,114,45,62,115,101,116,82,97,110,103,101,32,40,48,46,48,49,44,32,49,48,46,48,44,32,48,46,48,48,49,41,59,13,10,32,32,32,32,32, + 32,32,32,115,99,97,108,101,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,49,46,48,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,46,48,44,32,49,46,48,44,32,48,46,48, + 48,49,41,59,13,10,32,32,32,32,32,32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,48,44,32,49,48,44,32, + 48,46,48,48,49,41,59,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59,13, + 10,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,48,44,32,49,48,44,32,48, + 46,48,48,49,41,59,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59,13,10, + 13,10,32,32,32,32,32,32,32,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,48,44,32,49,44, + 32,48,46,48,49,41,59,13,10,32,32,32,32,32,32,32,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101, + 32,40,49,46,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,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,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,105,109,97,103,101,59,13,10,13,10,32,32,32,32,32,32,32,32,100,101, + 108,101,116,101,32,100,114,97,119,97,98,108,101,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,118,103,68,114,97,119,97,98, + 108,101,59,13,10,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,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32, + 123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,67,104,101,99,107,101,114,66,111,97,114,100,32,40,48,44,32,48,44,32,103,101,116, + 87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,53,48,44,32,53,48,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,32,32,32,67,111,108,111,117,114,32,40,48,120,102,102,101,48,101,48,101,48,41,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,32,32,32,67,111,108,111,117,114,115,58,58,119,104,105,116,101,41,59,13,10,13,10,32,32, + 32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,116,121,112,101,32,61,32,116,121,112,101,67,104,111,111,115,101,114,45,62,103,101,116,83, + 101,108,101,99,116,101,100,73,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,121,112,101,32,61,61,32,49,41,13,10, + 32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111, + 117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100, + 101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,80,97,116, + 104,32,40,115,104,97,112,101,44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32, + 32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,50,32,124,124,32,116,121,112,101,32,61,61,32,51,41,13, + 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98, + 32,40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105, + 116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,53,102,44,32,103,101,116,72,101,105,103, + 104,116,40,41,32,42,32,48,46,53,102,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,32, + 32,32,32,32,67,111,108,111,117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99, + 105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,54,102,44,32,103,101,116,72,101,105, + 103,104,116,40,41,32,42,32,48,46,55,102,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, + 32,32,32,32,32,116,121,112,101,32,61,61,32,51,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117, + 115,104,32,40,38,103,98,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,80,97,116,104,32,40,115,104,97,112,101, + 44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101, + 108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,56,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,73,109,97,103,101,66,114,117,115,104,32,105,98,32,40,105,109,97,103,101,44,32,49,48,48,44,32,49,48,48,44,32,40,102,108,111,97, + 116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,103,46,115,101,116,66,114,117,115,104,32,40,38,105,98,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102, + 105,108,108,80,97,116,104,32,40,115,104,97,112,101,44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32, + 32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,52,32,124,124,32,116,121,112,101,32, + 61,61,32,53,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,121,112,101,32,61, + 61,32,52,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,73,109,97,103,101,82,101,115,97,109,112,108,105, + 110,103,81,117,97,108,105,116,121,32,40,71,114,97,112,104,105,99,115,58,58,108,111,119,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116, + 121,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103, + 46,115,101,116,73,109,97,103,101,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116,121,32,40,71,114,97,112,104,105,99,115,58,58,109,101, + 100,105,117,109,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116,121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103, + 46,115,101,116,79,112,97,99,105,116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86, + 97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109, + 97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116, + 87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110, + 115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105, + 100,116,104,40,41,44,32,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,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,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,102,97,108,115,101,44,32,102,97,108,115,101,44,13,10,32,32,32,32, + 46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,41,59,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105, + 102,32,40,116,121,112,101,32,61,61,32,54,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46, + 115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111, + 97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40, + 105,109,97,103,101,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,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62, + 103,101,116,72,101,105,103,104,116,40,41,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,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105, + 111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,45,48,46,53,102,32,42,32,105, + 109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116, + 84,114,97,110,115,102,111,114,109,40,41,41,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, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, + 32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,55,41,13,10,32,32, + 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98,32,40,67, + 111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83, + 108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,53,102,44,32,103,101,116,72,101,105,103,104,116,40, + 41,32,42,32,48,46,53,102,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,32,32,32,32, + 32,67,111,108,111,117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121, + 83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,54,102,44,32,103,101,116,72,101,105,103,104,116, + 40,41,32,42,32,48,46,55,102,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,32,32,32, + 32,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117,115,104,32,40,38,103,98, + 41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,84,114,97, + 110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40, + 41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58, + 58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44, + 32,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111, + 119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101, + 32,61,61,32,57,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,73,109,97,103,101,66,114,117,115, + 104,32,105,98,32,40,105,109,97,103,101,44,32,49,48,48,44,32,49,48,48,44,32,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108, + 105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117, + 115,104,32,40,38,105,98,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73, + 109,97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101, + 116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97, + 110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87, + 105,100,116,104,40,41,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,45, + 48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101, + 100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61, + 61,32,49,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,79,112,97,99,105, + 116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13, + 10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,119,44,32,104,59,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,100,114,97,119,97,98,108,101,45,62,103,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13, + 10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,114,97,119,97,98,108,101,45,62,100,114,97,119,32,40,103,44,32,65,102,102,105,110,101, + 84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,120,32,45,32,48,46,53,102,32,42,32,119,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,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,32,32,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,103,101,116,87,105,108, - 100,99,97,114,100,70,111,114,65,108,108,70,111,114,109,97,116,115,40,41,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,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,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,83,116,114,105,110,103,58,58,101,109,112,116,121,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,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,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,84,40,34,40,99,104,111,111,115,101,32,97,32,87,65,86,32,111,114,32,65,73,70,70,32,102,105,108,101,32,116,111,32, - 112,108,97,121,41,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45,62,97,100,100,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101,116,66,114, - 111,119,115,101,66,117,116,116,111,110,84,101,120,116,32,40,84,40,34,98,114,111,119,115,101,34,41,41,59,13,10,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,112,108,97,121,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,84,40,34,112,108,97,121,34,41,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,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,32,32,32,32,32,32,84,40,34, - 99,108,105,99,107,32,104,101,114,101,32,116,111,32,112,108,97,121,32,116,104,101,32,99,117,114,114,101,110,116,32,97,117,100,105,111,32,102,105,108, - 101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,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,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,67,111, - 108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114, - 115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116, - 67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,79,110,67,111,108,111,117,114,73,100,44,32,67,111, - 108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45, - 62,115,101,116,67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101,100,79,110,82, - 105,103,104,116,41,59,13,10,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,115,116,111, - 112,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,84,40,34,115,116,111,112,34,41,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,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,32,32,32,32,32,32,84,40,34,99,108,105,99,107,32,104,101,114,101,32,116,111,32,112,108,97,121,32,116,104,101,32, - 99,117,114,114,101,110,116,32,97,117,100,105,111,32,102,105,108,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,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, - 115,116,111,112,66,117,116,116,111,110,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111, - 110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66, - 117,116,116,111,110,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,79,110,67,111, - 108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116,116, - 111,110,45,62,115,101,116,67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101,100, - 79,110,76,101,102,116,41,59,13,10,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, - 117,100,105,111,83,101,116,116,105,110,103,115,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,84,40,34, - 115,104,111,119,32,97,117,100,105,111,32,115,101,116,116,105,110,103,115,46,46,46,34,41,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,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,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,99,108,105,99,107,32,104,101,114,101,32,116,111,32,99,104,97,110,103,101,32,116,104,101,32, - 97,117,100,105,111,32,100,101,118,105,99,101,32,115,101,116,116,105,110,103,115,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105, - 111,83,101,116,116,105,110,103,115,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,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,107,101,121,98,111,97,114, - 100,67,111,109,112,111,110,101,110,116,32,61,32,110,101,119,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,32,40, - 115,121,110,116,104,83,111,117,114,99,101,46,107,101,121,98,111,97,114,100,83,116,97,116,101,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,32,32,32,32,32,32,32,32,45,121,32,45,32,48,46,53,102,32,42,32,104,41,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,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121, + 32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, + 101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,49,49,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,103,46,115,101,116,79,112,97,99,105,116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114, + 45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,108,111,97,116,32,120,44,32,121, + 44,32,119,44,32,104,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,45,62,103,101,116,66,111,117, + 110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119, + 97,98,108,101,45,62,100,114,97,119,32,40,103,44,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116, + 105,111,110,32,40,45,120,32,45,32,48,46,53,102,32,42,32,119,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,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,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,32,32,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110, - 101,110,116,58,58,104,111,114,105,122,111,110,116,97,108,75,101,121,98,111,97,114,100,41,41,59,13,10,13,10,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,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,32,61,32,110, - 101,119,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,40,41,41,59,13,10,13,10,32,32,32,32, - 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, + 32,32,32,32,32,45,121,32,45,32,48,46,53,102,32,42,32,104,41,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,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114, + 109,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,125,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,99,111,110,115,116,32,105,110,116,32,120,32,61,32,49,48,48, + 59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,121,32,61,32,52,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115, + 101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32, + 121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,115,99,97,108,101,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115, + 32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32, + 32,32,32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32, + 50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45, + 62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43, + 61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44, + 32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,111,112, + 97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13, + 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,108,105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83, + 108,105,100,101,114,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32, + 125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120,67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42, + 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,112, + 114,105,118,97,116,101,58,13,10,32,32,32,32,80,97,116,104,32,115,104,97,112,101,59,13,10,32,32,32,32,73,109,97,103,101,42,32,105,109,97, + 103,101,59,13,10,32,32,32,32,68,114,97,119,97,98,108,101,42,32,100,114,97,119,97,98,108,101,59,13,10,32,32,32,32,68,114,97,119,97,98, + 108,101,67,111,109,112,111,115,105,116,101,42,32,115,118,103,68,114,97,119,97,98,108,101,59,13,10,13,10,32,32,32,32,67,111,109,98,111,66,111, + 120,42,32,116,121,112,101,67,104,111,111,115,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,115,99,97,108,101,83,108,105,100,101,114, + 59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,97,110,103,108,101,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42, + 32,120,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,121,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105, + 100,101,114,42,32,111,112,97,99,105,116,121,83,108,105,100,101,114,59,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101, + 82,97,110,100,111,109,83,104,97,112,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,104,97,112,101,46,115,116,97,114, + 116,78,101,119,83,117,98,80,97,116,104,32,40,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101, + 114,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,55,59,32, + 43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,104,97,112,101,46,108,105,110,101,84, + 111,32,40,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,115,104,97,112,101,46,113,117,97,100,114,97,116,105,99,84,111,32,40,114,97,110,100,111,109,78,117,109,98, + 101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,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,32,32,32,32,32,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98, + 101,114,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,115,104,97,112,101,46,99,108,111,115,101, + 83,117,98,80,97,116,104,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101,73,109, + 97,103,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,32,61,32,73,109,97,103,101,70,105,108,101,70, + 111,114,109,97,116,58,58,108,111,97,100,70,114,111,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66, + 105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, + 118,111,105,100,32,103,101,110,101,114,97,116,101,68,114,97,119,97,98,108,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, + 47,47,32,99,114,101,97,116,101,32,97,32,99,111,109,112,111,115,105,116,101,32,100,114,97,119,97,98,108,101,32,111,98,106,101,99,116,46,46,13, + 10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,42,32,100,99,32,61,32,110,101,119,32,68,114,97, + 119,97,98,108,101,67,111,109,112,111,115,105,116,101,40,41,59,13,10,32,32,32,32,32,32,32,32,100,114,97,119,97,98,108,101,32,61,32,100,99, + 59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,46,46,97,100,100,32,97,32,112,97,116,104,115,32,100,114,97,119,97,98,108,101,32,116, + 111,32,105,116,46,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,100,112,59,13,10,32,32,32,32,32, + 32,32,32,100,112,46,115,101,116,80,97,116,104,32,40,115,104,97,112,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,112,46,115,101,116, + 79,117,116,108,105,110,101,32,40,52,46,48,102,44,32,67,111,108,111,117,114,115,58,58,98,108,117,101,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98,32,40,67,111,108,111,117,114,71,114,97,100,105,101,110,116,32,40,67,111,108,111, + 117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,48,46,52,102,41,44,32,45,49,48,48,46,48,102,44,32,45,49,48,48, + 46,48,102,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,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,67,111,108,111,117,114,115,58,58,103,114,101,101,110,46,119,105,116,104,65,108,112,104,97,32,40,48,46,54,102,41,44, + 32,49,48,48,46,48,102,44,32,49,48,48,46,48,102,44,32,102,97,108,115,101,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,112,46, + 115,101,116,70,105,108,108,66,114,117,115,104,32,40,103,98,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116, + 68,114,97,119,97,98,108,101,32,40,100,112,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,46,46,97,100,100,32,97,110,32,105,109, + 97,103,101,32,100,114,97,119,97,98,108,101,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,73,109,97,103,101,32,100,105, + 59,13,10,32,32,32,32,32,32,32,32,100,105,46,115,101,116,73,109,97,103,101,32,40,105,109,97,103,101,44,32,102,97,108,115,101,41,59,13,10, + 13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116,68,114,97,119,97,98,108,101,32,40,100,105,44,32,65,102,102,105,110,101, + 84,114,97,110,115,102,111,114,109,58,58,115,99,97,108,101,32,40,48,46,51,102,44,32,48,46,56,102,41,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,47,47,32,46,46,97,110,100,32,97,32,116,101,120,116,32,111,98,106,101,99,116,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97, + 98,108,101,84,101,120,116,32,100,116,59,13,10,32,32,32,32,32,32,32,32,100,116,46,115,101,116,84,101,120,116,32,40,84,40,34,74,85,67,69, + 32,68,114,97,119,97,98,108,101,115,34,41,44,32,70,111,110,116,32,40,51,48,46,48,102,44,32,70,111,110,116,58,58,98,111,108,100,41,41,59, + 13,10,32,32,32,32,32,32,32,32,100,116,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,103,114,101,101,110,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116,68,114,97,119,97,98,108,101,32,40,100,116,44,32,65,102,102,105, + 110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,56,48,46,48,102,44,32,45,50,48,46,48,102, + 41,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,32,32,32,32,32,32,32,32,32,32,32,46, + 115,99,97,108,101,100,32,40,50,46,48,102,44,32,48,46,56,102,41,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,32,32,32,32,32,32,32,32,32,32,32,46,114,111,116,97,116,101,100,32,40,45,49,46,51,102,41,41,59,13,10,32,32,32, + 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101,83,86,71,68,114,97,119,97,98,108,101,40,41,13,10,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,32,61,32,48,59,13,10,13,10,32,32,32,32,32,32,32, + 32,77,101,109,111,114,121,73,110,112,117,116,83,116,114,101,97,109,32,105,99,111,110,115,70,105,108,101,83,116,114,101,97,109,32,40,66,105,110,97, + 114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,44,32,66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112, + 83,105,122,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,90,105,112,70,105,108,101,32,105,99,111,110,115,32,40,38,105, + 99,111,110,115,70,105,108,101,83,116,114,101,97,109,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,76,111, + 97,100,32,97,32,114,97,110,100,111,109,32,83,86,71,32,102,105,108,101,32,102,114,111,109,32,111,117,114,32,101,109,98,101,100,100,101,100,32,105, + 99,111,110,115,46,122,105,112,32,102,105,108,101,46,13,10,32,32,32,32,32,32,32,32,73,110,112,117,116,83,116,114,101,97,109,42,32,115,118,103, + 70,105,108,101,83,116,114,101,97,109,13,10,32,32,32,32,32,32,32,32,32,32,32,32,61,32,105,99,111,110,115,46,99,114,101,97,116,101,83,116, + 114,101,97,109,70,111,114,69,110,116,114,121,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46, + 110,101,120,116,73,110,116,32,40,105,99,111,110,115,46,103,101,116,78,117,109,69,110,116,114,105,101,115,40,41,41,41,59,13,10,13,10,32,32,32, + 32,32,32,32,32,105,102,32,40,115,118,103,70,105,108,101,83,116,114,101,97,109,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,42,32,108,111,97,100,101,100,83,86,71,32,61,32,68,114,97,119,97, + 98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109,97,103,101,68,97,116,97,83,116,114,101,97,109,32,40,42,115,118,103,70,105,108,101, + 83,116,114,101,97,109,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,108,111,97,100,101,100,83,86,71,32,33,61, + 32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116, + 111,32,109,97,107,101,32,111,117,114,32,105,99,111,110,32,116,104,101,32,114,105,103,104,116,32,115,105,122,101,44,32,119,101,39,108,108,32,112,117, + 116,32,105,116,32,105,110,115,105,100,101,32,97,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,44,32,97,110,100,32,97,112,112, + 108,121,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,116,114,97,110,115,102,111,114,109,32,116,111,32,103,101, + 116,32,105,116,32,116,111,32,116,104,101,32,115,105,122,101,32,119,101,32,119,97,110,116,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,119,44,32,104,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 108,111,97,100,101,100,83,86,71,45,62,103,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,115,99,97,108,101,70,97,99,116,111,114,32,61,32,51,48, + 48,46,48,102,32,47,32,106,109,97,120,32,40,119,44,32,104,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115, + 118,103,68,114,97,119,97,98,108,101,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,40,41,59,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,45,62,105,110,115,101,114,116,68,114,97,119,97,98, + 108,101,32,40,108,111,97,100,101,100,83,86,71,44,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,115,99,97,108,101,32,40,115, + 99,97,108,101,70,97,99,116,111,114,44,32,115,99,97,108,101,70,97,99,116,111,114,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,118,103,70,105,108,101,83,116,114,101,97,109,59,13,10, + 32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,65,102,102,105,110,101,84,114,97,110, + 115,102,111,114,109,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,114,101,116,117,114,110,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,114,111,116,97,116,105,111,110,32,40,102,108,111, + 97,116,95,80,105,32,42,32,50,46,48,102,32,42,32,40,102,108,111,97,116,41,32,97,110,103,108,101,83,108,105,100,101,114,45,62,103,101,116,86, + 97,108,117,101,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,115,99,97,108,101,100,32,40,40,102,108,111,97,116, + 41,32,115,99,97,108,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,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,40,102,108,111,97,116,41,32,115,99,97,108,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108, + 117,101,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,116,114,97,110,115,108,97,116,101,100,32,40,103,101,116,87, + 105,100,116,104,40,41,32,42,32,48,46,53,102,32,43,32,40,102,108,111,97,116,41,32,120,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117, + 101,40,41,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,32,32,32,32,103,101,116,72,101, + 105,103,104,116,40,41,32,42,32,48,46,53,102,32,43,32,40,102,108,111,97,116,41,32,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117, + 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*) temp1; + +static const unsigned char temp2[] = {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,32,32,32,32,32,32,32,32,47,47,32,114,101,103,105,115,116,101,114,32,102,111,114,32,115,116,97,114,116,47,115,116,111,112, - 32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,46,46,13,10,32, - 32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,97,100,100,67,104,97,110,103,101,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,97,110,100,32,105,110,105,116,105,97,108,105,115,101,32,116,104, - 101,32,100,101,118,105,99,101,32,109,97,110,97,103,101,114,32,119,105,116,104,32,110,111,32,115,101,116,116,105,110,103,115,32,115,111,32,116,104,97, - 116,32,105,116,32,112,105,99,107,115,32,97,13,10,32,32,32,32,32,32,32,32,47,47,32,100,101,102,97,117,108,116,32,100,101,118,105,99,101,32, - 116,111,32,117,115,101,46,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,101,114,114,111,114,32,40,97,117,100, - 105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,105,110,105,116,105,97,108,105,115,101,32,40,49,44,32,47,42,32,110,117,109,98,101,114, - 32,111,102,32,105,110,112,117,116,32,99,104,97,110,110,101,108,115,32,42,47,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,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,32,32,32,32,32,32,32, - 32,32,50,44,32,47,42,32,110,117,109,98,101,114,32,111,102,32,111,117,116,112,117,116,32,99,104,97,110,110,101,108,115,32,42,47,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,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,32,32,32,32,32,32,32,32,32,48,44,32,47,42,32,110,111,32,88,77,76,32,115,101,116,116,105,110,103,115,46,46, - 32,42,47,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,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,32,32,32,32,32,32,32,32,32,116,114,117,101,32,32,47,42,32,115,101,108,101,99,116,32, - 100,101,102,97,117,108,116,32,100,101,118,105,99,101,32,111,110,32,102,97,105,108,117,114,101,32,42,47,41,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,105,102,32,40,101,114,114,111,114,46,105,115,78,111,116,69,109,112,116,121,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40, - 65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,65,117,100,105,111,32,68,101,109, - 111,34,41,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,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,84,40,34,67,111,117,108,100,110,39,116,32,111,112,101,110,32,97,110,32,111,117,116,112,117,116,32,100,101,118,105,99,101, - 33,92,110,92,110,34,41,32,43,32,101,114,114,111,114,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108, - 115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,116,104,101,32,116,119, - 111,32,97,117,100,105,111,32,115,111,117,114,99,101,115,32,116,111,32,111,117,114,32,109,105,120,101,114,46,46,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,109,105,120,101,114,83,111,117,114,99,101,46,97,100,100,73,110,112,117,116,83,111,117,114,99,101,32,40,38,116,114,97,110,115,112,111, - 114,116,83,111,117,114,99,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,105,120,101,114,83,111,117,114, - 99,101,46,97,100,100,73,110,112,117,116,83,111,117,114,99,101,32,40,38,115,121,110,116,104,83,111,117,114,99,101,44,32,102,97,108,115,101,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,97,110,100,32,99,111,110,110,101,99,116,32,116,104,101,32,109,105,120, - 101,114,32,116,111,32,111,117,114,32,115,111,117,114,99,101,32,112,108,97,121,101,114,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,117, - 100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,115,101,116,83,111,117,114,99,101,32,40,38,109,105,120,101,114,83,111,117,114,99,101,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,115,116,97,114,116,32,116,104,101,32,73,79,32,100,101,118,105,99,101,32, - 112,117,108,108,105,110,103,32,105,116,115,32,100,97,116,97,32,102,114,111,109,32,111,117,114,32,99,97,108,108,98,97,99,107,46,46,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,115,101,116,65,117,100,105,111,67,97,108, - 108,98,97,99,107,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,119,101,32,110, - 101,101,100,32,116,111,32,115,101,110,100,32,109,105,100,105,32,105,110,112,117,116,32,116,111,32,111,117,114,32,115,121,110,116,104,32,102,111,114,32, - 112,114,111,99,101,115,115,105,110,103,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103, - 101,114,46,97,100,100,77,105,100,105,73,110,112,117,116,67,97,108,108,98,97,99,107,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32, - 38,115,121,110,116,104,83,111,117,114,99,101,46,109,105,100,105,67,111,108,108,101,99,116,111,114,41,59,13,10,32,32,32,32,32,32,32,32,125,13, - 10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,65,117,100,105,111,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,114,101,109,111,118,101,77,105,100,105,73,110,112,117,116,67,97,108, - 108,98,97,99,107,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,38,115,121,110,116,104,83,111,117,114,99,101,46,109,105,100,105,67, - 111,108,108,101,99,116,111,114,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,115, - 101,116,65,117,100,105,111,67,97,108,108,98,97,99,107,32,40,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114, - 116,83,111,117,114,99,101,46,114,101,109,111,118,101,67,104,97,110,103,101,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,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116,83,111,117,114,99,101,32,40,48,41,59,13,10, - 32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83, - 111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,115,101,116, - 83,111,117,114,99,101,32,40,48,41,59,13,10,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,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,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,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,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,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101, - 73,79,67,97,108,108,98,97,99,107,32,40,99,111,110,115,116,32,102,108,111,97,116,42,42,32,105,110,112,117,116,67,104,97,110,110,101,108,68,97, - 116,97,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,32,32,32,32,32,32,32,105,110,116, - 32,116,111,116,97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,102,108,111,97,116,42,42,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97, - 116,97,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,32,32,32,32,32,32,32,105,110,116, - 32,116,111,116,97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,47,47,32,112,97,115,115,32,116,104,101,32,97,117,100,105,111,32,99,97,108,108,98,97,99,107,32,111,110,32, - 116,111,32,111,117,114,32,112,108,97,121,101,114,32,115,111,117,114,99,101,44,32,97,110,100,32,97,108,115,111,32,116,104,101,32,119,97,118,101,102, - 111,114,109,32,100,105,115,112,108,97,121,32,99,111,109,112,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97, - 121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,73,79,67,97,108,108,98,97,99,107,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68, - 97,116,97,44,32,116,111,116,97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,44,32,111,117,116,112,117,116,67,104,97,110,110,101, - 108,68,97,116,97,44,32,116,111,116,97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,44,32,110,117,109,83,97,109,112,108,101, - 115,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111,68,101,118, - 105,99,101,73,79,67,97,108,108,98,97,99,107,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,44,32,116,111,116,97,108,78,117, - 109,73,110,112,117,116,67,104,97,110,110,101,108,115,44,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97,116,97,44,32,116,111,116,97,108, - 78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,44,32,110,117,109,83,97,109,112,108,101,115,41,59,13,10,32,32,32,32,125,13,10, - 13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,65,117,100,105, - 111,73,79,68,101,118,105,99,101,42,32,100,101,118,105,99,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111, - 83,111,117,114,99,101,80,108,97,121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,100,101, - 118,105,99,101,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111, - 68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,100,101,118,105,99,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32, - 32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,83,116,111,112,112,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32, - 32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,83,116,111,112,112,101, - 100,40,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111,68,101, - 118,105,99,101,83,116,111,112,112,101,100,40,41,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,13,10,42,47,13, + 10,13,10,35,105,102,100,101,102,32,95,87,73,78,51,50,13,10,32,35,105,110,99,108,117,100,101,32,60,119,105,110,100,111,119,115,46,104,62,13, + 10,35,101,110,100,105,102,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,79,80,69,78,71,76,13,10,13,10,35,105,102,100,101,102,32,95,87,73,78,51,50,13, + 10,32,35,105,110,99,108,117,100,101,32,60,103,108,47,103,108,46,104,62,13,10,32,35,105,110,99,108,117,100,101,32,60,103,108,47,103,108,117,46, + 104,62,13,10,35,101,108,105,102,32,100,101,102,105,110,101,100,32,40,76,73,78,85,88,41,13,10,32,35,105,110,99,108,117,100,101,32,60,71,76, + 47,103,108,46,104,62,13,10,32,35,105,110,99,108,117,100,101,32,60,71,76,47,103,108,117,116,46,104,62,13,10,32,35,117,110,100,101,102,32,75, + 101,121,80,114,101,115,115,13,10,35,101,108,115,101,13,10,32,35,105,110,99,108,117,100,101,32,60,71,76,85,84,47,103,108,117,116,46,104,62,13, + 10,35,101,110,100,105,102,13,10,13,10,35,105,102,110,100,101,102,32,71,76,95,66,71,82,65,95,69,88,84,13,10,32,35,100,101,102,105,110,101, + 32,71,76,95,66,71,82,65,95,69,88,84,32,48,120,56,48,101,49,13,10,35,101,110,100,105,102,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,13,10,32,32,32,32,118,111,105,100,32, - 112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,112, - 114,105,110,116,32,115,111,109,101,32,116,101,120,116,32,116,111,32,101,120,112,108,97,105,110,32,119,104,97,116,32,115,116,97,116,101,32,119,101,39, - 114,101,32,105,110,46,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58, - 98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,49,52,46,48,102,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,83,116,114,105,110,103,32,115,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,114,97,110,115,112,111,114, - 116,83,111,117,114,99,101,46,105,115,80,108,97,121,105,110,103,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,61,32,84,40, - 34,112,108,97,121,105,110,103,34,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115, - 32,61,32,84,40,34,115,116,111,112,112,101,100,34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,99,117,114,114,101,110,116,65, - 117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,43,61,32,84, - 40,34,32,45,32,110,111,32,115,111,117,114,99,101,32,102,105,108,101,32,115,101,108,101,99,116,101,100,34,41,59,13,10,32,32,32,32,32,32,32, - 32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,43,61,32,84,40,34,32,45,32,102,105,108,101,58,32,92,34,34,41, - 32,43,32,99,117,114,114,101,110,116,70,105,108,101,46,103,101,116,70,117,108,108,80,97,116,104,78,97,109,101,40,41,32,43,32,84,40,34,92,34, - 34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,115,44,32,50,53,48,44,32,53,48,44,32,103, - 101,116,87,105,100,116,104,40,41,32,45,32,50,53,48,44,32,50,52,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116, - 114,101,100,76,101,102,116,44,32,116,114,117,101,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101,116,66,111,117, - 110,100,115,32,40,49,48,44,32,49,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,50,48,44,32,50,52,41,59,13,10,32,32,32,32, - 32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,53,48,44,32,49,48,48,44,32, - 50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,49,48, - 44,32,53,48,44,32,49,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117, - 116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32, - 32,32,32,32,32,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70, - 105,116,84,101,120,116,40,41,59,13,10,32,32,32,32,32,32,32,32,107,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,45,62,115,101, - 116,66,111,117,110,100,115,32,40,49,48,44,32,50,48,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,50,48,44,32,54,48,41,59,13, - 10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,115,101,116,66,111,117,110,100,115,32,40,49, - 48,44,32,51,48,48,44,32,52,48,48,44,32,56,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,66,117,116,116,111, - 110,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,117,112,100,97,116,101,66,117,116,116,111,110,115,40,41, - 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,69,110,97,98,108,101,100,32, - 40,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,33,61,32,48,32,38,38,32,33,32,116,114,97,110,115,112, - 111,114,116,83,111,117,114,99,101,46,105,115,80,108,97,121,105,110,103,40,41,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116, - 116,111,110,45,62,115,101,116,69,110,97,98,108,101,100,32,40,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,105,115,80,108,97,121,105, - 110,103,40,41,41,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,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,117,116,116,111,110,41,13,10,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,112,108,97,121,66,117,116,116,111,110,41,13,10, - 32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115, - 101,116,80,111,115,105,116,105,111,110,32,40,48,46,48,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116, - 83,111,117,114,99,101,46,115,116,97,114,116,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101, - 32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,115,116,111,112,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,116,111,112,40,41,59,13,10,32,32,32,32, - 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,97,117,100,105,111,83, - 101,116,116,105,110,103,115,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47, - 47,32,67,114,101,97,116,101,32,97,110,32,65,117,100,105,111,68,101,118,105,99,101,83,101,108,101,99,116,111,114,67,111,109,112,111,110,101,110,116, - 32,119,104,105,99,104,32,99,111,110,116,97,105,110,115,32,116,104,101,32,97,117,100,105,111,32,99,104,111,105,99,101,32,119,105,100,103,101,116,115, - 46,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,117,100,105,111,68,101,118,105,99,101,83,101,108,101,99,116,111,114,67,111, - 109,112,111,110,101,110,116,32,97,117,100,105,111,83,101,116,116,105,110,103,115,67,111,109,112,32,40,97,117,100,105,111,68,101,118,105,99,101,77,97, - 110,97,103,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,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,32,32,32,32,32,32,32,32,32,32,48,44,32,49,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,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,32,32,32,32,32,32,32,32,32,32,50,44,32,50,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,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,32,32,32,32,32,32,32,32, - 32,32,116,114,117,101,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,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,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,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,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,32,32,32,32,32,32,32,32,32,32,116,114,117,101,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,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,32,32,32,32,32,32, - 32,32,32,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,46,97,110,100,32,115,104,111, - 119,32,105,116,32,105,110,32,97,32,68,105,97,108,111,103,87,105,110,100,111,119,46,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97, - 117,100,105,111,83,101,116,116,105,110,103,115,67,111,109,112,46,115,101,116,83,105,122,101,32,40,53,48,48,44,32,52,53,48,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,68,105,97,108,111,103,87,105,110,100,111,119,58,58,115,104,111,119,77,111,100,97,108,68,105,97,108,111, - 103,32,40,84,40,34,65,117,100,105,111,32,83,101,116,116,105,110,103,115,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,38,97,117,100,105,111,83,101,116,116,105,110, - 103,115,67,111,109,112,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,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,116,104,105,115,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,108,111,117,114,115,58,58,97,122,117,114,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,102, - 105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,67,104,97,110,103,101,100,32,40,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101, - 110,116,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119, - 104,101,110,32,116,104,101,32,117,115,101,114,32,99,104,97,110,103,101,115,32,116,104,101,32,102,105,108,101,110,97,109,101,32,105,110,32,116,104,101, - 32,102,105,108,101,32,99,104,111,111,115,101,114,32,98,111,120,13,10,13,10,32,32,32,32,32,32,32,32,70,105,108,101,32,97,117,100,105,111,70, - 105,108,101,32,40,102,105,108,101,67,104,111,111,115,101,114,45,62,103,101,116,67,117,114,114,101,110,116,70,105,108,101,40,41,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,47,47,32,117,110,108,111,97,100,32,116,104,101,32,112,114,101,118,105,111,117,115,32,102,105,108,101,32,115,111,117,114, - 99,101,32,97,110,100,32,100,101,108,101,116,101,32,105,116,46,46,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117, - 114,99,101,46,115,116,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116, - 83,111,117,114,99,101,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,99,117,114,114, - 101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116, - 101,32,97,32,110,101,119,32,102,105,108,101,32,115,111,117,114,99,101,32,102,114,111,109,32,116,104,101,32,102,105,108,101,46,46,13,10,13,10,32, - 32,32,32,32,32,32,32,47,47,32,103,101,116,32,97,32,102,111,114,109,97,116,32,109,97,110,97,103,101,114,32,97,110,100,32,115,101,116,32,105, - 116,32,117,112,32,119,105,116,104,32,116,104,101,32,98,97,115,105,99,32,116,121,112,101,115,32,40,119,97,118,32,97,110,100,32,97,105,102,102,41, - 46,13,10,32,32,32,32,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,77,97,110,97,103,101,114,32,102,111,114,109,97,116,77,97,110,97, - 103,101,114,59,13,10,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,114,101,103,105,115,116,101,114,66,97,115,105, - 99,70,111,114,109,97,116,115,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114, - 42,32,114,101,97,100,101,114,32,61,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,99,114,101,97,116,101,82,101,97,100,101,114,70,111,114, - 32,40,97,117,100,105,111,70,105,108,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,101,97,100,101,114,32,33,61,32,48, - 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,70,105,108,101,32,61,32, - 97,117,100,105,111,70,105,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,65,117,100,105,111,70,105, - 108,101,83,111,117,114,99,101,32,61,32,110,101,119,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114,83,111,117,114,99,101,32,40, - 114,101,97,100,101,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,97,110,100,32,112, - 108,117,103,32,105,116,32,105,110,116,111,32,111,117,114,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116,83,111,117,114,99,101,32,40,99,117,114,114,101,110,116, - 65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,51,50,55,54,56,44,32,47,47,32,116,101,108,108,115,32,105,116,32,116,111,32,98, - 117,102,102,101,114,32,116,104,105,115,32,109,97,110,121,32,115,97,109,112,108,101,115,32,97,104,101,97,100,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,97,100,101,114,45,62,115,97, - 109,112,108,101,82,97,116,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,66, - 117,116,116,111,110,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,104,97,110,103,101,76,105,115,116,101, - 110,101,114,67,97,108,108,98,97,99,107,32,40,118,111,105,100,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,99, - 97,108,108,98,97,99,107,32,102,114,111,109,32,116,104,101,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,32,116,111,32,116,101,108, - 108,32,117,115,32,116,104,97,116,32,112,108,97,121,32,104,97,115,13,10,32,32,32,32,32,32,32,32,47,47,32,115,116,97,114,116,101,100,32,111, - 114,32,115,116,111,112,112,101,100,44,32,115,111,32,117,112,100,97,116,101,32,111,117,114,32,98,117,116,116,111,110,115,46,46,13,10,32,32,32,32, - 32,32,32,32,117,112,100,97,116,101,66,117,116,116,111,110,115,40,41,59,13,10,32,32,32,32,125,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,13,10,99,108,97,115,115,32,68, + 101,109,111,79,112,101,110,71,76,67,97,110,118,97,115,32,32,58,32,112,117,98,108,105,99,32,79,112,101,110,71,76,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,32,112,117,98,108,105,99,32,84,105,109, + 101,114,13,10,123,13,10,32,32,32,32,102,108,111,97,116,32,114,111,116,97,116,105,111,110,44,32,100,101,108,116,97,59,13,10,32,32,32,32,73, + 109,97,103,101,42,32,105,109,97,103,101,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68,101,109,111,79,112,101,110,71,76,67, + 97,110,118,97,115,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,111,116,97,116,105,111,110,32,61,32,48,46,48,102,59, + 13,10,32,32,32,32,32,32,32,32,100,101,108,116,97,32,61,32,49,46,48,102,59,13,10,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101, + 42,32,105,109,32,61,32,73,109,97,103,101,70,105,108,101,70,111,114,109,97,116,58,58,108,111,97,100,70,114,111,109,32,40,66,105,110,97,114,121, + 68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101, + 41,59,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,32,61,32,110,101,119,32,73,109,97,103,101,32,40,73,109,97,103,101,58,58,82,71, + 66,44,32,53,49,50,44,32,53,49,50,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,71,114,97,112,104,105,99,115,32,103,32, + 40,42,105,109,97,103,101,41,59,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,119, + 104,105,116,101,41,59,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,32,40,105,109,44,32,48,44,32,48,44,32,53, + 49,50,44,32,53,49,50,44,32,48,44,32,48,44,32,105,109,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,45,62,103,101,116,72,101, + 105,103,104,116,40,41,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,105,109,59,13,10,13,10,32,32,32,32,32,32,32,32, + 115,116,97,114,116,84,105,109,101,114,32,40,50,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,74,117,115,116,32,102,111,114,32, + 100,101,109,111,32,112,117,114,112,111,115,101,115,44,32,108,101,116,39,115,32,100,117,109,112,32,97,32,108,105,115,116,32,111,102,32,97,108,108,32, + 116,104,101,32,97,118,97,105,108,97,98,108,101,32,112,105,120,101,108,32,102,111,114,109,97,116,115,46,46,13,10,32,32,32,32,32,32,32,32,79, + 119,110,101,100,65,114,114,97,121,32,60,79,112,101,110,71,76,80,105,120,101,108,70,111,114,109,97,116,62,32,97,118,97,105,108,97,98,108,101,80, + 105,120,101,108,70,111,114,109,97,116,115,59,13,10,32,32,32,32,32,32,32,32,79,112,101,110,71,76,80,105,120,101,108,70,111,114,109,97,116,58, + 58,103,101,116,65,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,32,40,116,104,105,115,44,32,97,118,97,105,108,97,98, + 108,101,80,105,120,101,108,70,111,114,109,97,116,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61, + 32,48,59,32,105,32,60,32,97,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,46,115,105,122,101,40,41,59,32,43,43, + 105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,79,112,101,110,71,76,80, + 105,120,101,108,70,111,114,109,97,116,42,32,99,111,110,115,116,32,112,105,120,70,111,114,109,97,116,32,61,32,97,118,97,105,108,97,98,108,101,80, + 105,120,101,108,70,111,114,109,97,116,115,91,105,93,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,83,116,114,105,110,103,32,102,111, + 114,109,97,116,68,101,115,99,114,105,112,116,105,111,110,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,109,97,116,68,101,115,99, + 114,105,112,116,105,111,110,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,105,32,60,60,32,34,58,32,82,71,66,65,61,40, + 34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,114,101,100,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60, + 60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,103,114,101,101,110,66,105,116,115,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,98,108,117,101,66,105,116,115,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,108,112,104,97,66, + 105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,41,44,32,100,101,112,116,104,61,34,32,60,60,32,112,105,120, + 70,111,114,109,97,116,45,62,100,101,112,116,104,66,117,102,102,101,114,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60, + 60,32,34,44,32,115,116,101,110,99,105,108,61,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,115,116,101,110,99,105,108,66,117,102,102, + 101,114,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,97,99,99,117,109,32,82,71,66,65,61,40, + 34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110,66,117,102,102,101,114,82,101,100,66,105,116, + 115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97, + 99,99,117,109,117,108,97,116,105,111,110,66,117,102,102,101,114,71,114,101,101,110,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110,66,117,102,102, + 101,114,66,108,117,101,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120, + 70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110,66,117,102,102,101,114,65,108,112,104,97,66,105,116,115,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,41,44,32,102,117,108,108,45,115,99,101,110,101,32,65,65,61,34,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,102,117,108,108,83,99,101,110,101,65,110,116,105,65,108,105,97, + 115,105,110,103,78,117,109,83,97,109,112,108,101,115,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,76,111,103,103,101,114,58,58,111, + 117,116,112,117,116,68,101,98,117,103,83,116,114,105,110,103,32,40,102,111,114,109,97,116,68,101,115,99,114,105,112,116,105,111,110,41,59,13,10,32, + 32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,79,112,101,110,71,76,67,97,110,118,97,115, + 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,32,105,109,97,103,101,59,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,47,47,32,119,104,101,110,32,116,104,101,32,99,111,109,112,111,110,101,110,116,32,99,114,101,97,116,101,115,32,97,32,110, + 101,119,32,105,110,116,101,114,110,97,108,32,99,111,110,116,101,120,116,44,32,116,104,105,115,32,105,115,32,99,97,108,108,101,100,44,32,97,110,100, + 13,10,32,32,32,32,47,47,32,119,101,39,108,108,32,117,115,101,32,116,104,101,32,111,112,112,111,114,116,117,110,105,116,121,32,116,111,32,99,114, + 101,97,116,101,32,116,104,101,32,116,101,120,116,117,114,101,115,32,110,101,101,100,101,100,46,13,10,32,32,32,32,118,111,105,100,32,110,101,119,79, + 112,101,110,71,76,67,111,110,116,101,120,116,67,114,101,97,116,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47, + 32,40,110,111,32,110,101,101,100,32,116,111,32,99,97,108,108,32,109,97,107,101,67,117,114,114,101,110,116,67,111,110,116,101,120,116,65,99,116,105, + 118,101,40,41,44,32,97,115,32,116,104,97,116,32,119,105,108,108,32,104,97,118,101,13,10,32,32,32,32,32,32,32,32,47,47,32,98,101,101,110, + 32,100,111,110,101,32,102,111,114,32,117,115,32,98,101,102,111,114,101,32,116,104,101,32,109,101,116,104,111,100,32,99,97,108,108,41,46,13,10,32, + 32,32,32,32,32,32,32,103,108,67,108,101,97,114,67,111,108,111,114,32,40,48,46,48,102,44,32,48,46,48,102,44,32,48,46,48,102,44,32,48, + 46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,68,101,112,116,104,32,40,49,46,48,41,59,13,10,13,10,32,32, + 32,32,32,32,32,32,103,108,68,101,112,116,104,70,117,110,99,32,40,71,76,95,76,69,83,83,41,59,13,10,32,32,32,32,32,32,32,32,103,108, + 69,110,97,98,108,101,32,40,71,76,95,68,69,80,84,72,95,84,69,83,84,41,59,13,10,32,32,32,32,32,32,32,32,103,108,69,110,97,98,108, + 101,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,41,59,13,10,32,32,32,32,32,32,32,32,103,108,69,110,97,98,108,101,32,40,71,76, + 95,66,76,69,78,68,41,59,13,10,32,32,32,32,32,32,32,32,103,108,83,104,97,100,101,77,111,100,101,108,32,40,71,76,95,83,77,79,79,84, + 72,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85, + 82,69,95,50,68,44,32,71,76,95,84,69,88,84,85,82,69,95,87,82,65,80,95,83,44,32,71,76,95,67,76,65,77,80,41,59,13,10,32,32, + 32,32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,71,76, + 95,84,69,88,84,85,82,69,95,87,82,65,80,95,84,44,32,71,76,95,67,76,65,77,80,41,59,13,10,32,32,32,32,32,32,32,32,103,108,84, + 101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,71,76,95,84,69,88,84,85,82,69,95, + 77,65,71,95,70,73,76,84,69,82,44,32,71,76,95,76,73,78,69,65,82,41,59,13,10,32,32,32,32,32,32,32,32,103,108,84,101,120,80,97, + 114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,71,76,95,84,69,88,84,85,82,69,95,77,73,78,95, + 70,73,76,84,69,82,44,32,71,76,95,76,73,78,69,65,82,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,80,105,120,101,108,83,116, + 111,114,101,105,32,40,71,76,95,85,78,80,65,67,75,95,65,76,73,71,78,77,69,78,84,44,32,52,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,105,110,116,32,115,116,114,105,100,101,44,32,112,105,120,83,116,114,105,100,101,59,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32, + 118,111,105,100,42,32,112,105,120,101,108,115,32,61,32,105,109,97,103,101,45,62,108,111,99,107,80,105,120,101,108,68,97,116,97,82,101,97,100,79, + 110,108,121,32,40,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116, + 72,101,105,103,104,116,40,41,44,32,115,116,114,105,100,101,44,32,112,105,120,83,116,114,105,100,101,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,103,108,84,101,120,73,109,97,103,101,50,68,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,48,44,32,52,44,32,105,109,97,103, + 101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,48,44,32,71,76,95,82,71,66,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,71,76,95,85,78,83,73,71,78,69,68,95,66,89,84,69,44,32,112,105,120,101,108,115,41,59,13,10, + 32,32,32,32,32,32,32,32,105,109,97,103,101,45,62,114,101,108,101,97,115,101,80,105,120,101,108,68,97,116,97,82,101,97,100,79,110,108,121,32, + 40,112,105,120,101,108,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,72,105,110,116,32,40,71,76,95,76,73,78,69,95,83,77,79, + 79,84,72,95,72,73,78,84,44,32,71,76,95,78,73,67,69,83,84,41,59,13,10,32,32,32,32,32,32,32,32,103,108,72,105,110,116,32,40,71, + 76,95,80,79,73,78,84,95,83,77,79,79,84,72,95,72,73,78,84,44,32,71,76,95,78,73,67,69,83,84,41,59,13,10,32,32,32,32,32,32, + 32,32,103,108,66,108,101,110,100,70,117,110,99,32,40,71,76,95,83,82,67,95,65,76,80,72,65,44,32,71,76,95,79,78,69,95,77,73,78,85, + 83,95,83,82,67,95,65,76,80,72,65,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,109,111,117,115,101,68,114, + 97,103,32,40,99,111,110,115,116,32,77,111,117,115,101,69,118,101,110,116,38,32,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32, + 32,100,101,108,116,97,32,61,32,101,46,103,101,116,68,105,115,116,97,110,99,101,70,114,111,109,68,114,97,103,83,116,97,114,116,88,40,41,32,47, + 32,49,48,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,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,110,100,101,114,79,112,101,110,71,76,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103, + 108,67,108,101,97,114,67,111,108,111,114,32,40,48,46,56,102,44,32,48,46,48,102,44,32,48,46,52,102,44,32,48,46,48,102,41,59,13,10,32, + 32,32,32,32,32,32,32,103,108,67,108,101,97,114,32,40,71,76,95,67,79,76,79,82,95,66,85,70,70,69,82,95,66,73,84,32,124,32,71,76, + 95,68,69,80,84,72,95,66,85,70,70,69,82,95,66,73,84,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,77,97,116,114,105,120,77, + 111,100,101,40,71,76,95,80,82,79,74,69,67,84,73,79,78,41,59,13,10,32,32,32,32,32,32,32,32,103,108,76,111,97,100,73,100,101,110,116, + 105,116,121,40,41,59,13,10,32,32,32,32,32,32,32,32,103,108,79,114,116,104,111,32,40,48,46,48,44,32,103,101,116,87,105,100,116,104,40,41, + 44,32,48,46,48,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,48,44,32,49,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108, + 67,111,108,111,114,52,102,32,40,49,46,48,102,44,32,49,46,48,102,44,32,49,46,48,102,44,32,102,97,98,115,102,32,40,58,58,115,105,110,102, + 32,40,114,111,116,97,116,105,111,110,32,47,32,49,48,48,46,48,102,41,41,41,59,13,10,32,32,32,32,32,32,32,32,103,108,66,101,103,105,110, + 40,71,76,95,81,85,65,68,83,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,105,32,40,48, + 44,32,48,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,53,48,46,48,102,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,53, + 48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,105,32,40,49,44,32,48,41,59, + 32,103,108,86,101,114,116,101,120,50,102,32,40,103,101,116,87,105,100,116,104,40,41,32,45,32,53,48,46,48,102,44,32,103,101,116,72,101,105,103, + 104,116,40,41,32,45,32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,105, + 32,40,49,44,32,49,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,103,101,116,87,105,100,116,104,40,41,32,45,32,53,48,46,48,102,44, + 32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,105,32,40,48,44,32,49, + 41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,53,48,46,48,102,44,32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103, + 108,69,110,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,77,97,116,114,105,120,77,111,100,101,32,40,71,76,95,80,82,79,74, + 69,67,84,73,79,78,41,59,13,10,32,32,32,32,32,32,32,32,103,108,76,111,97,100,73,100,101,110,116,105,116,121,40,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,103,108,67,108,101,97,114,32,40,71,76,95,68,69,80,84,72,95,66,85,70,70,69,82,95,66,73,84,41,59,13,10,32, + 32,32,32,32,32,32,32,103,108,117,80,101,114,115,112,101,99,116,105,118,101,32,40,52,53,46,48,102,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,103,101,116,87,105,100,116,104,40,41,32,47,32,40,71,76,102,108,111,97,116,41,32,103,101, + 116,72,101,105,103,104,116,40,41,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,48,46,49,102, + 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,49,48,48,46,48,102,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,103,108,77,97,116,114,105,120,77,111,100,101,32,40,71,76,95,77,79,68,69,76,86,73,69,87,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,103,108,76,111,97,100,73,100,101,110,116,105,116,121,40,41,59,13,10,32,32,32,32,32,32,32,32,103,108,80,117,115,104, + 77,97,116,114,105,120,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,114,97,110,115,108,97,116,101,102,32,40,48, + 46,48,102,44,32,48,46,48,102,44,32,45,53,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,82,111,116,97,116,101, + 102,32,40,114,111,116,97,116,105,111,110,44,32,48,46,53,102,44,32,49,46,48,102,44,32,48,46,48,102,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,103,108,66,101,103,105,110,32,40,71,76,95,81,85,65,68,83,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,48,46,48,102,44,32,49,46,48,102,44,32,48,46,48,102,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59, + 32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86, + 101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101, + 120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40, + 45,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,103,108,67,111,108,111,114,51,102,32,40,49,46,48,102,44,32,48,46,48,102,44,32,48,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101, + 114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120, + 51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32, + 49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108, + 84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102, + 44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111, + 108,111,114,51,102,32,40,48,46,48,102,44,32,48,46,48,102,44,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51, + 102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49, + 46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84, + 101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44, + 32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111, + 111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46, + 48,102,44,32,45,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102, + 32,40,49,46,48,102,44,32,49,46,48,102,44,32,48,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46, + 48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101, + 120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32, + 45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111, + 114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48, + 102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102, + 40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,32, + 49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,48,46,48, + 102,44,32,49,46,48,102,44,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120, + 67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45, + 49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114, + 100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102, + 44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40, + 49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49, + 46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102, + 44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,49,46,48,102,44,32,48,46, + 48,102,44,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100, + 50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44, + 32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48, + 46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46, + 48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44, + 32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48, + 102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,103,108,69,110,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,80,111,112,77,97,116, + 114,105,120,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105,109,101,114,67,97,108,108,98,97,99,107,40, + 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,111,116,97,116,105,111,110,32,43,61,32,100,101,108,116,97,59,13,10,13,10, + 32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,125,59,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,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*) temp1; + 61,61,61,61,61,61,61,61,61,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,79,112,101,110,71,76,68,101,109,111,32,32,58,32,112,117,98,108,105,99,32,67,111,109,112,111,110,101,110,116,13,10,123,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,79,112,101,110,71,76,67,97,110,118,97,115,42,32,99,97,110,118,97,115,59,13,10,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,79,112,101,110,71,76,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,84,40,34,79,112,101,110,71,76,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,97,110, + 118,97,115,32,61,32,110,101,119,32,68,101,109,111,79,112,101,110,71,76,67,97,110,118,97,115,40,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,99,97,110,118,97,115,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32, + 32,126,79,112,101,110,71,76,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,99,97,110,118,97,115,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32, + 49,48,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,48,41,59,13, + 10,32,32,32,32,125,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,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*) temp2; -static const unsigned char temp2[] = {82,73,70,70,4,181,0,0,87,65,86,69,102,109,116,32,16,0,0,0,1,0,1,0,34,86,0,0,68,172,0,0,2,0,16,0,98,101,120,116, - 92,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,114,97,99,107,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,50,48,48,54,45,49,48,45,48,52,49,50,58,49,52,58,48,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,100,97,116,97,124,178,0,0,0,0,0,0,250,255,248,255,0,0,253,255,255,255,0,0,253,255,249,255,249,255,248,255, - 252,255,249,255,0,0,4,0,1,0,255,255,4,0,7,0,255,255,4,0,249,255,252,255,1,0,255,255,0,0,255,255,255,255,3,0,3,0,1,0, - 4,0,252,255,4,0,253,255,255,255,250,255,248,255,241,255,248,255,3,0,6,0,6,0,1,0,7,0,1,0,253,255,253,255,246,255,245,255,242,255, - 246,255,252,255,252,255,249,255,1,0,255,255,0,0,255,255,255,255,253,255,3,0,0,0,253,255,250,255,249,255,245,255,246,255,249,255,248,255,255,255, - 3,0,6,0,0,0,255,255,250,255,4,0,7,0,6,0,0,0,255,255,249,255,252,255,0,0,0,0,6,0,3,0,255,255,0,0,250,255,0,0, - 3,0,4,0,3,0,1,0,4,0,4,0,7,0,3,0,255,255,255,255,246,255,248,255,253,255,3,0,253,255,1,0,252,255,4,0,253,255,6,0, - 3,0,253,255,253,255,252,255,255,255,253,255,253,255,0,0,255,255,0,0,0,0,3,0,7,0,4,0,1,0,255,255,242,255,250,255,255,255,8,0, - 0,0,3,0,0,0,3,0,0,0,249,255,248,255,250,255,0,0,252,255,0,0,253,255,250,255,248,255,253,255,0,0,252,255,0,0,1,0,252,255, - 0,0,250,255,253,255,0,0,4,0,0,0,250,255,255,255,253,255,252,255,3,0,253,255,248,255,0,0,252,255,0,0,249,255,244,255,249,255,252,255, - 255,255,249,255,253,255,246,255,250,255,248,255,1,0,6,0,3,0,0,0,253,255,246,255,250,255,255,255,246,255,249,255,1,0,255,255,253,255,1,0, - 3,0,6,0,1,0,250,255,255,255,252,255,1,0,253,255,0,0,255,255,253,255,0,0,253,255,250,255,250,255,253,255,248,255,255,255,250,255,248,255, - 0,0,253,255,252,255,6,0,3,0,3,0,250,255,255,255,255,255,250,255,249,255,253,255,1,0,4,0,6,0,4,0,255,255,253,255,253,255,255,255, - 255,255,250,255,1,0,253,255,250,255,255,255,249,255,252,255,255,255,255,255,6,0,6,0,8,0,4,0,255,255,1,0,1,0,3,0,255,255,4,0, - 4,0,1,0,250,255,3,0,253,255,253,255,4,0,250,255,255,255,255,255,255,255,249,255,248,255,255,255,3,0,248,255,3,0,248,255,0,0,4,0, - 4,0,253,255,252,255,252,255,246,255,248,255,250,255,250,255,253,255,6,0,3,0,6,0,4,0,6,0,7,0,12,0,6,0,10,0,15,0,14,0, - 6,0,6,0,255,255,248,255,252,255,1,0,3,0,8,0,3,0,3,0,8,0,0,0,1,0,10,0,10,0,7,0,6,0,6,0,10,0,6,0, - 4,0,252,255,4,0,11,0,18,0,14,0,10,0,15,0,11,0,10,0,14,0,15,0,17,0,18,0,17,0,17,0,17,0,11,0,12,0,11,0, - 17,0,12,0,14,0,7,0,10,0,12,0,11,0,4,0,3,0,253,255,255,255,1,0,0,0,250,255,253,255,6,0,4,0,7,0,7,0,4,0, - 1,0,3,0,1,0,3,0,252,255,246,255,248,255,249,255,252,255,0,0,0,0,253,255,255,255,250,255,246,255,249,255,253,255,8,0,6,0,25,0, - 19,0,19,0,18,0,18,0,24,0,24,0,25,0,26,0,30,0,26,0,22,0,28,0,15,0,15,0,8,0,11,0,10,0,7,0,25,0,24,0, - 32,0,44,0,43,0,57,0,51,0,53,0,48,0,46,0,40,0,35,0,29,0,24,0,21,0,8,0,0,0,250,255,239,255,237,255,228,255,227,255, - 223,255,228,255,227,255,228,255,228,255,239,255,239,255,242,255,244,255,245,255,245,255,237,255,223,255,214,255,202,255,191,255,174,255,162,255,155,255,138,255, - 138,255,130,255,127,255,120,255,111,255,111,255,108,255,105,255,102,255,98,255,99,255,99,255,97,255,99,255,104,255,113,255,127,255,145,255,151,255,165,255, - 169,255,180,255,192,255,187,255,180,255,166,255,162,255,156,255,154,255,148,255,149,255,156,255,172,255,187,255,196,255,188,255,194,255,188,255,191,255,181,255, - 181,255,180,255,173,255,170,255,167,255,156,255,141,255,112,255,87,255,57,255,26,255,0,255,231,254,216,254,214,254,211,254,220,254,229,254,239,254,254,254, - 29,255,69,255,104,255,133,255,142,255,166,255,195,255,210,255,232,255,250,255,4,0,253,255,235,255,209,255,180,255,165,255,162,255,165,255,170,255,185,255, - 191,255,184,255,183,255,173,255,154,255,127,255,104,255,99,255,112,255,133,255,156,255,170,255,176,255,173,255,136,255,115,255,79,255,52,255,37,255,37,255, - 50,255,62,255,65,255,65,255,72,255,51,255,11,255,218,254,185,254,171,254,196,254,3,255,79,255,167,255,3,0,89,0,169,0,233,0,33,1,78,1, - 132,1,191,1,243,1,28,2,52,2,48,2,20,2,222,1,141,1,35,1,172,0,54,0,221,255,158,255,130,255,142,255,185,255,238,255,44,0,101,0, - 147,0,150,0,127,0,76,0,7,0,195,255,98,255,254,254,175,254,131,254,105,254,98,254,108,254,119,254,135,254,152,254,163,254,178,254,195,254,221,254, - 254,254,18,255,15,255,254,254,209,254,141,254,72,254,23,254,244,253,6,254,38,254,110,254,213,254,58,255,142,255,220,255,28,0,83,0,134,0,180,0, - 220,0,22,1,90,1,161,1,236,1,54,2,126,2,194,2,250,2,42,3,84,3,107,3,132,3,143,3,143,3,139,3,127,3,91,3,70,3,41,3, - 244,2,187,2,147,2,104,2,84,2,79,2,77,2,78,2,85,2,93,2,84,2,54,2,10,2,202,1,144,1,81,1,14,1,194,0,126,0,72,0, - 55,0,60,0,105,0,157,0,216,0,14,1,54,1,96,1,117,1,136,1,155,1,154,1,164,1,175,1,180,1,194,1,222,1,3,2,49,2,125,2, - 211,2,39,3,103,3,159,3,186,3,172,3,128,3,75,3,19,3,200,2,125,2,50,2,248,1,179,1,117,1,54,1,248,0,183,0,118,0,61,0, - 24,0,0,0,255,255,7,0,43,0,90,0,148,0,213,0,28,1,108,1,193,1,10,2,75,2,147,2,211,2,15,3,67,3,95,3,117,3,141,3, - 142,3,131,3,109,3,85,3,55,3,15,3,226,2,196,2,142,2,85,2,14,2,198,1,117,1,39,1,205,0,101,0,244,255,122,255,242,254,112,254, - 228,253,109,253,1,253,172,252,114,252,89,252,82,252,92,252,128,252,196,252,10,253,91,253,168,253,228,253,19,254,52,254,63,254,52,254,30,254,242,253, - 206,253,166,253,128,253,100,253,96,253,102,253,123,253,154,253,193,253,242,253,37,254,85,254,124,254,163,254,177,254,167,254,153,254,139,254,116,254,80,254, - 11,254,171,253,96,253,42,253,9,253,237,252,219,252,240,252,24,253,77,253,177,253,49,254,175,254,39,255,140,255,209,255,11,0,65,0,115,0,125,0, - 96,0,73,0,51,0,1,0,205,255,176,255,191,255,228,255,249,255,252,255,255,255,245,255,232,255,209,255,174,255,147,255,116,255,61,255,227,254,124,254, - 1,254,142,253,74,253,59,253,27,253,240,252,186,252,142,252,96,252,68,252,24,252,245,251,229,251,241,251,21,252,84,252,151,252,193,252,200,252,161,252, - 77,252,219,251,94,251,244,250,163,250,143,250,177,250,4,251,97,251,207,251,79,252,185,252,248,252,21,253,75,253,207,253,146,254,131,255,127,0,71,1, - 225,1,90,2,181,2,239,2,13,3,21,3,44,3,41,3,37,3,251,2,207,2,149,2,79,2,233,1,56,1,86,0,115,255,191,254,65,254,239,253, - 203,253,204,253,224,253,36,254,128,254,239,254,80,255,151,255,166,255,131,255,54,255,167,254,218,253,243,252,27,252,132,251,58,251,40,251,56,251,96,251, - 125,251,129,251,74,251,234,250,130,250,57,250,21,250,14,250,49,250,94,250,151,250,231,250,86,251,193,251,18,252,63,252,86,252,113,252,120,252,96,252, - 61,252,24,252,23,252,48,252,118,252,228,252,134,253,78,254,40,255,10,0,201,0,93,1,191,1,13,2,84,2,174,2,5,3,82,3,154,3,213,3, - 26,4,74,4,90,4,108,4,144,4,186,4,254,4,75,5,174,5,10,6,104,6,148,6,162,6,125,6,78,6,29,6,252,5,246,5,4,6,21,6, - 61,6,118,6,162,6,166,6,119,6,36,6,201,5,77,5,211,4,106,4,253,3,128,3,17,3,153,2,50,2,208,1,132,1,97,1,104,1,132,1, - 184,1,252,1,75,2,189,2,45,3,163,3,251,3,76,4,155,4,228,4,27,5,69,5,91,5,99,5,87,5,80,5,58,5,39,5,19,5,231,4, - 193,4,167,4,137,4,90,4,51,4,24,4,30,4,59,4,106,4,166,4,231,4,45,5,112,5,173,5,239,5,48,6,93,6,109,6,80,6,29,6, - 221,5,135,5,43,5,220,4,134,4,47,4,208,3,143,3,78,3,24,3,222,2,153,2,90,2,43,2,251,1,216,1,187,1,171,1,178,1,211,1, - 7,2,43,2,74,2,68,2,255,1,162,1,49,1,172,0,43,0,191,255,115,255,86,255,87,255,115,255,180,255,4,0,87,0,140,0,151,0,130,0, - 66,0,226,255,99,255,217,254,54,254,148,253,244,252,110,252,241,251,151,251,90,251,57,251,65,251,104,251,190,251,35,252,149,252,9,253,99,253,174,253, - 221,253,239,253,235,253,208,253,185,253,152,253,99,253,33,253,225,252,158,252,99,252,49,252,17,252,5,252,2,252,27,252,82,252,176,252,49,253,192,253, - 78,254,220,254,81,255,169,255,224,255,221,255,184,255,91,255,214,254,62,254,152,253,3,253,139,252,46,252,237,251,196,251,182,251,227,251,48,252,121,252, - 199,252,35,253,174,253,36,254,134,254,235,254,66,255,130,255,167,255,151,255,99,255,19,255,156,254,27,254,181,253,103,253,49,253,235,252,147,252,60,252, - 244,251,209,251,204,251,190,251,150,251,104,251,60,251,10,251,224,250,202,250,184,250,184,250,215,250,65,251,226,251,163,252,132,253,102,254,14,255,83,255, - 57,255,223,254,94,254,207,253,60,253,160,252,20,252,193,251,147,251,118,251,101,251,99,251,83,251,57,251,14,251,7,251,11,251,64,251,183,251,86,252, - 241,252,100,253,179,253,9,254,113,254,224,254,68,255,163,255,7,0,90,0,165,0,217,0,6,1,7,1,183,0,8,0,22,255,8,254,24,253,107,252, - 17,252,9,252,35,252,86,252,163,252,253,252,92,253,142,253,100,253,192,252,197,251,130,250,57,249,254,247,26,247,120,246,5,246,200,245,180,245,211,245, - 254,245,24,246,3,246,204,245,168,245,164,245,198,245,25,246,147,246,52,247,197,247,37,248,112,248,185,248,14,249,142,249,69,250,72,251,131,252,215,253, - 23,255,54,0,33,1,191,1,2,2,25,2,35,2,63,2,117,2,207,2,107,3,73,4,108,5,184,6,251,7,60,9,149,10,214,11,240,12,197,13, - 110,14,239,14,77,15,132,15,139,15,89,15,211,14,13,14,54,13,105,12,201,11,84,11,5,11,232,10,222,10,189,10,144,10,70,10,239,9,96,9, - 146,8,157,7,150,6,126,5,116,4,114,3,138,2,165,1,202,0,15,0,112,255,236,254,148,254,105,254,120,254,211,254,104,255,43,0,20,1,14,2, - 3,3,221,3,116,4,227,4,69,5,185,5,33,6,155,6,33,7,157,7,2,8,118,8,216,8,35,9,64,9,64,9,49,9,30,9,12,9,255,8, - 240,8,208,8,150,8,67,8,243,7,155,7,45,7,205,6,107,6,21,6,202,5,153,5,102,5,83,5,84,5,81,5,102,5,108,5,106,5,134,5, - 202,5,42,6,180,6,93,7,32,8,236,8,170,9,103,10,246,10,66,11,73,11,7,11,108,10,149,9,133,8,83,7,37,6,239,4,224,3,211,2, - 226,1,22,1,129,0,255,255,113,255,198,254,9,254,42,253,57,252,42,251,14,250,236,248,214,247,215,246,12,246,97,245,14,245,6,245,68,245,197,245, - 111,246,12,247,160,247,33,248,148,248,216,248,242,248,235,248,234,248,221,248,241,248,28,249,98,249,176,249,15,250,119,250,240,250,117,251,241,251,93,252, - 193,252,16,253,81,253,125,253,153,253,167,253,163,253,168,253,167,253,128,253,81,253,56,253,89,253,152,253,210,253,218,253,197,253,186,253,215,253,38,254, - 119,254,196,254,1,255,65,255,137,255,220,255,46,0,134,0,209,0,9,1,54,1,83,1,79,1,49,1,32,1,25,1,249,0,145,0,4,0,91,255, - 164,254,12,254,159,253,55,253,194,252,103,252,43,252,2,252,200,251,118,251,40,251,249,250,198,250,133,250,37,250,187,249,77,249,235,248,149,248,48,248, - 196,247,130,247,107,247,114,247,124,247,114,247,24,247,125,246,203,245,4,245,53,244,152,243,66,243,26,243,37,243,79,243,108,243,133,243,177,243,233,243, - 35,244,73,244,144,244,53,245,74,246,179,247,102,249,75,251,39,253,227,254,112,0,227,1,45,3,110,4,115,5,39,6,127,6,80,6,209,5,1,5, - 225,3,63,2,55,0,228,253,154,251,158,249,56,248,121,247,69,247,121,247,243,247,159,248,116,249,55,250,202,250,21,251,33,251,197,250,255,249,25,249, - 49,248,67,247,103,246,129,245,168,244,248,243,109,243,33,243,14,243,46,243,98,243,142,243,191,243,6,244,115,244,20,245,197,245,88,246,187,246,34,247, - 148,247,19,248,203,248,147,249,98,250,25,251,162,251,42,252,163,252,10,253,105,253,195,253,78,254,5,255,4,0,74,1,229,2,149,4,44,6,147,7, - 186,8,189,9,108,10,214,10,1,11,16,11,52,11,152,11,253,11,144,12,69,13,243,13,180,14,106,15,23,16,182,16,61,17,217,17,154,18,25,19, - 78,19,47,19,197,18,61,18,167,17,250,16,73,16,179,15,116,15,114,15,161,15,217,15,16,16,30,16,226,15,113,15,174,14,151,13,41,12,144,10, - 241,8,85,7,206,5,110,4,64,3,78,2,172,1,69,1,51,1,86,1,198,1,140,2,145,3,153,4,149,5,100,6,10,7,112,7,130,7,81,7, - 238,6,115,6,237,5,140,5,95,5,122,5,225,5,123,6,13,7,132,7,254,7,131,8,6,9,142,9,22,10,168,10,94,11,246,11,125,12,220,12, - 22,13,36,13,231,12,98,12,188,11,250,10,51,10,123,9,236,8,139,8,56,8,227,7,140,7,38,7,183,6,89,6,235,5,153,5,79,5,25,5, - 235,4,196,4,157,4,85,4,254,3,132,3,232,2,74,2,139,1,213,0,7,0,21,255,23,254,67,253,121,252,186,251,70,251,25,251,56,251,150,251, - 31,252,215,252,145,253,58,254,178,254,200,254,113,254,190,253,204,252,168,251,100,250,37,249,232,247,194,246,201,245,2,245,129,244,65,244,55,244,90,244, - 158,244,233,244,74,245,190,245,53,246,135,246,186,246,194,246,205,246,207,246,254,246,78,247,150,247,213,247,243,247,51,248,134,248,252,248,118,249,219,249, - 75,250,181,250,25,251,125,251,240,251,84,252,171,252,240,252,69,253,175,253,49,254,174,254,44,255,136,255,178,255,169,255,105,255,34,255,239,254,247,254, - 54,255,115,255,141,255,144,255,134,255,140,255,191,255,29,0,173,0,57,1,129,1,118,1,47,1,6,1,213,0,132,0,8,0,77,255,92,254,34,253, - 182,251,107,250,111,249,157,248,245,247,95,247,247,246,161,246,73,246,216,245,7,245,216,243,55,242,64,240,47,238,112,236,55,235,156,234,100,234,111,234, - 228,234,182,235,195,236,220,237,193,238,131,239,84,240,73,241,119,242,235,243,64,245,70,246,232,246,94,247,202,247,12,248,119,248,39,249,54,250,70,251, - 77,252,44,253,195,253,2,254,211,253,70,253,85,252,36,251,223,249,221,248,119,248,223,248,228,249,49,251,133,252,224,253,7,255,4,0,162,0,217,0, - 125,0,162,255,106,254,39,253,5,252,32,251,151,250,158,250,229,250,29,251,6,251,169,250,24,250,95,249,133,248,132,247,103,246,56,245,31,244,23,243, - 19,242,17,241,45,240,133,239,53,239,57,239,190,239,172,240,251,241,137,243,49,245,167,246,184,247,106,248,224,248,61,249,145,249,31,250,49,251,194,252, - 182,254,224,0,39,3,147,5,255,7,53,10,68,12,6,14,136,15,203,16,176,17,77,18,166,18,8,19,159,19,81,20,44,21,73,22,152,23,249,24, - 88,26,196,27,25,29,29,30,245,30,109,31,118,31,249,30,65,30,98,29,92,28,97,27,89,26,72,25,50,24,66,23,116,22,212,21,78,21,225,20, - 131,20,249,19,22,19,230,17,96,16,168,14,240,12,90,11,4,10,236,8,238,7,36,7,145,6,42,6,230,5,159,5,137,5,173,5,235,5,72,6, - 198,6,94,7,34,8,216,8,128,9,2,10,74,10,80,10,27,10,204,9,111,9,250,8,126,8,243,7,61,7,129,6,253,5,223,5,47,6,201,6, - 154,7,102,8,49,9,27,10,11,11,219,11,122,12,231,12,26,13,21,13,237,12,202,12,174,12,152,12,112,12,29,12,165,11,234,10,246,9,240,8, - 3,8,56,7,161,6,47,6,6,6,50,6,134,6,223,6,24,7,61,7,68,7,40,7,226,6,90,6,159,5,166,4,124,3,50,2,188,0,34,255, - 134,253,23,252,227,250,18,250,162,249,158,249,209,249,51,250,137,250,219,250,244,250,186,250,33,250,252,248,80,247,81,245,47,243,40,241,85,239,219,237, - 241,236,149,236,209,236,155,237,193,238,32,240,164,241,40,243,139,244,201,245,181,246,81,247,145,247,163,247,128,247,31,247,109,246,143,245,139,244,126,243, - 170,242,48,242,11,242,0,242,250,241,54,242,192,242,203,243,16,245,96,246,181,247,242,248,54,250,96,251,67,252,190,252,200,252,146,252,34,252,81,251, - 31,250,26,249,144,248,101,248,117,248,224,248,130,249,51,250,248,250,12,252,114,253,7,255,151,0,254,1,229,2,82,3,71,3,236,2,59,2,28,1, - 199,255,72,254,128,252,150,250,181,248,88,247,118,246,187,245,247,244,91,244,35,244,255,243,208,243,90,243,135,242,110,241,9,240,112,238,173,236,218,234, - 95,233,159,232,47,232,233,231,249,231,101,232,23,233,172,233,180,233,77,233,220,232,7,233,200,233,251,234,79,236,163,237,198,238,236,239,243,240,225,241, - 187,242,145,243,130,244,165,245,172,246,178,247,105,248,3,249,98,249,108,249,239,248,29,248,84,247,34,247,192,247,16,249,226,250,10,253,21,255,222,0, - 60,2,45,3,177,3,202,3,105,3,142,2,35,1,76,255,62,253,112,251,250,249,224,248,11,248,172,247,156,247,196,247,18,248,31,248,213,247,44,247, - 61,246,97,245,132,244,195,243,180,242,121,241,98,240,216,239,254,239,226,240,61,242,235,243,155,245,253,246,9,248,229,248,88,249,149,249,185,249,65,250, - 79,251,212,252,36,255,20,2,93,5,218,8,47,12,20,15,79,17,20,19,101,20,104,21,67,22,51,23,62,24,40,25,244,25,160,26,48,27,163,27, - 24,28,189,28,134,29,90,30,93,31,180,32,3,34,9,35,157,35,171,35,88,35,6,35,168,34,49,34,192,33,118,33,81,33,39,33,254,32,184,32, - 101,32,204,31,221,30,139,29,232,27,47,26,77,24,124,22,237,20,129,19,48,18,30,17,67,16,138,15,216,14,65,14,198,13,105,13,85,13,130,13, - 226,13,104,14,246,14,85,15,102,15,21,15,118,14,162,13,170,12,192,11,227,10,214,9,214,8,237,7,36,7,105,6,171,5,216,4,247,3,62,3, - 183,2,129,2,139,2,218,2,77,3,254,3,189,4,160,5,138,6,86,7,219,7,9,8,28,8,32,8,41,8,61,8,107,8,198,8,27,9,102,9, - 124,9,114,9,67,9,248,8,132,8,6,8,117,7,215,6,73,6,220,5,147,5,98,5,98,5,137,5,209,5,1,6,6,6,188,5,41,5,47,4, - 183,2,220,0,210,254,168,252,144,250,164,248,33,247,12,246,101,245,29,245,53,245,107,245,128,245,136,245,74,245,229,244,49,244,76,243,56,242,15,241, - 226,239,186,238,174,237,228,236,102,236,98,236,188,236,109,237,80,238,72,239,88,240,137,241,207,242,51,244,72,245,251,245,48,246,250,245,139,245,13,245, - 98,244,119,243,99,242,94,241,98,240,140,239,187,238,248,237,82,237,155,236,254,235,204,235,70,236,83,237,132,238,244,239,171,241,140,243,86,245,186,246, - 181,247,103,248,54,249,196,249,209,249,115,249,15,249,15,249,123,249,65,250,75,251,106,252,102,253,0,254,8,254,1,254,134,254,148,255,120,0,222,0, - 212,0,97,0,172,255,243,254,29,254,248,252,82,251,154,249,13,248,207,246,208,245,249,244,241,243,178,242,60,241,75,239,212,236,1,234,80,231,254,228, - 3,227,93,225,243,223,72,223,45,223,80,223,72,223,44,223,40,223,130,223,120,224,62,226,100,228,166,230,168,232,57,234,38,235,156,235,242,235,115,236, - 36,237,53,238,149,239,52,241,228,242,211,244,2,247,15,249,108,250,202,250,53,250,61,249,133,248,98,248,239,248,21,250,204,251,51,254,18,1,31,4, - 46,7,113,9,184,10,163,10,34,9,148,6,85,3,248,255,171,252,216,249,152,247,227,245,169,244,212,243,155,243,216,243,7,244,31,244,43,244,86,244, - 121,244,175,244,177,244,140,244,57,244,213,243,106,243,90,243,221,243,249,244,111,246,48,248,239,249,101,251,99,252,250,252,17,253,246,252,207,252,222,252, - 172,253,52,255,135,1,116,4,101,7,59,10,238,12,80,15,109,17,86,19,232,20,178,22,192,24,153,26,59,28,210,29,53,31,83,32,196,32,182,32, - 81,32,201,31,177,31,97,32,194,33,151,35,145,37,97,39,229,40,14,42,238,42,115,43,130,43,68,43,252,42,202,42,130,42,250,41,88,41,177,40, - 228,39,222,38,172,37,101,36,23,35,233,33,191,32,111,31,57,30,36,29,247,27,178,26,90,25,235,23,174,22,200,21,114,21,120,21,163,21,9,22, - 137,22,195,22,148,22,225,21,219,20,119,19,224,17,67,16,169,14,51,13,35,12,129,11,40,11,231,10,127,10,190,9,135,8,235,6,69,5,177,3, - 23,2,211,0,227,255,50,255,217,254,177,254,241,254,130,255,64,0,31,1,17,2,20,3,88,4,176,5,253,6,16,8,218,8,159,9,73,10,186,10, - 235,10,239,10,234,10,192,10,130,10,33,10,188,9,80,9,237,8,143,8,218,7,46,7,104,6,195,5,48,5,173,4,58,4,146,3,171,2,100,1, - 201,255,18,254,124,252,10,251,167,249,84,248,46,247,59,246,82,245,184,244,15,244,100,243,202,242,240,241,27,241,35,240,49,239,107,238,177,237,239,236, - 23,236,76,235,106,234,205,233,119,233,83,233,136,233,28,234,15,235,177,236,206,238,74,241,198,243,201,245,31,247,182,247,207,247,102,247,127,246,9,245, - 33,243,243,240,154,238,50,236,98,234,14,233,252,231,206,230,185,229,29,229,44,229,160,229,65,230,23,231,25,232,64,233,164,234,14,236,77,237,134,238, - 12,240,156,241,148,242,191,242,135,242,105,242,73,242,55,242,112,242,26,243,172,243,208,243,166,243,137,243,237,243,205,244,55,246,236,247,154,249,245,250, - 24,252,1,253,178,253,220,253,91,253,84,252,241,250,91,249,182,247,254,245,32,244,67,242,121,240,134,238,144,236,102,234,119,232,217,230,166,229,171,228, - 203,227,56,227,17,227,36,227,245,226,101,226,194,225,120,225,202,225,209,226,167,228,4,231,124,233,196,235,165,237,35,239,79,240,27,241,125,241,160,241, - 240,241,109,242,48,243,35,244,75,245,149,246,95,247,163,247,2,247,189,245,101,244,109,243,205,242,146,242,232,242,237,243,169,245,195,247,248,249,89,252, - 77,254,145,255,234,255,169,255,195,254,109,253,169,251,24,250,41,249,182,248,49,248,149,247,154,246,168,245,119,244,82,243,62,242,114,241,38,241,98,241, - 34,242,242,242,158,243,33,244,166,244,18,245,171,245,187,246,79,248,109,250,250,252,136,255,214,1,62,3,202,3,168,3,176,2,31,1,210,255,16,255, - 245,254,102,255,111,0,82,2,214,4,200,7,48,11,192,14,116,18,254,21,111,25,146,28,90,31,139,33,105,35,183,36,94,37,175,37,162,37,101,37, - 62,37,79,37,191,37,215,38,124,40,198,42,85,45,5,48,187,50,58,53,28,55,101,56,2,57,213,56,255,55,138,54,217,52,230,50,224,48,47,47, - 192,45,159,44,198,43,220,42,9,42,63,41,154,40,251,39,81,39,107,38,107,37,27,36,127,34,218,32,61,31,227,29,185,28,157,27,144,26,141,25, - 166,24,48,24,241,23,189,23,166,23,130,23,59,23,202,22,53,22,96,21,54,20,165,18,54,17,168,15,23,14,116,12,227,10,127,9,41,8,191,6, - 61,5,179,3,102,2,132,1,208,0,136,0,140,0,234,0,87,1,232,1,146,2,81,3,40,4,75,5,190,6,42,8,69,9,206,9,237,9,196,9, - 48,9,241,7,120,6,25,5,254,3,53,3,217,2,8,3,147,3,44,4,221,4,106,5,159,5,144,5,76,5,198,4,222,3,203,2,144,1,98,0, - 50,255,242,253,147,252,29,251,177,249,130,248,125,247,243,246,197,246,5,247,99,247,159,247,190,247,74,247,115,246,13,245,84,243,51,241,206,238,162,236, - 92,234,64,232,130,230,77,229,188,228,168,228,15,229,216,229,217,230,43,232,178,233,38,235,91,236,1,237,245,236,138,236,14,236,132,235,197,234,229,233, - 223,232,217,231,1,231,80,230,234,229,124,229,23,229,195,228,82,228,182,227,162,227,19,228,163,228,69,229,243,229,145,230,93,231,83,232,125,233,199,234, - 86,236,198,237,150,238,176,238,97,238,10,238,220,237,10,238,143,238,16,239,10,239,90,238,69,237,68,236,210,235,9,236,213,236,219,237,206,238,222,239, - 99,241,3,243,42,244,170,244,173,244,44,244,10,243,184,241,131,240,89,239,11,238,149,236,219,234,212,232,188,230,88,228,227,225,232,223,73,222,223,220, - 209,219,147,219,61,220,61,221,237,221,241,221,138,221,142,221,23,222,37,223,195,224,28,227,236,229,164,232,242,234,19,237,21,239,253,240,145,242,201,243, - 143,244,74,245,49,246,71,247,127,248,142,249,238,249,21,249,33,247,97,244,149,241,71,239,237,237,141,237,49,238,125,239,166,241,118,244,23,248,247,251, - 130,255,237,1,248,2,189,2,161,1,212,255,202,253,251,251,245,250,118,250,58,250,138,249,109,248,247,246,76,245,163,243,69,242,134,241,130,241,77,242, - 113,243,139,244,201,245,221,246,148,247,246,247,8,248,123,248,54,249,108,250,10,252,220,253,94,255,129,0,27,1,147,0,50,255,56,253,110,251,79,250, - 89,250,179,251,74,254,158,1,187,5,135,10,102,15,0,20,245,23,142,27,219,30,117,33,70,35,147,36,132,37,90,38,41,39,236,39,123,40,8,41, - 213,41,12,43,164,44,175,46,75,49,3,52,158,54,82,57,235,59,19,62,114,63,23,64,54,64,203,63,166,62,234,60,206,58,147,56,162,54,203,52, - 241,50,101,49,234,47,116,46,209,44,21,43,66,41,154,39,38,38,231,36,218,35,184,34,111,33,24,32,202,30,163,29,153,28,224,27,140,27,95,27, - 97,27,153,27,246,27,121,28,240,28,20,29,207,28,20,28,27,27,242,25,179,24,77,23,222,21,82,20,191,18,1,17,2,15,28,13,138,11,66,10, - 32,9,42,8,118,7,36,7,235,6,248,6,22,7,46,7,81,7,114,7,76,7,162,6,207,5,9,5,189,4,163,4,220,4,189,4,180,4,126,4, - 77,4,220,3,163,3,123,3,136,3,197,3,149,4,188,5,224,6,238,7,193,8,66,9,63,9,223,8,43,8,105,7,181,6,7,6,57,5,62,4, - 39,3,36,2,209,0,47,255,171,253,49,252,233,250,237,249,37,249,166,248,126,248,164,248,163,248,91,248,81,247,154,245,65,243,77,240,68,237,14,234, - 216,230,39,228,21,226,191,224,8,224,243,223,97,224,50,225,133,226,78,228,178,230,60,233,168,235,180,237,205,238,35,239,249,238,86,238,71,237,204,235, - 13,234,125,232,32,231,90,230,62,230,47,230,23,230,189,229,88,229,231,228,139,228,74,228,106,228,160,228,213,228,244,228,5,229,27,229,102,229,210,229, - 207,230,8,232,229,232,74,233,180,233,17,234,92,234,182,234,44,235,137,235,91,235,172,234,236,233,244,232,4,232,202,231,115,232,68,233,219,233,189,234, - 43,236,228,237,133,239,154,240,237,240,199,240,163,240,216,239,13,238,239,235,20,234,64,232,27,230,175,227,246,224,57,222,174,219,173,217,26,216,168,214, - 130,213,249,212,76,213,140,214,39,216,134,217,86,218,21,219,28,220,153,221,152,223,28,226,232,228,180,231,66,234,140,236,180,238,193,240,151,242,10,244, - 82,245,109,246,128,247,139,248,209,249,22,251,233,251,136,251,252,249,188,247,89,245,69,243,214,241,41,241,98,241,87,242,58,244,19,247,181,250,138,254, - 220,1,98,4,217,5,255,5,245,4,233,2,54,0,188,253,212,251,180,250,14,250,228,249,202,249,159,249,68,249,159,248,156,247,124,246,166,245,244,244, - 209,244,218,244,241,244,212,244,133,244,152,244,220,244,52,245,171,245,183,246,94,248,201,250,166,253,58,0,250,1,185,2,179,2,168,1,209,255,206,253, - 63,252,139,251,82,252,173,254,23,2,134,6,169,11,152,17,95,23,117,28,176,32,30,36,147,38,111,40,192,41,94,42,221,42,58,43,163,43,11,44, - 79,44,252,44,64,46,0,48,68,50,27,53,46,56,96,59,132,62,120,65,247,67,167,69,108,70,95,70,93,69,114,67,238,64,185,61,64,58,228,54, - 2,52,186,49,218,47,145,46,176,45,220,44,231,43,12,43,51,42,110,41,192,40,17,40,230,38,61,37,109,35,244,33,171,32,90,31,127,30,210,29, - 135,29,144,29,170,29,198,29,4,30,19,30,252,29,196,29,54,29,145,28,172,27,144,26,44,25,140,23,5,22,121,20,105,18,81,16,72,14,183,12, - 74,11,247,9,95,8,154,6,3,5,196,3,194,2,251,1,68,1,209,0,104,0,39,0,230,255,106,255,234,254,216,254,59,255,216,255,143,0,128,1, - 114,2,67,3,233,3,130,4,186,4,199,4,232,4,66,5,191,5,162,6,108,7,63,8,248,8,178,9,244,9,193,9,69,9,182,8,243,7,194,6, - 142,5,54,4,171,2,238,0,243,254,183,252,151,250,52,249,109,248,4,248,153,247,38,247,193,246,56,246,90,245,3,244,170,241,216,238,238,235,13,233, - 84,230,255,227,33,226,163,224,207,223,137,223,235,223,159,224,205,225,82,227,11,229,21,231,27,233,244,234,112,236,119,237,244,237,223,237,134,237,188,236, - 171,235,96,234,34,233,79,232,180,231,108,231,41,231,180,230,74,230,164,229,199,228,204,227,220,226,32,226,224,225,210,225,156,225,125,225,209,225,150,226, - 229,227,1,229,1,230,3,231,217,231,132,232,2,233,47,233,83,233,136,233,135,233,39,233,78,232,69,231,61,230,87,229,4,229,58,229,211,229,178,230, - 251,231,93,233,246,234,159,236,56,238,131,239,55,240,55,240,47,239,59,237,153,234,173,231,96,228,225,224,86,221,55,218,156,215,163,213,43,212,226,210, - 215,209,73,209,24,209,74,209,174,209,5,210,246,209,235,209,56,210,41,211,224,212,113,215,169,218,12,222,118,225,30,229,202,232,87,236,149,239,120,242, - 230,244,183,246,74,248,4,250,41,252,128,254,157,0,31,2,142,2,7,2,123,0,76,254,16,252,36,250,59,249,98,249,159,250,175,252,105,255,106,2, - 162,5,117,8,178,10,178,11,29,11,51,9,151,6,226,3,135,1,241,255,147,255,120,255,172,255,109,255,178,254,17,253,186,250,245,247,169,245,216,243, - 95,242,244,240,248,239,96,239,50,239,28,239,96,239,204,239,74,240,103,241,106,243,239,245,206,248,175,251,56,254,21,0,187,0,137,0,183,255,128,254, - 145,253,56,253,179,253,27,255,87,1,204,4,82,9,93,14,187,19,234,24,180,29,244,33,125,37,248,39,149,41,181,42,144,43,114,44,75,45,44,46, - 85,47,116,48,213,49,147,51,181,53,18,56,118,58,7,61,209,63,151,66,8,69,203,70,207,71,87,72,30,72,250,70,187,68,154,65,68,62,200,58, - 147,55,246,52,10,51,219,49,55,49,180,48,12,48,8,47,212,45,118,44,11,43,135,41,239,39,83,38,216,36,97,35,56,34,86,33,222,32,155,32, - 146,32,130,32,60,32,244,31,180,31,96,31,224,30,241,29,251,28,182,27,128,26,71,25,25,24,99,22,36,20,239,17,217,15,193,13,155,11,196,9, - 153,8,218,7,129,7,22,7,104,6,191,5,185,4,186,3,117,2,76,1,226,255,200,254,67,254,229,253,210,253,22,254,227,254,190,255,177,0,141,1, - 21,2,169,2,52,3,145,3,186,3,232,3,72,4,245,4,250,5,33,7,132,8,174,9,159,10,91,11,171,11,135,11,5,11,17,10,228,8,141,7, - 1,6,37,4,21,2,42,0,103,254,179,252,212,250,243,248,175,247,160,246,143,245,161,244,3,244,115,243,28,243,180,242,161,241,214,239,113,237,199,234, - 89,232,217,229,156,227,127,225,202,223,156,222,57,222,85,222,199,222,127,223,195,224,117,226,143,228,195,230,225,232,200,234,58,236,47,237,181,237,183,237, - 5,237,225,235,135,234,79,233,58,232,149,231,108,231,148,231,202,231,195,231,58,231,112,230,76,229,38,228,81,227,159,226,255,225,126,225,86,225,162,225, - 25,226,231,226,38,228,157,229,134,230,188,230,237,230,55,231,104,231,138,231,0,232,58,232,177,231,87,230,255,228,31,228,212,227,44,228,197,228,125,229, - 74,230,79,231,141,232,164,233,125,234,40,235,120,235,40,235,17,234,122,232,80,230,210,227,55,225,103,222,116,219,127,216,125,213,109,210,169,207,146,205, - 230,203,186,202,57,202,132,202,7,203,38,203,236,202,204,202,24,203,255,203,188,205,28,208,61,211,243,214,11,219,65,223,47,227,183,230,82,234,40,238, - 25,242,150,245,37,248,3,250,225,251,33,254,151,0,194,2,15,4,47,4,124,3,9,2,40,0,52,254,223,252,136,252,219,252,186,253,70,255,154,1, - 175,4,227,7,138,10,44,12,150,12,235,11,106,10,120,8,66,6,76,4,19,3,133,2,193,2,114,3,192,3,70,3,45,2,181,0,192,254,147,252, - 76,250,26,248,125,246,197,244,102,243,180,242,108,242,173,242,115,243,170,244,41,246,200,247,80,250,19,253,231,255,93,2,85,4,19,5,210,4,232,3, - 186,2,118,1,126,0,114,0,97,1,44,3,183,5,12,9,244,12,74,17,253,21,222,26,150,31,232,35,136,39,16,42,216,43,233,44,139,45,140,45, - 21,45,208,44,54,45,45,46,229,47,53,50,31,53,133,56,1,60,61,63,22,66,108,68,109,70,244,71,210,72,230,72,62,72,243,70,246,68,122,66, - 201,63,26,61,92,58,60,56,162,54,121,53,125,52,96,51,31,50,177,48,55,47,214,45,148,44,7,43,63,41,96,39,204,37,105,36,45,35,254,33, - 39,33,119,32,205,31,13,31,23,30,2,29,23,28,79,27,117,26,40,25,194,23,152,22,154,21,157,20,98,19,158,17,215,15,57,14,180,12,98,11, - 37,10,78,9,186,8,68,8,143,7,115,6,241,4,109,3,237,1,133,0,137,255,169,254,138,254,203,254,94,255,25,0,249,0,236,1,250,2,12,4, - 236,4,144,5,8,6,86,6,162,6,4,7,159,7,52,8,228,8,226,9,50,11,181,12,124,14,69,16,160,17,133,18,181,18,73,18,22,17,57,15, - 51,13,253,10,139,8,24,6,188,3,101,1,220,254,49,252,119,249,56,247,150,245,96,244,174,243,73,243,230,242,162,242,233,241,73,241,250,239,235,237, - 34,235,92,232,98,229,151,226,250,223,179,221,206,219,87,218,127,217,31,217,36,217,247,217,172,219,20,222,165,224,238,226,163,228,144,229,45,230,128,230, - 104,230,20,230,116,229,38,229,250,228,62,229,222,229,126,230,239,230,127,231,234,231,7,232,113,231,199,230,238,229,15,229,95,228,140,227,118,226,205,225, - 181,225,111,226,85,227,42,228,69,229,178,230,233,231,141,232,236,232,18,233,99,233,196,233,154,233,144,232,250,230,218,229,150,229,221,229,30,230,252,229, - 235,229,238,229,34,230,192,230,130,231,233,231,172,231,127,231,89,231,141,230,12,229,106,227,151,225,250,222,201,219,23,217,147,214,105,211,50,208,79,205, - 14,203,35,201,119,199,152,198,138,198,228,198,74,199,38,199,225,198,193,198,69,199,191,200,89,203,115,206,243,209,29,214,210,218,150,223,246,227,240,231, - 47,236,110,240,216,243,81,246,91,248,158,250,145,253,234,0,76,4,197,6,204,7,189,7,21,7,194,5,47,4,129,2,92,1,206,0,234,0,230,1, - 200,3,93,6,64,9,23,12,65,14,77,15,10,15,137,13,187,11,160,9,164,7,216,5,218,4,41,5,26,6,237,6,195,6,134,5,163,3,160,1, - 165,255,222,253,102,252,229,250,88,249,128,248,37,248,2,248,4,248,22,248,61,248,196,248,244,249,230,251,145,254,168,1,236,4,193,7,44,9,14,9, - 229,7,143,6,227,4,67,3,79,2,14,2,167,2,15,4,187,6,144,10,16,15,247,19,0,25,199,29,228,33,40,37,12,39,251,39,74,40,89,40, - 71,40,34,40,53,40,0,41,203,42,92,45,104,48,214,51,137,55,191,59,243,63,204,67,242,70,96,73,64,75,174,76,98,77,36,77,232,75,150,73, - 221,70,255,67,61,65,161,62,108,60,176,58,115,57,29,56,141,54,218,52,212,50,250,48,109,47,60,46,16,45,111,43,196,41,93,40,245,38,118,37, - 170,35,197,33,88,32,98,31,167,30,160,29,102,28,42,27,54,26,255,24,144,23,33,22,207,20,238,19,86,19,108,18,245,16,28,15,22,13,40,11, - 226,8,177,6,186,4,62,3,30,2,87,1,190,0,51,0,214,255,159,255,165,255,181,255,221,255,51,0,190,0,72,1,178,1,3,2,85,2,217,2, - 134,3,114,4,159,5,208,6,158,7,41,8,178,8,105,9,17,10,43,11,190,12,135,14,105,16,71,18,220,19,63,21,38,22,98,22,233,21,97,20, - 59,18,163,15,145,12,113,9,68,6,105,3,198,0,4,254,107,251,224,248,20,247,160,245,161,244,203,243,32,243,103,242,245,241,42,241,21,240,49,238, - 182,235,28,233,79,230,200,227,25,225,78,222,252,219,242,217,74,216,13,215,45,214,24,214,142,214,174,215,65,217,40,219,5,221,147,222,224,223,238,224, - 152,225,234,225,163,225,53,225,131,224,224,223,184,223,90,224,132,225,200,226,232,227,240,228,160,229,177,229,102,229,236,228,114,228,164,227,171,226,0,226, - 73,225,158,224,199,224,166,225,164,226,92,227,28,228,196,228,240,228,232,228,22,229,198,229,138,230,83,231,22,232,83,232,234,231,53,231,162,230,63,230, - 228,229,157,229,238,229,77,230,188,230,65,231,194,231,205,231,33,231,9,230,201,228,53,227,66,225,44,223,236,220,144,218,208,215,226,212,248,209,6,207, - 82,204,25,202,87,200,7,199,226,197,104,197,211,197,137,198,233,198,233,198,156,198,186,198,202,199,186,201,124,204,236,207,34,212,235,216,230,221,110,226, - 148,230,157,234,252,238,44,243,183,246,241,249,34,253,151,0,67,4,122,7,228,9,58,11,88,11,164,10,66,9,171,7,22,6,81,5,87,5,246,5, - 141,6,165,7,153,9,37,12,193,14,191,16,199,17,12,18,72,17,233,15,215,13,201,11,62,10,85,9,239,8,12,9,24,9,142,8,96,7,213,5, - 99,4,133,2,166,0,111,255,69,254,12,253,191,251,222,250,101,250,72,250,91,250,145,250,50,251,73,252,52,254,107,0,214,2,5,5,154,6,54,7, - 55,6,54,4,153,1,18,255,33,253,255,251,7,252,244,252,181,254,179,1,145,5,250,9,243,14,230,19,120,24,171,28,6,32,17,34,213,34,4,35, - 9,35,251,34,242,34,27,35,253,35,176,37,87,40,183,43,145,47,139,51,138,55,137,59,122,63,235,66,207,69,24,72,135,73,255,73,132,73,1,72, - 215,69,36,67,130,64,235,61,161,59,254,57,213,56,226,55,29,55,25,54,253,52,154,51,249,49,149,48,121,47,67,46,159,44,171,42,0,41,153,39, - 58,38,133,36,192,34,1,33,191,31,167,30,72,29,240,27,219,26,238,25,98,25,231,24,70,24,148,23,189,22,164,21,53,20,48,18,192,15,35,13, - 204,10,193,8,202,6,218,4,145,3,42,3,19,3,247,2,239,2,52,3,106,3,152,3,147,3,171,3,170,3,177,3,19,4,124,4,4,5,212,5, - 163,6,121,7,82,8,34,9,207,9,65,10,204,10,73,11,142,11,7,12,217,12,28,14,175,15,141,17,82,19,230,20,42,22,203,22,235,22,81,22, - 232,20,29,19,202,16,117,14,30,12,139,9,79,7,5,5,52,2,238,254,227,251,184,249,247,247,93,246,212,244,126,243,69,242,15,241,255,239,89,238, - 45,236,233,233,79,231,120,228,191,225,196,222,81,220,21,218,16,216,9,214,18,212,136,210,35,210,81,210,69,211,8,213,21,215,51,217,78,219,158,220, - 79,221,61,221,49,221,97,221,193,221,51,222,217,222,209,223,8,225,81,226,180,227,210,228,153,229,167,229,235,228,180,227,164,226,35,226,90,225,57,224, - 162,223,185,223,220,223,185,223,191,223,105,224,29,226,158,227,92,228,138,228,5,229,163,229,14,230,50,230,70,230,195,230,71,231,98,231,230,230,8,230, - 220,229,188,230,199,231,139,232,154,233,219,234,103,235,55,235,206,234,28,234,240,232,108,231,192,229,233,227,190,225,180,223,151,221,98,219,197,216,75,213, - 145,209,26,206,164,203,97,202,50,201,0,200,83,199,86,199,242,199,158,200,165,200,253,199,74,199,36,199,14,200,10,202,70,205,27,210,139,215,146,220, - 17,225,189,229,153,234,101,239,210,243,247,247,218,251,41,255,30,2,235,4,153,7,175,9,18,11,127,11,202,10,20,9,252,6,224,4,206,3,210,3, - 90,4,124,5,130,7,192,10,86,14,230,17,218,20,51,23,184,24,238,24,116,23,219,20,207,17,8,15,210,12,187,11,76,11,239,10,51,10,177,9, - 207,8,112,7,205,5,191,4,44,4,221,3,78,3,142,2,85,1,4,0,253,254,44,254,132,253,253,252,196,252,150,253,225,254,119,0,90,2,33,4, - 43,5,153,4,239,2,147,0,0,254,104,251,169,249,229,248,239,248,15,250,226,251,85,254,105,1,87,5,196,9,85,14,215,18,81,23,240,26,90,29, - 194,30,172,31,65,32,220,32,229,33,72,35,226,36,5,39,162,41,31,45,51,49,128,53,216,57,7,62,223,65,129,69,126,72,138,74,177,75,60,76, - 237,75,144,74,50,72,87,69,114,66,176,63,40,61,49,59,209,57,177,56,173,55,160,54,33,53,43,51,55,49,178,47,59,46,128,44,91,42,17,40, - 190,37,126,35,125,33,123,31,145,29,182,28,45,28,250,27,185,27,115,27,49,27,196,26,2,26,37,25,220,23,168,22,152,21,114,20,224,18,61,17, - 3,15,210,12,224,10,182,8,191,6,115,5,243,4,196,4,177,4,159,4,84,4,23,4,22,4,52,4,58,4,145,4,133,5,123,6,29,7,166,7, - 95,8,23,9,218,9,200,10,160,11,48,12,241,12,193,13,174,14,142,15,85,16,41,17,29,18,74,19,93,20,49,21,224,21,124,22,12,23,254,22, - 202,22,71,22,49,21,158,19,130,17,37,15,102,12,75,9,50,6,35,3,221,255,100,252,51,249,164,246,155,244,5,243,174,241,114,240,114,239,103,238, - 105,237,47,236,197,234,237,232,185,230,145,228,201,225,136,222,73,219,56,216,245,213,245,211,91,210,135,209,157,209,157,210,29,212,13,214,16,216,36,218, - 122,219,64,220,3,220,161,219,242,219,172,220,23,221,59,221,146,221,15,222,236,222,216,223,239,224,212,225,83,226,101,226,255,225,48,225,45,224,225,223, - 188,223,139,223,177,223,20,224,122,224,248,224,242,225,128,227,206,228,101,229,117,229,119,229,95,229,81,229,106,229,70,229,38,229,152,229,156,229,215,228, - 6,228,198,227,71,228,85,229,248,230,155,232,194,233,77,234,250,234,110,235,255,234,197,233,182,232,165,231,61,230,103,228,241,226,181,225,234,223,226,221, - 133,219,246,216,20,214,79,211,106,209,89,208,112,207,94,206,92,205,192,204,1,205,135,205,134,205,218,204,112,204,16,205,187,206,70,209,252,212,185,217, - 190,222,107,227,172,231,171,235,187,239,205,243,175,247,28,251,222,253,62,0,183,2,23,5,115,7,193,9,81,11,180,11,196,10,16,9,87,7,239,5, - 52,5,249,4,108,5,65,6,187,7,12,10,64,13,175,16,211,19,247,21,210,22,63,22,95,20,200,17,246,14,155,12,83,11,102,11,137,11,144,11, - 76,11,240,10,48,10,30,9,244,7,130,6,3,5,179,3,138,2,103,1,64,0,122,255,247,254,157,254,106,254,239,254,213,255,69,1,204,2,83,4, - 151,5,76,6,244,5,149,4,196,1,16,254,122,250,116,247,168,245,238,244,125,245,45,247,206,249,89,253,162,1,71,6,184,10,203,14,126,18,154,21, - 246,23,152,25,176,26,160,27,148,28,159,29,142,30,190,31,150,33,245,35,215,38,134,42,199,46,71,51,204,55,20,60,221,63,217,66,3,69,58,70, - 195,70,168,70,190,69,238,67,68,65,176,62,45,60,252,57,46,56,174,54,121,53,111,52,136,51,62,50,180,48,51,47,168,45,230,43,22,42,63,40, - 233,37,141,35,118,33,107,31,191,29,52,28,2,27,126,26,89,26,112,26,79,26,54,26,22,26,218,25,71,25,130,24,173,23,155,22,129,21,29,20, - 137,18,207,16,233,14,11,13,45,11,102,9,194,7,93,6,149,5,246,4,108,4,253,3,236,3,249,3,73,4,199,4,148,5,152,6,115,7,60,8, - 246,8,142,9,229,9,44,10,110,10,192,10,213,10,54,11,148,11,21,12,159,12,6,13,128,13,24,14,246,14,58,16,108,17,190,18,252,19,59,21, - 15,22,146,22,130,22,6,22,16,21,133,19,2,17,240,13,108,10,216,6,131,3,48,0,53,253,249,249,23,247,191,244,228,242,137,241,116,240,211,239, - 53,239,100,238,23,237,92,235,42,233,102,230,38,227,250,223,216,220,213,217,20,215,10,213,227,211,43,211,228,210,15,211,167,211,221,212,85,214,131,216, - 160,218,69,220,194,221,56,222,150,222,197,222,164,222,182,222,204,222,213,222,246,222,98,223,63,224,72,225,28,226,100,226,28,226,151,225,8,225,0,225, - 4,225,248,224,62,225,230,225,93,226,62,226,68,226,146,226,65,227,186,227,28,228,134,228,199,228,31,229,181,229,131,230,55,231,147,231,241,231,7,232, - 180,231,136,231,231,231,194,232,136,233,111,234,105,235,70,236,152,236,194,236,40,237,94,237,12,237,134,236,90,236,178,235,154,234,255,232,97,231,192,229, - 186,227,166,225,51,223,147,220,36,218,241,215,0,214,62,212,228,210,248,209,160,209,240,209,100,210,218,210,36,211,98,211,242,211,220,212,147,214,148,217, - 201,221,74,226,219,230,83,235,173,239,57,243,113,246,100,249,248,251,70,254,130,0,225,2,11,5,230,6,117,8,156,9,239,9,1,9,58,7,242,4, - 64,3,157,2,205,2,103,3,128,4,87,6,44,9,180,12,251,15,83,18,198,19,5,20,104,19,219,17,128,15,212,12,195,10,203,9,64,9,106,9, - 75,9,62,9,201,8,233,7,0,7,32,6,192,4,41,3,137,1,26,0,134,254,10,253,216,251,36,251,238,250,82,251,255,251,80,253,111,255,220,1, - 81,4,48,6,18,7,137,6,218,4,52,2,249,254,194,251,206,248,158,246,107,245,96,245,200,246,52,249,78,252,8,0,34,4,102,8,122,12,242,15, - 141,18,173,20,110,22,239,23,46,25,68,26,55,27,84,28,188,29,71,31,38,33,130,35,90,38,173,41,39,45,159,48,247,51,14,55,164,57,221,59, - 100,61,112,62,186,62,56,62,220,60,211,58,51,56,173,53,156,51,28,50,57,49,73,48,121,47,109,46,5,45,46,43,4,41,219,38,253,36,22,35, - 95,33,216,31,50,30,16,29,41,28,142,27,2,27,154,26,45,26,3,26,234,25,190,25,79,25,152,24,189,23,243,22,221,21,204,20,230,19,64,19, - 177,18,225,17,168,16,2,15,11,13,247,10,2,9,57,7,252,5,54,5,160,4,26,4,213,3,192,3,165,3,171,3,217,3,65,4,184,4,62,5, - 184,5,57,6,140,6,244,6,61,7,137,7,186,7,234,7,7,8,79,8,167,8,45,9,153,9,33,10,193,10,158,11,174,12,238,13,30,15,40,16, - 22,17,234,17,113,18,165,18,61,18,77,17,181,15,112,13,199,10,85,7,142,3,142,255,190,251,108,248,178,245,234,243,120,242,164,241,163,240,24,240, - 208,239,97,239,211,238,181,237,43,236,81,234,8,232,148,229,227,226,243,223,79,221,78,219,228,217,109,217,137,217,57,218,40,219,110,220,160,221,8,223, - 220,224,103,226,237,227,27,229,216,229,61,230,185,230,22,231,248,230,185,230,99,230,86,230,117,230,181,230,80,231,68,232,236,232,117,233,197,233,196,233, - 132,233,35,233,170,232,42,232,148,231,232,230,130,230,124,230,245,230,172,231,104,232,125,233,132,234,77,235,149,235,189,235,4,236,66,236,117,236,123,236, - 94,236,202,235,83,235,49,235,119,235,231,235,223,236,46,238,54,239,186,239,102,240,74,241,97,242,198,242,205,242,121,242,175,241,129,240,245,238,90,237, - 179,235,24,234,130,232,183,230,33,229,208,227,254,226,56,226,64,225,54,224,193,223,227,223,52,224,174,224,90,225,53,226,41,227,91,228,231,229,22,232, - 203,234,188,237,193,240,152,243,42,246,164,248,3,251,85,253,173,255,241,1,181,3,48,5,94,6,128,7,110,8,1,9,37,9,139,8,112,7,241,5, - 152,4,200,3,120,3,206,3,124,4,180,5,227,6,92,8,47,10,30,12,245,13,24,15,2,15,53,14,212,12,174,11,221,10,108,10,65,10,96,10, - 144,10,173,10,132,10,183,9,38,8,108,6,16,5,154,3,179,2,244,1,49,1,119,0,220,255,90,255,9,255,5,255,113,255,114,0,179,1,75,3, - 249,4,98,6,60,7,43,7,62,6,159,4,54,2,155,255,24,253,17,251,249,249,122,249,212,249,252,250,205,252,39,255,137,1,183,3,187,5,216,7, - 249,9,206,11,94,13,162,14,136,15,45,16,124,16,206,16,41,17,126,17,22,18,31,19,167,20,106,22,136,24,214,26,15,29,15,31,2,33,153,34, - 189,35,122,36,118,36,199,35,160,34,133,33,128,32,103,31,55,30,56,29,107,28,132,27,135,26,67,25,195,23,60,22,16,21,240,19,210,18,189,17, - 231,16,31,16,74,15,157,14,193,13,8,13,204,12,179,12,154,12,86,12,82,12,115,12,180,12,237,12,212,12,181,12,210,12,252,12,252,12,161,12, - 75,12,196,11,22,11,58,10,45,9,230,7,168,6,148,5,180,4,249,3,35,3,111,2,17,2,27,2,71,2,157,2,5,3,120,3,231,3,92,4, - 174,4,218,4,11,5,70,5,137,5,246,5,64,6,102,6,101,6,114,6,137,6,168,6,209,6,28,7,97,7,205,7,64,8,240,8,150,9,65,10, - 225,10,26,11,50,11,2,11,132,10,41,10,106,9,149,8,97,7,245,5,59,4,84,2,68,0,18,254,3,252,60,250,243,248,192,247,10,247,140,246, - 17,246,96,245,144,244,191,243,227,242,30,242,145,240,47,239,221,237,133,236,135,235,190,234,167,233,254,232,150,232,97,232,209,232,39,233,187,233,179,234, - 243,235,249,236,194,237,118,238,213,238,71,239,106,239,196,239,43,240,89,240,59,240,66,240,103,240,111,240,135,240,243,240,60,241,98,241,130,241,132,241, - 98,241,66,241,26,241,229,240,157,240,50,240,185,239,151,239,161,239,241,239,131,240,56,241,251,241,72,242,159,242,220,242,249,242,14,243,21,243,30,243, - 14,243,166,242,38,242,213,241,197,241,4,242,156,242,82,243,53,244,237,244,184,245,114,246,51,247,196,247,15,248,45,248,83,248,65,248,220,247,62,247, - 146,246,196,245,201,244,174,243,166,242,188,241,22,241,212,240,229,240,248,240,248,240,1,241,94,241,228,241,83,242,145,242,28,243,234,243,248,244,103,246, - 43,248,250,249,227,251,213,253,162,255,93,1,230,2,37,4,95,5,151,6,216,7,251,8,253,9,184,10,122,11,41,12,143,12,93,12,119,11,51,10, - 218,8,201,7,49,7,197,6,194,6,217,6,104,7,64,8,53,9,55,10,63,11,64,12,208,12,183,12,0,12,18,11,35,10,138,9,134,9,237,9, - 142,10,235,10,19,11,253,10,78,10,109,9,41,8,181,6,84,5,11,4,244,2,74,2,223,1,164,1,135,1,122,1,79,1,57,1,99,1,194,1, - 117,2,82,3,232,3,37,4,213,3,247,2,130,1,174,255,142,253,250,251,222,250,50,250,50,250,183,250,179,251,9,253,139,254,11,0,125,1,182,2, - 190,3,178,4,117,5,252,5,47,6,19,6,195,5,108,5,66,5,101,5,162,5,69,6,31,7,46,8,117,9,29,11,177,12,11,14,73,15,116,16, - 63,17,164,17,238,17,32,18,206,17,0,17,11,16,193,14,126,13,69,12,36,11,33,10,100,9,218,8,78,8,158,7,212,6,30,6,99,5,163,4, - 13,4,135,3,8,3,178,2,120,2,70,2,28,2,23,2,106,2,210,2,39,3,128,3,240,3,145,4,57,5,162,5,203,5,28,6,127,6,188,6, - 231,6,213,6,144,6,11,6,124,5,33,5,153,4,29,4,202,3,152,3,109,3,70,3,26,3,222,2,172,2,151,2,182,2,235,2,39,3,127,3, - 232,3,66,4,141,4,166,4,167,4,189,4,231,4,4,5,33,5,76,5,159,5,203,5,212,5,220,5,4,6,47,6,147,6,228,6,122,7,27,8, - 143,8,201,8,179,8,157,8,75,8,187,7,54,7,83,6,144,5,138,4,145,3,114,2,78,1,26,0,182,254,118,253,28,252,240,250,37,250,116,249, - 39,249,5,249,188,248,51,248,80,247,78,246,153,245,188,244,253,243,58,243,109,242,209,241,76,241,211,240,125,240,13,240,212,239,223,239,25,240,107,240, - 2,241,189,241,130,242,90,243,169,243,206,243,172,243,138,243,162,243,251,243,61,244,151,244,238,244,100,245,229,245,67,246,95,246,55,246,244,245,88,245, - 227,244,101,244,7,244,0,244,36,244,116,244,147,244,202,244,21,245,108,245,151,245,130,245,103,245,43,245,212,244,158,244,191,244,248,244,46,245,140,245, - 214,245,186,245,148,245,125,245,165,245,86,246,23,247,229,247,178,248,65,249,201,249,89,250,7,251,168,251,7,252,75,252,60,252,17,252,198,251,103,251, - 39,251,11,251,223,250,151,250,87,250,83,250,118,250,179,250,230,250,88,251,189,251,245,251,23,252,60,252,114,252,151,252,196,252,35,253,214,253,189,254, - 228,255,60,1,185,2,19,4,68,5,72,6,103,7,88,8,57,9,222,9,120,10,30,11,241,11,181,12,125,13,236,13,41,14,29,14,190,13,17,13, - 39,12,252,10,229,9,251,8,79,8,13,8,194,7,158,7,70,8,41,9,2,10,220,10,54,11,48,11,247,10,139,10,249,9,135,9,203,8,125,8, - 52,8,238,7,143,7,57,7,238,6,253,6,17,7,17,7,223,6,143,6,3,6,113,5,184,4,18,4,125,3,6,3,248,2,193,2,156,2,161,2, - 114,2,34,2,223,1,86,1,127,0,158,255,166,254,189,253,235,252,35,252,140,251,60,251,251,250,31,251,151,251,75,252,78,253,137,254,230,255,21,1, - 42,2,218,2,87,3,93,3,8,3,110,2,179,1,231,0,32,0,134,255,41,255,47,255,181,255,141,0,118,1,102,2,53,3,188,3,251,3,40,4, - 112,4,162,4,185,4,227,4,206,4,130,4,38,4,143,3,165,2,172,1,234,0,91,0,159,255,25,255,225,254,159,254,116,254,137,254,120,254,87,254, - 65,254,228,253,134,253,236,252,82,252,223,251,197,251,252,251,74,252,190,252,113,253,112,254,55,255,227,255,111,0,191,0,9,1,114,1,222,1,48,2, - 138,2,255,2,143,3,211,3,175,3,109,3,53,3,232,2,194,2,201,2,215,2,1,3,63,3,117,3,118,3,70,3,225,2,140,2,103,2,99,2, - 89,2,75,2,117,2,214,2,30,3,100,3,168,3,225,3,37,4,77,4,85,4,81,4,73,4,84,4,102,4,135,4,232,4,51,5,134,5,207,5, - 228,5,228,5,199,5,147,5,75,5,12,5,189,4,117,4,247,3,89,3,194,2,255,1,47,1,107,0,130,255,239,254,127,254,27,254,185,253,39,253, - 120,252,232,251,94,251,215,250,139,250,101,250,3,250,169,249,221,248,52,248,196,247,203,246,45,246,136,245,255,244,188,244,172,244,223,244,11,245,36,245, - 104,245,252,245,154,246,239,246,53,247,121,247,124,247,146,247,123,247,53,247,35,247,6,247,110,247,4,248,98,248,181,248,200,248,177,248,76,248,208,247, - 96,247,22,247,212,246,160,246,156,246,160,246,221,246,40,247,113,247,168,247,178,247,161,247,128,247,100,247,63,247,66,247,80,247,77,247,102,247,154,247, - 254,247,83,248,137,248,246,248,87,249,214,249,104,250,249,250,121,251,202,251,70,252,194,252,110,253,22,254,166,254,243,254,25,255,54,255,58,255,5,255, - 159,254,73,254,33,254,16,254,49,254,115,254,234,254,142,255,15,0,143,0,240,0,97,1,175,1,241,1,92,2,181,2,235,2,27,3,93,3,214,3, - 138,4,131,5,119,6,125,7,104,8,67,9,239,9,91,10,134,10,188,10,18,11,141,11,246,11,29,12,90,12,156,12,26,13,94,13,74,13,219,12, - 95,12,228,11,93,11,164,10,208,9,91,9,59,9,59,9,92,9,170,9,197,9,23,10,73,10,35,10,236,9,127,9,27,9,179,8,135,8,84,8, - 225,7,151,7,31,7,198,6,69,6,217,5,79,5,228,4,163,4,213,4,247,4,52,5,111,5,40,5,217,4,90,4,197,3,46,3,133,2,28,2, - 223,1,164,1,75,1,166,0,226,255,29,255,99,254,128,253,133,252,173,251,226,250,111,250,83,250,118,250,27,251,9,252,70,253,108,254,130,255,60,0, - 168,0,241,0,17,1,24,1,230,0,125,0,10,0,102,255,209,254,106,254,51,254,12,254,24,254,62,254,130,254,162,254,170,254,5,255,141,255,217,255, - 0,0,228,255,148,255,44,255,199,254,42,254,118,253,240,252,196,252,165,252,143,252,139,252,79,252,2,252,154,251,56,251,172,250,53,250,246,249,199,249, - 199,249,221,249,10,250,44,250,89,250,140,250,197,250,6,251,93,251,166,251,247,251,103,252,237,252,123,253,58,254,39,255,205,255,94,0,202,0,51,1, - 133,1,204,1,32,2,118,2,211,2,26,3,88,3,121,3,109,3,92,3,99,3,132,3,141,3,157,3,142,3,116,3,73,3,251,2,131,2,31,2, - 208,1,178,1,141,1,114,1,103,1,105,1,126,1,154,1,202,1,233,1,14,2,63,2,107,2,124,2,140,2,186,2,37,3,95,3,136,3,116,3, - 118,3,174,3,210,3,22,4,2,4,231,3,153,3,3,3,93,2,166,1,234,0,79,0,250,255,205,255,145,255,127,255,84,255,54,255,250,254,191,254, - 159,254,127,254,58,254,244,253,152,253,75,253,5,253,189,252,114,252,20,252,101,251,109,250,144,249,216,248,99,248,61,248,1,248,190,247,220,247,37,248, - 121,248,227,248,54,249,94,249,165,249,250,249,57,250,112,250,96,250,65,250,37,250,230,249,165,249,73,249,32,249,26,249,73,249,105,249,98,249,93,249, - 91,249,77,249,86,249,70,249,84,249,136,249,142,249,134,249,119,249,72,249,11,249,177,248,94,248,52,248,29,248,91,248,164,248,239,248,19,249,62,249, - 94,249,100,249,124,249,184,249,255,249,155,250,72,251,30,252,255,252,208,253,91,254,243,254,105,255,217,255,51,0,105,0,145,0,184,0,227,0,11,1, - 39,1,28,1,15,1,240,0,198,0,212,0,233,0,14,1,89,1,169,1,222,1,71,2,183,2,67,3,220,3,96,4,171,4,241,4,45,5,151,5, - 53,6,206,6,99,7,226,7,95,8,247,8,124,9,235,9,119,10,229,10,36,11,47,11,56,11,61,11,72,11,50,11,37,11,40,11,26,11,25,11, - 199,10,83,10,226,9,154,9,132,9,143,9,163,9,201,9,246,9,31,10,23,10,218,9,131,9,9,9,149,8,43,8,165,7,235,6,73,6,174,5, - 84,5,44,5,15,5,241,4,227,4,211,4,180,4,124,4,62,4,243,3,189,3,139,3,135,3,196,3,185,3,159,3,99,3,248,2,126,2,23,2, - 175,1,89,1,27,1,193,0,73,0,180,255,254,254,20,254,45,253,78,252,139,251,11,251,202,250,224,250,97,251,43,252,13,253,202,253,121,254,235,254, - 76,255,113,255,140,255,174,255,194,255,187,255,246,255,244,255,196,255,123,255,39,255,211,254,142,254,84,254,55,254,31,254,1,254,208,253,153,253,63,253, - 211,252,164,252,133,252,61,252,220,251,93,251,206,250,104,250,3,250,178,249,122,249,109,249,142,249,162,249,167,249,123,249,43,249,207,248,128,248,79,248, - 40,248,43,248,123,248,252,248,155,249,58,250,234,250,136,251,14,252,106,252,149,252,176,252,236,252,28,253,110,253,233,253,106,254,253,254,129,255,0,0, - 133,0,234,0,72,1,151,1,209,1,0,2,25,2,111,2,215,2,28,3,88,3,89,3,49,3,254,2,189,2,117,2,52,2,241,1,202,1,164,1, - 126,1,78,1,255,0,197,0,140,0,108,0,62,0,19,0,235,255,209,255,208,255,234,255,29,0,129,0,248,0,89,1,141,1,128,1,90,1,79,1, - 75,1,92,1,132,1,132,1,139,1,135,1,96,1,21,1,172,0,69,0,241,255,187,255,116,255,69,255,62,255,34,255,58,255,106,255,123,255,151,255, - 142,255,129,255,162,255,191,255,203,255,195,255,166,255,105,255,249,254,134,254,244,253,120,253,34,253,186,252,125,252,254,251,153,251,68,251,75,251,43,251, - 79,251,112,251,161,251,18,252,99,252,127,252,145,252,74,252,52,252,31,252,23,252,205,251,142,251,117,251,82,251,67,251,43,251,223,250,165,250,159,250, - 191,250,235,250,6,251,28,251,61,251,93,251,50,251,252,250,144,250,31,250,227,249,158,249,134,249,130,249,165,249,190,249,255,249,44,250,60,250,109,250, - 159,250,169,250,181,250,204,250,17,251,126,251,255,251,174,252,113,253,38,254,210,254,140,255,39,0,168,0,17,1,126,1,209,1,35,2,90,2,132,2, - 161,2,207,2,250,2,45,3,62,3,51,3,37,3,3,3,225,2,215,2,236,2,17,3,116,3,221,3,95,4,218,4,62,5,183,5,105,6,240,6, - 126,7,225,7,48,8,128,8,197,8,251,8,44,9,75,9,150,9,244,9,63,10,114,10,144,10,130,10,149,10,166,10,148,10,74,10,249,9,174,9, - 121,9,67,9,8,9,212,8,210,8,214,8,3,9,41,9,75,9,102,9,96,9,74,9,3,9,172,8,50,8,118,7,158,6,207,5,15,5,145,4, - 76,4,250,3,218,3,243,3,12,4,253,3,246,3,210,3,159,3,139,3,64,3,182,2,23,2,137,1,22,1,212,0,162,0,155,0,223,0,17,1, - 76,1,65,1,4,1,163,0,101,0,0,0,152,255,50,255,169,254,49,254,174,253,49,253,218,252,192,252,182,252,214,252,30,253,95,253,159,253,197,253, - 231,253,26,254,76,254,108,254,153,254,187,254,200,254,205,254,214,254,169,254,135,254,126,254,76,254,41,254,239,253,138,253,38,253,163,252,63,252,243,251, - 146,251,46,251,217,250,140,250,64,250,60,250,12,250,190,249,75,249,198,248,40,248,131,247,247,246,150,246,114,246,160,246,243,246,48,247,130,247,185,247, - 250,247,34,248,80,248,115,248,214,248,86,249,6,250,155,250,47,251,196,251,82,252,232,252,78,253,171,253,244,253,34,254,84,254,112,254,174,254,254,254, - 98,255,198,255,51,0,144,0,11,1,111,1,198,1,16,2,48,2,66,2,107,2,140,2,158,2,146,2,110,2,56,2,237,1,136,1,61,1,244,0, - 205,0,199,0,190,0,169,0,119,0,40,0,196,255,75,255,221,254,163,254,144,254,175,254,209,254,19,255,69,255,94,255,97,255,75,255,119,255,154,255, - 195,255,178,255,149,255,140,255,101,255,69,255,9,255,221,254,203,254,232,254,227,254,223,254,229,254,0,255,16,255,33,255,55,255,75,255,91,255,91,255, - 104,255,147,255,184,255,238,255,47,0,107,0,150,0,155,0,133,0,98,0,3,0,140,255,25,255,178,254,113,254,49,254,5,254,236,253,231,253,207,253, - 186,253,177,253,153,253,153,253,107,253,63,253,57,253,78,253,71,253,91,253,63,253,20,253,244,252,217,252,211,252,183,252,164,252,133,252,124,252,111,252, - 89,252,70,252,50,252,60,252,34,252,2,252,218,251,169,251,126,251,100,251,67,251,56,251,90,251,122,251,139,251,151,251,153,251,136,251,154,251,164,251, - 202,251,7,252,73,252,157,252,3,253,124,253,233,253,73,254,175,254,34,255,163,255,33,0,186,0,76,1,223,1,131,2,46,3,185,3,41,4,88,4, - 126,4,142,4,162,4,141,4,108,4,78,4,69,4,120,4,146,4,167,4,206,4,243,4,25,5,63,5,108,5,145,5,174,5,244,5,54,6,140,6, - 2,7,130,7,3,8,96,8,142,8,197,8,215,8,9,9,71,9,131,9,106,9,81,9,118,9,131,9,160,9,167,9,149,9,157,9,146,9,125,9, - 62,9,243,8,186,8,144,8,79,8,254,7,159,7,115,7,87,7,115,7,141,7,175,7,201,7,158,7,75,7,158,6,224,5,241,4,88,4,202,3, - 116,3,110,3,135,3,121,3,103,3,57,3,38,3,5,3,232,2,149,2,57,2,222,1,121,1,7,1,165,0,65,0,217,255,201,255,199,255,202,255, - 228,255,14,0,62,0,120,0,127,0,94,0,40,0,227,255,130,255,41,255,231,254,192,254,146,254,103,254,62,254,243,253,188,253,143,253,103,253,88,253, - 89,253,103,253,107,253,114,253,114,253,124,253,120,253,96,253,44,253,5,253,246,252,26,253,19,253,197,252,128,252,77,252,49,252,21,252,209,251,137,251, - 114,251,117,251,96,251,32,251,193,250,78,250,209,249,80,249,196,248,62,248,175,247,80,247,2,247,190,246,125,246,75,246,73,246,136,246,255,246,127,247, - 5,248,177,248,97,249,234,249,90,250,129,250,165,250,208,250,57,251,197,251,93,252,247,252,161,253,34,254,162,254,243,254,66,255,131,255,201,255,253,255, - 40,0,64,0,94,0,173,0,13,1,104,1,211,1,43,2,110,2,131,2,115,2,52,2,230,1,153,1,114,1,103,1,103,1,117,1,130,1,107,1, - 51,1,216,0,134,0,55,0,235,255,144,255,59,255,0,255,211,254,157,254,113,254,81,254,56,254,31,254,9,254,232,253,226,253,228,253,243,253,240,253, - 1,254,242,253,251,253,238,253,8,254,0,254,24,254,23,254,18,254,6,254,44,254,60,254,81,254,139,254,171,254,224,254,246,254,252,254,249,254,246,254, - 9,255,51,255,130,255,185,255,1,0,36,0,66,0,87,0,86,0,65,0,58,0,17,0,14,0,235,255,173,255,80,255,7,255,196,254,189,254,180,254, - 162,254,159,254,151,254,113,254,48,254,4,254,229,253,207,253,202,253,193,253,210,253,225,253,232,253,229,253,231,253,181,253,161,253,154,253,153,253,166,253, - 163,253,156,253,120,253,80,253,6,253,165,252,73,252,234,251,194,251,190,251,215,251,252,251,46,252,102,252,110,252,103,252,71,252,63,252,60,252,78,252, - 124,252,186,252,27,253,116,253,240,253,101,254,198,254,68,255,192,255,39,0,115,0,187,0,22,1,123,1,226,1,115,2,235,2,89,3,171,3,250,3, - 56,4,123,4,181,4,217,4,1,5,0,5,0,5,27,5,40,5,66,5,131,5,216,5,43,6,115,6,147,6,156,6,147,6,138,6,122,6,129,6, - 163,6,191,6,224,6,45,7,128,7,201,7,31,8,93,8,126,8,129,8,131,8,165,8,179,8,180,8,208,8,17,9,59,9,91,9,87,9,32,9, - 236,8,182,8,113,8,18,8,130,7,223,6,152,6,46,6,225,5,145,5,122,5,91,5,81,5,50,5,214,4,103,4,251,3,111,3,12,3,189,2, - 135,2,99,2,56,2,35,2,234,1,193,1,168,1,94,1,58,1,245,0,202,0,163,0,108,0,65,0,26,0,238,255,209,255,142,255,77,255,43,255, - 254,254,241,254,44,255,124,255,208,255,21,0,55,0,62,0,18,0,198,255,137,255,75,255,66,255,73,255,62,255,61,255,33,255,21,255,242,254,206,254, - 135,254,83,254,29,254,226,253,179,253,91,253,21,253,237,252,210,252,176,252,121,252,46,252,211,251,146,251,148,251,151,251,169,251,209,251,36,252,122,252, - 181,252,160,252,103,252,24,252,164,251,36,251,122,250,180,249,28,249,174,248,92,248,43,248,8,248,245,247,12,248,44,248,37,248,31,248,23,248,49,248, - 113,248,216,248,83,249,221,249,121,250,35,251,223,251,113,252,221,252,53,253,107,253,164,253,224,253,27,254,108,254,209,254,76,255,191,255,40,0,107,0, - 143,0,159,0,191,0,211,0,229,0,0,1,24,1,51,1,58,1,56,1,64,1,67,1,75,1,85,1,83,1,76,1,50,1,21,1,235,0,217,0, - 204,0,168,0,130,0,54,0,205,255,109,255,23,255,191,254,112,254,45,254,244,253,186,253,156,253,125,253,81,253,27,253,205,252,165,252,138,252,117,252, - 104,252,106,252,140,252,182,252,217,252,235,252,2,253,46,253,94,253,141,253,178,253,210,253,236,253,15,254,38,254,59,254,87,254,112,254,163,254,214,254, - 21,255,72,255,131,255,163,255,219,255,15,0,65,0,91,0,108,0,105,0,108,0,108,0,102,0,84,0,71,0,69,0,51,0,15,0,199,255,98,255, - 9,255,207,254,173,254,167,254,169,254,177,254,164,254,130,254,131,254,167,254,171,254,167,254,155,254,153,254,145,254,167,254,195,254,202,254,178,254,157,254, - 141,254,130,254,126,254,85,254,44,254,20,254,217,253,136,253,60,253,5,253,228,252,233,252,235,252,241,252,241,252,244,252,250,252,6,253,24,253,33,253, - 67,253,138,253,214,253,66,254,188,254,43,255,160,255,32,0,130,0,237,0,105,1,225,1,86,2,178,2,255,2,49,3,98,3,128,3,167,3,195,3, - 226,3,20,4,92,4,204,4,55,5,148,5,219,5,17,6,58,6,101,6,155,6,195,6,210,6,253,6,46,7,79,7,94,7,115,7,112,7,76,7, - 53,7,50,7,36,7,17,7,27,7,39,7,69,7,75,7,130,7,223,7,13,8,61,8,97,8,151,8,182,8,234,8,251,8,218,8,172,8,99,8, - 57,8,225,7,105,7,0,7,144,6,30,6,183,5,83,5,246,4,145,4,29,4,179,3,88,3,9,3,200,2,142,2,108,2,57,2,251,1,179,1, - 153,1,105,1,81,1,33,1,248,0,198,0,127,0,105,0,55,0,253,255,242,255,206,255,202,255,191,255,173,255,137,255,116,255,95,255,72,255,34,255, - 3,255,238,254,254,254,34,255,84,255,131,255,192,255,226,255,242,255,252,255,241,255,232,255,252,255,6,0,242,255,217,255,206,255,205,255,188,255,156,255, - 115,255,55,255,227,254,103,254,239,253,134,253,24,253,178,252,81,252,230,251,147,251,70,251,13,251,216,250,206,250,229,250,13,251,61,251,117,251,161,251, - 204,251,236,251,222,251,158,251,81,251,251,250,127,250,7,250,155,249,50,249,218,248,160,248,124,248,110,248,108,248,153,248,236,248,57,249,119,249,154,249, - 167,249,169,249,176,249,219,249,31,250,173,250,108,251,70,252,9,253,177,253,41,254,113,254,148,254,169,254,184,254,207,254,242,254,40,255,112,255,176,255, - 216,255,10,0,75,0,144,0,197,0,226,0,234,0,230,0,233,0,204,0,176,0,155,0,150,0,162,0,175,0,180,0,172,0,173,0,159,0,129,0, - 51,0,228,255,159,255,119,255,93,255,75,255,18,255,200,254,116,254,19,254,196,253,114,253,56,253,30,253,239,252,208,252,157,252,107,252,77,252,30,252, - 248,251,211,251,197,251,186,251,186,251,227,251,16,252,102,252,179,252,10,253,88,253,146,253,188,253,220,253,239,253,12,254,56,254,85,254,148,254,223,254, - 69,255,156,255,230,255,24,0,69,0,105,0,114,0,118,0,102,0,98,0,107,0,111,0,123,0,116,0,102,0,69,0,29,0,4,0,3,0,248,255, - 206,255,177,255,112,255,58,255,29,255,245,254,15,255,62,255,95,255,133,255,167,255,141,255,120,255,117,255,90,255,65,255,47,255,33,255,52,255,70,255, - 95,255,95,255,43,255,12,255,247,254,234,254,224,254,151,254,109,254,90,254,49,254,33,254,243,253,178,253,152,253,148,253,145,253,127,253,130,253,153,253, - 226,253,48,254,135,254,235,254,79,255,187,255,51,0,168,0,27,1,147,1,244,1,72,2,142,2,218,2,28,3,56,3,59,3,44,3,41,3,63,3, - 114,3,167,3,235,3,59,4,126,4,223,4,59,5,165,5,15,6,94,6,183,6,248,6,46,7,68,7,96,7,117,7,162,7,194,7,200,7,220,7, - 216,7,200,7,194,7,153,7,96,7,86,7,78,7,89,7,105,7,122,7,155,7,225,7,43,8,96,8,142,8,147,8,143,8,122,8,67,8,247,7, - 136,7,248,6,118,6,32,6,198,5,120,5,55,5,210,4,108,4,4,4,181,3,75,3,218,2,120,2,16,2,166,1,96,1,38,1,9,1,244,0, - 217,0,208,0,170,0,109,0,50,0,242,255,170,255,115,255,84,255,63,255,69,255,52,255,58,255,44,255,23,255,242,254,202,254,191,254,188,254,191,254, - 193,254,210,254,220,254,243,254,29,255,79,255,130,255,149,255,165,255,191,255,212,255,237,255,241,255,248,255,24,0,66,0,73,0,97,0,87,0,47,0, - 8,0,201,255,137,255,58,255,192,254,42,254,139,253,254,252,132,252,32,252,194,251,97,251,17,251,215,250,134,250,103,250,85,250,115,250,152,250,179,250, - 190,250,190,250,194,250,213,250,219,250,216,250,198,250,180,250,150,250,122,250,69,250,40,250,6,250,252,249,36,250,65,250,87,250,98,250,121,250,159,250, - 188,250,215,250,0,251,71,251,153,251,234,251,46,252,117,252,196,252,52,253,179,253,58,254,162,254,234,254,36,255,75,255,93,255,105,255,94,255,97,255, - 112,255,148,255,188,255,239,255,39,0,116,0,181,0,234,0,0,1,247,0,211,0,157,0,105,0,54,0,6,0,223,255,202,255,208,255,202,255,169,255, - 138,255,75,255,0,255,177,254,112,254,72,254,37,254,29,254,37,254,23,254,242,253,171,253,116,253,44,253,219,252,158,252,97,252,67,252,71,252,96,252, - 95,252,85,252,73,252,31,252,25,252,13,252,20,252,59,252,120,252,182,252,19,253,92,253,146,253,200,253,242,253,42,254,90,254,121,254,171,254,221,254, - 34,255,102,255,183,255,244,255,61,0,122,0,162,0,176,0,159,0,154,0,158,0,150,0,140,0,141,0,108,0,69,0,55,0,32,0,25,0,1,0, - 12,0,18,0,22,0,22,0,1,0,231,255,196,255,183,255,219,255,14,0,72,0,89,0,98,0,48,0,250,255,217,255,176,255,162,255,129,255,133,255, - 160,255,185,255,224,255,239,255,238,255,213,255,165,255,145,255,93,255,57,255,26,255,47,255,57,255,22,255,207,254,121,254,48,254,251,253,11,254,33,254, - 72,254,123,254,216,254,44,255,134,255,216,255,57,0,157,0,248,0,85,1,190,1,43,2,139,2,214,2,253,2,20,3,31,3,49,3,67,3,75,3, - 96,3,160,3,222,3,30,4,87,4,121,4,170,4,217,4,29,5,120,5,219,5,58,6,123,6,201,6,252,6,17,7,46,7,42,7,50,7,72,7, - 100,7,132,7,144,7,165,7,168,7,162,7,194,7,168,7,161,7,162,7,161,7,122,7,68,7,42,7,32,7,45,7,65,7,82,7,61,7,18,7, - 219,6,134,6,40,6,178,5,37,5,149,4,19,4,152,3,57,3,2,3,218,2,219,2,203,2,133,2,23,2,136,1,7,1,133,0,48,0,253,255, - 244,255,212,255,221,255,199,255,191,255,178,255,159,255,144,255,127,255,105,255,98,255,88,255,83,255,72,255,62,255,62,255,40,255,14,255,238,254,220,254, - 205,254,216,254,1,255,21,255,50,255,69,255,86,255,113,255,147,255,147,255,137,255,129,255,145,255,163,255,173,255,174,255,188,255,206,255,241,255,15,0, - 21,0,248,255,187,255,112,255,16,255,166,254,60,254,206,253,109,253,19,253,175,252,78,252,7,252,175,251,65,251,216,250,111,250,17,250,237,249,228,249, - 249,249,54,250,104,250,163,250,213,250,233,250,251,250,229,250,253,250,50,251,110,251,165,251,211,251,229,251,244,251,248,251,16,252,14,252,6,252,248,251, - 251,251,18,252,38,252,66,252,124,252,205,252,30,253,105,253,154,253,171,253,178,253,204,253,240,253,37,254,94,254,174,254,254,254,65,255,109,255,133,255, - 123,255,106,255,105,255,104,255,115,255,165,255,235,255,72,0,147,0,187,0,194,0,168,0,109,0,46,0,219,255,145,255,75,255,40,255,7,255,239,254, - 228,254,192,254,152,254,102,254,49,254,253,253,190,253,148,253,134,253,127,253,107,253,102,253,99,253,73,253,27,253,217,252,114,252,57,252,32,252,41,252, - 57,252,84,252,113,252,110,252,106,252,75,252,63,252,56,252,81,252,131,252,193,252,255,252,87,253,161,253,221,253,12,254,52,254,120,254,171,254,247,254, - 72,255,151,255,250,255,64,0,122,0,154,0,181,0,176,0,177,0,172,0,180,0,176,0,179,0,166,0,173,0,170,0,175,0,183,0,145,0,134,0, - 136,0,132,0,152,0,172,0,176,0,180,0,180,0,180,0,154,0,133,0,129,0,141,0,147,0,136,0,141,0,94,0,39,0,248,255,212,255,230,255, - 234,255,11,0,54,0,87,0,101,0,98,0,71,0,25,0,231,255,198,255,209,255,232,255,231,255,227,255,239,255,206,255,160,255,88,255,33,255,254,254, - 4,255,40,255,80,255,158,255,230,255,64,0,136,0,169,0,222,0,13,1,75,1,151,1,229,1,59,2,129,2,217,2,17,3,51,3,55,3,41,3, - 46,3,93,3,125,3,168,3,208,3,217,3,239,3,8,4,23,4,62,4,87,4,160,4,1,5,119,5,205,5,8,6,64,6,104,6,126,6,133,6, - 137,6,162,6,180,6,212,6,252,6,27,7,72,7,86,7,50,7,251,6,162,6,65,6,244,5,188,5,141,5,97,5,41,5,249,4,234,4,206,4, - 192,4,188,4,182,4,146,4,69,4,228,3,110,3,241,2,96,2,252,1,208,1,184,1,212,1,222,1,189,1,94,1,251,0,115,0,238,255,133,255, - 63,255,16,255,3,255,5,255,29,255,95,255,131,255,144,255,136,255,116,255,90,255,84,255,75,255,59,255,61,255,75,255,106,255,134,255,141,255,149,255, - 142,255,156,255,145,255,122,255,105,255,87,255,93,255,84,255,97,255,113,255,162,255,210,255,250,255,248,255,235,255,202,255,176,255,134,255,84,255,50,255, - 47,255,69,255,72,255,41,255,0,255,211,254,170,254,101,254,9,254,178,253,92,253,255,252,150,252,35,252,178,251,79,251,3,251,208,250,176,250,144,250, - 108,250,85,250,89,250,93,250,108,250,123,250,177,250,247,250,46,251,94,251,154,251,191,251,234,251,75,252,146,252,200,252,255,252,42,253,89,253,128,253, - 128,253,131,253,127,253,121,253,112,253,114,253,134,253,163,253,190,253,229,253,249,253,253,253,1,254,4,254,8,254,18,254,38,254,70,254,120,254,181,254, - 231,254,30,255,76,255,109,255,160,255,194,255,196,255,205,255,216,255,212,255,217,255,235,255,250,255,242,255,226,255,183,255,124,255,69,255,7,255,213,254, - 180,254,128,254,84,254,37,254,8,254,226,253,202,253,182,253,189,253,185,253,167,253,167,253,148,253,125,253,94,253,49,253,27,253,13,253,15,253,1,253, - 9,253,13,253,5,253,17,253,5,253,251,252,255,252,251,252,254,252,27,253,64,253,112,253,152,253,196,253,246,253,40,254,81,254,116,254,156,254,228,254, - 44,255,112,255,209,255,36,0,122,0,176,0,201,0,201,0,191,0,199,0,184,0,206,0,206,0,224,0,233,0,2,1,7,1,6,1,7,1,9,1, - 17,1,9,1,25,1,29,1,21,1,22,1,13,1,14,1,0,1,212,0,183,0,114,0,61,0,25,0,255,255,10,0,29,0,65,0,78,0,84,0, - 82,0,82,0,115,0,101,0,93,0,87,0,84,0,90,0,82,0,96,0,82,0,86,0,105,0,125,0,145,0,154,0,159,0,136,0,87,0,39,0, - 226,255,185,255,184,255,216,255,244,255,28,0,64,0,100,0,129,0,169,0,209,0,27,1,108,1,219,1,72,2,178,2,15,3,66,3,96,3,128,3, - 139,3,146,3,175,3,185,3,192,3,213,3,244,3,249,3,250,3,6,4,29,4,45,4,73,4,110,4,166,4,0,5,66,5,130,5,178,5,214,5, - 10,6,50,6,76,6,97,6,101,6,123,6,126,6,129,6,98,6,75,6,19,6,221,5,137,5,65,5,225,4,146,4,77,4,0,4,189,3,125,3, - 75,3,28,3,5,3,215,2,199,2,176,2,164,2,120,2,66,2,241,1,151,1,65,1,234,0,163,0,126,0,66,0,24,0,230,255,178,255,109,255, - 37,255,250,254,196,254,182,254,187,254,206,254,205,254,228,254,241,254,243,254,252,254,18,255,51,255,113,255,167,255,202,255,223,255,239,255,4,0,6,0, - 7,0,255,255,241,255,224,255,212,255,201,255,180,255,166,255,154,255,174,255,198,255,252,255,33,0,65,0,65,0,35,0,246,255,220,255,166,255,123,255, - 76,255,47,255,0,255,246,254,232,254,206,254,184,254,138,254,70,254,2,254,186,253,112,253,46,253,214,252,142,252,92,252,49,252,28,252,2,252,216,251, - 193,251,166,251,136,251,104,251,75,251,42,251,25,251,27,251,42,251,67,251,104,251,166,251,255,251,99,252,196,252,33,253,121,253,202,253,13,254,67,254, - 108,254,135,254,163,254,181,254,181,254,167,254,149,254,119,254,98,254,77,254,56,254,33,254,27,254,30,254,48,254,56,254,65,254,76,254,77,254,91,254, - 113,254,135,254,171,254,217,254,14,255,73,255,98,255,124,255,117,255,113,255,83,255,77,255,65,255,39,255,43,255,54,255,57,255,66,255,66,255,50,255, - 15,255,223,254,164,254,105,254,55,254,6,254,228,253,210,253,185,253,164,253,154,253,141,253,135,253,113,253,94,253,99,253,109,253,123,253,112,253,98,253, - 88,253,81,253,88,253,103,253,134,253,153,253,172,253,182,253,199,253,207,253,224,253,0,254,29,254,59,254,98,254,139,254,187,254,223,254,30,255,75,255, - 140,255,210,255,8,0,69,0,100,0,115,0,139,0,152,0,161,0,176,0,194,0,204,0,224,0,249,0,29,1,51,1,92,1,133,1,157,1,183,1, - 200,1,197,1,180,1,165,1,140,1,125,1,121,1,89,1,64,1,31,1,238,0,181,0,118,0,54,0,3,0,228,255,228,255,245,255,24,0,68,0, - 94,0,91,0,72,0,54,0,51,0,54,0,46,0,54,0,79,0,120,0,159,0,170,0,186,0,175,0,183,0,188,0,215,0,224,0,233,0,219,0, - 206,0,148,0,91,0,36,0,0,0,241,255,249,255,22,0,68,0,127,0,198,0,255,0,85,1,147,1,234,1,34,2,85,2,154,2,219,2,28,3, - 96,3,159,3,183,3,220,3,251,3,38,4,58,4,55,4,41,4,29,4,18,4,9,4,9,4,20,4,74,4,126,4,202,4,27,5,81,5,142,5, - 173,5,183,5,202,5,213,5,230,5,237,5,228,5,201,5,183,5,144,5,122,5,91,5,43,5,228,4,144,4,40,4,200,3,118,3,24,3,200,2, - 104,2,27,2,200,1,125,1,76,1,33,1,21,1,10,1,20,1,28,1,244,0,183,0,97,0,17,0,181,255,102,255,50,255,15,255,247,254,238,254, - 235,254,229,254,211,254,195,254,169,254,134,254,117,254,101,254,88,254,110,254,159,254,195,254,250,254,48,255,94,255,122,255,144,255,165,255,178,255,174,255, - 173,255,173,255,165,255,140,255,134,255,129,255,130,255,140,255,178,255,219,255,232,255,248,255,6,0,14,0,29,0,24,0,0,0,248,255,234,255,198,255, - 149,255,98,255,65,255,21,255,211,254,152,254,88,254,16,254,203,253,171,253,132,253,100,253,85,253,82,253,88,253,98,253,74,253,48,253,243,252,215,252, - 199,252,183,252,187,252,168,252,160,252,138,252,133,252,106,252,71,252,54,252,60,252,73,252,103,252,142,252,197,252,28,253,130,253,221,253,40,254,92,254, - 134,254,173,254,216,254,0,255,30,255,54,255,58,255,70,255,61,255,43,255,16,255,249,254,229,254,213,254,200,254,187,254,167,254,130,254,103,254,87,254, - 70,254,83,254,110,254,128,254,139,254,142,254,133,254,123,254,121,254,116,254,108,254,115,254,138,254,180,254,202,254,227,254,241,254,249,254,235,254,223,254, - 192,254,180,254,152,254,134,254,102,254,69,254,41,254,249,253,211,253,186,253,166,253,125,253,94,253,70,253,63,253,60,253,46,253,63,253,81,253,102,253, - 116,253,125,253,132,253,113,253,112,253,124,253,142,253,190,253,249,253,40,254,94,254,138,254,157,254,170,254,184,254,213,254,246,254,52,255,112,255,165,255, - 224,255,19,0,50,0,57,0,93,0,118,0,130,0,148,0,150,0,141,0,159,0,186,0,213,0,242,0,17,1,60,1,108,1,150,1,189,1,202,1, - 193,1,187,1,169,1,150,1,125,1,99,1,68,1,45,1,18,1,251,0,212,0,180,0,134,0,90,0,68,0,32,0,255,255,223,255,198,255,178,255, - 195,255,191,255,201,255,202,255,220,255,234,255,6,0,58,0,104,0,126,0,151,0,190,0,217,0,0,1,21,1,36,1,35,1,29,1,27,1,22,1, - 20,1,27,1,252,0,241,0,219,0,194,0,155,0,141,0,158,0,204,0,21,1,79,1,100,1,133,1,171,1,191,1,222,1,254,1,30,2,74,2, - 153,2,229,2,41,3,118,3,156,3,195,3,231,3,253,3,20,4,37,4,33,4,37,4,56,4,48,4,63,4,78,4,84,4,98,4,109,4,130,4, - 155,4,199,4,242,4,8,5,11,5,239,4,218,4,204,4,185,4,166,4,141,4,113,4,76,4,31,4,236,3,160,3,67,3,240,2,142,2,66,2, - 219,1,140,1,60,1,238,0,159,0,97,0,57,0,32,0,24,0,12,0,6,0,237,255,199,255,136,255,77,255,18,255,223,254,198,254,178,254,167,254, - 157,254,157,254,138,254,123,254,112,254,69,254,62,254,78,254,92,254,115,254,134,254,156,254,187,254,232,254,21,255,62,255,104,255,112,255,119,255,108,255, - 90,255,72,255,45,255,36,255,50,255,88,255,137,255,163,255,195,255,209,255,248,255,15,0,18,0,26,0,50,0,79,0,80,0,71,0,30,0,230,255, - 172,255,97,255,18,255,196,254,139,254,102,254,67,254,54,254,22,254,243,253,196,253,160,253,132,253,112,253,113,253,117,253,152,253,189,253,210,253,220,253, - 213,253,192,253,181,253,177,253,179,253,196,253,210,253,211,253,221,253,222,253,211,253,213,253,220,253,221,253,221,253,229,253,238,253,5,254,19,254,56,254, - 99,254,141,254,171,254,200,254,245,254,16,255,65,255,119,255,158,255,181,255,206,255,214,255,224,255,228,255,212,255,194,255,151,255,111,255,65,255,16,255, - 216,254,170,254,131,254,127,254,134,254,141,254,141,254,134,254,120,254,105,254,91,254,83,254,77,254,96,254,137,254,167,254,193,254,207,254,214,254,227,254, - 213,254,202,254,177,254,139,254,109,254,73,254,45,254,27,254,249,253,218,253,195,253,177,253,174,253,166,253,160,253,152,253,136,253,130,253,110,253,125,253, - 142,253,167,253,217,253,240,253,239,253,243,253,240,253,253,253,19,254,52,254,102,254,142,254,184,254,245,254,27,255,83,255,112,255,134,255,167,255,187,255, - 226,255,248,255,35,0,78,0,116,0,147,0,168,0,180,0,186,0,199,0,216,0,227,0,231,0,255,0,14,1,31,1,50,1,75,1,114,1,135,1, - 144,1,140,1,122,1,89,1,56,1,24,1,253,0,233,0,202,0,177,0,150,0,132,0,116,0,100,0,101,0,91,0,76,0,48,0,6,0,232,255, - 172,255,129,255,113,255,129,255,165,255,208,255,6,0,40,0,62,0,102,0,141,0,204,0,240,0,21,1,65,1,101,1,125,1,130,1,141,1,144,1, - 136,1,158,1,172,1,190,1,176,1,191,1,204,1,204,1,204,1,186,1,171,1,136,1,137,1,160,1,183,1,197,1,225,1,250,1,28,2,52,2, - 86,2,146,2,185,2,228,2,48,3,96,3,136,3,186,3,243,3,70,4,121,4,170,4,195,4,189,4,167,4,148,4,130,4,90,4,54,4,29,4, - 26,4,30,4,51,4,69,4,73,4,87,4,96,4,96,4,74,4,33,4,240,3,164,3,113,3,62,3,35,3,236,2,192,2,142,2,85,2,18,2, - 172,1,86,1,0,1,170,0,104,0,39,0,238,255,173,255,116,255,81,255,50,255,41,255,16,255,242,254,199,254,160,254,130,254,90,254,73,254,56,254, - 55,254,62,254,70,254,87,254,85,254,98,254,109,254,126,254,133,254,139,254,137,254,121,254,134,254,148,254,155,254,184,254,200,254,211,254,231,254,235,254, - 234,254,223,254,209,254,221,254,246,254,14,255,68,255,113,255,152,255,185,255,214,255,242,255,8,0,11,0,7,0,22,0,26,0,8,0,228,255,187,255, - 148,255,102,255,30,255,243,254,191,254,156,254,124,254,105,254,80,254,67,254,54,254,51,254,62,254,59,254,48,254,44,254,34,254,22,254,15,254,9,254, - 24,254,45,254,65,254,102,254,141,254,177,254,203,254,234,254,7,255,26,255,33,255,12,255,249,254,241,254,228,254,223,254,207,254,180,254,171,254,160,254, - 149,254,124,254,105,254,113,254,131,254,174,254,227,254,23,255,79,255,140,255,188,255,219,255,227,255,235,255,230,255,227,255,220,255,210,255,187,255,160,255, - 130,255,88,255,39,255,241,254,184,254,144,254,116,254,96,254,83,254,80,254,92,254,113,254,124,254,128,254,120,254,115,254,106,254,88,254,78,254,80,254, - 90,254,95,254,112,254,128,254,146,254,138,254,119,254,63,254,4,254,218,253,192,253,181,253,175,253,174,253,177,253,189,253,207,253,206,253,184,253,175,253, - 168,253,163,253,156,253,157,253,152,253,170,253,184,253,208,253,244,253,22,254,52,254,112,254,169,254,217,254,11,255,45,255,99,255,144,255,165,255,184,255, - 205,255,237,255,12,0,43,0,75,0,107,0,129,0,175,0,206,0,231,0,255,0,11,1,18,1,38,1,54,1,54,1,50,1,38,1,31,1,11,1, - 11,1,14,1,20,1,29,1,32,1,11,1,231,0,186,0,143,0,104,0,89,0,71,0,73,0,76,0,76,0,72,0,61,0,39,0,8,0,238,255, - 224,255,228,255,213,255,209,255,188,255,188,255,198,255,230,255,19,0,58,0,111,0,127,0,175,0,220,0,233,0,33,1,71,1,126,1,176,1,225,1, - 3,2,32,2,46,2,56,2,63,2,77,2,88,2,84,2,85,2,79,2,74,2,45,2,21,2,247,1,243,1,243,1,237,1,244,1,6,2,39,2, - 89,2,132,2,150,2,171,2,192,2,230,2,6,3,34,3,98,3,160,3,214,3,6,4,31,4,36,4,42,4,27,4,12,4,0,4,242,3,236,3, - 229,3,221,3,210,3,186,3,161,3,141,3,123,3,113,3,88,3,60,3,27,3,233,2,165,2,103,2,52,2,240,1,180,1,146,1,107,1,79,1, - 57,1,17,1,215,0,155,0,82,0,253,255,177,255,115,255,57,255,12,255,221,254,199,254,169,254,153,254,128,254,98,254,94,254,74,254,66,254,58,254, - 65,254,58,254,56,254,56,254,66,254,94,254,113,254,139,254,166,254,184,254,206,254,207,254,203,254,187,254,173,254,156,254,119,254,110,254,110,254,130,254, - 146,254,171,254,210,254,0,255,27,255,48,255,65,255,84,255,113,255,147,255,159,255,160,255,174,255,173,255,170,255,145,255,126,255,117,255,129,255,156,255, - 177,255,183,255,187,255,160,255,127,255,73,255,11,255,228,254,193,254,191,254,211,254,221,254,223,254,205,254,196,254,182,254,171,254,153,254,141,254,135,254, - 152,254,175,254,203,254,223,254,239,254,16,255,51,255,73,255,94,255,112,255,140,255,169,255,174,255,170,255,160,255,133,255,99,255,66,255,27,255,3,255, - 235,254,234,254,227,254,217,254,218,254,221,254,228,254,241,254,3,255,26,255,45,255,61,255,65,255,75,255,84,255,99,255,122,255,127,255,126,255,124,255, - 113,255,102,255,73,255,57,255,36,255,9,255,225,254,175,254,133,254,102,254,83,254,85,254,98,254,109,254,113,254,121,254,106,254,106,254,95,254,70,254, - 40,254,26,254,11,254,8,254,0,254,8,254,22,254,58,254,62,254,62,254,52,254,27,254,254,253,222,253,195,253,178,253,177,253,181,253,192,253,215,253, - 228,253,247,253,251,253,249,253,250,253,254,253,4,254,11,254,29,254,62,254,106,254,155,254,202,254,0,255,48,255,81,255,124,255,162,255,213,255,250,255, - 33,0,53,0,80,0,101,0,127,0,157,0,186,0,205,0,231,0,4,1,25,1,49,1,67,1,75,1,87,1,87,1,81,1,68,1,47,1,39,1, - 27,1,10,1,244,0,223,0,191,0,154,0,127,0,115,0,105,0,101,0,102,0,104,0,94,0,79,0,50,0,14,0,242,255,226,255,221,255,232,255, - 244,255,24,0,40,0,53,0,51,0,51,0,36,0,18,0,25,0,42,0,65,0,97,0,141,0,175,0,223,0,241,0,21,1,69,1,111,1,150,1, - 168,1,205,1,245,1,25,2,66,2,88,2,107,2,100,2,118,2,117,2,107,2,85,2,70,2,57,2,42,2,34,2,6,2,12,2,31,2,46,2, - 78,2,93,2,113,2,135,2,154,2,181,2,200,2,223,2,240,2,246,2,255,2,10,3,27,3,60,3,74,3,95,3,121,3,150,3,167,3,177,3, - 170,3,164,3,168,3,172,3,165,3,132,3,96,3,34,3,229,2,174,2,120,2,66,2,23,2,240,1,186,1,140,1,87,1,32,1,241,0,197,0, - 147,0,120,0,98,0,73,0,37,0,4,0,214,255,181,255,123,255,75,255,8,255,229,254,189,254,153,254,144,254,135,254,127,254,134,254,133,254,119,254, - 108,254,98,254,102,254,110,254,119,254,116,254,109,254,105,254,96,254,108,254,138,254,151,254,169,254,200,254,214,254,211,254,191,254,157,254,133,254,133,254, - 148,254,175,254,205,254,0,255,61,255,102,255,108,255,115,255,112,255,97,255,80,255,52,255,22,255,8,255,245,254,4,255,15,255,32,255,45,255,47,255, - 66,255,84,255,108,255,136,255,149,255,162,255,162,255,152,255,145,255,133,255,116,255,95,255,75,255,73,255,63,255,68,255,59,255,54,255,66,255,76,255, - 90,255,109,255,129,255,140,255,141,255,133,255,119,255,126,255,137,255,149,255,160,255,173,255,210,255,235,255,246,255,244,255,219,255,185,255,163,255,142,255, - 126,255,105,255,111,255,105,255,102,255,102,255,87,255,73,255,50,255,25,255,253,254,211,254,203,254,207,254,224,254,241,254,252,254,12,255,14,255,33,255, - 43,255,45,255,40,255,23,255,21,255,18,255,12,255,5,255,247,254,224,254,202,254,162,254,123,254,85,254,62,254,44,254,41,254,56,254,67,254,92,254, - 106,254,103,254,87,254,59,254,24,254,12,254,1,254,12,254,40,254,81,254,120,254,139,254,152,254,128,254,91,254,69,254,38,254,6,254,233,253,236,253, - 231,253,246,253,16,254,41,254,69,254,85,254,92,254,131,254,142,254,163,254,174,254,213,254,1,255,23,255,51,255,98,255,162,255,227,255,3,0,43,0, - 79,0,108,0,139,0,173,0,190,0,204,0,229,0,244,0,251,0,6,1,7,1,9,1,25,1,39,1,49,1,68,1,90,1,104,1,97,1,87,1, - 51,1,9,1,224,0,195,0,169,0,147,0,144,0,130,0,127,0,119,0,101,0,80,0,47,0,7,0,231,255,206,255,203,255,210,255,212,255,231,255, - 235,255,235,255,253,255,1,0,17,0,32,0,58,0,84,0,101,0,114,0,123,0,130,0,148,0,177,0,205,0,244,0,28,1,60,1,85,1,97,1, - 110,1,129,1,166,1,202,1,236,1,0,2,24,2,59,2,81,2,96,2,104,2,96,2,89,2,81,2,95,2,99,2,118,2,128,2,139,2,149,2, - 128,2,129,2,140,2,142,2,158,2,175,2,172,2,158,2,139,2,121,2,121,2,110,2,103,2,131,2,160,2,192,2,221,2,248,2,28,3,62,3, - 92,3,116,3,116,3,107,3,75,3,46,3,241,2,199,2,153,2,111,2,59,2,250,1,183,1,115,1,60,1,15,1,224,0,184,0,150,0,98,0, - 69,0,26,0,226,255,180,255,129,255,109,255,95,255,93,255,84,255,66,255,45,255,29,255,7,255,245,254,210,254,198,254,181,254,174,254,171,254,175,254, - 175,254,162,254,149,254,144,254,139,254,138,254,127,254,137,254,126,254,103,254,70,254,40,254,40,254,54,254,67,254,101,254,139,254,184,254,225,254,247,254, - 249,254,253,254,5,255,8,255,5,255,249,254,249,254,9,255,15,255,12,255,242,254,229,254,210,254,189,254,177,254,187,254,195,254,193,254,211,254,228,254, - 236,254,250,254,19,255,65,255,117,255,156,255,185,255,210,255,223,255,214,255,201,255,181,255,160,255,160,255,170,255,188,255,202,255,219,255,219,255,241,255, - 245,255,245,255,231,255,227,255,223,255,220,255,208,255,203,255,196,255,199,255,206,255,226,255,231,255,238,255,224,255,224,255,224,255,228,255,224,255,235,255, - 235,255,230,255,231,255,230,255,226,255,205,255,178,255,142,255,108,255,66,255,19,255,241,254,223,254,199,254,181,254,170,254,167,254,187,254,187,254,192,254, - 203,254,223,254,231,254,250,254,252,254,253,254,3,255,254,254,1,255,246,254,235,254,203,254,169,254,130,254,102,254,69,254,51,254,38,254,41,254,38,254, - 52,254,60,254,69,254,85,254,92,254,108,254,108,254,113,254,109,254,110,254,123,254,146,254,159,254,192,254,214,254,216,254,207,254,187,254,156,254,113,254, - 90,254,56,254,55,254,52,254,65,254,85,254,131,254,180,254,209,254,252,254,16,255,40,255,54,255,83,255,129,255,167,255,224,255,14,0,46,0,86,0, - 111,0,137,0,165,0,181,0,187,0,195,0,208,0,217,0,233,0,240,0,241,0,251,0,253,0,6,1,13,1,17,1,9,1,255,0,238,0,235,0, - 222,0,217,0,204,0,193,0,180,0,180,0,170,0,166,0,169,0,151,0,134,0,90,0,35,0,250,255,205,255,191,255,188,255,190,255,195,255,199,255, - 192,255,187,255,188,255,191,255,206,255,232,255,15,0,50,0,101,0,150,0,191,0,217,0,247,0,10,1,7,1,2,1,252,0,252,0,20,1,43,1, - 75,1,105,1,125,1,137,1,151,1,161,1,191,1,227,1,255,1,3,2,14,2,27,2,48,2,84,2,100,2,113,2,131,2,158,2,175,2,169,2, - 174,2,157,2,162,2,144,2,125,2,78,2,45,2,34,2,5,2,254,1,240,1,254,1,2,2,21,2,46,2,45,2,71,2,96,2,115,2,158,2, - 179,2,192,2,194,2,179,2,176,2,139,2,115,2,86,2,57,2,20,2,230,1,178,1,126,1,82,1,25,1,230,0,173,0,114,0,76,0,33,0, - 253,255,212,255,160,255,120,255,94,255,63,255,45,255,19,255,15,255,9,255,9,255,14,255,21,255,15,255,15,255,0,255,236,254,232,254,228,254,238,254, - 231,254,221,254,203,254,182,254,146,254,124,254,101,254,103,254,108,254,109,254,119,254,110,254,92,254,74,254,74,254,84,254,110,254,157,254,206,254,7,255, - 41,255,55,255,62,255,54,255,41,255,12,255,236,254,206,254,185,254,184,254,184,254,175,254,175,254,185,254,195,254,200,254,213,254,217,254,228,254,216,254, - 242,254,1,255,21,255,29,255,61,255,98,255,144,255,188,255,216,255,232,255,244,255,3,0,4,0,246,255,237,255,246,255,3,0,29,0,50,0,55,0, - 53,0,37,0,25,0,22,0,10,0,8,0,1,0,1,0,10,0,7,0,3,0,0,0,252,255,235,255,230,255,228,255,239,255,7,0,28,0,37,0, - 46,0,39,0,33,0,8,0,252,255,221,255,199,255,180,255,155,255,141,255,120,255,99,255,70,255,43,255,11,255,229,254,207,254,188,254,175,254,167,254, - 169,254,178,254,192,254,213,254,234,254,252,254,247,254,241,254,235,254,227,254,214,254,206,254,189,254,177,254,164,254,144,254,141,254,110,254,90,254,58,254, - 31,254,20,254,33,254,51,254,90,254,121,254,157,254,193,254,216,254,221,254,218,254,210,254,221,254,224,254,223,254,245,254,4,255,22,255,32,255,30,255, - 9,255,250,254,224,254,207,254,198,254,198,254,199,254,211,254,250,254,43,255,75,255,111,255,152,255,203,255,227,255,253,255,21,0,47,0,72,0,97,0, - 123,0,145,0,159,0,173,0,183,0,184,0,190,0,183,0,183,0,199,0,219,0,251,0,20,1,28,1,20,1,252,0,224,0,198,0,166,0,141,0, - 129,0,126,0,133,0,154,0,172,0,195,0,206,0,198,0,176,0,133,0,90,0,43,0,14,0,246,255,232,255,223,255,206,255,194,255,187,255,163,255, - 160,255,159,255,165,255,172,255,196,255,220,255,12,0,62,0,120,0,166,0,206,0,249,0,17,1,32,1,36,1,43,1,57,1,64,1,79,1,78,1, - 76,1,71,1,81,1,86,1,97,1,123,1,135,1,150,1,157,1,176,1,197,1,225,1,245,1,9,2,42,2,75,2,118,2,140,2,143,2,149,2, - 151,2,157,2,161,2,124,2,100,2,67,2,36,2,3,2,232,1,205,1,194,1,197,1,196,1,211,1,215,1,244,1,17,2,42,2,61,2,61,2, - 61,2,46,2,20,2,10,2,240,1,230,1,211,1,197,1,178,1,164,1,143,1,123,1,96,1,74,1,35,1,253,0,216,0,169,0,104,0,29,0, - 202,255,136,255,93,255,69,255,50,255,41,255,41,255,33,255,29,255,12,255,239,254,220,254,202,254,205,254,214,254,236,254,245,254,7,255,19,255,18,255, - 12,255,239,254,206,254,170,254,133,254,94,254,78,254,60,254,40,254,37,254,41,254,63,254,98,254,116,254,139,254,157,254,175,254,185,254,191,254,209,254, - 220,254,229,254,232,254,245,254,246,254,234,254,232,254,214,254,193,254,173,254,173,254,171,254,166,254,156,254,156,254,173,254,180,254,210,254,231,254,247,254, - 15,255,33,255,52,255,76,255,101,255,117,255,141,255,177,255,196,255,227,255,245,255,14,0,36,0,46,0,48,0,57,0,65,0,80,0,86,0,84,0, - 82,0,80,0,80,0,73,0,64,0,60,0,53,0,53,0,57,0,53,0,44,0,50,0,53,0,61,0,44,0,37,0,35,0,39,0,50,0,57,0, - 75,0,89,0,91,0,68,0,36,0,0,0,228,255,201,255,190,255,181,255,173,255,174,255,170,255,154,255,129,255,104,255,76,255,48,255,27,255,253,254, - 238,254,234,254,234,254,229,254,234,254,236,254,234,254,229,254,217,254,203,254,198,254,189,254,199,254,202,254,207,254,207,254,192,254,162,254,139,254,121,254, - 123,254,112,254,108,254,117,254,119,254,121,254,145,254,157,254,173,254,202,254,234,254,4,255,29,255,44,255,48,255,62,255,65,255,51,255,43,255,44,255, - 43,255,48,255,51,255,55,255,57,255,51,255,45,255,51,255,63,255,70,255,102,255,138,255,177,255,220,255,252,255,28,0,46,0,65,0,89,0,98,0, - 111,0,122,0,132,0,147,0,162,0,176,0,190,0,195,0,201,0,199,0,205,0,212,0,209,0,206,0,209,0,204,0,183,0,172,0,145,0,123,0, - 109,0,97,0,108,0,114,0,144,0,159,0,162,0,162,0,137,0,115,0,75,0,51,0,29,0,17,0,255,255,234,255,212,255,180,255,167,255,162,255, - 156,255,160,255,173,255,181,255,206,255,238,255,24,0,65,0,104,0,133,0,166,0,188,0,217,0,224,0,249,0,15,1,47,1,78,1,100,1,108,1, - 119,1,126,1,123,1,125,1,119,1,107,1,107,1,122,1,144,1,155,1,179,1,191,1,226,1,233,1,248,1,0,2,5,2,17,2,38,2,64,2, - 81,2,81,2,81,2,64,2,54,2,23,2,252,1,250,1,247,1,241,1,227,1,214,1,208,1,198,1,190,1,187,1,191,1,202,1,208,1,205,1, - 189,1,176,1,151,1,114,1,89,1,61,1,45,1,42,1,21,1,18,1,24,1,25,1,15,1,11,1,255,0,231,0,186,0,130,0,68,0,252,255, - 195,255,159,255,129,255,102,255,72,255,51,255,37,255,21,255,18,255,11,255,247,254,238,254,232,254,234,254,223,254,223,254,220,254,216,254,221,254,220,254, - 218,254,210,254,187,254,188,254,157,254,126,254,83,254,59,254,29,254,23,254,19,254,23,254,54,254,87,254,126,254,148,254,160,254,175,254,180,254,185,254, - 187,254,187,254,196,254,203,254,207,254,217,254,228,254,242,254,236,254,236,254,238,254,249,254,247,254,245,254,228,254,220,254,217,254,224,254,231,254,0,255, - 23,255,62,255,94,255,120,255,144,255,180,255,199,255,232,255,6,0,21,0,48,0,62,0,73,0,90,0,87,0,91,0,98,0,101,0,107,0,109,0, - 109,0,108,0,101,0,87,0,86,0,87,0,86,0,90,0,83,0,78,0,80,0,84,0,93,0,109,0,111,0,109,0,97,0,87,0,79,0,72,0, - 55,0,57,0,57,0,44,0,43,0,37,0,17,0,248,255,228,255,205,255,198,255,187,255,173,255,166,255,162,255,154,255,145,255,131,255,117,255,106,255, - 87,255,72,255,45,255,9,255,245,254,224,254,213,254,211,254,203,254,189,254,187,254,188,254,196,254,193,254,202,254,209,254,207,254,191,254,187,254,181,254, - 180,254,174,254,162,254,171,254,177,254,181,254,175,254,175,254,170,254,175,254,203,254,235,254,21,255,57,255,91,255,120,255,124,255,124,255,104,255,80,255, - 69,255,58,255,55,255,63,255,73,255,106,255,126,255,151,255,167,255,176,255,174,255,188,255,212,255,246,255,11,0,36,0,47,0,60,0,66,0,71,0, - 71,0,72,0,83,0,86,0,94,0,118,0,133,0,139,0,161,0,175,0,180,0,188,0,180,0,166,0,148,0,139,0,129,0,120,0,132,0,129,0, - 140,0,143,0,151,0,151,0,136,0,127,0,115,0,104,0,87,0,79,0,66,0,64,0,55,0,50,0,30,0,17,0,245,255,216,255,191,255,180,255, - 184,255,188,255,208,255,228,255,250,255,19,0,42,0,64,0,76,0,93,0,116,0,130,0,145,0,173,0,208,0,231,0,10,1,36,1,53,1,81,1, - 107,1,126,1,139,1,151,1,165,1,169,1,164,1,162,1,146,1,141,1,140,1,154,1,165,1,171,1,176,1,179,1,168,1,165,1,168,1,171,1, - 182,1,183,1,196,1,205,1,211,1,200,1,193,1,183,1,178,1,173,1,191,1,209,1,208,1,200,1,205,1,194,1,171,1,148,1,123,1,99,1, - 64,1,35,1,7,1,241,0,222,0,206,0,199,0,184,0,177,0,165,0,159,0,163,0,155,0,157,0,155,0,137,0,105,0,73,0,32,0,3,0, - 230,255,209,255,188,255,173,255,154,255,123,255,79,255,47,255,25,255,11,255,15,255,25,255,37,255,41,255,30,255,14,255,249,254,218,254,187,254,177,254, - 166,254,163,254,162,254,163,254,151,254,139,254,130,254,105,254,91,254,76,254,66,254,67,254,76,254,96,254,117,254,108,254,102,254,92,254,95,254,102,254, - 120,254,141,254,159,254,189,254,206,254,217,254,216,254,231,254,245,254,12,255,18,255,27,255,37,255,48,255,39,255,26,255,3,255,246,254,3,255,5,255, - 29,255,50,255,83,255,122,255,159,255,196,255,230,255,0,0,32,0,58,0,84,0,109,0,134,0,145,0,145,0,143,0,130,0,136,0,136,0,136,0, - 144,0,162,0,159,0,150,0,143,0,134,0,134,0,122,0,118,0,133,0,139,0,130,0,130,0,130,0,137,0,140,0,133,0,129,0,125,0,107,0, - 97,0,66,0,43,0,21,0,250,255,231,255,245,255,241,255,250,255,10,0,12,0,18,0,250,255,230,255,202,255,183,255,170,255,156,255,155,255,148,255, - 147,255,134,255,112,255,91,255,65,255,41,255,1,255,220,254,184,254,159,254,139,254,144,254,169,254,188,254,210,254,224,254,224,254,216,254,200,254,205,254, - 205,254,209,254,211,254,217,254,232,254,232,254,235,254,238,254,249,254,254,254,7,255,14,255,25,255,33,255,57,255,81,255,102,255,123,255,126,255,133,255, - 140,255,129,255,124,255,126,255,137,255,141,255,156,255,181,255,196,255,220,255,244,255,7,0,29,0,39,0,30,0,25,0,15,0,22,0,22,0,19,0, - 29,0,42,0,47,0,65,0,75,0,82,0,87,0,87,0,94,0,96,0,102,0,109,0,115,0,120,0,126,0,118,0,111,0,104,0,109,0,107,0, - 109,0,122,0,122,0,127,0,137,0,133,0,126,0,102,0,68,0,58,0,43,0,33,0,26,0,26,0,22,0,14,0,252,255,238,255,238,255,246,255, - 3,0,8,0,15,0,32,0,42,0,47,0,55,0,61,0,66,0,79,0,86,0,104,0,116,0,139,0,163,0,201,0,222,0,3,1,42,1,71,1, - 87,1,108,1,128,1,158,1,179,1,196,1,205,1,211,1,215,1,204,1,200,1,175,1,153,1,122,1,97,1,83,1,75,1,83,1,90,1,105,1, - 107,1,119,1,122,1,123,1,126,1,118,1,129,1,137,1,157,1,175,1,172,1,182,1,178,1,173,1,173,1,166,1,161,1,150,1,126,1,82,1, - 36,1,238,0,188,0,154,0,122,0,118,0,108,0,107,0,107,0,108,0,105,0,105,0,89,0,66,0,54,0,47,0,33,0,32,0,24,0,25,0, - 24,0,10,0,8,0,249,255,221,255,185,255,141,255,106,255,79,255,65,255,54,255,58,255,55,255,45,255,30,255,21,255,14,255,234,254,209,254,184,254, - 169,254,138,254,123,254,117,254,113,254,116,254,115,254,119,254,119,254,121,254,121,254,108,254,101,254,96,254,92,254,80,254,60,254,54,254,41,254,30,254, - 45,254,70,254,108,254,137,254,167,254,193,254,220,254,246,254,7,255,25,255,41,255,57,255,63,255,59,255,51,255,45,255,40,255,58,255,73,255,97,255, - 117,255,140,255,169,255,188,255,198,255,206,255,224,255,249,255,24,0,55,0,89,0,125,0,151,0,169,0,175,0,162,0,157,0,144,0,150,0,155,0, - 172,0,186,0,184,0,195,0,195,0,190,0,198,0,193,0,202,0,199,0,191,0,177,0,170,0,166,0,158,0,155,0,151,0,137,0,129,0,118,0, - 101,0,82,0,60,0,40,0,26,0,14,0,7,0,253,255,244,255,248,255,3,0,19,0,33,0,37,0,35,0,29,0,11,0,246,255,231,255,213,255, - 199,255,188,255,167,255,149,255,131,255,102,255,79,255,55,255,27,255,0,255,225,254,193,254,199,254,193,254,203,254,217,254,216,254,223,254,225,254,228,254, - 228,254,229,254,243,254,246,254,253,254,15,255,23,255,43,255,62,255,73,255,84,255,99,255,95,255,104,255,98,255,98,255,93,255,97,255,93,255,109,255, - 116,255,138,255,152,255,167,255,181,255,187,255,195,255,188,255,192,255,199,255,210,255,226,255,235,255,249,255,0,0,8,0,17,0,6,0,253,255,253,255, - 255,255,252,255,7,0,11,0,26,0,30,0,50,0,61,0,68,0,72,0,72,0,68,0,64,0,53,0,62,0,60,0,71,0,80,0,98,0,104,0, - 101,0,109,0,108,0,102,0,94,0,76,0,60,0,55,0,35,0,35,0,32,0,22,0,21,0,11,0,252,255,241,255,231,255,237,255,239,255,255,255, - 19,0,36,0,48,0,47,0,50,0,46,0,32,0,24,0,29,0,36,0,46,0,55,0,82,0,108,0,139,0,162,0,191,0,215,0,238,0,10,1, - 36,1,76,1,112,1,150,1,176,1,184,1,187,1,194,1,193,1,191,1,193,1,189,1,178,1,157,1,135,1,103,1,71,1,54,1,43,1,45,1, - 36,1,46,1,47,1,45,1,46,1,49,1,65,1,93,1,94,1,105,1,126,1,140,1,132,1,128,1,136,1,130,1,118,1,92,1,74,1,36,1, - 0,1,220,0,188,0,150,0,112,0,79,0,51,0,42,0,28,0,24,0,8,0,1,0,252,255,244,255,234,255,235,255,224,255,219,255,223,255,238,255, - 245,255,3,0,7,0,3,0,231,255,210,255,191,255,178,255,154,255,137,255,122,255,98,255,83,255,68,255,43,255,22,255,253,254,234,254,211,254,195,254, - 192,254,170,254,167,254,151,254,139,254,128,254,117,254,108,254,109,254,120,254,123,254,135,254,127,254,108,254,102,254,94,254,81,254,87,254,77,254,77,254, - 80,254,92,254,92,254,115,254,127,254,155,254,185,254,216,254,246,254,19,255,37,255,51,255,52,255,54,255,58,255,51,255,61,255,83,255,119,255,163,255, - 203,255,235,255,250,255,7,0,0,0,241,255,238,255,245,255,6,0,17,0,36,0,72,0,102,0,126,0,145,0,151,0,159,0,162,0,169,0,170,0, - 170,0,170,0,183,0,199,0,220,0,216,0,227,0,222,0,229,0,238,0,229,0,216,0,204,0,181,0,172,0,165,0,150,0,148,0,130,0,111,0, - 93,0,76,0,62,0,46,0,36,0,30,0,26,0,22,0,19,0,14,0,26,0,25,0,26,0,21,0,21,0,22,0,33,0,36,0,30,0,15,0, - 253,255,224,255,194,255,163,255,133,255,116,255,95,255,88,255,77,255,65,255,54,255,44,255,33,255,18,255,1,255,243,254,220,254,214,254,213,254,214,254, - 227,254,239,254,4,255,16,255,32,255,50,255,63,255,76,255,98,255,119,255,147,255,159,255,170,255,190,255,187,255,188,255,159,255,160,255,159,255,155,255, - 158,255,165,255,169,255,185,255,206,255,234,255,242,255,0,0,252,255,234,255,223,255,212,255,202,255,201,255,194,255,212,255,230,255,249,255,11,0,24,0, - 18,0,11,0,1,0,248,255,250,255,10,0,17,0,30,0,57,0,66,0,71,0,79,0,66,0,64,0,54,0,40,0,40,0,36,0,48,0,75,0, - 87,0,97,0,97,0,98,0,82,0,62,0,36,0,11,0,253,255,249,255,10,0,29,0,36,0,29,0,19,0,3,0,245,255,235,255,237,255,241,255, - 250,255,6,0,19,0,28,0,25,0,32,0,35,0,22,0,29,0,28,0,28,0,42,0,53,0,73,0,93,0,112,0,145,0,163,0,188,0,220,0, - 252,0,29,1,51,1,68,1,82,1,100,1,114,1,121,1,132,1,139,1,146,1,137,1,130,1,119,1,110,1,101,1,90,1,76,1,50,1,36,1, - 7,1,249,0,249,0,242,0,242,0,255,0,252,0,11,1,13,1,31,1,32,1,49,1,54,1,53,1,56,1,57,1,56,1,38,1,24,1,6,1, - 242,0,226,0,198,0,177,0,150,0,134,0,109,0,73,0,35,0,7,0,241,255,224,255,210,255,202,255,195,255,196,255,192,255,202,255,212,255,213,255, - 231,255,230,255,231,255,220,255,214,255,209,255,203,255,201,255,191,255,180,255,180,255,172,255,154,255,133,255,102,255,73,255,39,255,5,255,235,254,207,254, - 191,254,185,254,188,254,195,254,181,254,171,254,170,254,153,254,135,254,113,254,91,254,87,254,87,254,92,254,106,254,124,254,133,254,127,254,128,254,113,254, - 103,254,94,254,95,254,112,254,127,254,151,254,169,254,191,254,210,254,223,254,246,254,4,255,37,255,44,255,51,255,61,255,81,255,97,255,133,255,173,255, - 210,255,248,255,24,0,40,0,43,0,40,0,25,0,14,0,12,0,14,0,24,0,35,0,62,0,87,0,101,0,111,0,136,0,150,0,151,0,154,0, - 155,0,165,0,177,0,193,0,206,0,230,0,229,0,230,0,235,0,234,0,227,0,222,0,209,0,215,0,206,0,194,0,179,0,166,0,141,0,122,0, - 104,0,96,0,84,0,76,0,64,0,58,0,53,0,50,0,48,0,42,0,29,0,21,0,11,0,1,0,246,255,235,255,232,255,242,255,244,255,248,255, - 253,255,242,255,221,255,212,255,184,255,165,255,149,255,138,255,129,255,126,255,126,255,134,255,129,255,113,255,99,255,75,255,54,255,40,255,22,255,12,255, - 254,254,253,254,14,255,23,255,25,255,47,255,69,255,99,255,131,255,147,255,176,255,202,255,214,255,230,255,232,255,241,255,248,255,249,255,11,0,11,0, - 14,0,12,0,245,255,238,255,237,255,232,255,224,255,221,255,228,255,245,255,248,255,235,255,231,255,227,255,223,255,213,255,209,255,195,255,201,255,208,255, - 216,255,237,255,246,255,0,0,6,0,4,0,4,0,7,0,10,0,22,0,22,0,36,0,51,0,54,0,57,0,61,0,64,0,61,0,55,0,54,0, - 62,0,61,0,60,0,54,0,47,0,33,0,24,0,7,0,6,0,15,0,15,0,15,0,26,0,29,0,24,0,18,0,12,0,3,0,4,0,249,255, - 253,255,3,0,7,0,10,0,8,0,6,0,6,0,10,0,17,0,35,0,44,0,61,0,89,0,93,0,101,0,114,0,126,0,145,0,169,0,183,0, - 206,0,244,0,14,1,29,1,45,1,45,1,38,1,43,1,54,1,58,1,63,1,57,1,63,1,69,1,74,1,86,1,79,1,81,1,74,1,61,1, - 36,1,17,1,244,0,231,0,219,0,220,0,226,0,238,0,235,0,234,0,233,0,229,0,231,0,241,0,241,0,253,0,245,0,240,0,240,0,230,0, - 226,0,206,0,198,0,183,0,169,0,145,0,126,0,107,0,73,0,48,0,26,0,242,255,213,255,201,255,190,255,185,255,184,255,185,255,180,255,190,255, - 206,255,209,255,201,255,187,255,166,255,165,255,156,255,165,255,162,255,165,255,180,255,178,255,167,255,159,255,142,255,112,255,91,255,61,255,29,255,1,255, - 229,254,214,254,188,254,171,254,169,254,153,254,151,254,146,254,135,254,126,254,113,254,112,254,109,254,102,254,96,254,102,254,126,254,135,254,145,254,148,254, - 145,254,144,254,149,254,151,254,138,254,146,254,155,254,167,254,188,254,196,254,207,254,224,254,235,254,7,255,34,255,61,255,91,255,129,255,165,255,201,255, - 226,255,241,255,0,0,8,0,19,0,17,0,17,0,33,0,37,0,47,0,53,0,62,0,69,0,79,0,97,0,91,0,105,0,116,0,118,0,129,0, - 137,0,147,0,162,0,177,0,186,0,195,0,195,0,195,0,205,0,201,0,208,0,205,0,204,0,206,0,198,0,191,0,186,0,187,0,175,0,168,0, - 152,0,133,0,111,0,107,0,104,0,100,0,84,0,76,0,55,0,43,0,28,0,17,0,7,0,10,0,248,255,248,255,241,255,242,255,234,255,219,255, - 212,255,202,255,191,255,185,255,185,255,169,255,170,255,174,255,177,255,181,255,188,255,187,255,174,255,160,255,151,255,134,255,124,255,105,255,104,255,94,255, - 73,255,61,255,50,255,45,255,44,255,79,255,81,255,93,255,113,255,133,255,160,255,187,255,209,255,234,255,244,255,252,255,15,0,40,0,55,0,71,0, - 89,0,80,0,83,0,64,0,44,0,17,0,253,255,239,255,228,255,221,255,216,255,221,255,219,255,234,255,237,255,234,255,230,255,220,255,220,255,212,255, - 198,255,191,255,194,255,206,255,212,255,238,255,250,255,12,0,24,0,25,0,22,0,19,0,14,0,11,0,15,0,25,0,35,0,43,0,51,0,61,0, - 61,0,53,0,40,0,21,0,12,0,3,0,253,255,6,0,14,0,32,0,26,0,25,0,22,0,22,0,6,0,255,255,252,255,0,0,0,0,3,0, - 7,0,7,0,11,0,6,0,1,0,255,255,250,255,249,255,255,255,18,0,39,0,53,0,84,0,107,0,120,0,127,0,137,0,150,0,158,0,173,0, - 186,0,197,0,217,0,229,0,244,0,255,0,4,1,17,1,27,1,27,1,28,1,15,1,15,1,25,1,38,1,42,1,57,1,58,1,63,1,51,1, - 40,1,29,1,17,1,255,0,237,0,226,0,216,0,209,0,205,0,201,0,193,0,187,0,175,0,169,0,166,0,162,0,162,0,162,0,165,0,168,0, - 168,0,173,0,172,0,158,0,150,0,139,0,133,0,129,0,123,0,114,0,100,0,72,0,47,0,3,0,227,255,203,255,192,255,195,255,185,255,187,255, - 180,255,173,255,170,255,162,255,152,255,145,255,138,255,134,255,133,255,129,255,144,255,148,255,156,255,147,255,145,255,141,255,136,255,115,255,81,255,57,255, - 33,255,4,255,231,254,203,254,182,254,171,254,170,254,174,254,173,254,171,254,166,254,163,254,151,254,134,254,127,254,127,254,133,254,139,254,141,254,151,254, - 151,254,156,254,152,254,156,254,167,254,177,254,184,254,196,254,207,254,205,254,216,254,227,254,241,254,4,255,30,255,57,255,97,255,130,255,169,255,191,255, - 206,255,210,255,213,255,210,255,213,255,216,255,220,255,234,255,11,0,37,0,68,0,90,0,102,0,102,0,119,0,120,0,118,0,122,0,109,0,104,0, - 120,0,127,0,143,0,151,0,162,0,175,0,186,0,191,0,188,0,191,0,198,0,206,0,212,0,220,0,226,0,216,0,205,0,195,0,180,0,172,0, - 162,0,157,0,151,0,148,0,133,0,119,0,107,0,89,0,73,0,65,0,47,0,33,0,15,0,4,0,255,255,246,255,241,255,235,255,223,255,208,255, - 210,255,202,255,195,255,184,255,181,255,177,255,173,255,174,255,177,255,173,255,188,255,191,255,192,255,198,255,194,255,184,255,173,255,166,255,158,255,154,255, - 154,255,142,255,134,255,127,255,123,255,126,255,116,255,129,255,129,255,144,255,158,255,177,255,195,255,206,255,228,255,249,255,14,0,36,0,51,0,69,0, - 83,0,79,0,82,0,79,0,66,0,58,0,51,0,42,0,24,0,4,0,244,255,238,255,234,255,227,255,227,255,228,255,231,255,228,255,221,255,216,255, - 216,255,205,255,196,255,191,255,192,255,192,255,203,255,214,255,235,255,245,255,3,0,17,0,14,0,14,0,253,255,253,255,252,255,244,255,250,255,7,0, - 17,0,26,0,24,0,26,0,18,0,14,0,8,0,4,0,0,0,255,255,3,0,0,0,1,0,0,0,255,255,1,0,1,0,0,0,7,0,8,0, - 11,0,14,0,17,0,11,0,3,0,7,0,1,0,1,0,11,0,17,0,37,0,51,0,60,0,68,0,78,0,87,0,116,0,137,0,150,0,163,0, - 173,0,179,0,186,0,197,0,195,0,199,0,209,0,220,0,219,0,229,0,222,0,231,0,231,0,241,0,242,0,247,0,0,1,3,1,253,0,4,1, - 13,1,13,1,13,1,3,1,4,1,0,1,235,0,216,0,202,0,197,0,180,0,172,0,162,0,147,0,133,0,114,0,105,0,89,0,80,0,78,0, - 72,0,84,0,101,0,114,0,118,0,122,0,130,0,125,0,118,0,107,0,93,0,71,0,57,0,40,0,21,0,252,255,220,255,198,255,181,255,173,255, - 159,255,163,255,156,255,148,255,140,255,129,255,120,255,109,255,105,255,104,255,102,255,104,255,112,255,109,255,112,255,111,255,101,255,90,255,68,255,47,255, - 29,255,8,255,254,254,252,254,239,254,235,254,227,254,223,254,216,254,213,254,216,254,210,254,196,254,184,254,167,254,149,254,137,254,130,254,128,254,138,254, - 135,254,135,254,139,254,149,254,160,254,178,254,195,254,209,254,220,254,232,254,241,254,253,254,1,255,14,255,39,255,59,255,94,255,120,255,138,255,166,255, - 183,255,194,255,199,255,202,255,201,255,212,255,216,255,221,255,245,255,7,0,26,0,55,0,97,0,134,0,157,0,172,0,172,0,161,0,145,0,123,0, - 108,0,105,0,111,0,129,0,152,0,172,0,206,0,223,0,230,0,224,0,223,0,209,0,197,0,194,0,188,0,197,0,191,0,197,0,195,0,201,0, - 184,0,188,0,184,0,179,0,166,0,150,0,137,0,129,0,108,0,91,0,78,0,66,0,57,0,46,0,33,0,22,0,7,0,249,255,237,255,216,255, - 202,255,192,255,192,255,192,255,201,255,212,255,210,255,209,255,209,255,206,255,203,255,201,255,205,255,210,255,213,255,223,255,227,255,230,255,221,255,213,255, - 208,255,196,255,199,255,212,255,208,255,217,255,216,255,219,255,220,255,209,255,208,255,212,255,206,255,205,255,219,255,235,255,253,255,11,0,28,0,35,0, - 44,0,46,0,54,0,61,0,60,0,60,0,53,0,40,0,39,0,32,0,26,0,18,0,17,0,11,0,3,0,253,255,239,255,237,255,231,255,231,255, - 220,255,216,255,209,255,208,255,206,255,214,255,216,255,216,255,223,255,221,255,230,255,232,255,234,255,244,255,250,255,3,0,252,255,255,255,246,255,248,255, - 255,255,0,0,4,0,11,0,17,0,19,0,28,0,22,0,21,0,22,0,24,0,14,0,19,0,22,0,24,0,25,0,17,0,28,0,21,0,28,0, - 36,0,33,0,32,0,35,0,32,0,32,0,30,0,29,0,32,0,42,0,53,0,53,0,57,0,69,0,75,0,86,0,93,0,109,0,123,0,139,0, - 158,0,169,0,175,0,193,0,198,0,201,0,204,0,201,0,206,0,201,0,206,0,202,0,217,0,223,0,222,0,217,0,216,0,220,0,217,0,222,0, - 222,0,216,0,220,0,229,0,226,0,231,0,219,0,206,0,201,0,170,0,152,0,133,0,107,0,91,0,80,0,64,0,58,0,53,0,46,0,53,0, - 57,0,61,0,60,0,60,0,71,0,71,0,69,0,62,0,60,0,54,0,50,0,43,0,28,0,18,0,10,0,255,255,239,255,216,255,202,255,183,255, - 176,255,176,255,166,255,162,255,155,255,147,255,144,255,136,255,120,255,99,255,83,255,66,255,63,255,62,255,58,255,55,255,54,255,58,255,57,255,55,255, - 39,255,32,255,26,255,23,255,5,255,7,255,253,254,14,255,8,255,9,255,4,255,253,254,239,254,223,254,205,254,191,254,180,254,166,254,169,254,169,254, - 166,254,167,254,173,254,174,254,170,254,175,254,177,254,184,254,199,254,210,254,223,254,239,254,4,255,15,255,40,255,62,255,77,255,91,255,101,255,115,255, - 126,255,140,255,159,255,176,255,190,255,210,255,223,255,235,255,244,255,0,0,11,0,26,0,46,0,60,0,84,0,102,0,125,0,141,0,162,0,159,0, - 155,0,141,0,133,0,143,0,151,0,166,0,190,0,205,0,219,0,224,0,226,0,216,0,206,0,199,0,191,0,186,0,180,0,172,0,172,0,169,0, - 180,0,179,0,177,0,180,0,175,0,165,0,154,0,144,0,132,0,111,0,96,0,86,0,80,0,79,0,72,0,57,0,40,0,19,0,253,255,244,255, - 224,255,220,255,217,255,203,255,212,255,220,255,217,255,223,255,227,255,232,255,232,255,228,255,230,255,224,255,234,255,230,255,234,255,237,255,244,255,252,255, - 3,0,12,0,14,0,12,0,6,0,255,255,0,0,246,255,245,255,248,255,239,255,235,255,245,255,248,255,0,0,6,0,11,0,6,0,14,0,6,0, - 17,0,28,0,29,0,29,0,36,0,32,0,26,0,26,0,17,0,18,0,21,0,14,0,15,0,12,0,3,0,7,0,253,255,237,255,223,255,210,255, - 213,255,213,255,208,255,210,255,199,255,194,255,194,255,194,255,190,255,194,255,201,255,210,255,217,255,230,255,230,255,231,255,234,255,235,255,235,255,232,255, - 235,255,238,255,245,255,255,255,8,0,18,0,25,0,21,0,19,0,19,0,28,0,33,0,47,0,47,0,55,0,66,0,62,0,60,0,55,0,54,0, - 53,0,50,0,51,0,51,0,54,0,55,0,61,0,54,0,42,0,30,0,18,0,28,0,26,0,43,0,55,0,73,0,83,0,94,0,108,0,116,0, - 137,0,144,0,161,0,175,0,186,0,198,0,197,0,194,0,197,0,193,0,197,0,197,0,205,0,201,0,205,0,204,0,199,0,193,0,186,0,198,0, - 204,0,193,0,193,0,187,0,187,0,180,0,173,0,170,0,168,0,155,0,140,0,112,0,91,0,60,0,39,0,28,0,32,0,33,0,43,0,47,0, - 47,0,44,0,32,0,29,0,12,0,10,0,255,255,0,0,1,0,245,255,246,255,241,255,244,255,244,255,237,255,227,255,227,255,216,255,208,255,199,255, - 185,255,173,255,165,255,160,255,163,255,156,255,154,255,142,255,129,255,106,255,83,255,62,255,41,255,36,255,27,255,30,255,32,255,41,255,41,255,50,255, - 50,255,62,255,52,255,44,255,51,255,40,255,41,255,36,255,34,255,27,255,18,255,12,255,4,255,253,254,250,254,243,254,234,254,223,254,210,254,206,254, - 210,254,216,254,217,254,207,254,203,254,193,254,198,254,195,254,200,254,223,254,231,254,250,254,15,255,33,255,40,255,52,255,65,255,73,255,73,255,81,255, - 98,255,116,255,144,255,170,255,184,255,209,255,228,255,245,255,252,255,14,0,19,0,29,0,30,0,42,0,57,0,73,0,101,0,122,0,147,0,175,0, - 193,0,208,0,209,0,205,0,194,0,191,0,194,0,201,0,205,0,217,0,220,0,227,0,224,0,213,0,202,0,191,0,188,0,190,0,191,0,195,0, - 194,0,186,0,180,0,181,0,177,0,176,0,162,0,166,0,151,0,143,0,127,0,122,0,109,0,97,0,82,0,66,0,58,0,47,0,25,0,15,0, - 6,0,0,0,252,255,242,255,228,255,216,255,212,255,219,255,228,255,230,255,238,255,244,255,0,0,248,255,241,255,242,255,238,255,248,255,250,255,3,0, - 17,0,25,0,21,0,30,0,29,0,35,0,32,0,35,0,29,0,21,0,14,0,10,0,11,0,15,0,25,0,21,0,24,0,26,0,22,0,24,0, - 18,0,14,0,8,0,8,0,255,255,3,0,7,0,15,0,21,0,18,0,25,0,35,0,36,0,35,0,28,0,19,0,10,0,249,255,238,255,221,255, - 219,255,214,255,209,255,195,255,190,255,178,255,169,255,169,255,167,255,167,255,184,255,201,255,216,255,227,255,239,255,235,255,230,255,220,255,217,255,217,255, - 223,255,242,255,250,255,0,0,14,0,22,0,26,0,25,0,26,0,25,0,24,0,28,0,37,0,50,0,65,0,69,0,90,0,93,0,98,0,98,0, - 89,0,80,0,78,0,75,0,69,0,72,0,65,0,61,0,48,0,37,0,30,0,25,0,28,0,26,0,36,0,47,0,57,0,71,0,79,0,91,0, - 107,0,122,0,140,0,143,0,145,0,152,0,155,0,158,0,172,0,181,0,172,0,176,0,170,0,175,0,169,0,180,0,176,0,175,0,179,0,168,0, - 173,0,175,0,168,0,158,0,150,0,145,0,133,0,119,0,102,0,93,0,76,0,72,0,57,0,54,0,53,0,39,0,36,0,32,0,22,0,15,0, - 11,0,10,0,1,0,241,255,227,255,209,255,191,255,183,255,174,255,169,255,176,255,183,255,185,255,183,255,185,255,195,255,198,255,190,255,190,255,187,255, - 178,255,177,255,173,255,176,255,177,255,158,255,144,255,119,255,94,255,75,255,59,255,55,255,51,255,48,255,50,255,32,255,26,255,18,255,26,255,33,255, - 47,255,55,255,59,255,59,255,73,255,69,255,59,255,50,255,45,255,41,255,37,255,33,255,27,255,21,255,23,255,23,255,19,255,22,255,12,255,9,255, - 8,255,0,255,247,254,236,254,234,254,223,254,220,254,214,254,218,254,227,254,229,254,247,254,0,255,12,255,23,255,25,255,26,255,40,255,48,255,61,255, - 70,255,91,255,116,255,142,255,167,255,191,255,208,255,224,255,238,255,252,255,14,0,22,0,36,0,46,0,60,0,79,0,96,0,104,0,123,0,141,0, - 173,0,186,0,201,0,213,0,230,0,237,0,231,0,229,0,215,0,202,0,194,0,187,0,193,0,202,0,215,0,215,0,212,0,201,0,201,0,204,0, - 201,0,191,0,188,0,186,0,190,0,183,0,175,0,169,0,166,0,159,0,148,0,139,0,140,0,120,0,105,0,86,0,76,0,62,0,57,0,46,0, - 44,0,35,0,28,0,12,0,6,0,252,255,252,255,241,255,239,255,244,255,244,255,248,255,0,0,10,0,12,0,25,0,37,0,42,0,46,0,48,0, - 37,0,30,0,30,0,35,0,35,0,40,0,44,0,47,0,58,0,72,0,71,0,72,0,65,0,58,0,51,0,42,0,39,0,37,0,29,0,30,0, - 35,0,28,0,15,0,17,0,12,0,12,0,14,0,17,0,24,0,29,0,33,0,37,0,36,0,28,0,24,0,24,0,12,0,4,0,253,255,239,255, - 226,255,219,255,202,255,198,255,198,255,199,255,194,255,190,255,187,255,190,255,190,255,191,255,187,255,198,255,195,255,201,255,209,255,217,255,227,255,237,255, - 239,255,244,255,250,255,255,255,0,0,10,0,17,0,29,0,39,0,47,0,43,0,54,0,57,0,62,0,78,0,82,0,94,0,100,0,104,0,98,0, - 102,0,97,0,96,0,84,0,82,0,76,0,68,0,64,0,60,0,54,0,57,0,50,0,51,0,46,0,42,0,40,0,37,0,47,0,51,0,65,0, - 79,0,83,0,101,0,111,0,125,0,139,0,148,0,148,0,152,0,155,0,157,0,161,0,162,0,165,0,169,0,173,0,176,0,175,0,172,0,165,0, - 161,0,152,0,148,0,139,0,134,0,126,0,114,0,94,0,76,0,61,0,54,0,39,0,39,0,46,0,39,0,40,0,33,0,29,0,22,0,4,0, - 241,255,216,255,203,255,188,255,173,255,172,255,159,255,165,255,159,255,145,255,145,255,145,255,142,255,134,255,136,255,144,255,151,255,165,255,163,255,162,255, - 158,255,154,255,156,255,144,255,136,255,123,255,119,255,108,255,95,255,86,255,79,255,81,255,73,255,63,255,61,255,57,255,54,255,48,255,51,255,54,255, - 44,255,43,255,47,255,44,255,48,255,57,255,62,255,68,255,63,255,59,255,54,255,54,255,55,255,57,255,58,255,62,255,54,255,61,255,65,255,58,255, - 50,255,36,255,23,255,9,255,8,255,3,255,1,255,7,255,7,255,3,255,0,255,243,254,242,254,239,254,1,255,14,255,26,255,43,255,57,255,70,255, - 84,255,81,255,101,255,112,255,133,255,147,255,165,255,177,255,194,255,201,255,224,255,234,255,6,0,30,0,51,0,72,0,93,0,109,0,123,0,125,0, - 141,0,151,0,175,0,186,0,205,0,219,0,234,0,235,0,230,0,220,0,213,0,209,0,202,0,204,0,201,0,209,0,216,0,216,0,213,0,204,0, - 206,0,194,0,183,0,184,0,179,0,186,0,181,0,173,0,165,0,155,0,147,0,130,0,125,0,129,0,122,0,120,0,119,0,105,0,107,0,89,0, - 78,0,66,0,51,0,46,0,40,0,35,0,33,0,25,0,17,0,15,0,14,0,11,0,4,0,15,0,25,0,22,0,21,0,28,0,26,0,35,0, - 33,0,39,0,36,0,35,0,29,0,32,0,37,0,40,0,53,0,65,0,78,0,79,0,79,0,83,0,86,0,72,0,68,0,62,0,46,0,36,0, - 40,0,37,0,42,0,37,0,42,0,62,0,55,0,57,0,60,0,55,0,55,0,46,0,43,0,33,0,28,0,19,0,17,0,253,255,245,255,244,255, - 234,255,220,255,208,255,208,255,201,255,201,255,205,255,205,255,216,255,216,255,212,255,203,255,191,255,187,255,178,255,177,255,183,255,196,255,208,255,227,255, - 237,255,252,255,255,255,253,255,252,255,4,0,11,0,15,0,26,0,28,0,47,0,61,0,69,0,80,0,83,0,80,0,75,0,79,0,78,0,68,0, - 75,0,75,0,80,0,86,0,83,0,89,0,86,0,84,0,84,0,78,0,71,0,69,0,61,0,58,0,54,0,46,0,50,0,51,0,48,0,50,0, - 58,0,61,0,72,0,75,0,87,0,94,0,100,0,114,0,119,0,122,0,126,0,136,0,137,0,152,0,151,0,158,0,154,0,155,0,158,0,157,0, - 155,0,151,0,147,0,139,0,122,0,97,0,91,0,68,0,65,0,53,0,43,0,32,0,30,0,26,0,30,0,30,0,22,0,30,0,17,0,253,255, - 237,255,214,255,194,255,172,255,165,255,155,255,149,255,145,255,144,255,148,255,138,255,133,255,124,255,120,255,123,255,126,255,117,255,122,255,115,255,117,255, - 117,255,117,255,116,255,115,255,115,255,117,255,120,255,126,255,133,255,127,255,123,255,115,255,104,255,95,255,81,255,91,255,90,255,80,255,81,255,75,255, - 70,255,63,255,61,255,55,255,47,255,43,255,52,255,54,255,65,255,66,255,81,255,81,255,80,255,75,255,81,255,83,255,75,255,79,255,73,255,68,255, - 55,255,47,255,39,255,26,255,25,255,15,255,19,255,12,255,22,255,23,255,21,255,9,255,3,255,252,254,252,254,250,254,1,255,14,255,23,255,36,255, - 43,255,55,255,69,255,88,255,104,255,116,255,126,255,130,255,155,255,177,255,198,255,221,255,238,255,7,0,29,0,50,0,69,0,97,0,114,0,126,0, - 139,0,140,0,145,0,161,0,170,0,179,0,195,0,201,0,212,0,219,0,222,0,217,0,213,0,206,0,211,0,211,0,206,0,205,0,215,0,223,0, - 220,0,223,0,205,0,198,0,187,0,184,0,175,0,169,0,162,0,159,0,154,0,143,0,134,0,129,0,127,0,126,0,122,0,130,0,122,0,119,0, - 104,0,94,0,80,0,75,0,61,0,51,0,51,0,42,0,37,0,37,0,35,0,30,0,25,0,30,0,24,0,33,0,30,0,25,0,25,0,28,0, - 29,0,36,0,37,0,44,0,58,0,71,0,73,0,75,0,78,0,75,0,71,0,76,0,71,0,76,0,82,0,72,0,76,0,64,0,51,0,48,0, - 43,0,42,0,39,0,50,0,58,0,64,0,73,0,79,0,80,0,71,0,55,0,50,0,46,0,28,0,24,0,19,0,12,0,7,0,253,255,245,255, - 231,255,223,255,223,255,216,255,219,255,216,255,223,255,224,255,221,255,213,255,202,255,195,255,187,255,178,255,183,255,184,255,181,255,185,255,191,255,202,255, - 212,255,226,255,232,255,252,255,1,0,8,0,11,0,18,0,25,0,29,0,46,0,53,0,60,0,58,0,54,0,54,0,54,0,57,0,51,0,60,0, - 60,0,60,0,68,0,61,0,62,0,73,0,76,0,76,0,82,0,83,0,75,0,71,0,60,0,55,0,46,0,47,0,47,0,51,0,54,0,60,0, - 47,0,51,0,53,0,55,0,58,0,55,0,68,0,79,0,89,0,97,0,104,0,120,0,132,0,134,0,141,0,139,0,140,0,139,0,148,0,148,0, - 140,0,136,0,125,0,116,0,96,0,91,0,78,0,66,0,51,0,46,0,40,0,32,0,26,0,14,0,10,0,6,0,0,0,245,255,232,255,219,255, - 205,255,184,255,170,255,165,255,156,255,158,255,154,255,141,255,142,255,138,255,129,255,129,255,130,255,124,255,117,255,101,255,91,255,97,255,91,255,95,255, - 98,255,99,255,108,255,115,255,116,255,124,255,129,255,129,255,129,255,138,255,140,255,140,255,136,255,140,255,141,255,142,255,126,255,119,255,117,255,109,255, - 109,255,94,255,83,255,81,255,75,255,72,255,65,255,69,255,66,255,68,255,70,255,76,255,76,255,87,255,97,255,94,255,91,255,80,255,77,255,77,255, - 70,255,73,255,66,255,63,255,63,255,50,255,40,255,30,255,25,255,19,255,26,255,32,255,18,255,21,255,14,255,8,255,9,255,14,255,21,255,32,255, - 47,255,57,255,73,255,90,255,106,255,116,255,123,255,136,255,147,255,163,255,183,255,202,255,234,255,6,0,18,0,33,0,54,0,65,0,87,0,97,0, - 116,0,134,0,144,0,154,0,152,0,161,0,169,0,175,0,191,0,212,0,217,0,227,0,219,0,222,0,212,0,204,0,213,0,209,0,213,0,212,0, - 212,0,211,0,208,0,204,0,193,0,181,0,173,0,166,0,154,0,148,0,141,0,140,0,133,0,125,0,129,0,123,0,132,0,118,0,127,0,120,0, - 120,0,118,0,108,0,105,0,94,0,84,0,71,0,61,0,60,0,50,0,61,0,47,0,46,0,40,0,40,0,32,0,40,0,39,0,30,0,32,0, - 28,0,29,0,35,0,48,0,61,0,61,0,66,0,79,0,83,0,83,0,78,0,75,0,60,0,62,0,58,0,61,0,64,0,66,0,68,0,68,0, - 66,0,68,0,72,0,73,0,73,0,76,0,79,0,83,0,83,0,82,0,72,0,66,0,58,0,57,0,48,0,35,0,32,0,15,0,18,0,10,0, - 248,255,253,255,245,255,239,255,235,255,230,255,231,255,228,255,226,255,216,255,206,255,198,255,187,255,181,255,184,255,187,255,190,255,194,255,198,255,206,255, - 216,255,227,255,241,255,245,255,253,255,8,0,19,0,29,0,33,0,33,0,29,0,26,0,17,0,17,0,22,0,15,0,22,0,36,0,33,0,35,0, - 44,0,50,0,61,0,64,0,75,0,78,0,83,0,79,0,79,0,76,0,80,0,79,0,79,0,82,0,73,0,68,0,65,0,55,0,57,0,44,0, - 48,0,43,0,48,0,51,0,57,0,53,0,51,0,48,0,55,0,72,0,84,0,96,0,107,0,115,0,119,0,119,0,130,0,130,0,133,0,136,0, - 136,0,127,0,123,0,104,0,93,0,83,0,73,0,62,0,48,0,47,0,33,0,26,0,14,0,255,255,250,255,246,255,226,255,206,255,180,255,180,255, - 170,255,170,255,170,255,162,255,159,255,155,255,147,255,148,255,136,255,124,255,116,255,111,255,104,255,97,255,91,255,97,255,95,255,97,255,97,255,91,255, - 87,255,88,255,97,255,98,255,101,255,112,255,116,255,116,255,120,255,126,255,129,255,148,255,160,255,173,255,176,255,178,255,172,255,170,255,162,255,152,255, - 136,255,120,255,111,255,116,255,111,255,106,255,111,255,108,255,97,255,94,255,88,255,84,255,87,255,86,255,87,255,93,255,97,255,98,255,87,255,88,255, - 86,255,87,255,88,255,91,255,91,255,80,255,80,255,70,255,55,255,36,255,37,255,48,255,40,255,44,255,41,255,40,255,41,255,44,255,36,255,40,255, - 52,255,63,255,73,255,90,255,98,255,106,255,123,255,129,255,149,255,160,255,178,255,198,255,221,255,237,255,6,0,21,0,25,0,43,0,54,0,75,0, - 98,0,107,0,115,0,125,0,126,0,143,0,155,0,163,0,175,0,191,0,209,0,213,0,206,0,211,0,213,0,205,0,208,0,209,0,215,0,212,0, - 215,0,215,0,213,0,198,0,188,0,177,0,163,0,150,0,150,0,139,0,144,0,145,0,144,0,141,0,145,0,139,0,139,0,136,0,133,0,123,0, - 126,0,111,0,104,0,105,0,98,0,91,0,84,0,75,0,62,0,55,0,48,0,51,0,48,0,42,0,44,0,40,0,37,0,42,0,35,0,28,0, - 29,0,32,0,39,0,39,0,51,0,72,0,69,0,79,0,86,0,82,0,84,0,87,0,83,0,72,0,66,0,55,0,58,0,61,0,62,0,62,0, - 84,0,83,0,80,0,82,0,72,0,65,0,65,0,69,0,71,0,69,0,71,0,68,0,64,0,66,0,66,0,66,0,65,0,57,0,44,0,28,0, - 17,0,8,0,8,0,7,0,252,255,248,255,239,255,232,255,221,255,213,255,205,255,198,255,202,255,202,255,201,255,202,255,208,255,209,255,203,255,206,255, - 210,255,223,255,234,255,237,255,242,255,245,255,252,255,6,0,253,255,1,0,12,0,1,0,8,0,4,0,4,0,3,0,11,0,17,0,21,0,26,0, - 30,0,35,0,48,0,61,0,64,0,58,0,58,0,54,0,54,0,57,0,58,0,54,0,60,0,65,0,62,0,65,0,64,0,65,0,55,0,55,0, - 47,0,43,0,37,0,35,0,26,0,28,0,29,0,26,0,26,0,37,0,46,0,53,0,69,0,82,0,86,0,93,0,100,0,111,0,118,0,109,0, - 105,0,101,0,96,0,84,0,72,0,72,0,62,0,51,0,36,0,26,0,21,0,11,0,6,0,248,255,232,255,220,255,203,255,183,255,177,255,160,255, - 154,255,148,255,149,255,151,255,154,255,141,255,133,255,123,255,115,255,120,255,113,255,112,255,112,255,104,255,101,255,95,255,94,255,88,255,90,255,90,255, - 86,255,90,255,88,255,95,255,102,255,104,255,108,255,115,255,111,255,122,255,131,255,149,255,170,255,181,255,187,255,192,255,196,255,195,255,202,255,194,255, - 192,255,180,255,169,255,162,255,155,255,147,255,142,255,134,255,133,255,123,255,120,255,109,255,98,255,91,255,93,255,93,255,80,255,80,255,84,255,93,255, - 98,255,102,255,111,255,116,255,112,255,109,255,97,255,87,255,70,255,58,255,47,255,37,255,34,255,39,255,50,255,63,255,66,255,70,255,76,255,79,255, - 87,255,86,255,95,255,102,255,111,255,127,255,144,255,156,255,167,255,176,255,195,255,216,255,227,255,244,255,250,255,4,0,14,0,22,0,35,0,42,0, - 48,0,65,0,75,0,79,0,94,0,111,0,119,0,144,0,144,0,163,0,175,0,180,0,186,0,194,0,195,0,197,0,198,0,202,0,208,0,206,0, - 209,0,206,0,204,0,199,0,190,0,180,0,161,0,150,0,139,0,139,0,143,0,145,0,150,0,147,0,150,0,148,0,147,0,136,0,114,0,112,0, - 119,0,112,0,107,0,105,0,100,0,91,0,84,0,72,0,69,0,60,0,68,0,62,0,58,0,58,0,54,0,43,0,43,0,43,0,43,0,36,0, - 39,0,36,0,42,0,48,0,55,0,53,0,65,0,62,0,72,0,78,0,76,0,71,0,73,0,80,0,72,0,66,0,64,0,65,0,64,0,65,0, - 65,0,61,0,62,0,73,0,69,0,71,0,80,0,86,0,84,0,91,0,93,0,97,0,96,0,93,0,83,0,86,0,76,0,66,0,64,0,57,0, - 42,0,36,0,25,0,25,0,15,0,12,0,4,0,245,255,242,255,235,255,230,255,228,255,226,255,226,255,230,255,227,255,234,255,227,255,220,255,231,255, - 235,255,230,255,231,255,238,255,235,255,238,255,241,255,238,255,242,255,248,255,241,255,242,255,237,255,237,255,244,255,250,255,253,255,1,0,14,0,22,0, - 25,0,30,0,37,0,47,0,55,0,39,0,43,0,47,0,47,0,54,0,64,0,58,0,61,0,65,0,64,0,53,0,57,0,54,0,57,0,55,0, - 42,0,37,0,43,0,32,0,22,0,12,0,10,0,17,0,26,0,40,0,42,0,48,0,46,0,61,0,61,0,65,0,76,0,75,0,82,0,75,0, - 73,0,79,0,71,0,61,0,58,0,47,0,44,0,40,0,32,0,25,0,14,0,6,0,245,255,226,255,214,255,203,255,190,255,174,255,165,255,148,255, - 142,255,137,255,137,255,126,255,123,255,120,255,113,255,104,255,102,255,95,255,98,255,95,255,97,255,99,255,109,255,102,255,104,255,95,255,97,255,94,255, - 95,255,94,255,97,255,98,255,104,255,106,255,115,255,119,255,119,255,133,255,144,255,149,255,165,255,174,255,191,255,198,255,209,255,208,255,205,255,205,255, - 203,255,195,255,194,255,194,255,190,255,178,255,167,255,156,255,154,255,136,255,130,255,123,255,120,255,117,255,105,255,98,255,91,255,88,255,87,255,90,255, - 99,255,105,255,113,255,122,255,126,255,120,255,122,255,115,255,105,255,95,255,86,255,77,255,72,255,72,255,61,255,68,255,68,255,80,255,87,255,104,255, - 98,255,109,255,109,255,115,255,127,255,134,255,149,255,169,255,183,255,199,255,214,255,223,255,227,255,239,255,239,255,253,255,7,0,11,0,17,0,29,0, - 35,0,40,0,43,0,55,0,68,0,72,0,82,0,93,0,115,0,127,0,136,0,150,0,161,0,172,0,181,0,184,0,193,0,187,0,184,0,184,0, - 176,0,181,0,183,0,183,0,181,0,173,0,170,0,159,0,147,0,130,0,130,0,133,0,136,0,134,0,141,0,134,0,130,0,129,0,120,0,107,0, - 107,0,100,0,100,0,96,0,94,0,80,0,80,0,76,0,69,0,65,0,62,0,65,0,71,0,72,0,68,0,69,0,66,0,66,0,53,0,47,0, - 44,0,55,0,54,0,53,0,51,0,54,0,51,0,53,0,64,0,71,0,64,0,57,0,64,0,69,0,76,0,80,0,73,0,69,0,64,0,62,0, - 53,0,53,0,50,0,58,0,66,0,66,0,80,0,89,0,100,0,100,0,109,0,116,0,118,0,114,0,107,0,108,0,96,0,101,0,78,0,78,0, - 66,0,71,0,69,0,55,0,46,0,39,0,22,0,10,0,253,255,245,255,237,255,235,255,237,255,241,255,244,255,242,255,249,255,242,255,238,255,237,255, - 234,255,237,255,238,255,224,255,228,255,230,255,232,255,231,255,231,255,230,255,230,255,242,255,237,255,241,255,239,255,245,255,255,255,1,0,3,0,14,0, - 22,0,25,0,29,0,28,0,35,0,33,0,40,0,37,0,36,0,29,0,29,0,26,0,37,0,43,0,46,0,53,0,61,0,60,0,64,0,55,0, - 48,0,44,0,39,0,29,0,24,0,29,0,29,0,33,0,26,0,36,0,36,0,37,0,48,0,50,0,50,0,50,0,51,0,54,0,51,0,53,0, - 57,0,51,0,48,0,43,0,42,0,35,0,26,0,26,0,24,0,18,0,8,0,0,0,238,255,227,255,217,255,199,255,192,255,184,255,173,255,169,255, - 155,255,141,255,130,255,120,255,119,255,115,255,117,255,115,255,116,255,112,255,113,255,106,255,109,255,109,255,109,255,119,255,123,255,129,255,131,255,130,255, - 126,255,124,255,108,255,111,255,119,255,120,255,123,255,133,255,144,255,147,255,149,255,156,255,163,255,178,255,180,255,185,255,191,255,201,255,209,255,217,255, - 217,255,221,255,221,255,223,255,219,255,212,255,202,255,188,255,183,255,169,255,154,255,140,255,129,255,130,255,123,255,123,255,122,255,117,255,115,255,111,255, - 117,255,117,255,116,255,111,255,120,255,119,255,126,255,117,255,113,255,113,255,116,255,106,255,106,255,94,255,93,255,98,255,94,255,102,255,102,255,120,255, - 117,255,117,255,131,255,137,255,142,255,151,255,159,255,173,255,185,255,194,255,199,255,217,255,226,255,227,255,242,255,252,255,3,0,12,0,8,0,18,0, - 22,0,32,0,37,0,43,0,53,0,55,0,68,0,72,0,82,0,93,0,100,0,109,0,120,0,141,0,144,0,169,0,168,0,168,0,165,0,168,0, - 159,0,154,0,148,0,158,0,162,0,170,0,161,0,165,0,158,0,148,0,141,0,134,0,132,0,125,0,127,0,115,0,116,0,120,0,108,0,94,0, - 86,0,89,0,80,0,76,0,71,0,64,0,64,0,60,0,62,0,65,0,58,0,58,0,65,0,65,0,66,0,75,0,69,0,72,0,79,0,73,0, - 66,0,61,0,60,0,54,0,62,0,61,0,65,0,54,0,55,0,50,0,53,0,50,0,44,0,42,0,43,0,48,0,51,0,50,0,54,0,53,0, - 57,0,58,0,50,0,46,0,51,0,51,0,55,0,68,0,80,0,89,0,100,0,107,0,118,0,127,0,120,0,108,0,105,0,97,0,80,0,71,0, - 64,0,66,0,76,0,69,0,75,0,69,0,60,0,46,0,30,0,19,0,1,0,248,255,244,255,242,255,241,255,249,255,246,255,246,255,248,255,238,255, - 235,255,227,255,220,255,214,255,213,255,224,255,224,255,228,255,235,255,228,255,234,255,228,255,234,255,234,255,232,255,246,255,250,255,249,255,255,255,0,0, - 0,0,4,0,3,0,0,0,0,0,7,0,10,0,8,0,17,0,19,0,24,0,22,0,29,0,28,0,32,0,32,0,43,0,48,0,48,0,43,0, - 40,0,36,0,33,0,29,0,37,0,36,0,33,0,36,0,32,0,35,0,32,0,33,0,29,0,26,0,28,0,25,0,36,0,46,0,42,0,33,0, - 28,0,30,0,29,0,25,0,25,0,14,0,18,0,17,0,6,0,1,0,253,255,245,255,239,255,230,255,224,255,216,255,203,255,201,255,190,255,181,255, - 162,255,147,255,129,255,126,255,126,255,124,255,119,255,120,255,127,255,119,255,119,255,126,255,124,255,124,255,129,255,131,255,137,255,138,255,138,255,142,255, - 145,255,138,255,138,255,136,255,140,255,145,255,144,255,147,255,149,255,152,255,159,255,165,255,166,255,174,255,180,255,174,255,184,255,190,255,196,255,208,255, - 216,255,221,255,223,255,231,255,227,255,227,255,216,255,212,255,203,255,191,255,184,255,172,255,169,255,159,255,145,255,138,255,137,255,133,255,130,255,127,255, - 122,255,123,255,123,255,123,255,116,255,123,255,113,255,119,255,120,255,124,255,117,255,131,255,129,255,123,255,127,255,130,255,129,255,137,255,136,255,144,255, - 141,255,145,255,142,255,145,255,151,255,163,255,178,255,191,255,198,255,214,255,216,255,220,255,223,255,230,255,232,255,244,255,1,0,11,0,18,0,28,0, - 22,0,29,0,29,0,35,0,39,0,44,0,54,0,62,0,69,0,83,0,86,0,91,0,97,0,104,0,109,0,132,0,133,0,143,0,140,0,141,0, - 141,0,137,0,145,0,143,0,141,0,144,0,141,0,139,0,148,0,144,0,140,0,126,0,126,0,130,0,119,0,119,0,114,0,105,0,100,0,96,0, - 90,0,83,0,80,0,83,0,76,0,71,0,62,0,58,0,50,0,46,0,44,0,48,0,48,0,55,0,58,0,64,0,75,0,78,0,78,0,76,0, - 76,0,73,0,66,0,65,0,61,0,58,0,55,0,60,0,68,0,69,0,64,0,55,0,47,0,44,0,42,0,35,0,36,0,33,0,37,0,44,0, - 50,0,51,0,53,0,55,0,46,0,60,0,61,0,72,0,71,0,73,0,82,0,97,0,104,0,105,0,109,0,112,0,115,0,111,0,115,0,105,0, - 101,0,86,0,73,0,68,0,73,0,68,0,58,0,55,0,53,0,39,0,36,0,24,0,17,0,12,0,7,0,255,255,239,255,231,255,231,255,228,255, - 224,255,220,255,220,255,220,255,217,255,219,255,228,255,224,255,224,255,230,255,232,255,235,255,237,255,238,255,244,255,239,255,241,255,230,255,244,255,244,255, - 241,255,239,255,242,255,242,255,245,255,246,255,6,0,0,0,12,0,7,0,8,0,3,0,11,0,8,0,17,0,18,0,19,0,24,0,26,0,22,0, - 24,0,26,0,25,0,26,0,29,0,42,0,40,0,42,0,37,0,44,0,44,0,33,0,37,0,28,0,26,0,22,0,12,0,19,0,18,0,22,0, - 18,0,14,0,12,0,14,0,19,0,17,0,12,0,10,0,4,0,3,0,0,0,253,255,237,255,231,255,227,255,216,255,206,255,198,255,185,255,177,255, - 166,255,158,255,149,255,151,255,138,255,140,255,140,255,144,255,136,255,136,255,134,255,134,255,137,255,137,255,137,255,142,255,154,255,149,255,152,255,149,255, - 155,255,154,255,156,255,155,255,155,255,156,255,151,255,152,255,158,255,158,255,162,255,169,255,172,255,176,255,170,255,169,255,174,255,178,255,183,255,184,255, - 190,255,196,255,209,255,216,255,217,255,209,255,213,255,214,255,214,255,214,255,199,255,201,255,201,255,191,255,180,255,173,255,160,255,155,255,145,255,136,255, - 133,255,134,255,133,255,130,255,130,255,133,255,133,255,129,255,126,255,127,255,127,255,131,255,127,255,131,255,136,255,141,255,149,255,155,255,166,255,173,255, - 170,255,178,255,170,255,176,255,184,255,184,255,185,255,198,255,199,255,206,255,220,255,231,255,232,255,241,255,237,255,245,255,249,255,253,255,3,0,10,0, - 19,0,29,0,35,0,32,0,30,0,42,0,44,0,54,0,54,0,55,0,65,0,71,0,82,0,87,0,98,0,107,0,108,0,116,0,130,0,130,0, - 130,0,129,0,134,0,127,0,127,0,127,0,118,0,127,0,126,0,126,0,126,0,123,0,118,0,118,0,115,0,105,0,107,0,100,0,86,0,86,0, - 89,0,82,0,79,0,75,0,73,0,75,0,76,0,61,0,60,0,43,0,39,0,35,0,42,0,50,0,51,0,57,0,66,0,71,0,73,0,68,0, - 71,0,73,0,66,0,65,0,53,0,61,0,61,0,60,0,54,0,57,0,57,0,51,0,50,0,40,0,42,0,39,0,35,0,35,0,33,0,29,0, - 32,0,42,0,40,0,48,0,46,0,55,0,57,0,69,0,76,0,80,0,79,0,86,0,93,0,101,0,105,0,101,0,108,0,115,0,111,0,108,0, - 112,0,112,0,111,0,104,0,104,0,86,0,75,0,71,0,64,0,61,0,54,0,40,0,35,0,18,0,12,0,3,0,252,255,238,255,237,255,228,255, - 219,255,212,255,199,255,202,255,203,255,209,255,216,255,217,255,220,255,221,255,224,255,228,255,226,255,231,255,239,255,242,255,239,255,242,255,242,255,246,255, - 230,255,234,255,234,255,228,255,228,255,231,255,237,255,246,255,1,0,3,0,6,0,11,0,3,0,3,0,250,255,252,255,253,255,1,0,3,0,6,0, - 11,0,12,0,14,0,28,0,24,0,35,0,32,0,24,0,15,0,21,0,15,0,10,0,12,0,18,0,22,0,18,0,19,0,19,0,10,0,7,0, - 10,0,15,0,8,0,1,0,12,0,4,0,0,0,252,255,255,255,244,255,246,255,238,255,234,255,227,255,221,255,213,255,208,255,198,255,191,255,188,255, - 181,255,174,255,177,255,167,255,163,255,162,255,159,255,162,255,158,255,156,255,145,255,145,255,144,255,142,255,144,255,145,255,141,255,151,255,160,255,170,255, - 170,255,167,255,167,255,173,255,181,255,187,255,183,255,187,255,178,255,173,255,169,255,169,255,170,255,176,255,183,255,181,255,190,255,188,255,196,255,203,255, - 209,255,205,255,205,255,209,255,209,255,214,255,214,255,206,255,210,255,206,255,203,255,209,255,206,255,196,255,199,255,199,255,198,255,183,255,174,255,165,255, - 156,255,152,255,148,255,144,255,149,255,148,255,152,255,147,255,142,255,133,255,138,255,138,255,136,255,142,255,144,255,140,255,148,255,142,255,154,255,160,255, - 170,255,177,255,176,255,183,255,183,255,190,255,194,255,198,255,212,255,217,255,223,255,224,255,238,255,238,255,242,255,248,255,250,255,248,255,253,255,6,0, - 12,0,17,0,21,0,21,0,32,0,37,0,43,0,48,0,53,0,58,0,62,0,68,0,75,0,84,0,94,0,100,0,105,0,115,0,112,0,112,0, - 119,0,120,0,122,0,125,0,120,0,129,0,127,0,123,0,120,0,109,0,114,0,109,0,112,0,109,0,111,0,107,0,102,0,90,0,91,0,83,0, - 82,0,75,0,69,0,68,0,72,0,75,0,75,0,80,0,76,0,76,0,64,0,61,0,50,0,55,0,54,0,61,0,61,0,69,0,66,0,66,0, - 55,0,65,0,65,0,55,0,57,0,55,0,50,0,43,0,43,0,50,0,51,0,47,0,48,0,51,0,54,0,53,0,53,0,54,0,51,0,48,0, - 43,0,46,0,39,0,37,0,37,0,50,0,54,0,65,0,66,0,72,0,69,0,71,0,79,0,86,0,82,0,89,0,84,0,94,0,94,0,94,0, - 93,0,94,0,93,0,96,0,93,0,89,0,91,0,90,0,78,0,69,0,61,0,50,0,37,0,24,0,11,0,6,0,249,255,246,255,230,255,231,255, - 226,255,212,255,212,255,208,255,198,255,199,255,201,255,203,255,205,255,210,255,216,255,217,255,220,255,216,255,217,255,226,255,216,255,216,255,232,255,228,255, - 227,255,231,255,232,255,234,255,230,255,235,255,232,255,230,255,237,255,238,255,244,255,245,255,244,255,248,255,246,255,249,255,1,0,4,0,14,0,6,0, - 7,0,8,0,8,0,10,0,17,0,21,0,17,0,21,0,11,0,6,0,7,0,3,0,8,0,4,0,7,0,17,0,19,0,19,0,19,0,15,0, - 19,0,10,0,6,0,7,0,7,0,6,0,4,0,250,255,241,255,244,255,227,255,224,255,219,255,217,255,210,255,210,255,210,255,206,255,202,255,209,255, - 210,255,209,255,205,255,199,255,203,255,195,255,192,255,184,255,176,255,170,255,172,255,166,255,170,255,163,255,158,255,162,255,169,255,172,255,183,255,177,255, - 180,255,185,255,185,255,185,255,190,255,184,255,185,255,194,255,191,255,184,255,181,255,181,255,174,255,177,255,181,255,185,255,194,255,188,255,201,255,210,255, - 209,255,210,255,205,255,209,255,201,255,206,255,212,255,210,255,210,255,209,255,206,255,205,255,196,255,196,255,195,255,201,255,196,255,192,255,196,255,178,255, - 176,255,177,255,170,255,167,255,166,255,166,255,163,255,165,255,167,255,162,255,159,255,155,255,148,255,142,255,147,255,147,255,151,255,147,255,158,255,165,255, - 173,255,173,255,178,255,184,255,190,255,195,255,199,255,201,255,210,255,217,255,220,255,226,255,228,255,235,255,238,255,241,255,249,255,0,0,7,0,8,0, - 12,0,17,0,18,0,28,0,25,0,24,0,28,0,29,0,35,0,47,0,58,0,58,0,65,0,76,0,84,0,84,0,91,0,94,0,91,0,96,0, - 102,0,107,0,107,0,111,0,112,0,122,0,120,0,123,0,126,0,118,0,108,0,101,0,89,0,97,0,91,0,90,0,91,0,97,0,91,0,82,0, - 73,0,64,0,61,0,65,0,57,0,62,0,64,0,66,0,79,0,80,0,80,0,78,0,75,0,75,0,71,0,64,0,64,0,60,0,62,0,62,0, - 58,0,57,0,60,0,60,0,54,0,50,0,46,0,47,0,47,0,37,0,39,0,39,0,39,0,43,0,50,0,47,0,46,0,48,0,54,0,51,0, - 43,0,40,0,30,0,37,0,42,0,48,0,53,0,61,0,55,0,62,0,66,0,75,0,78,0,80,0,82,0,93,0,96,0,93,0,94,0,93,0, - 96,0,93,0,89,0,87,0,87,0,87,0,79,0,78,0,80,0,68,0,60,0,50,0,36,0,26,0,12,0,12,0,3,0,249,255,242,255,239,255, - 239,255,228,255,226,255,219,255,210,255,208,255,206,255,196,255,194,255,196,255,201,255,208,255,205,255,208,255,205,255,205,255,209,255,209,255,208,255,214,255, - 221,255,226,255,227,255,234,255,237,255,241,255,246,255,246,255,242,255,249,255,248,255,252,255,1,0,255,255,0,0,253,255,6,0,3,0,7,0,6,0, - 0,0,10,0,12,0,17,0,11,0,8,0,4,0,3,0,255,255,252,255,6,0,4,0,7,0,4,0,0,0,6,0,8,0,11,0,14,0,21,0, - 19,0,15,0,14,0,14,0,10,0,1,0,249,255,245,255,234,255,230,255,228,255,232,255,220,255,223,255,216,255,217,255,208,255,206,255,209,255,206,255, - 205,255,205,255,205,255,201,255,199,255,201,255,198,255,201,255,198,255,194,255,190,255,184,255,191,255,191,255,187,255,187,255,187,255,188,255,194,255,192,255, - 192,255,192,255,187,255,192,255,191,255,191,255,194,255,192,255,185,255,188,255,191,255,194,255,191,255,187,255,187,255,192,255,191,255,195,255,199,255,202,255, - 212,255,219,255,214,255,216,255,206,255,206,255,210,255,212,255,209,255,205,255,206,255,203,255,205,255,198,255,196,255,201,255,198,255,191,255,192,255,191,255, - 195,255,191,255,187,255,181,255,183,255,184,255,187,255,188,255,190,255,184,255,183,255,173,255,178,255,170,255,167,255,159,255,165,255,165,255,167,255,174,255, - 181,255,188,255,184,255,198,255,196,255,195,255,196,255,203,255,205,255,214,255,220,255,223,255,234,255,237,255,235,255,244,255,250,255,255,255,4,0,18,0, - 12,0,11,0,15,0,25,0,37,0,35,0,39,0,48,0,43,0,43,0,44,0,53,0,57,0,62,0,61,0,68,0,71,0,72,0,76,0,79,0, - 87,0,90,0,96,0,102,0,97,0,98,0,101,0,115,0,120,0,125,0,119,0,107,0,105,0,105,0,90,0,87,0,93,0,90,0,94,0,97,0, - 93,0,80,0,80,0,73,0,65,0,60,0,64,0,61,0,66,0,73,0,76,0,78,0,84,0,82,0,80,0,75,0,73,0,71,0,65,0,65,0, - 62,0,51,0,48,0,48,0,46,0,44,0,40,0,47,0,44,0,44,0,43,0,50,0,44,0,40,0,39,0,42,0,42,0,46,0,40,0,40,0, - 30,0,37,0,36,0,37,0,39,0,48,0,47,0,51,0,55,0,58,0,65,0,66,0,73,0,80,0,84,0,91,0,84,0,94,0,93,0,83,0, - 83,0,82,0,82,0,75,0,71,0,66,0,60,0,60,0,62,0,50,0,36,0,28,0,18,0,11,0,4,0,1,0,0,0,0,0,253,255,246,255, - 237,255,228,255,224,255,220,255,214,255,206,255,198,255,201,255,199,255,201,255,194,255,194,255,196,255,195,255,202,255,196,255,199,255,201,255,208,255,206,255, - 214,255,221,255,224,255,220,255,221,255,228,255,227,255,234,255,239,255,252,255,249,255,1,0,1,0,252,255,253,255,249,255,255,255,3,0,253,255,0,0, - 1,0,7,0,4,0,12,0,7,0,7,0,7,0,7,0,3,0,244,255,253,255,248,255,249,255,245,255,0,0,0,0,3,0,11,0,12,0,12,0, - 15,0,6,0,3,0,6,0,253,255,249,255,245,255,245,255,244,255,244,255,241,255,234,255,230,255,226,255,216,255,217,255,208,255,208,255,206,255,216,255, - 219,255,210,255,216,255,205,255,210,255,213,255,213,255,208,255,206,255,202,255,203,255,196,255,187,255,185,255,190,255,181,255,181,255,192,255,187,255,190,255, - 195,255,199,255,203,255,202,255,190,255,199,255,203,255,198,255,194,255,187,255,188,255,187,255,191,255,187,255,188,255,180,255,191,255,184,255,190,255,187,255, - 195,255,198,255,202,255,202,255,209,255,208,255,210,255,213,255,212,255,212,255,214,255,216,255,206,255,213,255,210,255,208,255,205,255,202,255,198,255,203,255, - 199,255,195,255,194,255,191,255,192,255,190,255,183,255,191,255,187,255,187,255,180,255,177,255,173,255,167,255,169,255,166,255,173,255,178,255,180,255,181,255, - 188,255,194,255,198,255,196,255,203,255,203,255,199,255,199,255,206,255,213,255,213,255,219,255,230,255,231,255,242,255,242,255,242,255,250,255,252,255,7,0, - 15,0,19,0,30,0,30,0,26,0,30,0,30,0,30,0,42,0,47,0,55,0,54,0,51,0,61,0,55,0,64,0,62,0,62,0,65,0,76,0, - 75,0,79,0,82,0,82,0,82,0,86,0,84,0,83,0,89,0,97,0,90,0,101,0,100,0,97,0,101,0,102,0,97,0,97,0,94,0,84,0, - 90,0,76,0,72,0,80,0,72,0,76,0,64,0,61,0,60,0,61,0,58,0,75,0,75,0,75,0,79,0,69,0,71,0,66,0,57,0,53,0, - 48,0,50,0,51,0,46,0,42,0,46,0,53,0,47,0,47,0,42,0,37,0,36,0,32,0,32,0,33,0,35,0,36,0,39,0,29,0,28,0, - 30,0,32,0,28,0,29,0,32,0,33,0,35,0,44,0,51,0,55,0,64,0,68,0,69,0,80,0,83,0,86,0,82,0,79,0,87,0,83,0, - 72,0,62,0,64,0,57,0,58,0,61,0,64,0,66,0,62,0,53,0,44,0,30,0,25,0,21,0,18,0,255,255,255,255,250,255,245,255,245,255, - 244,255,234,255,231,255,228,255,217,255,213,255,210,255,213,255,212,255,210,255,214,255,206,255,209,255,209,255,205,255,206,255,206,255,198,255,205,255,206,255, - 206,255,205,255,212,255,216,255,217,255,227,255,231,255,235,255,242,255,244,255,0,0,3,0,0,0,4,0,6,0,4,0,7,0,255,255,0,0,255,255, - 6,0,8,0,14,0,15,0,17,0,18,0,8,0,3,0,0,0,1,0,4,0,7,0,7,0,4,0,3,0,4,0,1,0,250,255,11,0,12,0, - 10,0,7,0,255,255,3,0,250,255,241,255,234,255,237,255,230,255,238,255,237,255,241,255,237,255,235,255,238,255,228,255,228,255,226,255,219,255,212,255, - 217,255,221,255,208,255,212,255,212,255,209,255,201,255,210,255,210,255,206,255,210,255,205,255,203,255,194,255,196,255,190,255,192,255,194,255,196,255,198,255, - 199,255,196,255,192,255,194,255,190,255,195,255,198,255,188,255,184,255,180,255,181,255,187,255,195,255,196,255,191,255,195,255,195,255,188,255,188,255,187,255, - 185,255,194,255,191,255,195,255,196,255,199,255,195,255,201,255,201,255,205,255,201,255,202,255,203,255,213,255,216,255,213,255,212,255,208,255,199,255,198,255, - 209,255,209,255,209,255,210,255,208,255,206,255,199,255,191,255,176,255,172,255,172,255,176,255,187,255,178,255,185,255,187,255,184,255,185,255,191,255,195,255, - 195,255,202,255,203,255,210,255,210,255,208,255,212,255,213,255,219,255,226,255,230,255,231,255,232,255,234,255,238,255,234,255,237,255,245,255,255,255,4,0, - 7,0,12,0,12,0,24,0,24,0,26,0,28,0,30,0,33,0,33,0,33,0,39,0,47,0,43,0,48,0,55,0,60,0,61,0,61,0,57,0, - 57,0,57,0,55,0,57,0,68,0,69,0,71,0,71,0,72,0,78,0,72,0,82,0,83,0,93,0,96,0,93,0,93,0,89,0,87,0,89,0, - 91,0,82,0,83,0,84,0,78,0,76,0,71,0,69,0,75,0,68,0,69,0,71,0,68,0,78,0,69,0,65,0,69,0,61,0,64,0,64,0, - 53,0,57,0,58,0,47,0,54,0,51,0,55,0,46,0,43,0,43,0,43,0,33,0,36,0,32,0,30,0,29,0,29,0,22,0,14,0,14,0, - 21,0,36,0,39,0,36,0,35,0,40,0,43,0,42,0,42,0,48,0,60,0,48,0,54,0,66,0,55,0,62,0,62,0,62,0,69,0,64,0, - 66,0,65,0,64,0,62,0,64,0,64,0,58,0,46,0,51,0,47,0,40,0,35,0,30,0,19,0,15,0,8,0,1,0,255,255,238,255,238,255, - 238,255,237,255,239,255,235,255,232,255,226,255,228,255,221,255,213,255,219,255,213,255,212,255,208,255,205,255,213,255,212,255,212,255,216,255,213,255,209,255, - 206,255,206,255,214,255,216,255,219,255,220,255,228,255,234,255,244,255,246,255,255,255,1,0,1,0,8,0,4,0,4,0,12,0,14,0,12,0,10,0, - 15,0,22,0,18,0,28,0,24,0,21,0,15,0,18,0,12,0,14,0,17,0,17,0,19,0,19,0,17,0,12,0,4,0,1,0,0,0,249,255, - 252,255,1,0,3,0,250,255,248,255,248,255,242,255,237,255,237,255,227,255,230,255,231,255,235,255,235,255,238,255,230,255,235,255,219,255,221,255,227,255, - 228,255,221,255,210,255,209,255,210,255,210,255,210,255,212,255,216,255,208,255,209,255,195,255,195,255,195,255,196,255,196,255,191,255,187,255,195,255,198,255, - 201,255,203,255,206,255,196,255,195,255,205,255,201,255,195,255,194,255,191,255,195,255,192,255,190,255,190,255,187,255,195,255,198,255,196,255,196,255,192,255, - 192,255,187,255,195,255,195,255,195,255,202,255,206,255,210,255,208,255,212,255,206,255,205,255,213,255,213,255,217,255,223,255,223,255,223,255,228,255,227,255, - 220,255,221,255,216,255,217,255,223,255,212,255,203,255,201,255,195,255,196,255,190,255,192,255,191,255,191,255,188,255,192,255,194,255,201,255,201,255,205,255, - 206,255,209,255,209,255,216,255,210,255,212,255,217,255,221,255,220,255,226,255,230,255,235,255,241,255,242,255,245,255,250,255,237,255,241,255,250,255,252,255, - 7,0,11,0,18,0,18,0,29,0,24,0,24,0,33,0,32,0,36,0,35,0,33,0,39,0,48,0,46,0,43,0,44,0,60,0,64,0,57,0, - 62,0,68,0,62,0,60,0,64,0,66,0,65,0,61,0,73,0,75,0,78,0,72,0,79,0,75,0,83,0,76,0,83,0,86,0,80,0,86,0, - 89,0,90,0,90,0,87,0,89,0,84,0,87,0,83,0,82,0,82,0,71,0,65,0,61,0,60,0,54,0,55,0,60,0,60,0,66,0,64,0, - 69,0,61,0,57,0,61,0,48,0,42,0,32,0,37,0,36,0,39,0,39,0,39,0,37,0,36,0,36,0,24,0,28,0,25,0,24,0,25,0, - 22,0,28,0,33,0,28,0,30,0,33,0,33,0,35,0,35,0,37,0,39,0,36,0,33,0,30,0,33,0,33,0,33,0,30,0,33,0,32,0, - 43,0,40,0,40,0,44,0,44,0,40,0,42,0,33,0,32,0,28,0,28,0,22,0,30,0,28,0,24,0,15,0,6,0,3,0,253,255,244,255, - 237,255,226,255,221,255,226,255,226,255,223,255,234,255,226,255,230,255,228,255,220,255,212,255,212,255,212,255,208,255,203,255,203,255,206,255,210,255,213,255, - 220,255,230,255,224,255,223,255,227,255,226,255,226,255,226,255,231,255,238,255,237,255,238,255,241,255,245,255,250,255,0,0,250,255,255,255,7,0,11,0, - 15,0,15,0,15,0,17,0,14,0,15,0,30,0,25,0,24,0,21,0,22,0,24,0,24,0,12,0,18,0,15,0,15,0,7,0,8,0,7,0, - 0,0,252,255,246,255,245,255,244,255,252,255,248,255,237,255,239,255,244,255,238,255,237,255,237,255,235,255,230,255,231,255,221,255,228,255,232,255,234,255, - 232,255,231,255,226,255,228,255,219,255,214,255,216,255,216,255,212,255,212,255,212,255,205,255,210,255,206,255,195,255,199,255,187,255,190,255,190,255,187,255, - 188,255,196,255,201,255,205,255,209,255,194,255,190,255,199,255,192,255,191,255,181,255,181,255,183,255,181,255,183,255,185,255,191,255,199,255,195,255,190,255, - 188,255,185,255,190,255,194,255,192,255,192,255,195,255,202,255,205,255,205,255,206,255,213,255,212,255,210,255,208,255,209,255,210,255,217,255,213,255,213,255, - 219,255,221,255,219,255,219,255,217,255,213,255,208,255,203,255,201,255,198,255,196,255,195,255,192,255,194,255,196,255,192,255,192,255,198,255,203,255,205,255, - 213,255,213,255,220,255,227,255,234,255,231,255,227,255,235,255,237,255,238,255,245,255,245,255,249,255,248,255,248,255,253,255,255,255,4,0,4,0,3,0, - 0,0,3,0,8,0,10,0,17,0,15,0,26,0,32,0,33,0,32,0,30,0,29,0,39,0,40,0,37,0,39,0,37,0,50,0,53,0,62,0, - 60,0,54,0,61,0,65,0,66,0,66,0,69,0,64,0,60,0,64,0,71,0,76,0,73,0,78,0,83,0,80,0,76,0,78,0,83,0,82,0, - 79,0,87,0,80,0,76,0,78,0,82,0,86,0,90,0,83,0,76,0,72,0,61,0,61,0,57,0,61,0,53,0,55,0,68,0,72,0,69,0, - 66,0,66,0,60,0,48,0,51,0,47,0,39,0,42,0,42,0,46,0,47,0,42,0,37,0,35,0,39,0,32,0,28,0,28,0,19,0,19,0, - 29,0,28,0,35,0,28,0,32,0,32,0,37,0,36,0,39,0,32,0,35,0,25,0,14,0,18,0,17,0,24,0,24,0,35,0,30,0,29,0, - 33,0,33,0,30,0,32,0,30,0,24,0,21,0,21,0,21,0,22,0,18,0,14,0,12,0,8,0,14,0,10,0,8,0,8,0,1,0,1,0, - 250,255,241,255,237,255,234,255,231,255,234,255,237,255,231,255,221,255,217,255,220,255,223,255,224,255,226,255,228,255,224,255,221,255,219,255,214,255,220,255, - 220,255,227,255,226,255,228,255,227,255,230,255,228,255,232,255,232,255,234,255,235,255,239,255,245,255,249,255,255,255,3,0,6,0,11,0,18,0,24,0, - 19,0,18,0,19,0,26,0,24,0,26,0,24,0,24,0,29,0,36,0,26,0,29,0,25,0,19,0,18,0,18,0,12,0,17,0,11,0,10,0, - 8,0,12,0,7,0,255,255,246,255,241,255,242,255,244,255,246,255,246,255,245,255,242,255,235,255,228,255,230,255,223,255,226,255,227,255,230,255,237,255, - 232,255,230,255,231,255,231,255,232,255,231,255,213,255,212,255,206,255,196,255,196,255,194,255,192,255,195,255,194,255,195,255,192,255,188,255,195,255,195,255, - 190,255,187,255,183,255,191,255,187,255,190,255,190,255,187,255,190,255,187,255,188,255,187,255,188,255,190,255,188,255,192,255,194,255,191,255,194,255,190,255, - 191,255,191,255,192,255,187,255,190,255,190,255,190,255,201,255,203,255,198,255,203,255,206,255,209,255,212,255,210,255,206,255,201,255,209,255,210,255,213,255, - 217,255,217,255,214,255,214,255,217,255,219,255,216,255,210,255,208,255,212,255,213,255,208,255,213,255,210,255,209,255,208,255,206,255,209,255,212,255,210,255, - 214,255,219,255,221,255,220,255,228,255,231,255,238,255,238,255,234,255,239,255,238,255,246,255,244,255,244,255,250,255,4,0,255,255,253,255,1,0,4,0, - 3,0,14,0,14,0,18,0,19,0,19,0,29,0,24,0,24,0,21,0,29,0,33,0,39,0,39,0,42,0,46,0,48,0,46,0,47,0,51,0, - 39,0,50,0,50,0,61,0,57,0,66,0,61,0,62,0,64,0,62,0,61,0,61,0,66,0,68,0,71,0,79,0,79,0,80,0,75,0,76,0, - 75,0,73,0,83,0,91,0,86,0,93,0,83,0,73,0,83,0,84,0,80,0,79,0,79,0,73,0,71,0,69,0,68,0,58,0,57,0,54,0, - 62,0,61,0,58,0,57,0,55,0,57,0,54,0,51,0,48,0,39,0,36,0,32,0,33,0,33,0,33,0,36,0,32,0,37,0,32,0,32,0, - 29,0,25,0,19,0,21,0,19,0,22,0,22,0,21,0,18,0,24,0,21,0,21,0,19,0,18,0,17,0,15,0,15,0,11,0,14,0,19,0, - 10,0,11,0,10,0,15,0,8,0,14,0,11,0,14,0,14,0,11,0,6,0,8,0,10,0,8,0,4,0,6,0,1,0,3,0,1,0,253,255, - 255,255,249,255,241,255,231,255,232,255,232,255,231,255,230,255,231,255,228,255,230,255,228,255,241,255,232,255,232,255,230,255,231,255,235,255,242,255,238,255, - 232,255,227,255,231,255,238,255,239,255,235,255,237,255,235,255,238,255,241,255,244,255,249,255,246,255,253,255,4,0,14,0,14,0,12,0,17,0,14,0, - 24,0,24,0,22,0,25,0,22,0,25,0,21,0,21,0,24,0,30,0,30,0,30,0,36,0,24,0,19,0,24,0,21,0,21,0,11,0,12,0, - 10,0,8,0,8,0,1,0,3,0,1,0,3,0,255,255,249,255,249,255,241,255,238,255,237,255,239,255,238,255,230,255,231,255,230,255,232,255,228,255, - 234,255,234,255,231,255,235,255,237,255,228,255,224,255,213,255,217,255,210,255,210,255,214,255,212,255,214,255,206,255,205,255,198,255,198,255,196,255,191,255, - 184,255,174,255,170,255,173,255,187,255,184,255,180,255,178,255,177,255,178,255,187,255,198,255,194,255,195,255,192,255,195,255,203,255,198,255,192,255,196,255, - 198,255,198,255,188,255,198,255,196,255,203,255,206,255,209,255,199,255,198,255,199,255,206,255,214,255,210,255,212,255,213,255,213,255,220,255,217,255,217,255, - 214,255,214,255,206,255,209,255,208,255,210,255,217,255,216,255,216,255,219,255,220,255,223,255,223,255,221,255,223,255,220,255,220,255,216,255,219,255,216,255, - 217,255,219,255,226,255,232,255,228,255,231,255,234,255,244,255,237,255,234,255,235,255,248,255,248,255,250,255,255,255,6,0,0,0,14,0,17,0,12,0, - 14,0,18,0,15,0,18,0,19,0,19,0,18,0,14,0,22,0,19,0,26,0,24,0,29,0,33,0,35,0,37,0,37,0,42,0,44,0,43,0, - 47,0,46,0,50,0,48,0,47,0,51,0,57,0,60,0,57,0,65,0,62,0,65,0,66,0,58,0,61,0,64,0,66,0,68,0,65,0,66,0, - 68,0,66,0,73,0,76,0,76,0,78,0,76,0,69,0,69,0,78,0,72,0,69,0,66,0,66,0,61,0,61,0,58,0,69,0,57,0,57,0, - 53,0,54,0,46,0,46,0,46,0,47,0,48,0,40,0,47,0,42,0,46,0,40,0,39,0,46,0,47,0,46,0,40,0,37,0,33,0,30,0, - 35,0,25,0,26,0,24,0,12,0,14,0,10,0,12,0,14,0,8,0,14,0,10,0,10,0,12,0,15,0,12,0,11,0,14,0,7,0,11,0, - 1,0,1,0,0,0,255,255,252,255,8,0,3,0,3,0,4,0,250,255,252,255,252,255,252,255,249,255,252,255,253,255,252,255,249,255,250,255,252,255, - 245,255,248,255,248,255,239,255,242,255,238,255,235,255,230,255,235,255,232,255,230,255,228,255,228,255,235,255,226,255,238,255,231,255,227,255,226,255,230,255, - 230,255,235,255,230,255,231,255,230,255,239,255,232,255,239,255,237,255,238,255,241,255,238,255,250,255,4,0,3,0,10,0,8,0,7,0,10,0,12,0, - 17,0,22,0,19,0,19,0,29,0,21,0,26,0,25,0,21,0,24,0,28,0,28,0,33,0,25,0,28,0,24,0,24,0,18,0,14,0,14,0, - 10,0,6,0,3,0,3,0,3,0,252,255,250,255,246,255,246,255,248,255,242,255,238,255,241,255,242,255,244,255,242,255,237,255,237,255,230,255,232,255, - 234,255,228,255,224,255,223,255,226,255,220,255,221,255,226,255,224,255,221,255,219,255,212,255,205,255,208,255,201,255,199,255,198,255,201,255,192,255,192,255, - 185,255,188,255,181,255,180,255,177,255,181,255,180,255,184,255,181,255,178,255,195,255,201,255,202,255,195,255,187,255,191,255,199,255,195,255,202,255,203,255, - 205,255,202,255,208,255,213,255,203,255,210,255,206,255,209,255,209,255,208,255,203,255,203,255,202,255,212,255,213,255,224,255,227,255,214,255,221,255,219,255, - 223,255,219,255,212,255,220,255,216,255,219,255,219,255,224,255,228,255,216,255,223,255,220,255,228,255,227,255,230,255,228,255,227,255,224,255,219,255,224,255, - 223,255,221,255,226,255,227,255,234,255,239,255,241,255,245,255,249,255,255,255,6,0,255,255,0,0,1,0,253,255,0,0,0,0,4,0,15,0,11,0, - 7,0,14,0,14,0,24,0,26,0,28,0,18,0,26,0,22,0,21,0,22,0,18,0,22,0,28,0,26,0,25,0,29,0,37,0,37,0,37,0, - 44,0,40,0,47,0,48,0,55,0,55,0,55,0,54,0,62,0,62,0,60,0,66,0,68,0,64,0,60,0,65,0,64,0,57,0,60,0,57,0, - 60,0,64,0,64,0,66,0,73,0,76,0,76,0,75,0,73,0,76,0,75,0,75,0,75,0,73,0,71,0,78,0,72,0,68,0,64,0,64,0, - 57,0,48,0,47,0,48,0,46,0,46,0,42,0,40,0,42,0,43,0,47,0,47,0,42,0,33,0,30,0,29,0,32,0,29,0,29,0,29,0, - 29,0,24,0,28,0,22,0,21,0,19,0,22,0,17,0,19,0,12,0,15,0,10,0,17,0,11,0,7,0,6,0,6,0,6,0,4,0,11,0, - 10,0,8,0,3,0,255,255,253,255,248,255,249,255,248,255,249,255,246,255,252,255,249,255,245,255,250,255,249,255,246,255,248,255,245,255,241,255,246,255, - 248,255,246,255,246,255,252,255,250,255,252,255,252,255,237,255,242,255,235,255,241,255,241,255,239,255,231,255,232,255,234,255,238,255,228,255,231,255,227,255, - 239,255,242,255,238,255,234,255,230,255,238,255,239,255,234,255,237,255,238,255,248,255,255,255,248,255,250,255,250,255,3,0,4,0,10,0,3,0,8,0, - 252,255,7,0,10,0,12,0,11,0,15,0,24,0,19,0,28,0,30,0,32,0,33,0,30,0,25,0,21,0,25,0,25,0,21,0,18,0,18,0, - 14,0,12,0,21,0,17,0,8,0,7,0,6,0,252,255,250,255,246,255,249,255,252,255,249,255,249,255,242,255,235,255,238,255,244,255,242,255,241,255, - 234,255,235,255,232,255,231,255,221,255,214,255,224,255,224,255,223,255,228,255,226,255,227,255,221,255,220,255,226,255,219,255,208,255,206,255,202,255,199,255, - 195,255,191,255,187,255,187,255,177,255,180,255,181,255,184,255,185,255,184,255,190,255,195,255,195,255,201,255,203,255,202,255,201,255,199,255,205,255,205,255, - 209,255,209,255,216,255,216,255,209,255,208,255,214,255,210,255,216,255,214,255,214,255,208,255,210,255,216,255,217,255,221,255,220,255,223,255,221,255,219,255, - 221,255,221,255,227,255,214,255,217,255,216,255,216,255,221,255,224,255,226,255,228,255,228,255,226,255,234,255,231,255,220,255,227,255,230,255,230,255,235,255, - 234,255,235,255,238,255,244,255,238,255,239,255,239,255,245,255,241,255,246,255,244,255,250,255,253,255,0,0,0,0,253,255,3,0,8,0,6,0,15,0, - 10,0,12,0,11,0,15,0,11,0,15,0,21,0,24,0,15,0,15,0,18,0,25,0,24,0,30,0,22,0,32,0,28,0,29,0,37,0,36,0, - 36,0,36,0,35,0,35,0,43,0,43,0,46,0,43,0,43,0,46,0,37,0,44,0,47,0,46,0,48,0,53,0,53,0,54,0,57,0,53,0, - 54,0,48,0,53,0,53,0,58,0,51,0,54,0,55,0,55,0,62,0,61,0,61,0,62,0,57,0,55,0,51,0,57,0,50,0,51,0,53,0, - 51,0,54,0,48,0,48,0,42,0,43,0,46,0,44,0,39,0,32,0,33,0,35,0,32,0,36,0,29,0,28,0,28,0,24,0,28,0,28,0, - 25,0,24,0,22,0,24,0,17,0,15,0,17,0,18,0,17,0,8,0,6,0,4,0,4,0,6,0,6,0,12,0,11,0,11,0,6,0,255,255, - 252,255,246,255,252,255,249,255,239,255,239,255,234,255,244,255,238,255,241,255,242,255,245,255,246,255,244,255,248,255,249,255,245,255,245,255,241,255,242,255, - 241,255,249,255,250,255,248,255,248,255,249,255,250,255,246,255,237,255,241,255,239,255,238,255,234,255,238,255,237,255,237,255,238,255,231,255,237,255,231,255, - 231,255,234,255,235,255,231,255,239,255,244,255,245,255,245,255,246,255,249,255,253,255,249,255,252,255,250,255,1,0,3,0,252,255,252,255,0,0,1,0, - 7,0,15,0,15,0,10,0,17,0,17,0,28,0,22,0,30,0,30,0,32,0,37,0,30,0,36,0,30,0,25,0,21,0,18,0,19,0,24,0, - 24,0,26,0,21,0,25,0,11,0,10,0,8,0,255,255,0,0,253,255,249,255,253,255,246,255,248,255,245,255,237,255,239,255,237,255,234,255,232,255, - 239,255,238,255,231,255,234,255,226,255,231,255,231,255,237,255,237,255,234,255,231,255,226,255,210,255,209,255,214,255,213,255,214,255,214,255,217,255,213,255, - 206,255,201,255,196,255,190,255,183,255,183,255,184,255,187,255,191,255,185,255,194,255,199,255,202,255,205,255,195,255,202,255,203,255,209,255,208,255,214,255, - 219,255,223,255,214,255,216,255,210,255,216,255,219,255,219,255,223,255,219,255,223,255,216,255,217,255,220,255,223,255,221,255,221,255,227,255,228,255,217,255, - 220,255,223,255,221,255,228,255,226,255,230,255,226,255,232,255,231,255,228,255,238,255,232,255,234,255,238,255,245,255,246,255,249,255,244,255,249,255,245,255, - 248,255,241,255,245,255,248,255,248,255,249,255,246,255,248,255,246,255,249,255,252,255,245,255,3,0,255,255,0,0,255,255,1,0,4,0,4,0,4,0, - 6,0,7,0,6,0,8,0,18,0,21,0,24,0,19,0,26,0,22,0,15,0,22,0,22,0,19,0,25,0,25,0,36,0,26,0,22,0,24,0, - 30,0,22,0,32,0,30,0,35,0,32,0,39,0,36,0,35,0,39,0,46,0,43,0,43,0,46,0,43,0,46,0,53,0,48,0,48,0,58,0, - 60,0,50,0,50,0,50,0,55,0,53,0,44,0,46,0,50,0,60,0,62,0,60,0,60,0,61,0,53,0,48,0,48,0,50,0,48,0,46,0, - 48,0,50,0,48,0,50,0,47,0,44,0,43,0,39,0,32,0,36,0,26,0,29,0,25,0,21,0,17,0,21,0,18,0,26,0,19,0,18,0, - 15,0,18,0,17,0,15,0,12,0,11,0,10,0,14,0,15,0,11,0,15,0,19,0,12,0,7,0,4,0,1,0,8,0,8,0,8,0,3,0, - 4,0,253,255,250,255,246,255,252,255,248,255,244,255,238,255,238,255,235,255,232,255,235,255,237,255,237,255,231,255,234,255,239,255,238,255,249,255,252,255, - 252,255,0,0,250,255,255,255,0,0,1,0,252,255,248,255,241,255,238,255,237,255,235,255,230,255,237,255,237,255,239,255,241,255,237,255,237,255,226,255, - 234,255,234,255,238,255,238,255,242,255,239,255,241,255,246,255,244,255,244,255,249,255,0,0,248,255,3,0,3,0,7,0,8,0,7,0,10,0,0,0, - 4,0,8,0,6,0,7,0,12,0,15,0,24,0,19,0,22,0,24,0,22,0,25,0,26,0,22,0,24,0,25,0,28,0,22,0,18,0,18,0, - 11,0,15,0,21,0,21,0,18,0,15,0,8,0,12,0,4,0,7,0,10,0,1,0,250,255,246,255,244,255,235,255,235,255,235,255,232,255,239,255, - 234,255,231,255,239,255,248,255,241,255,241,255,238,255,230,255,227,255,226,255,217,255,223,255,220,255,223,255,221,255,216,255,212,255,209,255,199,255,199,255, - 205,255,206,255,202,255,201,255,212,255,205,255,202,255,203,255,205,255,210,255,208,255,206,255,208,255,208,255,209,255,203,255,206,255,213,255,208,255,212,255, - 214,255,213,255,217,255,214,255,220,255,213,255,214,255,213,255,219,255,221,255,220,255,223,255,230,255,224,255,224,255,231,255,230,255,226,255,230,255,227,255, - 234,255,231,255,230,255,235,255,228,255,224,255,227,255,231,255,231,255,232,255,234,255,238,255,241,255,231,255,231,255,235,255,242,255,237,255,238,255,241,255, - 248,255,246,255,244,255,250,255,249,255,248,255,248,255,245,255,250,255,253,255,246,255,1,0,0,0,255,255,253,255,248,255,245,255,249,255,250,255,248,255, - 248,255,255,255,255,255,4,0,1,0,6,0,8,0,8,0,10,0,10,0,12,0,18,0,25,0,26,0,22,0,30,0,25,0,28,0,24,0,28,0, - 29,0,33,0,28,0,29,0,32,0,22,0,25,0,33,0,32,0,35,0,37,0,36,0,29,0,28,0,28,0,32,0,37,0,37,0,43,0,43,0, - 48,0,46,0,44,0,36,0,33,0,32,0,33,0,36,0,46,0,42,0,47,0,48,0,48,0,46,0,36,0,42,0,32,0,37,0,33,0,29,0, - 40,0,39,0,39,0,33,0,37,0,36,0,32,0,30,0,28,0,28,0,29,0,29,0,25,0,18,0,14,0,15,0,18,0,17,0,10,0,15,0, - 8,0,4,0,17,0,12,0,19,0,15,0,11,0,17,0,14,0,19,0,17,0,14,0,7,0,8,0,14,0,10,0,12,0,14,0,11,0,8,0, - 11,0,0,0,4,0,248,255,245,255,241,255,238,255,239,255,238,255,237,255,245,255,246,255,238,255,238,255,238,255,241,255,242,255,244,255,250,255,0,0, - 246,255,1,0,252,255,0,0,253,255,252,255,255,255,255,255,252,255,248,255,250,255,250,255,246,255,250,255,244,255,244,255,245,255,242,255,237,255,234,255, - 241,255,239,255,239,255,239,255,239,255,237,255,249,255,248,255,255,255,248,255,249,255,244,255,249,255,252,255,252,255,0,0,3,0,7,0,4,0,7,0, - 14,0,8,0,14,0,18,0,12,0,15,0,17,0,26,0,19,0,19,0,19,0,24,0,22,0,25,0,32,0,26,0,30,0,24,0,22,0,22,0, - 19,0,22,0,22,0,18,0,18,0,25,0,12,0,7,0,10,0,11,0,11,0,7,0,255,255,252,255,253,255,250,255,250,255,245,255,244,255,245,255, - 244,255,242,255,237,255,241,255,231,255,235,255,230,255,221,255,224,255,223,255,224,255,232,255,227,255,221,255,217,255,219,255,213,255,221,255,214,255,216,255, - 210,255,210,255,202,255,202,255,196,255,202,255,209,255,210,255,210,255,217,255,214,255,219,255,212,255,213,255,213,255,214,255,214,255,209,255,209,255,209,255, - 212,255,210,255,216,255,216,255,216,255,217,255,227,255,226,255,228,255,228,255,221,255,224,255,227,255,235,255,228,255,238,255,237,255,231,255,237,255,241,255, - 242,255,235,255,235,255,238,255,244,255,235,255,242,255,242,255,241,255,242,255,239,255,245,255,246,255,250,255,244,255,244,255,245,255,244,255,239,255,242,255, - 239,255,245,255,246,255,245,255,252,255,255,255,253,255,0,0,3,0,6,0,8,0,3,0,0,0,252,255,0,0,255,255,255,255,252,255,253,255,253,255, - 252,255,246,255,248,255,0,0,253,255,0,0,0,0,255,255,253,255,252,255,1,0,8,0,18,0,22,0,22,0,24,0,26,0,18,0,26,0,24,0, - 19,0,19,0,18,0,19,0,15,0,18,0,28,0,22,0,22,0,17,0,25,0,30,0,33,0,29,0,24,0,32,0,35,0,35,0,36,0,35,0, - 33,0,35,0,48,0,37,0,35,0,32,0,39,0,43,0,37,0,40,0,39,0,40,0,39,0,43,0,37,0,30,0,33,0,35,0,33,0,26,0, - 29,0,30,0,33,0,35,0,32,0,33,0,24,0,19,0,25,0,21,0,17,0,12,0,4,0,14,0,11,0,10,0,12,0,15,0,11,0,8,0, - 4,0,3,0,6,0,6,0,10,0,6,0,6,0,10,0,4,0,3,0,8,0,3,0,6,0,1,0,3,0,0,0,253,255,253,255,4,0,7,0, - 6,0,7,0,4,0,0,0,0,0,248,255,245,255,242,255,235,255,239,255,239,255,238,255,241,255,237,255,232,255,231,255,241,255,234,255,252,255,252,255, - 252,255,249,255,248,255,252,255,253,255,0,0,1,0,252,255,3,0,4,0,1,0,250,255,253,255,252,255,250,255,248,255,242,255,246,255,249,255,249,255, - 248,255,248,255,245,255,248,255,245,255,252,255,244,255,242,255,241,255,245,255,3,0,252,255,3,0,4,0,0,0,255,255,255,255,0,0,11,0,18,0, - 17,0,15,0,17,0,17,0,22,0,29,0,22,0,24,0,22,0,26,0,30,0,33,0,35,0,35,0,39,0,32,0,32,0,32,0,25,0,22,0, - 21,0,17,0,15,0,14,0,11,0,12,0,11,0,7,0,14,0,14,0,8,0,255,255,1,0,1,0,252,255,249,255,248,255,246,255,242,255,238,255, - 242,255,242,255,242,255,232,255,235,255,235,255,235,255,234,255,237,255,234,255,239,255,228,255,226,255,227,255,223,255,220,255,221,255,216,255,212,255,212,255, - 220,255,216,255,223,255,221,255,212,255,210,255,208,255,212,255,213,255,213,255,217,255,214,255,212,255,210,255,224,255,226,255,224,255,221,255,221,255,219,255, - 220,255,226,255,214,255,219,255,223,255,226,255,223,255,227,255,220,255,226,255,227,255,232,255,235,255,237,255,235,255,239,255,238,255,242,255,244,255,245,255, - 248,255,252,255,249,255,0,0,1,0,1,0,252,255,255,255,250,255,244,255,245,255,248,255,245,255,244,255,246,255,245,255,246,255,246,255,248,255,246,255, - 249,255,245,255,242,255,245,255,250,255,255,255,252,255,255,255,3,0,252,255,249,255,252,255,4,0,7,0,4,0,0,0,0,0,0,0,253,255,0,0, - 253,255,250,255,4,0,255,255,4,0,4,0,1,0,8,0,3,0,0,0,0,0,6,0,3,0,6,0,1,0,17,0,18,0,26,0,21,0,24,0, - 25,0,24,0,22,0,22,0,22,0,19,0,18,0,22,0,22,0,28,0,25,0,22,0,25,0,25,0,18,0,24,0,21,0,21,0,30,0,30,0, - 29,0,33,0,42,0,37,0,42,0,37,0,36,0,40,0,39,0,43,0,37,0,35,0,37,0,24,0,25,0,25,0,25,0,22,0,19,0,25,0, - 26,0,19,0,17,0,21,0,17,0,15,0,11,0,19,0,19,0,19,0,15,0,17,0,12,0,15,0,15,0,19,0,12,0,6,0,1,0,252,255, - 0,0,7,0,1,0,3,0,8,0,6,0,7,0,1,0,14,0,14,0,6,0,8,0,8,0,1,0,3,0,255,255,252,255,252,255,250,255,255,255, - 250,255,253,255,0,0,6,0,0,0,249,255,255,255,255,255,249,255,250,255,244,255,248,255,245,255,239,255,231,255,232,255,237,255,241,255,244,255,252,255, - 248,255,245,255,239,255,245,255,241,255,250,255,250,255,1,0,246,255,255,255,255,255,255,255,255,255,253,255,250,255,255,255,1,0,253,255,250,255,248,255, - 246,255,246,255,246,255,252,255,249,255,252,255,250,255,255,255,249,255,250,255,250,255,249,255,248,255,252,255,249,255,6,0,3,0,11,0,8,0,15,0, - 17,0,14,0,17,0,17,0,21,0,26,0,26,0,29,0,29,0,29,0,24,0,19,0,17,0,19,0,19,0,14,0,21,0,19,0,24,0,19,0, - 21,0,21,0,19,0,14,0,21,0,6,0,10,0,15,0,6,0,3,0,4,0,3,0,4,0,255,255,253,255,245,255,244,255,244,255,241,255,241,255, - 238,255,245,255,241,255,238,255,235,255,235,255,232,255,232,255,231,255,232,255,235,255,235,255,231,255,228,255,221,255,221,255,223,255,223,255,230,255,213,255, - 213,255,216,255,210,255,208,255,203,255,212,255,212,255,206,255,210,255,212,255,208,255,216,255,210,255,209,255,213,255,206,255,213,255,223,255,221,255,227,255, - 230,255,232,255,228,255,226,255,230,255,224,255,226,255,224,255,226,255,230,255,234,255,228,255,230,255,232,255,231,255,227,255,232,255,235,255,239,255,244,255, - 237,255,252,255,249,255,249,255,250,255,252,255,252,255,0,0,248,255,255,255,252,255,250,255,3,0,1,0,252,255,248,255,246,255,245,255,245,255,245,255, - 246,255,242,255,249,255,249,255,245,255,250,255,249,255,252,255,253,255,1,0,1,0,4,0,0,0,3,0,6,0,3,0,8,0,7,0,7,0,250,255, - 4,0,252,255,246,255,253,255,252,255,3,0,4,0,250,255,249,255,239,255,250,255,249,255,4,0,0,0,11,0,11,0,15,0,17,0,21,0,14,0, - 17,0,21,0,21,0,25,0,22,0,22,0,28,0,35,0,25,0,26,0,24,0,26,0,25,0,24,0,18,0,26,0,24,0,26,0,28,0,19,0, - 29,0,30,0,25,0,26,0,35,0,35,0,28,0,22,0,28,0,28,0,33,0,30,0,30,0,37,0,37,0,39,0,28,0,22,0,19,0,18,0, - 10,0,12,0,14,0,15,0,11,0,12,0,14,0,17,0,8,0,8,0,8,0,10,0,19,0,4,0,6,0,8,0,11,0,8,0,6,0,6,0, - 8,0,1,0,252,255,253,255,1,0,253,255,1,0,1,0,8,0,7,0,7,0,7,0,4,0,6,0,255,255,252,255,253,255,255,255,252,255,250,255, - 6,0,6,0,0,0,6,0,3,0,0,0,249,255,249,255,255,255,246,255,249,255,250,255,248,255,244,255,245,255,249,255,244,255,252,255,245,255,244,255, - 242,255,245,255,237,255,237,255,244,255,244,255,250,255,255,255,1,0,253,255,255,255,255,255,6,0,4,0,4,0,253,255,255,255,0,0,1,0,252,255, - 241,255,250,255,252,255,255,255,0,0,255,255,1,0,253,255,244,255,245,255,239,255,244,255,248,255,3,0,8,0,7,0,11,0,3,0,10,0,14,0, - 14,0,14,0,15,0,22,0,26,0,24,0,26,0,26,0,22,0,26,0,32,0,33,0,33,0,33,0,29,0,30,0,30,0,36,0,29,0,21,0, - 19,0,18,0,19,0,21,0,17,0,17,0,18,0,12,0,7,0,4,0,1,0,252,255,255,255,4,0,3,0,248,255,242,255,242,255,238,255,241,255, - 238,255,239,255,237,255,239,255,241,255,235,255,232,255,231,255,230,255,234,255,231,255,232,255,230,255,234,255,235,255,234,255,227,255,230,255,231,255,220,255, - 217,255,210,255,213,255,217,255,217,255,219,255,220,255,219,255,226,255,223,255,212,255,220,255,220,255,220,255,210,255,223,255,230,255,224,255,227,255,231,255, - 231,255,231,255,234,255,226,255,232,255,237,255,241,255,235,255,232,255,231,255,232,255,237,255,235,255,234,255,0,0}; -const char* BinaryData::cello_wav = (const char*) temp2; - -static const unsigned char temp3[] = {60,68,69,77,79,95,84,65,66,76,69,95,68,65,84,65,62,13,10,32,32,32,32,60,67,79,76,85,77,78,83,62,13,10,32,32,32,32,32,32, - 32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,49,34,32,110,97,109,101,61,34,73,68,34,32,119,105,100,116,104,61,34, - 53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,50,34,32,110,97,109,101, - 61,34,65,114,116,105,115,116,34,32,119,105,100,116,104,61,34,49,53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78, - 32,99,111,108,117,109,110,73,100,61,34,51,34,32,110,97,109,101,61,34,83,111,110,103,34,32,119,105,100,116,104,61,34,50,48,48,34,47,62,13, - 10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,52,34,32,110,97,109,101,61,34,65,108,98,117, - 109,34,32,119,105,100,116,104,61,34,49,48,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110, - 73,100,61,34,53,34,32,110,97,109,101,61,34,82,97,116,105,110,103,34,32,119,105,100,116,104,61,34,49,50,48,34,47,62,13,10,32,32,32,32, - 32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,54,34,32,110,97,109,101,61,34,71,101,110,114,101,34,32,119,105, - 100,116,104,61,34,56,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,55,34, - 32,110,97,109,101,61,34,76,101,110,103,116,104,34,32,119,105,100,116,104,61,34,56,48,34,47,62,13,10,32,32,32,32,60,47,67,79,76,85,77, - 78,83,62,13,10,32,32,32,32,60,68,65,84,65,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,49,34,32,65, - 114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110, - 103,61,34,84,97,120,109,97,110,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,51,57,34,32,82,97, - 116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,50,34,32,65,114,116,105,115,116, - 61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110,103,61,34,69,108, - 101,97,110,111,114,32,82,105,103,98,121,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,48,55,34,32, - 82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,51,34,32,65,114,116,105, - 115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110,103,61,34, - 73,39,109,32,111,110,108,121,32,83,108,101,101,112,105,110,103,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34, - 51,58,48,49,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,52, - 34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32, - 83,111,110,103,61,34,89,101,108,108,111,119,32,83,117,98,109,97,114,105,110,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110, - 103,116,104,61,34,50,58,52,48,34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73, - 68,61,34,48,53,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,117,98,98,101, - 114,32,83,111,117,108,34,32,83,111,110,103,61,34,68,114,105,118,101,32,77,121,32,67,97,114,34,32,71,101,110,114,101,61,34,82,111,99,107,34, - 32,76,101,110,103,116,104,61,34,50,58,51,48,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84, - 69,77,32,73,68,61,34,48,54,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82, - 117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,78,111,114,119,101,103,105,97,110,32,87,111,111,100,34,32,71,101,110,114,101,61, - 34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,48,53,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32, - 32,32,32,60,73,84,69,77,32,73,68,61,34,48,55,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108, - 98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,78,111,119,104,101,114,101,32,77,97,110,34,32,71,101,110, - 114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,52,34,32,82,97,116,105,110,103,61,34,53,34,47,62,13,10,32,32, - 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,56,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34, - 32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,84,104,101,32,87,111,114,100,34,32,71,101,110, - 114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,51,34,32,82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32, - 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,57,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34, - 32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,87,104,97,116,32,71,111,101,115,32,79,110,34, - 32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,53,48,34,32,82,97,116,105,110,103,61,34,51,34,47,62, - 13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,48,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116, - 108,101,115,34,32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,73,110,32,77,121,32,76,105,102, - 101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,50,55,34,32,82,97,116,105,110,103,61,34,49,34, - 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,49,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97, - 117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,76,97,122,121, - 32,67,97,108,109,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,54,58,51,54,34,32,82,97, - 116,105,110,103,61,34,54,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,50,34,32,65,114,116,105,115,116, - 61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111, - 110,103,61,34,70,108,117,102,102,121,32,84,117,102,116,115,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116, - 104,61,34,51,58,48,53,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61, - 34,49,51,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111, - 114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,79,111,109,105,110,103,109,97,107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97, - 108,34,32,76,101,110,103,116,104,61,34,50,58,52,50,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32,32,60, - 73,84,69,77,32,73,68,61,34,49,52,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117, - 109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,70,101,101,116,45,76,105,107,101,32,70,105,110,115,34,32,71, - 101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,50,54,34,32,82,97,116,105,110,103,61,34,49,34, - 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,53,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97, - 117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103, - 61,34,75,110,111,119,32,87,104,111,32,89,111,117,32,65,114,101,32,65,116,32,69,118,101,114,121,32,65,103,101,34,32,71,101,110,114,101,61,34, - 69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,52,50,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32, - 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,54,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110, - 115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103,61,34,69,118,97,110, - 103,101,108,105,110,101,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,52,58,51,49,34,32,82, - 97,116,105,110,103,61,34,53,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,55,34,32,65,114,116,105,115, - 116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67, - 97,102,101,34,32,83,111,110,103,61,34,66,108,117,101,98,101,97,114,100,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76, - 101,110,103,116,104,61,34,51,58,53,54,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77, - 32,73,68,61,34,49,56,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70, - 111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103,61,34,83,113,117,101,101,122,101,45,87,97,120,34,32,71,101, - 110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,52,57,34,32,82,97,116,105,110,103,61,34,49,34,47, - 62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,57,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117, - 32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103, - 61,34,67,104,101,114,114,121,45,67,111,108,111,117,114,101,100,32,70,117,110,107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34, - 32,76,101,110,103,116,104,61,34,51,58,49,51,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84, - 69,77,32,73,68,61,34,50,48,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61, - 34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103,61,34,73,99,101,98,108,105,110,107,32,76,117,99, - 107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,49,56,34,32,82,97,116,105,110,103, - 61,34,55,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,49,34,32,65,114,116,105,115,116,61,34,67,111, - 99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34, - 32,83,111,110,103,61,34,70,105,102,116,121,45,70,105,102,116,121,32,67,108,111,119,110,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97, - 108,34,32,76,101,110,103,116,104,61,34,51,58,49,53,34,32,82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32,32,32,32,32,32,32,60, - 73,84,69,77,32,73,68,61,34,50,50,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117, - 109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103,61,34,70,111,116,122,101,112,111,108,105,116, - 105,99,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,51,48,34,32,82,97,116,105,110, - 103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,51,34,32,65,114,116,105,115,116,61,34,82, - 111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79,102,116,101,110,32,68,114,101,97,109,32,111,102,32, - 84,114,97,105,110,115,34,32,83,111,110,103,61,34,78,111,99,116,117,114,110,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110, - 103,116,104,61,34,49,58,52,50,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73, - 68,61,34,50,52,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73, - 32,79,102,116,101,110,32,68,114,101,97,109,32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,85,110,99,111,114,114,101,99,116,101, - 100,32,80,101,114,115,111,110,97,108,105,116,121,32,84,114,97,105,116,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116, - 104,61,34,49,58,52,53,34,32,82,97,116,105,110,103,61,34,53,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61, - 34,50,53,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79, - 102,116,101,110,32,68,114,101,97,109,32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,77,121,32,70,97,118,111,117,114,105,116,101, - 32,66,117,105,108,100,105,110,103,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,57,34,32,82, - 97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,54,34,32,65,114,116,105,115, - 116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79,102,116,101,110,32,68,114,101,97,109, - 32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,72,101,97,114,116,102,117,108,32,111,102,32,76,101,97,118,101,115,34,32,71,101, - 110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,51,48,34,32,82,97,116,105,110,103,61,34,55,34,47,62,13,10,32, - 32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,55,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104, - 99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110,103,61,34,80,101,110,101,108,111,112,101,39,115,32,65,110,103, - 108,101,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,51,58,49,56,34,32,82,97,116,105,110,103,61,34, - 49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,56,34,32,65,114,116,105,115,116,61,34,82,111,98,121, - 110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110,103,61,34,89,111,117,32,82,101,109, - 105,110,100,32,77,101,32,79,102,32,89,111,117,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,49,53, - 34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,57,34,32,65,114, - 116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110, - 103,61,34,84,104,101,32,87,111,108,102,32,72,111,117,115,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34, - 51,58,50,51,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,48, - 34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,74,101,119,101,108,115, - 32,70,111,114,32,83,111,112,104,105,97,34,32,83,111,110,103,61,34,77,101,120,105,99,97,110,32,71,111,100,34,32,71,101,110,114,101,61,34,82, - 111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,53,55,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32, - 32,60,73,84,69,77,32,73,68,61,34,51,49,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32, - 65,108,98,117,109,61,34,74,101,119,101,108,115,32,70,111,114,32,83,111,112,104,105,97,34,32,83,111,110,103,61,34,84,104,101,32,67,104,101,101, - 115,101,32,65,108,97,114,109,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,48,51,34,32,82,97,116, - 105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,50,34,32,65,114,116,105,115,116,61, - 34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,74,101,119,101,108,115,32,70,111,114,32,83,111,112,104, - 105,97,34,32,83,111,110,103,61,34,78,111,44,32,73,32,68,111,110,39,116,32,82,101,109,101,109,98,101,114,32,71,117,105,108,100,102,111,114,100, - 34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,52,53,34,32,82,97,116,105,110,103,61,34,54,34,47, - 62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,51,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114, - 114,101,116,116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,66,97,98,121,32,76,101,109,111,110,97,100, - 101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,49,48,34,32,82,97,116,105,110,103,61,34,50,34, - 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,52,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97, - 114,114,101,116,116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,68,111,109,105,110,111,101,115,34,32,71, - 101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,48,56,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10, - 32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,53,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114,114,101,116, - 116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,71,105,103,111,108,111,32,65,117,110,116,34,32,71,101, - 110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,53,58,52,54,34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32, - 32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,54,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114,114,101,116,116, - 34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,69,102,102,101,114,118,101,115,99,105,110,103,32,69,108,101, - 112,104,97,110,116,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,49,58,53,50,34,32,82,97,116,105,110,103, - 61,34,53,34,47,62,13,10,32,32,32,32,60,47,68,65,84,65,62,13,10,60,47,68,69,77,79,95,84,65,66,76,69,95,68,65,84,65,62,0,0}; -const char* BinaryData::demo_table_data_xml = (const char*) temp3; - -static const unsigned char temp4[] = {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, - 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,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,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,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,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,47,32,116,104,105,115,32,105,115,32,116,104,101,32,108,105,115,116,98,111,120,32,99,111,110,116,97,105,110,105,110,103,32,116,104,101,32,100, - 114,97,103,103,97,98,108,101,32,115,111,117,114,99,101,32,99,111,109,112,111,110,101,110,116,115,46,46,13,10,13,10,99,108,97,115,115,32,68,114, - 97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,32,32,58,32,112,117,98,108,105,99,32,76,105,115,116,66,111,120,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,32,32,32,32,32,32,112,117,98,108,105,99,32,76,105, - 115,116,66,111,120,77,111,100,101,108,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,114,97,103,65,110, - 100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,41,13,10,32,32,32,32,32,32,32,32,58,32,76,105,115,116,66,111,120,32,40,84,40, - 34,100,43,100,32,115,111,117,114,99,101,34,41,44,32,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,101,108, - 108,115,32,116,104,101,32,76,105,115,116,66,111,120,32,116,104,97,116,32,116,104,105,115,32,111,98,106,101,99,116,32,115,117,112,112,108,105,101,115, - 32,116,104,101,32,105,110,102,111,32,97,98,111,117,116,13,10,32,32,32,32,32,32,32,32,47,47,32,105,116,115,32,114,111,119,115,46,13,10,32, - 32,32,32,32,32,32,32,115,101,116,77,111,100,101,108,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,77,117, - 108,116,105,112,108,101,83,101,108,101,99,116,105,111,110,69,110,97,98,108,101,100,32,40,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13, - 10,32,32,32,32,126,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,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,47,47,32,84,104,101,32,102,111,108,108,111,119,105,110,103,32,109,101,116,104,111,100, - 115,32,105,109,112,108,101,109,101,110,116,32,116,104,101,32,110,101,99,101,115,115,97,114,121,32,118,105,114,116,117,97,108,32,102,117,110,99,116,105, - 111,110,115,32,102,114,111,109,32,76,105,115,116,66,111,120,77,111,100,101,108,44,13,10,32,32,32,32,47,47,32,116,101,108,108,105,110,103,32,116, - 104,101,32,108,105,115,116,98,111,120,32,104,111,119,32,109,97,110,121,32,114,111,119,115,32,116,104,101,114,101,32,97,114,101,44,32,112,97,105,110, - 116,105,110,103,32,116,104,101,109,44,32,101,116,99,46,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40,41,13,10,32, - 32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,51,48,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118, - 111,105,100,32,112,97,105,110,116,76,105,115,116,66,111,120,73,116,101,109,32,40,105,110,116,32,114,111,119,78,117,109,98,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,32,32,71,114,97,112,104,105,99,115,38,32,103,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,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116, - 32,104,101,105,103,104,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,32,32,98,111,111, - 108,32,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119, - 73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111, - 117,114,115,58,58,108,105,103,104,116,98,108,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32, - 40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,104,101, - 105,103,104,116,32,42,32,48,46,55,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,84,40,34, - 82,111,119,32,78,117,109,98,101,114,32,34,41,32,43,32,83,116,114,105,110,103,32,40,114,111,119,78,117,109,98,101,114,32,43,32,49,41,44,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,53,44,32,48,44,32,119,105,100,116,104,44,32,104,101,105,103,104,116, - 44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101, - 110,116,114,101,100,76,101,102,116,44,32,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,83,116, - 114,105,110,103,32,103,101,116,68,114,97,103,83,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,32,40,99,111,110,115,116,32,83,112,97, - 114,115,101,83,101,116,60,105,110,116,62,38,32,115,101,108,101,99,116,101,100,82,111,119,115,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,47,47,32,102,111,114,32,111,117,114,32,100,114,97,103,32,100,101,115,99,116,114,105,112,116,105,111,110,44,32,119,101,39,108,108,32,106, - 117,115,116,32,109,97,107,101,32,97,32,108,105,115,116,32,111,102,32,116,104,101,32,115,101,108,101,99,116,101,100,13,10,32,32,32,32,32,32,32, - 32,47,47,32,114,111,119,32,110,117,109,98,101,114,115,32,45,32,116,104,105,115,32,119,105,108,108,32,98,101,32,112,105,99,107,101,100,32,117,112, - 32,98,121,32,116,104,101,32,100,114,97,103,32,116,97,114,103,101,116,32,97,110,100,32,100,105,115,112,108,97,121,101,100,32,105,110,13,10,32,32, - 32,32,32,32,32,32,47,47,32,105,116,115,32,98,111,120,46,13,10,32,32,32,32,32,32,32,32,83,116,114,105,110,103,32,100,101,115,99,59,13, - 10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,115,101,108,101,99,116,101,100,82, - 111,119,115,46,115,105,122,101,40,41,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,40,115, - 101,108,101,99,116,101,100,82,111,119,115,32,91,105,93,32,43,32,49,41,32,60,60,32,84,40,34,32,34,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,114,101,116,117,114,110,32,100,101,115,99,46,116,114,105,109,40,41,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,47,47,32,116,104,105,115,32,106,117,115,116,32,102,105,108,108,115,32,105,110,32,116,104,101,32,98,97,99,107,103,114,111,117,110,100,32, - 111,102,32,116,104,101,32,108,105,115,116,98,111,120,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115, - 38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58, - 58,119,104,105,116,101,46,119,105,116,104,65,108,112,104,97,32,40,48,46,55,102,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, - 47,42,118,111,105,100,32,108,105,115,116,66,111,120,73,116,101,109,67,108,105,99,107,101,100,32,40,105,110,116,32,114,111,119,44,32,99,111,110,115, - 116,32,77,111,117,115,101,69,118,101,110,116,38,32,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101, - 110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49,44,32,34,115,100,102,115,100,102,115,34,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,109,46,115,104,111,119,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,65,108,101,114,116, - 87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102, - 111,73,99,111,110,44,32,34,97,115,100,102,115,97,100,102,97,100,115,34,44,32,34,115,114,100,102,115,100,102,97,34,41,59,13,10,32,32,32,32, - 32,32,32,32,68,111,99,117,109,101,110,116,87,105,110,100,111,119,42,32,100,119,32,61,32,110,101,119,32,68,111,99,117,109,101,110,116,87,105,110, - 100,111,119,32,40,34,115,102,100,115,100,34,44,32,67,111,108,111,117,114,115,58,58,119,104,105,116,101,44,32,68,111,99,117,109,101,110,116,87,105, - 110,100,111,119,58,58,97,108,108,66,117,116,116,111,110,115,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,100,119,45,62,115,101, - 116,66,111,117,110,100,115,32,40,49,48,48,44,32,49,48,48,44,32,53,48,48,44,32,53,48,48,41,59,13,10,32,32,32,32,32,32,32,32,100, - 119,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,125,42,47,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,47,47,32,97,110,100,32,116,104,105,115,32,105,115,32,97,32,99,111,109,112,111,110,101,110,116,32,116,104,97,116,32,99,97,110,32,104,97, - 118,101,32,116,104,105,110,103,115,32,100,114,111,112,112,101,100,32,111,110,116,111,32,105,116,46,46,13,10,13,10,99,108,97,115,115,32,68,114,97, - 103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,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,32,32,32,32,32,32,112,117,98,108,105,99,32,68, - 114,97,103,65,110,100,68,114,111,112,84,97,114,103,101,116,13,10,123,13,10,32,32,32,32,98,111,111,108,32,115,111,109,101,116,104,105,110,103,73, - 115,66,101,105,110,103,68,114,97,103,103,101,100,79,118,101,114,59,13,10,32,32,32,32,83,116,114,105,110,103,32,109,101,115,115,97,103,101,59,13, - 10,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,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114, - 103,101,116,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114, - 97,103,103,101,100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,13,10,32,32,32,32,32,32,32,32,109,101,115,115,97,103,101,32,61,32, - 84,40,34,68,114,97,103,45,97,110,100,45,100,114,111,112,32,115,111,109,101,32,114,111,119,115,32,102,114,111,109,32,116,104,101,32,116,111,112,45, - 108,101,102,116,32,98,111,120,32,111,110,116,111,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,33,34,41,59,13,10,32,32,32,32,125,13, - 10,13,10,32,32,32,32,126,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,40,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, - 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,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,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38, - 32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58, - 103,114,101,101,110,46,119,105,116,104,65,108,112,104,97,32,40,48,46,50,102,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,100, - 114,97,119,32,97,32,114,101,100,32,108,105,110,101,32,97,114,111,117,110,100,32,116,104,101,32,99,111,109,112,32,105,102,32,116,104,101,32,117,115, - 101,114,39,115,32,99,117,114,114,101,110,116,108,121,32,100,114,97,103,103,105,110,103,32,115,111,109,101,116,104,105,110,103,32,111,118,101,114,32,105, - 116,46,46,13,10,32,32,32,32,32,32,32,32,105,102,32,40,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114,97,103,103,101,100, - 79,118,101,114,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117, - 114,32,40,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99, - 116,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,51,41,59,13,10,32, - 32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115, - 58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,49,52,46,48,102,41,59,13,10,32, - 32,32,32,32,32,32,32,103,46,100,114,97,119,70,105,116,116,101,100,84,101,120,116,32,40,109,101,115,115,97,103,101,44,32,49,48,44,32,48,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,44,32,74,117,115,116,105,102,105,99,97, - 116,105,111,110,58,58,99,101,110,116,114,101,100,44,32,52,41,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,98, - 111,111,108,32,105,115,73,110,116,101,114,101,115,116,101,100,73,110,68,114,97,103,83,111,117,114,99,101,32,40,99,111,110,115,116,32,83,116,114,105, - 110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,67,111,109,112, - 111,110,101,110,116,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,110,111,114,109,97,108,108,121,32,121,111,117,39,100, - 32,99,104,101,99,107,32,116,104,101,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,32,118,97,108,117,101,32,116,111,32,115,101, - 101,32,105,102,32,105,116,39,115,32,116,104,101,13,10,32,32,32,32,32,32,32,32,47,47,32,115,111,114,116,32,111,102,32,111,98,106,101,99,116, - 32,116,104,97,116,32,121,111,117,39,114,101,32,105,110,116,101,114,101,115,116,101,100,32,105,110,32,98,101,102,111,114,101,32,114,101,116,117,114,110, - 105,110,103,32,116,114,117,101,44,32,98,117,116,32,102,111,114,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,100,101,109,111,44,32, - 119,101,39,108,108,32,115,97,121,32,121,101,115,32,116,111,32,97,110,121,116,104,105,110,103,46,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,118,111,105,100,32,105,116,101,109,68,114,97,103,69,110,116, - 101,114,32,40,99,111,110,115,116,32,83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120, - 44,32,105,110,116,32,121,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110, - 103,68,114,97,103,103,101,100,79,118,101,114,32,61,32,116,114,117,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59, - 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,97,103,77,111,118,101,32,40,99,111,110,115,116,32, - 83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120,44,32,105,110,116,32,121,41,13,10,32,32, - 32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,97,103,69,120,105,116,32,40,99,111,110, - 115,116,32,83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,67,111,109,112,111,110,101,110,116, - 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114,97,103,103,101, - 100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32, - 125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,111,112,112,101,100,32,40,99,111,110,115,116,32,83,116,114,105,110,103,38, - 32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120,44,32,105,110,116,32,121,41,13,10,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,109,101,115,115,97,103,101,32,61,32,84,40,34,108,97,115,116,32,114,111,119,115,32,100,114,111,112,112,101,100,58,32,34,41,32,43, - 32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,59,13,10,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103, - 73,115,66,101,105,110,103,68,114,97,103,103,101,100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112, - 97,105,110,116,40,41,59,13,10,32,32,32,32,125,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,68,114,97,103,65,110,100,68, - 114,111,112,68,101,109,111,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,68,114,97,103,65,110,100,68,114,111,112,67,111,110,116,97,105,110, - 101,114,13,10,123,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,114,97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,42,32, - 115,111,117,114,99,101,59,13,10,32,32,32,32,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,42,32,116,97,114,103, - 101,116,59,13,10,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,114,97,103,65,110,100,68,114,111,112,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,84,40,34,68,114,97,103,45,97,110,100, - 45,68,114,111,112,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,111,117,114,99,101,32,61,32,110,101,119,32,68,114,97,103,65,110, - 100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,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,115,111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,97,114,103,101,116,32,61,32,110,101,119,32, - 68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,40,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,116,97,114,103,101,116,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,114,97, - 103,65,110,100,68,114,111,112,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,115,111,117,114,99,101,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32, - 49,48,44,32,50,53,48,44,32,49,53,48,41,59,13,10,32,32,32,32,32,32,32,32,116,97,114,103,101,116,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,50,54,48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,49,54,48,44,32, - 50,53,48,44,32,49,53,48,41,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,47,47,32,40,110,101,101,100,32, - 116,111,32,112,117,116,32,116,104,105,115,32,105,110,32,116,111,32,100,105,115,97,109,98,105,103,117,97,116,101,32,116,104,101,32,110,101,119,47,100, - 101,108,101,116,101,32,111,112,101,114,97,116,111,114,115,32,117,115,101,100,32,105,110,32,116,104,101,13,10,32,32,32,32,47,47,32,116,119,111,32, - 98,97,115,101,32,99,108,97,115,115,101,115,41,46,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,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,68,114,97, - 103,65,110,100,68,114,111,112,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,68,114,97,103,65,110, - 100,68,114,111,112,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::draganddropdemo_cpp = (const char*) temp4; - -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,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,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,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,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,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,70,111,110,116,115,65,110,100,84,101,120,116,68,101,109,111,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,32,112,117,98,108,105,99, - 32,76,105,115,116,66,111,120,77,111,100,101,108,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,32,112,117,98,108,105,99,32,66,117,116,116,111,110,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,32,112,117,98,108,105,99,32,83,108,105,100,101,114,76,105,115,116,101,110,101,114,13,10,123,13,10,32,32, - 32,32,79,119,110,101,100,65,114,114,97,121,32,60,70,111,110,116,62,32,102,111,110,116,115,59,13,10,32,32,32,32,76,105,115,116,66,111,120,42, - 32,108,105,115,116,66,111,120,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,116,101,120,116,66,111,120,59,13,10,32,32,32, - 32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,98,111,108,100,66,117,116,116,111,110,59,13,10,32,32,32,32,84,111,103,103,108,101,66,117, - 116,116,111,110,42,32,105,116,97,108,105,99,66,117,116,116,111,110,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,115,105,122,101,83,108,105, - 100,101,114,59,13,10,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,77,97,110,97,103,101,114,32,118,101,114, - 116,105,99,97,108,76,97,121,111,117,116,59,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,77,97,110,97,103, - 101,114,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,59,13,10,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76, - 97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,42,32,118,101,114,116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,59,13,10,32,32, - 32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,42,32,104,111,114,105,122,111,110,116,97, - 108,68,105,118,105,100,101,114,66,97,114,59,13,10,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,70,111,110,116,115, - 65,110,100,84,101,120,116,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,84, - 40,34,70,111,110,116,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,70,111,110,116,58,58,102,105,110,100,70,111,110,116,115,32,40, - 102,111,110,116,115,41,59,13,10,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,108,105, - 115,116,66,111,120,32,61,32,110,101,119,32,76,105,115,116,66,111,120,32,40,84,40,34,102,111,110,116,115,34,41,44,32,116,104,105,115,41,41,59, - 13,10,32,32,32,32,32,32,32,32,108,105,115,116,66,111,120,45,62,115,101,116,82,111,119,72,101,105,103,104,116,32,40,50,56,41,59,13,10,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,116,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,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116, - 67,111,108,111,117,114,32,40,84,101,120,116,69,100,105,116,111,114,58,58,98,97,99,107,103,114,111,117,110,100,67,111,108,111,117,114,73,100,44,32, - 67,111,108,111,117,114,115,58,58,119,104,105,116,101,41,59,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,67,111, - 108,111,117,114,32,40,84,101,120,116,69,100,105,116,111,114,58,58,111,117,116,108,105,110,101,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117, - 114,115,58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,53,102,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 116,101,120,116,66,111,120,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32, - 32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,82,101,116,117,114,110,75,101,121,83,116,97,114,116,115,78,101,119,76,105,110,101,32, - 40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,84,101,120,116,32,40,84,40,34,84,104, - 101,32,81,117,105,99,107,32,66,114,111,119,110,32,70,111,120,32,74,117,109,112,101,100,32,79,118,101,114,32,84,104,101,32,76,97,122,121,32,68, - 111,103,92,110,92,110,65,97,32,66,98,32,67,99,32,68,100,32,69,101,32,70,102,32,71,103,32,72,104,32,73,105,32,74,106,32,75,107,32,76, - 108,32,77,109,32,78,110,32,79,111,32,80,112,32,81,113,32,82,114,32,83,115,32,84,116,32,85,117,32,86,118,32,87,119,32,88,120,32,89,121, - 32,90,122,32,48,49,50,51,52,53,54,55,56,57,34,41,41,59,13,10,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,111,108,100,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108,101,66,117,116,116,111,110,32,40, - 84,40,34,98,111,108,100,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,98,111,108,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,97,100,100,65,110,100,77,97,107, - 101,86,105,115,105,98,108,101,32,40,105,116,97,108,105,99,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108,101,66,117,116,116,111, - 110,32,40,84,40,34,105,116,97,108,105,99,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,105,116,97,108,105,99,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,97,100, - 100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,115,105,122,101,83,108,105,100,101,114,32,61,32,110,101,119,32,83,108,105,100,101,114, - 32,40,84,40,34,115,105,122,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105,100,101,114,45,62,115,101,116,82, - 97,110,103,101,32,40,51,46,48,44,32,49,53,48,46,48,44,32,48,46,49,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105, - 100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,50,48,46,48,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105,100,101, - 114,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,108,105,115,116,66,111, - 120,45,62,115,101,108,101,99,116,82,111,119,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,108,105,115,116,66,111,120,45,62,115,101,116,67, - 111,108,111,117,114,32,40,76,105,115,116,66,111,120,58,58,111,117,116,108,105,110,101,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115, - 58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,53,102,41,41,59,13,10,32,32,32,32,32,32,32,32,108,105,115,116, - 66,111,120,45,62,115,101,116,79,117,116,108,105,110,101,84,104,105,99,107,110,101,115,115,32,40,49,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,47,47,32,115,101,116,32,117,112,32,116,104,101,32,108,97,121,111,117,116,32,97,110,100,32,114,101,115,105,122,101,114,32,98,97,114,115,46,46, - 13,10,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116, - 32,40,48,44,32,45,48,46,50,44,32,45,48,46,56,44,32,45,48,46,53,41,59,32,32,47,47,32,119,105,100,116,104,32,111,102,32,116,104,101, - 32,102,111,110,116,32,108,105,115,116,32,109,117,115,116,32,98,101,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,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,32,32,32,32,32,32,32,32,32,32, - 32,47,47,32,98,101,116,119,101,101,110,32,50,48,37,32,97,110,100,32,56,48,37,44,32,112,114,101,102,101,114,97,98,108,121,32,53,48,37,13, - 10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49, - 44,32,56,44,32,56,44,32,56,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,118,101,114,116,105,99,97,108,32,100,105, - 118,105,100,101,114,32,100,114,97,103,45,98,97,114,32,116,104,105,110,103,32,105,115,32,97,108,119,97,121,115,32,56,32,112,105,120,101,108,115,32, - 119,105,100,101,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111, - 117,116,32,40,50,44,32,49,53,48,44,32,45,49,46,48,44,32,45,48,46,53,41,59,32,32,32,47,47,32,116,104,101,32,99,111,109,112,111,110, - 101,110,116,115,32,111,110,32,116,104,101,32,114,105,103,104,116,32,109,117,115,116,32,98,101,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,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,32,32,32, - 32,32,32,32,32,32,32,32,47,47,32,97,116,32,108,101,97,115,116,32,49,53,48,32,112,105,120,101,108,115,32,119,105,100,101,44,32,112,114,101, - 102,101,114,97,98,108,121,32,53,48,37,32,111,102,32,116,104,101,32,116,111,116,97,108,32,119,105,100,116,104,13,10,13,10,32,32,32,32,32,32, - 32,32,118,101,114,116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,32,61,32,110,101,119,32,83,116,114,101,116,99,104,97,98,108,101,76,97, - 121,111,117,116,82,101,115,105,122,101,114,66,97,114,32,40,38,118,101,114,116,105,99,97,108,76,97,121,111,117,116,44,32,49,44,32,116,114,117,101, - 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,118,101,114,116,105,99,97,108,68, - 105,118,105,100,101,114,66,97,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46, - 115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,48,44,32,45,48,46,50,44,32,45,49,46,48,44,32,45,48,46,52,41,59,32,32,47,47, - 32,104,101,105,103,104,116,32,111,102,32,116,104,101,32,102,111,110,116,32,116,101,120,116,32,98,111,120,32,109,117,115,116,32,98,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,98,101,116,119,101,101,110,32,50,48,37,32,97,110,100,32, - 49,48,48,37,44,32,112,114,101,102,101,114,97,98,108,121,32,52,48,37,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, - 76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49,44,32,56,44,32,56,44,32,56,41,59,32,32,32,32,32,32, - 32,32,32,32,32,47,47,32,116,104,101,32,104,111,114,105,122,111,110,116,97,108,32,100,105,118,105,100,101,114,32,100,114,97,103,45,98,97,114,32, - 116,104,105,110,103,32,105,115,32,97,108,119,97,121,115,32,56,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104, - 111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,50,44,32,50,44,32,53,44,32, - 53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114, - 111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121, - 111,117,116,32,40,51,44,32,49,53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,105,116,97,108,105, - 99,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104, - 13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116, - 32,40,52,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101, - 110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116, - 46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,53,44,32,49,53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47, - 47,32,116,104,101,32,98,111,108,100,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105, - 120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73, - 116,101,109,76,97,121,111,117,116,32,40,54,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103, - 97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110, - 116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,55,44,32,49,53,44,32,50,48,44,32,50,48,41,59, - 32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,105,116,97,108,105,99,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32, - 116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, - 76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,56,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32, - 32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32, - 32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,57,44,32,49, - 53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,99,111,112,121,32,99,111,100,101,32,98,117,116,116, - 111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32, - 32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49,48,44,32, - 53,44,32,45,49,46,48,44,32,53,41,59,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,103,97,112,32,97,116,32,116,104,101,32, - 98,111,116,116,111,109,32,116,104,97,116,32,119,105,108,108,32,102,105,108,108,32,117,112,32,97,110,121,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,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, - 32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,115,112,97,99,101,32,108,101,102,116,32,111,118,101,114,32,45,32,116,104,105,115,32,119, - 105,108,108,32,115,116,111,112,32,116,104,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32, - 115,108,105,100,101,114,115,32,102,114,111,109,32,97,108,119,97,121,115,32,115,116,105,99,107,105,110,103,32,116,111,32,116,104,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,98,111,116,116,111,109,32,111,102,32,116,104,101,32,119,105,110, - 100,111,119,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,32,61,32,110,101, - 119,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,32,40,38,104,111,114,105,122,111,110,116, - 97,108,76,97,121,111,117,116,44,32,49,44,32,102,97,108,115,101,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,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,41,59,13,10,32,32,32,32,125,13,10, - 13,10,32,32,32,32,126,70,111,110,116,115,65,110,100,84,101,120,116,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,47,47,32,108,97,121,32,111,117,116,32,116, - 104,101,32,108,105,115,116,32,98,111,120,32,97,110,100,32,118,101,114,116,105,99,97,108,32,100,105,118,105,100,101,114,46,46,13,10,32,32,32,32, - 32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,118,99,111,109,112,115,91,93,32,61,32,123,32,108,105,115,116,66,111,120,44,32,118,101,114, - 116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,44,32,48,32,125,59,13,10,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97, - 108,76,97,121,111,117,116,46,108,97,121,79,117,116,67,111,109,112,111,110,101,110,116,115,32,40,118,99,111,109,112,115,44,32,51,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,52, - 44,32,52,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,56,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 102,97,108,115,101,44,32,32,32,32,32,47,47,32,108,97,121,32,111,117,116,32,115,105,100,101,45,98,121,45,115,105,100,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117, - 101,41,59,32,32,32,32,32,47,47,32,114,101,115,105,122,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,115,39,32,104,101,105,103,104,116, - 115,32,97,115,32,119,101,108,108,32,97,115,32,119,105,100,116,104,115,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,110,111,119,32,108,97, - 121,32,111,117,116,32,116,104,101,32,116,101,120,116,32,98,111,120,32,97,110,100,32,116,104,101,32,99,111,110,116,114,111,108,115,32,98,101,108,111, - 119,32,105,116,46,46,13,10,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,104,99,111,109,112,115,91,93,32,61,32,123,32, - 116,101,120,116,66,111,120,44,32,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,44,32,48,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,32,32,32,32,32,32,32,98,111,108,100,66,117,116,116,111,110,44,32,48, - 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,32,32,32,32,32,32,32,105,116,97,108,105, - 99,66,117,116,116,111,110,44,32,48,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,32,32, - 32,32,32,32,32,115,105,122,101,83,108,105,100,101,114,32,125,59,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, - 76,97,121,111,117,116,46,108,97,121,79,117,116,67,111,109,112,111,110,101,110,116,115,32,40,104,99,111,109,112,115,44,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 52,32,43,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,103,101,116,73,116,101,109,67,117,114,114,101,110,116,80,111,115,105,116,105,111, - 110,32,40,50,41,44,32,47,47,32,102,111,114,32,116,104,101,105,114,32,119,105,100,116,104,115,44,32,114,101,102,101,114,32,116,111,32,116,104,101, - 32,118,101,114,116,105,99,97,108,32,108,97,121,111,117,116,32,115,116,97,116,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,52,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,118,101,114,116,105,99, - 97,108,76,97,121,111,117,116,46,103,101,116,73,116,101,109,67,117,114,114,101,110,116,65,98,115,111,108,117,116,101,83,105,122,101,32,40,50,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,32,32,32,47,47,32,108,97, - 121,32,111,117,116,32,97,98,111,118,101,32,101,97,99,104,32,111,116,104,101,114,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,32,32,32,47,47,32,114, - 101,115,105,122,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,115,39,32,119,105,100,116,104,115,32,97,115,32,119,101,108,108,32,97,115,32, - 104,101,105,103,104,116,115,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32, - 76,105,115,116,66,111,120,77,111,100,101,108,32,109,101,116,104,111,100,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40, - 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,102,111,110,116,115,46,115,105,122,101,40,41,59,13,10, - 32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32,76,105,115,116,66,111,120,77,111, - 100,101,108,32,109,101,116,104,111,100,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,76,105,115,116,66,111,120,73,116,101,109,32,40,105, - 110,116,32,114,111,119,78,117,109,98,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, - 32,32,71,114,97,112,104,105,99,115,38,32,103,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,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,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,32,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,98,108,117,101,41,59,13,10,13,10,32,32,32, - 32,32,32,32,32,105,102,32,40,102,111,110,116,115,32,91,114,111,119,78,117,109,98,101,114,93,32,33,61,32,48,41,13,10,32,32,32,32,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,70,111,110,116,32,102,111,110,116,32,40,42,102,111,110,116,115,32,91,114,111,119,78, - 117,109,98,101,114,93,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,110,116,46,115,101,116,72,101,105,103,104,116,32,40,104,101, - 105,103,104,116,32,42,32,48,46,55,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40, - 102,111,110,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,102,111,110,116,46,103,101,116, - 84,121,112,101,102,97,99,101,78,97,109,101,40,41,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,52,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105,103,104,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,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116, - 114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,117,112,100,97, - 116,101,80,114,101,118,105,101,119,66,111,120,84,101,120,116,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,70,111,110,116,42, - 32,102,32,61,32,102,111,110,116,115,32,91,108,105,115,116,66,111,120,45,62,103,101,116,83,101,108,101,99,116,101,100,82,111,119,40,41,93,59,13, - 10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,102,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,70,111,110,116,32,102,111,110,116,32,40,42,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111, - 110,116,46,115,101,116,72,101,105,103,104,116,32,40,40,102,108,111,97,116,41,32,115,105,122,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108, - 117,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,110,116,46,115,101,116,66,111,108,100,32,40,98,111,108,100,66,117, - 116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97,116,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111, - 110,116,46,115,101,116,73,116,97,108,105,99,32,40,105,116,97,108,105,99,66,117,116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97, - 116,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,97,112,112,108,121,70,111,110,116, - 84,111,65,108,108,84,101,120,116,32,40,102,111,110,116,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32, - 32,32,32,118,111,105,100,32,115,101,108,101,99,116,101,100,82,111,119,115,67,104,97,110,103,101,100,32,40,105,110,116,32,108,97,115,116,82,111,119, - 115,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,80,114,101,118,105,101,119,66, - 111,120,84,101,120,116,40,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,117,112,100,97, - 116,101,80,114,101,118,105,101,119,66,111,120,84,101,120,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115, - 108,105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83,108,105,100,101,114,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,47,47,32,40,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,115,105,122,101,32,115,108,105, - 100,101,114,32,105,115,32,109,111,118,101,100,41,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,80,114,101,118,105,101,119,66,111,120,84, - 101,120,116,40,41,59,13,10,32,32,32,32,125,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,70,111,110,116,115,65,110,100,84,101,120,116,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, - 70,111,110,116,115,65,110,100,84,101,120,116,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::fontsandtextdemo_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, - 101,119,46,115,118,103,237,28,93,115,219,54,242,61,191,66,167,188,212,83,139,196,55,64,37,118,39,77,38,157,222,244,122,51,77,59,247,216,161,40, - 72,102,77,145,58,146,178,236,252,250,91,144,20,9,82,144,45,217,106,210,155,169,213,142,169,197,114,23,216,47,236,46,16,191,253,238,126,149,140,238, - 116,94,196,89,122,53,198,30,26,143,116,26,101,243,56,93,94,141,127,251,245,227,68,141,71,69,25,166,243,48,201,82,125,53,78,179,241,119,215,175, - 222,254,99,50,25,189,207,117,88,234,249,104,27,151,55,163,31,211,219,34,10,215,122,244,205,77,89,174,167,190,191,221,110,189,184,1,122,89,190,244, - 47,70,147,9,188,89,220,45,95,141,70,35,96,155,22,211,121,116,53,110,240,215,155,60,169,240,230,145,175,19,189,210,105,89,248,216,195,254,184,67, - 143,58,244,173,158,121,185,46,178,77,30,213,228,163,200,198,204,231,139,14,21,102,178,165,21,18,14,130,192,71,196,39,100,2,24,147,226,33,45,195, - 251,73,90,188,182,94,133,9,186,94,37,8,33,31,198,58,204,227,176,166,247,9,136,225,224,100,170,81,155,59,136,126,13,255,183,47,236,0,94,189, - 214,5,188,169,189,84,151,254,135,95,63,180,131,19,228,205,203,185,69,102,39,249,30,223,158,58,210,112,165,139,117,24,233,194,223,193,171,247,183,241, - 188,188,185,26,51,133,60,84,253,172,239,43,248,141,142,151,55,165,99,224,46,214,219,239,179,251,171,49,26,161,17,83,240,95,5,142,231,87,99,16, - 4,97,65,245,117,55,211,105,107,107,200,163,164,198,108,216,219,67,140,126,59,215,119,58,233,191,59,207,162,89,88,192,162,252,155,108,165,253,63,226, - 213,42,140,252,34,143,252,232,174,240,193,74,151,217,36,142,178,116,82,222,128,1,249,64,53,9,103,137,246,195,168,4,186,197,30,49,35,131,171,49, - 60,108,140,185,77,82,189,245,118,186,107,39,165,239,215,89,94,78,22,113,162,107,244,30,239,229,226,222,79,51,152,104,226,175,231,32,202,50,223,164, - 183,62,80,44,252,239,127,252,97,21,175,244,164,212,247,165,183,78,221,100,239,231,107,80,53,97,141,76,157,56,15,3,156,107,64,122,59,215,139,194, - 32,215,130,54,223,104,53,0,67,121,56,143,195,228,7,243,11,86,85,35,89,84,163,44,73,116,4,154,12,147,109,248,80,11,197,252,84,150,56,189, - 201,53,120,206,107,120,214,97,190,163,193,145,64,45,158,225,215,103,193,17,197,237,240,178,1,254,150,198,37,184,200,166,208,249,39,99,102,255,78,127, - 43,244,30,214,175,121,152,22,96,211,171,171,241,42,44,243,248,254,155,9,241,164,100,84,5,151,8,62,216,11,68,32,145,184,196,24,224,130,208,203, - 137,146,196,83,138,179,139,150,88,4,198,39,16,247,36,102,36,232,160,15,198,88,133,39,152,84,29,116,225,196,93,56,113,115,8,136,88,122,128,169, - 196,120,228,55,226,237,139,230,104,241,26,177,57,164,122,221,140,191,45,202,108,189,195,5,43,45,31,18,176,53,3,156,0,197,44,159,206,146,48,186, - 125,83,1,50,144,103,92,62,76,241,155,113,247,70,182,88,20,26,216,34,11,86,249,32,188,1,156,72,187,128,231,241,66,46,94,216,205,139,117,194, - 242,251,75,254,122,22,106,41,251,165,22,234,54,208,9,86,1,246,4,253,235,90,168,195,0,33,86,159,221,40,220,6,200,209,97,3,180,176,132,139, - 160,199,199,167,123,198,23,51,119,78,158,50,247,103,70,140,71,205,189,217,101,15,41,150,200,47,96,238,196,195,50,112,153,251,61,190,26,83,4,80, - 46,113,167,187,7,3,21,67,19,190,39,78,92,98,156,32,240,140,225,200,63,33,246,50,206,200,241,166,255,186,78,120,158,25,125,129,23,59,197,28, - 157,220,142,54,72,224,38,190,124,252,173,228,121,56,254,194,176,234,5,67,194,60,138,132,12,120,63,24,18,15,73,25,168,94,44,220,71,93,184,80, - 77,40,228,158,34,152,99,118,132,85,227,38,137,189,68,142,7,162,88,128,193,198,133,71,49,130,160,164,39,240,141,2,2,216,188,186,56,210,179,78, - 14,199,152,11,113,138,81,46,170,159,129,81,54,139,112,71,230,221,160,195,108,12,243,211,172,116,161,204,231,4,246,248,9,246,207,52,219,227,226,155, - 177,25,193,60,14,134,212,183,46,228,129,82,177,109,70,220,35,92,246,236,114,248,98,228,120,209,172,36,140,151,249,156,142,159,216,230,48,231,146,62, - 186,163,189,254,136,204,199,25,95,158,220,69,13,249,199,55,204,215,65,104,62,207,82,93,167,162,190,54,206,164,34,140,141,168,21,59,70,71,162,167, - 163,189,55,31,85,18,57,66,73,66,252,169,74,18,234,107,41,233,216,128,68,68,112,66,56,10,169,249,156,41,28,17,137,78,10,70,44,50,159,51, - 5,35,34,241,51,83,186,125,17,242,83,68,184,8,205,231,92,34,20,167,137,112,86,253,156,75,132,226,108,34,196,132,227,175,183,45,2,115,122,218, - 182,184,88,112,50,76,222,32,10,97,72,30,144,114,243,231,143,79,64,158,58,1,186,151,61,62,123,95,38,38,157,250,226,233,100,173,243,195,249,36, - 145,234,196,250,198,236,6,156,123,131,133,86,27,7,225,94,31,186,112,226,46,156,184,38,237,132,4,85,242,94,220,117,75,4,112,169,244,36,40,20, - 211,30,89,10,64,129,137,226,189,41,40,200,102,25,195,65,127,186,251,184,145,19,247,112,234,139,160,134,83,68,82,71,234,11,166,64,137,20,242,146, - 122,148,83,206,13,142,96,130,49,121,113,162,188,247,117,6,41,158,181,101,63,162,124,179,237,60,105,68,79,139,90,9,79,34,197,120,95,131,148,123, - 146,10,200,238,123,162,166,20,100,34,122,41,158,19,55,114,226,58,68,109,90,207,186,146,52,98,1,53,114,101,24,83,114,30,41,170,163,164,200,207, - 34,69,170,60,204,149,24,84,95,210,35,2,138,120,33,7,6,139,25,237,229,77,145,19,55,114,226,254,21,13,86,28,37,234,186,112,123,169,176,79, - 139,151,77,22,251,72,136,36,138,158,173,7,4,37,49,9,36,162,238,106,185,30,98,158,192,148,147,0,84,17,64,97,142,212,197,163,169,120,116,108, - 182,239,44,11,218,18,224,252,66,165,143,11,149,255,213,133,122,76,149,235,170,134,219,202,183,22,233,91,223,28,42,85,79,237,145,153,57,0,155,155, - 243,190,238,228,201,156,199,53,36,214,225,82,87,57,8,72,178,78,194,154,129,89,150,207,117,190,27,18,213,79,111,168,73,83,234,51,193,0,34,165, - 220,141,183,250,51,196,45,52,228,26,47,110,194,121,182,133,213,14,7,63,103,217,170,235,150,117,54,97,162,57,134,253,84,178,54,190,117,131,192,103, - 34,60,198,20,98,74,238,141,110,242,220,28,25,38,225,131,134,69,85,191,118,115,46,110,178,237,50,55,194,89,132,73,43,157,246,85,51,52,153,205, - 204,137,105,153,111,246,134,219,211,200,77,109,86,205,41,171,133,177,141,83,88,230,164,57,168,85,146,28,64,216,157,216,138,118,39,24,98,192,20,176, - 16,7,6,141,219,241,61,153,153,197,217,178,174,151,216,152,204,74,151,225,60,44,195,206,60,118,16,214,30,78,206,23,211,95,62,124,108,211,217,40, - 154,254,39,203,111,187,204,211,32,132,179,108,3,19,111,147,126,115,222,25,77,141,243,132,229,117,188,2,246,230,140,253,219,251,85,2,86,218,14,244, - 144,203,135,181,238,136,214,100,119,247,5,156,119,14,230,209,42,54,47,249,159,202,56,73,126,52,76,172,180,187,33,26,151,137,190,254,89,111,71,31, - 26,45,85,252,107,112,15,51,50,119,35,178,252,218,154,130,89,234,187,101,155,53,239,211,253,103,120,187,153,141,62,149,26,54,151,220,69,216,56,229, - 62,145,10,115,143,159,33,91,175,246,186,89,108,125,98,237,173,54,69,28,221,132,73,226,69,159,171,87,27,172,87,246,60,147,56,210,105,241,180,0, - 43,182,241,29,184,253,106,149,165,69,37,203,230,221,194,159,61,76,138,208,39,30,242,237,250,197,111,52,110,91,192,79,67,118,150,17,156,200,169,191, - 142,181,206,65,171,197,147,235,112,221,38,249,69,175,243,108,190,169,174,14,244,45,225,133,132,63,196,5,196,255,217,198,73,56,215,255,221,196,240,198, - 179,40,255,156,149,32,146,243,210,124,87,30,158,236,139,164,160,243,248,174,82,169,177,134,226,188,147,254,116,19,230,250,93,18,223,234,161,233,53,166, - 214,246,199,186,112,244,214,223,5,171,234,219,114,16,248,146,112,166,147,171,241,167,42,238,141,187,8,215,11,253,86,144,207,54,235,85,54,215,13,194, - 46,252,45,95,245,11,247,121,92,172,1,97,26,167,38,165,236,101,30,75,142,72,151,224,149,142,115,57,44,56,230,68,79,72,115,52,199,20,236,100, - 212,124,103,20,50,9,41,46,25,241,132,226,52,184,232,250,39,57,100,65,157,76,205,38,135,57,228,204,144,97,219,77,227,251,10,206,3,72,8,136, - 221,171,110,111,1,73,5,9,183,196,118,15,179,217,144,48,165,129,57,7,231,131,118,130,97,204,176,171,243,221,117,41,24,34,72,96,197,223,216,7, - 179,11,136,199,83,136,212,223,188,222,63,229,188,168,70,173,51,185,234,107,190,73,244,52,205,210,207,144,90,188,1,103,203,110,171,175,186,121,174,183, - 78,64,110,190,26,178,160,181,41,232,44,157,219,192,63,178,56,157,130,133,235,252,205,42,204,111,117,94,83,169,159,39,69,25,230,101,15,178,138,231, - 189,239,58,157,247,248,86,164,146,24,126,77,217,14,54,15,97,43,205,115,176,1,27,211,64,235,254,204,20,237,96,221,34,239,226,34,158,197,137,249, - 82,61,38,250,77,223,144,222,100,119,58,95,36,217,118,55,110,187,193,58,44,111,44,29,180,201,29,88,171,217,0,33,231,136,224,103,160,61,243,18, - 71,220,214,55,64,255,53,154,16,12,218,198,74,154,35,97,99,72,10,81,53,122,127,0,110,65,161,108,243,4,135,178,216,13,4,10,18,10,120,198, - 120,192,0,172,60,206,145,18,35,211,128,145,10,51,113,73,32,167,133,220,76,242,29,140,170,75,165,60,115,16,73,57,188,222,65,39,224,13,92,18, - 138,200,104,2,197,187,224,156,81,107,86,226,192,92,63,143,94,96,169,251,215,79,254,182,212,23,91,234,11,117,64,241,223,58,56,82,7,67,39,111, - 183,130,129,147,59,225,22,212,114,114,23,208,80,144,8,54,50,34,184,229,228,19,28,32,40,124,57,225,150,151,91,64,219,205,45,176,237,231,88,50, - 40,102,49,151,61,63,119,78,183,231,231,93,168,235,109,109,7,131,100,215,25,95,214,57,196,178,151,60,236,242,131,189,50,170,201,38,190,15,93,245, - 225,32,117,120,245,72,194,176,171,170,172,77,61,55,133,155,135,25,200,69,117,221,181,170,115,92,117,198,172,86,149,185,105,230,9,68,57,39,221,106, - 219,45,30,121,1,65,44,232,154,46,205,6,79,153,167,234,126,247,171,193,246,142,33,213,232,154,12,205,140,251,151,90,14,185,103,213,215,28,250,103, - 123,106,113,208,79,15,80,18,23,3,231,109,41,29,229,196,61,168,237,134,67,50,182,227,13,199,246,87,241,178,168,240,136,27,207,146,12,34,223,193, - 72,218,55,15,115,83,187,49,15,235,154,67,254,224,4,155,155,54,30,87,52,24,152,13,120,176,16,136,211,125,179,161,202,3,100,170,246,205,198,92, - 36,227,74,73,135,217,8,235,246,230,97,179,169,196,112,30,11,17,234,111,11,177,45,100,217,171,60,136,57,126,119,84,30,213,99,18,150,230,100,163, - 238,178,95,78,168,39,3,21,80,83,118,88,85,198,178,139,157,229,51,27,159,129,144,72,97,120,32,140,5,210,58,58,105,77,164,50,138,221,121,239, - 169,118,241,186,175,11,151,14,7,251,194,18,51,134,236,6,131,187,229,124,124,107,120,216,221,70,253,145,182,111,139,130,160,55,178,107,126,15,230,216, - 239,169,15,70,14,18,115,156,123,48,235,110,164,227,204,185,119,62,204,24,27,247,135,142,185,41,115,232,182,204,211,220,196,211,220,152,52,159,3,220, - 112,191,209,224,188,32,227,200,61,187,204,0,230,160,122,180,171,12,137,80,143,17,85,157,72,97,168,189,37,60,65,114,98,67,185,135,24,5,40,193, - 158,218,193,204,93,88,2,48,40,63,20,231,125,24,84,48,210,83,10,15,48,133,71,20,233,40,14,97,29,111,27,10,238,16,8,131,105,40,214,48, - 20,120,224,85,125,222,45,236,189,61,203,22,106,175,198,80,28,194,118,188,123,9,149,165,161,54,177,238,171,224,92,94,212,156,103,32,114,154,23,73, - 167,23,185,137,157,230,69,28,29,239,69,156,124,73,47,226,236,235,123,17,23,143,121,145,104,140,169,239,69,162,113,34,219,139,170,11,229,21,172,179, - 228,14,102,123,145,133,217,250,70,71,209,130,89,188,45,104,227,68,182,23,241,198,53,108,222,29,204,246,162,14,106,173,166,113,34,228,92,247,41,94, - 212,148,29,14,137,183,242,230,92,162,97,89,23,120,65,0,133,14,10,46,9,60,66,89,68,4,76,186,131,82,83,98,115,78,17,192,4,145,80,78, - 96,3,147,18,68,194,1,6,69,22,60,217,176,247,35,229,73,130,20,83,212,130,170,230,108,158,52,20,41,194,22,204,230,221,131,178,64,129,167,85, - 20,49,146,10,25,24,166,152,7,210,226,221,193,222,91,179,180,49,173,53,178,32,192,132,56,215,237,234,246,28,170,85,204,209,250,197,113,189,3,103, - 90,113,176,195,97,107,75,30,214,22,134,250,87,72,44,251,218,2,40,196,37,170,108,109,129,89,18,5,97,204,214,86,7,179,181,213,65,59,29,116, - 20,123,176,150,119,15,138,48,5,6,150,182,192,77,234,28,209,230,221,194,108,109,217,152,214,106,128,34,228,125,206,117,159,168,45,126,14,109,181,78, - 214,83,154,187,51,208,43,113,106,141,10,217,133,248,74,159,176,135,114,100,250,21,151,28,12,147,17,41,196,232,39,11,202,32,40,32,164,172,203,80, - 246,66,247,107,33,112,55,190,151,244,234,59,13,19,155,31,72,122,235,210,7,234,124,5,193,139,226,189,22,215,108,83,150,7,58,92,71,148,62,214, - 229,67,44,57,163,138,91,55,9,159,41,67,54,144,33,105,238,78,130,12,17,65,28,115,102,100,216,66,205,57,8,85,196,234,110,156,65,134,237,5, - 211,99,202,199,115,137,144,32,48,125,69,113,123,59,99,233,60,165,58,208,60,106,27,81,236,64,35,42,213,219,99,250,76,78,173,25,141,93,141,195, - 60,122,94,231,135,200,103,244,125,28,253,89,200,229,204,59,228,40,13,252,95,214,239,251,30,65,56,182,250,109,59,133,184,239,186,118,195,206,139,172, - 237,176,105,16,117,87,90,247,135,31,92,195,149,55,138,160,1,143,90,242,163,119,163,22,217,122,130,103,248,140,24,130,61,160,174,61,142,123,193,197, - 225,243,35,103,164,224,207,138,146,128,56,59,13,205,144,249,87,94,12,41,101,254,225,46,100,136,28,11,235,146,213,145,127,6,224,30,140,39,76,127, - 7,77,251,230,239,15,20,126,26,110,202,56,217,20,126,1,85,75,64,125,200,172,163,219,223,193,203,38,144,81,238,254,24,192,232,224,31,4,160,20, - 210,73,2,123,239,65,188,135,1,158,21,22,222,154,203,49,215,175,254,7,80,75,3,4,20,0,0,0,8,0,96,128,249,52,242,213,5,70,140,20, - 0,0,25,120,0,0,17,0,0,0,100,111,99,117,109,101,110,116,45,111,112,101,110,46,115,118,103,237,93,109,115,219,56,146,254,158,95,161,83,190, - 236,212,74,20,222,95,156,56,91,83,158,154,171,185,202,237,86,237,204,212,125,188,162,37,218,214,70,150,116,164,20,219,243,235,239,105,232,133,160,8, - 217,146,237,100,61,113,172,157,138,244,16,4,192,70,119,227,105,160,193,125,255,183,219,235,73,231,115,81,86,227,217,244,180,203,51,214,237,20,211,225, - 108,52,158,94,158,118,127,255,237,231,190,235,118,170,69,62,29,229,147,217,180,56,237,78,103,221,191,125,120,243,254,63,250,253,206,89,89,228,139,98, - 212,185,25,47,174,58,191,76,63,85,195,124,94,116,254,114,181,88,204,79,6,131,155,155,155,108,188,6,179,89,121,57,248,161,211,239,227,206,234,243, - 229,155,78,167,131,102,167,213,201,104,120,218,93,151,159,47,203,73,40,55,26,14,138,73,113,93,76,23,213,128,103,124,208,173,139,15,235,226,55,197, - 121,86,22,213,108,89,14,87,213,15,135,113,201,114,116,81,23,69,79,110,100,40,196,189,247,3,38,6,66,244,81,162,95,221,77,23,249,109,127,90, - 189,141,110,69,7,83,183,10,198,216,0,215,234,146,135,149,58,185,157,64,12,123,59,19,174,198,173,67,244,115,252,183,189,97,3,100,171,103,189,192, - 157,69,54,45,22,131,159,126,251,105,123,177,207,178,209,98,20,85,179,145,124,163,221,198,112,76,243,235,162,154,231,195,162,26,108,240,112,255,205,120, - 180,184,58,237,42,151,177,240,55,191,13,240,85,49,190,188,90,180,241,241,232,180,139,231,245,54,252,218,244,231,100,171,81,44,147,98,85,112,221,72, - 124,73,201,191,142,138,207,197,164,121,239,104,54,60,207,43,116,125,112,53,187,46,6,255,26,95,95,231,195,65,85,14,7,195,207,213,0,186,120,57, - 235,143,135,179,105,127,113,5,53,25,160,214,73,126,62,41,6,249,112,129,122,171,86,101,244,164,167,93,124,89,146,82,245,103,243,98,154,109,134,104, - 219,171,226,118,62,43,23,253,139,241,164,88,149,111,52,126,59,190,30,231,211,255,205,203,197,128,90,174,32,189,229,98,60,89,86,131,106,58,187,25, - 45,167,144,226,229,20,55,244,47,170,254,104,92,22,195,197,172,188,235,231,195,97,49,95,100,243,105,186,177,219,209,28,227,236,217,90,162,201,50,119, - 59,101,62,160,208,251,81,113,81,81,225,149,248,233,151,12,23,112,169,204,71,227,124,242,159,244,15,30,118,85,40,170,117,56,155,76,208,185,211,110, - 62,185,201,239,86,178,162,191,160,134,39,87,101,1,179,121,139,239,69,94,110,234,208,204,176,109,57,106,175,217,132,102,146,111,47,95,174,193,223,167, - 227,5,236,99,89,21,229,175,164,99,255,152,254,94,21,173,82,191,149,249,180,130,66,95,159,118,175,243,69,57,190,253,75,95,100,214,42,233,124,143, - 225,195,51,111,188,101,166,199,57,112,35,100,175,239,172,200,156,211,234,135,109,101,195,219,211,174,97,58,179,92,9,95,163,119,164,170,38,51,202,186, - 26,189,72,150,189,72,150,45,225,13,185,205,80,210,153,110,103,176,22,111,83,52,7,139,151,196,150,144,234,135,245,245,247,213,98,54,223,148,133,242, - 46,238,38,208,64,2,251,168,113,86,158,156,79,242,225,167,119,1,152,65,158,227,197,221,9,127,215,173,239,152,93,92,84,5,154,101,17,22,44,19, - 119,160,37,177,125,128,199,181,197,82,109,241,116,91,170,22,214,160,249,200,255,62,13,141,6,251,169,26,154,86,208,62,119,158,103,70,190,92,13,77, - 40,160,114,79,82,192,164,82,164,21,80,179,253,10,24,149,50,169,10,51,221,61,222,50,190,154,186,107,241,144,186,63,210,99,220,171,238,24,185,251, - 6,86,216,175,160,238,34,227,214,167,212,253,150,159,118,37,3,170,45,175,199,238,142,80,179,171,194,183,34,89,86,144,17,248,140,20,199,30,175,217, - 194,248,125,138,189,25,56,97,89,82,215,88,52,19,239,83,152,183,185,164,207,142,206,109,110,189,71,247,234,198,121,74,191,14,107,92,13,233,243,96, - 227,95,205,247,146,176,247,187,94,39,164,122,54,93,100,80,63,39,172,236,109,198,169,254,2,9,40,99,156,233,41,149,73,163,52,252,48,60,35,99, - 150,219,166,31,118,153,19,74,113,207,26,126,88,102,86,27,46,156,110,248,225,118,217,139,100,89,248,97,105,129,114,203,229,35,180,85,63,172,173,230, - 9,218,122,145,211,231,120,109,77,41,190,163,207,33,52,164,225,180,55,143,1,101,112,7,88,135,73,90,199,253,15,57,28,209,103,239,52,240,213,92, - 51,13,230,254,161,134,0,76,195,77,10,157,57,219,244,145,156,101,70,232,134,131,68,41,209,116,142,146,53,238,123,170,97,241,150,61,69,134,133,65, - 115,112,249,91,164,111,225,239,153,246,48,172,231,103,197,92,58,37,14,103,37,111,215,90,252,56,98,76,141,169,163,12,32,213,220,193,100,129,154,51, - 143,84,201,150,160,188,53,230,8,57,25,238,213,240,252,145,114,66,91,247,216,109,162,53,43,252,197,240,226,128,214,82,98,242,214,178,231,146,18,63, - 134,226,190,189,8,127,59,163,155,113,169,152,96,102,143,159,107,187,224,237,112,43,127,148,208,210,173,51,205,181,50,210,167,197,119,95,243,250,217,164, - 40,165,126,162,20,163,249,230,56,33,74,105,158,67,136,251,27,191,79,132,82,218,103,83,68,34,189,71,76,180,140,62,143,117,107,214,223,19,110,61, - 101,90,79,122,53,235,249,179,73,9,2,127,234,88,91,134,185,201,89,119,180,185,222,199,77,190,180,166,113,233,191,62,87,33,179,190,103,44,244,51, - 240,11,90,154,45,64,47,148,224,90,218,30,141,142,84,102,39,86,228,62,227,220,224,127,13,30,36,92,230,149,97,170,214,57,162,66,40,171,16,113, - 136,58,168,32,58,164,17,152,114,192,15,179,239,39,136,139,223,27,116,243,104,241,226,233,116,76,75,45,188,79,208,49,144,67,205,165,244,61,153,41, - 205,21,119,61,145,41,229,112,105,71,166,42,115,222,75,235,155,50,69,72,164,189,81,178,73,47,17,227,99,146,81,166,33,83,197,51,39,141,243,250, - 139,202,84,218,123,101,234,158,81,166,202,64,67,34,30,107,50,207,224,41,93,209,23,36,86,60,172,73,72,188,41,86,16,113,163,225,240,84,67,172, - 220,101,86,104,103,154,98,117,153,224,66,8,197,154,170,42,136,222,59,29,249,204,231,143,201,121,188,196,210,14,202,185,126,190,229,80,120,53,168,190, - 212,177,228,56,147,156,233,94,112,120,154,139,40,116,112,8,206,189,210,36,243,102,88,46,12,238,50,214,214,234,16,194,114,151,113,175,121,36,238,139, - 100,217,139,100,89,10,203,5,34,39,208,87,255,37,149,56,80,241,251,38,53,110,196,215,9,213,152,16,28,46,1,58,198,52,228,220,235,243,76,10, - 201,132,105,106,177,160,165,59,18,203,206,226,92,134,121,211,123,191,235,28,152,209,50,218,226,9,241,39,181,192,148,255,162,114,93,197,130,247,199,138, - 110,247,193,196,206,138,163,109,69,211,152,66,108,51,154,38,103,121,112,52,189,122,224,247,3,218,116,11,223,182,59,141,180,109,56,250,60,46,110,222, - 108,59,76,219,152,235,122,231,249,101,17,168,3,158,115,197,29,214,23,206,103,229,168,40,55,151,76,248,107,92,90,179,139,213,230,252,155,166,88,169, - 214,237,117,150,190,94,93,229,163,217,13,164,179,123,241,143,217,236,186,38,117,245,80,221,6,107,18,6,2,182,173,139,119,65,168,210,57,201,218,119, - 46,203,146,118,88,39,249,93,129,135,9,255,108,156,98,117,53,187,185,44,73,40,23,249,100,43,149,237,173,116,169,127,126,62,67,219,139,114,217,186, - 188,221,188,93,174,6,101,189,249,28,149,184,25,79,241,148,253,245,238,53,175,215,192,119,75,108,54,178,241,0,123,74,160,15,202,155,61,23,105,28, - 182,254,115,123,145,158,46,150,245,234,25,215,186,114,93,44,242,81,190,200,107,189,216,32,106,187,107,59,186,56,249,231,79,63,111,233,231,112,120,242, - 63,179,242,83,205,20,169,64,126,62,91,162,227,91,138,76,27,193,195,19,114,15,249,226,195,248,26,205,83,230,193,95,111,175,39,80,207,237,133,70, - 225,197,221,188,168,43,93,85,187,201,162,72,102,98,140,134,215,99,186,105,240,235,98,60,153,252,66,141,68,52,121,93,233,120,49,41,62,252,60,155, - 64,89,59,191,12,103,211,206,143,97,223,59,244,98,117,177,81,30,79,94,124,16,152,27,250,140,247,37,15,197,2,214,40,53,164,236,146,89,249,33, - 234,46,137,229,199,203,45,39,110,247,225,191,242,79,203,243,206,175,139,2,142,162,76,53,79,150,219,174,36,148,108,181,71,173,77,198,195,98,90,61, - 44,178,112,243,248,51,44,252,250,122,54,173,130,244,214,247,86,131,243,187,126,149,15,224,50,7,45,209,173,170,249,176,174,101,149,108,144,93,47,171, - 241,240,42,159,76,178,225,31,161,107,235,82,77,33,22,213,176,28,207,41,227,225,195,143,67,106,155,210,116,22,69,167,223,185,185,42,166,29,74,100, - 168,58,121,89,116,206,33,141,203,206,168,204,47,47,139,81,103,49,203,86,2,143,238,111,84,60,95,158,79,198,213,85,113,156,228,255,62,251,92,76, - 38,189,206,47,211,97,118,164,224,91,13,134,146,164,254,177,57,124,220,29,137,200,34,142,28,132,230,16,207,139,18,42,94,61,56,196,169,132,163,127, - 22,243,114,54,90,134,188,147,230,216,62,177,226,159,198,21,166,251,243,101,178,226,178,248,191,229,24,119,60,170,230,191,207,22,16,201,243,214,249,227, - 98,127,103,159,36,133,162,28,127,14,67,74,218,80,61,111,167,127,189,130,113,252,56,25,127,138,133,17,84,111,173,106,155,112,60,242,205,239,7,27, - 207,29,126,93,214,30,61,204,117,173,9,113,146,159,23,147,211,238,202,53,182,167,188,217,114,126,61,27,21,235,187,55,211,197,101,186,146,127,204,139, - 105,119,167,65,249,96,157,235,135,152,231,139,171,141,148,106,194,130,114,228,219,49,159,14,195,95,133,63,252,179,101,66,235,101,143,230,226,55,28,203, - 228,4,51,196,95,222,182,162,138,31,194,197,104,13,41,252,44,151,147,2,109,77,255,0,149,121,7,181,158,125,42,78,222,234,156,62,235,159,171,89, - 27,229,215,63,137,231,225,113,78,240,48,211,81,12,254,107,54,158,174,209,235,188,252,84,148,84,111,177,254,222,135,255,43,23,13,228,122,60,106,252, - 46,166,235,223,235,58,161,153,69,57,25,227,159,19,181,193,70,57,38,243,176,102,115,194,54,88,253,68,159,199,213,248,124,60,161,31,225,235,164,120, - 55,26,87,115,8,251,100,60,165,46,190,131,35,44,47,38,179,155,205,245,6,131,165,113,16,50,34,155,192,254,187,163,64,82,25,19,78,247,192,187, - 16,224,35,164,234,156,17,106,56,194,82,160,62,99,150,43,219,209,25,231,86,33,238,39,72,121,238,133,2,166,37,88,191,116,17,246,177,3,54,111, - 140,149,202,68,232,89,7,204,141,57,206,121,140,2,83,90,50,235,234,102,8,226,92,216,168,59,168,81,81,82,10,98,129,30,167,5,10,110,133,163, - 26,209,75,124,83,154,80,78,55,41,194,4,46,27,219,163,205,44,132,216,162,35,101,230,152,84,222,213,208,199,142,0,161,117,12,223,107,240,172,35, - 88,166,156,215,210,212,32,24,187,179,12,145,9,65,120,86,97,28,97,8,1,17,239,244,64,231,37,83,78,121,212,136,72,92,91,37,184,71,116,175, - 132,50,204,145,32,129,42,4,43,232,143,206,60,183,82,50,71,24,40,34,67,200,175,17,251,59,7,174,219,225,54,68,139,144,89,141,161,151,136,161, - 132,226,206,69,40,234,204,208,53,163,188,136,239,135,88,140,113,214,244,40,66,245,161,155,232,15,186,166,9,210,194,163,195,168,49,53,220,127,116,234, - 80,170,97,172,43,19,140,182,35,184,52,248,200,119,9,171,220,108,188,28,108,133,219,253,172,216,10,215,241,164,52,47,198,28,243,178,132,125,197,37, - 191,152,145,6,123,148,153,148,206,48,168,17,84,2,193,175,114,118,101,0,202,57,101,120,141,182,108,27,193,62,175,151,129,210,158,246,165,13,180,80, - 175,118,160,53,6,26,214,39,96,137,241,64,3,166,77,20,91,163,169,129,142,146,50,142,26,232,116,217,68,3,210,239,237,173,78,246,86,239,246,246, - 187,82,125,29,165,218,14,244,229,142,228,155,55,54,6,249,82,51,81,47,111,45,18,153,119,28,115,131,22,97,125,122,149,124,199,164,83,156,126,43, - 129,9,90,211,148,111,50,47,165,21,63,212,251,102,148,123,94,19,226,187,211,110,159,107,154,73,141,139,115,114,110,3,174,61,102,60,33,35,124,155, - 230,111,93,38,181,229,46,186,182,89,91,145,32,10,38,222,61,90,47,50,163,97,133,233,181,157,169,83,235,223,106,43,221,233,119,113,238,101,205,40, - 219,137,140,135,83,202,120,128,143,226,147,65,111,190,25,21,220,241,54,251,233,254,206,232,209,77,154,233,120,188,131,211,233,11,162,90,156,88,205,74, - 145,192,227,136,0,165,241,8,149,194,130,220,48,197,211,32,106,176,38,179,74,105,175,0,131,184,105,16,170,14,23,58,179,14,60,179,39,2,19,100, - 86,111,48,168,187,3,147,211,74,200,192,234,182,104,95,73,208,44,90,232,238,244,65,52,141,214,74,70,189,50,123,250,10,202,245,120,77,109,103,152, - 127,215,212,39,107,234,19,199,64,242,239,99,112,36,11,218,24,249,118,42,216,49,242,36,30,161,145,145,167,64,170,193,50,204,100,130,162,216,173,145, - 247,185,103,8,130,136,201,212,86,30,129,177,153,71,112,108,231,8,131,53,162,76,109,27,118,158,236,110,195,206,107,87,215,152,218,246,58,201,58,43, - 227,242,200,165,148,97,88,75,105,19,59,33,29,107,242,58,68,139,150,91,205,29,197,131,136,52,141,165,88,221,100,130,246,81,109,64,65,205,24,227, - 192,24,138,34,110,37,204,75,237,32,76,77,115,187,84,171,114,78,10,165,36,88,97,10,61,35,6,105,181,166,60,233,186,78,157,33,228,183,214,135, - 146,154,118,16,77,88,103,48,24,128,128,1,177,206,135,72,24,131,231,48,2,8,102,93,112,220,33,96,207,152,198,176,114,66,181,84,8,251,25,48, - 161,164,210,1,147,10,33,49,231,192,180,150,22,209,112,132,125,164,152,91,50,169,37,7,42,224,184,133,38,173,1,234,64,100,185,14,168,32,46,28, - 34,118,37,188,161,157,123,68,240,22,178,33,140,59,9,86,12,204,90,97,164,229,171,120,191,133,98,2,64,60,110,153,234,249,112,92,65,106,214,9, - 201,36,136,205,21,173,43,40,203,172,18,171,30,161,114,208,165,158,13,61,134,7,90,245,200,160,81,71,40,195,45,120,188,176,94,96,33,49,5,12, - 100,221,75,131,185,138,210,10,72,96,17,6,142,142,126,112,8,89,71,232,25,80,4,147,10,126,43,66,37,85,169,140,167,146,36,37,60,59,133,163, - 12,223,52,97,6,156,76,57,170,19,146,113,232,136,17,209,184,125,76,234,82,100,0,15,172,232,181,242,47,118,29,234,54,193,233,24,199,138,46,73, - 197,185,222,117,176,231,203,197,98,143,127,77,120,200,109,211,9,159,184,123,173,221,223,167,57,236,123,60,236,249,100,134,73,105,127,68,240,184,208,79, - 237,172,16,10,168,0,220,154,36,85,217,70,126,116,194,193,57,90,215,106,133,169,95,63,240,99,153,15,127,78,188,202,192,239,113,195,204,91,195,108, - 181,149,52,204,97,141,117,19,225,195,81,120,35,184,170,209,23,16,225,243,215,57,208,219,8,63,125,80,219,170,204,133,213,211,238,190,114,183,7,150, - 59,254,36,250,178,42,188,76,28,67,223,158,63,167,191,246,66,3,6,84,42,133,89,172,145,194,165,180,8,41,69,171,75,125,204,144,12,44,130,242, - 13,141,228,158,71,57,156,97,49,3,92,129,239,42,229,74,231,214,137,178,13,157,99,153,118,68,110,156,59,88,249,146,83,65,195,9,119,143,9,128, - 43,250,36,120,33,158,67,236,178,99,197,17,104,106,171,36,184,3,104,166,116,134,120,15,161,180,79,225,123,152,126,17,165,64,82,132,97,84,189,20, - 192,104,83,198,49,67,152,52,224,178,44,96,2,204,132,17,151,2,43,163,196,170,128,10,230,16,234,16,151,66,85,187,40,48,48,33,207,13,48,112, - 8,144,58,190,239,110,159,145,79,81,10,168,50,138,41,3,238,64,71,8,208,62,98,231,204,91,207,113,153,48,239,188,16,150,158,135,58,164,60,177, - 145,4,186,126,242,192,154,64,165,133,119,50,41,141,84,40,29,241,129,71,177,232,148,191,140,150,170,214,11,245,28,143,230,53,60,163,110,248,75,144, - 41,40,112,141,190,128,137,209,191,206,21,209,239,123,28,255,246,61,14,142,72,205,210,158,175,108,236,26,32,236,19,34,66,147,6,23,57,245,47,178, - 199,193,119,246,56,48,45,26,204,13,20,161,242,198,214,155,71,192,15,94,36,95,16,3,122,93,59,164,47,204,162,95,151,240,119,211,69,36,73,217, - 246,48,227,199,54,226,152,112,42,66,147,155,138,250,11,91,116,116,164,99,221,91,101,132,215,26,253,106,110,166,27,41,184,49,53,250,221,162,95,169, - 69,191,38,153,239,152,134,208,218,88,58,197,165,155,121,38,134,89,47,107,52,185,68,244,200,60,147,195,13,89,238,246,150,33,140,225,30,189,149,141, - 222,130,129,115,198,107,244,5,24,242,235,226,123,47,197,144,95,165,240,119,2,82,167,133,163,247,37,137,38,125,229,220,41,81,131,73,42,108,15,54, - 232,111,121,17,106,179,250,116,196,226,19,119,90,30,191,248,228,31,181,246,244,5,214,156,208,125,253,101,214,156,182,75,78,209,138,83,114,193,233,192, - 245,166,111,99,185,233,59,189,252,250,142,81,100,158,54,148,185,236,113,185,179,82,199,44,20,149,223,187,10,113,184,103,124,228,186,162,222,117,227,38, - 156,174,247,61,238,155,189,85,86,112,93,163,47,128,234,188,210,125,152,151,97,209,175,152,234,136,76,11,37,40,27,100,99,12,235,124,14,71,111,109, - 148,53,154,12,94,30,105,209,187,3,45,189,0,87,80,58,53,208,169,140,6,58,50,222,206,105,120,82,154,88,50,139,225,207,53,222,123,114,24,154, - 46,81,81,238,80,143,131,202,138,144,210,18,78,7,217,144,137,18,114,140,44,165,180,108,191,134,98,155,210,141,31,103,205,159,168,55,254,30,181,17, - 205,242,181,230,56,245,80,214,61,72,214,65,202,195,15,212,25,122,105,223,225,121,133,137,196,68,122,7,230,15,143,81,162,63,87,170,225,33,74,164, - 100,24,96,145,41,175,20,147,148,146,6,200,217,48,163,74,75,171,147,97,65,193,211,187,107,40,90,98,66,56,235,233,64,26,72,165,34,157,227,116, - 175,9,57,89,41,52,188,80,177,39,69,38,233,29,133,174,245,27,13,134,217,91,88,79,217,198,180,2,19,78,174,25,3,63,210,193,55,202,73,204, - 232,96,151,166,99,116,173,14,39,148,18,227,251,160,78,30,232,208,146,58,25,70,231,224,217,42,231,244,249,174,110,164,110,92,103,138,134,207,32,88, - 18,10,74,69,126,203,215,63,19,67,105,31,55,49,253,73,227,240,125,30,180,10,110,52,145,187,170,24,111,138,88,103,22,225,153,209,42,156,30,53, - 218,123,27,242,76,157,19,140,217,128,66,166,48,77,202,93,117,206,33,120,15,103,79,241,13,46,222,96,2,247,130,131,45,212,24,13,81,102,153,53, - 54,2,207,8,196,189,154,210,29,183,168,98,25,252,3,66,71,194,224,10,16,26,2,82,92,59,181,106,89,40,29,114,105,129,194,61,8,181,154,158, - 164,100,50,4,155,12,205,32,216,164,83,152,20,37,7,76,50,68,152,161,156,208,156,51,187,114,81,86,27,171,209,52,38,43,169,141,178,29,101,137, - 100,82,39,57,69,186,74,32,208,77,97,103,132,210,105,88,230,9,181,134,210,59,9,99,156,73,180,67,39,86,53,23,30,152,201,108,244,243,35,57, - 35,10,191,181,139,208,51,66,33,77,220,27,161,28,140,87,224,153,36,117,208,104,60,128,130,104,61,151,82,123,65,135,216,156,116,146,219,85,90,176, - 197,61,82,71,195,245,49,57,136,237,164,209,99,39,206,240,226,163,35,142,132,75,101,116,174,154,158,107,127,86,225,183,75,187,158,18,203,194,129,249, - 150,15,132,198,18,33,119,177,23,212,116,16,92,137,26,60,106,180,191,79,73,79,29,207,205,128,201,221,148,38,46,233,141,179,202,154,158,160,119,207, - 58,19,142,81,112,16,24,3,47,226,105,79,8,54,47,65,101,120,248,63,156,224,68,79,60,37,115,56,23,60,129,226,136,113,66,90,7,29,154,96, - 171,163,82,152,95,148,183,156,136,144,87,58,220,77,219,174,202,48,248,7,182,126,133,96,71,36,176,64,179,90,168,34,226,228,66,219,32,79,96,107, - 140,119,20,122,6,215,163,37,245,156,129,47,169,144,164,156,120,158,182,111,217,159,130,222,226,222,137,20,244,226,115,1,179,216,68,221,169,160,109,115, - 211,252,246,8,189,219,29,251,214,11,60,95,38,217,219,187,46,244,237,154,216,174,199,227,74,130,125,208,177,14,120,183,53,165,0,21,192,36,184,193, - 18,158,211,61,50,215,105,239,145,138,196,88,62,172,188,73,35,208,187,241,227,126,125,190,239,212,90,98,156,94,232,169,138,61,43,80,239,162,61,28, - 33,44,125,118,2,76,48,79,16,79,39,41,200,51,8,253,24,37,219,194,255,33,54,4,199,139,208,179,36,74,218,17,156,20,29,166,7,59,36,2, - 104,51,184,91,41,233,128,20,190,10,199,108,120,1,8,248,44,189,158,214,70,40,180,76,115,6,218,24,56,151,133,11,20,1,3,223,148,44,194,194, - 70,14,244,205,59,31,161,240,169,136,86,200,75,211,11,255,21,109,120,37,159,39,17,130,202,232,133,184,199,174,138,28,74,44,220,238,68,165,64,222, - 93,96,187,98,107,102,46,28,215,210,126,131,125,109,86,177,119,89,246,219,245,125,47,96,170,81,238,245,136,123,151,172,25,225,153,112,180,102,185,177, - 1,68,94,150,222,152,186,193,82,182,244,69,147,240,80,255,142,91,36,107,20,204,88,216,165,217,246,51,172,122,57,181,129,190,155,234,203,53,213,100, - 30,195,211,78,183,127,187,82,110,104,190,9,235,183,208,245,176,61,1,102,72,153,179,106,181,6,204,185,55,156,108,152,212,159,102,44,154,96,97,43, - 61,177,57,178,65,43,192,34,172,32,199,16,95,65,100,251,42,64,103,29,190,222,211,64,176,67,117,152,204,88,7,110,161,105,145,70,88,78,161,80, - 220,147,228,42,114,244,206,238,135,2,139,117,98,67,235,85,129,173,215,255,189,217,182,17,126,183,94,1,188,126,183,32,58,128,209,90,189,188,241,61, - 189,68,246,195,155,255,7,80,75,3,4,20,0,2,0,8,0,96,125,250,52,34,86,64,46,27,23,0,0,165,116,0,0,17,0,0,0,100,111,99, - 117,109,101,110,116,45,115,97,118,101,46,115,118,103,236,92,89,115,227,200,145,126,159,95,193,229,188,76,135,69,176,238,67,125,56,198,61,97,135,55, - 218,187,17,158,153,216,103,136,132,36,186,41,82,6,169,150,186,127,253,126,89,0,137,2,88,36,33,81,125,120,162,41,143,155,76,20,234,200,252,42, - 175,74,224,213,159,31,110,230,131,15,69,185,154,45,23,175,135,60,99,195,65,177,152,44,167,179,197,213,235,225,239,191,253,117,228,134,131,213,58,95, - 76,243,249,114,81,188,30,46,150,195,63,191,249,225,213,127,141,70,131,183,101,145,175,139,233,224,126,182,190,30,252,125,241,126,53,201,111,139,193,79, - 215,235,245,237,249,120,124,127,127,159,205,106,98,182,44,175,198,47,6,163,17,238,92,125,184,250,97,48,24,96,216,197,234,124,58,121,61,172,219,223, - 222,149,243,208,110,58,25,23,243,226,166,88,172,87,99,158,241,241,176,105,62,105,154,223,23,23,89,89,172,150,119,229,164,234,126,50,137,91,150,211, - 203,166,41,102,114,47,67,35,238,189,31,51,49,22,98,132,22,163,213,199,197,58,127,24,45,86,63,70,183,98,130,169,91,5,99,108,140,107,77,203, - 126,173,206,31,230,96,195,222,201,132,171,241,232,96,253,45,254,219,222,176,33,100,213,90,47,113,103,145,45,138,245,248,151,223,126,217,94,28,177,108, - 186,158,70,221,108,56,223,26,183,37,142,69,126,83,172,110,243,73,177,26,111,232,225,254,77,151,231,211,229,132,218,188,30,226,203,29,137,99,180,202, - 63,20,217,102,113,113,187,139,124,133,118,227,235,229,77,49,254,215,236,230,38,159,140,87,229,100,60,249,176,26,3,58,87,203,209,108,178,92,140,214, - 215,144,234,24,35,205,243,139,121,49,206,39,107,96,110,21,58,219,204,224,124,139,68,150,41,249,167,105,241,161,152,183,71,139,26,72,81,221,59,125, - 61,196,164,132,231,50,252,190,46,102,87,215,235,215,67,229,216,237,67,160,220,207,166,235,235,152,240,97,86,220,255,101,249,128,78,6,108,160,28,254, - 23,200,111,240,127,175,166,197,229,138,126,84,29,211,47,57,124,19,8,175,202,124,58,203,231,127,163,127,192,142,170,81,52,247,201,114,62,47,38,24, - 57,159,223,231,31,171,133,209,39,136,248,252,186,44,0,201,31,241,189,200,203,77,31,154,25,182,109,71,227,181,135,208,76,242,237,229,171,154,248,251, - 98,182,6,246,238,86,69,249,43,201,239,127,23,191,175,138,157,86,191,149,249,98,5,176,220,188,30,222,228,235,114,246,240,211,72,100,214,42,233,252, - 25,195,31,207,188,241,150,153,51,206,65,55,66,158,141,156,21,153,115,90,189,216,118,54,1,139,12,211,153,229,74,248,134,250,145,120,105,50,163,172, - 107,168,151,201,182,151,201,182,37,52,13,183,25,90,58,51,28,140,107,246,182,89,211,155,189,196,182,4,87,223,212,215,95,173,214,203,219,77,91,0, - 105,253,113,14,172,18,113,132,30,151,229,249,197,60,159,188,127,25,8,75,240,115,182,254,120,206,95,14,155,59,150,151,151,171,2,195,178,136,22,48, - 135,59,48,146,216,46,224,105,99,177,212,88,60,61,150,106,152,53,110,47,249,235,33,52,18,246,169,8,77,3,116,196,157,231,153,145,223,46,66,19, - 0,132,70,121,118,80,164,1,168,217,126,0,70,173,76,170,195,76,15,31,191,51,190,24,220,181,56,6,247,39,106,140,131,112,175,109,193,62,193,10, - 251,5,224,46,50,110,125,10,238,15,252,245,80,50,80,181,229,141,236,62,18,213,116,33,252,32,146,109,5,109,2,159,17,112,236,103,208,189,198,11, - 221,31,250,63,10,166,114,103,159,168,125,49,150,125,12,28,147,163,245,6,36,70,243,159,9,144,41,54,50,254,8,54,74,101,116,174,158,204,70,38, - 31,197,198,212,104,143,96,35,211,95,140,141,202,251,199,176,241,50,124,158,200,70,140,245,56,54,166,70,235,205,70,140,166,191,188,55,16,248,185,223, - 27,192,101,219,50,205,66,102,74,89,102,109,203,52,155,76,105,107,172,210,45,211,188,219,246,50,217,150,76,179,207,224,120,233,62,78,47,207,36,71, - 183,28,122,53,99,204,72,46,138,145,8,63,132,240,70,209,15,52,145,70,8,126,166,76,134,127,152,59,27,169,204,51,239,156,125,209,83,217,63,218, - 67,16,220,53,235,220,43,145,35,102,29,157,248,35,224,236,15,242,163,78,132,224,158,31,1,103,127,144,127,113,195,222,102,248,142,60,184,133,115,253, - 92,134,157,101,158,43,206,21,144,165,184,176,158,23,35,78,134,61,254,181,109,51,146,153,51,206,120,160,14,14,1,131,122,20,29,123,47,51,166,189, - 103,166,101,239,133,205,164,71,7,182,101,239,17,203,25,161,164,180,45,123,15,170,118,210,26,255,25,236,189,51,136,128,250,235,60,22,62,79,212,176, - 24,75,61,74,195,166,70,235,173,97,49,154,249,242,26,54,240,115,191,134,197,101,215,214,176,42,131,104,185,48,45,13,43,161,54,5,34,123,219,214, - 176,59,109,47,147,109,73,195,106,120,147,202,74,219,3,238,164,88,233,115,54,178,153,227,70,25,91,140,100,208,177,92,10,197,124,248,133,88,67,26, - 75,105,6,157,57,111,189,129,30,166,29,98,50,103,37,51,159,79,209,106,173,143,234,81,173,237,231,215,163,137,46,10,67,127,157,46,106,110,166,67, - 64,248,237,213,103,152,90,134,225,61,212,184,54,50,217,179,213,59,61,247,93,117,51,229,71,173,158,211,223,163,86,239,20,199,174,140,84,117,107,93, - 186,207,234,117,202,100,110,135,125,150,197,63,206,168,237,58,173,194,170,19,157,86,150,9,173,16,66,120,151,230,227,126,16,97,112,115,178,23,123,80, - 138,252,240,232,238,249,216,24,225,228,169,46,22,58,49,143,87,13,123,172,220,81,116,98,52,247,120,23,107,143,149,123,54,54,234,231,96,163,54,95, - 206,83,197,104,238,43,123,170,9,54,42,117,156,75,202,244,220,174,41,117,170,232,239,241,154,57,26,221,61,93,53,78,37,253,125,126,213,40,205,51, - 128,81,186,199,131,177,8,159,167,128,81,177,199,131,49,53,218,115,178,81,184,30,92,98,79,7,227,69,248,156,2,70,41,158,14,70,127,73,127,159, - 29,140,220,29,223,210,220,157,176,165,157,164,191,19,184,200,221,9,91,58,37,67,118,34,23,19,81,196,154,190,206,243,117,129,184,217,122,184,45,242, - 76,226,139,231,142,189,104,133,177,82,103,194,113,161,89,43,228,69,80,99,28,249,174,237,116,248,110,91,80,109,72,27,197,11,239,23,234,167,118,16, - 243,189,18,102,132,145,163,10,235,72,84,211,111,146,196,34,197,50,175,164,151,186,125,10,96,50,238,16,100,217,118,6,193,101,202,113,110,77,135,69, - 134,41,35,152,62,184,120,169,122,45,158,212,76,239,160,248,8,52,234,24,83,103,60,72,240,197,243,49,77,2,110,26,129,245,78,42,69,8,238,132, - 108,227,202,102,224,13,216,214,98,26,181,181,86,113,113,144,105,74,244,99,90,31,19,119,50,211,210,153,139,83,51,95,28,187,206,96,161,8,247,173, - 227,33,169,133,111,156,89,71,105,86,16,180,22,148,231,146,90,73,229,208,10,62,7,87,209,62,47,129,75,96,88,130,197,237,60,176,200,188,118,154, - 123,214,202,104,112,157,105,203,85,148,152,156,36,219,78,146,109,19,9,236,150,198,56,36,36,245,69,183,53,118,165,96,38,2,6,33,84,169,140,121, - 195,59,154,79,101,74,74,46,13,235,34,84,90,39,181,61,136,80,211,115,241,125,34,130,111,22,161,245,136,44,241,197,104,206,100,0,168,115,26,252, - 14,153,90,159,41,173,141,151,109,144,202,76,107,216,42,213,6,169,13,18,209,59,7,27,2,161,184,234,128,116,167,237,36,217,54,5,82,219,83,78, - 230,75,130,84,24,108,107,11,67,211,54,207,18,230,217,65,1,180,64,202,233,88,198,185,216,78,241,84,219,100,114,164,167,26,181,234,171,217,158,147, - 14,42,180,62,100,123,113,89,118,143,7,148,132,25,239,148,3,80,61,129,178,182,109,211,4,207,172,178,62,226,76,56,30,0,213,193,59,240,207,148, - 131,61,97,241,225,216,251,224,169,184,109,171,53,5,211,205,141,242,109,116,105,58,82,81,81,4,65,139,119,153,243,90,10,215,174,133,224,6,44,145, - 170,119,157,221,103,93,188,208,7,23,47,119,189,142,182,212,185,139,41,180,232,246,65,16,228,207,225,144,62,114,177,175,198,84,5,25,190,109,203,48, - 169,50,116,74,101,148,63,180,151,125,63,91,76,151,247,35,232,55,190,149,100,247,34,212,92,163,224,186,23,55,213,155,141,164,187,45,234,106,78,239, - 125,183,193,182,80,245,174,90,77,93,237,25,181,184,42,103,211,209,197,5,149,126,174,203,187,141,254,90,93,47,239,233,202,235,225,101,62,223,106,181, - 70,148,119,101,73,189,206,243,143,5,84,127,248,71,236,52,250,24,54,146,243,92,109,115,120,205,197,135,224,110,67,229,41,175,187,23,63,45,151,55, - 77,62,96,75,190,205,175,138,213,117,142,21,227,222,212,197,58,36,11,193,100,125,253,98,89,78,139,50,186,32,160,5,53,243,174,117,61,132,119,64, - 159,9,159,250,18,245,184,185,80,101,194,134,77,21,44,213,247,118,167,64,76,139,231,24,179,238,114,54,159,163,159,170,78,100,195,228,117,185,124,143, - 8,179,46,194,217,96,235,166,88,231,211,124,157,55,131,109,40,106,91,118,59,189,60,255,231,47,127,221,198,186,147,201,249,255,45,203,247,77,236,74, - 13,242,139,229,29,96,179,141,199,169,146,119,114,78,170,60,95,191,153,221,96,162,84,150,253,167,135,155,57,224,188,189,208,106,188,254,120,91,52,157, - 86,221,110,74,204,147,101,234,211,201,205,140,110,26,255,186,198,130,255,78,131,68,49,121,221,233,108,61,47,222,252,154,127,40,194,184,213,207,86,139, - 9,149,209,47,203,55,209,208,180,196,159,175,182,177,244,110,127,255,157,191,191,187,24,252,186,46,160,33,202,84,199,180,107,119,59,9,45,119,198,163, - 110,87,119,23,255,130,186,106,117,64,235,255,75,126,213,153,3,81,231,179,55,215,211,233,171,113,253,61,221,32,47,167,131,105,57,163,133,31,106,183, - 202,143,181,152,45,143,244,128,213,36,187,168,104,173,37,4,14,236,44,150,248,61,159,77,138,197,234,56,0,2,251,176,170,201,242,230,102,185,88,5, - 44,212,247,174,198,23,31,71,171,124,44,50,54,222,1,194,108,10,81,204,46,103,69,217,189,82,13,240,166,238,191,170,159,207,110,238,86,179,201,117, - 62,159,103,147,79,213,164,171,86,63,68,210,165,93,16,239,138,119,221,37,68,27,227,145,179,111,243,230,182,40,129,244,213,81,222,164,30,202,248,103, - 113,91,46,167,119,161,216,191,205,148,19,59,254,101,6,149,50,187,184,75,118,92,22,255,190,155,225,142,39,245,252,63,203,53,88,242,188,125,254,188, - 222,63,217,147,184,80,96,139,5,145,18,26,86,207,59,233,95,177,137,139,159,231,179,247,49,51,2,244,106,168,109,50,128,145,138,126,53,222,40,240, - 240,235,170,99,54,230,249,69,1,219,112,59,123,136,236,75,218,164,94,149,203,187,219,155,229,180,168,27,108,236,193,213,15,237,156,229,116,182,186,69, - 131,243,217,130,28,166,150,7,117,165,153,104,188,192,117,162,4,151,106,112,152,166,50,176,186,10,87,120,193,66,141,152,210,153,34,143,241,76,193,63, - 214,66,184,23,77,178,183,132,250,104,56,10,83,59,226,26,225,163,55,46,174,168,126,8,116,237,225,148,137,248,204,125,251,132,138,117,85,200,20,93, - 171,189,27,46,165,167,154,119,221,57,36,165,129,21,183,114,55,115,219,100,104,21,19,204,112,167,95,198,69,216,100,146,207,97,187,126,250,113,183,162, - 249,69,184,26,157,106,132,159,229,221,188,56,95,44,23,159,224,81,188,172,172,55,253,44,234,239,149,31,118,206,55,63,169,91,136,237,28,66,91,76, - 99,226,191,150,179,197,57,240,93,148,47,111,242,242,125,81,86,189,84,223,71,171,117,94,174,91,148,155,217,180,245,187,88,76,91,227,134,174,230,51, - 252,115,174,54,180,105,14,55,164,44,1,130,184,37,81,171,156,247,57,219,208,154,69,126,152,173,102,23,179,57,253,8,95,231,197,203,54,146,94,46, - 63,20,229,229,124,121,191,185,30,111,130,219,124,125,29,201,96,235,23,3,174,228,18,192,251,156,224,211,145,30,221,164,89,235,112,18,212,127,12,70, - 130,67,218,220,89,170,18,35,32,57,38,221,224,237,30,122,68,149,194,102,70,51,197,211,68,244,96,41,190,81,218,43,144,93,166,53,115,102,128,40, - 150,210,115,202,156,9,1,184,32,226,214,27,154,116,103,206,101,74,43,33,53,110,111,168,35,37,51,109,133,100,98,48,66,200,105,180,86,50,154,149, - 217,51,215,79,131,19,144,186,251,168,201,119,164,158,140,212,19,101,32,249,119,25,244,148,65,119,147,111,77,65,103,147,39,233,17,53,218,228,41,34, - 245,96,153,200,184,48,58,218,228,35,238,153,66,19,161,163,93,30,17,227,109,30,145,227,125,206,17,60,102,130,107,219,218,231,201,233,182,246,121,163, - 234,90,166,109,175,146,108,78,18,107,79,189,133,217,61,183,173,38,155,79,203,226,211,157,138,251,38,83,30,120,207,233,96,66,27,127,198,101,198,160, - 162,4,49,158,99,242,134,181,136,60,20,78,41,197,137,38,173,117,44,208,24,3,77,16,205,75,40,67,94,221,28,168,60,162,130,115,18,131,112,136, - 129,103,76,42,15,198,164,104,111,247,180,12,83,172,104,150,25,229,109,76,19,84,91,201,93,117,247,46,181,161,41,56,53,198,112,109,146,180,248,110, - 18,181,194,194,61,104,94,73,101,237,89,56,83,224,92,187,129,2,137,18,209,122,75,51,131,119,3,186,133,150,29,17,223,14,240,29,158,146,240,50, - 162,2,57,204,59,238,105,16,105,133,183,49,73,100,66,89,197,66,135,27,34,150,162,61,61,15,69,29,238,18,9,137,64,59,220,49,112,199,9,203, - 184,14,205,194,100,36,137,55,48,241,221,64,186,141,168,85,144,170,36,105,129,200,25,231,216,32,156,224,13,128,235,129,196,6,194,234,93,160,49,15, - 79,79,18,141,119,32,241,46,5,158,8,238,181,66,13,26,51,168,147,189,218,177,248,80,0,194,27,109,119,254,35,32,128,191,182,130,20,253,20,100, - 139,218,95,197,109,103,213,108,185,30,59,109,239,46,139,142,33,194,46,3,178,172,212,53,46,185,224,142,11,146,48,0,14,89,194,91,128,152,148,240, - 16,40,81,121,120,92,205,5,121,42,248,220,21,85,103,156,195,206,7,33,51,47,189,142,137,21,110,188,176,21,68,106,34,225,11,59,200,16,12,97, - 159,132,21,53,12,5,161,24,226,230,78,17,232,182,52,154,146,167,19,72,174,34,42,109,12,76,210,27,99,35,106,179,164,176,89,48,79,27,211,194, - 182,130,115,69,184,75,44,126,15,76,18,110,56,29,169,191,232,13,157,132,97,205,96,198,161,163,188,185,125,232,66,8,81,231,122,143,137,61,1,23, - 181,254,93,237,224,66,66,110,93,92,80,49,170,131,6,13,218,206,43,166,192,110,168,46,168,28,239,2,195,32,184,160,134,160,143,148,113,128,10,157, - 106,8,97,56,100,165,93,221,108,75,123,155,164,146,132,136,104,143,208,130,194,178,0,37,105,14,80,49,51,205,9,80,74,50,38,195,116,148,192,151, - 74,99,33,18,51,174,210,48,152,184,172,53,140,199,122,68,80,49,214,217,176,28,82,49,92,105,237,130,138,1,138,188,171,84,12,70,173,52,12,131, - 102,9,26,70,27,33,42,173,67,55,243,90,197,80,151,50,162,86,6,10,106,178,69,37,11,133,184,176,210,70,210,81,130,55,216,34,76,211,86,166, - 136,214,91,27,168,14,49,37,135,20,237,16,108,119,207,203,79,130,237,51,161,53,142,199,171,71,26,4,21,16,69,39,101,84,217,226,180,245,145,103, - 176,9,195,53,196,21,29,155,108,34,112,58,115,111,159,199,212,193,183,234,114,167,89,122,187,34,119,255,102,103,254,20,174,9,194,172,199,231,81,214, - 226,143,18,210,244,82,77,41,159,80,181,181,82,141,7,101,41,193,227,12,55,100,3,18,196,134,36,233,43,227,48,74,41,218,219,1,226,95,236,180, - 240,36,33,233,99,175,4,246,171,193,126,87,10,138,106,219,161,168,235,220,68,60,112,130,120,112,46,91,210,238,102,109,98,59,7,141,4,215,69,30, - 64,162,18,223,194,254,237,235,133,236,138,85,68,7,198,65,172,164,219,61,56,3,133,70,207,180,64,121,187,74,227,59,237,141,163,52,8,156,70,105, - 140,32,26,20,40,215,158,172,0,156,62,45,130,191,64,158,169,10,22,136,109,253,209,4,85,103,82,107,9,131,187,165,217,45,205,182,239,70,231,6, - 191,92,68,69,135,206,106,15,245,140,249,88,43,148,231,193,131,160,7,4,137,36,224,77,59,17,156,18,105,36,195,216,116,51,183,210,114,69,29,122, - 203,188,9,52,120,176,180,196,214,208,53,237,109,123,146,129,106,219,139,169,91,166,104,129,105,136,37,25,249,220,160,42,109,184,13,126,184,48,78,243, - 96,38,53,220,31,21,152,43,12,96,15,142,195,163,115,149,43,151,144,195,30,195,178,41,189,255,182,112,216,64,140,119,32,6,211,234,169,230,244,140, - 215,85,166,149,185,245,96,76,69,84,14,65,115,176,213,150,46,19,201,32,78,134,9,142,73,232,161,186,177,166,24,112,81,26,166,201,27,64,200,132, - 0,155,108,16,61,134,7,19,79,62,37,218,32,104,55,245,125,2,200,208,16,5,17,225,202,154,144,196,203,232,169,31,110,137,134,189,47,149,32,26, - 77,202,86,83,166,27,131,107,141,0,144,136,92,195,129,48,68,67,204,108,88,120,32,15,177,61,41,150,221,85,126,26,252,35,184,52,162,181,114,73, - 79,162,26,56,191,213,189,204,25,120,57,6,139,18,222,185,106,12,105,16,254,73,172,24,155,164,53,23,170,76,229,22,142,85,152,48,150,44,5,209, - 224,229,91,89,45,12,158,142,39,82,88,123,61,156,64,252,6,92,17,119,188,148,74,17,173,97,33,54,178,105,40,27,54,71,132,90,20,180,18,75, - 94,89,36,177,238,234,194,138,125,117,167,144,153,229,117,103,30,236,130,59,230,207,132,165,218,81,104,226,1,57,177,92,58,103,9,239,213,250,132,170, - 186,105,40,111,201,30,48,3,227,109,182,68,14,187,65,24,99,140,135,238,160,22,176,167,92,141,10,26,149,238,195,111,229,16,100,59,162,192,0,112, - 112,202,101,134,60,151,51,140,195,169,212,187,69,145,196,235,112,99,32,49,121,38,240,21,27,18,187,51,60,221,137,224,51,104,67,90,19,28,203,102, - 178,21,137,150,41,50,207,45,229,137,55,52,44,28,58,75,121,191,237,204,213,180,214,152,17,137,75,56,202,38,48,17,174,189,242,97,250,240,96,17, - 51,237,48,246,144,41,3,94,201,148,217,222,46,150,61,201,176,125,247,172,214,169,82,56,135,152,205,97,23,211,249,24,108,11,195,222,141,138,119,131, - 114,196,46,181,48,175,216,181,2,142,53,252,33,173,6,63,15,72,163,49,42,108,196,55,70,207,8,155,1,27,64,67,14,96,162,28,54,185,4,246, - 123,53,79,117,255,105,184,227,59,148,31,195,99,14,225,214,196,85,42,7,222,12,177,123,57,148,103,110,122,79,92,14,193,4,34,68,163,59,101,242, - 149,185,16,143,11,16,146,214,143,133,215,94,8,203,204,119,212,30,73,175,111,229,66,190,226,235,97,94,78,142,248,149,77,187,239,98,250,114,98,138, - 246,135,233,187,167,250,238,200,35,251,57,169,12,190,190,178,74,106,88,120,218,30,110,137,62,163,147,23,41,125,92,108,220,66,243,83,211,206,73,99, - 105,216,139,157,124,98,248,8,245,133,18,210,221,227,26,163,132,230,85,186,94,49,43,100,229,184,34,16,114,66,70,84,74,145,41,143,248,137,104,78, - 48,230,130,219,173,224,215,169,112,4,32,181,220,228,210,2,209,53,68,112,154,50,122,42,196,45,30,174,11,57,159,9,218,219,61,45,17,212,72,200, - 151,18,103,218,131,83,54,166,9,184,93,78,235,224,13,37,168,13,13,129,188,87,206,104,158,164,197,119,83,166,155,1,18,148,19,229,8,35,185,84, - 33,43,109,169,67,88,99,101,157,226,17,41,156,214,96,214,112,240,27,98,136,234,208,157,163,52,249,134,72,129,158,129,39,28,72,130,146,216,50,166, - 241,12,222,56,171,50,231,91,42,133,127,138,222,227,81,7,138,93,42,104,134,158,252,17,245,113,22,98,219,112,80,100,169,194,159,104,28,238,32,243, - 148,79,181,244,184,5,156,201,32,26,44,66,170,202,97,183,204,122,27,164,29,174,7,151,93,82,170,63,72,91,35,76,113,138,98,3,112,138,89,30, - 161,226,93,18,65,145,123,217,40,35,45,134,253,15,26,159,176,19,41,246,61,112,6,180,125,232,60,177,247,148,219,141,106,87,255,190,203,203,162,95, - 92,11,196,11,196,145,46,170,73,170,50,36,12,209,20,133,84,154,222,166,65,66,37,2,164,12,48,240,78,253,125,197,36,39,142,133,200,174,147,92, - 147,174,26,195,112,120,250,117,210,60,140,97,36,157,185,13,255,147,152,247,199,144,122,136,161,91,18,49,73,137,68,50,53,71,165,238,58,99,168,238, - 24,234,187,212,191,174,212,69,87,34,226,136,212,61,59,38,117,47,58,99,176,238,24,236,143,37,245,104,233,93,53,231,235,165,195,49,49,100,113,3, - 129,150,30,29,29,237,228,50,152,167,87,16,59,245,242,9,69,3,219,151,189,124,6,62,240,131,160,239,63,255,35,162,252,188,75,104,203,199,214,242, - 49,210,41,81,249,26,149,124,92,235,225,184,72,194,71,149,158,239,42,61,221,29,67,39,199,248,207,98,227,31,14,9,178,43,37,121,24,9,146,29, - 83,132,146,117,21,33,239,142,193,255,168,72,216,50,65,91,177,115,172,106,3,23,36,37,208,223,213,191,233,184,50,36,135,223,209,73,103,56,6,136, - 72,14,177,110,221,170,185,101,211,197,161,172,176,146,62,124,94,126,195,231,72,253,243,78,140,222,45,65,72,232,155,229,166,135,129,79,201,114,211,155, - 22,36,194,76,239,122,66,228,155,75,73,109,76,183,245,207,145,155,18,90,233,116,110,74,236,73,74,113,223,46,30,105,167,164,20,1,57,157,143,50, - 225,173,53,59,222,4,29,131,212,125,82,102,41,116,48,168,218,110,146,74,156,85,71,129,135,91,117,250,250,116,224,33,24,170,251,177,14,161,242,238, - 43,17,112,201,48,171,168,0,24,222,28,216,236,206,40,165,128,246,219,188,84,93,180,187,243,160,207,206,211,59,157,199,125,118,30,120,173,159,12,154, - 46,239,23,195,195,231,17,219,121,115,201,184,167,89,114,204,223,250,240,186,6,155,121,238,180,82,248,97,195,219,71,180,55,140,211,107,118,61,212,44, - 24,167,37,20,180,142,223,170,191,137,138,149,227,206,200,193,246,133,168,196,219,205,123,80,161,163,164,55,206,203,45,135,233,12,80,72,231,130,166,234, - 115,67,106,132,61,71,23,219,123,247,0,107,231,237,172,45,80,238,190,209,181,141,229,157,215,192,110,240,239,76,244,6,144,29,229,68,239,43,182,70, - 237,87,78,187,175,170,61,169,182,228,17,154,248,185,53,18,103,223,250,97,198,211,42,207,232,5,10,93,153,100,108,255,19,28,201,46,232,17,144,174, - 25,9,31,39,190,162,200,62,215,185,198,197,124,57,121,191,95,96,155,194,103,38,149,102,225,92,192,73,77,103,1,84,224,202,45,34,70,11,53,164, - 51,233,52,213,50,12,4,29,228,115,74,118,142,232,240,136,115,202,181,210,67,27,78,40,30,74,17,172,115,216,250,85,28,65,207,31,202,22,17,155, - 87,99,23,106,65,39,240,214,42,99,67,253,40,189,225,91,43,17,119,240,54,73,21,100,61,140,211,254,8,45,84,164,105,39,61,85,179,101,84,191, - 45,168,102,158,146,232,66,82,186,29,225,62,195,162,77,114,241,137,84,43,143,223,199,113,160,198,235,209,69,97,187,86,156,71,190,118,237,147,26,3, - 141,200,228,25,148,54,83,156,85,21,178,84,71,105,254,191,188,43,200,109,24,134,97,247,189,162,15,8,2,203,150,37,11,24,118,217,181,255,127,207, - 72,37,1,50,204,205,10,236,182,94,5,180,9,194,152,162,100,42,230,108,91,225,198,2,210,154,17,137,180,161,216,82,87,23,71,30,1,58,190,58, - 0,219,204,49,221,163,197,222,218,42,62,194,237,20,253,156,70,19,178,38,61,237,29,233,133,137,105,236,206,76,206,150,236,248,246,151,147,32,160,25, - 222,232,43,190,10,1,66,100,70,213,112,238,38,161,20,192,107,215,119,163,18,103,133,80,166,2,183,42,125,250,124,46,101,183,75,71,54,157,178,206, - 117,59,227,119,126,97,138,121,192,47,77,255,99,74,120,64,48,207,21,224,26,218,4,218,231,201,156,204,3,58,254,50,191,119,32,225,175,152,155,143, - 22,183,131,115,123,154,205,32,178,76,246,174,42,253,110,30,116,169,121,119,144,37,151,159,231,232,19,228,179,248,10,122,47,53,23,254,128,180,171,177, - 96,113,42,207,24,208,27,61,114,160,213,161,75,14,234,133,228,220,140,180,156,118,137,92,248,101,148,226,126,84,207,170,27,29,136,241,115,123,27,87, - 235,104,149,99,46,40,154,77,233,101,131,134,4,123,21,252,94,129,26,46,106,183,78,87,114,53,203,61,53,171,188,229,116,136,13,218,13,41,146,101, - 173,134,171,139,241,222,161,63,91,158,84,49,138,65,250,13,146,99,29,59,199,8,213,96,221,120,240,199,3,153,237,180,197,233,172,146,75,139,239,169, - 172,120,231,55,91,62,222,190,0,80,75,3,4,20,0,2,0,8,0,118,128,249,52,254,120,218,95,213,23,0,0,110,124,0,0,20,0,0,0,100, - 111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,236,93,91,115,26,73,150,126,239,95,193,210,47,237,24,81,228,253,34,91,158, - 232,117,199,108,204,134,103,55,98,186,59,246,185,4,37,137,54,2,13,32,75,246,175,223,239,100,21,69,86,145,64,33,100,217,211,97,20,29,134,83, - 121,61,231,203,115,203,204,234,55,127,125,188,157,246,62,22,139,229,100,62,187,232,243,140,245,123,197,108,52,31,79,102,215,23,253,223,127,251,219,192, - 245,123,203,85,62,27,231,211,249,172,184,232,207,230,253,191,190,253,225,205,127,12,6,189,119,139,34,95,21,227,222,195,100,117,211,251,251,236,195,114, - 148,223,21,189,159,110,86,171,187,243,225,240,225,225,33,155,84,196,108,190,184,30,190,234,13,6,168,185,252,120,253,67,175,215,67,183,179,229,249,120, - 116,209,175,202,223,221,47,166,161,220,120,52,44,166,197,109,49,91,45,135,60,227,195,254,166,248,104,83,252,161,184,204,22,197,114,126,191,24,149,205, - 143,70,113,201,197,248,106,83,20,35,121,144,161,16,247,222,15,153,24,10,49,64,137,193,242,211,108,149,63,14,102,203,31,163,170,24,96,170,170,96, - 140,13,241,108,83,178,91,169,243,199,41,216,176,115,48,225,105,220,59,88,127,135,255,234,10,107,66,86,206,245,10,53,139,108,86,172,134,191,252,246, - 75,253,112,192,178,241,106,28,53,179,230,124,163,223,134,56,102,249,109,177,188,203,71,197,114,184,166,135,250,235,38,207,199,243,17,149,185,232,227,203, - 61,137,99,176,204,63,22,131,124,153,173,231,23,23,189,204,151,40,58,188,153,223,22,195,63,38,183,183,249,104,184,92,140,134,163,143,203,33,208,115, - 61,31,76,70,243,217,96,117,3,193,14,209,217,52,191,156,22,195,124,180,2,236,150,161,177,245,32,206,107,48,178,76,201,191,140,139,143,197,180,217, - 91,84,64,138,178,238,248,162,143,65,9,207,101,248,125,83,76,174,111,86,23,125,229,238,30,3,225,97,50,94,221,84,191,223,130,240,102,92,92,45, - 233,65,89,151,126,201,240,0,143,22,249,120,146,79,255,139,254,193,164,203,66,209,240,70,243,233,180,24,161,241,124,250,144,127,42,199,78,159,32,200, - 243,155,69,1,224,253,136,239,69,190,88,183,161,153,97,117,57,234,175,217,133,102,146,215,143,175,43,226,239,179,201,10,8,187,95,22,139,95,73,74, - 255,59,251,125,89,108,149,250,109,145,207,150,128,196,237,69,255,54,95,45,38,143,63,13,68,102,173,146,206,159,49,252,241,204,27,111,153,57,227,28, - 116,35,228,217,192,89,145,57,167,213,171,186,177,209,227,69,223,48,157,89,174,132,223,80,63,17,191,76,102,148,117,27,234,85,178,236,85,178,236,2, - 250,132,219,12,37,157,233,247,134,21,123,155,172,233,204,94,98,91,130,171,111,171,231,111,150,171,249,221,186,44,176,178,250,52,5,28,137,56,64,139, - 243,197,249,229,52,31,125,120,29,8,115,240,115,178,250,116,206,95,247,55,53,230,87,87,203,2,221,178,136,22,96,133,26,232,73,212,19,120,90,95, - 44,213,23,79,247,165,54,204,26,54,167,252,245,16,26,9,251,84,132,166,1,58,224,206,243,204,200,111,23,161,9,0,42,215,127,118,80,164,1,168, - 217,110,0,70,165,76,170,193,76,247,143,95,25,47,6,119,45,14,193,253,137,26,99,47,220,33,185,125,130,21,246,5,224,46,50,110,125,10,238,143, - 252,162,47,25,168,218,242,141,236,62,17,213,180,33,252,40,146,101,5,45,2,159,17,112,236,241,200,54,222,232,238,200,254,113,28,62,79,84,174,232, - 203,30,131,182,31,175,198,244,215,161,55,158,238,205,127,33,188,165,216,40,142,97,163,96,42,119,246,201,108,20,199,177,49,213,27,235,206,70,241,146, - 108,100,252,8,54,74,101,116,174,158,204,70,38,143,98,99,170,183,35,216,200,244,139,177,81,121,127,12,27,175,194,231,137,108,68,95,199,177,49,213, - 91,103,54,162,55,253,242,62,83,224,231,110,159,9,143,109,195,129,17,50,83,202,50,107,27,14,140,201,148,182,198,42,221,112,96,182,203,94,37,203, - 146,3,227,51,184,167,186,75,104,192,51,201,209,44,135,245,201,24,51,146,139,98,32,194,15,33,188,81,244,3,69,164,17,130,159,41,147,225,31,230, - 206,6,42,243,204,59,103,95,117,52,137,71,91,27,193,221,102,158,59,37,114,192,249,65,35,254,0,56,187,131,252,160,171,37,184,231,7,192,217,29, - 228,47,238,254,52,25,190,37,15,110,17,130,60,151,251,195,50,207,21,231,10,200,82,92,88,207,139,1,39,247,39,254,85,151,25,200,204,25,103,60, - 80,7,183,137,65,61,138,150,87,36,51,166,189,103,166,225,21,9,155,73,143,6,108,195,43,66,196,107,132,146,210,54,188,34,80,181,147,54,246,2, - 158,77,195,58,131,56,177,187,206,99,225,243,68,13,139,190,212,81,26,54,213,91,103,13,139,222,204,203,107,216,192,207,221,26,22,143,93,83,195,170, - 12,162,229,194,52,52,172,132,218,20,156,71,46,253,85,178,236,85,178,44,105,88,13,159,91,89,105,59,192,157,20,43,125,206,6,54,115,220,40,99, - 139,129,12,58,150,75,161,152,15,191,16,145,73,99,41,25,163,51,231,173,55,208,195,180,66,76,230,172,100,230,203,41,90,173,245,65,61,170,181,253, - 242,122,52,209,68,97,232,175,213,68,197,205,116,160,140,232,166,252,244,83,211,48,188,131,26,215,70,38,91,182,122,171,229,174,179,222,12,249,168,217, - 115,250,59,106,246,78,113,172,202,72,85,55,230,165,187,204,94,167,76,102,221,237,179,76,254,56,163,182,237,180,10,171,78,116,90,89,38,180,66,8, - 225,93,154,143,187,65,132,206,205,201,94,236,94,41,242,253,189,187,231,99,99,132,147,167,186,88,104,196,28,175,26,118,88,185,131,232,68,111,238,120, - 23,107,135,149,123,54,54,234,231,96,163,54,47,231,169,162,55,247,149,61,213,4,27,149,58,204,37,101,58,46,215,148,58,85,244,119,188,102,142,122, - 119,79,87,141,99,73,127,95,94,53,74,243,12,96,148,238,120,48,22,225,243,20,48,42,118,60,24,83,189,61,39,27,133,235,192,37,246,116,48,94, - 134,207,41,96,148,226,233,96,244,87,244,247,197,193,200,221,225,37,205,221,9,75,218,73,250,59,129,139,220,157,176,164,83,50,100,39,114,49,17,69, - 172,232,235,52,95,21,136,155,173,135,219,34,207,36,190,120,238,216,171,70,24,43,117,38,28,23,154,53,66,94,4,53,198,145,239,218,220,52,216,46, - 11,170,13,105,163,120,226,221,66,253,212,10,98,190,83,194,140,48,114,80,97,29,136,106,186,13,146,88,164,88,230,149,244,82,55,247,74,76,198,29, - 130,44,219,204,32,184,76,57,206,173,105,177,200,48,101,4,211,123,39,47,85,167,201,147,154,233,28,20,31,128,70,21,99,234,140,7,9,190,122,62, - 166,73,192,77,35,176,222,74,165,8,193,157,144,77,92,217,12,188,1,219,26,76,163,178,214,42,46,246,50,77,137,110,76,235,98,226,78,102,90,58, - 115,113,106,230,139,99,213,25,76,20,225,190,117,60,36,181,240,141,51,235,40,205,10,130,214,130,242,92,82,43,169,28,74,193,231,224,42,90,231,11, - 224,18,24,150,96,113,51,15,44,50,175,157,230,158,53,50,26,92,103,218,114,21,37,38,71,201,178,163,100,217,68,2,187,161,49,246,9,73,189,232, - 178,198,170,20,204,68,192,32,132,42,149,49,111,120,75,243,169,76,73,201,165,97,109,132,74,235,164,182,123,17,106,58,78,190,75,68,240,205,34,180, - 234,145,37,190,24,205,153,12,0,117,78,131,223,33,83,235,51,165,181,241,178,9,82,153,105,13,91,165,154,32,181,65,34,122,107,99,67,32,20,87, - 45,144,110,149,29,37,203,166,64,106,59,202,201,188,36,72,133,193,178,182,48,52,77,243,44,97,158,29,20,64,3,164,156,182,101,156,139,237,20,79, - 149,77,38,71,58,170,81,171,190,154,237,57,105,163,66,235,125,182,23,143,101,123,123,64,73,152,241,214,161,9,58,117,161,172,109,218,52,193,51,171, - 172,143,56,19,182,7,64,117,240,14,252,51,229,96,79,152,124,216,246,222,187,43,110,155,106,77,193,116,115,163,124,19,93,154,182,84,84,20,65,208, - 228,93,230,188,150,194,53,79,140,112,3,150,72,213,249,52,226,23,157,188,208,123,39,47,183,189,142,166,212,185,139,41,52,233,230,70,16,228,207,225, - 144,126,27,147,53,251,39,107,155,147,133,183,202,12,87,198,180,97,142,217,72,213,60,27,148,40,91,122,193,74,90,229,197,81,147,127,51,164,131,178, - 225,91,125,24,151,142,8,143,63,78,138,135,31,154,108,120,152,204,198,243,135,1,148,59,175,117,88,251,33,116,188,170,119,120,218,15,215,103,120,55, - 48,111,151,168,14,245,122,239,219,5,234,19,203,247,229,108,170,83,192,81,137,235,197,100,60,184,188,156,63,146,114,187,95,43,239,229,205,252,129,158, - 92,244,175,242,105,173,210,55,162,189,95,44,168,213,105,254,169,128,221,11,255,108,13,159,236,25,39,237,232,253,214,188,201,170,129,245,177,211,92,63, - 251,60,159,223,146,187,230,132,131,190,222,122,124,151,95,23,203,155,28,243,70,161,212,195,42,42,13,241,116,245,252,114,190,24,23,139,232,129,128,33, - 208,172,30,87,249,60,68,184,192,164,9,159,234,17,181,184,126,80,38,3,251,155,227,210,116,214,187,61,4,98,93,60,198,152,129,87,147,233,20,237, - 148,71,101,214,172,94,45,230,31,16,100,87,231,144,214,8,187,45,86,249,56,95,229,155,206,214,20,85,159,207,30,95,157,255,243,151,191,213,225,254, - 104,116,254,127,243,197,135,77,248,78,5,242,203,249,61,192,83,167,36,232,200,247,232,156,172,89,190,122,59,185,197,64,233,148,254,95,30,111,167,0, - 117,253,160,81,120,245,233,174,216,52,90,54,187,190,113,144,188,181,48,30,221,78,168,210,240,215,21,38,252,119,234,36,74,75,84,141,78,86,211,226, - 237,175,249,199,162,247,243,50,116,93,82,26,133,70,116,177,98,190,120,27,245,78,179,252,249,186,206,40,108,55,249,223,249,135,251,203,222,175,171,2, - 170,99,145,106,152,150,239,118,35,161,228,86,127,212,236,242,254,242,15,232,177,70,3,196,130,255,204,175,91,99,32,234,116,242,246,102,60,126,51,172, - 190,167,11,228,139,113,111,188,152,124,44,246,151,163,107,6,189,124,185,191,208,100,126,160,17,76,40,217,79,73,107,204,34,48,97,107,190,196,242,233, - 100,84,204,150,135,97,16,56,136,137,141,230,183,183,243,217,50,32,162,170,187,28,94,126,26,44,243,161,200,216,112,11,14,147,49,164,49,185,154,20, - 139,246,147,178,131,183,85,251,229,141,138,236,246,126,57,25,221,228,211,105,54,250,92,14,186,44,245,67,36,96,90,11,241,218,120,223,158,66,180,60, - 142,28,125,147,55,119,197,2,120,95,30,228,77,234,166,206,63,139,187,197,124,124,31,174,127,52,153,114,98,195,191,76,160,88,38,151,247,201,134,23, - 197,191,238,39,168,241,164,150,255,103,190,2,75,158,183,205,159,87,187,7,123,18,23,10,172,178,32,82,66,195,242,121,7,253,43,214,113,241,243,116, - 242,33,102,70,128,94,5,181,117,42,52,82,212,111,134,107,53,30,126,93,183,140,199,52,191,44,96,33,238,38,143,145,149,73,155,215,235,197,252,254, - 238,118,62,46,170,2,107,171,112,253,67,51,121,59,158,44,239,80,224,124,50,35,103,170,225,93,93,107,38,54,142,207,42,113,98,155,14,35,49,77, - 231,225,170,67,219,194,11,22,14,203,41,157,41,114,157,207,20,2,5,45,132,123,181,201,122,47,160,62,54,28,133,193,29,112,141,56,218,27,23,31, - 192,127,12,116,237,225,157,138,248,240,65,125,103,201,186,50,118,140,158,85,158,14,151,210,211,21,9,221,218,45,166,142,21,183,114,59,133,189,73,85, - 43,38,224,7,58,253,58,62,179,79,134,249,28,22,236,167,31,183,15,192,191,10,79,163,237,157,240,115,113,63,45,206,103,243,217,103,248,21,175,75, - 27,78,63,139,234,123,233,147,157,243,245,79,106,22,98,59,135,208,102,227,152,248,199,124,50,59,7,190,139,197,235,219,124,241,161,88,148,173,148,223, - 7,203,85,190,88,53,40,183,147,113,227,119,49,27,55,250,13,77,77,39,248,231,92,173,105,227,28,206,200,98,1,16,196,37,137,90,38,255,207,217, - 154,182,153,228,199,201,114,114,57,153,210,143,240,117,90,188,110,34,233,245,252,99,177,184,154,206,31,214,207,227,69,112,151,175,110,34,25,212,62,50, - 224,74,142,1,60,209,17,62,45,233,81,37,205,26,187,180,160,254,163,55,16,28,210,230,206,210,113,57,2,146,99,210,245,222,237,160,71,84,41,108, - 102,52,83,60,77,68,11,150,2,61,165,189,2,217,101,90,51,103,122,8,231,41,79,169,204,153,16,128,139,99,86,175,105,210,157,57,151,41,173,132, - 212,168,190,161,14,148,204,180,21,146,137,222,0,177,183,209,90,201,104,84,102,199,88,63,247,78,64,234,246,205,164,239,72,61,25,169,39,202,64,242, - 239,50,232,40,131,246,34,175,77,65,107,145,39,233,17,53,90,228,41,34,181,96,153,64,24,106,116,180,200,7,220,51,133,34,66,71,171,60,34,198, - 203,60,34,199,235,156,35,132,204,4,215,182,177,206,147,195,109,172,243,141,170,107,152,182,157,74,114,179,165,90,121,234,13,204,238,168,182,28,173,63, - 13,139,79,53,21,247,155,28,72,224,61,167,29,26,109,252,25,151,25,131,138,18,196,120,142,193,27,214,32,242,112,130,76,41,78,52,105,173,99,129, - 198,24,104,130,104,94,66,25,242,178,114,160,242,136,10,206,73,116,194,33,6,158,49,169,60,24,147,162,189,219,81,50,12,177,164,89,102,148,183,49, - 77,208,33,83,238,202,218,219,212,13,77,193,169,49,134,107,147,164,197,181,73,212,10,19,247,160,121,37,149,181,103,97,115,133,115,237,122,10,36,202, - 200,235,154,102,122,239,123,84,133,166,29,17,223,245,240,29,158,146,240,50,162,2,57,204,59,238,169,19,105,133,183,49,73,100,66,89,197,66,131,107, - 34,166,162,61,93,159,163,6,183,137,132,68,160,29,238,24,184,227,132,101,92,135,98,97,48,146,196,27,152,248,190,39,221,90,212,42,72,85,146,180, - 64,228,140,115,44,16,78,240,6,192,117,79,98,1,97,246,46,208,152,135,167,39,137,198,91,144,120,159,2,79,4,247,74,161,6,141,25,212,201,78, - 237,88,124,44,0,225,181,182,59,255,17,16,192,95,83,65,138,110,10,178,65,237,174,226,234,81,109,150,92,135,149,182,115,149,69,251,49,97,149,1, - 89,86,234,10,151,92,112,199,5,73,24,0,135,44,225,45,80,218,82,120,8,148,168,60,220,110,116,65,158,10,62,119,73,213,25,231,176,243,65,200, - 204,75,175,99,98,137,27,47,108,9,145,138,72,248,194,10,50,4,67,216,39,97,69,5,67,65,40,134,184,185,83,4,186,154,70,67,242,180,21,203, - 85,68,165,133,129,65,122,99,108,68,221,76,41,44,22,140,211,198,180,176,172,224,92,17,238,18,147,223,1,147,132,27,78,103,11,94,117,134,78,194, - 176,102,48,227,208,81,222,220,61,182,33,132,168,115,181,195,196,158,128,139,74,255,46,183,112,33,33,183,54,46,232,84,174,131,6,13,218,206,43,166, - 192,110,168,46,168,28,239,2,195,32,184,160,134,160,143,148,113,128,10,109,239,8,97,56,100,165,93,85,172,166,189,75,82,73,66,68,180,7,104,65, - 97,89,128,146,52,7,168,24,153,230,4,40,37,25,147,97,56,74,224,75,169,177,16,137,25,87,106,24,12,92,86,26,198,99,62,34,168,24,235,108, - 152,14,169,24,174,180,118,65,197,0,69,222,149,42,6,189,150,26,134,65,179,4,13,163,141,16,165,214,161,202,188,82,49,212,164,140,168,165,129,130, - 154,108,80,201,66,33,46,44,181,145,116,148,230,13,182,8,195,180,165,41,162,249,86,6,170,69,76,201,33,69,219,7,219,237,131,3,39,193,246,153, - 208,26,199,227,229,221,14,65,39,169,162,45,67,58,226,227,180,245,145,103,176,14,195,53,196,21,237,31,173,35,112,58,124,208,220,171,169,130,111,213, - 230,206,102,234,205,163,201,187,23,59,243,167,112,77,16,102,61,62,71,89,139,63,75,72,211,73,53,165,124,66,213,212,74,21,30,148,165,4,143,51, - 220,144,13,72,16,55,36,73,95,25,135,81,74,209,222,245,16,255,98,165,133,43,149,164,143,189,18,88,175,6,235,93,41,40,170,186,65,81,29,248, - 19,113,199,9,226,222,177,212,164,237,197,186,137,237,28,52,18,92,23,185,7,137,74,124,11,235,183,171,23,178,45,86,17,237,156,7,177,146,110,247, - 224,12,20,26,93,238,129,242,118,165,198,119,218,27,71,105,16,56,141,210,24,65,52,40,80,174,61,89,1,56,125,90,4,127,129,60,83,21,44,16, - 171,253,209,4,85,103,82,107,9,131,91,211,108,77,179,205,218,104,220,224,151,139,168,104,208,89,237,161,158,49,30,107,133,242,60,120,16,116,83,146, - 72,2,222,180,19,193,41,145,70,50,244,77,149,185,149,150,43,106,208,91,230,77,160,193,131,165,41,54,186,174,104,239,154,131,12,84,219,156,76,85, - 50,69,11,76,67,44,201,200,231,6,85,105,195,109,240,195,133,113,154,7,51,169,225,254,168,192,92,97,0,123,112,28,30,157,43,93,185,132,28,118, - 24,150,245,29,132,111,11,135,27,136,241,22,196,96,90,61,29,190,61,227,213,113,219,210,220,122,48,166,36,42,135,160,57,216,106,75,143,137,100,16, - 39,195,4,199,36,180,80,86,172,40,6,92,148,134,105,242,6,16,50,33,192,38,27,68,247,17,97,226,201,167,68,25,4,237,166,170,39,128,12,13, - 81,16,17,174,172,9,73,188,140,174,63,113,75,52,172,125,169,4,209,104,80,182,28,50,85,12,174,53,2,64,34,114,13,7,194,16,13,49,179,97, - 225,102,34,98,123,82,44,219,179,252,220,251,71,112,105,68,99,230,146,174,228,26,56,191,101,93,230,12,188,28,131,73,9,239,92,217,135,52,8,255, - 36,102,140,69,210,24,11,29,209,229,22,142,85,24,48,166,44,5,209,224,229,91,89,78,12,158,142,39,82,152,123,213,157,64,252,6,92,17,119,188, - 148,74,17,109,195,66,44,100,179,161,172,217,28,17,42,81,208,76,44,121,101,145,196,218,179,11,51,246,101,77,33,51,203,171,198,60,216,5,119,204, - 159,9,75,135,104,161,137,123,228,196,114,233,156,37,188,151,243,19,170,108,102,67,121,71,246,128,25,24,111,83,19,57,236,6,97,140,49,30,154,131, - 90,192,154,114,21,42,168,87,170,135,223,202,33,200,118,68,129,1,224,224,148,203,12,121,46,103,232,135,211,153,247,6,69,18,175,67,197,64,98,242, - 76,224,43,22,36,86,103,184,230,138,224,51,104,67,154,19,28,203,205,96,75,18,77,83,100,158,91,202,19,175,105,152,184,167,195,36,190,110,204,85, - 180,70,159,17,137,75,56,202,38,48,17,174,189,242,97,248,240,96,17,51,109,49,118,159,41,3,94,201,148,217,206,46,150,61,201,176,125,247,172,86, - 169,51,129,14,49,155,195,42,166,253,49,216,22,134,181,27,157,98,14,202,17,171,212,194,188,98,213,10,56,214,240,135,180,234,253,220,35,141,198,232, - 132,39,190,49,186,44,109,122,172,7,13,217,131,137,114,88,228,18,216,239,84,60,213,252,231,254,150,239,176,248,20,238,123,132,170,137,167,116,46,122, - 221,197,246,227,112,78,117,221,122,226,113,8,38,16,33,26,221,186,47,80,154,11,113,92,128,144,180,126,44,188,255,67,88,102,190,163,246,64,122,189, - 150,11,249,138,23,253,124,49,58,224,87,110,202,125,23,211,203,137,41,90,31,166,235,154,234,186,34,15,172,231,164,50,248,250,202,42,169,97,225,105, - 123,184,37,250,140,118,94,164,244,241,169,235,6,154,159,154,118,78,26,75,195,94,109,229,19,195,71,168,23,74,72,183,183,107,140,18,154,151,233,122, - 197,172,144,165,227,138,64,200,9,25,81,41,69,166,60,226,39,162,57,193,152,11,110,183,130,95,167,194,22,128,212,114,157,75,11,68,183,33,130,211, - 148,209,83,33,110,241,112,93,200,249,76,208,222,237,40,137,160,70,66,190,148,56,211,30,156,178,49,77,192,237,114,90,7,111,40,65,221,208,16,200, - 123,229,140,230,73,90,92,155,50,221,12,144,160,156,40,71,24,201,165,10,89,105,75,13,194,26,43,235,20,143,72,97,183,6,163,134,131,191,33,134, - 168,14,205,57,74,147,175,137,20,232,25,120,194,129,36,40,137,45,99,26,207,224,141,179,50,115,94,83,41,252,83,244,66,147,42,80,108,83,65,51, - 116,5,74,84,219,89,136,109,195,70,145,165,171,14,68,227,112,7,153,167,124,170,165,123,39,112,38,131,104,48,9,169,74,135,221,50,235,109,144,118, - 120,30,92,118,73,169,254,32,109,141,48,197,41,138,13,192,41,102,121,132,138,247,73,4,69,238,229,70,25,105,209,239,190,209,248,132,149,72,177,239, - 158,61,160,250,246,125,98,237,209,43,140,219,171,111,249,175,251,124,81,116,139,107,129,120,129,56,210,69,103,146,202,12,9,67,52,69,33,149,166,215, - 138,144,80,137,0,41,3,12,188,117,17,161,100,146,19,135,66,100,215,74,174,73,87,246,97,56,60,253,42,105,30,250,48,146,246,220,250,255,78,204, - 251,115,72,61,196,208,13,137,152,164,68,34,153,154,131,82,119,173,62,84,187,15,245,93,234,95,87,234,162,45,17,113,64,234,158,29,146,122,116,149, - 164,236,131,181,251,96,127,46,169,71,83,111,171,57,95,77,29,142,137,33,139,27,8,52,245,104,235,104,43,151,193,60,189,177,218,169,215,79,99,69, - 253,226,155,47,192,10,190,23,247,255,38,83,104,138,200,86,34,50,210,41,81,186,27,165,136,92,227,162,96,36,228,131,122,207,183,245,158,110,247,161, - 147,125,124,71,194,87,69,130,108,75,73,238,71,130,100,135,116,161,100,109,93,200,219,125,240,63,43,18,106,38,104,43,182,118,86,109,224,130,164,28, - 250,251,234,55,237,88,134,252,240,123,218,236,12,59,1,17,201,33,220,173,74,109,170,172,155,216,151,24,86,210,135,207,235,111,120,43,169,123,234,137, - 209,123,54,8,9,93,19,221,116,49,250,148,68,55,189,117,66,34,210,244,174,35,68,190,185,172,212,218,122,91,255,28,233,41,161,149,78,167,167,196, - 142,188,20,247,205,243,35,205,172,148,34,32,167,83,82,38,188,193,103,203,161,160,157,144,170,77,74,46,133,6,122,101,217,117,94,137,179,114,55,112, - 127,169,86,91,159,247,220,131,161,163,63,214,33,90,222,126,61,4,30,25,102,21,157,1,134,67,7,54,187,51,202,42,160,124,157,154,170,206,237,110, - 221,245,217,186,192,211,186,241,179,117,243,181,186,28,52,158,63,204,250,251,183,36,234,113,115,201,184,167,81,114,140,223,250,240,234,10,155,121,238,180, - 82,248,97,195,155,88,180,55,140,211,43,135,61,212,44,24,167,37,20,180,142,255,63,12,235,192,88,57,238,140,236,213,47,135,37,222,174,223,9,11, - 29,37,189,113,94,214,28,166,109,64,33,157,11,154,170,75,133,84,15,59,118,47,234,186,59,128,181,245,166,218,6,40,183,223,110,219,196,242,214,43, - 113,215,248,119,38,122,27,202,150,114,162,119,55,91,163,118,43,167,237,215,246,158,116,188,228,8,77,252,220,26,137,179,111,125,63,227,105,135,207,232, - 101,18,109,153,100,108,247,37,142,100,19,116,11,164,109,70,194,199,137,175,40,178,47,181,181,113,57,157,143,62,236,22,216,250,236,51,147,74,179,176, - 53,224,164,166,237,0,58,227,202,45,130,70,11,53,164,51,233,52,29,103,232,9,218,203,231,148,239,28,208,254,17,231,148,110,165,123,27,78,40,30, - 78,35,88,231,176,244,203,56,130,174,32,202,6,17,139,87,99,21,106,65,155,240,214,42,99,195,17,82,122,219,185,86,34,110,224,93,146,42,200,122, - 24,167,253,1,90,56,148,166,157,244,116,160,45,163,35,220,130,142,205,83,30,93,200,255,111,239,90,114,27,6,161,224,190,167,136,212,173,101,241,248, - 188,7,82,213,77,183,61,70,239,127,134,206,96,91,197,53,118,18,119,151,70,89,5,41,177,147,129,121,3,204,96,174,184,99,198,239,240,163,181,251, - 227,59,171,173,210,158,77,114,96,243,186,219,23,182,173,226,210,104,237,89,147,170,130,17,93,24,64,218,46,138,155,76,178,180,82,42,227,109,142,123, - 11,40,107,74,36,170,19,69,7,63,154,24,234,8,208,177,209,0,216,228,143,73,86,66,153,87,183,156,229,98,218,180,126,116,91,43,100,65,82,117, - 120,84,59,76,233,182,125,178,146,115,85,54,175,190,178,211,8,104,178,5,90,139,143,154,0,33,42,99,140,197,184,161,132,169,0,186,93,154,189,74, - 140,11,97,154,10,220,188,164,238,255,115,40,187,77,18,170,105,151,117,142,247,163,174,243,11,75,204,14,191,132,248,136,37,97,135,96,110,155,128,199, - 18,131,64,251,220,88,147,249,176,146,191,68,248,22,36,236,63,214,230,101,149,219,192,185,169,250,205,32,178,84,230,133,85,90,222,172,208,168,102,201, - 64,150,28,126,86,211,79,144,207,98,35,232,221,249,58,240,51,164,157,47,3,6,103,228,243,22,226,133,54,57,208,106,142,67,205,234,21,169,209,25, - 9,53,240,82,234,192,119,217,57,179,101,246,28,227,68,7,162,60,122,112,226,234,152,131,103,210,5,147,102,141,180,179,65,67,130,189,28,62,31,129, - 26,46,170,151,68,99,178,87,173,219,106,234,121,203,213,36,150,233,56,164,72,150,209,43,174,46,202,123,135,254,12,245,169,29,217,41,164,95,38,57, - 250,60,115,140,80,13,250,137,7,55,127,72,111,179,173,52,207,109,57,116,249,118,125,253,167,245,142,201,61,122,231,213,190,248,218,233,244,250,136,1, - 214,43,250,102,137,62,104,73,242,59,37,129,57,38,123,104,115,44,228,146,170,168,135,131,102,239,87,25,12,238,19,135,212,30,68,205,185,138,27,125, - 201,33,255,104,131,201,207,161,30,92,213,228,53,38,27,199,210,122,75,31,129,124,41,186,91,166,22,164,159,113,230,147,189,33,108,50,51,219,112,141, - 173,34,56,43,216,195,10,89,119,126,212,183,111,158,64,158,0,210,54,64,110,112,44,45,142,141,195,145,64,250,118,29,232,141,167,109,189,191,124,3, - 80,75,3,4,20,0,2,0,8,0,106,128,249,52,126,63,165,149,12,18,0,0,232,90,0,0,18,0,0,0,100,111,99,117,109,101,110,116,45,112, - 114,105,110,116,46,115,118,103,237,92,91,115,218,216,150,126,239,95,193,144,151,78,29,35,246,253,226,196,57,213,147,212,153,58,83,153,75,157,238,174, - 121,22,66,216,116,48,120,4,216,78,126,253,124,107,75,136,45,16,32,108,39,233,153,9,116,151,165,181,239,107,127,235,182,247,34,111,255,250,120,59, - 235,221,231,197,114,186,152,95,245,121,194,250,189,124,158,45,198,211,249,245,85,255,247,223,254,54,112,253,222,114,149,206,199,233,108,49,207,175,250,243, - 69,255,175,239,126,122,251,79,131,65,239,125,145,167,171,124,220,123,152,174,110,122,127,159,127,90,102,233,93,222,251,249,102,181,186,187,28,14,31,30, - 30,146,105,69,76,22,197,245,240,117,111,48,64,203,229,253,245,79,189,94,15,195,206,151,151,227,236,170,95,213,191,91,23,179,80,111,156,13,243,89, - 126,155,207,87,203,33,79,248,176,191,173,158,109,171,63,228,163,164,200,151,139,117,145,149,221,103,89,92,179,24,79,182,85,49,147,7,25,42,113,239, - 253,144,137,161,16,3,212,24,44,63,207,87,233,227,96,190,124,21,53,197,4,219,154,10,198,216,16,101,219,154,221,106,93,62,206,192,134,131,147,9, - 165,241,232,96,253,29,254,175,27,108,8,73,185,214,9,90,230,201,60,95,13,63,252,246,161,46,28,176,100,188,26,71,221,108,56,223,24,183,177,29, - 243,244,54,95,222,165,89,190,28,110,232,161,253,166,203,203,241,34,163,58,87,125,60,172,105,59,6,119,197,116,190,74,54,171,139,43,142,210,37,42, - 14,111,22,183,249,240,143,233,237,109,154,13,151,69,54,204,238,151,67,96,231,122,49,152,102,139,249,96,117,131,109,29,98,168,89,58,154,229,195,52, - 91,1,116,203,208,217,102,10,151,53,20,89,162,228,95,198,249,125,62,107,142,22,85,144,162,108,59,190,234,99,82,194,123,21,222,111,242,233,245,205, - 234,170,175,220,221,99,32,60,76,199,171,155,234,253,29,8,111,199,249,100,73,5,101,91,122,147,161,0,69,69,58,158,166,179,127,161,63,88,114,89, - 41,154,94,182,152,205,242,12,157,167,179,135,244,115,57,119,250,132,109,188,188,41,114,192,238,21,158,243,180,216,244,161,153,97,117,61,26,175,57,132, - 102,146,215,197,215,21,241,247,249,116,5,124,173,151,121,241,43,237,209,127,204,127,95,230,123,181,126,43,210,249,18,128,184,189,234,223,166,171,98,250, - 248,243,64,36,214,42,233,252,5,195,151,39,222,120,203,204,5,231,160,27,33,47,6,206,138,196,57,173,94,215,157,101,143,87,125,195,116,98,185,18, - 126,75,253,76,252,50,137,81,214,109,169,147,214,186,147,214,186,5,180,9,183,9,106,58,211,239,13,43,246,54,89,211,153,189,196,182,22,174,190,171, - 202,223,46,87,139,187,77,93,96,101,245,121,6,56,18,113,128,30,23,197,229,104,150,102,159,222,4,194,2,252,156,174,62,95,242,55,253,109,139,197, - 100,178,204,49,44,139,104,1,86,104,129,145,68,189,128,167,141,197,218,198,226,237,99,169,45,179,134,205,37,127,63,132,70,155,253,92,132,182,3,116, - 192,157,231,137,145,127,94,132,182,0,80,185,254,139,131,162,29,128,154,29,6,96,84,203,180,117,152,232,254,249,146,241,205,224,174,197,41,184,63,81, - 99,28,133,59,118,238,216,198,10,251,13,224,46,18,110,125,27,220,31,249,85,95,50,80,181,229,219,189,251,76,84,179,11,225,71,209,90,87,144,16, - 248,132,128,99,191,130,238,181,134,139,238,208,127,197,194,231,137,218,23,99,169,115,224,216,58,90,103,64,98,52,243,237,245,111,224,231,97,253,139,98, - 215,80,134,66,37,229,42,155,202,144,39,206,234,152,58,105,173,59,105,173,75,202,208,39,92,52,136,135,113,205,171,94,47,88,203,131,12,159,45,69, - 216,196,115,99,236,235,142,98,117,182,46,86,112,110,206,0,228,36,124,118,32,130,181,75,203,185,84,173,200,172,150,210,134,80,12,174,78,171,103,212, - 114,173,29,115,38,149,114,194,245,207,158,242,102,15,216,89,250,186,125,245,93,5,4,203,48,79,212,216,45,187,166,120,255,36,219,148,236,184,31,45, - 75,29,103,248,166,231,115,45,26,93,183,49,166,219,232,163,116,228,71,246,228,232,207,230,162,148,167,185,40,245,211,185,216,170,81,147,74,90,186,177, - 81,218,19,248,234,174,200,95,138,109,198,187,211,108,107,176,230,76,182,5,49,27,191,136,200,142,232,227,15,118,213,234,245,29,83,88,204,116,217,52, - 38,158,142,253,86,155,255,242,216,55,238,244,38,26,255,140,77,52,225,243,12,13,98,188,248,243,65,223,69,225,222,33,191,229,228,194,156,56,225,194, - 181,201,132,157,152,137,238,30,110,68,163,169,243,217,216,54,218,75,178,209,116,0,159,101,231,115,201,229,110,236,236,115,130,178,87,217,40,243,25,63, - 75,99,8,171,157,17,204,246,91,151,209,69,99,24,251,12,141,209,186,232,23,215,24,66,251,83,123,38,204,51,244,69,206,232,251,213,252,180,19,91, - 168,152,134,194,49,190,109,11,157,51,231,33,40,56,79,231,217,156,224,201,90,215,62,124,7,39,89,24,254,116,0,41,79,223,175,13,32,174,205,225, - 88,99,179,14,170,164,158,233,57,236,197,39,221,141,14,13,111,158,206,200,137,163,239,83,25,217,30,30,35,188,20,136,176,132,101,220,52,34,81,97, - 18,47,180,246,170,17,181,82,36,234,181,242,205,8,119,191,110,214,90,183,219,161,205,126,160,205,149,148,93,226,245,224,59,158,52,160,39,162,88,58, - 164,177,34,97,70,201,136,37,116,160,227,17,45,11,199,165,104,28,254,104,155,128,125,70,179,198,65,145,79,28,38,195,34,91,124,252,44,74,48,103, - 218,99,118,195,172,244,120,48,220,89,238,46,232,84,74,226,191,215,79,224,234,142,196,40,101,59,113,213,70,220,127,14,87,181,74,184,52,92,54,143, - 201,56,157,75,56,17,141,65,92,53,42,49,90,196,42,159,184,186,95,247,24,87,37,118,64,169,86,174,42,193,161,142,163,147,144,234,225,37,184,170, - 121,55,172,118,113,246,58,112,213,136,68,56,1,27,191,131,85,203,52,84,190,106,112,213,178,196,10,229,173,217,193,170,5,212,181,20,127,106,174,118, - 212,0,238,101,52,0,247,64,154,85,70,54,184,42,192,63,110,93,164,168,137,171,66,39,92,49,17,207,144,151,117,45,52,171,239,116,106,199,189,179, - 166,60,141,102,137,211,82,27,125,49,96,232,87,146,98,0,35,37,112,245,34,66,31,221,70,28,97,100,105,78,95,130,147,224,142,128,10,225,188,201, - 73,149,88,231,109,228,213,134,131,244,196,88,167,149,182,77,78,234,132,105,99,57,239,192,73,150,120,165,188,220,156,235,51,58,166,182,23,38,1,100, - 181,181,249,64,92,168,132,121,201,173,125,17,94,250,46,188,20,81,181,103,233,79,151,56,201,69,228,193,4,253,169,19,229,44,148,98,147,147,2,94, - 159,23,210,53,245,167,78,164,179,177,35,122,12,147,48,221,220,240,10,147,8,170,172,226,23,152,130,7,16,5,113,82,188,4,11,227,213,28,179,65, - 47,132,70,231,18,1,111,84,178,38,15,93,226,173,0,107,27,60,108,169,75,60,4,150,52,156,3,214,73,91,10,207,161,156,43,30,42,169,4,132, - 28,60,212,154,91,255,114,60,116,221,120,168,248,139,242,80,158,193,67,217,202,67,222,205,226,48,97,69,205,66,11,142,134,71,237,20,180,226,75,240, - 207,118,180,216,166,179,109,121,59,164,228,149,240,84,39,200,80,210,206,248,126,154,63,252,212,236,225,97,58,31,47,30,6,240,163,165,218,8,230,110, - 33,220,105,89,115,107,183,112,147,87,99,244,161,230,85,162,141,171,207,1,234,10,215,235,233,56,31,140,70,11,140,176,42,214,27,62,45,111,22,15, - 161,104,217,32,215,205,234,212,163,117,201,236,42,161,39,238,184,152,142,15,244,91,208,30,76,210,217,114,175,219,108,93,20,212,235,44,253,156,35,50, - 9,127,246,86,77,17,199,0,104,131,34,132,75,188,87,138,1,157,71,196,13,231,123,143,29,95,22,139,219,237,233,84,77,190,75,175,243,229,77,10, - 78,193,216,180,21,86,209,86,8,20,171,242,209,162,24,231,69,92,0,109,233,225,172,187,70,133,16,186,1,74,229,121,101,85,68,93,110,10,202,152, - 178,191,205,122,162,148,173,221,57,16,219,226,73,198,204,155,76,103,51,244,99,133,159,100,147,13,252,110,243,85,58,78,87,233,182,219,13,69,213,9, - 85,227,201,229,63,62,252,173,14,89,179,236,242,191,22,197,167,109,4,74,21,210,209,98,13,100,213,113,53,229,104,101,151,36,159,233,234,221,244,22, - 83,162,164,186,191,60,222,206,128,248,186,160,81,121,245,249,46,223,118,90,118,187,73,16,108,77,50,28,103,183,83,106,52,252,117,133,165,253,157,6, - 137,66,235,170,211,233,106,150,191,251,79,202,123,235,125,168,176,24,102,80,22,52,234,102,148,14,185,40,222,69,147,160,197,254,114,93,199,198,251,61, - 255,107,250,105,61,234,253,186,202,161,1,138,182,142,73,196,247,59,9,53,247,198,163,209,102,211,44,159,47,79,51,34,52,158,222,3,30,183,183,139, - 249,50,240,164,106,187,28,142,62,15,150,233,16,206,224,112,143,33,101,55,239,170,94,202,84,191,228,118,189,156,102,55,233,108,150,100,95,194,212,170, - 90,205,150,235,209,31,80,96,141,165,209,212,254,57,189,222,225,14,81,103,211,119,227,154,223,21,161,181,214,236,174,56,94,33,36,45,158,232,99,145, - 165,179,19,85,32,45,39,6,26,173,71,163,89,254,71,126,98,48,8,219,201,58,29,230,12,121,185,91,159,168,147,173,239,150,167,184,55,110,171,80, - 210,26,59,83,238,107,115,15,3,52,73,152,99,225,254,184,139,192,72,190,207,4,95,19,218,119,121,1,129,93,158,132,118,91,102,240,63,242,187,98, - 49,94,135,132,211,38,166,159,217,241,135,233,18,222,195,104,221,218,113,145,255,247,122,138,22,79,234,249,223,23,43,176,228,101,251,252,101,117,120,178, - 207,226,66,94,76,239,195,150,18,26,150,47,59,233,95,111,210,34,255,101,54,253,20,51,35,64,175,130,218,230,56,50,178,52,111,135,27,59,20,222, - 174,247,156,134,197,250,238,118,49,206,43,219,191,107,7,103,233,40,135,177,251,72,101,61,30,25,205,202,83,168,70,188,254,169,121,136,58,158,46,239, - 80,227,114,58,39,143,174,225,10,94,107,38,182,145,197,170,197,251,84,28,193,189,38,95,189,74,21,19,94,176,16,255,40,138,188,188,150,23,210,39, - 86,11,225,94,111,207,159,11,136,227,150,171,193,99,209,8,162,188,113,241,133,255,99,160,107,159,8,45,226,116,138,58,83,218,186,68,106,203,227,147, - 251,202,151,227,18,163,26,217,200,31,8,39,167,24,88,113,43,247,143,146,183,39,214,138,9,102,184,211,111,226,76,65,242,35,46,97,134,127,126,181, - 159,118,247,58,148,70,119,94,225,181,88,207,242,203,249,98,254,5,126,208,27,136,219,226,83,120,205,171,231,210,235,188,228,155,87,234,22,187,120,137, - 61,158,143,99,226,31,139,233,252,18,24,207,139,55,183,105,241,41,47,202,94,202,231,193,114,149,22,171,6,229,118,58,110,188,231,243,113,99,220,208, - 213,108,138,63,151,106,67,27,167,240,157,138,2,32,136,107,18,181,60,132,191,100,27,218,118,145,247,211,229,116,52,157,209,75,120,156,229,111,154,72, - 122,179,184,207,139,201,108,241,176,41,143,5,225,46,93,221,68,123,80,71,1,64,55,121,55,112,154,51,124,118,118,143,26,105,166,227,253,6,245,223, - 122,3,193,125,56,1,166,28,69,2,146,99,210,245,222,31,160,71,84,41,108,98,52,83,188,157,136,30,172,73,172,82,218,43,144,93,162,53,115,166, - 199,133,78,172,67,96,121,33,4,224,226,152,213,27,154,116,23,136,233,148,86,66,106,52,223,82,7,74,38,218,10,4,107,189,129,148,232,95,43,25, - 205,202,28,152,235,151,222,51,144,186,159,15,253,3,169,207,70,234,51,247,64,242,31,123,208,113,15,118,133,188,54,5,59,66,222,74,143,168,145,144, - 183,17,169,7,203,232,154,207,232,72,200,7,220,179,112,203,162,35,41,143,136,177,152,71,228,88,206,185,133,13,20,92,219,134,156,183,78,183,33,231, - 91,85,215,48,109,7,149,228,246,106,243,122,19,189,70,246,181,248,76,39,74,150,115,173,236,246,228,184,120,172,169,46,58,27,165,108,237,132,129,45, - 113,182,54,44,45,44,120,253,94,31,168,36,202,115,104,198,109,243,202,248,74,71,7,81,186,121,101,73,134,23,28,234,239,56,31,135,236,42,29,59, - 237,73,74,37,23,175,180,167,111,83,52,88,226,195,199,137,99,208,173,251,218,50,45,150,239,86,22,47,163,79,203,154,216,150,83,1,167,54,225,146, - 57,111,248,133,224,137,238,125,236,41,150,56,11,29,161,75,194,251,158,226,216,127,109,54,53,240,106,41,27,215,209,171,117,14,0,233,41,68,18,154, - 51,229,1,190,68,8,233,185,167,134,2,254,14,172,17,39,170,209,112,151,84,15,120,179,206,106,186,251,84,137,131,219,3,146,74,56,243,138,58,4, - 254,188,245,70,81,99,133,93,225,210,6,170,53,116,165,66,52,152,5,233,237,133,48,137,0,220,180,104,210,172,85,152,4,45,162,166,74,58,160,101, - 94,243,178,207,13,21,78,158,81,90,148,19,178,12,106,241,2,11,15,43,113,6,48,171,94,63,246,194,117,144,196,228,75,2,58,73,132,228,52,225, - 146,32,1,43,207,201,102,110,251,140,104,245,232,31,35,234,118,166,239,155,84,225,24,84,46,104,134,193,81,243,97,237,240,24,141,34,154,87,90,195, - 89,37,26,23,12,126,100,152,140,116,156,27,99,136,157,116,14,205,37,102,172,149,119,198,40,98,59,132,219,90,144,156,118,92,88,114,1,18,174,49, - 127,106,108,18,180,148,206,217,176,147,82,42,99,65,179,82,40,181,217,236,29,116,68,114,95,9,68,51,151,238,176,120,24,215,221,144,188,50,150,190, - 59,182,164,186,126,148,102,215,168,32,212,90,125,15,155,242,85,44,120,119,249,110,200,54,181,82,113,104,81,201,118,121,111,76,155,231,173,214,82,96, - 215,45,36,199,10,31,209,76,2,233,246,198,7,57,229,204,98,199,65,147,76,73,79,216,0,136,56,23,128,53,196,42,129,82,132,131,41,9,132,16, - 94,83,138,21,112,228,45,97,4,146,234,149,55,134,42,122,47,49,58,161,218,25,120,159,28,32,148,30,27,72,234,160,166,125,36,129,163,107,66,4, - 94,91,234,123,146,74,231,96,221,68,68,13,52,19,100,2,104,198,52,137,98,152,64,33,209,20,132,71,6,217,231,40,135,36,4,252,91,11,132,251, - 82,139,105,169,4,11,84,225,181,6,21,52,50,29,218,68,204,128,80,27,1,51,161,35,218,199,54,78,238,203,66,64,255,171,201,136,190,135,193,158, - 223,231,216,206,241,17,175,233,238,241,12,136,119,180,20,7,165,53,140,223,85,50,219,69,91,189,222,179,109,148,32,103,25,255,63,41,170,59,34,70, - 170,218,151,54,142,174,165,181,41,109,40,229,27,104,23,81,223,19,213,194,248,16,180,106,42,25,87,102,132,148,1,172,220,25,81,194,210,67,86,32, - 163,18,250,151,11,39,75,0,35,54,211,78,19,21,225,152,135,31,6,225,129,5,14,118,23,70,1,182,93,105,18,10,230,165,240,65,70,13,41,204, - 82,158,32,204,26,49,28,228,9,98,98,109,168,168,33,60,218,19,77,105,131,129,154,52,120,39,48,61,180,156,154,10,123,6,187,36,76,37,163,27, - 170,135,145,84,210,233,114,28,44,60,28,163,160,84,210,18,233,246,26,30,164,143,104,100,87,181,100,154,153,136,72,154,196,24,39,157,112,113,243,68, - 89,8,164,140,71,169,73,245,116,62,110,137,219,153,191,111,16,49,158,36,254,36,198,67,195,113,95,42,18,15,215,22,147,65,88,164,130,186,129,34, - 193,100,57,53,166,71,73,233,142,193,87,241,210,96,104,216,76,198,5,244,33,237,2,204,164,145,146,116,165,71,189,176,49,204,192,201,182,193,184,162, - 186,181,46,184,68,48,208,14,26,140,146,203,40,99,39,218,255,54,252,68,154,101,171,219,163,148,180,211,110,95,119,107,82,126,246,252,68,248,8,158, - 55,145,206,57,86,196,173,189,32,221,14,181,170,72,47,194,253,134,147,230,164,143,168,239,137,10,39,14,86,38,162,74,75,153,13,90,153,11,48,155, - 145,153,104,144,224,226,192,230,135,46,107,42,184,46,21,220,27,11,42,167,31,91,56,102,228,1,234,182,135,247,13,106,53,20,38,15,199,138,240,191, - 157,81,203,130,158,238,223,232,51,14,43,94,57,79,223,118,255,134,139,63,77,208,252,36,173,57,154,45,178,79,71,252,155,56,214,251,154,86,73,155, - 215,237,12,22,170,27,131,75,234,255,26,6,239,75,176,137,242,45,171,80,151,146,175,224,129,69,41,131,155,232,152,83,58,146,129,209,138,227,104,78, - 134,8,190,84,35,226,214,228,218,9,21,229,62,23,225,202,156,195,101,199,127,186,17,179,215,100,209,142,128,40,218,143,226,250,131,209,190,176,176,171, - 141,31,207,210,191,68,80,253,202,150,237,45,10,54,113,231,7,184,155,144,31,65,95,179,201,54,64,142,50,235,79,6,253,122,47,232,175,51,184,143, - 98,83,30,192,38,107,67,204,110,217,222,88,237,234,62,186,254,8,143,179,116,149,255,124,36,155,179,84,242,20,252,211,150,245,232,192,73,32,202,55, - 189,95,122,240,81,96,79,37,103,209,19,158,241,237,57,196,9,136,112,73,91,119,107,208,54,194,151,125,211,86,2,163,106,219,82,252,120,180,56,43, - 177,82,118,223,82,28,18,218,181,103,92,70,9,148,181,173,133,239,122,24,2,251,201,236,167,32,208,226,225,63,111,187,247,214,67,198,252,170,159,22, - 217,89,97,100,112,25,178,22,87,67,238,91,126,171,100,200,87,135,240,195,205,212,178,180,211,18,158,107,69,13,33,28,153,126,155,80,224,199,77,160, - 58,38,164,234,201,144,54,198,100,168,137,248,18,177,87,160,85,125,170,77,235,143,68,229,85,102,188,160,95,179,87,35,249,196,59,104,2,29,81,75, - 111,218,91,217,160,130,134,232,140,201,224,138,113,230,224,159,145,223,204,173,144,37,173,30,9,84,83,81,213,102,77,225,196,138,123,207,37,11,179,103, - 210,250,16,100,210,216,44,28,208,72,202,162,12,167,68,220,178,224,242,213,180,176,118,3,101,231,84,68,229,178,228,71,104,205,20,167,113,218,248,121, - 32,154,108,85,31,202,30,132,220,57,97,230,166,209,179,194,205,122,228,237,21,131,52,186,252,135,97,142,69,162,7,172,60,246,84,31,94,196,246,55, - 59,199,195,229,99,6,125,47,94,110,64,29,27,139,221,10,219,26,206,66,19,199,69,249,214,34,39,230,132,75,30,137,227,245,83,181,242,254,5,142, - 68,140,160,120,115,62,215,202,41,127,232,190,250,176,151,21,191,196,63,58,247,116,70,106,244,89,87,61,187,106,235,187,56,87,187,147,136,157,172,147, - 122,245,121,151,62,181,3,225,36,111,185,224,247,201,222,143,194,106,215,171,229,7,99,100,222,212,126,147,224,126,237,90,253,182,4,5,219,189,207,99, - 211,56,50,251,104,189,45,233,9,63,192,246,21,192,118,112,195,127,48,253,27,75,184,254,154,18,238,59,73,56,231,201,183,147,112,251,67,194,127,72, - 248,255,43,9,247,45,50,194,95,74,194,17,20,236,70,238,101,46,196,230,79,215,84,202,77,178,164,56,144,91,153,22,197,226,161,127,222,89,240,126, - 68,232,76,148,52,17,220,100,129,245,138,112,75,128,128,203,121,37,233,0,158,254,1,50,231,37,93,35,182,82,185,161,211,113,68,114,20,210,53,95, - 195,229,53,252,110,115,225,232,84,215,146,151,107,132,184,224,26,141,141,179,228,139,135,49,165,65,116,181,71,109,206,100,63,148,218,158,171,181,9,80, - 106,233,251,140,11,187,77,46,135,118,223,83,112,56,251,46,73,103,1,178,111,233,135,35,239,126,250,31,80,75,3,4,20,0,2,0,8,0,121,128, - 249,52,162,251,72,104,220,10,0,0,238,60,0,0,13,0,0,0,101,100,105,116,45,99,111,112,121,46,115,118,103,237,90,91,147,218,200,21,126,223, - 95,65,240,139,167,118,144,250,174,110,230,178,229,216,217,212,166,156,77,213,218,91,121,76,9,212,48,218,17,18,145,196,0,251,235,115,186,37,144,132, - 154,241,48,198,246,110,101,160,166,6,78,159,190,125,231,126,196,245,15,155,69,50,120,208,121,17,103,233,205,16,123,104,56,208,233,52,139,226,116,126, - 51,252,245,227,143,35,57,28,20,101,152,70,97,146,165,250,102,152,102,195,31,110,191,187,254,203,104,52,120,155,235,176,212,209,96,29,151,119,131,159, - 210,251,98,26,46,245,224,245,93,89,46,199,190,191,94,175,189,184,38,122,89,62,247,47,6,163,17,204,44,30,230,223,13,6,3,216,54,45,198,209, - 244,102,88,243,47,87,121,98,249,162,169,175,19,189,208,105,89,248,216,195,254,176,97,159,54,236,107,61,241,114,93,100,171,124,90,45,63,157,182,57, - 243,104,214,176,194,73,214,212,50,97,165,148,143,136,79,200,8,56,70,197,54,45,195,205,40,45,94,181,166,194,1,93,83,9,66,200,135,177,134,243, - 105,92,227,77,2,48,28,61,140,29,109,239,14,208,47,225,111,63,97,143,97,117,215,25,204,212,94,170,75,255,221,199,119,254,142,123,132,188,168,140, - 90,203,236,102,117,246,237,136,35,13,23,186,88,134,83,93,236,183,176,243,215,113,84,222,221,12,153,92,110,236,247,59,29,207,239,202,22,33,142,110, - 134,112,67,134,149,180,223,119,103,24,239,181,8,121,148,84,172,245,194,237,33,70,191,143,244,131,78,186,115,163,108,58,9,11,56,174,127,151,45,180, - 95,198,115,157,151,254,244,161,240,103,185,214,145,46,238,203,108,105,207,13,186,56,207,70,241,52,75,71,229,29,168,137,15,59,36,225,36,209,126,56, - 45,97,143,162,183,176,185,233,205,80,71,113,57,154,102,203,173,183,19,207,254,116,217,170,92,174,202,255,232,77,169,211,234,152,176,81,11,45,59,108, - 166,237,105,195,91,88,224,58,210,179,194,44,84,97,98,190,49,144,191,29,131,81,16,172,14,243,191,231,97,20,131,46,87,124,21,103,119,4,115,130, - 101,61,9,166,21,112,209,29,51,220,163,220,38,112,120,67,132,195,39,89,62,126,53,67,51,164,103,87,150,148,129,0,227,114,59,6,187,173,94,87, - 195,102,110,54,155,21,186,52,152,215,131,173,49,43,68,88,1,54,39,96,242,254,145,237,119,108,132,8,229,92,153,43,69,164,224,98,248,232,145,181, - 52,239,131,35,95,61,105,219,192,185,173,36,1,151,130,208,199,183,157,217,215,211,183,117,44,17,73,120,211,19,192,198,159,0,155,236,183,191,246,187, - 122,240,184,218,236,116,21,206,149,232,41,108,20,38,235,112,91,12,143,235,21,33,92,157,162,86,110,176,28,232,15,157,130,194,39,225,234,218,205,141, - 167,123,55,250,76,24,29,40,17,118,2,74,193,212,188,159,141,18,17,39,161,52,145,230,253,132,221,220,40,17,249,133,148,205,6,173,241,93,174,33, - 200,190,114,224,249,24,220,180,65,102,131,111,134,148,123,74,9,46,201,158,186,5,42,131,56,1,52,210,220,107,67,128,151,122,66,48,213,162,110,13, - 53,240,130,0,5,45,234,188,222,236,215,52,46,33,74,175,10,157,127,48,145,238,95,233,175,133,238,113,125,204,195,180,128,176,186,184,25,150,230,99, - 2,73,205,107,225,97,129,37,21,151,204,67,148,50,140,47,26,40,207,105,161,248,235,89,40,167,95,211,66,57,255,22,186,199,241,227,112,7,93,221, - 163,30,85,2,33,214,209,61,42,60,80,49,74,105,87,247,152,135,3,96,149,93,221,147,30,10,16,149,95,70,247,64,221,185,60,139,238,61,2,90, - 149,126,28,71,141,17,46,63,255,118,139,176,204,227,205,107,136,142,144,44,40,121,185,203,73,218,31,148,12,184,226,151,35,233,113,38,41,65,151,35, - 230,73,133,3,76,47,58,98,35,196,163,72,82,138,59,98,195,18,28,9,193,12,117,197,198,189,64,114,162,88,87,108,202,99,74,18,42,191,36,176, - 54,254,62,134,171,64,103,195,21,192,83,146,35,230,198,21,174,202,196,229,8,244,26,116,85,225,10,87,162,16,62,192,85,128,50,11,164,186,174,24, - 168,66,9,17,136,46,174,144,131,97,140,3,210,193,149,17,216,53,160,28,127,67,92,49,21,28,159,21,88,197,8,118,0,187,203,244,46,77,4,195, - 20,171,86,172,248,19,194,250,41,63,96,112,165,103,117,4,1,1,31,231,118,4,138,4,38,244,130,178,10,201,44,174,144,58,7,95,218,13,92,251, - 166,134,179,159,246,245,163,41,30,163,135,88,175,155,66,207,20,170,245,58,203,112,174,109,188,4,56,171,128,89,15,76,178,60,210,249,110,104,162,205, - 187,51,84,135,212,126,193,176,151,161,89,123,207,5,232,184,198,139,187,48,202,214,128,197,225,224,239,89,182,48,107,51,12,202,75,197,225,240,116,115, - 51,228,160,129,224,103,25,235,13,110,77,181,239,65,8,228,146,247,6,87,121,14,18,29,37,225,86,195,213,236,191,157,4,138,187,108,61,207,13,68, - 179,48,217,99,180,159,106,134,70,147,73,182,49,193,110,213,27,134,74,125,101,186,62,163,85,165,83,117,187,161,197,177,142,83,184,237,168,238,80,200, - 128,30,97,216,181,44,132,82,71,56,54,198,0,217,145,65,184,62,97,61,68,205,229,218,144,87,87,172,21,103,161,203,48,10,203,176,81,146,29,133, - 17,68,119,29,129,60,154,141,127,121,247,227,62,7,155,78,199,255,206,242,251,38,125,50,12,225,36,91,193,217,247,121,161,233,51,76,199,198,120,194, - 242,54,94,192,9,76,127,233,251,205,34,1,117,221,15,116,152,203,237,82,55,139,86,203,238,122,101,206,126,91,52,93,196,102,146,255,161,140,147,228, - 39,179,73,43,87,172,23,141,203,68,223,254,45,138,203,193,219,108,185,181,155,87,180,14,27,220,89,223,18,132,248,8,163,17,230,150,205,210,58,92, - 83,211,58,204,242,219,214,41,13,26,111,230,251,244,176,191,245,155,52,130,89,197,224,231,56,41,138,44,117,29,192,152,112,127,25,203,217,219,209,44, - 92,172,38,191,129,155,236,44,96,192,250,107,56,63,56,133,161,38,241,173,105,34,93,251,245,23,39,199,212,98,211,231,168,104,157,133,237,185,122,71, - 48,56,36,241,84,167,197,167,101,104,47,21,63,128,11,90,44,178,180,176,226,172,231,22,254,100,59,42,66,31,66,135,223,147,229,52,75,193,11,79, - 86,167,138,224,31,225,253,106,50,248,80,106,136,12,249,169,2,232,239,105,121,141,5,180,45,226,253,225,221,91,70,113,226,181,187,160,46,117,14,90, - 94,124,18,84,87,103,249,23,189,204,179,104,101,27,140,93,52,63,115,225,119,113,81,161,226,90,56,215,255,93,197,48,227,89,43,255,156,149,0,201, - 121,215,124,83,30,63,236,103,161,160,243,248,193,138,212,104,67,113,222,67,127,184,11,115,253,38,137,239,219,96,88,213,171,85,109,87,165,182,220,243, - 181,191,243,223,246,219,188,241,235,157,128,183,15,14,73,56,209,201,205,240,189,25,28,224,126,224,203,86,203,69,22,233,122,250,46,30,204,219,217,214, - 28,10,130,38,255,170,11,242,125,225,13,137,138,125,53,5,108,233,202,169,16,230,72,30,203,85,5,134,34,128,195,39,66,16,215,35,98,42,2,10, - 21,173,50,95,46,154,70,68,14,254,168,65,122,107,107,95,155,216,182,219,173,38,130,162,170,80,109,183,104,119,161,151,56,218,160,117,220,198,212,115, - 118,72,205,182,144,228,169,126,79,183,65,1,74,112,198,25,39,87,117,147,162,238,195,206,32,106,117,190,56,122,181,150,156,175,18,61,214,15,58,205, - 162,232,10,44,47,187,215,227,52,75,117,253,185,74,45,90,147,106,178,201,132,65,146,99,80,253,178,77,251,45,139,211,49,104,189,206,175,22,97,126, - 175,243,106,177,234,243,168,40,195,188,236,80,22,113,212,249,174,211,168,179,189,93,42,137,225,223,152,29,158,33,10,33,243,200,243,112,219,153,97,168, - 85,35,102,140,14,103,244,49,120,136,139,120,18,39,134,104,63,38,250,42,138,139,37,40,229,56,78,205,133,174,178,7,157,207,146,108,189,27,111,155, - 76,87,47,114,155,149,114,33,48,87,162,221,3,202,55,213,0,188,57,110,15,216,100,151,11,162,40,58,208,36,108,42,126,198,144,116,104,146,105,16, - 6,66,72,217,215,36,168,150,20,199,156,43,135,38,49,147,214,31,213,164,174,90,140,33,21,122,253,170,223,246,184,56,89,151,94,73,41,67,201,187, - 234,100,43,112,69,21,101,39,232,211,215,209,136,79,137,183,111,196,149,116,251,116,147,52,131,112,17,87,156,31,184,9,143,83,194,49,81,46,225,82, - 40,246,48,234,60,63,170,133,75,164,105,87,4,12,59,133,203,208,147,133,107,193,57,85,144,78,141,16,232,194,45,89,65,255,68,146,53,102,136,42, - 135,206,186,146,10,60,4,14,29,43,116,154,67,39,248,184,67,7,73,201,23,135,254,167,112,232,47,178,249,230,178,113,217,15,119,89,28,234,91,220, - 99,134,122,196,182,141,39,96,59,79,240,168,191,144,21,23,63,139,191,48,171,29,247,23,156,188,248,139,23,127,241,34,155,103,251,11,246,180,8,253, - 60,127,65,200,206,19,60,230,47,204,35,15,71,193,248,92,127,65,31,245,23,226,197,95,252,17,253,197,181,63,119,182,57,48,145,130,54,205,134,101, - 88,222,245,228,119,172,40,179,207,160,206,84,149,237,230,145,243,167,238,79,79,210,155,155,3,52,255,28,96,238,161,128,40,38,46,33,67,231,8,73, - 78,6,239,7,140,121,10,138,102,138,91,212,183,3,198,61,194,56,10,218,84,160,49,165,8,15,12,45,224,84,49,222,166,153,135,110,146,18,102,214, - 220,83,169,244,8,229,66,138,106,205,154,202,96,62,38,152,202,1,140,11,172,24,3,154,128,74,78,6,1,29,80,1,115,48,84,117,45,218,251,214, - 233,27,234,219,1,100,24,1,15,8,106,83,129,198,17,69,196,144,136,132,205,113,139,100,234,125,108,215,219,145,154,131,191,109,17,247,55,108,118,104, - 144,112,33,249,251,192,225,64,48,233,186,169,230,193,95,22,105,243,76,164,184,25,78,119,175,179,150,203,112,43,238,112,188,112,114,142,136,226,216,85, - 46,131,186,49,20,8,230,46,151,85,64,153,171,23,130,57,97,236,171,215,203,246,65,252,133,219,232,228,31,186,94,62,240,73,71,52,226,0,104,51, - 137,16,220,179,105,99,43,4,41,44,43,253,55,15,253,65,141,141,213,113,76,169,181,10,41,192,252,152,177,62,137,64,247,241,101,245,192,31,209,192, - 208,56,226,148,40,99,167,230,199,27,196,218,62,245,20,3,133,183,118,202,4,108,171,6,198,98,153,144,8,44,90,121,96,154,96,208,176,181,160,18, - 49,101,72,76,50,25,152,157,251,68,26,84,225,218,30,17,85,71,116,29,187,99,64,71,149,200,17,105,29,218,97,126,8,248,28,79,46,192,147,179, - 207,247,228,255,7,217,186,51,178,54,153,17,136,148,98,137,3,151,188,28,46,224,36,211,55,191,180,115,180,202,204,75,126,83,41,61,93,58,61,169, - 124,94,126,94,185,130,192,19,16,218,56,132,77,230,81,200,75,133,137,104,96,134,136,97,76,217,37,51,191,111,197,130,66,208,6,7,160,148,64,204, - 184,2,172,36,0,103,140,158,194,39,201,141,209,83,28,40,197,141,43,192,224,52,136,84,216,80,1,94,196,7,246,199,179,24,7,150,145,147,128,41, - 108,183,6,19,230,150,141,35,105,55,238,209,128,34,185,132,48,98,142,194,33,117,86,204,121,232,94,36,173,156,31,11,158,16,72,31,111,52,40,103, - 163,225,212,126,199,19,26,147,132,4,248,165,112,120,105,52,188,200,230,121,141,6,176,31,234,40,213,149,249,245,29,161,244,233,141,6,151,109,155,22, - 2,125,82,163,33,56,167,191,192,129,121,212,24,32,226,190,47,127,241,23,47,254,226,69,54,207,246,23,193,89,26,147,71,252,5,197,135,254,162,110, - 64,217,127,215,230,55,147,183,223,253,15,80,75,3,4,20,0,2,0,8,0,125,128,249,52,153,109,230,156,183,23,0,0,27,89,0,0,12,0,0, - 0,101,100,105,116,45,99,117,116,46,115,118,103,220,92,105,115,219,86,150,253,158,95,193,97,190,68,213,36,248,246,69,182,220,229,216,157,174,76,37, - 51,85,157,164,102,190,165,32,18,146,216,166,8,54,72,89,82,126,253,156,243,192,5,32,33,89,155,99,247,80,149,50,121,241,214,187,158,123,223,67, - 94,255,245,230,114,214,251,88,84,203,105,57,63,233,203,76,244,123,197,124,92,78,166,243,243,147,254,111,191,254,48,12,253,222,114,149,207,39,249,172, - 156,23,39,253,121,217,255,235,155,111,94,255,199,112,216,123,87,21,249,170,152,244,174,167,171,139,222,143,243,15,203,113,190,40,122,223,93,172,86,139, - 227,209,232,250,250,58,155,174,137,89,89,157,143,142,122,195,33,122,46,63,158,127,211,235,245,48,237,124,121,60,25,159,244,215,237,23,87,213,44,181, - 155,140,71,197,172,184,44,230,171,229,72,102,114,212,223,53,31,239,154,95,23,167,89,85,44,203,171,106,92,15,63,30,55,91,86,147,179,93,83,172, - 228,90,167,70,50,198,56,18,106,164,212,16,45,134,203,219,249,42,191,25,206,151,223,54,186,98,129,93,93,149,16,98,132,103,187,150,15,107,117,124, - 51,3,27,238,92,76,122,218,156,29,172,95,224,191,109,135,45,15,235,189,158,161,103,145,205,139,213,232,253,175,239,71,155,214,67,145,77,86,147,198, - 48,155,94,173,121,91,226,152,231,151,197,114,145,143,139,229,118,138,212,255,122,58,89,93,156,244,77,72,191,46,138,233,249,197,106,251,115,58,57,233, - 99,119,74,135,160,19,97,179,128,227,173,10,137,76,171,186,237,122,212,230,35,163,255,50,41,62,22,179,212,160,165,117,173,193,38,229,248,52,95,98, - 241,163,139,242,178,24,253,115,122,121,153,143,71,203,106,60,26,127,92,142,160,141,231,229,112,58,46,231,195,213,5,20,101,132,105,102,249,233,172,24, - 229,227,21,6,92,30,12,198,189,158,244,139,201,116,53,28,95,173,178,141,124,182,43,44,110,22,101,181,26,158,77,103,69,221,180,158,247,60,175,170, - 98,181,26,109,59,46,230,221,29,111,38,11,8,44,138,206,135,183,155,135,111,240,244,245,164,56,91,178,85,205,75,254,34,51,109,122,136,199,208,134, - 34,175,254,94,229,147,41,12,160,110,216,24,114,92,206,102,197,24,242,200,103,215,249,109,189,209,205,88,237,174,74,185,184,30,20,195,46,87,229,98, - 211,22,172,89,221,206,176,73,18,135,24,177,172,142,191,21,233,243,42,145,74,104,197,116,117,123,44,95,245,119,125,202,179,179,101,129,137,69,131,150, - 180,1,61,148,242,178,223,27,61,111,54,209,53,155,236,158,77,111,103,123,61,106,111,251,229,217,104,31,195,198,152,139,241,51,216,232,30,199,198,174, - 217,30,193,70,247,167,178,81,62,130,141,147,51,149,171,252,201,108,180,250,81,108,236,154,237,17,108,180,246,137,108,236,224,146,122,140,178,21,138,127, - 79,230,146,126,156,178,77,2,255,30,48,91,55,151,244,39,149,141,191,242,217,62,151,206,215,191,127,155,79,87,136,184,87,203,162,250,133,81,235,191, - 231,191,45,139,254,126,171,95,171,124,190,68,136,188,60,233,95,230,171,106,122,243,29,98,75,250,12,196,193,23,60,146,66,215,95,132,143,46,22,67, - 25,6,8,165,210,198,32,228,209,118,244,234,164,239,51,21,76,80,65,109,137,227,219,147,190,210,153,214,24,33,236,168,55,96,128,179,153,112,82,152, - 150,65,180,183,39,93,176,226,46,89,111,184,198,70,170,127,175,84,254,246,131,182,218,118,202,252,78,225,54,135,55,247,15,159,155,14,71,221,41,243, - 157,112,219,27,253,164,9,252,239,207,63,253,248,254,247,16,253,239,253,199,201,252,70,66,0,81,101,209,99,35,91,234,45,168,38,243,54,42,239,245, - 174,173,98,91,151,69,29,125,220,181,5,85,138,204,75,105,160,158,119,112,171,203,136,186,4,193,207,187,14,213,55,86,196,123,252,81,151,213,116,12, - 127,150,62,247,88,95,115,186,103,56,164,69,190,186,208,74,139,223,213,83,196,33,157,11,153,119,198,181,196,33,131,205,180,144,222,181,196,33,157,143, - 25,12,109,79,28,222,102,62,108,208,229,167,76,91,73,29,218,166,13,11,181,248,50,148,153,243,18,96,124,96,92,230,149,83,118,96,140,207,162,49, - 234,232,153,130,254,33,125,186,56,31,189,127,182,156,223,253,192,191,238,209,227,51,197,170,165,252,93,62,73,172,70,137,204,26,111,90,98,29,90,145, - 69,25,141,54,109,185,178,177,179,70,181,228,58,164,176,61,218,202,7,8,86,101,194,202,61,159,13,117,161,56,225,157,161,50,36,97,196,152,41,97, - 226,64,41,56,112,175,204,115,37,251,206,188,197,192,221,188,23,207,150,108,180,254,237,93,163,171,167,197,198,157,251,180,13,115,237,14,65,221,225,170, - 51,178,125,222,96,122,191,218,61,211,9,239,71,195,13,143,131,84,159,142,135,0,41,241,254,241,199,81,230,242,97,184,244,249,14,223,140,205,248,1, - 14,63,72,243,220,224,107,236,83,188,2,92,61,188,181,138,186,229,21,96,139,70,153,32,108,203,41,120,147,217,224,165,13,45,167,160,124,22,180,131, - 97,63,83,236,223,191,253,254,253,247,174,131,55,174,17,10,159,42,136,59,3,187,139,254,51,229,79,169,38,116,124,81,21,103,39,253,111,187,34,242, - 97,234,0,175,27,26,1,246,249,168,25,161,213,7,57,88,199,84,19,237,58,166,74,175,241,13,177,53,67,74,55,208,81,102,86,171,163,207,134,2, - 182,12,254,115,89,25,204,103,96,101,11,165,236,115,84,131,61,53,71,13,57,42,254,157,88,186,7,44,186,89,26,213,139,177,148,248,64,68,231,247, - 240,129,140,190,198,7,33,6,51,24,50,195,5,57,14,240,40,115,78,199,163,207,8,106,94,148,169,135,94,185,131,165,206,55,162,85,202,133,96,146, - 202,234,24,219,254,88,103,1,43,212,178,157,11,153,76,70,97,76,91,71,48,66,112,34,10,255,64,73,125,134,77,91,245,137,77,187,189,77,211,92, - 34,32,84,219,48,84,38,225,14,197,126,2,232,65,182,210,182,13,131,160,40,186,175,119,203,33,190,156,51,210,153,83,198,232,208,1,224,182,143,134, - 82,88,141,208,30,241,205,65,121,252,190,51,98,34,237,157,220,83,52,240,92,72,5,13,60,224,185,143,65,169,253,164,59,26,7,68,240,37,248,25, - 141,123,73,126,194,183,71,221,201,79,227,133,246,54,241,211,101,82,186,196,79,81,103,42,251,252,52,193,73,217,230,167,205,172,112,81,186,131,34,6, - 48,151,104,235,112,204,160,237,209,42,245,57,248,217,42,205,116,50,180,81,126,121,46,67,135,112,76,202,67,187,58,56,138,71,64,139,66,14,36,20, - 53,131,254,128,161,50,131,27,139,246,232,179,85,133,190,8,67,253,203,89,188,65,172,212,70,249,251,248,9,54,2,29,32,115,250,183,99,104,87,81, - 245,30,206,122,161,194,11,2,59,233,16,101,186,124,41,220,91,4,194,3,28,177,48,124,37,165,28,192,196,133,128,133,22,195,61,180,172,99,70,95, - 218,132,22,228,45,194,154,17,81,171,22,111,135,154,216,112,63,130,81,104,192,60,194,168,47,224,78,225,227,204,159,203,82,5,48,231,136,254,238,100, - 41,66,122,0,18,106,131,101,131,161,92,240,182,205,81,32,67,47,68,203,247,82,135,51,173,156,82,222,127,25,134,250,39,100,227,132,54,38,24,219, - 218,51,0,48,98,143,83,237,61,43,40,37,216,166,219,90,4,224,235,189,9,193,191,156,156,140,22,30,48,2,249,142,179,112,233,71,47,203,205,142, - 179,179,251,142,214,26,219,77,46,141,89,88,16,170,205,48,168,20,80,163,51,97,31,45,195,234,154,24,83,37,96,13,163,181,250,139,128,229,199,238, - 221,127,37,123,191,163,142,249,2,86,212,30,89,169,70,161,153,5,81,141,109,32,33,136,178,85,16,213,30,24,171,89,15,61,235,108,122,214,213,180, - 58,233,135,76,195,94,130,215,207,46,157,130,241,205,10,1,108,71,197,104,165,57,250,26,148,203,202,251,79,246,247,148,43,6,32,223,230,193,229,109, - 237,146,45,118,20,246,179,131,128,140,51,154,176,159,145,65,57,99,35,57,253,146,155,191,223,178,156,253,90,54,255,18,166,213,113,133,232,62,27,243, - 182,101,99,140,43,161,73,131,217,24,137,180,210,182,236,107,191,217,217,97,179,138,181,45,88,69,131,244,36,203,226,93,52,171,156,24,32,55,5,46, - 85,174,64,10,54,80,24,58,56,225,31,103,92,175,71,188,172,149,190,109,175,150,241,178,216,228,227,180,184,222,221,232,226,189,181,245,184,139,252,188, - 72,69,100,112,182,62,191,93,63,56,45,171,73,81,109,30,185,244,105,61,90,23,252,121,99,78,234,250,179,126,190,149,39,7,111,52,19,93,207,151, - 23,249,164,188,6,199,247,31,254,81,150,224,31,96,163,150,218,111,125,218,78,87,232,5,193,50,228,13,242,240,97,125,144,36,236,182,192,184,123,116, - 85,85,224,226,112,150,223,22,216,89,250,103,227,59,150,23,229,245,121,69,14,173,170,171,98,191,231,164,28,95,241,198,231,240,170,150,192,226,102,191, - 5,251,14,79,79,203,155,214,0,164,22,151,11,222,99,76,23,86,77,131,190,42,103,5,148,101,92,144,63,246,112,196,235,233,28,220,25,174,239,59, - 74,177,197,128,251,45,54,119,32,1,227,197,29,77,200,48,31,238,120,120,187,59,192,88,174,170,242,3,22,180,190,88,177,223,129,76,106,10,238,44, - 159,237,244,239,178,88,229,147,124,149,239,116,109,67,225,13,194,176,185,65,88,77,206,142,255,241,254,135,237,161,199,120,124,252,63,101,245,97,119,126, - 193,6,249,105,121,133,29,109,207,93,120,49,113,124,76,179,202,87,111,166,151,88,2,47,177,254,229,230,114,6,181,223,62,104,53,94,221,46,138,221, - 160,245,176,155,11,185,157,151,122,39,227,203,41,59,141,126,89,77,103,179,31,57,73,227,112,102,61,232,116,53,43,222,252,109,50,93,245,222,93,173, - 210,220,53,169,213,106,204,139,199,101,245,166,49,61,183,249,246,124,123,242,114,56,230,223,235,187,156,189,159,138,222,47,152,185,107,104,218,248,225,48, - 169,229,193,140,28,120,121,117,250,79,184,212,214,0,228,194,247,249,249,222,42,72,157,77,223,240,30,233,235,209,250,71,103,139,241,213,167,26,204,166, - 139,211,50,175,38,93,205,106,90,107,250,180,250,131,133,146,91,179,233,184,152,47,63,45,194,180,245,233,71,120,178,203,203,114,190,76,210,92,247,93, - 142,78,111,135,243,241,112,153,143,224,45,70,7,210,28,151,115,120,232,211,171,199,202,234,63,243,15,87,167,189,95,86,5,194,81,245,88,73,29,206, - 153,218,210,6,154,54,241,211,254,246,27,102,241,248,157,183,89,187,40,42,168,250,242,147,172,237,186,195,254,143,98,81,149,147,171,116,145,185,205,208, - 103,14,252,126,186,172,25,211,53,112,85,252,235,106,138,30,79,26,249,191,202,21,184,242,178,99,190,93,221,189,88,48,232,98,122,250,84,62,188,131, - 52,17,124,1,100,154,240,233,69,56,92,84,211,143,73,99,168,108,203,151,101,200,47,23,121,85,188,157,77,63,52,215,156,52,123,173,201,219,27,0, - 59,255,255,122,180,137,16,233,215,249,46,114,180,66,243,54,252,204,242,211,98,118,210,255,137,15,123,242,48,2,151,87,139,203,114,82,172,187,111,2, - 14,143,0,191,105,159,159,159,193,193,31,195,245,127,247,109,71,173,248,232,85,29,5,143,191,69,212,202,131,93,255,172,3,241,177,220,252,100,79,204, - 123,140,89,231,147,38,241,159,229,116,222,166,66,98,69,53,155,226,159,99,179,161,77,114,4,209,170,202,111,143,231,229,188,216,80,183,55,41,182,208, - 15,204,248,185,135,148,79,122,163,165,28,16,135,154,24,163,239,189,35,85,7,128,198,68,141,188,89,98,73,179,81,90,15,146,199,102,156,140,36,241, - 132,35,26,208,2,178,98,161,216,215,102,134,215,134,226,192,0,71,69,43,180,239,105,228,6,46,122,207,202,21,70,85,0,87,61,164,149,90,73,109, - 205,32,176,131,212,42,176,183,206,76,180,22,189,165,201,48,180,85,61,21,177,6,47,148,28,40,137,228,208,88,103,123,64,210,1,75,181,113,160,124, - 230,129,116,185,234,84,221,49,66,106,18,131,87,210,163,179,201,64,241,90,145,134,209,100,208,61,96,56,103,60,210,146,68,115,49,58,118,86,188,54, - 132,108,52,129,100,96,34,223,83,124,107,67,11,151,198,243,222,26,76,12,112,30,21,25,70,154,210,128,130,236,171,179,232,131,70,95,60,118,193,96, - 28,174,90,0,99,178,102,15,40,43,141,193,196,93,204,254,163,215,223,191,174,198,3,221,70,253,237,17,90,198,122,199,209,43,62,109,220,156,89,235, - 92,83,25,214,10,151,41,251,133,116,78,193,0,148,134,134,40,91,171,155,176,30,34,6,193,90,111,172,138,84,132,160,163,18,97,0,169,42,17,141, - 34,201,9,229,163,6,201,48,69,34,235,35,122,216,168,195,128,39,159,16,135,143,212,3,99,132,15,134,226,136,66,104,12,7,213,225,113,149,71,14, - 100,179,117,87,38,1,84,91,146,130,15,178,22,57,212,75,24,63,80,142,7,92,42,202,212,206,209,10,72,179,206,71,167,107,125,65,186,107,162,34, - 213,59,27,76,173,88,176,155,144,104,81,6,52,166,2,122,227,188,75,180,245,196,33,179,216,175,5,9,26,198,66,161,233,33,233,144,81,57,157,244, - 94,98,81,65,209,146,162,209,194,132,1,212,84,105,137,134,100,22,76,40,88,43,35,168,48,204,40,48,49,104,26,186,13,77,197,188,96,129,18,50, - 245,142,202,8,210,28,0,124,109,216,96,141,3,104,246,96,33,166,5,191,20,185,31,21,148,219,128,251,145,85,48,37,107,7,0,101,162,136,164,229, - 178,127,74,52,41,131,76,98,67,130,140,60,178,166,54,133,121,135,58,55,46,112,46,202,217,237,121,57,127,176,223,132,179,185,75,165,119,175,129,52, - 180,154,21,62,152,155,112,225,79,214,237,180,223,122,115,198,202,70,93,114,129,105,152,218,241,68,88,24,99,52,117,85,11,228,229,80,153,8,209,197, - 104,224,18,52,88,110,188,163,235,128,202,195,29,74,234,130,103,197,160,199,195,126,56,49,163,216,204,121,40,128,74,205,60,207,146,7,60,186,114,188, - 211,208,235,154,98,187,142,213,203,29,226,62,197,57,165,243,231,199,120,167,122,37,82,125,9,31,149,44,147,151,167,105,201,60,60,129,241,200,152,33, - 124,68,145,226,134,177,48,153,144,104,17,110,23,182,12,135,143,120,7,95,3,175,99,130,84,62,209,162,86,48,126,246,14,16,106,136,38,14,180,64, - 252,129,9,251,158,164,9,123,132,134,129,134,51,134,36,16,78,36,175,165,74,204,156,234,16,50,121,12,210,60,98,175,36,17,243,58,35,73,131,123, - 82,176,111,248,69,29,165,241,134,115,232,117,215,168,55,107,230,161,42,252,30,102,240,81,166,152,40,120,104,30,156,227,74,116,12,52,120,56,57,15, - 119,197,13,135,44,72,108,61,214,46,146,119,142,67,32,85,43,97,17,42,225,248,172,85,28,145,209,83,58,227,18,45,241,202,239,252,178,98,165,41, - 197,73,7,71,110,141,73,115,240,72,176,118,143,1,234,140,150,135,124,222,247,32,181,69,241,50,136,123,170,218,121,243,21,34,47,24,40,140,86,196, - 216,66,94,160,122,248,118,200,102,135,188,36,57,46,240,173,1,189,104,222,198,227,121,19,122,193,15,120,1,15,210,132,94,1,62,66,198,208,130,94, - 145,213,87,40,143,111,65,47,122,22,229,28,90,110,161,23,116,76,67,43,92,19,121,193,46,17,216,116,27,121,97,17,210,71,235,154,200,139,171,230, - 90,90,192,11,254,46,88,221,2,94,152,12,42,141,105,119,192,203,193,188,116,8,177,1,188,216,3,14,80,248,22,240,226,225,60,120,215,4,94,50, - 141,194,192,188,3,94,93,188,238,214,51,190,68,242,100,236,101,191,126,236,69,253,162,122,249,13,246,162,34,1,222,192,129,89,30,254,0,222,104,234, - 145,242,112,189,142,58,67,163,55,150,52,33,232,181,6,59,35,79,225,73,163,215,32,213,238,133,134,163,163,243,243,22,105,1,193,141,244,112,111,129, - 98,2,110,0,181,70,80,181,131,96,184,131,115,215,201,25,40,1,60,78,85,112,80,0,246,5,102,129,246,192,69,42,2,21,11,191,65,218,214,187, - 0,195,1,151,83,9,241,13,33,80,164,134,8,84,240,112,164,9,76,44,211,128,128,102,136,197,3,149,142,182,146,174,210,251,9,171,176,104,232,42, - 48,63,253,38,156,143,1,234,138,12,165,138,23,138,21,205,65,4,15,55,14,78,185,245,162,73,131,190,193,58,1,84,5,32,147,72,186,133,241,8, - 35,137,238,149,148,180,155,54,151,59,65,145,211,246,14,61,219,212,216,89,50,60,233,231,213,184,191,167,130,59,253,106,191,85,124,15,136,210,135,32, - 42,253,172,174,102,73,61,255,40,170,242,229,180,245,50,175,62,20,85,61,80,253,125,184,92,229,213,170,69,185,156,78,90,191,139,249,164,53,245,195, - 117,157,212,250,78,251,177,56,208,255,87,31,167,203,233,233,116,198,31,233,235,172,120,53,153,46,23,200,228,143,167,115,46,252,85,249,177,168,206,102, - 229,245,230,121,23,132,109,92,35,221,10,40,29,253,192,167,65,121,149,233,120,124,219,117,9,117,251,184,186,97,121,30,249,179,197,159,238,120,126,219, - 249,188,134,39,155,91,172,189,237,4,189,183,189,93,235,214,215,30,192,66,175,183,189,36,59,120,120,151,142,89,254,184,7,78,98,4,24,126,39,156, - 108,28,85,33,137,0,208,229,197,101,111,144,188,28,61,215,10,120,201,2,6,8,136,113,167,57,28,30,223,221,99,13,197,199,98,94,78,38,247,88, - 195,190,41,156,94,173,86,7,150,144,212,247,255,157,37,32,241,243,119,24,194,222,225,102,203,12,246,78,57,91,54,176,127,222,217,50,0,102,230,182, - 173,251,70,211,167,214,35,66,131,215,221,123,169,229,70,115,125,70,24,124,127,155,214,56,247,169,53,189,159,19,136,124,93,199,172,65,2,122,199,193, - 16,51,198,168,163,25,32,13,224,133,52,121,135,94,111,24,137,20,81,135,254,67,49,44,83,177,59,179,224,237,171,202,247,6,126,32,41,230,39,154, - 160,95,1,255,105,83,7,67,128,76,152,97,202,54,36,96,149,78,48,61,58,133,96,168,29,171,108,193,74,50,16,233,137,214,129,60,85,8,219,129, - 208,77,2,50,32,239,244,192,155,188,178,11,223,209,3,230,210,30,230,13,18,114,27,32,7,68,82,176,134,52,64,55,67,1,0,143,166,74,31,75, - 51,200,61,248,126,106,38,173,96,116,102,97,78,2,238,169,129,142,201,170,181,234,1,49,216,104,0,67,7,44,84,0,21,36,156,28,137,50,48,164, - 77,217,20,122,33,11,145,188,26,139,12,44,229,48,22,248,214,152,206,109,255,209,251,153,75,15,6,32,32,48,123,66,154,44,82,109,133,35,32,232, - 155,148,65,41,103,107,220,163,211,75,44,104,7,120,97,1,83,98,42,37,41,230,79,188,57,164,165,224,138,0,139,164,19,200,135,184,118,44,23,88, - 27,52,128,24,38,225,3,163,18,186,82,6,128,60,70,169,88,235,210,228,11,176,13,39,70,26,164,156,54,129,212,8,80,18,36,193,6,145,106,176, - 236,140,93,27,48,3,203,54,54,4,46,59,98,99,220,108,157,30,26,165,165,78,2,3,246,85,235,36,18,216,135,203,70,116,242,34,118,110,25,200, - 228,73,57,21,239,62,62,4,236,222,165,140,233,106,85,146,29,52,78,37,44,15,204,100,8,33,83,126,28,129,208,36,185,2,64,39,140,172,115,97, - 175,133,3,243,161,136,22,220,79,187,0,50,213,228,31,228,141,141,177,18,205,253,82,95,52,104,200,153,68,162,1,173,33,17,176,20,8,48,42,244, - 2,147,88,86,255,60,141,192,242,253,22,224,64,48,38,93,138,12,2,110,1,118,1,88,71,4,39,128,33,21,242,79,104,34,152,134,212,56,82,72, - 72,79,140,224,186,1,29,5,51,31,104,113,128,242,74,75,9,35,233,71,214,69,125,135,230,178,88,195,173,112,171,154,52,12,107,141,170,247,44,165, - 80,186,238,141,88,11,176,188,126,43,67,199,181,42,32,203,75,122,137,204,78,91,210,176,81,230,255,181,249,33,1,215,158,10,98,188,135,77,178,66, - 131,220,156,230,7,191,6,47,4,238,240,85,6,66,115,199,173,32,207,210,206,212,229,8,104,104,12,224,35,108,59,221,17,97,177,192,70,11,200,158, - 76,13,214,18,124,42,91,64,171,107,15,33,157,21,65,214,26,167,61,235,21,44,43,8,85,39,139,208,47,94,79,77,166,6,27,103,37,228,64,206, - 201,246,120,108,128,44,55,85,61,16,182,125,74,124,169,186,44,213,215,133,10,128,246,84,206,128,55,48,193,39,227,67,34,24,44,103,142,138,169,9, - 4,8,19,116,201,141,145,8,195,213,154,18,196,6,44,121,230,120,171,83,232,218,84,96,163,72,114,177,68,184,182,40,18,123,172,128,251,112,53,170, - 247,158,26,71,62,70,161,60,210,102,94,44,54,73,161,12,171,157,164,66,245,44,228,106,117,162,241,250,136,119,73,245,36,156,27,114,217,154,106,20, - 180,2,30,79,8,190,71,66,113,65,30,176,52,172,70,194,251,168,52,9,44,211,37,39,232,216,80,197,122,145,206,24,56,24,42,148,132,27,137,201, - 189,68,130,165,216,99,118,171,225,117,3,37,19,120,54,83,59,13,216,134,118,137,61,90,90,45,66,90,55,55,147,234,61,224,34,229,146,220,43,148, - 33,177,27,219,87,174,118,117,76,251,180,76,212,0,201,166,150,248,102,85,221,18,156,215,170,75,88,221,53,222,198,255,8,169,229,74,234,146,63,194, - 130,198,174,77,59,250,248,140,47,179,89,221,140,62,169,92,20,91,209,71,65,128,86,7,213,10,62,232,226,60,223,248,219,5,31,154,47,198,16,205, - 224,3,157,15,209,240,232,169,25,124,146,168,144,219,185,70,240,193,55,77,215,43,27,193,7,19,98,16,79,142,52,130,15,44,6,126,93,55,99,79, - 138,14,65,105,221,136,61,93,155,166,254,211,144,96,91,177,21,122,120,184,161,180,65,158,187,13,61,96,128,227,251,120,161,17,123,48,181,131,22,82, - 108,141,216,67,195,150,78,26,217,136,61,160,25,143,47,161,17,123,240,84,152,218,91,53,130,15,217,38,32,248,70,236,209,233,85,76,190,159,185,139, - 61,44,61,122,77,193,52,66,15,57,0,188,131,89,182,177,7,36,111,235,144,187,141,61,29,91,110,104,209,65,180,57,188,210,250,100,240,179,213,80, - 24,190,127,234,41,4,175,122,222,181,130,206,230,206,30,29,156,74,120,158,213,132,248,69,79,37,132,236,56,149,128,151,33,190,109,157,74,80,37,68, - 251,80,130,119,54,189,140,205,67,9,218,9,113,93,243,80,2,209,4,89,166,108,29,74,28,206,112,255,161,196,211,222,212,123,90,117,24,222,225,225, - 101,187,47,38,198,58,235,119,245,97,92,42,159,214,245,125,150,199,16,125,1,39,21,207,23,156,102,45,159,199,71,112,28,174,166,33,74,203,84,101, - 149,53,50,54,187,158,24,43,29,82,4,94,163,139,28,223,3,62,200,228,255,211,129,162,164,143,102,152,0,167,233,112,25,51,125,125,132,9,215,22, - 117,178,113,164,15,78,37,47,45,36,223,32,166,175,132,79,213,66,39,207,93,31,102,212,243,215,30,195,50,218,164,168,5,132,194,40,202,115,18,132, - 188,20,139,60,235,117,138,51,164,243,128,228,99,55,199,166,136,88,74,90,174,216,67,201,88,244,171,55,168,210,1,5,58,254,95,41,231,146,20,49, - 12,3,209,253,156,133,42,172,248,39,87,81,92,135,251,223,128,215,173,192,134,97,3,219,204,76,18,75,178,251,117,228,9,114,175,59,190,71,250,213, - 62,169,39,140,44,118,213,178,184,178,123,172,112,82,79,7,51,39,35,236,63,227,251,107,47,98,181,191,114,243,149,255,224,102,73,67,226,154,182,17, - 107,0,50,189,34,74,81,238,102,240,90,27,48,29,138,40,99,139,10,41,200,178,71,214,150,4,147,37,231,73,248,101,238,18,225,211,82,127,202,23, - 81,1,40,80,132,122,64,106,241,152,167,142,154,213,97,53,35,185,145,47,254,63,17,82,105,23,167,151,94,64,61,54,219,72,75,132,111,18,2,79, - 11,15,158,216,253,100,148,133,121,211,172,49,92,58,119,222,221,104,22,135,105,160,66,171,212,197,208,182,16,190,55,12,202,172,41,162,118,4,71,196, - 196,96,134,74,59,181,30,149,232,1,8,133,222,12,6,169,149,94,79,128,89,61,234,46,167,100,5,79,148,57,172,100,40,53,233,215,111,1,102,180, - 145,171,112,110,125,94,223,156,106,148,111,13,90,177,69,28,185,6,238,62,135,113,147,138,27,181,73,5,247,169,86,90,87,89,35,188,240,129,132,57, - 85,24,54,138,34,143,58,6,120,79,137,163,2,62,113,208,213,192,199,40,28,25,157,144,83,208,246,4,185,17,88,60,134,142,121,83,194,112,204,200, - 129,152,79,34,235,167,111,181,65,6,82,178,75,26,167,183,176,184,2,215,163,56,131,180,174,243,180,80,110,244,80,31,241,120,134,195,74,235,156,218, - 127,65,208,154,74,64,132,24,231,234,222,62,160,57,108,43,204,189,241,43,229,166,29,86,133,171,166,174,82,82,52,164,191,165,234,150,68,80,16,89, - 101,140,68,41,150,46,42,140,132,168,65,125,30,187,212,33,194,137,74,34,96,155,179,108,200,216,212,15,121,208,6,8,97,182,155,131,83,95,154,55, - 195,233,94,88,131,122,253,180,233,229,6,91,185,222,49,228,14,186,214,8,232,184,171,38,240,60,33,246,40,255,51,183,142,225,28,102,61,126,80,143, - 43,246,54,10,113,234,229,45,39,68,132,50,242,101,186,122,110,14,228,134,96,66,245,29,10,67,222,51,110,83,245,246,250,106,154,44,207,174,196,90, - 185,122,144,73,240,201,171,223,226,122,10,130,194,238,244,123,73,108,171,144,114,113,198,240,108,197,170,180,225,192,226,191,250,210,37,200,232,42,54,134, - 44,47,215,109,119,235,214,238,247,210,34,207,121,52,5,153,241,203,196,191,48,199,208,241,179,52,63,167,246,239,215,196,188,189,126,188,63,222,180,247, - 249,253,241,9,80,75,3,4,20,0,2,0,8,0,136,128,249,52,38,221,82,145,115,17,0,0,142,92,0,0,14,0,0,0,101,100,105,116,45,112, - 97,115,116,101,46,115,118,103,237,91,89,115,219,72,146,126,247,175,224,208,47,173,24,18,172,251,160,45,77,244,184,183,55,102,194,211,187,209,71,236, - 51,4,66,18,218,36,161,5,160,171,127,253,102,22,174,194,65,153,148,104,89,59,109,202,14,17,137,172,43,243,203,163,178,74,239,255,118,191,89,79, - 110,227,44,79,210,237,233,148,6,100,58,137,183,81,186,74,182,151,167,211,223,126,253,113,110,166,147,188,8,183,171,112,157,110,227,211,233,54,157,254, - 237,236,205,251,191,204,231,147,15,89,28,22,241,106,114,151,20,87,147,127,108,63,229,81,120,29,79,190,187,42,138,235,229,98,113,119,119,23,36,21, - 49,72,179,203,197,201,100,62,135,150,249,237,229,155,201,100,2,195,110,243,229,42,58,157,86,252,215,55,217,218,241,173,162,69,188,142,55,241,182,200, - 23,52,160,139,105,203,30,181,236,119,241,121,144,197,121,122,147,69,101,247,81,228,115,102,171,139,150,21,102,114,199,29,19,181,214,46,8,91,48,54, - 7,142,121,254,176,45,194,251,249,54,127,235,53,133,9,142,53,101,132,144,5,188,107,57,247,227,90,222,175,65,12,59,39,227,222,250,163,131,232,175, - 225,127,211,160,38,4,229,90,47,160,101,28,108,227,98,241,195,175,63,52,47,231,36,88,21,43,175,155,90,242,157,113,59,234,216,134,155,56,191,14, - 163,56,95,212,116,215,254,46,89,21,87,167,83,97,174,239,221,243,85,156,92,94,21,30,33,89,157,78,97,133,148,113,69,28,161,158,196,178,129,17, - 9,56,43,121,171,158,253,87,130,255,117,21,223,198,235,110,219,85,26,157,135,57,204,119,113,149,110,226,197,239,201,102,19,70,139,60,139,22,209,109, - 190,0,0,94,166,243,36,74,183,243,226,10,176,177,128,94,215,225,249,58,94,132,81,1,253,230,131,206,112,121,167,211,120,149,20,243,235,48,47,226, - 0,149,114,6,92,239,87,241,69,142,220,229,74,240,9,151,194,220,75,120,157,133,171,36,92,255,39,254,2,8,150,140,222,66,162,116,189,142,35,144, - 71,184,190,11,31,202,113,241,227,244,184,188,202,98,192,221,91,248,30,135,89,221,135,36,149,160,234,49,187,67,72,194,105,243,250,178,34,254,182,77, - 10,0,216,77,30,103,191,160,146,254,107,251,91,30,15,184,126,205,194,109,14,136,216,156,78,55,97,145,37,247,223,205,89,160,181,224,198,206,8,252, - 208,192,42,171,137,154,81,10,116,197,248,108,110,52,11,140,145,226,164,233,44,186,63,157,42,34,3,77,5,179,45,245,1,85,174,2,37,180,105,169, - 23,163,188,23,163,188,25,184,19,170,3,224,52,106,58,89,84,226,237,138,102,111,241,162,216,70,164,122,86,189,127,159,23,233,117,205,11,64,40,30, - 214,160,125,36,206,161,199,52,91,158,175,195,232,211,59,71,72,65,158,73,241,176,164,239,166,109,139,244,226,34,143,97,88,226,209,28,208,161,5,140, - 196,154,5,60,109,44,50,54,22,29,31,75,180,194,90,116,151,252,245,16,234,41,251,185,8,29,7,232,156,26,75,3,197,95,47,66,71,0,40,204, - 244,232,160,24,7,160,36,187,1,232,113,169,177,14,3,57,61,220,50,94,12,238,146,125,14,238,79,244,24,143,194,29,52,247,152,98,153,126,1,184, - 179,128,106,59,6,247,123,122,58,229,4,168,82,211,86,119,15,72,85,125,8,223,179,81,94,134,70,96,3,4,142,254,2,190,151,49,105,247,135,254, - 219,11,247,121,162,247,101,76,209,67,224,56,58,218,222,128,132,209,248,23,2,228,168,24,233,203,137,81,242,151,20,163,148,47,40,70,254,130,104,20, - 47,138,70,241,84,52,142,72,137,137,3,164,164,35,252,121,178,148,152,58,72,74,231,6,127,246,24,109,92,74,204,188,32,216,168,58,64,140,196,125, - 158,44,70,106,14,18,227,216,104,7,128,141,145,99,129,141,74,198,15,65,155,213,86,155,176,39,166,128,84,235,25,205,106,170,151,35,11,193,193,213, - 231,243,37,96,19,108,60,97,26,246,61,50,231,136,69,236,220,238,156,243,33,122,211,43,189,82,23,7,44,159,126,102,249,230,136,138,164,230,16,231, - 74,46,72,124,113,60,69,178,61,18,95,112,54,118,92,143,214,66,102,223,201,138,71,166,28,27,252,217,63,3,246,134,213,163,195,26,166,165,129,205, - 246,244,41,97,232,16,216,172,12,252,240,227,193,134,177,163,193,70,8,115,136,253,71,202,128,212,142,5,27,24,252,176,240,99,172,34,244,104,246,7, - 195,191,92,60,162,92,139,67,2,146,18,74,72,251,196,128,132,131,29,22,145,198,134,219,59,34,193,112,146,188,124,53,164,20,233,238,114,8,78,139, - 117,138,19,76,224,182,76,51,214,45,78,200,128,105,38,141,238,20,39,134,188,23,163,188,25,176,2,204,40,165,154,239,177,207,172,17,57,35,35,95, - 40,37,82,235,153,8,172,209,156,147,120,78,225,129,4,76,41,97,78,246,220,234,62,119,23,249,152,192,157,183,120,212,155,88,210,217,30,171,128,18, - 77,181,16,157,237,49,37,129,144,148,249,188,184,61,230,110,119,44,120,103,123,204,117,96,180,53,94,221,235,235,45,223,197,216,71,99,48,19,157,229, - 51,22,112,98,184,87,55,118,203,55,1,4,60,42,122,203,151,129,54,146,89,209,93,190,13,132,53,152,40,28,171,208,1,0,132,80,107,205,40,0, - 1,119,210,202,217,156,6,82,9,193,237,76,7,2,161,200,226,57,59,249,194,178,229,226,113,217,138,46,180,152,12,4,17,82,179,110,229,37,48,212, - 16,234,73,17,101,139,188,74,48,74,59,178,181,1,103,156,75,98,143,41,91,201,20,103,35,178,109,236,30,100,171,141,21,90,52,239,190,168,96,221, - 62,232,209,221,38,235,22,180,20,72,144,245,202,89,54,160,82,121,196,251,18,153,196,167,161,68,5,235,210,190,154,169,50,223,18,71,43,17,93,48, - 129,241,89,171,164,233,130,73,160,159,50,32,193,190,159,2,127,108,25,237,251,41,173,137,102,244,53,44,158,219,71,23,47,100,223,146,148,97,198,43, - 195,59,47,133,117,79,70,164,237,91,146,130,165,123,137,60,46,126,14,49,138,128,235,34,86,189,134,229,75,250,120,49,79,119,117,207,3,14,121,37, - 17,189,18,110,0,235,228,156,119,117,47,64,40,196,47,75,59,221,155,128,104,194,205,171,208,189,124,92,247,170,167,123,5,83,87,196,118,129,15,84, - 101,149,210,170,87,191,6,215,0,105,14,27,216,60,209,92,210,87,17,160,249,227,102,111,248,209,124,61,108,91,185,209,130,143,198,81,73,33,10,169, - 25,36,58,134,16,3,78,31,72,134,41,65,78,158,21,195,122,188,120,122,0,241,153,18,175,242,254,117,196,170,143,25,66,9,238,112,71,197,106,12, - 183,204,160,52,21,211,150,161,236,141,192,205,199,201,23,75,13,74,185,190,95,224,253,3,247,173,185,188,128,55,23,86,183,73,124,215,94,82,192,155, - 17,85,63,215,225,101,236,246,86,32,206,178,132,80,189,56,79,179,85,156,213,175,148,251,116,94,85,219,47,220,59,83,204,7,105,147,116,54,74,196, - 206,61,54,50,246,62,191,10,87,233,29,44,176,255,242,143,52,221,180,251,184,22,24,247,101,240,151,82,75,49,120,9,227,80,17,16,161,12,151,131, - 151,55,89,6,186,156,175,195,135,24,214,228,126,213,221,231,87,233,221,101,134,178,185,8,215,141,112,154,166,248,106,126,126,158,194,216,69,118,51,120, - 189,74,163,27,188,96,52,191,41,209,84,221,108,241,56,238,146,45,172,114,94,93,134,49,154,237,96,168,111,199,152,225,218,42,14,92,190,145,59,94, - 194,242,245,64,202,184,54,95,210,229,10,43,192,108,226,34,92,133,69,216,130,163,166,224,45,22,217,220,98,89,93,44,127,254,225,199,102,163,30,69, - 203,255,73,179,79,237,30,27,25,194,243,244,6,230,222,84,15,240,114,76,180,68,179,9,139,179,100,3,83,192,171,76,127,189,223,172,1,167,205,139, - 14,115,241,112,29,183,157,150,221,214,215,178,70,175,118,173,162,77,130,141,22,191,20,201,122,253,15,28,196,43,40,84,157,38,197,58,62,251,143,85, - 82,76,254,27,239,238,184,209,75,98,135,15,86,29,159,49,176,235,57,37,240,207,177,57,90,135,43,194,107,106,105,118,230,77,19,197,241,253,101,83, - 67,24,142,253,253,118,5,173,242,201,79,201,58,207,211,237,216,4,208,120,135,221,56,206,193,136,216,113,126,115,254,59,56,200,78,7,40,173,191,135, - 151,189,89,32,117,157,156,225,221,165,247,139,234,97,148,227,186,20,206,144,165,164,117,122,118,19,27,204,1,5,177,78,162,120,155,127,94,139,110,85, - 201,45,120,159,205,38,221,230,78,161,85,219,124,113,254,48,207,195,5,132,236,197,64,155,81,186,5,15,124,126,115,168,14,254,25,126,186,57,159,252, - 82,196,16,20,178,67,53,48,28,211,241,162,13,248,54,241,177,191,118,207,44,14,92,118,87,168,215,113,6,56,207,63,43,212,177,107,140,63,199,215, - 89,186,186,113,23,219,186,210,124,102,199,63,36,121,41,149,177,142,179,248,127,111,18,104,241,164,158,127,74,11,16,201,113,251,252,190,216,61,217,103, - 73,33,206,146,91,167,82,68,67,126,220,73,255,114,21,102,241,247,235,228,147,47,12,7,189,10,106,117,45,211,115,208,239,23,181,11,119,79,151,173, - 107,239,132,188,38,62,172,195,243,120,125,58,253,136,47,39,116,24,250,210,155,235,77,186,138,171,230,117,68,184,124,211,173,210,174,146,252,26,24,150, - 201,22,179,174,78,26,118,41,137,183,123,47,70,238,180,112,38,97,179,22,207,89,117,173,69,24,9,41,43,62,11,1,169,41,100,81,51,193,97,207, - 78,184,61,105,139,211,25,248,158,86,170,16,251,230,84,18,220,17,24,255,138,210,189,163,75,27,192,24,254,25,74,115,17,85,155,128,75,237,149,204, - 154,75,171,176,175,178,120,137,76,246,138,201,56,176,240,235,168,141,20,154,154,52,100,118,12,242,93,35,223,249,183,154,46,32,70,45,33,122,125,247, - 118,120,69,232,196,189,245,138,232,238,49,187,89,199,203,109,186,253,3,18,174,119,96,110,233,39,247,24,87,223,203,140,2,152,171,71,236,22,212,182, - 4,165,109,87,62,241,247,52,217,46,1,227,113,246,110,19,102,159,226,172,236,165,252,62,207,139,48,43,58,148,77,178,234,60,199,219,85,103,92,215, - 213,58,129,95,75,81,211,86,33,164,24,89,6,32,240,57,145,90,86,229,151,164,166,181,139,188,77,242,228,60,89,227,131,251,186,142,223,117,145,244, - 46,189,141,179,139,117,122,87,191,247,13,225,58,44,174,60,29,52,41,47,192,21,147,2,72,197,34,248,244,180,135,141,36,145,190,190,129,250,175,201, - 156,81,208,54,53,26,239,83,33,144,12,236,149,39,31,118,208,61,42,103,58,80,146,8,58,78,132,30,180,10,180,16,210,10,32,155,64,74,98,212, - 132,50,172,164,82,161,102,140,1,92,12,209,178,166,113,51,51,38,16,82,48,46,161,121,75,157,131,21,192,126,129,19,54,153,99,125,71,74,193,189, - 89,169,29,115,253,99,242,12,164,14,239,110,126,67,234,179,145,250,76,29,112,250,77,7,123,234,160,111,228,77,40,232,25,249,40,221,163,122,70,62, - 70,196,30,52,97,1,101,74,122,70,62,167,150,8,96,97,210,179,114,143,232,155,185,71,246,237,156,106,60,204,163,82,119,236,124,116,186,29,59,111, - 93,93,39,180,237,116,146,237,185,232,101,189,233,243,226,107,15,177,237,105,246,174,144,230,14,217,250,40,13,136,135,211,248,54,134,57,212,184,91,190, - 213,84,68,84,117,161,74,2,235,62,90,245,49,11,153,92,177,3,178,35,160,107,166,187,55,248,250,45,154,53,116,79,114,65,68,184,81,110,37,92, - 165,14,120,236,192,165,242,10,121,77,190,1,82,0,157,115,175,186,11,68,172,238,112,63,165,192,67,220,250,230,80,123,136,123,143,119,5,184,209,150, - 235,118,34,217,67,67,245,111,251,63,166,190,221,106,195,195,193,71,156,75,95,105,198,152,16,220,86,215,191,84,178,99,226,121,74,123,134,167,24,81, - 146,160,124,160,36,128,151,68,75,26,40,9,15,90,180,82,198,248,74,2,163,230,140,67,132,245,149,164,2,201,176,19,221,81,18,9,164,2,199,96, - 188,212,49,123,232,144,247,82,83,215,202,222,202,8,127,6,54,229,241,140,42,105,36,2,244,209,253,213,173,106,112,1,166,81,28,215,222,141,171,58, - 49,103,65,143,189,177,174,65,71,247,238,36,187,71,124,24,187,242,83,42,206,26,176,36,233,29,168,148,138,107,200,7,216,151,147,194,190,166,52,98, - 140,120,12,114,50,174,57,97,94,145,109,73,230,221,156,168,84,196,192,1,82,65,133,30,218,22,22,104,137,86,194,87,145,13,36,133,0,64,59,14, - 80,131,87,84,210,120,250,119,42,234,106,230,41,150,52,162,152,207,155,81,123,171,236,117,7,168,221,166,36,173,30,232,137,235,128,128,132,165,28,234, - 9,52,104,153,53,157,64,37,3,193,45,23,254,129,122,73,36,90,107,217,51,37,216,90,107,107,188,83,200,210,148,26,242,168,230,186,209,108,44,242, - 233,110,144,20,154,49,237,57,229,123,119,6,160,45,21,158,251,174,23,165,7,174,196,4,86,104,174,213,64,92,144,176,181,237,7,25,59,37,218,74, - 33,101,229,154,125,240,236,19,55,187,186,235,218,54,101,95,207,182,143,161,18,62,200,91,74,149,184,59,39,108,168,146,1,96,247,80,141,87,226,57, - 60,53,197,75,58,39,135,219,127,21,126,199,117,246,250,204,127,167,42,241,207,169,177,112,192,251,246,58,32,59,189,131,25,40,237,157,188,163,50,241, - 166,13,229,108,152,221,242,234,0,121,224,103,108,160,44,234,146,143,41,147,78,15,78,84,241,144,124,255,60,117,119,10,244,234,140,237,16,9,232,255, - 239,18,24,203,246,196,136,31,32,150,91,59,116,29,42,160,198,139,58,165,155,177,146,67,230,209,117,72,224,162,100,207,113,193,186,187,238,236,193,167, - 54,170,241,11,55,195,178,141,49,10,12,70,189,235,254,193,204,110,141,49,118,200,150,120,183,206,14,218,90,253,187,148,112,92,1,7,179,18,106,56, - 81,51,174,2,38,39,31,39,213,13,191,89,117,171,15,41,184,207,170,40,142,183,226,242,219,121,181,146,186,82,194,24,109,33,246,249,58,201,35,200, - 160,123,3,130,31,86,35,49,10,182,219,226,27,38,122,152,128,104,40,45,49,204,105,28,100,164,196,228,195,132,211,192,224,201,19,71,42,68,54,73, - 149,67,1,24,45,177,51,188,8,73,53,211,6,105,18,189,11,155,97,73,221,26,35,177,26,7,239,177,2,224,224,66,97,207,47,217,4,54,46,210, - 8,171,233,140,203,64,41,45,132,194,161,133,86,140,114,164,97,228,147,10,27,143,80,241,90,154,166,18,39,73,161,31,55,201,177,137,143,3,147,28, - 7,152,16,227,169,50,212,80,125,172,29,170,232,239,80,235,29,145,125,5,213,31,135,14,72,86,132,50,120,186,82,253,254,80,146,96,107,41,144,166, - 137,65,253,32,77,19,216,177,34,205,226,86,95,249,77,155,102,90,26,124,36,76,235,146,129,27,10,200,194,70,144,225,72,93,210,170,54,31,155,39, - 17,240,102,232,234,217,80,193,152,173,38,35,40,144,4,33,0,64,218,142,139,36,244,105,101,59,13,64,84,142,6,187,27,46,75,54,220,212,33,13, - 226,16,108,214,58,77,113,28,152,129,116,225,175,38,124,112,4,90,183,194,137,2,70,45,166,212,142,32,181,148,212,209,122,109,12,222,155,53,72,18, - 76,105,202,145,134,7,88,210,117,36,193,150,20,115,52,215,172,150,52,88,10,5,191,203,38,46,255,183,22,16,14,52,97,24,103,216,23,152,145,6, - 170,163,149,147,196,107,221,101,67,129,252,40,22,35,185,228,194,120,76,150,9,32,248,205,172,27,240,99,67,129,12,181,233,167,122,22,48,67,34,75, - 10,174,18,105,154,48,42,180,207,213,204,187,92,38,144,192,252,36,103,78,38,229,50,145,102,40,113,168,145,213,82,45,88,86,51,160,6,68,25,36, - 113,41,153,41,91,130,241,187,150,220,72,74,136,147,2,182,106,244,11,143,68,32,131,160,176,153,118,207,176,95,226,142,194,97,35,94,206,92,186,81, - 172,167,22,24,129,50,129,36,197,240,144,208,209,64,206,6,91,194,80,144,115,187,193,148,107,39,219,89,42,0,160,180,72,19,176,153,45,133,169,52, - 199,174,36,56,68,89,206,177,90,156,108,102,9,18,195,179,6,32,105,232,187,92,28,180,82,194,209,12,186,212,26,6,240,108,155,121,86,80,129,125, - 0,94,156,44,231,89,65,10,143,44,173,129,116,182,134,157,13,154,225,42,100,34,5,61,174,109,209,91,50,213,232,46,159,32,206,87,89,64,221,5, - 62,27,194,84,69,128,71,88,44,248,97,175,71,164,117,91,128,92,8,64,182,157,23,208,24,53,210,233,167,158,63,210,252,53,226,179,2,164,50,79, - 14,72,179,218,42,230,201,11,104,149,18,101,51,32,103,74,121,114,71,138,162,70,80,79,59,72,211,190,10,129,0,254,130,83,225,233,25,105,88,94, - 81,30,30,144,86,105,81,52,51,133,125,53,248,28,15,91,72,179,78,63,37,254,224,217,135,39,62,82,102,28,208,106,4,35,13,76,67,48,15,233, - 72,171,86,215,78,19,88,180,107,89,91,13,210,164,6,127,229,89,23,210,74,197,85,38,232,8,2,2,140,103,167,30,83,101,205,30,165,214,191,123, - 174,61,194,7,159,82,121,13,164,104,78,136,245,124,75,203,101,218,121,131,197,106,214,120,41,199,196,141,161,206,11,214,222,172,132,65,235,241,90,168, - 180,94,177,133,84,235,61,43,212,9,79,41,21,50,91,47,220,128,183,226,170,193,221,248,118,60,104,228,157,110,28,69,212,109,202,152,128,52,64,177, - 17,94,236,240,91,86,58,118,36,46,173,31,137,144,86,142,88,135,43,143,210,76,193,25,98,80,247,1,200,53,194,11,136,174,95,6,48,105,194,102, - 51,120,219,136,89,105,148,23,122,203,201,128,95,241,66,180,215,172,150,118,185,52,161,221,120,16,155,117,181,92,194,33,31,118,52,216,206,85,115,104, - 154,185,168,220,207,7,112,178,202,107,81,6,92,208,178,215,243,32,149,232,37,107,101,57,131,179,29,185,216,231,238,167,180,249,158,87,54,47,51,92, - 20,157,149,212,226,223,89,194,200,164,66,140,209,88,161,69,34,120,2,134,86,164,2,240,206,218,64,230,105,48,163,36,152,244,106,48,79,64,173,112, - 91,31,34,97,143,139,173,33,76,128,80,5,69,170,4,229,90,133,25,46,23,96,170,28,105,218,66,16,147,56,180,194,191,247,116,153,176,5,187,183, - 85,114,61,160,34,13,178,99,174,103,144,82,91,202,136,25,155,183,39,178,97,114,10,178,135,228,212,140,109,159,158,159,170,74,189,35,85,53,236,79, - 180,115,218,167,232,68,208,225,10,87,222,30,209,196,161,197,238,61,110,160,252,9,118,170,173,127,240,142,238,235,195,50,58,40,109,117,235,173,157,114, - 22,221,113,122,140,175,236,142,102,195,110,235,161,201,216,12,249,244,27,50,190,89,226,191,191,37,202,97,173,249,16,75,100,124,167,37,50,125,176,37, - 210,177,25,234,111,150,248,205,18,255,4,150,104,7,150,200,15,177,68,78,155,63,129,188,60,123,243,30,255,208,236,236,205,255,1,80,75,3,4,20, - 0,2,0,8,0,130,128,249,52,145,40,234,161,189,30,0,0,76,213,0,0,15,0,0,0,101,100,105,116,45,100,101,108,101,116,101,46,115,118,103, - 236,93,219,114,35,55,146,125,159,175,224,178,95,220,49,98,17,72,220,213,151,9,239,56,102,195,27,218,217,136,177,29,251,184,193,75,73,162,155,34, - 181,36,213,106,249,235,247,36,138,151,42,22,68,145,20,69,117,88,148,236,104,49,11,133,203,65,34,243,36,42,81,252,248,183,111,55,195,198,215,124, - 50,29,140,71,159,154,50,19,205,70,62,234,141,251,131,209,213,167,230,111,191,254,163,229,155,141,233,172,51,234,119,134,227,81,254,169,57,26,55,255, - 246,249,47,31,255,173,213,106,252,125,146,119,102,121,191,113,63,152,93,55,126,30,125,153,246,58,183,121,227,135,235,217,236,246,188,221,190,191,191,207, - 6,115,97,54,158,92,181,223,55,90,45,220,57,253,122,245,151,70,163,129,102,71,211,243,126,239,83,115,94,254,246,110,50,140,229,250,189,118,62,204, - 111,242,209,108,218,150,153,108,55,87,197,123,171,226,247,121,55,155,228,211,241,221,164,87,84,223,235,149,75,78,250,151,171,162,232,201,189,138,133,100, - 8,161,45,168,77,212,66,137,214,244,97,52,235,124,107,141,166,239,74,183,162,131,169,91,73,8,209,198,181,85,201,237,74,157,127,27,2,134,71,59, - 19,175,150,91,7,244,183,248,127,121,195,66,144,21,99,189,196,157,121,54,202,103,237,159,126,253,105,121,177,37,178,254,172,95,170,102,129,124,165,221, - 202,116,140,58,55,249,244,182,211,203,167,237,133,60,222,127,63,232,207,174,63,53,181,191,253,22,63,95,231,131,171,235,89,73,48,232,127,106,98,132, - 198,197,79,139,30,156,47,117,72,100,138,138,130,243,106,203,151,180,254,107,63,255,154,15,171,247,246,199,189,110,103,138,206,182,175,199,55,121,251,247, - 193,205,77,167,215,158,78,122,237,222,215,105,27,218,119,53,110,13,122,227,81,107,118,13,197,104,163,214,97,167,59,204,219,157,222,12,245,78,107,149, - 241,216,62,53,243,254,96,214,234,67,151,102,121,198,83,242,25,197,62,246,243,203,41,23,47,198,193,159,84,188,128,75,152,137,188,51,249,143,73,167, - 63,128,242,21,133,138,98,213,43,138,180,156,223,131,187,166,179,241,237,162,44,122,49,123,24,162,105,22,182,122,227,225,120,114,126,127,61,152,229,31, - 162,96,12,184,7,179,135,115,249,161,185,186,99,124,121,57,205,129,175,40,201,34,196,184,3,45,169,102,163,253,156,182,68,170,45,153,110,203,44,219, - 250,216,174,14,121,103,132,40,108,143,208,59,19,124,183,215,221,27,35,37,31,199,168,52,186,144,170,48,115,198,242,127,190,185,177,135,116,105,122,193, - 214,122,184,195,212,188,35,161,114,107,182,24,100,122,114,148,218,115,114,22,139,16,221,24,230,61,212,223,25,222,119,30,166,205,13,179,39,157,217,126, - 246,186,195,78,239,203,190,115,39,157,219,5,196,68,91,219,235,183,116,225,136,16,154,112,44,8,173,60,30,132,86,29,204,68,200,93,140,232,187,142, - 134,99,21,123,99,180,155,25,125,119,121,217,211,61,189,239,90,149,7,52,164,66,248,35,185,26,33,197,78,24,245,21,255,238,139,145,144,116,40,140, - 40,184,35,97,68,193,239,136,145,225,223,61,49,66,107,116,52,131,69,193,234,227,24,44,180,100,143,101,176,208,150,127,10,66,254,212,25,238,12,97, - 228,237,231,215,147,28,113,198,187,106,197,70,88,81,129,186,218,132,117,114,69,69,174,230,194,223,70,131,25,2,138,187,105,62,249,133,73,249,127,143, - 126,155,230,181,82,191,78,58,163,41,34,128,155,79,205,155,206,108,50,248,246,67,139,50,231,180,242,225,76,224,87,102,193,6,39,236,153,148,144,91, - 82,103,45,239,40,243,222,232,247,203,202,122,223,62,53,173,48,153,147,154,86,29,233,61,48,197,183,153,213,206,175,164,151,201,178,151,201,178,19,204, - 129,116,25,74,250,213,4,31,78,67,35,170,71,209,80,180,68,199,210,80,180,165,191,71,13,117,7,211,208,180,130,182,164,15,50,179,234,251,213,208, - 132,2,106,223,60,184,82,164,21,208,136,167,67,26,148,178,201,144,198,52,119,95,25,71,83,119,243,82,62,109,163,186,107,191,193,178,64,221,205,17, - 212,157,50,68,32,41,117,255,38,63,53,149,128,212,148,59,242,192,82,187,174,194,223,40,89,150,120,17,132,140,21,199,237,174,217,202,63,74,197,151, - 132,205,211,19,202,155,164,209,252,179,189,174,173,26,83,79,232,211,118,91,31,153,215,218,90,65,244,225,96,124,220,238,96,2,146,227,23,153,20,74, - 4,114,62,105,13,50,81,252,164,56,179,13,59,6,49,169,214,231,245,39,23,236,166,198,221,193,248,186,20,118,135,237,133,119,93,211,19,70,174,41, - 209,166,97,108,194,16,109,239,68,62,223,121,227,115,117,185,67,235,114,115,235,238,96,40,98,66,158,88,70,210,169,45,225,73,12,220,74,219,19,254, - 209,129,63,185,134,165,211,91,162,147,104,92,7,3,172,158,108,252,185,16,218,39,205,158,180,180,63,132,198,153,96,204,51,32,180,106,127,8,93,207, - 229,46,188,56,132,198,61,9,161,241,251,67,216,237,116,251,93,251,12,8,77,216,31,194,75,121,105,242,222,139,67,88,218,152,126,148,228,60,57,76, - 177,187,119,158,143,99,103,239,44,141,220,217,59,39,27,59,32,134,222,238,242,188,161,23,248,119,207,232,80,122,183,219,38,144,243,174,227,186,123,110, - 2,161,53,185,31,74,219,17,217,200,28,67,166,17,66,9,85,97,153,46,51,20,164,44,237,85,48,35,37,151,41,103,45,201,10,123,101,161,242,86, - 248,45,8,178,202,96,221,133,180,145,32,139,76,105,173,120,159,130,178,224,72,120,119,214,66,1,225,165,246,121,139,222,55,55,153,30,218,134,251,111, - 181,188,158,187,91,177,109,251,245,109,55,97,252,193,66,15,133,25,19,90,202,37,178,158,97,6,158,66,185,32,61,162,17,163,53,25,247,254,137,185, - 123,100,158,211,58,81,209,159,23,196,49,110,80,110,220,4,22,149,97,97,0,213,88,74,234,202,80,112,221,82,53,130,146,62,115,70,136,3,6,131, - 139,169,112,1,63,252,161,37,51,25,130,119,230,253,10,171,195,111,239,196,29,241,199,183,119,40,120,93,217,107,65,224,232,130,37,77,149,189,22,5, - 125,242,158,74,176,95,38,203,94,38,203,78,0,113,102,12,33,26,166,173,116,87,106,142,195,207,108,22,72,123,111,177,250,207,90,22,170,203,200,241, - 7,4,214,136,230,36,164,210,101,158,60,155,10,43,1,173,13,225,253,150,51,246,170,152,31,114,161,239,0,150,205,164,39,173,82,96,29,101,238,95, - 19,243,64,175,131,185,206,148,34,99,34,230,254,173,97,110,95,7,115,202,172,99,35,203,152,11,37,141,121,51,152,171,114,36,115,84,204,225,217,188, - 225,237,77,43,178,16,192,218,222,18,230,250,117,48,7,80,94,89,42,236,185,145,142,94,11,243,195,115,188,152,237,176,41,25,34,28,238,177,20,20, - 214,107,163,212,124,159,158,132,50,30,49,9,162,16,25,68,140,71,36,41,25,100,149,44,19,188,169,145,74,85,131,162,150,193,244,8,41,75,207,99, - 230,20,19,116,82,121,87,101,153,42,83,152,182,242,131,233,227,107,175,20,238,85,180,215,71,199,56,215,222,183,229,25,21,226,166,87,193,220,190,105, - 204,205,171,96,174,223,52,230,225,85,48,167,183,140,57,169,87,193,92,188,105,204,95,197,135,202,204,90,206,48,120,147,144,171,87,113,161,234,77,67, - 254,42,30,212,124,55,144,191,64,152,195,169,239,27,51,227,93,37,232,208,98,125,43,91,101,158,200,149,162,33,14,55,170,197,56,210,176,153,119,206, - 107,218,117,119,244,37,134,108,194,198,33,91,83,141,179,212,250,144,169,26,90,169,181,177,218,204,122,103,190,135,129,150,122,145,26,168,175,62,57,163, - 234,48,215,158,183,172,61,160,80,148,209,247,48,70,162,141,147,73,106,87,2,24,145,208,197,163,117,91,157,119,147,121,229,96,133,170,184,212,203,82, - 4,239,69,71,189,121,213,210,218,170,37,56,106,231,130,172,14,39,112,70,160,17,213,149,75,76,93,149,41,113,184,184,124,81,129,86,193,217,157,102, - 252,99,155,207,52,198,191,150,39,34,249,56,100,255,235,32,191,47,42,154,94,143,239,187,227,73,63,135,193,155,77,238,22,211,192,99,226,83,152,243, - 143,183,157,171,60,62,193,6,18,69,42,217,252,66,113,235,226,146,181,182,34,159,63,225,230,12,15,169,138,159,69,253,11,240,185,230,82,49,145,186, - 62,189,238,244,199,247,128,102,253,226,31,227,241,205,234,81,249,106,66,97,231,181,206,76,240,102,153,45,185,186,200,230,62,100,66,43,45,106,21,246, - 238,38,19,96,218,26,118,30,24,144,248,207,162,122,70,234,106,194,192,92,118,134,75,100,150,183,242,165,86,183,59,254,86,197,113,113,185,63,238,221, - 241,49,230,214,93,49,95,243,243,179,165,18,247,131,17,70,217,154,31,185,245,142,30,41,176,56,131,187,122,30,187,94,226,27,107,81,120,236,234,3, - 47,36,187,126,145,71,87,198,186,60,70,30,90,126,115,203,7,132,227,73,112,189,126,243,184,251,59,22,80,107,52,238,231,211,244,240,231,37,110,199, - 131,17,143,62,137,224,188,76,129,97,26,227,59,116,100,99,1,158,132,69,35,155,250,209,153,93,47,187,49,95,43,55,249,172,211,239,204,58,171,5, - 176,144,44,14,195,124,156,244,47,207,255,245,211,63,150,233,30,189,222,249,255,140,39,95,86,153,26,92,160,211,29,223,97,122,150,41,40,124,206,184, - 119,206,220,167,51,251,60,184,1,198,124,38,252,175,223,110,134,88,158,203,11,149,194,179,135,219,124,85,105,81,237,226,124,123,242,140,124,191,119,51, - 224,155,218,191,204,6,195,225,207,220,72,41,45,101,94,233,96,54,204,63,255,20,143,64,199,150,11,65,165,12,70,155,127,142,23,227,95,149,107,61, - 62,225,63,158,124,46,117,140,1,248,241,106,153,124,82,111,237,63,59,95,238,186,141,95,102,57,204,227,36,213,40,219,168,122,37,177,100,173,61,174, - 118,122,23,39,176,82,1,163,243,239,157,171,181,62,176,116,56,248,204,231,190,63,182,231,31,146,37,250,115,68,54,149,153,194,11,244,251,60,132,122, - 169,66,86,233,64,236,127,173,171,220,255,219,187,238,112,48,189,206,119,131,241,159,227,175,249,112,120,214,248,121,212,203,118,68,49,209,32,55,55,28, - 244,242,209,244,105,37,139,147,48,248,10,227,127,115,51,30,77,163,190,205,239,157,182,187,15,173,105,167,77,153,104,215,148,173,55,30,129,229,119,239, - 118,85,152,93,117,164,222,76,44,203,171,178,188,74,47,214,135,91,90,168,59,142,180,138,227,109,62,193,202,155,62,137,99,234,13,21,255,202,111,39, - 227,254,93,124,109,65,21,192,103,86,252,211,96,90,160,146,170,120,146,255,223,221,0,119,236,85,243,63,199,51,64,114,216,58,127,156,61,222,217,103, - 161,144,79,6,95,227,148,178,54,76,15,219,233,95,174,59,147,252,199,225,224,75,25,140,168,122,115,85,91,36,233,149,92,198,199,246,194,161,196,79, - 87,43,71,83,225,25,75,95,53,236,116,243,225,167,230,5,95,108,200,186,171,27,223,221,222,192,227,206,111,95,248,168,171,191,84,179,15,251,131,233, - 45,10,156,15,70,204,81,151,244,113,150,56,172,66,150,148,87,28,122,47,206,171,32,80,230,212,187,51,176,41,21,140,12,103,26,82,143,192,189,154, - 140,119,101,157,40,229,254,78,96,246,106,89,144,171,83,7,224,93,194,74,111,62,148,143,16,93,194,111,157,195,163,253,240,174,126,30,231,125,188,90, - 202,151,140,31,39,119,195,252,124,52,30,253,1,158,249,1,10,63,254,18,63,230,243,191,11,34,117,46,23,31,185,90,0,119,14,216,70,253,178,240, - 119,208,133,115,104,89,62,249,112,211,153,124,201,39,69,45,197,223,173,233,172,51,153,85,36,55,131,126,229,115,62,234,87,218,141,85,13,7,248,231, - 92,47,100,253,14,120,213,100,130,105,40,151,100,105,145,239,121,46,22,178,213,32,191,14,166,131,238,96,200,31,226,159,195,252,67,117,46,63,192,43, - 76,46,135,227,251,197,245,181,148,81,158,6,76,76,57,233,121,78,46,249,161,37,159,183,43,31,14,91,190,218,197,249,76,25,39,203,137,218,160,91, - 45,105,76,64,196,73,229,52,244,135,40,23,153,13,214,155,242,66,96,126,181,191,6,212,15,32,158,52,96,103,13,128,2,252,87,163,69,8,50,129, - 180,227,83,103,60,81,94,40,223,248,251,35,242,146,84,113,74,164,17,90,166,133,168,193,89,222,158,51,65,67,236,51,99,132,183,13,73,38,115,108, - 30,206,136,48,203,94,56,179,144,41,127,230,125,166,141,38,101,112,251,74,218,210,42,51,142,148,160,70,75,41,212,111,180,42,245,202,62,210,215,63, - 26,107,218,206,42,7,85,169,164,158,47,99,94,152,73,166,199,160,252,61,252,108,208,212,199,238,72,182,165,106,112,47,23,201,26,220,73,121,73,90, - 130,59,37,228,26,156,224,44,4,107,74,112,183,100,16,26,69,200,148,240,46,9,203,128,151,196,101,196,165,211,38,35,105,92,5,241,100,119,43,136, - 63,123,73,135,211,146,222,114,73,175,18,254,231,17,70,69,103,107,19,161,188,53,193,5,189,149,119,229,45,200,245,137,200,196,46,83,193,51,31,127, - 106,115,2,74,55,251,147,91,217,184,232,117,230,176,254,100,227,162,129,117,69,139,63,41,83,142,215,42,36,248,104,56,191,124,249,105,113,71,105,69, - 45,172,138,226,115,122,203,25,79,76,116,156,201,197,81,168,71,87,80,254,53,135,5,91,172,136,243,119,198,24,103,212,19,139,104,195,132,237,12,249, - 170,83,43,205,52,235,184,65,107,188,48,103,210,114,106,148,32,182,148,42,11,198,122,173,21,75,181,213,198,105,128,231,200,57,10,254,12,168,10,97, - 12,160,99,153,39,133,114,44,147,138,172,194,221,38,243,1,222,3,254,131,183,255,172,10,86,54,92,70,30,82,7,238,106,50,13,73,240,13,159,121, - 29,32,157,203,240,99,113,183,207,130,48,214,122,98,41,231,254,147,107,40,207,59,151,65,233,249,221,48,250,44,115,40,167,231,50,141,30,225,110,48, - 99,229,141,210,50,74,61,121,24,82,238,27,225,102,148,84,153,135,175,116,196,50,18,68,214,197,158,123,227,28,183,205,82,105,37,247,28,82,195,184, - 176,58,5,111,165,44,16,82,133,0,63,232,96,5,50,24,104,107,3,233,146,84,58,222,68,246,214,150,100,9,188,19,10,40,93,233,68,215,99,238, - 176,236,17,151,1,201,228,127,123,213,189,207,234,181,135,249,181,77,202,189,210,21,82,112,229,24,193,86,86,140,15,206,60,199,157,136,239,197,116,237, - 101,164,186,195,113,239,203,218,210,82,112,252,46,24,125,6,90,224,192,26,108,128,217,193,74,16,46,0,88,150,90,31,200,106,86,31,172,20,9,237, - 113,176,72,25,214,145,9,212,64,116,224,189,145,208,91,226,228,37,167,37,69,227,38,53,104,24,203,164,71,136,96,10,147,87,107,41,165,85,62,168, - 39,181,234,249,42,117,85,9,74,149,12,171,216,167,166,97,18,102,1,131,245,133,86,173,20,172,4,250,92,97,22,239,184,40,219,206,76,61,195,38, - 166,130,240,248,231,176,51,203,127,128,113,82,220,53,142,187,75,127,191,111,238,194,89,167,61,254,47,65,91,21,9,185,78,91,41,100,210,42,141,169, - 141,76,91,11,199,138,145,146,194,214,16,184,133,83,103,164,160,24,70,27,46,102,164,139,186,98,227,49,51,19,111,102,27,169,61,108,23,174,43,43, - 172,241,92,146,216,78,249,51,232,28,73,33,173,75,202,46,184,25,239,181,66,51,144,162,15,248,171,48,116,53,41,100,18,28,54,192,185,10,216,90, - 15,155,207,178,192,169,10,142,123,100,80,183,98,6,173,36,226,21,184,142,192,93,23,104,138,226,221,176,191,8,88,230,67,132,79,72,202,46,146,96, - 108,34,196,178,110,184,146,42,246,168,203,222,172,116,111,128,99,237,22,163,109,210,247,90,152,22,178,32,73,75,235,121,50,157,129,131,102,5,73,73, - 165,100,165,210,66,179,210,112,124,37,93,67,98,13,88,11,5,96,245,210,65,41,42,238,54,2,134,18,138,204,11,66,192,138,26,46,41,64,176,93, - 84,110,197,129,173,78,202,46,184,29,109,16,156,185,51,132,192,104,70,89,246,236,41,41,238,135,91,215,100,89,225,65,22,131,176,92,14,33,26,236, - 25,247,200,58,33,66,188,155,152,156,240,10,84,208,93,75,129,203,193,192,99,21,196,17,90,65,32,46,41,217,69,18,139,147,186,191,142,186,159,144, - 126,209,45,50,25,115,40,165,141,154,190,240,125,9,33,191,68,15,158,132,247,182,96,10,162,235,147,76,239,5,22,115,180,4,11,215,135,123,201,120, - 237,163,37,208,133,235,243,240,25,206,35,54,96,47,132,200,33,36,36,188,234,60,89,88,17,207,235,221,41,68,9,209,176,212,132,124,188,141,36,175, - 78,21,121,12,59,61,25,59,37,84,52,1,11,159,39,225,83,209,145,64,209,6,20,62,15,5,227,137,122,55,31,27,251,183,148,236,34,5,66,114, - 215,13,38,214,52,183,179,207,135,51,234,174,70,98,100,146,196,36,164,68,117,18,35,147,36,70,36,72,140,76,144,24,153,34,49,104,38,144,55,8, - 244,32,117,32,198,49,76,76,73,33,171,145,24,46,87,39,49,232,112,141,196,160,100,141,176,164,100,23,73,48,78,86,253,100,213,255,132,86,93,153, - 148,53,72,73,149,173,89,3,20,75,88,3,94,175,235,214,0,55,243,86,188,11,108,156,97,125,65,198,18,162,11,222,50,18,206,89,89,236,1,6, - 56,13,54,237,41,41,110,175,7,52,54,25,208,184,68,64,99,19,1,141,77,217,130,20,20,143,89,247,240,108,235,126,210,246,151,213,246,164,239,75, - 73,85,221,247,169,164,239,83,9,223,167,18,126,78,37,125,31,154,113,193,4,175,89,10,98,65,202,113,157,9,169,74,248,62,149,244,125,42,225,251, - 84,194,207,169,164,239,83,114,107,125,127,250,25,226,161,217,76,253,73,162,82,201,25,77,72,25,246,245,25,85,201,25,165,196,140,34,70,116,202,153, - 184,165,34,148,42,192,95,23,93,196,70,44,66,209,56,115,154,223,101,103,11,139,88,147,242,204,214,230,83,39,231,211,36,230,83,39,230,83,39,231, - 83,157,184,204,137,203,188,9,235,78,46,25,217,36,164,228,235,145,141,75,70,54,54,17,217,128,141,88,237,180,98,226,18,124,144,88,205,41,89,220, - 12,117,164,133,37,150,42,225,81,83,177,95,92,147,226,254,122,100,227,147,145,77,72,68,54,62,17,217,248,100,100,227,182,183,238,71,143,85,101,61, - 86,77,178,211,148,148,234,236,148,146,236,148,18,236,148,31,212,240,169,145,104,159,193,52,141,215,73,217,5,215,105,131,148,209,230,147,23,94,134,162, - 63,235,66,74,176,83,74,178,83,74,176,83,74,48,81,74,178,83,50,39,235,126,178,238,111,195,186,39,153,94,74,74,117,166,71,73,166,71,9,166, - 135,146,245,125,43,149,220,183,130,37,17,204,229,216,142,243,91,31,133,156,219,151,117,41,37,184,30,37,185,30,37,184,30,37,120,29,37,185,30,169, - 237,173,123,56,182,117,167,218,227,84,126,169,143,4,236,190,186,165,156,144,74,208,102,10,156,67,185,218,83,142,231,203,57,207,175,178,167,140,136,72, - 232,160,108,105,79,153,119,124,37,68,33,62,73,42,102,47,37,187,224,102,66,8,80,148,248,224,20,241,23,217,98,115,184,38,229,13,99,235,172,180, - 229,157,101,19,55,135,157,175,110,45,115,174,141,81,186,188,179,172,57,81,39,40,83,222,89,78,200,46,146,88,156,204,251,201,188,255,25,31,47,97, - 189,74,144,39,197,9,50,134,4,153,248,108,54,33,141,182,205,96,53,196,4,27,254,122,49,201,50,240,111,254,102,28,240,41,226,92,222,120,183,143, - 150,213,74,94,165,252,13,115,150,183,246,21,74,22,139,153,243,212,156,74,202,226,99,9,199,15,143,34,165,247,86,107,53,247,24,107,66,62,157,204, - 182,128,248,9,21,90,115,222,242,3,17,99,60,188,0,119,71,64,18,204,252,25,11,115,202,248,148,73,133,32,164,225,146,158,15,73,23,227,131,151, - 160,148,232,34,9,196,35,166,189,114,242,224,180,13,249,61,234,122,50,172,73,73,101,61,172,145,201,176,70,38,194,26,148,172,209,150,148,236,130,155, - 73,80,153,148,84,38,2,27,153,12,108,100,34,176,145,137,32,70,38,3,27,185,253,182,59,29,61,80,165,90,160,202,111,13,145,22,198,136,151,167, - 118,96,11,166,0,176,38,5,44,129,183,78,13,91,47,18,194,7,201,50,105,3,204,68,180,94,82,233,48,191,155,135,13,88,57,155,140,172,8,161, - 160,9,224,32,158,141,141,23,90,249,148,40,194,23,44,170,113,103,113,143,24,54,114,174,97,53,41,79,147,19,82,197,86,124,208,194,71,179,233,249, - 237,50,220,29,21,4,57,42,76,177,226,62,74,158,79,15,219,103,53,151,36,37,96,87,207,138,99,21,154,147,103,18,178,139,36,20,39,38,115,220, - 227,16,235,89,159,94,53,247,118,0,137,195,42,252,62,181,247,91,207,79,242,132,196,27,142,110,79,169,165,207,78,45,93,157,13,33,249,242,20,40, - 181,2,132,208,167,21,176,231,10,56,37,155,62,59,217,116,185,0,132,160,227,114,34,42,191,113,233,148,48,248,204,132,193,189,140,15,127,65,201,201, - 248,28,97,159,39,73,125,132,59,97,191,47,245,57,37,164,62,59,33,117,69,125,142,158,98,44,149,58,37,21,30,58,169,112,79,43,164,204,201,10, - 29,251,220,148,172,236,63,157,210,12,15,148,102,184,239,22,196,201,15,191,26,7,82,242,132,253,190,137,201,167,52,214,103,166,177,150,236,241,177,83, - 27,100,34,113,237,148,138,248,236,84,196,61,173,208,198,55,38,157,172,208,139,122,0,121,226,159,123,71,193,167,84,215,103,166,186,150,236,177,58,182, - 7,168,28,253,58,165,43,30,40,93,113,95,43,116,226,161,175,228,1,248,11,155,79,216,239,155,21,116,74,135,125,110,58,236,234,113,148,183,199,126, - 0,22,252,41,165,241,176,41,141,251,62,131,23,39,19,116,228,77,80,104,191,56,37,57,30,62,201,113,79,39,28,232,180,2,94,139,0,5,123,194, - 126,95,2,116,74,162,125,102,18,109,201,30,235,29,249,207,198,183,102,71,117,143,170,176,173,106,223,95,67,173,94,249,61,202,118,254,230,210,234,59, - 95,13,88,135,182,94,74,54,186,160,160,197,78,168,129,63,81,154,180,158,75,81,166,1,183,100,164,6,1,131,78,4,229,45,65,18,140,13,26,36, - 72,11,80,36,231,5,51,40,40,158,2,169,5,45,229,119,191,42,67,40,201,223,98,143,214,249,155,64,192,232,156,214,130,51,147,2,88,156,112,174, - 36,155,231,42,4,169,100,73,170,112,187,33,184,68,150,65,105,13,116,140,223,176,76,152,116,29,101,198,107,17,223,166,204,250,6,141,136,237,192,43, - 145,182,81,166,2,124,84,236,15,137,32,3,191,117,89,88,232,155,225,111,38,17,10,62,84,22,239,98,150,96,94,70,241,120,136,35,137,248,46,102, - 43,36,136,59,35,1,143,22,40,190,139,25,220,79,145,42,201,226,19,6,84,73,69,150,218,92,138,149,96,53,127,131,95,196,209,40,131,182,83,136, - 167,94,233,93,250,18,200,180,198,198,159,23,121,161,242,163,239,125,39,181,195,118,242,59,18,186,227,221,107,168,125,85,199,227,214,58,41,226,47,141, - 53,214,199,55,103,219,76,192,110,57,65,44,115,82,6,135,137,33,161,172,83,129,69,1,51,204,111,92,151,78,113,226,33,230,17,246,53,68,45,201, - 80,153,231,136,15,102,206,123,169,64,232,51,97,160,76,252,134,109,132,131,70,73,15,155,197,54,217,4,88,39,230,95,132,168,128,21,20,186,136,240, - 2,81,34,116,7,90,109,141,181,176,223,153,55,66,4,142,13,65,253,37,214,140,107,192,30,6,86,95,23,141,27,226,143,248,210,110,222,102,116,32, - 125,234,255,219,59,183,221,56,138,32,12,191,202,42,185,33,146,89,250,124,144,200,5,226,54,47,97,133,0,145,0,9,115,16,240,244,124,127,117,175, - 119,188,51,14,227,36,128,192,78,46,226,148,187,102,122,186,78,127,85,247,76,13,71,216,72,179,14,166,255,53,166,50,184,241,254,93,52,198,25,96, - 92,114,43,243,116,250,206,185,168,73,81,65,52,157,96,134,155,249,56,114,45,22,34,105,113,120,136,164,169,167,174,251,12,110,44,175,144,25,137,234, - 42,6,111,150,64,158,205,211,104,147,38,246,97,48,100,185,177,65,177,47,64,155,89,178,64,133,123,68,86,22,32,89,90,52,91,75,53,100,173,127, - 170,69,153,18,70,199,144,138,227,208,151,198,201,163,202,176,232,24,186,203,38,59,108,54,216,167,217,21,114,218,20,39,209,108,67,194,155,95,147,78, - 126,135,73,189,254,155,140,106,241,13,105,173,105,202,27,189,22,78,95,220,255,16,200,148,247,117,185,24,212,255,91,75,5,156,110,150,118,131,48,124, - 45,227,235,229,61,128,132,194,164,234,235,229,175,136,61,46,55,181,30,145,255,71,113,189,33,28,141,205,184,107,139,61,153,60,39,116,243,20,165,181, - 140,66,67,4,47,181,234,33,233,220,49,58,171,144,18,177,41,47,90,208,221,201,146,100,20,138,123,109,244,108,184,152,210,134,98,194,84,118,124,60, - 127,167,118,37,2,113,204,110,163,165,202,243,55,250,243,250,73,187,222,75,187,154,206,3,224,92,154,116,166,232,88,116,52,157,1,121,7,82,111,211, - 25,80,136,157,138,87,30,140,239,235,166,73,181,0,36,162,233,28,168,216,219,200,134,122,4,97,32,220,61,42,135,210,228,163,211,209,253,52,78,232, - 161,111,41,216,72,194,2,42,41,124,209,149,134,199,108,196,136,74,22,145,74,233,174,143,129,76,163,54,57,76,151,67,45,214,204,162,225,49,123,152, - 135,254,92,17,46,242,71,185,216,58,173,96,245,68,219,234,217,118,245,118,216,167,159,214,162,33,185,240,164,159,31,87,63,55,69,44,109,240,68,27, - 3,196,192,220,90,194,8,170,4,218,50,212,19,104,77,208,177,70,36,4,213,1,188,5,146,147,193,228,18,249,57,200,167,245,226,155,57,79,124,30, - 161,62,122,171,95,118,213,123,164,96,168,34,142,118,210,116,250,126,91,235,54,245,171,184,247,119,127,167,241,26,251,242,217,185,99,175,173,243,70,176, - 6,201,254,194,53,63,5,247,19,130,253,226,51,239,103,222,155,183,223,188,253,225,250,59,139,41,2,37,173,102,252,251,76,48,34,202,11,236,18,28, - 1,4,102,235,20,67,238,89,68,41,65,64,18,52,194,79,121,16,242,0,155,164,193,173,118,35,37,53,211,48,180,73,34,211,149,88,145,135,19,60, - 12,110,54,187,226,96,179,119,202,66,96,213,234,81,209,38,17,102,132,164,124,44,217,54,10,88,124,229,66,130,154,213,170,132,193,248,7,204,172,8, - 46,22,165,32,136,151,9,11,101,54,175,80,101,56,177,87,252,79,36,42,233,94,162,12,120,73,38,175,22,29,6,27,209,145,129,46,85,142,30,92, - 45,48,117,67,151,103,38,230,15,180,234,54,34,37,50,191,50,80,101,138,222,50,32,71,52,114,109,162,202,49,207,124,194,147,62,4,43,90,38,31, - 213,44,76,161,83,39,169,162,50,70,157,193,244,134,39,203,88,149,88,79,96,50,43,196,29,116,4,8,100,216,102,226,22,108,45,117,214,167,244,187, - 114,91,40,221,157,238,236,107,84,248,190,9,254,102,178,148,234,139,127,57,231,63,117,245,90,103,151,33,214,181,226,223,183,44,95,77,75,80,111,42, - 4,19,39,170,135,64,250,222,202,160,33,75,75,182,81,193,68,178,93,205,26,82,51,92,47,37,27,148,60,34,89,83,204,12,70,82,171,5,47,26, - 9,148,74,60,162,41,53,80,63,153,5,15,174,164,69,215,154,145,208,251,156,117,154,156,219,135,49,169,76,242,129,150,197,105,4,11,206,32,216,86, - 141,208,80,28,59,81,102,7,125,45,107,33,101,151,117,168,0,229,199,36,251,208,179,81,116,87,145,26,123,116,141,56,43,173,196,226,179,226,250,24, - 231,172,182,97,214,190,224,196,32,34,113,57,218,179,116,153,187,208,97,97,152,211,244,121,240,164,194,68,57,45,75,157,86,155,143,77,47,145,246,96, - 153,101,118,36,122,234,88,69,66,89,130,209,42,94,89,77,193,236,126,205,216,141,173,6,178,185,168,137,118,176,168,171,65,131,106,5,58,68,13,139, - 37,130,55,150,140,115,162,89,14,6,255,93,161,33,63,143,184,68,83,99,44,227,12,145,137,249,8,109,50,234,21,215,193,72,2,211,84,12,82,83, - 65,242,60,235,183,21,107,5,130,136,214,170,115,178,103,132,145,175,250,173,91,210,94,41,88,40,167,43,189,188,87,88,134,40,39,151,42,63,95,233, - 173,193,64,62,125,208,158,43,108,222,31,141,9,31,85,45,161,212,235,104,202,212,15,218,153,0,126,147,187,251,200,2,247,78,242,24,143,201,86,211, - 15,110,227,67,51,58,233,166,104,140,175,120,21,34,23,90,18,148,217,50,23,198,235,188,232,16,131,118,31,198,44,131,48,87,183,23,210,228,152,66, - 210,171,45,140,142,158,149,49,90,1,200,119,104,210,51,63,151,213,24,181,65,169,61,94,111,126,158,213,18,13,167,171,83,229,170,5,105,187,38,29, - 116,112,229,202,183,49,99,155,169,243,173,187,241,6,156,98,116,3,218,97,187,4,235,96,85,34,29,73,77,229,228,173,141,82,78,43,234,112,179,190, - 212,65,52,65,36,107,123,153,71,209,137,129,57,154,26,221,225,195,63,163,238,4,178,73,236,165,0,7,83,233,37,207,75,241,107,175,55,57,227,93, - 70,214,205,3,61,91,25,243,66,204,85,101,92,173,100,158,55,172,177,217,169,153,33,197,51,171,118,169,170,75,169,79,86,19,101,178,66,196,228,236, - 81,167,96,209,187,118,193,170,122,28,49,36,76,154,234,196,248,124,108,36,150,56,89,245,146,169,80,202,197,124,5,102,154,34,217,156,27,246,120,48, - 0,205,4,198,51,148,226,202,168,152,164,53,111,143,221,228,41,34,202,100,213,150,158,8,229,243,249,37,153,131,176,251,148,203,201,53,74,153,28,11, - 60,36,234,212,103,14,26,49,46,5,19,125,5,96,169,14,153,199,250,182,83,108,147,207,209,142,158,162,54,225,30,247,98,67,90,239,214,167,13,191, - 17,186,93,106,248,28,171,190,183,19,43,222,145,236,66,103,10,8,227,209,174,238,85,240,52,69,102,202,78,161,50,15,235,55,210,237,100,29,154,233, - 172,220,83,193,138,201,238,138,78,214,24,76,191,49,162,81,104,178,155,137,52,53,94,171,86,180,33,46,90,140,10,199,162,85,109,252,24,43,70,202, - 106,138,150,167,117,222,50,2,108,178,150,49,154,183,40,214,167,174,54,128,68,145,165,107,186,213,218,135,197,33,22,127,108,167,240,207,106,56,205,86, - 40,7,111,217,6,70,192,207,226,86,184,64,181,26,150,218,158,202,247,204,103,4,35,129,149,162,156,88,77,217,147,34,153,6,97,117,85,253,178,192, - 31,77,106,43,196,171,71,108,39,103,96,16,184,248,146,228,54,129,22,209,198,228,238,48,94,249,219,142,131,172,134,148,103,16,152,174,21,2,158,60, - 215,100,190,92,149,64,11,132,64,48,86,216,170,101,242,207,134,83,46,98,170,26,99,90,113,49,131,155,250,136,169,196,69,201,194,198,9,253,25,109, - 21,141,19,240,172,180,65,195,48,198,40,34,151,171,147,211,171,166,121,55,140,3,141,246,165,109,77,181,65,44,116,95,107,189,94,63,240,216,193,35, - 174,51,160,216,163,176,32,181,15,35,183,146,105,41,248,204,92,30,164,65,172,150,5,8,36,88,46,47,174,237,228,42,252,117,114,245,78,29,216,213, - 17,214,245,7,188,106,244,188,181,118,221,242,229,247,104,70,71,216,22,255,211,125,21,119,201,24,63,133,117,235,221,125,111,77,53,157,183,116,89,101, - 236,26,133,3,110,169,246,110,37,198,108,213,248,91,170,118,196,130,48,41,180,98,128,33,222,161,233,234,246,145,132,5,113,114,199,113,201,21,181,143, - 142,166,128,242,119,211,94,45,169,167,27,125,121,135,120,154,81,31,63,73,111,111,103,190,245,228,23,106,171,6,244,145,136,240,17,107,78,167,189,207, - 181,243,250,224,109,220,169,181,97,117,82,225,167,31,127,185,190,121,243,24,90,25,123,55,132,111,14,137,60,92,24,235,213,130,26,166,164,173,78,164, - 186,73,34,212,222,67,133,171,168,204,25,55,122,28,187,123,122,28,47,250,97,126,127,253,243,205,219,223,62,33,92,121,46,151,174,156,254,18,230,1, - 128,150,76,182,72,184,87,75,210,80,122,122,113,217,254,148,156,239,240,5,240,92,91,114,196,70,119,0,1,31,14,74,61,182,232,99,252,31,107,53, - 189,249,253,229,51,13,220,248,205,111,47,159,133,227,198,47,180,131,228,183,232,48,164,101,15,228,197,139,230,247,118,41,221,56,156,243,252,181,115,251, - 221,243,181,53,231,190,84,244,144,192,74,0,222,71,169,232,23,117,198,235,155,125,245,72,141,123,128,148,222,124,29,122,232,31,84,117,242,235,170,211, - 227,150,220,194,98,234,14,3,251,75,147,188,215,134,87,102,255,81,188,202,67,157,27,215,75,218,51,122,113,214,79,5,212,251,91,102,3,56,122,110, - 251,90,102,131,77,86,239,180,29,221,131,154,102,91,126,35,191,255,8,79,246,221,162,27,159,207,170,104,235,130,74,157,221,249,183,111,222,126,243,237, - 207,47,159,229,227,157,207,41,160,119,231,49,232,90,177,84,117,167,152,9,23,190,230,80,30,252,33,201,39,137,238,147,104,89,75,52,174,36,234,151, - 194,244,97,41,205,115,141,94,14,102,233,145,228,87,244,255,77,65,75,15,238,185,232,250,166,115,98,62,111,205,255,93,77,207,159,148,231,239,80,158, - 7,9,250,73,40,255,180,69,215,181,225,244,135,88,116,219,41,104,59,107,252,249,103,63,253,202,63,127,2,80,75,3,4,20,0,2,0,8,0,131, - 128,249,52,23,55,187,63,234,22,0,0,20,138,0,0,13,0,0,0,101,100,105,116,45,102,105,110,100,46,115,118,103,236,93,109,115,226,72,146,254, - 62,191,130,163,191,140,99,65,212,251,139,187,221,27,179,61,55,19,123,49,123,23,177,51,19,247,89,6,129,217,198,224,19,184,109,247,175,191,204,146, - 144,170,68,9,132,49,211,179,14,67,116,180,72,149,234,37,243,169,204,172,84,86,249,195,95,31,111,23,189,47,89,190,158,175,150,87,125,154,144,126, - 47,91,142,87,147,249,114,118,213,255,253,183,159,134,166,223,91,111,210,229,36,93,172,150,217,85,127,185,234,255,245,227,119,31,254,99,56,236,125,202, - 179,116,147,77,122,15,243,205,77,239,239,203,207,235,113,122,151,245,190,191,217,108,238,46,71,163,135,135,135,100,94,18,147,85,62,27,93,244,134,67, - 120,114,253,101,246,93,175,215,131,102,151,235,203,201,248,170,95,150,191,187,207,23,174,220,100,60,202,22,217,109,182,220,172,71,52,161,163,126,93,124, - 92,23,127,200,174,147,60,91,175,238,243,113,81,253,120,236,151,204,39,211,186,40,244,228,129,187,66,212,90,59,34,108,196,216,16,74,12,215,79,203, - 77,250,56,92,174,223,121,143,66,7,99,143,50,66,200,8,238,213,37,187,149,186,124,92,0,27,90,59,227,238,250,173,3,235,239,224,95,245,192,150, - 144,20,99,157,194,147,89,178,204,54,163,31,127,251,177,186,57,36,201,100,51,241,170,217,114,62,104,55,16,199,50,189,205,214,119,233,56,91,143,182, - 116,247,252,246,199,101,246,120,183,202,55,195,167,201,29,116,198,146,132,184,79,180,204,99,135,50,211,249,34,195,54,175,250,163,155,213,109,54,90,111, - 178,47,217,114,148,77,230,120,111,57,25,10,147,220,45,11,198,109,135,117,57,89,141,139,103,170,98,201,150,185,126,153,235,116,93,213,251,175,249,237, - 109,58,30,173,243,241,104,252,101,61,2,232,206,86,195,249,120,181,28,110,110,50,108,119,156,46,210,235,69,54,74,199,27,192,252,58,236,108,53,19, - 72,34,248,95,38,208,197,69,216,154,87,128,179,226,217,201,85,31,58,197,132,117,63,111,178,249,236,102,115,213,135,225,20,220,184,123,116,244,135,249, - 100,115,19,146,63,2,253,195,36,155,174,241,126,81,17,254,226,238,6,220,202,211,201,60,93,252,140,255,193,108,40,10,121,125,29,175,22,139,108,12, - 77,165,139,135,244,169,24,8,126,28,164,46,111,242,12,166,192,59,184,206,210,124,91,135,36,138,84,229,176,189,176,9,73,56,173,110,207,74,226,239, - 203,249,6,176,126,191,206,242,95,17,47,255,179,252,125,157,237,148,250,45,79,151,107,0,231,237,85,255,54,221,228,243,199,239,135,44,209,90,112,99, - 7,4,190,52,177,202,106,162,6,148,2,93,49,62,24,26,205,18,99,164,184,168,42,27,63,94,245,21,145,137,166,130,217,154,250,132,108,83,137,18, - 218,212,212,105,180,236,52,90,54,7,205,70,117,2,37,141,234,247,70,37,123,67,214,116,102,47,178,45,194,213,143,229,253,15,235,205,234,110,91,22, - 128,179,121,90,0,54,145,56,132,26,87,249,229,245,34,29,127,126,239,8,43,224,231,124,243,116,73,223,247,235,39,86,211,233,58,131,102,137,71,115, - 24,131,39,160,37,86,13,224,121,109,145,88,91,52,222,150,168,153,53,10,135,252,237,16,234,9,251,84,132,198,1,58,164,198,210,68,241,63,47,66, - 35,0,20,166,255,226,160,136,3,80,146,118,0,122,165,84,172,194,68,246,143,159,25,127,24,220,37,59,4,247,103,106,140,189,112,7,201,237,19,44, - 211,127,0,220,89,66,181,141,193,253,145,94,245,57,1,170,212,180,150,221,19,82,85,19,194,143,44,90,150,225,36,176,9,2,71,159,65,247,10,41, - 88,119,232,191,43,108,239,51,181,47,180,37,142,129,99,180,181,206,128,132,214,212,51,1,185,195,37,42,149,106,101,211,182,65,44,36,162,211,150,120, - 126,93,235,96,167,238,211,96,237,246,209,247,135,149,6,54,31,211,26,180,99,243,6,191,7,155,63,206,144,65,215,210,249,44,159,240,192,0,48,146, - 192,156,161,129,250,87,34,145,74,7,10,93,38,76,234,192,26,52,31,156,70,30,220,63,203,91,120,24,67,109,132,71,63,17,252,246,99,188,151,154, - 183,139,232,72,81,216,20,191,173,162,136,55,47,61,17,133,210,232,38,34,118,80,68,148,34,171,141,104,202,72,29,148,209,206,147,223,74,72,74,125, - 83,33,41,115,72,72,93,21,18,83,246,144,58,98,154,60,95,25,165,28,191,207,87,70,76,211,231,171,34,49,198,239,115,85,81,103,22,202,195,44, - 84,39,176,112,154,226,247,4,22,170,19,88,120,237,62,47,172,205,79,240,211,16,175,237,171,18,48,93,158,22,57,213,79,35,224,154,25,166,249,96, - 43,168,250,2,88,192,153,86,122,192,19,46,185,148,88,70,9,37,132,14,151,40,38,49,76,8,106,73,160,0,121,162,165,162,204,200,64,225,237,150, - 157,70,203,130,182,228,26,168,84,211,218,84,156,131,213,242,16,171,205,233,172,198,40,80,230,56,77,132,229,200,87,65,41,103,33,23,57,135,251,202, - 55,206,142,139,176,162,227,202,210,208,108,236,150,157,70,203,2,23,97,241,167,137,17,222,66,234,12,92,44,60,190,189,124,84,230,207,5,89,42,184, - 179,112,62,179,117,194,20,44,50,148,110,64,182,89,118,26,45,139,144,133,178,210,40,43,15,49,123,215,25,136,25,254,105,87,223,34,230,132,236,227, - 31,99,176,26,139,241,175,186,37,18,69,185,100,22,24,105,181,53,196,92,28,41,190,93,16,48,102,120,28,76,13,151,170,21,137,221,152,170,247,122, - 188,211,142,46,245,191,11,75,229,30,150,242,147,89,122,138,82,112,139,229,246,190,195,109,19,114,91,36,156,128,8,100,24,233,98,9,209,192,174,80, - 128,59,69,167,177,162,24,231,146,96,112,168,164,162,131,16,105,68,118,181,16,141,0,205,90,83,56,92,1,56,58,11,241,232,48,155,16,130,28,114, - 185,160,12,235,31,237,243,235,9,126,79,9,125,189,187,166,248,237,224,207,123,209,184,93,87,204,27,134,57,236,226,65,41,241,124,31,79,25,252,158, - 219,77,22,128,234,195,66,107,137,87,118,26,135,102,118,58,110,4,62,0,157,68,27,193,169,120,223,133,141,158,75,115,52,27,227,205,43,173,192,165, - 147,47,201,71,48,172,7,7,226,185,201,157,193,31,13,28,117,98,219,41,139,180,88,171,32,53,81,240,237,5,217,166,245,97,157,127,120,164,207,224, - 107,75,172,179,3,95,13,61,16,163,236,30,235,124,169,197,46,7,103,175,187,50,108,129,84,183,48,47,180,213,65,247,49,174,69,87,173,218,29,126, - 128,61,64,32,59,78,245,31,136,188,118,155,34,222,184,200,139,73,205,136,99,164,102,82,252,30,101,194,246,140,195,236,179,96,177,168,141,193,239,75, - 113,209,72,242,199,71,41,66,101,19,89,243,189,224,219,164,253,174,25,215,176,32,28,12,49,182,64,137,50,217,16,28,53,102,18,11,75,65,115,209, - 244,49,41,39,132,154,112,145,173,97,69,169,45,99,77,39,179,81,118,26,45,139,94,166,74,36,51,138,177,147,223,57,237,11,85,32,190,247,189,117, - 57,250,101,53,190,112,99,58,1,109,199,5,13,94,184,49,24,144,33,204,170,240,133,27,77,56,151,214,123,111,243,228,94,195,37,82,106,173,207,58, - 120,231,13,239,27,252,11,230,146,224,40,133,180,241,248,2,179,148,89,54,24,42,88,196,113,35,224,74,39,66,17,37,77,243,69,102,162,164,98,146, - 132,47,50,69,210,152,197,142,175,28,116,177,209,126,217,130,219,4,43,32,103,5,21,87,251,65,197,249,51,64,69,13,240,137,41,205,131,193,83,158, - 40,194,168,183,160,198,193,83,141,70,204,88,30,12,158,201,68,11,142,30,222,57,87,168,232,173,239,211,96,252,88,13,134,58,6,7,47,136,109,100, - 108,48,154,24,10,139,211,48,182,180,91,118,26,45,139,129,60,88,242,130,158,151,244,188,28,81,251,117,58,127,201,132,24,9,3,87,28,103,144,6, - 73,19,146,13,153,24,12,93,14,139,16,220,253,98,9,147,160,212,129,12,136,32,210,106,137,57,4,137,21,148,144,80,181,195,74,95,80,193,117,35, - 84,198,19,92,26,145,48,126,176,91,118,26,45,11,108,87,229,52,222,206,194,15,35,204,154,115,87,85,154,30,102,13,78,190,204,179,135,239,66,1, - 60,204,151,147,213,195,16,163,133,91,182,53,239,97,124,177,90,143,53,111,110,179,251,76,165,135,155,37,202,60,63,74,232,78,137,201,106,124,143,121, - 173,195,251,66,62,101,102,160,87,98,150,207,39,195,235,235,21,244,97,147,223,111,69,182,190,89,61,224,157,128,88,99,234,62,207,177,210,69,250,148, - 1,119,220,127,59,77,59,198,139,196,26,98,5,223,185,249,232,102,183,229,70,147,157,129,127,93,173,110,107,231,191,34,223,165,179,108,125,147,194,136, - 225,217,216,205,210,133,114,78,90,121,255,122,149,79,178,220,187,193,164,176,132,86,172,44,238,59,119,12,166,129,114,159,242,22,214,184,189,81,184,187, - 253,58,105,18,211,63,155,93,64,158,249,125,156,166,139,42,228,243,225,54,219,164,147,116,147,214,85,108,41,162,202,189,156,76,47,255,249,227,79,149, - 251,56,30,95,254,239,42,255,92,123,122,88,32,189,94,221,3,24,42,23,23,211,57,199,151,56,165,210,205,199,249,45,52,143,185,192,127,121,188,93, - 0,70,171,27,65,225,205,211,93,86,87,90,84,187,205,107,142,230,70,79,198,183,115,124,104,244,235,102,190,88,252,29,27,241,220,220,178,210,249,102, - 145,125,252,207,201,124,211,251,9,80,233,26,47,104,65,177,245,253,245,191,64,27,125,244,218,119,227,254,91,58,243,105,37,117,49,255,136,89,184,31, - 70,229,143,104,137,169,107,110,95,137,197,106,156,110,178,253,101,214,160,255,198,55,177,50,5,45,232,160,27,221,206,80,80,96,139,249,56,91,174,15, - 179,119,140,137,236,243,47,0,176,219,219,213,114,237,56,93,62,187,30,93,63,13,215,233,136,37,100,180,195,102,247,220,42,15,250,7,205,254,48,171, - 124,252,93,161,252,234,210,158,123,63,167,121,14,98,140,73,6,71,180,91,139,43,185,211,160,147,162,27,204,78,223,86,75,80,233,215,247,199,246,239, - 191,210,207,247,215,61,232,37,24,161,252,216,238,237,182,233,202,226,196,241,39,210,47,77,185,120,115,169,155,72,10,121,132,210,190,203,114,152,25,235, - 131,210,142,237,28,248,103,118,151,175,38,247,46,35,60,20,243,137,21,255,56,95,23,44,137,85,156,103,255,119,63,135,39,158,85,243,127,175,54,192, - 143,151,173,243,135,77,123,103,79,226,66,150,207,191,56,121,34,20,214,47,219,233,95,111,210,60,251,97,49,255,236,51,195,225,174,196,89,149,176,82, - 171,244,15,163,173,194,119,191,102,59,102,120,117,127,119,187,154,100,165,57,245,108,77,220,188,46,210,235,108,113,213,255,213,25,155,173,9,153,125,23, - 6,27,38,243,245,29,60,126,57,95,162,135,23,248,116,51,73,188,229,235,38,226,152,81,37,97,57,9,14,88,153,189,41,140,212,206,33,27,8,240, - 145,136,86,3,193,18,101,192,27,188,168,35,46,57,168,196,154,167,96,114,135,84,194,34,8,150,230,126,34,238,163,163,75,139,126,29,247,232,213,78, - 6,13,142,174,212,212,143,81,111,189,28,206,45,166,74,203,70,8,4,27,22,84,243,221,24,88,29,235,18,132,17,69,141,124,239,231,238,78,193,166, - 93,130,181,251,254,221,110,34,236,133,187,235,197,243,220,207,252,126,145,93,46,87,203,175,224,89,188,135,201,182,250,236,126,102,229,117,225,143,93,210, - 237,79,172,22,68,118,9,18,94,78,124,226,191,86,243,229,37,32,60,203,223,223,166,249,231,44,47,106,41,174,135,235,77,154,111,2,202,237,124,18, - 252,206,150,147,160,93,87,213,98,14,255,93,138,45,109,146,130,59,146,231,128,1,191,36,82,139,152,210,37,217,210,234,65,126,153,175,231,215,243,5, - 254,112,151,139,236,125,8,164,247,171,47,89,62,93,172,30,182,247,253,105,112,151,110,110,60,25,84,238,49,96,27,157,8,112,66,199,240,105,72,15, - 31,130,101,141,47,111,160,254,163,55,100,20,164,13,203,98,204,26,70,32,25,194,77,239,83,11,221,163,114,166,193,103,39,130,198,137,80,131,86,176, - 224,128,21,190,0,178,73,164,36,70,245,40,174,56,13,21,106,192,24,192,197,16,45,183,52,110,6,198,36,248,58,147,75,120,188,166,14,97,54,72, - 205,56,97,189,33,172,225,149,148,130,123,189,82,45,125,253,218,59,1,169,187,59,20,222,144,122,50,82,79,148,1,167,111,50,232,40,131,230,36,175, - 76,65,99,146,71,233,30,213,155,228,49,34,214,160,9,24,50,166,164,55,201,135,248,198,3,138,48,233,205,114,143,232,79,115,143,236,207,115,170,133, - 76,24,149,58,152,231,209,238,6,243,188,86,117,129,105,107,85,146,117,56,127,86,248,16,51,223,121,216,103,228,15,58,22,13,63,226,111,222,130,118, - 235,115,208,106,101,234,25,245,178,209,240,21,92,219,172,112,169,115,205,105,81,189,224,104,157,30,45,53,169,139,198,156,169,106,234,52,119,2,170,143, - 254,102,53,62,222,155,247,118,71,113,218,100,220,51,123,174,97,221,250,185,125,242,108,157,30,12,199,213,33,172,210,75,226,34,193,80,178,23,98,174, - 92,43,146,88,70,132,173,99,158,143,46,190,69,184,148,172,6,165,203,199,116,73,115,94,78,95,142,33,157,132,10,152,19,254,158,177,110,240,112,195, - 125,25,36,40,243,134,132,40,18,148,151,125,189,69,2,238,193,146,198,11,35,111,145,192,49,130,170,184,9,144,0,186,19,42,145,60,64,130,72,164, - 225,182,137,4,82,34,193,203,181,203,31,3,114,133,144,89,100,157,225,46,23,233,6,115,98,139,236,204,193,144,39,218,26,203,113,145,113,17,174,86, - 24,230,230,87,150,123,22,170,212,25,245,95,12,85,32,116,176,219,190,170,62,22,121,239,66,105,199,80,226,181,184,121,102,50,160,85,154,24,10,23, - 76,8,171,217,133,31,96,136,7,246,91,98,242,97,14,152,159,185,72,172,13,239,120,185,163,36,184,179,205,71,109,140,205,79,151,108,86,54,109,173, - 172,219,126,149,200,123,242,182,92,137,174,123,87,130,13,36,34,216,62,119,160,53,122,184,53,161,241,219,222,154,10,3,13,209,29,43,17,223,211,107, - 171,242,15,131,70,156,159,196,120,34,152,113,111,32,221,91,10,184,2,23,197,167,202,132,8,14,84,124,119,180,165,225,166,73,6,52,88,132,24,41, - 67,26,172,99,116,98,12,109,148,84,9,51,172,174,177,73,171,219,246,169,48,167,172,194,146,88,99,65,35,54,1,84,135,109,87,180,79,126,47,43, - 170,63,26,172,177,73,219,182,29,184,85,181,99,69,195,36,194,163,103,145,36,71,204,162,50,91,152,176,216,44,210,71,206,162,120,101,127,146,89,36, - 217,31,57,139,164,248,99,102,145,42,193,20,206,34,85,78,34,127,22,185,157,199,142,86,35,185,166,249,179,200,43,89,205,141,186,70,143,230,181,237, - 81,203,73,228,207,34,89,78,13,191,237,154,230,207,162,154,234,141,166,156,68,36,58,238,214,89,36,131,93,127,163,217,254,53,115,155,251,143,201,254, - 23,221,86,193,7,236,171,147,156,77,172,133,149,19,177,3,6,151,176,206,98,10,198,95,83,57,174,217,165,228,4,104,138,105,240,81,41,210,180,6, - 238,74,160,193,170,13,174,124,218,167,158,73,52,35,70,24,238,81,77,185,109,132,149,53,114,66,61,154,223,118,64,21,214,192,220,118,53,82,162,13, - 65,26,229,84,90,237,181,93,211,62,121,189,244,75,122,99,20,214,82,198,162,227,142,46,43,113,83,43,57,24,225,216,35,45,121,22,105,81,88,80, - 43,77,117,40,45,124,129,207,96,133,236,75,11,16,206,12,40,65,95,90,53,205,151,86,77,173,101,80,215,24,208,170,182,3,42,161,28,26,240,164, - 5,51,174,112,67,253,182,43,154,47,45,191,164,55,26,168,17,92,184,232,184,91,165,165,155,75,252,134,208,124,145,237,46,160,0,177,114,199,143,197, - 151,125,171,201,164,197,143,45,214,75,176,6,52,160,74,56,221,9,59,93,223,111,54,45,81,167,14,235,165,186,99,132,106,41,184,241,82,107,28,40, - 192,166,75,130,81,148,129,4,116,11,166,149,234,253,226,81,5,40,41,66,76,99,235,99,193,45,165,107,219,24,143,152,212,204,124,97,30,86,233,174, - 93,214,156,47,197,66,88,165,43,109,188,148,182,130,131,172,76,247,5,14,18,70,36,149,2,57,88,81,241,221,12,55,140,153,40,7,69,55,14,54, - 2,77,157,223,82,201,150,232,210,63,210,217,114,62,125,154,47,103,189,159,23,233,122,155,133,20,15,96,237,89,51,214,123,255,8,124,105,124,239,95, - 113,193,18,174,184,98,166,186,181,179,160,148,188,237,181,85,123,16,227,157,189,198,111,19,66,18,237,174,150,246,168,136,239,55,140,89,224,182,37,106, - 52,229,220,124,179,168,69,16,183,48,106,247,77,31,99,69,247,69,228,5,97,44,17,186,72,233,114,84,223,137,6,223,218,70,74,151,161,10,152,63, - 74,88,255,173,97,17,218,32,74,114,75,140,167,160,223,80,242,237,81,98,206,137,18,74,147,55,148,188,2,148,88,114,86,148,240,55,148,188,10,148, - 176,179,162,68,190,161,228,85,160,68,156,21,37,250,13,37,175,2,37,103,245,94,169,125,67,201,171,64,201,89,189,87,246,230,189,190,6,148,104,114, - 86,239,149,189,121,175,175,2,37,60,226,189,218,196,98,223,37,63,2,37,34,177,248,105,162,164,213,123,37,202,48,34,24,183,111,48,249,183,128,201, - 11,57,38,45,48,121,115,76,94,7,74,204,57,81,194,223,28,147,87,129,18,65,206,138,146,55,199,228,117,160,132,157,21,37,111,97,181,215,129,146, - 72,88,13,143,99,128,190,211,23,64,73,123,88,141,40,98,165,100,29,80,82,231,99,204,130,247,198,84,235,125,219,38,73,162,160,42,173,163,105,191, - 229,45,24,169,53,74,72,76,36,129,70,185,244,246,79,182,236,158,195,23,244,87,253,52,31,239,219,52,70,53,165,140,89,243,190,235,230,140,221,13, - 142,145,188,232,70,46,196,201,200,62,207,22,38,186,101,115,247,173,76,135,19,250,79,218,218,180,77,187,16,66,203,216,94,159,248,73,84,126,129,232, - 65,83,94,1,196,116,125,232,84,172,128,219,197,97,57,103,38,152,86,46,145,68,224,217,68,0,67,210,171,26,233,253,208,171,234,235,85,15,246,72, - 143,194,183,167,19,133,41,78,74,13,58,62,16,107,225,235,222,164,121,154,8,161,4,143,39,118,72,252,235,117,100,48,4,81,91,45,36,238,178,114, - 135,131,43,115,113,228,254,211,245,122,60,30,151,255,190,194,39,34,53,102,196,14,199,168,193,20,48,169,240,240,94,119,26,180,192,93,106,20,183,144, - 25,193,125,42,199,228,77,13,107,229,129,77,180,128,113,75,235,209,92,110,39,76,123,204,73,171,169,76,37,196,37,152,249,53,50,220,234,76,165,241, - 219,174,104,159,122,96,89,41,209,148,9,143,10,139,119,170,141,212,100,0,158,55,19,70,43,217,99,192,40,226,142,172,130,53,27,227,68,82,220,29, - 7,84,97,165,165,18,243,28,25,215,220,50,164,41,198,153,212,238,105,16,159,182,61,134,27,226,52,238,106,5,26,136,0,174,122,191,244,184,77,4, - 3,29,66,6,2,101,163,141,192,241,56,153,131,29,118,155,195,165,177,84,203,30,94,17,99,97,140,112,37,96,104,68,245,112,51,157,33,156,186,167, - 161,26,110,44,62,141,123,237,168,226,102,0,181,91,67,173,166,72,131,238,50,28,185,73,40,3,20,105,124,154,105,24,36,71,40,18,169,164,181,216, - 35,150,112,202,53,148,132,81,72,102,169,65,30,65,159,149,96,76,56,14,91,33,45,1,89,144,196,48,232,18,69,154,214,156,81,71,35,96,212,185, - 163,25,128,173,82,197,211,214,10,134,84,145,112,112,130,133,232,129,175,202,53,30,90,56,96,120,74,152,86,138,123,180,64,186,21,181,198,1,182,168, - 148,178,62,94,98,200,250,218,115,136,147,0,123,41,6,208,184,194,179,198,156,220,84,66,45,21,148,123,84,232,39,32,70,51,11,45,225,233,227,48, - 0,143,134,25,139,10,92,36,94,140,168,164,66,61,156,43,197,84,175,192,30,225,46,135,214,74,152,197,198,107,187,166,125,194,84,61,38,44,33,210, - 163,74,0,10,232,48,162,6,128,61,208,118,212,42,143,230,183,93,83,109,162,52,112,83,81,172,17,83,58,169,173,70,67,162,227,222,183,97,186,86, - 217,49,39,110,50,198,239,209,150,46,114,38,0,30,175,215,216,122,134,235,22,105,192,167,121,179,126,221,55,87,159,69,94,237,158,137,120,147,77,22, - 51,102,132,89,156,200,48,255,112,247,39,45,141,25,104,57,229,83,193,68,81,80,123,196,160,18,35,154,107,235,211,80,221,105,176,250,182,48,102,37, - 21,21,10,55,168,238,188,26,25,58,192,204,112,191,237,138,230,140,25,177,160,43,141,71,117,198,12,140,7,115,230,72,43,65,85,97,204,164,85,46, - 193,158,57,115,177,53,102,214,82,167,194,152,2,55,93,20,198,76,43,93,60,109,185,52,210,25,51,240,189,133,198,86,8,35,194,136,210,152,129,163, - 162,185,51,102,218,40,75,11,99,6,102,83,148,39,157,72,46,160,71,104,204,80,157,73,103,224,192,46,129,10,3,115,164,184,226,160,214,208,152,105, - 201,156,242,7,195,5,14,57,177,122,0,245,16,14,230,138,57,99,166,209,204,59,99,6,38,12,188,37,120,26,253,38,77,209,152,81,194,9,227,165, - 49,131,15,30,69,1,198,12,15,72,150,165,49,195,179,55,29,135,193,118,43,148,15,24,51,48,55,133,129,211,232,111,49,103,204,64,13,131,129,196, - 114,184,172,114,230,8,70,12,22,84,203,194,152,89,161,153,51,81,160,199,209,104,162,49,195,63,156,225,209,2,233,86,212,26,7,206,152,25,46,124, - 188,196,144,181,53,102,96,100,96,68,10,4,4,253,21,78,234,34,49,176,58,5,85,191,165,130,140,240,85,6,122,142,3,48,14,28,132,206,3,26, - 166,223,203,242,233,138,202,192,253,100,138,67,91,117,141,24,160,102,133,145,169,218,174,105,120,136,7,24,51,105,193,221,168,169,248,23,49,13,3,46, - 120,53,214,52,191,237,45,213,120,189,172,107,172,199,24,27,119,116,67,128,16,156,188,140,10,141,154,174,221,3,42,222,86,123,47,171,83,65,139,72, - 220,89,37,10,45,2,158,40,110,208,226,136,45,195,113,59,145,77,56,17,146,112,212,44,232,71,115,208,3,206,29,100,202,160,30,32,150,18,116,189, - 113,30,91,238,102,124,140,234,116,3,129,218,157,110,224,20,180,88,148,230,230,7,55,224,134,59,151,88,104,33,172,65,13,8,64,7,231,24,81,143, - 103,84,48,130,52,9,62,184,59,35,7,183,34,129,94,43,180,226,206,120,218,144,219,229,60,139,113,135,117,90,135,72,199,94,232,119,59,102,160,139, - 171,199,249,206,41,3,140,192,234,84,188,65,191,37,208,17,236,158,13,2,29,187,231,251,54,2,29,197,222,45,198,121,107,160,3,255,96,150,145,193, - 170,60,8,116,196,10,20,27,62,13,6,108,193,9,233,85,141,96,220,98,91,220,187,42,227,22,10,150,187,12,140,189,30,116,124,32,214,194,161,64, - 7,115,75,234,248,233,210,197,173,33,110,216,148,232,1,12,21,250,10,4,0,121,48,136,237,29,95,132,225,0,73,236,139,77,146,150,93,80,120,250, - 148,228,246,109,78,196,98,221,160,112,101,36,212,109,17,64,34,200,162,168,206,103,73,192,129,22,218,240,48,212,13,6,131,107,112,207,116,24,234,198, - 195,54,136,81,68,138,70,172,27,15,19,7,27,192,84,35,212,205,192,87,212,220,242,67,135,87,128,19,107,13,254,165,35,133,97,26,61,24,226,33, - 29,198,18,6,36,173,8,56,133,187,208,189,56,77,189,119,141,90,243,103,68,173,223,129,105,44,254,58,103,232,202,104,33,149,149,127,58,236,158,130, - 210,184,102,102,251,52,51,254,9,43,186,71,51,3,28,153,109,13,65,215,103,146,183,104,230,88,129,66,51,203,196,252,127,123,87,146,194,48,12,3, - 239,125,69,30,80,130,181,88,142,160,244,255,207,234,140,27,130,41,110,155,75,111,189,25,37,194,11,178,208,140,45,57,1,130,98,57,58,129,163,61, - 126,31,90,187,163,101,210,111,65,28,82,174,39,21,102,61,124,243,204,6,195,23,159,122,230,253,19,252,177,34,138,103,241,63,214,184,223,178,126,164, - 160,95,61,51,240,18,212,235,249,115,26,203,127,228,254,115,54,132,55,116,129,234,219,202,35,142,236,156,2,208,92,122,154,142,210,109,109,198,231,122, - 132,168,47,196,162,155,221,33,11,62,63,162,189,248,220,32,133,93,178,130,125,48,181,188,106,180,218,19,216,91,201,2,252,143,70,203,234,204,89,229, - 201,134,136,251,147,104,45,38,8,38,136,203,29,176,188,54,142,199,130,181,131,40,107,206,247,47,23,49,168,3,56,142,50,104,39,169,110,13,29,164, - 196,197,205,176,217,251,40,183,42,136,230,177,63,20,129,140,96,60,176,203,146,145,157,75,177,149,1,144,231,21,115,32,231,2,116,194,251,197,78,38, - 103,88,139,217,170,189,193,7,161,211,98,118,55,86,43,191,95,30,80,75,3,4,20,0,2,0,8,0,141,128,249,52,100,188,189,164,140,9,0,0, - 25,36,0,0,13,0,0,0,101,100,105,116,45,117,110,100,111,46,115,118,103,221,89,89,147,219,184,17,126,247,175,96,228,23,187,86,4,113,17,36, - 52,199,150,227,201,166,54,229,36,85,107,187,242,152,162,72,72,162,135,34,21,144,26,73,254,245,105,128,20,143,17,53,135,199,187,78,69,83,83,35, - 52,26,221,192,215,7,186,49,151,63,239,215,153,115,167,116,153,22,249,213,132,32,60,113,84,30,23,73,154,47,175,38,159,63,253,226,134,19,167,172, - 162,60,137,178,34,87,87,147,188,152,252,124,253,234,242,79,174,235,188,215,42,170,84,226,236,210,106,229,252,154,223,150,113,180,81,206,155,85,85,109, - 102,158,183,219,237,80,218,16,81,161,151,222,91,199,117,97,101,121,183,124,229,56,14,168,205,203,89,18,95,77,26,254,205,86,103,150,47,137,61,149, - 169,181,202,171,210,35,136,120,147,142,61,238,216,119,106,142,180,42,139,173,142,107,241,113,220,231,212,201,162,99,133,157,236,152,101,34,82,74,15,83, - 143,82,23,56,220,242,144,87,209,222,205,203,215,189,165,176,193,177,165,20,99,236,193,92,199,249,52,174,217,62,3,24,206,110,198,206,246,181,3,244, - 27,248,109,23,180,24,214,103,93,192,74,133,114,85,121,55,159,110,188,35,183,139,81,82,37,61,49,199,85,3,189,3,115,228,209,90,149,155,40,86, - 101,171,194,174,63,14,102,106,191,41,116,229,30,146,13,108,70,98,132,237,103,148,103,255,4,158,69,154,41,163,243,106,226,173,138,181,242,190,164,235, - 117,20,123,55,170,188,173,138,141,183,75,129,3,109,242,26,185,93,154,84,171,171,9,15,55,123,59,94,169,116,185,170,122,132,52,185,154,0,204,132, - 176,70,221,17,137,89,235,203,24,49,58,220,73,111,138,179,159,18,117,167,178,225,218,164,136,231,81,217,110,177,74,151,74,87,94,124,87,122,11,173, - 84,82,111,213,162,7,17,177,44,220,52,46,114,183,90,129,179,122,160,33,139,230,153,242,162,184,2,29,229,137,224,250,236,42,73,43,119,155,39,5, - 58,58,73,187,187,98,91,109,182,213,191,213,190,82,121,189,77,80,212,179,153,157,54,203,90,218,228,26,4,92,38,106,81,26,65,53,40,102,196,236, - 4,76,129,111,169,72,255,85,71,73,10,225,84,51,245,52,198,69,150,169,24,96,141,178,93,116,168,183,124,148,51,92,74,25,21,141,80,16,91,2, - 10,71,94,56,100,117,200,224,100,134,232,130,196,66,207,94,47,236,231,194,146,10,240,177,180,58,204,200,197,164,91,83,44,22,165,2,197,184,71,179, - 38,133,21,160,11,114,142,247,50,109,120,76,27,25,213,198,112,171,237,210,27,30,251,251,195,72,158,3,99,204,35,136,166,111,134,145,60,15,198,49, - 109,207,128,145,254,145,48,226,240,25,48,170,36,225,47,129,17,63,11,198,49,109,207,128,145,208,63,12,198,80,8,250,12,24,235,220,254,141,48,130, - 46,254,44,24,199,180,61,25,70,208,38,30,131,209,140,162,236,217,48,218,251,122,182,210,10,234,139,215,35,120,246,225,30,170,128,233,176,157,142,247, - 87,19,202,81,200,2,2,153,181,165,30,174,38,76,32,78,9,161,65,75,93,140,242,46,70,121,53,0,226,35,193,121,192,58,226,178,217,193,39,29, - 229,37,20,16,235,171,201,58,170,116,186,127,67,154,27,123,138,71,190,248,76,4,148,77,93,129,40,13,168,240,149,75,248,148,8,20,6,12,139,183, - 39,210,63,231,105,5,53,209,182,84,250,163,169,43,254,153,127,46,85,103,133,51,110,123,26,220,36,236,118,126,214,28,103,28,169,141,35,18,202,71, - 60,243,233,215,214,89,183,237,180,73,242,136,103,62,253,218,250,125,162,255,1,183,29,2,126,98,15,18,64,228,62,205,214,143,251,155,75,80,72,24, - 15,8,248,146,152,194,136,4,68,210,254,183,1,3,23,64,230,28,79,125,142,8,38,132,116,94,183,39,0,112,128,176,192,33,238,130,226,96,168,4, - 49,233,227,46,20,247,20,136,20,9,202,89,47,40,14,53,213,135,176,18,242,81,55,125,9,190,230,182,122,176,38,224,131,83,81,129,252,193,129,24, - 71,212,31,156,6,88,122,20,115,18,206,144,31,144,144,145,239,20,150,47,58,47,17,15,151,146,244,7,158,247,251,167,125,91,27,159,79,251,80,96, - 210,65,218,135,252,140,37,199,108,144,245,9,67,52,132,44,75,6,89,255,132,117,49,202,106,146,62,70,68,112,33,158,16,131,20,113,41,48,35,54, - 232,124,34,177,111,99,13,174,2,65,2,95,216,1,69,208,87,137,80,78,93,234,35,66,57,166,192,29,160,144,10,246,204,204,127,233,153,142,196,126, - 107,187,33,211,10,37,119,169,218,189,106,114,163,46,110,33,57,54,21,104,35,30,250,197,12,104,117,57,53,233,26,28,211,160,53,195,77,180,84,54, - 153,2,95,157,77,155,137,121,161,19,165,143,83,194,126,6,83,77,190,53,157,32,245,185,196,68,30,231,91,79,48,194,123,108,120,108,190,92,69,73, - 177,3,255,188,63,249,181,40,0,112,10,128,133,156,6,228,254,180,113,3,22,192,221,141,89,235,215,221,36,232,115,193,242,224,221,66,158,72,142,183, - 90,3,228,110,22,29,20,28,206,254,57,202,47,87,197,110,169,13,72,139,40,107,81,106,151,154,41,119,62,47,64,121,165,183,39,211,208,163,110,205, - 171,11,180,167,214,156,77,167,221,227,48,242,251,199,30,213,178,75,161,187,221,185,77,7,31,74,114,134,225,216,210,75,70,207,112,152,178,71,242,51, - 147,0,82,32,142,181,242,229,90,85,81,18,85,81,231,38,71,10,63,246,194,58,89,204,126,187,249,165,189,202,227,120,246,175,66,223,118,87,180,97, - 136,230,208,102,95,77,218,242,194,180,215,241,204,132,79,84,93,167,107,56,187,121,220,249,105,191,206,192,175,219,137,1,115,117,216,168,78,104,45,246, - 248,80,53,250,216,149,196,235,212,44,242,62,86,224,242,191,26,37,189,146,163,22,26,155,167,182,66,95,247,4,155,3,188,91,182,133,193,96,11,105, - 149,169,235,191,69,183,219,185,243,177,82,144,173,180,221,110,77,239,203,240,78,133,88,206,19,125,70,108,125,134,235,230,8,245,251,13,90,111,203,52, - 94,69,89,134,226,175,118,105,195,245,170,191,207,44,141,85,94,62,14,139,85,155,222,65,80,175,215,69,94,90,132,154,181,165,55,63,184,101,228,81, - 132,189,19,120,234,131,253,37,73,43,231,51,120,199,216,97,237,1,182,243,47,144,220,7,8,152,125,252,57,90,222,3,209,80,179,244,218,188,214,92, - 122,205,96,148,99,107,213,61,196,161,213,157,210,163,82,106,218,64,121,141,224,112,155,214,72,198,85,251,174,251,225,62,162,61,239,125,38,152,67,83, - 109,148,6,119,44,31,53,213,216,251,235,111,106,163,139,100,107,31,192,134,54,122,161,224,155,20,238,136,116,190,29,21,172,213,127,182,41,172,248,38, - 201,255,40,42,128,228,251,202,124,87,157,223,236,139,80,80,58,189,179,38,53,222,80,126,223,77,127,92,69,90,189,203,210,219,62,24,214,245,26,87, - 59,118,37,189,60,122,233,29,179,172,29,45,187,236,59,184,150,218,212,157,69,115,5,119,250,7,51,233,144,211,235,169,216,110,214,69,162,154,229,199, - 196,189,137,170,213,241,72,213,88,71,193,67,25,48,49,210,194,186,166,189,37,212,167,83,129,145,192,28,152,2,31,49,232,162,113,87,196,192,110,255, - 238,112,12,82,72,40,152,211,182,212,206,59,167,237,164,157,16,90,10,40,135,152,239,96,135,192,143,35,17,116,43,44,12,253,233,19,23,140,105,248, - 218,110,162,45,141,52,220,107,237,218,145,233,253,88,127,223,78,143,191,31,116,211,163,15,9,198,94,6,227,80,136,174,63,110,250,213,182,47,69,132, - 19,211,9,6,23,195,247,25,83,165,205,224,50,123,243,250,244,177,227,173,157,237,117,210,118,168,183,153,154,65,78,204,139,36,185,168,75,191,89,94, - 228,170,249,94,23,14,192,220,12,77,173,13,238,49,131,120,170,250,180,47,69,154,207,32,148,148,190,88,71,250,86,233,90,72,253,221,45,171,72,87, - 3,202,58,77,6,99,149,39,3,181,86,84,150,194,159,25,193,71,98,18,65,169,163,117,116,24,176,26,106,221,227,207,90,206,238,144,119,105,153,206, - 211,204,12,236,215,76,93,36,105,185,1,151,158,165,185,217,249,69,1,23,194,34,43,118,199,249,83,67,153,114,0,90,16,29,119,125,75,63,10,238, - 25,135,156,181,201,105,167,121,223,38,8,247,172,2,135,252,10,181,241,209,42,163,34,40,125,123,207,82,77,180,17,250,3,77,198,127,39,139,205,179, - 34,190,61,111,48,155,59,36,242,67,202,57,153,114,232,214,24,36,25,233,188,119,184,132,132,3,100,105,222,48,152,239,251,88,58,220,54,110,28,251, - 83,66,17,133,248,246,29,10,205,152,160,16,90,134,196,101,32,124,231,67,143,200,160,247,162,20,178,1,80,125,243,48,34,169,12,167,208,136,5,56, - 12,137,28,242,50,48,132,96,220,104,31,163,118,52,202,16,99,129,20,227,180,247,38,65,249,212,247,41,80,41,10,124,243,111,74,147,190,4,147,146, - 193,121,56,10,2,12,77,211,216,193,191,58,39,105,133,240,94,255,219,181,128,144,231,141,151,67,159,17,215,159,51,174,254,192,130,251,154,40,9,130, - 161,105,24,56,39,120,108,8,56,72,200,251,62,156,197,216,198,156,202,103,161,1,135,50,63,148,212,129,105,74,49,14,216,20,186,107,28,6,112,165, - 56,20,110,22,30,6,152,24,26,156,87,250,22,240,150,234,35,238,227,80,4,161,1,124,132,10,253,29,198,82,208,218,96,132,131,162,81,90,95,38, - 3,152,253,16,250,240,129,204,142,218,209,192,52,44,196,50,144,163,52,107,68,10,215,147,111,169,0,66,0,14,200,124,227,148,194,184,5,180,151,44, - 244,129,115,12,162,158,21,79,238,1,33,67,184,196,196,104,206,177,33,119,54,231,63,158,93,204,5,115,47,187,96,36,237,39,248,127,188,15,206,100, - 151,167,228,124,140,124,66,24,24,130,63,241,66,54,207,80,15,38,255,255,233,43,153,255,160,27,217,102,17,129,4,149,80,49,17,19,180,34,164,129, - 12,32,104,77,14,15,125,72,199,144,58,113,0,17,40,32,234,72,136,124,1,65,196,76,212,65,89,106,162,14,234,181,128,153,162,211,252,239,36,32, - 24,114,171,67,5,146,126,200,185,48,185,69,16,33,25,171,147,57,134,248,148,210,220,6,82,134,148,240,58,59,72,106,222,235,56,164,104,16,46,40, - 16,199,246,52,146,124,225,190,230,79,72,190,237,91,29,180,162,151,230,133,227,250,213,127,1,80,75,3,4,20,0,2,0,8,0,143,128,249,52,187, - 167,102,138,170,9,0,0,119,36,0,0,13,0,0,0,101,100,105,116,45,114,101,100,111,46,115,118,103,221,89,235,147,219,182,17,255,238,191,130,149, - 191,196,19,17,196,139,0,161,123,100,220,184,233,164,147,182,51,113,50,253,216,161,72,72,98,142,34,85,146,58,73,254,235,187,0,223,39,202,167,179, - 29,183,19,122,60,34,119,23,187,192,62,126,192,226,110,191,59,110,83,231,81,23,101,146,103,119,51,130,240,204,209,89,148,199,73,182,190,155,253,250, - 203,15,110,48,115,202,42,204,226,48,205,51,125,55,203,242,217,119,247,175,110,255,228,186,206,247,133,14,43,29,59,135,164,218,56,63,102,15,101,20, - 238,180,243,205,166,170,118,11,207,59,28,14,40,105,136,40,47,214,222,27,199,117,97,100,249,184,126,229,56,14,152,205,202,69,28,221,205,26,249,221, - 190,72,173,92,28,121,58,213,91,157,85,165,71,16,241,102,189,120,212,139,31,244,18,21,186,204,247,69,84,171,143,162,161,100,17,175,122,81,152,201, - 129,89,33,162,148,242,48,245,40,117,65,194,45,79,89,21,30,221,172,124,61,24,10,19,156,26,74,49,198,30,240,122,201,235,164,22,199,20,220,112, - 113,50,150,59,180,14,174,223,193,255,110,64,231,195,122,173,43,24,169,81,166,43,239,221,47,239,188,86,218,197,40,174,226,129,154,118,212,200,238,40, - 28,89,184,213,229,46,140,116,217,153,176,227,219,143,133,62,238,242,162,114,79,241,14,38,163,48,194,246,153,148,57,94,33,179,74,82,109,108,222,205, - 188,77,190,213,222,111,201,118,27,70,222,59,93,62,84,249,206,59,36,32,129,118,89,237,185,67,18,87,155,187,25,15,118,71,251,189,209,201,122,83, - 13,8,73,124,55,3,55,19,194,26,115,173,39,22,93,46,99,196,232,120,38,3,22,103,223,198,250,81,167,227,177,113,30,45,195,178,155,98,149,172, - 117,81,121,209,99,233,173,10,173,227,122,170,214,123,80,17,235,220,77,162,60,115,171,13,36,171,7,22,210,112,153,106,47,140,42,176,81,158,41,174, - 215,174,227,164,114,11,29,231,168,77,146,110,118,249,190,218,237,171,127,235,99,165,179,122,154,96,104,16,51,203,54,195,58,218,236,30,20,220,198,122, - 85,26,69,181,83,204,23,179,12,96,65,110,233,176,248,107,17,198,9,148,83,45,52,176,24,229,105,170,35,112,107,152,30,194,83,61,229,86,207,120, - 40,165,28,55,74,65,109,9,94,104,101,97,145,213,41,133,149,25,162,11,26,243,98,241,90,169,37,198,203,27,75,202,33,199,146,234,180,32,55,179, - 126,76,190,90,149,26,12,227,1,205,134,20,70,128,45,58,115,188,207,179,134,167,172,145,105,107,188,179,118,235,141,151,253,229,221,8,41,121,253,194, - 100,16,8,140,63,217,141,140,191,200,141,83,214,94,224,70,38,190,154,27,185,82,228,5,110,92,217,231,19,221,8,182,216,139,220,56,101,237,106,55, - 130,53,255,171,185,49,16,226,37,217,88,99,251,39,186,17,108,189,44,27,167,172,93,237,70,176,246,108,54,154,175,48,125,177,27,237,126,189,216,20, - 26,206,23,175,39,252,57,116,247,216,4,176,131,142,29,29,239,102,148,163,128,73,66,69,79,61,221,205,152,64,156,18,66,101,71,93,77,202,174,38, - 101,11,112,136,143,4,231,146,245,196,117,51,131,95,138,48,43,225,0,177,189,155,109,195,170,72,142,223,144,102,199,158,227,137,23,159,9,73,217,220, - 245,81,64,125,70,149,118,9,159,19,129,2,201,176,120,115,166,253,215,44,169,224,76,180,47,117,241,222,156,43,254,153,253,90,234,62,10,23,210,246, - 28,35,73,208,207,252,98,56,46,36,82,7,71,36,80,207,100,230,245,64,113,49,109,123,107,138,60,147,153,215,3,197,239,83,253,31,73,219,177,195, - 207,226,65,36,84,238,117,177,190,38,223,2,194,184,36,144,74,98,238,194,233,94,18,69,197,124,240,50,224,19,36,3,26,96,50,247,57,34,152,16, - 210,231,220,145,128,123,37,194,2,7,184,47,137,147,161,18,196,148,143,251,66,60,82,32,82,36,40,103,131,146,56,213,84,31,138,74,168,222,231,95, - 30,20,236,94,117,25,20,128,45,71,160,0,245,229,11,22,12,166,106,64,1,86,69,152,221,99,135,160,112,46,187,154,148,53,160,160,192,89,212,191, - 34,68,16,21,170,48,96,138,118,41,132,64,4,62,81,210,196,2,142,218,129,161,48,66,184,244,13,23,68,49,39,176,4,120,195,136,16,95,146,47, - 5,11,159,147,207,148,209,143,159,193,130,81,30,49,54,74,32,230,35,233,143,178,135,17,228,143,18,135,83,228,255,63,172,147,227,143,31,217,197,215, - 94,231,173,103,218,15,251,214,181,62,166,239,137,31,19,125,120,213,0,97,145,63,0,18,54,199,205,70,61,52,135,41,208,234,147,252,172,239,102,76, - 55,214,124,238,194,181,182,200,9,114,53,116,54,140,101,94,196,186,104,89,194,62,35,86,3,174,166,237,163,62,135,220,86,45,191,115,191,81,62,16, - 195,83,252,114,19,198,249,1,182,226,167,204,15,121,14,229,195,159,146,77,53,251,204,108,167,92,202,51,166,217,189,13,51,192,231,179,137,246,69,1, - 158,118,211,240,164,97,77,246,167,5,145,114,147,31,214,133,241,205,42,76,59,231,116,67,13,203,93,46,115,176,93,21,251,51,54,244,161,123,115,179, - 226,238,235,40,54,221,244,64,194,232,31,174,118,210,202,33,201,128,233,54,93,122,160,232,5,129,182,109,15,24,185,32,113,52,135,152,224,2,19,124, - 228,203,54,181,182,186,10,227,176,10,251,228,104,41,188,109,119,139,120,181,248,249,221,15,221,110,29,69,139,127,229,197,67,191,11,27,129,112,9,157, - 244,221,172,59,65,152,14,58,90,24,8,12,171,251,100,11,75,55,247,55,223,30,183,41,100,115,199,24,9,87,167,157,238,149,214,106,219,187,168,201, - 251,172,56,218,38,102,144,247,190,130,68,255,209,24,25,156,42,106,165,145,185,77,203,139,251,129,98,179,128,183,235,110,239,31,77,33,169,82,125,255, - 183,240,97,191,116,222,87,26,42,191,176,211,173,233,67,29,222,185,18,43,121,102,207,168,173,215,112,223,44,161,190,162,65,219,125,153,68,155,48,77, - 81,244,193,14,109,164,94,13,231,153,38,145,206,202,231,221,98,205,38,143,80,202,219,109,158,149,214,67,205,216,210,91,158,220,50,244,40,194,222,153, - 123,234,133,253,37,78,42,231,103,29,231,83,139,181,11,216,47,127,3,28,29,121,192,204,227,207,225,250,137,19,13,53,77,238,205,133,204,173,215,124, - 76,74,20,214,220,199,36,194,117,152,100,207,41,9,119,187,244,52,37,84,211,70,19,172,189,60,94,138,13,164,73,231,97,122,255,244,212,235,131,12, - 127,161,195,199,225,220,233,2,82,182,124,54,156,83,215,176,63,235,93,145,199,123,123,15,54,142,227,103,42,126,151,192,238,145,44,247,147,138,11,253, - 159,125,2,35,62,73,243,63,242,10,92,242,101,117,190,173,46,79,246,179,188,160,139,228,209,134,212,100,67,249,101,39,253,126,19,22,250,109,154,60, - 12,157,97,83,175,73,181,182,57,25,96,237,173,215,34,177,253,90,247,8,61,218,185,58,116,79,195,165,134,221,254,39,195,116,200,249,14,150,239,119, - 219,60,214,205,240,22,220,119,97,181,105,151,84,77,52,22,60,80,146,137,137,70,214,156,82,225,60,235,155,243,42,244,1,208,93,136,185,244,225,24, - 75,5,238,143,171,48,219,191,59,28,131,26,18,8,230,116,157,181,243,214,233,26,106,39,128,222,66,4,138,249,14,118,8,252,115,20,130,182,133,5, - 129,63,191,114,192,148,133,15,221,36,186,67,83,1,91,95,55,118,130,125,156,106,243,59,246,244,53,66,207,158,188,79,48,241,50,62,14,132,232,143, - 149,77,219,218,181,167,136,112,98,26,66,121,51,190,166,49,231,183,5,108,120,223,188,62,191,243,120,99,185,131,134,218,126,22,251,84,47,244,163,206, - 242,56,190,169,15,133,139,44,207,116,243,94,159,45,64,184,249,52,103,91,72,143,5,212,83,53,164,253,150,39,217,2,74,73,23,55,219,176,120,208, - 69,173,164,126,119,203,42,44,170,17,101,155,196,163,111,157,197,35,179,86,85,154,192,207,130,224,150,24,135,112,26,42,138,240,52,18,53,212,186,213, - 95,116,146,253,34,31,147,50,89,38,169,249,176,175,169,190,137,147,114,7,41,189,72,50,51,243,155,252,81,23,171,52,63,180,252,243,64,153,35,3, - 116,4,69,212,183,17,195,42,120,18,28,114,49,38,231,141,193,211,152,32,60,136,10,44,242,3,156,154,219,168,76,170,96,16,214,113,164,154,114,35, - 244,127,24,50,254,59,69,108,153,230,209,195,229,128,89,236,96,80,175,146,75,49,231,62,194,140,51,161,156,239,29,192,30,225,19,204,3,32,11,196, - 124,223,199,202,225,72,128,160,242,249,28,240,136,66,129,251,14,245,17,87,64,51,20,174,164,240,157,159,122,26,67,132,130,199,149,0,34,180,100,132, - 51,42,201,156,72,36,113,16,16,53,18,53,45,133,96,220,216,158,32,118,36,202,16,99,82,137,73,210,247,14,1,56,101,68,4,115,74,161,73,52, - 127,167,116,36,0,166,164,130,240,57,231,72,74,12,141,212,212,146,63,56,103,128,98,230,123,158,219,80,247,218,228,55,52,33,81,253,92,72,242,143, - 12,120,106,137,18,41,199,65,33,2,41,202,21,157,51,5,243,247,97,41,176,58,31,81,76,2,138,185,241,12,101,62,244,47,0,212,210,192,161,132, - 152,128,183,2,9,187,137,67,5,242,49,64,59,80,124,115,49,111,61,221,208,192,107,240,43,100,96,28,125,70,3,148,247,125,1,69,98,163,68,56, - 152,152,164,245,250,24,134,68,9,4,145,3,125,61,173,165,64,56,24,52,140,82,77,80,108,212,0,110,133,37,98,200,17,72,53,72,39,198,3,31, - 114,192,71,132,5,62,200,77,184,100,16,180,51,192,23,10,250,116,38,38,193,197,214,214,69,112,127,30,70,204,78,242,4,70,48,82,246,145,127,68, - 224,191,0,35,215,128,59,54,85,202,72,64,174,221,121,205,197,226,155,171,131,115,190,243,254,161,3,241,220,14,108,177,3,74,12,3,164,5,106,206, - 145,15,117,133,149,65,101,56,87,73,202,36,149,115,2,56,168,2,202,137,41,89,133,100,32,232,128,234,48,218,14,7,100,149,204,231,64,3,176,85, - 132,88,154,64,2,246,5,160,89,244,86,146,115,67,165,8,162,12,150,76,53,99,163,82,213,84,192,121,98,202,217,84,184,29,15,208,203,107,73,3, - 209,212,142,134,189,65,168,102,52,67,80,180,140,3,92,51,137,96,176,8,136,35,16,5,133,10,91,140,99,181,198,126,70,164,182,66,106,80,58,91, - 249,4,176,115,53,248,35,203,243,192,126,235,65,135,123,107,46,87,238,95,253,23,80,75,3,4,20,0,2,0,8,0,171,128,249,52,75,77,50,197, - 89,10,0,0,186,54,0,0,23,0,0,0,109,101,100,105,97,45,115,101,101,107,45,98,97,99,107,119,97,114,100,46,115,118,103,237,90,109,143,219, - 54,18,254,158,95,225,115,190,36,232,74,226,155,40,201,251,82,244,26,244,16,32,185,3,154,4,247,241,64,75,180,173,174,44,185,146,188,182,243,235, - 111,72,189,91,114,214,222,85,18,92,174,110,131,181,56,195,25,242,225,195,209,12,233,155,159,247,235,104,242,32,211,44,76,226,219,41,54,209,116,34, - 99,63,9,194,120,121,59,253,244,241,55,195,157,78,178,92,196,129,136,146,88,222,78,227,100,250,243,221,139,155,191,25,198,228,215,84,138,92,6,147, - 93,152,175,38,111,227,251,204,23,27,57,121,181,202,243,205,204,178,118,187,157,25,150,141,102,146,46,173,215,19,195,128,158,217,195,242,197,100,50,1, - 183,113,54,11,252,219,105,169,191,217,166,145,214,11,124,75,70,114,45,227,60,179,176,137,173,105,163,238,55,234,59,57,55,83,153,37,219,212,47,204, - 251,126,91,51,13,22,141,42,140,100,71,181,18,246,60,207,66,196,34,196,0,13,35,59,196,185,216,27,113,246,178,213,21,6,56,212,149,32,132,44, - 144,53,154,231,105,205,246,17,192,112,114,48,90,218,246,14,208,111,224,95,221,161,198,176,152,235,2,122,74,51,150,185,245,230,227,27,171,210,54,144, - 25,228,65,203,76,213,171,227,183,179,28,177,88,203,108,35,124,153,213,46,116,255,93,24,228,171,219,41,115,55,123,253,188,146,225,114,149,183,26,194, - 224,118,10,51,196,20,57,250,185,26,195,172,102,17,50,41,41,84,75,195,109,17,163,63,5,242,65,70,221,190,65,226,207,69,6,195,181,86,201,90, - 90,127,132,235,181,240,173,44,245,45,255,33,179,128,127,203,196,8,253,36,54,242,21,80,195,2,171,145,152,71,210,18,126,14,118,179,158,49,53,187, - 219,233,90,6,161,48,50,41,239,141,185,240,239,119,34,13,204,106,113,234,177,201,253,38,73,115,99,17,70,178,232,85,12,33,18,155,196,122,35,179, - 251,60,217,88,255,72,197,34,244,133,245,22,134,32,173,194,108,233,218,72,182,57,172,161,204,204,77,60,108,121,31,108,96,57,61,52,40,60,84,194, - 59,144,222,4,114,145,41,173,2,101,245,4,48,123,90,6,82,229,70,164,48,150,32,132,221,81,232,21,154,93,9,161,152,151,125,160,87,6,19,168, - 116,1,164,252,16,193,28,85,163,225,39,81,146,206,94,34,253,185,214,77,9,48,34,204,15,51,124,61,109,250,36,139,69,38,129,2,168,213,166,89, - 0,61,192,23,68,8,235,124,111,11,253,233,122,67,38,183,61,199,163,142,55,228,22,15,186,37,168,118,123,99,117,231,127,41,92,182,203,190,25,92, - 182,203,159,15,215,217,40,217,174,59,22,74,54,114,236,11,80,18,193,28,9,247,137,40,129,47,231,34,148,24,103,14,99,71,222,206,4,9,156,121, - 163,81,137,131,173,90,92,109,117,24,100,36,125,112,47,162,157,56,100,167,80,172,87,141,187,248,17,160,206,36,10,62,13,98,203,25,125,4,168,1, - 103,1,13,28,127,49,222,6,244,240,163,160,216,30,29,9,148,235,51,80,177,61,251,114,84,164,250,248,71,123,245,137,32,157,226,206,105,20,93,206, - 201,183,10,99,224,139,93,180,65,135,188,157,29,198,192,27,127,12,70,245,36,162,139,97,212,233,215,108,149,74,72,23,95,14,224,217,134,187,235,2, - 123,180,17,47,203,198,79,113,152,67,94,184,205,100,250,65,229,86,255,138,63,101,178,167,245,49,21,113,6,137,220,26,50,20,145,167,225,254,21,190, - 66,234,63,211,166,220,33,244,138,153,200,179,49,162,210,192,244,10,115,211,117,40,226,175,107,59,254,254,118,74,152,233,82,7,19,222,180,30,110,167, - 148,155,140,96,76,156,186,117,49,168,187,24,212,77,1,126,219,228,140,57,180,9,191,79,37,232,23,144,213,175,146,211,68,198,12,225,231,35,155,171, - 175,17,20,40,175,12,230,152,144,106,243,43,3,19,220,160,184,199,183,83,155,153,158,235,218,152,213,173,7,172,64,104,144,218,19,173,229,122,220,115, - 154,214,3,180,98,70,76,236,58,158,247,53,161,210,185,201,151,160,106,45,234,40,80,1,32,30,178,241,149,225,57,38,225,4,211,46,96,204,131,4, - 30,181,23,72,3,134,137,233,49,143,211,14,108,160,203,185,67,9,235,194,6,20,195,192,70,218,192,54,254,222,237,190,135,251,123,151,81,62,218,222, - 69,38,33,4,242,215,43,40,194,128,101,196,161,87,64,12,2,140,35,176,163,153,195,17,3,56,137,7,82,198,175,8,50,129,111,78,119,51,115,6, - 54,28,228,176,206,102,198,154,183,212,38,157,205,220,215,93,12,234,194,102,118,77,216,103,223,21,101,239,27,163,76,145,251,157,81,254,10,33,64,85, - 115,95,42,246,8,233,108,81,136,246,0,7,230,188,187,69,41,212,88,174,205,89,103,139,18,10,131,239,110,103,162,222,12,103,46,91,49,235,27,75, - 21,170,250,91,93,130,171,74,58,120,8,229,174,169,102,85,125,95,218,221,136,165,212,137,1,76,182,72,209,74,193,60,73,3,153,86,34,174,63,29, - 81,153,59,168,131,4,108,19,143,97,168,62,95,116,33,86,198,91,106,104,72,158,173,68,144,236,96,254,199,194,207,73,2,156,235,217,212,244,129,184, - 229,129,199,190,80,49,195,1,120,109,226,244,12,250,219,52,5,252,140,72,28,36,204,73,255,169,208,206,86,201,110,153,42,108,22,34,170,193,169,187, - 42,145,49,159,39,123,21,161,183,61,113,144,248,91,117,74,102,108,139,181,41,143,103,212,154,133,129,58,217,9,227,229,94,33,96,15,73,14,125,137, - 92,111,74,225,0,48,122,48,155,36,140,149,171,214,112,22,97,20,169,85,244,197,130,202,246,188,182,96,48,59,53,51,37,236,79,77,55,231,73,36, - 97,247,251,144,64,226,122,120,89,158,38,247,208,242,210,33,222,194,95,28,219,219,133,49,44,167,81,30,93,97,204,216,9,141,234,48,203,69,238,9, - 13,24,17,115,240,9,161,202,154,88,107,146,5,39,135,151,71,201,219,84,107,3,81,244,43,41,1,9,110,117,192,83,111,31,141,68,181,7,147,84, - 237,64,145,235,3,180,21,60,125,78,224,49,170,247,232,38,201,194,66,72,93,21,27,161,22,238,196,11,109,140,96,175,201,216,159,237,200,51,17,100, - 105,46,179,7,29,241,139,28,61,200,52,15,253,39,184,113,199,114,163,96,115,108,124,148,105,21,110,8,66,227,193,70,136,74,55,73,171,188,111,59, - 34,99,205,7,162,186,135,92,199,229,131,110,216,88,110,176,173,222,134,12,15,176,141,81,74,198,131,205,128,82,5,113,194,24,31,244,52,34,175,13, - 219,53,17,225,158,61,232,104,52,94,99,23,222,75,136,184,195,200,141,198,107,140,96,129,8,25,92,32,181,108,99,185,33,158,233,65,230,53,236,198, - 27,111,117,176,167,194,155,235,12,172,14,84,203,124,60,71,156,154,136,122,220,97,67,142,198,156,17,148,72,136,115,138,6,103,68,240,136,196,118,29, - 19,1,183,28,50,224,73,221,228,140,231,9,35,2,232,145,161,232,99,171,203,140,49,61,193,54,98,200,118,251,158,40,198,99,162,231,17,211,102,80, - 138,15,4,110,117,4,80,39,194,253,252,87,183,175,101,46,2,145,139,38,25,174,90,48,197,213,161,221,77,26,44,102,191,191,249,173,62,84,243,253, - 217,191,147,244,190,57,15,83,10,98,158,108,33,129,169,15,250,212,165,145,63,83,165,146,200,239,194,53,36,28,234,250,241,167,253,58,130,180,188,22, - 116,148,243,195,70,54,70,11,179,213,85,234,224,117,108,224,175,67,213,201,250,144,67,182,247,86,57,105,29,254,149,70,195,60,146,119,239,213,205,216, - 228,131,148,247,147,191,151,23,110,122,24,133,180,211,193,87,183,199,73,122,215,26,137,154,241,47,203,250,76,175,111,254,157,216,36,147,95,69,36,214, - 34,14,82,25,14,217,86,203,208,183,163,53,123,46,149,195,40,244,101,156,61,14,136,238,28,62,64,221,178,94,39,113,166,177,41,251,102,214,252,96, - 100,194,2,222,91,237,83,81,171,92,193,246,138,190,59,118,215,90,212,11,61,117,231,177,145,41,172,82,246,232,60,134,46,206,127,151,155,52,9,182, - 250,66,179,187,178,207,52,252,38,132,204,61,156,111,7,13,167,242,207,109,8,61,158,100,249,159,9,188,142,228,184,54,127,201,79,15,246,89,40,200, - 52,124,208,75,170,216,144,141,59,232,15,43,145,202,95,162,240,94,30,83,175,164,90,117,108,222,10,47,55,86,21,127,244,211,178,137,75,157,250,180, - 174,101,34,49,151,80,229,189,83,194,9,238,151,134,201,118,179,78,2,89,118,175,107,54,125,11,16,132,217,6,154,103,97,172,206,45,170,88,183,17, - 249,170,119,56,146,254,71,149,210,173,98,170,43,219,31,201,154,96,11,190,85,124,130,114,211,47,63,157,56,173,156,65,77,216,4,111,104,123,63,129, - 44,217,70,136,93,97,248,59,121,55,129,20,83,61,17,6,223,43,17,101,90,212,209,252,60,121,63,97,184,211,149,176,86,223,74,86,246,237,168,126, - 158,52,131,47,208,233,94,143,168,98,26,102,19,75,253,173,117,45,163,31,211,109,36,103,242,65,194,116,131,235,162,34,158,65,148,126,245,178,127,32, - 244,186,148,23,37,241,140,86,143,74,19,224,156,101,127,110,129,53,237,214,63,160,180,159,193,66,198,193,245,90,164,247,50,45,198,81,124,55,178,92, - 164,121,167,101,29,6,157,103,25,151,207,165,77,216,44,80,225,134,240,103,198,170,182,64,64,49,156,166,64,134,182,166,106,45,110,127,102,168,106,107, - 102,254,16,102,225,60,140,212,131,254,26,201,235,46,163,174,19,72,77,23,81,178,171,229,205,175,10,112,235,96,110,12,198,157,252,241,198,41,133,253, - 99,10,79,253,213,73,253,99,147,47,109,132,222,38,176,109,108,143,180,9,206,32,178,230,102,255,72,248,245,217,228,110,179,164,32,50,54,11,7,252, - 76,66,107,22,254,175,19,122,92,14,95,186,94,252,175,245,186,116,189,58,59,108,132,119,133,218,190,219,76,194,238,117,46,216,243,95,35,210,92,28, - 223,234,8,57,46,135,191,240,230,247,143,153,222,188,14,144,131,8,252,111,95,159,34,127,255,114,245,89,228,63,38,125,241,122,253,33,95,186,95,228, - 60,67,38,148,185,222,21,102,38,129,114,185,67,117,245,83,7,234,12,176,191,243,110,114,202,55,16,162,152,219,186,193,197,68,181,97,117,128,162,76, - 115,120,217,115,210,121,81,217,117,183,150,153,163,109,165,216,72,188,83,121,194,215,75,210,212,111,28,94,63,47,86,254,128,188,249,190,41,121,147,37, - 17,124,97,145,113,78,206,216,138,113,23,146,173,250,25,219,211,67,17,253,255,125,255,170,168,81,70,154,34,206,112,211,227,176,227,107,90,105,41,165, - 102,29,61,218,234,37,181,186,22,128,92,45,19,149,184,54,113,164,175,67,25,41,155,90,97,170,108,162,216,116,89,97,215,53,61,196,121,53,178,227, - 46,122,40,168,103,167,106,106,217,33,188,109,168,215,103,152,242,246,121,111,215,175,73,253,230,77,109,115,172,63,215,223,117,55,252,128,17,86,221,212, - 56,64,12,90,81,25,23,13,138,28,110,167,69,221,85,22,58,221,62,3,236,161,216,115,198,37,196,147,11,244,114,68,12,181,46,58,138,48,224,169, - 28,68,79,171,216,53,173,41,195,67,57,107,53,255,182,98,191,206,61,230,40,242,254,226,232,120,28,61,89,213,84,23,44,203,187,23,55,234,130,227, - 238,197,127,1,80,75,3,4,20,0,2,0,8,0,174,128,249,52,207,153,178,73,172,10,0,0,72,56,0,0,22,0,0,0,109,101,100,105,97,45, - 115,101,101,107,45,102,111,114,119,97,114,100,46,115,118,103,237,90,109,147,155,56,18,254,158,95,225,115,190,36,181,6,244,134,16,158,151,173,173,77, - 229,42,87,201,93,213,38,169,251,120,37,131,108,179,131,193,11,120,236,201,175,191,22,239,24,60,51,158,33,201,85,46,36,169,24,117,171,91,122,244, - 168,213,146,184,252,245,176,9,39,183,42,73,131,56,186,154,98,19,77,39,42,242,98,63,136,86,87,211,207,159,222,26,98,58,73,51,25,249,50,140, - 35,117,53,141,226,233,175,215,47,46,255,102,24,147,223,19,37,51,229,79,246,65,182,158,188,139,110,82,79,110,213,228,213,58,203,182,115,203,218,239, - 247,102,80,22,154,113,178,178,94,79,12,3,106,166,183,171,23,147,201,4,220,70,233,220,247,174,166,165,254,118,151,132,185,158,239,89,42,84,27,21, - 101,169,133,77,108,77,27,117,175,81,223,171,133,153,168,52,222,37,94,97,222,243,218,154,137,191,108,84,161,37,123,154,43,97,215,117,45,68,44,66, - 12,208,48,210,187,40,147,7,35,74,95,182,170,66,3,135,170,18,132,144,5,178,70,243,113,90,243,67,8,48,156,108,76,46,109,123,7,232,183,240, - 175,174,80,99,88,244,117,9,53,149,25,169,204,122,243,233,141,85,105,27,200,244,51,191,101,166,170,213,241,219,25,142,72,110,84,186,149,158,74,107, - 23,121,253,125,224,103,235,171,41,19,219,67,254,190,86,193,106,157,181,10,2,255,106,10,61,196,20,57,249,123,213,134,121,205,34,100,82,82,168,150, - 134,219,34,70,127,241,213,173,10,187,117,253,216,91,200,20,154,107,173,227,141,178,254,12,54,27,233,89,105,226,89,222,109,106,1,255,86,177,17,120, - 113,100,100,107,160,134,5,86,67,185,8,149,37,189,12,236,166,61,99,186,119,87,211,141,242,3,105,164,74,221,24,128,219,94,38,190,89,141,77,221, - 52,117,216,198,73,102,44,131,80,21,149,138,22,132,114,27,91,111,84,122,147,197,91,235,239,137,92,6,158,180,222,65,11,148,85,88,45,61,27,241, - 46,131,33,84,169,185,141,134,45,31,252,45,140,166,139,6,133,119,149,240,26,164,151,190,90,166,90,171,0,89,191,1,202,110,46,3,169,118,35,19, - 104,139,31,192,228,40,244,10,205,174,132,80,204,203,58,80,43,133,14,84,186,128,81,118,23,66,31,117,161,225,197,97,156,204,95,162,252,185,200,139, - 98,32,68,144,221,205,241,197,180,169,19,47,151,169,2,6,160,86,89,78,2,168,1,190,32,64,88,143,247,182,204,159,174,55,100,114,219,117,92,234, - 184,67,110,241,160,91,130,106,183,151,86,183,255,231,194,101,11,246,205,224,178,5,127,62,92,143,70,201,22,98,44,148,108,228,216,103,160,36,253,5, - 146,226,137,40,129,47,231,44,148,24,103,14,99,71,222,30,9,18,56,115,71,163,18,7,91,181,184,154,234,208,200,80,121,224,94,134,123,121,151,158, - 66,177,30,53,46,240,3,64,61,146,40,248,52,136,45,103,244,1,160,6,156,249,212,119,188,229,120,19,208,197,15,130,98,187,116,36,80,46,30,129, - 138,237,218,231,163,162,244,227,29,205,213,39,130,116,138,59,167,81,20,156,147,111,21,198,192,23,59,107,130,14,121,123,116,24,3,111,252,33,24,245, - 155,12,207,134,49,207,190,230,235,68,65,182,248,114,0,207,54,220,93,23,216,165,141,120,85,22,126,142,130,12,210,194,93,170,146,143,58,181,250,87, - 244,57,85,61,173,79,137,140,82,200,71,54,144,160,200,44,9,14,175,240,12,233,63,166,77,185,67,232,140,153,200,101,88,8,101,96,58,195,220,20, - 14,69,252,117,109,199,59,92,77,9,51,5,117,48,225,77,233,221,213,148,114,147,17,140,137,83,151,46,7,117,151,131,186,9,192,111,155,156,49,135, - 54,225,247,169,4,189,7,217,124,41,57,77,100,204,16,30,13,89,163,128,22,207,92,219,132,116,219,101,51,3,19,220,96,121,192,87,83,155,154,76, - 203,26,124,238,176,134,66,152,12,51,42,26,93,50,168,11,165,152,17,19,217,176,220,126,77,216,242,60,229,62,216,90,3,60,30,108,4,96,67,194, - 158,25,174,99,18,78,48,237,98,199,92,72,232,81,123,196,114,236,48,84,99,46,167,29,236,64,151,115,135,18,214,197,14,56,135,129,158,180,193,110, - 252,201,220,93,152,251,147,153,209,17,177,67,38,33,4,50,218,25,252,2,166,16,135,206,12,98,98,2,180,33,48,201,153,195,17,195,51,74,5,96, - 196,233,140,32,83,216,216,233,206,111,206,192,136,131,28,214,153,223,152,57,96,145,218,164,51,191,251,186,203,65,93,152,223,194,132,169,247,93,113,118, - 191,57,206,54,255,222,56,127,133,88,160,183,120,247,237,0,9,233,76,83,88,2,0,14,204,143,66,28,133,141,151,176,57,235,76,83,66,161,241,221, - 41,77,244,114,49,126,112,97,194,132,172,128,178,25,122,93,130,117,105,233,77,111,254,171,222,205,235,93,185,127,27,168,125,179,51,214,71,5,165,163, - 173,92,169,60,201,0,140,138,116,175,20,44,226,196,87,73,37,226,249,211,17,149,121,136,62,147,192,54,129,5,23,87,161,190,30,25,109,188,165,134, - 134,228,233,90,250,241,30,96,59,22,126,137,99,232,51,44,168,54,23,54,235,137,53,251,28,219,36,176,110,56,61,153,94,159,77,88,178,93,82,179, - 173,17,238,146,4,112,53,66,121,167,160,107,249,127,213,88,165,235,120,191,74,52,68,75,25,214,24,213,85,181,200,88,44,98,112,157,37,187,158,216, - 143,189,157,62,119,51,118,197,200,150,7,62,122,44,3,95,159,21,5,209,234,160,129,176,135,36,119,125,137,218,108,75,225,0,62,121,99,182,113,16, - 105,87,173,230,44,131,48,212,131,233,201,37,85,237,126,237,192,96,122,170,103,90,216,239,90,94,156,197,161,2,18,122,144,147,226,186,121,105,150,196, - 55,80,242,210,33,238,210,91,30,219,219,7,17,140,170,81,30,134,97,204,216,9,141,234,120,76,32,113,66,227,160,87,62,247,132,16,64,171,211,76, - 221,201,130,154,195,195,163,229,109,198,181,129,40,234,149,148,128,156,185,58,51,170,103,81,142,68,53,55,227,68,207,76,153,229,71,114,107,120,251,18, - 195,107,88,207,221,109,156,6,133,80,47,82,46,100,251,78,39,218,228,198,8,118,155,77,192,179,29,185,38,130,196,79,48,123,208,17,63,203,209,173, - 74,178,192,123,130,27,49,150,27,13,155,99,227,163,132,173,112,67,16,26,15,54,2,137,150,16,164,117,98,208,118,68,198,234,15,172,9,144,5,58, - 130,15,186,97,99,185,193,182,94,75,25,30,96,27,163,148,140,7,155,1,187,31,196,9,99,124,208,211,136,188,54,96,27,129,8,119,237,65,71,163, - 241,26,11,88,158,16,17,195,200,141,198,107,140,96,128,8,25,28,32,61,108,99,185,33,174,233,82,36,134,221,184,227,141,14,118,117,120,19,206,192, - 232,216,24,241,241,28,113,106,34,234,114,135,13,57,26,179,71,176,201,66,156,83,52,216,35,130,71,36,182,112,76,4,220,114,200,128,39,125,55,52, - 158,39,140,96,123,77,201,80,244,177,245,253,200,152,158,96,26,49,100,139,190,39,138,241,152,232,193,198,218,102,176,163,31,8,220,88,212,39,210,151, - 86,63,13,206,203,55,42,147,190,204,100,147,19,87,37,152,226,234,28,240,50,241,151,243,63,222,188,173,207,233,60,111,254,239,56,185,105,142,216,180, - 130,92,196,59,72,96,234,179,67,125,15,229,205,117,198,46,179,235,96,3,9,135,190,208,252,229,176,9,33,59,175,5,29,229,236,110,171,26,163,133, - 217,234,114,118,240,130,215,247,54,129,174,100,125,204,32,219,123,167,157,180,206,19,75,163,65,22,170,235,15,250,178,109,242,81,169,155,201,219,226,10, - 47,111,69,33,236,232,123,250,58,58,78,174,91,13,209,29,254,109,85,159,18,246,173,191,151,219,120,242,187,12,229,70,70,126,162,130,33,219,122,20, - 250,118,114,205,158,75,237,48,12,60,21,165,15,227,145,87,14,110,97,247,178,217,196,81,154,67,83,214,77,173,197,157,145,74,11,104,111,245,112,241, - 128,83,73,176,216,157,219,215,127,200,155,221,98,242,49,83,176,85,76,206,237,104,223,103,174,171,217,212,102,215,251,227,190,183,8,118,102,183,187,160, - 110,85,2,140,73,31,4,117,232,179,128,63,212,54,137,253,93,126,95,219,69,243,153,134,223,4,105,129,202,144,225,68,253,181,11,160,198,147,44,255, - 51,134,165,81,141,107,243,183,236,116,99,159,133,130,74,130,219,124,72,53,27,210,113,27,253,113,45,19,245,91,24,220,180,193,200,169,87,82,173,186, - 21,104,133,186,75,171,138,133,249,219,170,137,145,157,189,114,189,175,10,229,66,193,142,243,189,22,78,112,127,155,26,239,182,155,216,87,101,245,122,255, - 152,95,114,248,65,186,133,226,121,16,233,19,152,42,238,110,101,182,238,29,243,36,255,209,219,250,214,198,174,43,59,28,201,154,192,15,190,117,172,132, - 173,175,87,62,157,53,67,59,131,253,105,179,144,64,217,135,137,62,241,209,231,221,116,134,169,105,79,222,79,24,46,14,192,233,140,48,120,109,228,148, - 229,242,163,10,95,38,31,38,188,40,33,78,101,67,111,3,90,54,26,121,105,227,168,194,151,73,211,155,2,174,230,198,31,219,23,221,187,33,189,237, - 135,190,70,42,255,213,186,147,202,95,147,93,168,230,234,86,1,24,254,69,177,119,159,195,122,242,234,101,255,224,235,117,41,47,54,239,115,90,189,106, - 77,0,123,158,254,181,3,78,181,75,255,140,131,104,14,195,28,249,23,27,153,220,168,164,104,71,241,219,72,51,153,100,157,146,77,224,119,222,85,84, - 190,151,54,97,42,193,94,60,128,255,230,172,42,243,37,108,219,147,4,168,210,214,212,165,197,213,215,28,85,101,77,207,111,131,52,88,4,161,126,201, - 127,134,234,162,203,183,139,24,146,232,101,24,239,43,121,147,160,140,65,193,147,31,171,156,82,56,60,164,240,212,175,108,234,143,107,238,155,25,189,89, - 97,219,216,30,123,86,28,51,122,128,196,57,47,251,7,223,175,31,77,236,54,67,10,18,99,179,112,192,31,73,230,156,129,63,201,220,137,167,103,142, - 23,255,57,94,231,142,87,103,170,141,184,120,232,249,188,75,21,76,103,231,140,32,240,53,66,207,217,1,175,14,153,227,114,249,158,220,192,59,189,230, - 34,7,17,248,59,184,242,14,44,166,250,70,249,89,147,224,152,252,197,18,251,99,46,188,247,115,223,49,185,112,88,94,192,76,2,27,252,35,194,235, - 47,62,168,51,56,11,142,22,45,167,92,149,92,46,184,91,148,8,76,242,66,97,130,13,198,242,79,70,176,205,201,209,250,101,215,117,59,214,142,230, - 153,166,39,113,177,61,76,216,211,65,244,185,153,155,254,234,227,245,243,130,232,15,72,164,255,177,44,190,73,172,8,62,115,163,242,152,52,179,21,5, - 207,100,95,245,165,223,211,131,21,253,255,93,169,117,52,41,57,195,204,34,10,1,205,16,197,216,109,104,86,106,80,106,214,129,165,91,169,160,154,219, - 68,180,194,18,161,29,75,141,70,109,169,87,41,143,121,118,109,190,21,204,234,66,138,77,193,10,7,212,213,177,147,215,77,237,87,212,246,156,198,73, - 99,175,41,108,217,35,184,99,111,160,226,240,132,176,31,183,58,127,205,137,209,172,244,54,199,240,32,247,226,187,206,149,31,48,32,83,219,180,133,227, - 114,119,6,60,113,4,44,90,154,50,249,101,162,40,57,87,44,238,77,25,33,38,161,136,186,84,147,181,95,125,128,77,20,187,206,147,9,242,96,130, - 60,238,17,65,217,100,134,90,247,64,69,84,65,38,113,132,160,0,0,53,9,114,48,114,0,128,242,139,159,114,58,21,80,53,101,16,84,144,45,4, - 209,248,13,84,191,239,60,233,39,227,199,103,252,3,20,186,180,86,215,47,46,245,229,208,245,139,255,2,80,75,3,4,20,0,2,0,8,0,168,128, - 249,52,105,10,147,139,124,11,0,0,198,82,0,0,23,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,115,116,111,112,46,115,118, - 103,237,92,109,115,219,54,18,254,158,95,161,83,190,36,83,145,196,27,241,34,191,116,122,205,180,211,155,244,174,211,52,115,31,111,40,18,178,88,83, - 164,74,82,150,149,95,127,11,146,162,72,137,178,229,152,86,166,182,149,201,88,0,22,88,224,193,179,139,133,164,229,249,247,183,243,104,112,163,211,44, - 76,226,139,33,182,209,112,160,99,63,9,194,248,234,98,248,249,143,159,44,57,28,100,185,23,7,94,148,196,250,98,24,39,195,239,47,223,156,255,195, - 178,6,63,166,218,203,117,48,88,133,249,108,240,75,124,157,249,222,66,15,222,205,242,124,49,118,156,213,106,101,135,85,165,157,164,87,206,251,129,101, - 65,207,236,230,234,205,96,48,0,181,113,54,14,252,139,97,37,191,88,166,81,33,23,248,142,142,244,92,199,121,230,96,27,59,195,173,184,191,21,95, - 233,137,157,234,44,89,166,126,57,188,239,55,37,211,96,186,21,133,153,172,104,33,132,149,82,14,34,14,33,22,72,88,217,58,206,189,91,43,206,222, - 54,186,194,4,187,186,18,132,144,3,109,91,201,227,164,198,183,17,192,112,112,50,69,107,83,59,64,191,128,255,117,135,26,195,114,173,83,232,169,237, - 88,231,206,135,63,62,56,27,105,11,217,65,30,52,134,217,244,106,233,109,109,71,236,205,117,182,240,124,157,213,42,138,254,171,48,200,103,23,67,38, - 139,210,76,135,87,179,188,46,134,193,197,16,86,135,41,18,69,121,163,127,92,51,8,217,148,148,162,213,160,205,38,70,191,11,244,141,142,218,125,131, - 196,159,120,25,76,213,153,37,115,237,252,25,206,231,158,239,100,169,239,248,55,153,3,220,187,74,172,208,79,98,43,159,1,45,28,24,53,242,38,145, - 118,60,63,135,113,179,189,193,204,202,46,134,115,29,132,158,181,136,188,245,196,243,175,173,44,79,22,246,102,99,234,185,233,219,69,146,230,214,52,140, - 116,217,171,156,66,228,45,18,231,131,206,174,161,147,243,115,234,77,67,223,115,126,129,41,104,167,28,182,82,109,37,203,28,246,79,103,246,34,238,30, - 249,54,88,192,86,42,212,217,184,110,54,182,108,176,37,157,254,207,191,189,24,230,233,82,239,213,175,171,250,75,104,56,15,244,52,51,2,229,54,153, - 18,236,147,42,218,160,213,204,211,75,97,49,65,8,166,85,202,149,146,237,22,34,177,168,250,64,47,3,219,70,22,80,206,215,17,128,100,42,45,63, - 137,146,116,252,22,21,175,179,162,42,1,58,133,249,122,140,207,134,219,62,201,116,154,105,96,16,106,212,21,52,130,30,160,75,13,7,206,241,218,166, - 197,171,173,13,104,37,153,75,57,146,93,106,113,167,90,130,107,181,231,78,123,253,15,133,203,149,236,100,112,185,146,63,30,174,163,81,114,165,236,13, - 37,174,14,146,170,214,199,149,186,7,136,142,37,78,188,73,48,185,3,149,122,116,129,240,61,11,239,24,221,117,93,225,210,254,80,16,219,21,214,102, - 12,170,34,237,195,92,188,104,229,173,179,251,97,146,248,225,48,77,133,249,183,195,187,35,80,227,146,62,28,53,223,15,144,127,80,217,195,64,60,132, - 210,97,148,41,2,128,30,103,35,71,91,36,232,162,167,179,72,208,230,158,12,70,201,57,57,149,99,3,93,236,65,48,118,105,59,26,70,208,198,239, - 131,209,148,188,232,193,48,22,209,220,120,150,106,136,62,223,222,101,252,48,149,182,10,130,49,169,155,175,170,202,207,113,152,67,152,185,204,116,250,201, - 132,106,255,137,63,103,122,79,234,143,212,139,51,136,11,231,16,244,120,121,26,222,190,163,182,203,9,156,253,218,226,35,11,226,9,65,144,59,194,182, - 82,4,35,102,106,136,139,184,43,139,102,70,108,142,49,119,71,68,82,91,72,133,223,215,10,76,216,129,185,178,133,192,98,11,164,9,58,48,66,54, - 65,184,138,2,205,107,218,41,59,237,148,77,161,178,225,15,190,146,178,119,98,173,196,29,212,38,152,244,128,117,110,222,70,112,3,122,103,97,50,66, - 91,216,110,113,1,69,93,94,155,50,134,192,152,74,228,110,165,200,142,20,148,21,5,164,32,154,81,79,9,78,225,31,239,4,135,245,9,14,166,116, - 36,16,112,15,94,59,24,185,54,146,202,37,184,141,148,107,19,5,87,35,214,70,138,181,128,114,137,237,98,228,138,173,215,120,2,139,45,60,224,93, - 22,75,69,111,22,139,71,200,252,179,33,142,21,132,142,152,205,4,21,148,106,11,211,17,230,182,20,20,241,182,97,18,102,75,42,48,225,45,195,164, - 220,102,198,149,180,13,115,95,118,218,41,155,22,240,115,102,148,127,91,100,213,83,33,11,206,143,97,206,92,174,141,213,190,60,104,5,113,159,142,180, - 46,225,140,171,23,74,90,65,196,83,146,150,18,42,229,51,37,237,125,177,145,32,234,53,54,58,81,108,36,40,126,141,141,14,131,67,95,99,163,163, - 156,33,123,202,99,70,40,48,218,151,122,204,176,39,61,102,152,164,228,165,158,50,236,245,148,57,217,41,227,190,158,50,119,128,243,122,202,28,103,177, - 10,191,90,236,169,44,86,209,151,107,177,247,131,227,190,186,179,195,224,136,191,163,59,59,61,80,18,161,94,89,196,180,5,158,75,65,188,197,181,69, - 254,94,88,221,103,113,18,209,158,195,96,240,249,136,81,105,124,61,3,112,144,241,250,2,34,98,78,220,103,227,167,36,226,253,250,169,26,41,37,108, - 164,24,125,34,164,78,31,90,72,244,109,46,3,88,192,85,8,19,60,34,24,130,12,197,212,115,8,45,204,79,138,238,98,37,233,209,150,109,140,40, - 225,100,99,210,46,83,88,0,172,156,218,152,16,9,38,205,109,138,49,149,59,76,21,230,178,74,57,109,241,85,50,155,112,202,164,106,243,21,100,5, - 115,73,219,43,130,71,180,153,106,254,30,224,91,156,32,196,125,130,19,132,112,99,219,132,63,175,203,131,164,248,219,90,56,150,252,197,88,184,43,159, - 165,133,127,3,214,114,244,122,46,157,42,90,226,228,53,198,124,248,25,196,217,235,45,230,56,172,40,35,125,158,65,192,39,172,100,73,180,145,197,33, - 34,71,252,153,222,255,0,57,214,27,114,4,220,186,148,96,149,109,19,101,152,217,136,99,249,212,38,122,242,67,4,192,235,239,59,36,105,43,224,130, - 32,173,67,132,217,74,34,194,119,63,54,85,8,28,191,34,47,232,110,67,25,69,61,242,148,19,136,74,220,157,200,135,81,14,33,17,86,167,139,124, - 206,29,147,93,82,188,171,19,111,76,254,76,112,19,234,213,54,5,197,100,245,84,227,44,188,43,93,252,118,23,0,44,127,3,93,53,76,146,52,208, - 233,166,137,23,175,86,83,245,243,94,147,62,132,21,71,66,178,205,58,234,109,51,131,55,196,80,87,123,54,243,130,100,117,49,36,187,141,95,146,4, - 16,102,187,213,134,144,12,12,154,113,37,247,250,24,94,18,215,22,48,161,250,55,128,219,198,101,154,194,246,89,145,183,214,176,166,226,207,134,166,217, - 44,89,93,165,6,155,169,23,213,224,212,93,77,147,53,153,36,205,116,159,70,115,144,248,75,147,23,103,45,75,2,45,110,43,9,211,207,228,114,133, - 241,213,173,65,192,237,106,89,239,183,232,249,162,106,236,0,166,152,204,34,9,99,163,170,49,157,105,24,69,102,23,125,111,74,117,115,93,75,24,48, - 59,180,50,211,184,191,180,162,58,79,34,13,92,247,53,16,173,158,94,150,167,201,53,212,188,21,68,77,253,233,238,120,171,48,134,237,180,170,100,53, - 41,200,1,129,77,254,154,201,101,233,150,128,9,169,250,20,220,109,92,111,127,175,110,150,88,50,178,123,115,76,123,147,104,37,12,149,223,169,173,164, - 88,240,198,180,146,212,216,185,151,23,105,95,51,40,125,73,160,24,213,166,183,72,178,176,108,164,224,101,21,231,172,237,106,138,193,8,86,141,131,248, - 177,138,148,141,48,67,178,241,235,141,166,34,254,32,69,55,58,205,67,255,43,212,200,190,212,24,216,132,139,37,235,80,67,16,234,15,54,66,224,192, - 147,100,39,216,219,40,34,125,173,135,80,56,108,165,144,188,83,13,235,75,13,118,5,208,141,225,14,182,49,74,73,127,176,89,112,114,33,56,211,24, - 239,212,212,35,175,45,87,218,16,144,40,183,83,81,111,188,198,18,142,31,68,100,55,114,189,241,26,34,28,91,17,210,185,65,102,219,250,82,67,148, - 173,224,10,211,173,70,245,183,59,88,25,247,38,69,199,238,192,77,131,247,167,136,195,37,137,42,46,88,151,162,62,87,196,192,195,113,78,81,231,138, - 154,217,167,143,38,182,4,19,66,2,115,217,161,201,164,105,247,167,9,35,176,33,133,144,234,212,164,122,213,4,193,158,203,72,135,38,136,111,113,29, - 133,238,7,159,69,253,92,231,94,224,229,222,54,18,221,212,96,138,55,73,109,231,105,48,29,255,254,225,167,58,233,204,247,199,255,77,210,235,109,190, - 152,17,240,38,201,18,194,135,58,17,206,164,89,251,99,19,149,123,249,101,56,135,243,222,100,251,127,119,59,143,32,38,174,27,90,194,249,122,161,183, - 131,150,195,110,158,92,208,249,244,131,192,159,135,166,147,243,41,135,80,235,23,163,164,145,28,87,13,26,230,145,190,252,213,36,163,15,126,171,114,220, - 7,191,121,112,165,40,230,81,54,183,122,248,230,105,13,73,122,217,152,138,89,242,15,87,117,210,219,254,248,31,189,69,50,248,209,139,188,185,23,7, - 169,14,187,198,54,251,176,63,78,33,185,167,210,40,140,66,95,199,217,253,136,20,157,195,27,184,53,204,231,73,156,21,224,84,125,51,103,178,182,50, - 207,33,54,114,246,144,201,150,147,63,225,14,215,154,160,81,240,79,239,106,103,153,166,54,10,47,139,140,254,115,167,42,117,138,152,172,193,187,37,54, - 207,25,184,91,234,6,8,156,220,45,50,95,102,161,223,37,82,214,181,86,81,128,188,183,222,98,179,193,180,210,112,178,124,232,134,255,203,187,94,78, - 6,159,114,13,151,216,244,161,187,189,175,179,144,53,70,213,52,178,143,187,4,104,216,217,3,247,190,205,172,133,78,193,112,178,123,153,213,245,232,144, - 223,245,34,77,130,101,241,88,135,54,165,30,57,240,135,48,43,81,233,26,56,213,127,45,67,232,241,85,35,255,59,129,115,91,247,59,230,15,249,225, - 201,62,10,5,157,134,55,197,150,26,54,100,253,78,250,211,204,75,245,15,81,120,221,4,163,160,94,69,181,77,166,111,195,227,159,59,155,35,161,40, - 93,109,143,138,214,125,189,190,221,69,222,68,195,173,247,163,105,28,224,253,171,114,178,92,204,147,64,87,221,235,59,108,145,184,28,132,153,113,15,227, - 48,54,159,13,237,246,221,121,186,199,225,231,123,192,52,23,94,62,123,211,206,138,222,62,5,3,187,103,237,236,104,115,81,31,199,73,172,139,119,141, - 172,236,162,152,46,35,61,214,55,58,78,130,224,172,188,109,143,225,16,122,247,118,255,3,172,247,85,123,121,221,30,227,242,183,87,202,37,155,122,211, - 5,166,60,206,254,90,194,86,52,107,255,76,194,120,12,232,196,193,217,220,75,175,117,90,78,168,124,111,101,185,151,230,173,154,121,24,180,202,58,174, - 202,213,152,192,64,157,70,33,252,25,179,77,93,224,193,157,59,77,1,225,166,164,169,45,179,192,199,104,83,183,133,224,38,204,194,73,24,153,66,241, - 54,210,103,237,109,58,75,32,48,158,70,201,106,211,94,135,34,192,145,95,7,230,163,97,68,37,25,97,98,75,162,48,162,131,143,219,74,106,62,255, - 36,212,85,80,73,139,239,121,204,55,61,221,181,157,3,108,43,191,12,90,49,144,97,0,92,51,221,253,199,72,236,241,168,155,73,117,144,214,228,82, - 151,224,49,10,42,14,118,208,174,96,210,254,167,206,239,143,166,98,115,43,43,218,29,201,182,130,34,207,142,109,238,8,83,155,33,87,184,37,79,92, - 67,167,77,153,118,149,119,229,235,114,39,165,136,232,151,26,245,200,162,241,37,234,102,49,12,174,96,84,148,51,18,138,241,114,138,85,173,153,188,249, - 38,171,92,7,147,66,34,217,93,217,221,127,91,219,88,232,97,166,62,222,65,18,182,227,32,209,203,116,144,39,114,45,61,108,24,62,176,97,130,191, - 96,31,99,190,226,81,204,100,126,109,29,201,182,146,110,189,9,188,5,91,116,149,219,93,217,217,189,174,236,62,207,112,55,121,246,98,156,206,16,103, - 243,112,163,131,156,0,16,191,232,52,57,124,180,236,217,105,105,144,167,49,83,140,158,104,219,39,81,226,95,223,183,235,220,108,141,130,163,217,149,102, - 195,248,136,184,118,185,159,35,66,108,129,192,167,150,37,16,147,46,163,162,148,218,118,234,218,80,214,245,156,171,35,3,148,122,239,235,207,118,32,174, - 54,31,135,100,224,13,204,171,254,244,7,110,194,231,230,211,151,203,55,255,7,80,75,3,4,20,0,2,0,8,0,164,128,249,52,67,149,237,100,185, - 11,0,0,111,89,0,0,24,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,112,97,117,115,101,46,115,118,103,237,92,89,115,227, - 54,18,126,207,175,208,106,94,102,42,34,137,139,56,228,35,149,205,84,82,217,154,236,166,50,73,237,227,22,69,66,54,99,138,84,72,202,199,252,250, - 109,144,20,15,137,146,237,49,101,87,108,105,106,74,98,119,3,13,124,248,26,104,72,128,79,191,187,93,68,163,107,157,102,97,18,159,141,177,141,198, - 35,29,251,73,16,198,23,103,227,63,126,255,209,146,227,81,150,123,113,224,69,73,172,207,198,113,50,254,238,252,155,211,127,88,214,232,135,84,123,185, - 14,70,55,97,126,57,250,57,190,202,124,111,169,71,239,47,243,124,57,117,156,155,155,27,59,172,132,118,146,94,56,31,70,150,5,37,179,235,139,111, - 70,163,17,184,141,179,105,224,159,141,43,251,229,42,141,10,187,192,119,116,164,23,58,206,51,7,219,216,25,55,230,126,99,126,163,103,118,170,179,100, - 149,250,101,245,190,223,182,76,131,121,99,10,45,185,161,133,17,86,74,57,136,56,132,88,96,97,101,119,113,238,221,90,113,246,174,85,20,26,216,87, - 148,32,132,28,208,53,150,15,179,154,222,70,0,195,206,198,20,218,182,119,128,126,9,255,235,2,53,134,101,95,231,80,82,219,177,206,157,143,191,127, - 116,214,214,22,178,131,60,104,85,179,46,213,241,219,25,142,216,91,232,108,233,249,58,171,93,20,229,111,194,32,191,60,27,51,185,188,45,158,47,117, - 120,113,153,183,4,97,112,54,134,30,98,138,68,241,188,110,195,180,102,17,178,41,41,77,171,138,219,42,70,191,13,244,181,142,186,101,131,196,159,121, - 25,52,215,185,76,22,218,249,51,92,44,60,223,201,82,223,241,175,51,7,248,119,145,88,161,159,196,86,126,9,212,112,160,214,200,155,69,218,241,252, - 28,234,205,182,42,51,189,59,27,47,116,16,122,214,50,242,238,102,158,127,101,45,189,85,6,56,86,163,83,55,78,223,46,147,52,183,230,97,164,203, - 98,101,27,34,111,153,56,31,117,118,149,39,75,231,167,212,155,135,190,231,252,12,109,208,78,89,111,229,219,74,86,57,12,162,206,236,101,220,95,243, - 109,176,132,241,84,168,87,121,183,86,158,131,246,52,208,243,204,88,149,48,155,39,192,89,21,58,208,26,55,94,10,109,9,66,8,143,210,174,180,236, - 106,136,196,162,42,3,165,50,232,192,218,22,80,202,239,34,232,163,17,90,126,18,37,233,244,29,42,94,39,133,40,1,74,132,249,221,20,159,140,155, - 50,201,124,158,105,224,0,106,201,10,26,64,9,240,165,198,35,231,225,222,230,197,171,235,13,104,33,153,75,57,146,125,110,113,175,91,130,107,183,167, - 78,183,255,143,133,203,149,236,217,224,114,37,127,58,92,15,70,201,149,114,48,148,184,218,73,170,218,31,87,234,30,32,122,186,56,243,102,193,108,15, - 42,117,237,2,225,123,58,222,83,187,235,186,194,165,195,161,32,154,30,214,177,12,174,34,237,67,91,188,232,198,187,203,238,135,73,226,199,195,52,23, - 230,223,6,239,30,128,26,151,244,241,168,249,126,128,252,157,206,30,7,226,46,148,118,163,76,17,0,244,180,24,121,112,68,130,47,250,124,17,9,222, - 220,103,131,81,114,78,158,107,98,3,95,236,81,48,246,121,123,48,140,224,141,223,7,163,121,242,162,71,195,88,100,100,211,203,84,67,6,249,110,95, - 240,67,83,186,46,8,198,164,86,95,84,194,63,226,48,135,84,17,50,143,244,179,73,183,254,19,255,145,233,45,171,223,83,47,206,32,183,91,64,210, - 226,229,105,120,251,158,218,46,39,176,246,107,139,79,44,200,203,5,65,238,4,219,74,17,140,152,145,16,23,113,87,22,106,70,108,142,49,119,39,68, - 82,91,72,133,63,212,14,252,91,0,144,43,91,8,44,26,32,253,59,144,34,100,19,132,171,44,206,188,230,189,182,243,94,219,20,132,173,249,224,43, - 41,187,23,107,37,246,80,155,96,50,0,214,185,249,24,193,46,230,189,133,137,93,16,114,130,202,119,212,96,120,139,11,92,234,231,59,243,140,33,203, - 165,18,185,141,21,217,176,130,103,69,1,54,72,109,212,33,145,42,38,203,189,72,177,33,145,194,148,22,8,77,4,2,54,194,107,3,40,215,70,82, - 185,4,119,225,114,109,162,96,195,195,186,112,177,14,90,46,177,93,140,92,209,204,35,7,136,225,98,78,220,23,195,84,12,22,195,184,162,82,205,169, - 246,7,72,119,5,161,19,102,51,65,5,165,218,194,116,130,185,45,5,69,188,27,191,132,217,146,10,76,120,39,126,41,183,153,153,113,186,241,187,109, - 59,239,181,77,139,49,225,204,56,127,89,184,213,179,194,13,19,39,195,156,185,28,240,38,111,16,111,65,220,225,240,158,160,73,135,201,46,225,140,171, - 55,202,100,65,196,161,144,53,164,165,132,74,249,74,73,123,95,94,37,136,58,230,85,207,148,87,9,138,7,206,171,38,175,39,149,130,117,122,224,84, - 234,149,102,81,130,29,114,153,17,10,130,246,173,46,51,236,160,203,12,147,148,188,213,85,134,29,87,153,103,91,101,220,227,42,179,7,156,227,42,243, - 176,136,85,248,24,177,207,21,177,138,190,221,136,189,31,28,247,56,157,237,6,71,252,29,167,179,231,7,74,34,52,40,139,152,182,96,230,82,144,111, - 113,109,145,191,23,86,247,69,156,68,116,224,52,216,124,123,200,168,52,115,61,115,205,247,134,240,73,64,70,204,137,251,106,230,41,137,248,176,243,84, - 141,148,18,54,82,140,30,8,169,231,79,45,36,122,153,205,0,22,176,21,194,4,79,8,134,36,67,49,245,26,82,11,115,28,105,31,43,201,128,177, - 108,99,68,9,39,235,144,118,153,194,2,96,229,212,198,132,72,8,105,110,83,140,169,220,96,170,48,155,85,202,105,135,175,146,217,132,83,38,85,151, - 175,96,43,152,75,186,179,34,204,136,54,83,237,179,4,47,177,130,16,247,0,43,8,225,38,182,9,127,93,155,7,73,241,203,70,56,150,252,205,68, - 184,43,95,101,132,191,0,107,57,58,174,75,207,149,45,113,114,204,49,31,191,6,113,246,119,220,197,156,58,230,180,117,241,169,62,72,110,142,131,7, - 215,161,190,105,142,100,155,83,234,85,61,75,239,66,23,103,217,0,162,242,76,96,165,152,37,105,160,211,181,138,23,175,142,170,58,238,102,142,195,99, - 197,145,144,108,61,43,213,3,99,42,111,153,161,62,125,118,233,5,201,205,217,152,108,42,191,36,201,162,57,55,215,12,182,9,62,4,253,134,52,65, - 108,41,77,12,42,91,113,201,169,187,165,92,165,41,12,144,21,121,119,26,250,84,188,173,171,207,46,147,155,139,212,96,51,247,162,26,156,186,168,81, - 89,179,89,114,107,6,117,181,165,14,18,127,101,238,122,88,171,146,34,213,37,3,67,138,48,48,247,19,194,248,226,214,32,224,246,105,238,182,53,122, - 177,172,148,61,192,20,141,89,38,97,108,92,181,154,51,15,163,200,140,162,239,205,169,110,247,107,5,21,102,187,122,102,148,219,93,43,196,121,18,105, - 160,176,175,1,212,186,121,89,158,38,87,32,121,39,136,154,251,243,205,250,110,194,24,134,211,170,46,96,72,65,118,24,172,111,100,152,179,221,253,22, - 208,32,69,240,14,229,93,115,126,211,116,177,100,100,255,224,24,125,155,104,37,12,213,204,82,71,73,209,225,117,104,37,169,137,100,47,47,110,123,92, - 194,211,151,4,30,163,58,244,150,73,22,150,74,42,97,165,225,156,117,167,224,162,50,130,85,43,53,124,170,35,101,35,204,144,108,253,34,217,118,196, - 31,229,232,90,167,121,232,127,133,27,57,148,27,3,155,112,177,100,61,110,8,66,195,193,70,136,173,164,36,27,147,253,218,17,25,170,63,132,218,144, - 83,9,201,123,221,176,161,220,96,87,0,221,24,238,97,27,163,148,12,7,155,69,97,183,196,9,99,188,215,211,128,188,182,92,105,35,200,97,220,94, - 71,131,241,26,75,115,138,142,200,126,228,6,227,53,100,126,182,34,164,119,128,204,176,13,229,134,192,26,7,41,76,191,27,53,220,232,152,181,20,22, - 83,209,51,58,144,119,240,225,28,193,190,7,81,197,5,235,115,52,100,143,24,204,112,156,83,212,219,163,246,109,172,39,19,27,54,198,8,9,204,101, - 143,39,115,237,112,56,79,24,65,12,41,132,84,175,39,53,168,39,72,246,92,70,122,60,193,110,21,215,89,232,118,242,89,200,23,58,247,2,47,247, - 154,76,116,45,193,20,175,47,121,156,166,193,124,250,219,199,31,235,75,24,190,63,253,111,146,94,53,247,39,140,129,55,75,86,144,62,212,23,67,204, - 181,67,127,106,242,110,47,63,15,23,176,222,155,27,172,223,222,46,34,200,137,107,69,199,56,191,91,234,166,210,178,218,245,109,220,222,27,189,129,191, - 8,77,33,231,115,14,169,214,207,198,73,235,178,72,85,105,152,71,250,252,23,115,183,114,244,107,117,103,115,244,171,185,179,89,180,163,84,119,74,248, - 230,6,114,146,158,183,154,98,186,252,253,69,125,9,100,187,254,79,222,50,25,253,224,69,222,194,139,131,84,135,125,117,155,113,216,174,167,176,220,114, - 105,28,70,161,175,227,236,126,68,138,194,225,53,236,26,22,139,36,206,10,112,170,178,153,51,187,179,50,207,33,54,114,182,144,201,86,179,63,97,151, - 214,105,160,113,240,79,239,98,163,155,70,26,133,231,197,5,213,83,167,122,234,53,89,150,192,238,53,169,6,97,191,213,53,48,56,217,111,178,88,101, - 161,223,103,82,202,58,221,40,80,222,234,112,49,218,16,91,105,56,91,61,118,196,255,229,93,173,102,163,207,185,134,125,106,250,216,225,222,246,89,216, - 154,168,106,71,217,167,77,6,180,2,237,145,131,223,165,214,82,167,16,57,217,189,212,234,187,15,255,155,94,166,73,176,42,174,41,119,57,245,196,138, - 63,134,89,137,74,95,197,169,254,107,21,66,137,175,170,249,223,9,44,220,122,216,58,191,207,119,55,246,73,40,232,52,188,46,134,212,176,33,27,182, - 209,159,47,189,84,127,31,133,87,109,48,10,234,85,84,91,95,125,107,77,249,167,206,122,77,40,158,46,154,181,162,179,97,175,183,119,145,55,211,176, - 237,253,100,148,35,188,189,87,78,86,203,69,18,232,170,120,189,137,45,110,242,5,97,102,166,135,105,24,155,175,127,214,235,207,69,103,109,35,146,182, - 110,12,47,189,252,178,117,145,111,237,38,253,159,249,230,161,181,251,220,212,222,110,107,161,114,83,27,236,77,220,150,24,164,191,140,204,111,21,146,187, - 220,157,96,98,75,162,48,162,163,79,45,41,101,176,171,33,212,85,32,53,159,49,225,174,220,33,237,175,161,145,126,25,109,223,161,109,110,180,99,247, - 164,123,211,209,124,201,48,141,147,88,23,159,90,55,44,139,199,116,21,233,169,190,214,113,18,4,39,229,55,5,83,88,64,223,191,219,254,177,236,67, - 165,47,191,42,152,226,242,44,132,114,201,90,110,138,0,124,211,236,175,21,176,168,45,253,51,9,227,41,12,108,28,156,44,188,244,74,167,101,131,202, - 207,86,150,123,105,222,145,44,194,160,243,172,227,234,185,170,19,130,71,167,81,8,111,83,182,150,5,94,6,228,77,129,28,109,75,35,45,111,116,78, - 209,90,214,64,112,29,102,225,44,140,204,67,241,49,210,39,93,134,157,36,144,212,207,163,228,102,173,111,135,197,6,181,106,122,180,14,153,54,244,96, - 144,150,79,48,181,25,114,133,91,142,108,33,130,113,95,139,204,199,29,162,158,130,181,168,143,15,61,20,40,70,117,251,231,230,15,15,166,69,27,214, - 138,2,15,28,249,98,184,94,239,200,239,198,252,233,97,135,182,195,174,116,128,223,86,216,237,11,40,161,24,239,70,148,107,0,234,70,212,166,168,175, - 100,35,235,196,84,29,217,162,245,203,204,189,171,69,207,74,243,128,185,3,227,173,174,138,170,113,205,172,176,22,209,102,86,48,31,119,136,122,10,214, - 162,7,206,29,3,240,24,109,240,184,58,74,167,196,113,14,25,181,255,138,16,32,169,205,150,53,131,129,48,175,241,192,201,11,107,253,208,187,102,152, - 180,17,134,212,162,224,133,98,68,184,210,112,165,150,18,106,83,72,170,164,42,73,133,48,69,76,78,8,177,5,82,92,116,132,80,129,116,25,21,157, - 242,77,173,251,83,151,222,204,101,253,247,71,118,178,15,198,235,139,78,147,221,171,212,214,68,89,206,136,207,51,79,98,116,32,134,205,162,196,191,218, - 77,176,83,231,162,47,57,134,205,55,145,140,109,255,41,153,30,210,236,163,91,190,235,143,25,40,65,136,50,167,136,247,175,149,135,207,87,93,121,204, - 87,251,23,206,151,217,168,52,75,28,147,135,89,68,31,153,250,114,116,76,125,135,200,190,14,186,157,105,88,227,162,3,165,94,131,124,35,224,146,23, - 205,80,15,153,185,113,114,220,129,188,216,246,143,179,99,218,220,51,255,60,219,150,168,21,225,236,160,171,214,49,11,30,50,11,126,236,6,199,28,138, - 20,130,203,238,6,135,217,176,231,65,76,125,245,14,167,197,30,254,36,246,60,100,159,184,145,249,23,111,167,230,39,213,243,111,254,15,80,75,3,4, - 20,0,2,0,8,0,165,128,249,52,158,228,190,4,151,9,0,0,193,42,0,0,24,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107, - 45,115,116,97,114,116,46,115,118,103,237,89,235,115,219,184,17,255,158,191,130,85,190,196,115,34,137,7,159,178,229,155,52,158,235,164,147,235,221,92, - 146,233,199,14,68,66,18,99,138,224,145,148,37,229,175,239,2,124,75,148,45,219,236,181,211,86,153,140,73,236,11,216,253,45,176,11,222,252,184,223, - 196,218,3,207,242,72,36,243,9,54,208,68,227,73,32,194,40,89,205,39,95,191,252,164,123,19,45,47,88,18,178,88,36,124,62,73,196,228,199,219, - 55,55,127,210,117,237,67,198,89,193,67,109,23,21,107,237,99,114,159,7,44,229,218,187,117,81,164,51,211,220,237,118,70,84,13,26,34,91,153,87, - 154,174,131,100,254,176,122,163,105,26,152,77,242,89,24,204,39,21,127,186,205,98,197,23,6,38,143,249,134,39,69,110,98,3,155,147,150,61,104,217, - 119,124,97,100,60,23,219,44,40,213,7,65,151,51,11,151,45,43,204,100,71,21,19,246,125,223,68,196,36,68,7,14,61,63,36,5,219,235,73,254, - 182,35,10,19,28,18,37,8,33,19,104,45,231,101,92,179,125,12,110,56,59,25,69,237,90,7,215,167,240,191,17,104,124,88,174,117,9,146,220,72, - 120,97,222,125,185,51,107,110,29,25,97,17,118,212,212,82,61,187,189,112,36,108,195,243,148,5,60,111,76,40,249,93,20,22,235,249,196,242,210,189, - 122,95,243,104,181,46,58,3,81,56,159,192,10,49,69,174,122,175,231,48,107,80,132,12,74,74,214,74,113,151,100,209,31,66,254,192,227,190,108,40, - 130,5,203,97,186,230,90,108,184,249,45,218,108,88,96,230,89,96,6,15,185,9,248,91,9,61,10,68,162,23,107,128,134,9,90,99,182,136,185,201, - 130,2,244,230,39,202,228,234,230,147,13,15,35,166,167,49,59,44,88,112,175,3,142,179,194,168,163,211,76,142,239,83,145,21,250,50,138,121,41,86, - 206,33,102,169,48,239,120,126,95,136,212,252,75,198,150,81,192,204,143,48,7,110,150,122,43,219,186,216,22,16,68,158,27,105,50,172,121,31,166,16, - 79,31,13,18,15,53,241,22,168,55,33,95,230,146,171,116,179,124,3,63,251,138,6,84,105,134,101,48,151,48,130,244,40,249,74,206,62,133,56,158, - 85,201,128,84,14,11,168,121,171,240,193,8,240,56,147,118,88,44,151,57,135,48,163,206,88,94,28,98,94,114,235,129,136,69,54,123,187,84,191,107, - 53,36,0,61,81,113,152,225,235,137,102,62,109,205,27,176,134,31,183,134,212,239,172,181,27,179,191,236,231,122,201,62,239,165,203,39,243,184,11,155, - 245,219,224,237,179,94,186,208,209,232,250,9,23,118,172,121,99,121,201,70,174,253,12,47,177,112,129,152,247,66,47,129,45,247,89,94,178,28,203,181, - 172,35,107,23,58,9,140,249,163,65,201,241,91,19,77,134,195,36,99,30,128,121,22,239,216,33,127,58,35,125,58,82,70,94,146,144,190,253,252,132, - 12,105,232,6,203,177,188,70,169,133,38,175,75,137,139,161,5,182,200,235,19,208,112,136,231,57,182,239,92,154,137,96,214,122,161,187,206,161,168,102, - 80,149,195,108,157,113,168,116,222,14,228,236,35,104,165,168,221,250,87,213,224,215,36,42,160,164,217,230,60,251,44,203,130,95,146,175,57,111,141,225, - 249,196,197,6,172,222,183,91,217,3,140,98,98,25,24,59,54,105,121,9,240,34,195,3,136,89,237,232,1,70,59,144,171,205,126,201,88,146,67,81, - 179,153,79,10,249,24,67,73,249,78,183,108,3,246,90,139,76,117,48,138,64,141,125,213,122,81,74,178,120,76,127,245,211,23,252,213,55,65,40,182, - 158,233,175,129,229,109,88,145,69,251,119,54,20,71,22,128,145,235,176,58,240,18,117,8,245,166,196,64,216,183,92,58,69,6,38,158,237,120,83,29, - 219,216,240,177,111,79,49,242,12,228,58,222,85,163,61,216,131,223,145,107,192,54,223,78,44,56,204,39,30,53,124,31,121,157,233,46,135,88,151,131, - 172,153,12,166,97,219,216,233,98,118,124,116,170,234,228,209,189,20,141,230,109,44,221,137,61,60,69,240,175,121,209,109,185,120,136,234,84,7,55,80, - 7,33,255,170,15,117,4,174,167,39,80,71,216,112,45,124,10,117,223,198,199,80,247,60,195,39,212,37,245,17,115,99,202,98,78,61,53,117,170,172, - 54,195,135,136,239,218,138,79,22,193,149,158,148,173,184,218,139,192,129,229,102,84,17,22,34,11,121,86,147,28,245,235,145,170,237,74,86,219,216,119, - 144,235,89,245,185,210,132,77,42,239,176,149,181,13,26,226,202,215,44,20,187,249,132,28,19,191,11,177,105,55,189,22,16,0,56,203,50,108,23,128, - 116,34,35,49,10,24,243,61,68,154,122,176,37,110,179,12,130,168,67,185,206,97,101,234,79,173,62,95,139,221,42,147,30,90,178,184,113,81,35,42, - 73,250,98,33,246,114,23,217,158,144,161,33,216,202,134,82,223,150,48,170,58,25,9,156,40,148,77,16,116,187,123,233,7,123,136,114,56,165,240,77, - 90,17,7,28,163,38,147,138,40,145,166,58,211,129,6,35,134,128,217,54,248,134,118,215,181,5,133,249,185,149,73,226,233,210,212,112,33,98,14,136, - 15,224,228,194,205,244,242,34,19,247,252,216,78,163,111,23,37,16,78,189,234,242,60,151,156,97,168,219,62,187,233,18,142,57,96,66,148,156,35,130, - 207,108,167,27,188,18,153,195,225,145,244,46,212,74,71,84,251,79,147,45,106,201,117,138,137,76,230,59,43,84,83,185,134,183,239,2,94,227,38,5, - 83,145,71,37,145,66,34,250,14,212,137,189,45,71,41,35,144,181,237,70,247,90,67,62,108,225,22,242,44,123,208,144,243,44,67,208,47,23,208,110, - 62,223,140,55,150,25,233,54,215,198,71,59,117,105,134,192,78,49,154,219,136,220,14,60,216,151,7,13,145,177,214,67,96,199,71,158,219,233,121,187, - 102,172,177,204,96,219,5,184,89,120,0,109,22,165,100,60,183,233,212,49,144,67,44,203,25,180,52,34,174,117,27,202,143,94,187,208,53,52,26,174, - 177,39,143,33,226,13,123,110,52,92,203,90,200,39,100,48,64,50,108,99,153,33,190,225,83,228,13,155,241,199,139,14,246,229,246,230,185,3,209,177, - 49,114,198,51,228,80,3,81,223,113,173,33,67,99,174,200,130,29,206,113,40,26,92,17,193,35,2,219,131,20,66,46,118,188,1,75,242,118,115,60, - 75,170,132,247,161,204,28,180,228,143,106,9,138,62,219,34,3,150,40,198,184,169,70,79,139,80,53,190,225,5,11,89,193,218,138,180,30,193,20,202, - 185,186,3,11,151,179,223,238,126,106,154,233,32,152,253,93,100,247,109,251,43,25,216,66,108,161,128,104,26,124,121,187,25,204,100,117,206,138,219,104, - 3,231,189,188,40,255,97,191,137,161,54,110,8,61,230,226,144,242,86,105,169,182,190,244,31,252,112,16,6,155,72,10,153,159,11,40,182,62,74,35, - 157,166,191,82,26,21,49,191,253,89,94,225,106,191,86,87,195,218,103,121,53,172,230,81,146,123,18,129,252,208,33,178,219,206,84,228,146,223,175,154, - 30,254,84,255,39,150,10,237,3,139,217,134,37,97,198,163,33,221,50,14,167,122,20,231,137,73,105,48,142,2,158,228,79,123,68,9,71,15,208,61, - 108,54,34,201,149,115,42,217,220,92,28,244,156,153,208,111,154,39,158,201,183,139,111,208,203,245,38,40,13,252,153,173,142,150,41,71,227,232,86,222, - 172,223,152,213,203,32,135,186,41,127,130,101,155,71,193,227,44,15,128,94,241,56,75,170,218,133,33,158,114,172,183,6,229,226,147,213,170,80,67,98, - 101,209,98,251,220,112,255,149,221,111,23,128,34,14,173,108,246,220,88,159,218,84,188,50,165,186,41,246,233,56,252,157,44,123,102,228,251,184,74,121, - 6,105,147,63,137,171,161,111,110,191,241,52,19,225,86,125,10,233,3,234,149,138,239,162,188,244,202,144,226,140,255,190,141,64,226,69,154,255,38,224, - 212,230,227,234,124,95,156,159,236,171,188,192,179,232,65,133,84,162,33,31,119,210,159,215,44,227,239,227,232,190,235,12,5,189,10,106,245,181,101,103, - 191,191,49,235,3,65,189,173,78,122,95,177,77,55,34,228,85,255,62,105,15,18,245,110,29,247,126,49,91,112,232,138,101,14,136,44,17,77,19,171, - 238,99,195,40,151,121,61,139,18,121,69,84,159,93,171,35,157,248,140,206,79,146,168,225,201,101,83,28,54,89,121,32,101,197,186,118,113,123,114,130, - 14,121,216,64,235,30,192,175,119,224,74,1,226,120,237,157,16,140,253,172,97,50,165,190,97,107,159,228,147,15,127,160,203,66,142,239,123,83,104,79, - 60,236,34,215,47,105,138,235,187,214,72,87,147,235,127,137,146,247,9,48,137,132,171,167,206,149,184,122,205,182,49,159,241,7,14,179,12,175,203,75, - 129,25,156,148,239,78,175,62,209,85,69,47,111,5,102,24,42,74,248,121,148,214,227,82,4,124,55,203,127,223,2,98,186,163,223,68,148,204,192,161, - 73,120,189,97,217,61,207,202,9,149,207,229,7,215,222,200,38,10,123,239,60,169,222,43,157,144,40,60,139,35,248,51,179,234,177,144,229,0,212,12, - 130,210,229,148,163,229,205,251,12,213,99,173,11,30,162,60,90,68,177,124,81,143,49,191,238,71,246,90,64,245,190,140,197,174,161,183,151,252,216,62, - 253,150,147,253,35,232,223,192,244,105,135,138,214,20,114,93,196,12,49,94,98,224,124,212,85,32,79,47,169,175,46,70,66,215,147,117,212,75,3,212, - 249,95,138,250,113,126,26,22,116,239,206,148,186,144,142,216,42,179,177,26,195,213,53,169,76,95,104,190,29,68,92,203,157,170,123,5,219,181,188,46, - 107,35,222,73,225,122,87,160,180,211,171,157,221,75,254,32,28,189,122,247,160,200,185,250,63,142,254,29,56,34,150,235,255,199,224,168,254,90,250,242, - 237,231,210,179,70,133,248,191,14,45,126,141,12,207,181,106,180,148,99,128,16,159,66,137,32,193,98,27,182,79,9,110,176,210,229,107,100,191,107,160, - 145,214,163,196,144,119,132,74,154,26,182,131,125,167,39,93,243,129,106,236,149,86,78,101,7,193,215,185,175,61,7,190,243,0,172,128,212,158,184,246, - 245,75,64,5,33,250,206,51,113,30,84,228,24,84,229,94,243,199,236,64,24,253,139,64,181,136,69,112,255,20,166,32,138,112,208,200,32,218,14,177, - 171,184,202,17,98,25,240,254,65,195,158,65,144,227,200,218,19,70,144,77,176,173,1,52,48,194,142,93,129,196,178,168,163,81,192,27,49,64,178,163, - 163,214,58,132,12,74,253,23,87,79,23,110,103,55,38,244,242,55,242,246,232,246,205,63,1,80,75,3,4,20,0,2,0,8,0,4,134,250,52,115, - 77,182,120,141,10,0,0,123,45,0,0,16,0,0,0,109,101,100,105,97,45,114,101,99,111,114,100,46,115,118,103,229,90,89,143,227,54,18,126,159, - 95,161,245,188,100,16,139,226,45,210,125,4,179,25,36,8,144,236,2,57,176,143,11,181,68,187,149,145,37,71,146,187,237,249,245,91,164,37,89,178, - 228,62,102,156,236,67,186,209,104,139,85,172,34,191,250,84,197,195,215,223,236,214,153,247,96,202,42,45,242,155,25,65,120,230,153,60,46,146,52,95, - 221,204,126,251,245,59,95,205,188,170,142,242,36,202,138,220,220,204,242,98,246,205,237,155,235,127,248,190,247,109,105,162,218,36,222,99,90,223,123,63, - 228,31,171,56,218,24,239,171,251,186,222,44,130,224,241,241,17,165,77,35,42,202,85,240,206,243,125,232,89,61,172,222,120,158,7,110,243,106,145,196, - 55,179,70,127,179,45,51,167,151,196,129,201,204,218,228,117,21,16,68,130,217,81,61,62,170,63,154,59,84,154,170,216,150,241,193,124,28,247,53,203, - 100,121,84,133,145,60,50,167,68,180,214,1,166,1,165,62,104,248,213,62,175,163,157,159,87,111,123,93,97,128,83,93,41,198,56,0,217,81,243,101, - 90,139,93,6,48,156,29,140,147,246,189,3,244,27,248,235,58,116,24,30,230,186,132,158,6,229,166,14,62,252,250,33,104,181,125,140,146,58,233,153, - 105,123,13,252,14,194,145,71,107,83,109,162,216,84,157,11,215,255,49,77,234,251,155,25,87,155,157,123,190,55,233,234,190,238,53,164,201,205,12,102, - 72,24,14,221,115,59,134,69,199,34,140,24,61,168,54,134,251,34,206,190,78,204,131,201,134,125,147,34,190,139,42,24,110,112,95,172,77,240,123,186, - 94,71,113,80,149,113,16,63,84,1,240,111,85,248,105,92,228,126,125,15,212,8,192,106,22,221,101,38,136,226,26,236,86,35,99,118,118,55,179,181, - 73,210,200,47,77,92,148,9,106,163,210,13,202,236,54,69,89,251,203,52,51,7,245,131,239,44,218,20,193,7,83,125,172,139,77,240,125,25,45,211, - 56,10,126,0,223,38,56,216,107,124,250,197,182,134,224,153,10,109,242,105,203,187,100,3,113,212,120,82,184,111,133,183,32,189,78,204,178,178,90,7, - 120,237,19,224,171,157,12,164,214,77,84,194,88,146,20,94,139,131,222,65,115,40,97,138,133,77,31,232,85,193,4,90,93,64,167,222,103,48,71,219, - 232,199,69,86,148,139,183,216,253,92,185,166,2,168,144,214,251,5,185,154,29,251,20,203,101,101,32,246,184,215,230,194,15,61,192,151,158,121,193,203, - 189,45,221,207,208,27,70,161,98,2,11,194,167,220,146,73,183,156,116,110,175,131,225,252,95,9,23,165,226,53,112,153,37,213,84,191,16,30,176,253, - 58,120,226,216,6,227,133,40,80,42,63,23,133,150,134,224,54,51,49,216,143,178,199,104,95,205,158,96,21,227,120,246,101,113,126,57,171,24,167,95, - 206,170,23,147,137,113,254,151,193,168,164,164,127,213,203,9,190,248,171,96,156,242,246,98,24,193,155,124,14,70,251,20,101,175,134,209,149,199,197,125, - 105,160,156,191,157,192,179,15,247,208,5,165,84,117,226,85,211,248,91,158,214,80,183,183,149,41,127,177,181,239,223,249,111,149,25,105,253,90,70,121, - 5,133,118,13,21,36,170,203,116,247,21,153,99,251,139,4,147,33,101,115,159,33,202,137,20,212,248,132,205,137,68,42,100,88,190,235,12,197,187,155, - 25,229,8,178,49,161,242,216,186,191,153,49,137,56,37,132,134,93,235,114,82,119,57,169,91,2,254,2,73,206,67,200,243,29,224,151,135,214,189,241, - 231,161,37,76,94,14,90,134,164,80,138,104,11,42,97,76,41,192,84,206,9,10,137,6,180,221,3,69,88,225,80,209,185,47,41,2,220,249,156,80, - 20,74,138,249,9,228,4,65,130,38,106,8,185,13,22,81,84,51,62,196,124,164,188,156,86,182,160,179,63,19,109,87,134,158,34,178,100,195,105,82, - 36,6,51,164,10,17,34,49,215,195,9,246,213,150,147,106,118,106,28,72,29,170,222,171,116,62,84,20,49,41,132,132,56,112,164,57,165,156,186,240, - 8,196,132,14,101,27,43,138,169,226,2,194,9,197,157,10,18,194,39,142,40,211,186,247,130,60,77,154,14,235,207,204,189,79,49,219,174,144,158,90, - 64,241,35,214,59,226,88,18,98,202,212,17,179,61,180,42,164,9,17,140,28,73,178,163,78,87,1,190,228,136,250,30,90,153,64,130,75,130,213,107, - 39,255,151,19,13,38,47,46,246,90,95,142,43,127,34,229,15,88,95,7,118,189,237,62,117,91,8,187,33,72,30,82,243,120,92,148,219,253,73,99, - 102,19,173,140,43,156,0,241,97,1,210,8,238,96,163,97,202,86,36,221,207,64,212,212,86,187,17,34,132,193,156,187,161,117,129,181,198,123,106,120, - 74,94,221,71,73,241,8,243,59,21,126,42,138,245,177,72,31,201,178,59,148,19,173,41,99,35,161,173,53,128,137,22,29,73,143,178,109,89,66,124, - 253,44,218,27,152,146,251,215,90,175,238,139,199,85,105,161,89,70,89,135,77,215,213,138,252,187,187,2,92,215,229,118,36,134,77,218,214,110,242,253, - 237,129,97,205,238,210,114,42,77,236,198,52,205,87,59,11,128,152,146,236,199,18,179,222,52,194,9,92,220,96,54,69,154,91,87,189,225,192,230,47, - 131,72,13,150,246,110,94,91,48,88,157,155,153,21,142,167,230,154,235,34,51,240,50,196,176,190,34,221,240,170,186,44,62,154,83,63,157,189,199,52, - 135,104,250,205,206,91,133,244,140,66,187,21,151,103,53,96,64,92,243,51,66,23,102,222,155,228,129,146,211,225,177,242,62,211,14,64,52,169,169,123, - 77,220,148,219,87,171,40,109,42,136,106,183,209,191,135,167,79,5,60,102,221,171,183,41,170,244,32,100,144,64,53,44,81,135,217,200,25,163,68,247, - 150,228,95,234,72,35,76,56,238,231,181,190,35,249,42,71,15,166,172,211,248,51,220,168,75,185,177,176,133,130,40,62,225,134,194,222,241,98,176,65, - 30,213,74,81,69,38,29,209,75,205,135,50,164,177,10,123,75,176,190,27,126,41,55,68,132,64,55,78,38,216,198,25,163,151,131,205,135,20,139,37, - 229,92,78,122,186,32,175,125,161,16,166,82,139,73,71,23,227,53,81,80,127,160,68,79,35,119,49,94,19,12,1,162,116,50,64,54,108,151,114,67, - 53,210,12,171,105,55,250,114,209,33,218,166,55,21,78,68,71,16,44,47,231,72,50,132,153,150,33,159,114,116,201,25,113,200,112,82,50,60,57,35, - 74,46,72,108,5,175,16,14,73,111,131,121,244,100,79,156,47,231,9,150,228,8,107,140,245,164,39,125,81,79,176,218,19,156,78,120,98,132,144,110, - 25,58,94,125,186,246,181,169,163,36,170,163,227,82,180,109,33,140,180,71,74,215,101,178,92,252,252,225,187,238,200,39,142,23,255,41,202,143,199,211, - 26,171,16,221,21,91,88,64,116,199,80,246,228,57,94,216,133,123,84,223,166,107,168,247,246,242,226,235,221,58,131,69,113,39,24,40,215,251,141,57, - 26,61,152,109,47,98,38,47,115,146,120,157,218,78,193,47,53,44,182,126,176,78,122,71,83,141,209,180,206,204,237,79,246,120,221,251,217,29,215,59, - 255,135,230,129,102,108,47,157,138,242,182,55,4,59,213,247,171,238,168,105,108,247,199,104,83,120,223,70,89,180,142,242,164,52,233,148,109,139,255,216, - 142,211,28,185,180,14,179,52,54,121,245,60,18,174,115,250,0,115,90,175,139,188,114,160,52,125,171,224,110,239,87,81,64,17,14,70,136,84,219,187, - 223,97,123,55,24,160,117,240,207,104,117,50,77,219,154,165,183,238,110,226,58,104,158,38,85,54,110,249,254,180,78,217,160,255,148,206,122,91,165,241, - 211,42,128,66,254,140,149,7,160,127,49,165,114,104,27,76,212,197,225,4,18,23,47,75,241,62,229,127,60,13,75,143,245,175,140,200,48,222,27,83, - 2,141,171,103,227,61,117,47,249,179,217,148,69,178,117,215,70,195,64,127,161,225,15,41,236,44,210,187,237,164,225,210,252,177,77,161,199,103,89,254, - 87,1,85,212,92,214,230,251,250,252,96,191,8,5,83,166,15,46,164,150,13,213,101,7,253,203,125,84,154,247,89,250,177,15,134,163,94,67,181,246, - 212,187,151,127,175,131,54,65,187,167,213,49,113,15,246,207,221,94,43,139,238,12,236,66,127,180,66,143,140,183,174,197,118,179,46,18,211,116,239,246, - 148,238,16,63,73,43,251,90,47,210,220,158,245,180,197,96,19,213,247,237,116,235,209,217,12,134,213,22,150,58,108,14,181,181,102,66,205,25,146,161, - 230,138,207,9,146,156,80,214,59,129,129,129,255,228,193,218,86,120,148,122,239,61,194,61,194,60,236,17,248,245,20,18,243,113,107,171,252,169,179,209, - 213,182,114,239,206,83,199,237,59,123,50,51,110,119,167,61,116,162,253,244,188,199,226,107,231,205,20,59,54,54,40,29,239,27,137,184,26,94,121,216, - 19,128,5,148,171,175,222,142,79,195,222,57,105,239,250,197,61,150,219,204,44,204,131,201,139,36,185,58,108,237,15,6,198,103,137,239,26,249,97,111, - 191,176,39,220,82,18,216,248,182,237,182,11,68,121,81,253,177,5,158,245,91,127,47,210,124,81,218,52,122,181,142,202,143,166,92,228,69,110,154,207, - 126,85,71,101,61,104,89,167,201,224,217,228,205,115,99,19,94,47,83,102,41,252,91,240,182,45,137,96,123,95,150,64,159,190,166,109,61,92,247,44, - 112,219,118,132,224,33,173,210,187,52,179,15,238,99,102,174,134,28,188,42,96,13,190,204,138,199,86,62,142,157,93,14,220,204,162,50,158,141,142,53, - 203,255,198,195,83,149,161,108,223,200,186,197,89,159,233,103,175,216,207,41,236,158,83,248,220,239,6,116,95,9,120,102,218,35,122,194,114,222,253,188, - 144,164,246,146,235,229,36,237,7,249,64,72,114,202,67,72,207,245,136,133,142,58,23,103,33,193,255,39,26,182,137,2,192,147,103,242,202,232,62,110, - 144,142,198,23,115,195,44,214,93,209,77,38,63,133,96,203,166,116,47,73,185,252,202,49,226,138,40,201,188,206,188,205,170,173,45,175,235,214,230,88, - 141,136,166,76,41,49,127,97,135,41,15,199,4,61,46,19,4,146,37,22,140,181,119,159,82,72,112,230,115,36,66,41,236,173,167,16,84,137,119,211, - 239,226,243,164,127,41,195,37,59,101,56,194,231,57,222,124,143,226,132,230,8,135,34,164,92,254,45,211,110,199,119,65,197,11,234,232,179,149,247,92, - 165,62,169,236,151,88,53,76,173,93,20,172,82,36,109,215,46,82,132,176,116,81,66,132,161,189,80,146,18,51,174,46,201,73,23,162,151,102,216,183, - 203,48,76,194,228,148,125,148,132,76,195,223,223,157,126,225,185,116,123,134,124,252,149,228,227,39,228,83,30,229,13,201,120,75,50,130,231,227,198,131, - 230,51,188,163,132,83,221,240,174,121,224,8,50,32,33,33,124,32,154,112,113,54,27,158,214,121,121,54,225,217,47,87,124,73,73,199,136,138,77,253, - 138,186,62,138,245,201,150,98,0,41,133,119,141,51,2,233,159,32,141,69,200,189,111,61,18,66,109,96,146,40,215,168,160,98,8,143,80,196,153,10, - 105,232,190,29,163,195,80,107,219,134,25,134,210,1,70,176,102,212,245,85,136,192,166,35,100,115,10,133,139,96,76,61,248,160,49,193,225,156,218,157, - 8,197,36,244,152,64,36,164,82,128,91,141,66,66,152,176,125,25,135,122,198,41,119,181,72,75,26,42,225,49,128,150,132,80,244,142,3,180,183,12, - 90,243,254,136,109,19,15,165,102,3,45,72,44,33,110,155,176,10,39,38,251,201,155,162,181,30,211,17,98,100,108,150,169,32,167,196,113,21,119,103, - 124,171,219,55,215,246,140,237,246,205,255,0,80,75,3,4,20,0,2,0,8,0,225,128,249,52,157,141,185,194,180,16,0,0,195,74,0,0,22,0, - 0,0,112,114,101,102,101,114,101,110,99,101,115,45,115,121,115,116,101,109,46,115,118,103,237,91,217,114,219,72,150,125,247,87,112,232,151,170,104,18, - 204,125,161,37,117,212,148,163,39,122,194,179,68,187,42,230,25,4,65,9,101,146,208,0,208,230,175,159,115,19,32,9,144,144,68,173,49,209,46,50, - 202,34,114,207,147,119,57,247,38,234,228,175,183,171,229,224,58,45,202,44,95,159,14,121,196,134,131,116,157,228,243,108,125,126,58,252,253,183,191,141, - 221,112,80,86,241,122,30,47,243,117,122,58,92,231,195,191,158,125,56,249,151,241,120,240,107,145,198,85,58,31,220,100,213,197,224,239,235,111,101,18, - 95,166,131,159,46,170,234,114,58,153,220,220,220,68,89,83,24,229,197,249,228,231,193,120,140,158,229,245,249,135,193,96,128,105,215,229,116,158,156,14, - 155,246,151,87,197,50,180,155,39,147,116,153,174,210,117,85,78,120,196,39,195,93,243,100,215,252,38,157,69,69,90,230,87,69,82,15,159,36,237,150, - 197,124,177,107,138,149,220,200,208,136,123,239,39,76,76,132,24,163,197,184,188,91,87,241,237,120,93,126,108,117,197,2,251,186,10,198,216,4,117,187, - 150,199,181,154,222,46,1,195,189,139,9,181,237,217,1,253,37,254,219,118,216,98,88,239,117,129,158,105,180,78,171,201,231,223,62,79,54,173,199,44, - 154,87,243,214,48,155,94,157,121,59,199,177,142,87,105,121,25,39,105,185,157,34,244,223,60,76,211,219,203,188,168,198,119,243,75,44,198,179,136,133, - 79,111,155,219,35,218,44,178,101,74,115,158,14,39,23,249,42,157,252,145,173,86,113,50,249,156,150,223,170,252,114,114,147,161,69,116,185,174,145,187, - 201,230,213,197,233,80,185,203,219,240,124,145,102,231,23,85,171,32,155,159,14,1,51,231,178,153,110,131,196,116,43,203,44,146,162,187,146,86,149,146, - 127,153,167,215,233,178,219,119,158,39,179,184,220,95,98,89,36,147,228,186,156,64,11,206,243,113,150,228,235,113,117,1,1,157,96,212,101,60,91,166, - 147,4,122,112,158,23,89,90,30,140,87,111,249,178,72,23,105,1,197,74,75,8,93,89,165,171,136,132,228,12,173,79,230,233,162,164,94,245,166,232, - 73,134,10,84,65,54,210,184,248,183,34,158,103,80,135,186,81,107,63,73,190,92,166,9,96,137,151,55,241,93,61,247,102,156,110,87,33,52,107,6, - 197,176,37,0,223,180,197,106,171,187,37,150,72,133,99,140,152,23,211,143,139,240,249,20,138,114,200,72,86,221,77,249,167,225,174,79,190,88,148,41, - 38,102,173,178,112,36,232,129,185,196,112,48,121,217,108,172,111,54,222,63,155,218,206,118,50,233,110,251,245,97,52,250,9,48,214,218,240,108,24,141, - 125,18,140,125,179,61,1,70,227,223,17,70,109,223,81,26,253,123,74,163,225,207,132,241,0,37,201,220,83,80,146,202,232,88,61,19,37,204,245,0, - 74,187,86,94,63,50,96,207,194,252,98,150,164,252,96,97,79,57,19,51,243,58,137,159,45,1,74,60,190,55,180,82,125,3,70,86,63,188,61,57, - 55,113,172,95,180,61,233,76,58,59,230,232,120,239,209,249,87,20,57,251,20,145,243,46,102,177,127,182,200,217,167,41,102,34,231,108,62,127,54,74, - 238,21,81,130,146,191,147,249,194,92,242,197,94,224,9,40,193,191,189,26,74,202,63,1,165,153,161,239,179,81,210,252,24,21,55,162,87,197,31,209, - 240,133,160,239,139,52,124,17,211,247,152,221,69,198,26,46,188,118,253,222,69,29,181,77,215,59,178,83,128,201,10,241,240,110,231,142,190,199,239,182, - 53,173,233,159,214,190,61,190,243,25,125,159,45,245,90,190,27,247,129,90,240,247,162,144,152,75,190,31,133,196,108,143,26,15,122,138,151,79,134,49, - 4,201,211,11,4,81,167,195,143,61,120,182,225,238,78,129,106,187,173,78,110,79,135,66,69,142,139,157,68,38,119,167,67,233,163,118,209,162,167,217, - 226,176,89,1,24,108,100,218,226,125,222,204,250,91,17,175,75,68,234,171,211,225,42,174,138,236,246,39,222,132,198,35,214,243,67,90,165,181,27,217, - 136,123,37,165,76,199,92,143,176,0,101,177,183,159,15,6,255,125,157,85,229,233,240,170,76,139,175,20,191,255,215,250,247,50,221,1,255,76,73,125, - 24,98,255,160,68,235,29,2,183,28,168,248,200,40,39,213,206,208,220,161,84,137,72,104,105,216,238,180,110,5,112,134,193,147,28,228,107,215,22,165, - 38,178,86,59,38,249,145,155,127,28,127,50,67,78,216,126,252,155,42,17,97,125,222,185,145,138,60,172,176,3,246,111,138,170,225,15,162,106,108,7, - 85,205,34,174,133,111,97,66,168,142,37,240,3,117,181,182,11,171,142,132,231,204,153,14,172,99,21,73,198,16,195,202,215,199,117,204,33,198,218,43, - 21,164,183,243,176,109,163,35,41,156,240,30,213,70,51,161,228,27,3,220,2,165,55,188,146,29,128,165,139,132,176,70,171,14,192,28,0,51,161,69, - 23,95,105,33,43,90,218,61,169,53,194,105,231,205,59,75,173,83,86,51,9,116,181,115,150,139,55,6,213,61,12,170,239,130,234,35,90,155,216,179, - 5,18,182,192,73,107,58,152,114,19,121,146,240,46,168,48,186,74,73,193,221,63,177,41,8,249,144,7,179,78,93,80,185,192,130,149,105,35,69,160, - 106,56,35,167,76,215,192,114,70,186,230,152,238,162,42,201,215,120,163,95,13,85,114,112,86,104,53,26,11,88,36,163,133,73,199,98,212,254,189,109, - 193,35,237,165,226,28,14,207,115,88,41,134,218,55,198,183,181,209,62,124,45,239,226,171,34,198,173,222,23,90,200,167,194,250,101,23,95,29,41,174, - 109,75,236,3,190,176,37,198,73,243,202,82,203,96,59,97,104,173,20,210,178,26,211,221,239,109,11,17,113,160,238,44,132,23,78,196,121,255,214,194, - 203,30,206,245,153,174,153,229,17,183,86,177,61,51,235,35,39,184,230,170,3,174,194,158,180,231,182,107,18,64,47,180,113,109,235,123,36,53,122,119, - 246,9,193,99,175,170,97,143,83,72,97,201,197,222,67,33,223,140,0,215,16,159,76,232,246,34,252,218,94,129,208,253,199,252,58,75,111,62,52,65, - 71,145,127,67,212,241,81,48,21,111,93,201,34,91,46,81,86,167,48,135,187,203,16,186,140,105,30,47,227,243,52,68,41,104,87,103,84,154,138,89, - 94,204,211,98,83,101,194,167,83,213,4,50,20,138,66,123,61,227,91,7,189,61,121,26,188,213,140,245,213,151,23,241,60,191,1,48,251,149,223,243, - 28,135,164,246,139,9,107,72,53,44,134,228,246,160,18,243,8,67,167,230,14,235,174,138,2,2,48,94,198,119,41,182,20,254,108,132,172,188,200,111, - 206,11,130,102,17,47,183,216,108,187,82,213,120,54,203,49,117,85,92,29,84,207,243,228,138,238,85,199,87,181,8,54,119,105,173,22,52,126,123,179, - 189,179,220,100,107,84,142,155,59,58,206,164,186,167,197,230,214,142,51,206,238,105,66,146,118,120,30,77,37,64,114,155,0,246,100,149,86,241,60,174, - 226,157,116,108,74,212,230,186,172,152,47,166,255,248,252,183,109,188,155,36,211,255,201,139,111,187,80,149,26,196,179,252,10,107,218,198,224,116,3,151, - 76,73,211,226,234,44,91,97,243,116,127,251,151,219,213,18,226,188,173,232,52,174,238,46,211,221,160,245,176,155,187,232,222,251,236,121,178,202,168,211, - 228,107,5,73,255,59,77,210,138,203,235,65,19,186,77,207,139,179,214,192,180,129,95,206,183,209,115,103,9,89,181,76,207,254,61,254,118,53,27,124, - 173,82,24,165,34,44,183,46,111,143,49,57,28,36,180,60,152,143,134,173,247,112,214,108,161,190,255,140,86,87,101,150,92,196,203,101,148,124,15,93, - 155,86,31,218,235,92,102,73,186,46,31,135,37,76,155,93,67,151,87,171,124,93,6,132,154,190,229,100,118,55,46,227,9,216,205,228,0,158,122,99, - 255,189,187,71,29,124,13,247,168,125,187,14,59,185,154,253,1,99,222,129,130,22,244,175,241,249,30,154,84,186,204,206,90,87,180,39,147,166,172,183, - 97,153,86,85,182,62,127,164,85,146,175,97,234,150,176,91,235,116,249,112,211,234,38,141,191,61,54,105,179,217,195,54,117,89,103,91,245,33,117,1, - 8,114,64,218,208,214,142,47,251,135,214,82,144,39,158,87,87,26,46,211,2,18,95,62,42,13,125,111,113,252,35,189,44,242,249,85,82,101,249,186, - 43,6,47,28,248,115,6,239,147,205,174,122,7,46,210,255,189,202,208,227,89,35,255,103,94,1,146,215,29,243,151,234,254,197,190,8,133,180,200,174, - 195,145,146,52,148,175,187,232,175,23,113,145,254,178,204,190,181,193,8,162,215,136,218,38,59,216,50,213,39,147,141,33,15,79,231,59,3,223,113,125, - 91,231,176,140,103,41,216,194,23,170,28,240,67,23,152,95,93,174,242,121,218,116,223,248,134,203,184,186,216,108,169,234,97,215,86,115,206,93,47,183, - 210,214,89,196,215,224,58,76,33,252,29,193,171,75,35,219,188,10,107,253,143,129,66,208,56,168,41,210,224,151,65,195,140,6,148,20,208,3,54,224, - 248,14,44,85,142,30,110,211,30,230,251,118,134,45,159,42,238,234,68,131,238,169,186,61,204,72,110,43,123,104,222,174,174,135,239,17,254,132,25,248, - 251,46,136,105,82,198,219,212,48,130,72,231,16,107,216,79,221,4,50,241,185,41,252,223,79,31,15,249,240,207,161,182,149,204,14,143,197,213,50,157, - 174,243,245,119,240,181,79,53,73,164,199,180,249,93,147,141,41,223,60,18,11,199,113,79,161,31,85,187,236,143,60,91,79,161,26,105,241,105,21,23, - 223,210,162,30,164,254,61,46,171,184,168,58,37,171,108,222,121,78,215,243,206,180,97,168,101,134,63,83,181,41,155,199,96,71,69,17,223,117,90,82, - 105,157,29,159,178,77,217,110,143,215,89,153,205,178,37,61,132,159,203,244,211,60,43,47,33,161,211,108,77,11,255,148,95,167,197,98,153,223,108,234, - 15,79,137,8,4,98,147,34,217,5,52,109,161,238,105,119,239,177,73,156,244,145,71,70,9,244,63,143,236,105,71,182,209,29,201,164,63,78,219,142, - 82,211,7,245,251,208,46,188,189,81,234,179,163,78,26,102,121,175,29,69,204,174,164,25,141,109,228,181,71,171,17,215,145,229,182,147,92,235,72,116, - 87,108,249,189,18,123,120,31,113,188,196,126,116,206,197,78,119,133,150,69,62,124,236,15,40,188,65,108,32,4,158,25,203,229,72,240,72,112,109,172, - 25,124,25,72,19,57,239,37,19,35,133,211,84,86,13,126,29,72,136,139,177,150,82,165,60,210,2,45,7,168,228,76,64,190,71,116,231,195,148,50, - 124,128,74,43,188,165,164,212,182,171,146,116,29,225,49,9,73,150,146,168,37,65,243,136,138,153,27,97,96,38,148,150,134,250,42,198,72,116,164,142, - 16,48,107,35,177,24,33,35,110,141,148,146,196,200,43,195,180,193,152,2,45,68,40,245,145,241,161,80,80,98,76,40,165,70,42,194,90,148,115,3, - 174,112,192,150,138,52,188,59,167,162,47,3,46,35,43,149,151,35,131,165,42,193,177,198,47,141,54,112,165,71,156,69,74,27,103,116,93,218,192,67, - 157,52,147,142,83,41,70,213,26,173,71,220,80,210,218,187,48,2,86,47,188,178,130,74,33,154,161,208,70,142,25,195,156,25,113,17,25,192,166,8, - 144,190,82,67,153,104,108,58,76,229,25,22,237,122,203,126,29,16,10,218,10,233,136,160,104,84,99,169,152,220,41,236,69,82,50,72,211,154,77,239, - 217,126,31,28,58,126,174,216,161,153,89,131,89,145,131,41,79,135,73,242,61,217,124,202,199,156,210,61,253,146,164,199,104,182,146,225,181,48,186,136, - 115,43,157,166,141,121,197,8,107,72,135,20,76,24,75,178,227,33,128,92,212,194,232,185,198,201,53,82,134,243,39,171,229,24,227,94,145,128,98,24, - 102,45,73,20,131,9,114,188,211,155,164,213,82,106,122,36,29,250,72,96,73,45,61,96,165,50,75,105,85,174,5,201,183,131,87,20,156,228,209,91, - 8,27,137,143,16,112,171,146,59,79,231,44,181,224,78,146,60,74,24,250,80,138,101,212,133,130,4,73,97,27,16,52,169,172,86,26,231,164,119,101, - 138,146,228,58,136,153,142,184,83,194,146,68,42,237,133,32,185,7,26,80,20,238,73,194,189,195,136,190,46,244,216,155,198,228,138,150,233,157,172,251, - 195,5,225,252,137,187,42,35,148,49,181,64,50,195,57,212,137,24,45,83,66,219,90,34,29,102,165,82,202,126,11,27,52,158,174,185,184,231,70,83, - 41,6,114,82,7,57,21,192,147,74,105,47,156,107,167,73,248,153,0,45,70,25,20,83,144,156,29,28,91,75,202,14,40,9,180,22,75,146,190,207, - 200,7,187,119,180,65,223,190,111,213,99,208,249,143,100,209,119,121,239,52,169,238,167,240,150,65,244,180,121,49,240,189,174,216,128,60,246,157,132,21, - 63,40,47,164,179,128,137,219,241,194,38,141,10,173,17,198,137,214,157,232,38,123,42,200,107,40,207,119,183,81,68,32,161,92,78,75,217,186,214,59, - 29,210,213,27,12,134,242,187,166,196,25,97,174,156,116,142,217,221,29,85,113,215,91,220,71,232,140,183,94,82,96,108,185,129,166,143,198,219,95,173, - 186,61,178,247,218,132,206,201,167,16,58,235,22,126,254,39,161,235,248,80,120,39,229,157,133,23,148,140,88,188,116,181,115,146,82,72,178,217,30,118, - 28,84,204,14,224,210,172,19,70,56,114,99,116,245,109,121,111,25,92,48,156,164,54,154,88,8,156,22,254,50,242,57,32,117,168,103,16,15,31,193, - 255,42,80,13,106,11,54,102,132,149,228,223,184,213,2,75,161,82,9,98,167,225,239,71,240,73,144,113,116,235,150,42,122,163,194,104,154,141,94,20, - 178,140,195,151,9,184,42,77,126,154,118,0,137,51,160,123,40,117,240,112,160,44,240,175,116,41,202,36,81,72,136,170,3,151,20,125,219,239,167,60, - 234,17,202,179,97,45,79,96,59,247,19,29,167,15,15,9,76,5,36,25,231,129,90,98,1,225,148,24,177,57,218,34,188,49,179,142,14,132,88,46, - 72,55,92,188,211,26,100,176,183,44,28,146,132,241,32,78,170,35,196,92,70,17,93,160,112,206,32,240,177,196,33,84,195,73,233,140,44,232,147,25, - 129,91,121,163,193,169,169,84,129,194,131,34,56,226,164,28,0,27,91,151,74,148,213,108,193,211,203,60,130,206,136,227,236,57,157,50,150,138,62,82, - 133,245,19,203,148,129,131,130,186,8,237,76,56,35,7,110,238,5,237,20,76,12,114,212,187,251,135,24,131,150,222,90,1,71,242,6,142,139,110,173, - 247,28,215,230,250,85,168,31,145,66,244,152,241,99,141,183,127,138,241,174,175,133,95,110,188,31,129,238,126,144,94,118,98,47,53,211,100,196,160,227, - 156,143,200,142,130,89,35,116,254,117,0,75,234,192,243,17,23,42,29,65,135,173,167,96,85,73,4,227,161,200,66,19,132,33,186,207,160,226,90,83, - 220,237,25,71,0,132,206,148,100,49,214,25,65,241,143,49,8,6,57,133,128,92,43,227,29,69,58,148,195,133,162,146,51,80,28,148,96,36,233,173, - 29,132,63,158,148,23,138,238,16,205,251,145,228,20,80,11,230,66,140,13,53,111,148,23,113,137,226,212,14,33,167,9,58,14,27,161,185,168,67,34, - 78,209,17,52,26,129,18,24,140,241,181,61,64,60,45,17,82,81,22,12,225,150,20,20,43,32,102,65,44,69,45,97,253,17,101,241,240,46,131,224, - 152,37,188,120,195,131,49,161,128,151,195,174,104,90,15,204,184,148,158,64,163,224,1,17,17,108,32,247,22,230,138,146,90,48,111,136,72,168,12,86, - 17,65,30,69,120,145,19,176,159,112,100,18,46,203,1,107,129,176,153,57,43,224,250,66,44,72,215,0,134,114,95,24,155,118,72,152,193,128,106,50, - 144,125,135,211,239,69,196,17,94,164,76,94,156,200,237,37,80,155,248,231,104,149,139,57,125,247,141,29,151,206,64,132,204,15,156,190,197,65,154,254, - 244,45,164,226,254,75,22,27,221,151,187,165,151,98,251,51,183,221,170,58,115,139,128,64,83,70,35,36,101,169,190,249,119,147,146,133,7,28,61,80, - 189,235,254,72,194,246,136,151,33,21,52,145,81,178,140,89,171,140,250,249,229,55,16,6,140,225,62,231,253,84,9,254,243,210,161,67,43,121,235,21, - 251,142,212,114,208,42,38,149,87,253,130,75,156,141,245,118,174,133,23,94,196,182,222,73,223,147,223,189,218,154,207,130,127,91,88,125,184,135,102,236, - 32,171,117,211,221,143,70,98,201,224,131,84,10,59,58,166,117,207,216,15,203,185,182,140,72,116,255,5,111,168,242,228,20,157,114,20,141,8,186,14, - 126,65,24,251,114,2,106,228,30,1,21,145,0,87,103,61,57,172,34,191,90,207,15,196,187,46,253,231,186,150,112,17,189,208,202,66,192,106,132,114, - 44,48,156,158,82,10,40,25,56,144,34,79,15,134,162,4,220,55,215,20,201,200,64,122,12,119,123,47,93,55,202,35,31,241,221,79,8,253,202,141, - 159,63,188,84,183,108,159,248,57,112,55,134,32,9,220,13,68,42,48,37,206,34,161,44,37,185,21,162,48,68,234,180,177,16,29,107,196,236,40,3, - 195,243,220,83,238,21,12,16,91,162,206,224,47,164,12,129,248,129,235,40,227,40,25,46,173,209,206,147,142,81,6,156,72,30,197,236,76,114,69,44, - 13,177,158,85,154,136,31,131,254,169,38,55,160,48,148,86,68,180,192,225,36,69,109,88,133,181,176,33,1,104,68,141,152,27,237,180,10,111,115,83, - 116,167,65,216,92,19,9,42,122,249,148,200,155,195,106,57,175,163,117,7,242,138,117,6,62,200,20,198,164,116,54,115,94,115,106,9,14,199,164,164, - 85,58,33,193,95,41,214,7,11,97,194,213,251,225,142,94,111,165,21,17,201,210,22,204,24,4,208,81,114,159,82,241,0,6,177,190,197,121,91,69, - 87,54,180,71,102,176,135,112,59,98,241,155,251,112,177,196,133,19,134,238,86,32,17,74,136,112,13,96,132,245,90,162,55,248,174,167,219,17,160,230, - 165,20,33,171,209,115,60,135,161,233,155,102,174,213,15,196,196,62,29,188,96,162,142,178,196,80,23,202,247,120,254,70,38,217,242,255,255,38,249,13, - 83,136,208,94,161,64,220,130,254,193,200,8,213,232,244,126,41,108,148,102,220,73,79,186,6,18,169,132,39,131,76,255,67,154,242,193,70,9,206,140, - 239,49,139,202,30,103,125,79,38,231,103,31,78,232,69,221,179,15,255,7,80,75,3,4,20,0,2,0,8,0,183,128,249,52,199,174,1,222,145,13, - 0,0,154,63,0,0,18,0,0,0,115,121,115,116,101,109,45,108,111,103,45,111,117,116,46,115,118,103,237,90,109,111,219,200,17,254,158,95,161,42, - 95,18,156,68,237,251,139,98,187,184,94,112,197,21,105,15,184,220,161,31,11,154,90,219,60,83,162,74,82,182,149,95,223,153,37,197,23,137,178,41, - 199,201,29,208,72,9,44,206,206,190,61,251,204,236,204,46,207,254,250,176,76,70,119,46,203,227,116,117,62,166,1,25,143,220,42,74,23,241,234,250, - 124,252,219,175,63,78,205,120,148,23,225,106,17,38,233,202,157,143,87,233,248,175,23,175,206,254,50,157,142,126,200,92,88,184,197,232,62,46,110,70, - 63,173,110,243,40,92,187,209,155,155,162,88,207,103,179,251,251,251,32,174,132,65,154,93,207,222,142,166,83,168,153,223,93,191,26,141,70,208,237,42, - 159,47,162,243,113,165,191,222,100,137,215,91,68,51,151,184,165,91,21,249,140,6,116,54,110,212,163,70,253,222,93,6,153,203,211,77,22,149,205,71, - 81,91,51,91,92,53,170,48,146,123,238,149,168,181,118,70,216,140,177,41,104,76,243,237,170,8,31,166,171,252,117,171,42,12,176,175,42,35,132,204, - 160,172,209,28,166,53,127,72,0,134,163,131,241,165,237,222,1,250,53,252,175,43,212,24,150,115,189,130,154,46,88,185,98,246,254,215,247,179,157,246, - 148,4,139,98,209,106,102,87,171,211,111,103,57,86,225,210,229,235,48,114,121,221,133,175,191,123,152,187,135,117,154,21,211,237,98,13,131,177,36,32, - 254,211,171,243,48,64,231,42,78,28,246,121,62,158,221,164,75,55,251,61,94,46,195,104,246,222,229,183,69,186,158,221,199,160,17,172,87,37,114,247, - 241,162,184,57,31,11,179,126,240,207,55,46,190,190,41,90,130,120,113,62,6,152,41,229,85,119,59,36,230,53,151,73,192,89,119,36,173,34,193,191, - 91,184,59,151,116,235,46,210,232,50,204,247,135,152,103,209,44,186,203,103,96,5,215,233,52,142,210,213,180,184,1,130,206,160,213,36,188,76,220,44, - 140,10,104,55,63,104,172,156,111,190,205,11,183,156,38,233,245,52,221,20,1,178,227,2,52,207,22,238,42,199,26,229,108,240,137,251,2,40,2,82, - 184,48,251,123,22,46,98,176,131,82,169,84,235,150,88,99,85,85,7,106,229,0,228,78,183,130,8,36,160,99,198,141,56,189,186,202,29,64,73,90, - 178,188,216,38,174,212,158,70,105,146,102,243,215,145,195,239,59,47,74,129,38,113,177,157,211,119,227,209,236,169,222,44,33,61,189,209,138,26,79,244, - 106,29,126,247,122,221,85,109,122,63,155,117,97,56,25,53,211,32,82,179,3,134,144,184,8,198,26,38,247,225,54,31,0,43,57,29,214,43,255,121, - 6,172,198,178,62,88,79,239,237,69,97,36,47,0,163,97,167,195,40,25,126,159,3,163,17,167,195,216,215,219,75,194,168,204,49,148,122,6,35,28, - 126,143,154,72,15,148,61,166,215,224,161,201,113,212,122,122,87,20,191,123,80,60,214,59,125,188,119,246,114,40,74,241,52,215,164,26,8,208,233,192, - 15,224,158,52,207,247,140,225,37,126,191,188,103,20,236,5,76,90,136,211,77,90,51,237,72,248,28,147,22,234,116,147,238,235,237,37,97,228,228,105, - 148,56,123,62,25,37,193,239,231,144,145,139,231,147,145,26,252,190,48,25,143,177,237,56,204,70,41,118,130,231,172,134,183,207,176,199,153,186,3,12, - 250,18,39,121,202,190,222,250,61,100,127,111,234,43,194,40,201,9,48,30,9,97,134,194,40,217,73,48,30,9,97,134,194,40,197,83,48,226,83,152, - 156,12,163,207,219,230,55,153,131,60,243,117,15,158,109,184,187,93,64,113,227,176,162,7,24,185,13,52,161,84,52,51,136,182,231,99,22,64,108,111, - 185,105,164,87,189,186,87,189,186,25,168,234,128,106,208,148,181,240,186,26,193,175,89,184,202,33,145,92,158,143,151,97,145,197,15,111,104,192,36,23, - 130,77,166,44,96,86,81,43,221,148,170,9,13,180,208,66,17,255,64,2,43,57,68,247,147,41,149,129,208,150,152,9,133,122,90,41,254,246,160,139, - 223,86,113,1,9,242,38,119,217,71,76,50,127,94,253,150,187,102,41,250,65,199,65,203,64,9,161,185,238,204,143,171,64,48,74,153,238,96,193,68, - 96,184,166,76,117,112,59,212,141,122,117,31,3,163,180,221,9,233,249,33,185,210,140,3,50,74,115,169,17,38,57,161,42,48,154,19,53,20,134,227, - 220,176,166,53,194,71,41,166,6,236,211,79,192,61,108,144,199,113,98,1,161,218,90,58,17,129,80,148,82,229,105,50,149,1,164,87,76,10,255,196, - 96,57,9,74,169,16,129,20,214,76,166,10,234,113,64,241,109,135,172,10,178,117,42,169,232,172,187,0,188,5,108,116,172,179,238,150,7,218,16,210, - 226,72,212,171,27,245,234,246,129,206,7,129,238,119,245,225,160,247,251,231,71,105,199,164,164,108,66,240,11,184,193,22,13,6,73,2,244,98,22,140, - 17,76,131,19,118,50,203,182,12,232,111,2,48,9,176,235,102,158,32,229,96,210,92,90,214,184,141,45,5,32,1,50,9,228,110,233,210,62,221,222, - 232,209,12,3,82,176,23,3,114,192,228,53,76,200,18,213,157,60,53,64,67,202,246,38,15,254,213,16,65,169,238,76,94,128,129,11,9,164,126,116, - 242,74,12,155,188,20,127,2,211,149,10,230,195,39,50,32,48,51,137,166,107,208,249,11,170,152,194,39,1,46,78,16,206,20,80,144,3,128,16,173, - 242,201,212,6,192,74,78,120,199,118,97,75,98,76,211,86,30,143,182,11,187,15,183,138,104,210,245,217,26,188,3,135,127,29,219,61,212,141,122,117, - 251,108,87,15,180,93,101,190,132,237,22,248,51,9,11,247,102,74,193,196,20,101,205,110,241,44,67,21,129,86,64,53,209,53,84,1,77,106,88,155, - 125,174,82,162,53,219,51,84,26,24,201,172,124,220,80,205,64,212,12,249,138,134,10,158,71,8,107,133,238,26,42,240,75,74,217,114,45,126,242,60, - 128,192,3,64,233,76,222,0,122,132,40,241,248,228,237,64,67,53,230,43,78,30,253,17,236,149,124,207,69,131,51,166,68,201,174,151,98,52,144,176, - 225,26,185,191,242,68,27,43,31,245,82,150,176,97,147,183,106,232,228,207,102,120,118,237,127,213,135,223,120,242,189,184,139,221,253,171,42,176,207,210, - 91,136,236,95,135,162,149,93,94,197,73,2,178,50,23,31,55,71,225,120,6,95,61,174,195,107,231,51,1,208,43,83,129,170,224,50,205,22,46,219, - 21,41,255,233,20,85,201,2,102,212,16,140,88,66,235,9,213,211,193,198,91,106,164,175,60,191,9,23,233,61,64,190,95,248,41,77,151,77,214,209, - 64,132,142,11,186,180,82,104,125,80,184,197,20,219,106,170,77,29,150,55,133,155,44,3,228,167,73,184,117,48,39,255,103,215,124,126,147,222,95,103, - 136,77,145,109,220,126,77,44,153,94,94,166,15,253,197,139,52,218,224,117,218,116,83,146,176,186,66,105,105,96,243,237,201,94,133,73,126,208,204,125, - 188,130,194,105,117,53,67,27,166,238,107,236,46,107,32,33,57,162,241,128,55,57,242,72,33,98,4,241,90,197,173,165,43,194,69,88,132,13,59,118, - 146,221,113,223,89,182,184,154,255,242,254,199,58,167,140,162,249,191,211,236,182,73,7,81,33,188,76,55,48,166,58,207,197,251,151,104,142,78,60,44, - 46,226,37,76,30,175,237,190,123,88,38,64,231,186,160,163,92,108,215,174,105,180,108,118,119,5,217,123,141,185,136,150,49,86,154,125,44,128,233,63, - 97,39,173,220,183,108,52,194,75,212,52,187,104,53,140,19,248,254,186,206,80,59,67,136,139,196,93,252,35,188,221,92,142,62,22,14,76,54,243,195, - 45,229,237,54,102,135,141,120,205,131,254,176,217,114,14,23,213,20,202,107,175,96,185,201,227,232,38,76,146,32,250,228,171,86,90,175,218,227,76,226, - 200,173,242,167,97,241,221,198,119,96,203,203,101,186,202,61,66,85,221,124,118,185,157,230,225,12,210,130,217,1,60,229,196,62,250,27,180,209,135,244, - 122,244,243,166,232,155,177,159,197,230,242,119,240,78,29,24,112,48,127,11,175,247,144,68,105,18,95,36,208,94,138,237,85,207,199,148,158,212,113,15, - 113,175,70,41,235,244,95,34,217,29,169,95,44,164,108,155,194,31,246,145,109,177,248,68,80,187,75,182,118,25,208,50,127,114,201,250,110,216,127,113, - 235,44,93,108,252,117,103,119,173,62,179,225,247,49,108,17,241,229,166,183,225,204,253,119,19,67,141,103,181,252,175,180,0,72,94,182,205,239,139,227, - 131,253,44,20,92,22,223,249,37,69,54,228,47,59,232,143,55,97,230,190,79,226,219,54,24,158,122,21,213,118,199,100,45,127,122,54,219,121,91,255, - 116,221,120,225,206,246,84,187,240,36,188,116,176,165,127,192,194,17,61,220,167,210,205,122,153,46,92,85,189,118,224,96,11,117,62,225,183,98,77,32, - 234,105,69,124,217,67,45,149,172,9,96,252,209,151,84,150,145,214,21,247,131,15,14,37,161,186,165,89,191,64,0,219,175,96,132,53,234,213,126,6, - 193,147,133,208,169,27,59,225,192,172,105,41,87,7,148,205,177,103,247,176,23,3,154,57,108,0,111,94,31,158,48,188,245,165,173,19,83,255,152,109, - 18,55,119,119,110,149,46,22,239,202,40,169,117,116,140,143,229,134,91,31,175,11,179,147,99,192,6,176,206,129,135,69,91,246,123,26,175,230,64,65, - 151,189,91,134,217,173,203,230,171,116,229,170,223,211,188,8,179,162,35,89,198,139,206,179,91,85,207,85,155,190,169,36,134,63,115,90,15,106,17,66, - 172,144,101,225,182,163,138,210,242,60,118,94,107,54,19,190,139,243,248,50,78,240,193,255,76,220,187,69,156,175,129,10,243,120,133,35,127,151,222,185, - 236,42,73,239,119,229,135,17,104,246,159,168,27,229,116,203,182,85,89,147,62,183,168,181,245,171,172,185,146,173,227,7,100,139,56,160,9,101,1,83, - 92,200,67,154,16,160,9,124,76,15,79,4,57,157,39,135,7,40,195,121,210,70,190,34,201,55,110,156,192,141,117,88,220,212,11,86,39,46,224,158, - 48,102,131,56,57,194,79,103,157,177,134,53,173,35,70,144,253,115,68,33,59,231,90,41,54,129,4,214,10,136,108,237,232,195,8,124,144,197,151,27, - 236,132,7,68,10,124,131,0,164,28,53,40,101,18,165,214,104,106,69,37,53,146,83,208,5,49,53,84,75,108,161,167,221,79,163,3,142,237,225,178, - 143,91,15,178,251,232,215,55,119,61,75,213,87,118,184,184,29,30,84,85,14,56,115,132,83,7,172,235,180,188,199,218,71,248,221,245,147,164,99,37, - 135,54,212,53,178,224,49,155,84,226,237,158,253,30,32,119,132,84,93,47,64,2,193,202,79,159,59,216,221,116,29,181,126,152,200,39,72,107,143,91, - 63,223,71,7,182,219,213,226,0,200,82,250,210,230,47,190,144,245,95,38,105,116,123,220,248,75,3,4,243,80,214,16,218,49,64,46,2,74,181,37, - 220,27,149,98,92,121,179,148,129,148,224,218,237,4,67,1,99,165,101,29,41,218,31,225,156,168,202,132,141,52,70,29,72,247,123,107,153,229,206,79, - 80,174,200,179,125,212,147,110,41,122,194,141,161,238,249,56,204,162,241,81,50,50,107,133,146,108,120,12,195,14,98,152,218,214,78,217,163,246,61,202, - 31,178,87,5,67,188,218,99,126,240,16,131,207,217,194,42,206,24,213,226,76,189,150,253,247,151,77,113,239,165,103,93,140,161,243,225,173,106,83,188, - 197,83,83,110,149,177,92,118,205,74,128,195,50,212,40,62,170,155,31,125,63,170,219,26,213,213,70,100,68,225,59,178,1,181,140,27,3,155,219,176, - 10,125,61,124,170,7,81,28,92,91,64,10,160,141,176,253,55,179,85,209,84,7,82,91,131,215,178,129,132,191,220,190,29,228,157,155,133,236,115,206, - 81,212,240,252,4,250,87,231,157,93,11,168,66,72,48,168,63,210,97,255,217,108,160,244,228,16,158,83,92,189,9,133,101,196,55,26,188,207,174,165, - 16,126,115,41,185,194,160,201,6,74,9,240,202,226,152,84,5,84,43,42,52,72,25,13,140,209,90,200,9,3,159,13,177,24,225,94,87,90,202,5, - 19,248,34,131,146,138,18,218,149,226,24,52,81,186,51,134,102,100,61,94,31,130,5,62,192,123,31,245,223,251,78,90,18,67,24,21,67,157,52,190, - 91,242,69,157,244,255,61,67,109,96,25,216,180,1,118,176,64,104,67,68,201,164,90,170,241,190,94,41,100,18,11,136,22,138,74,122,68,10,78,29, - 130,126,33,200,232,135,17,180,198,57,228,8,32,197,131,14,142,78,17,88,105,165,176,150,77,240,10,91,115,200,23,144,201,204,10,102,136,103,178,64, - 174,119,251,175,71,213,207,78,249,249,177,69,31,155,15,123,106,229,206,30,56,22,64,178,3,51,180,19,138,251,0,184,63,233,193,216,73,153,197,119, - 107,8,243,6,15,196,247,200,28,145,226,173,152,229,86,163,20,224,18,68,128,157,150,128,64,22,174,74,93,1,27,145,214,19,188,40,52,66,83,209, - 149,26,168,197,140,55,237,190,145,125,203,179,78,205,179,122,83,39,43,222,14,200,189,218,78,205,143,169,63,219,242,193,2,51,92,12,75,183,134,7, - 182,90,125,59,116,121,214,110,45,2,2,249,15,245,153,80,249,206,144,63,182,56,126,226,209,150,194,222,108,180,63,241,80,134,18,99,170,19,143,253, - 6,123,220,24,164,228,106,124,194,201,205,23,60,32,202,243,222,35,34,189,239,252,32,44,17,156,0,8,232,120,36,190,96,137,32,80,124,13,71,104, - 134,62,223,18,99,53,238,15,16,205,80,2,81,7,56,63,25,104,166,32,145,132,253,161,79,138,113,143,102,140,89,220,31,24,51,154,27,108,147,66, - 7,12,220,161,10,24,101,76,51,172,13,59,9,181,216,63,212,134,206,13,56,73,159,31,27,98,160,119,230,223,44,163,198,47,11,39,128,175,223,133, - 164,96,150,98,109,124,47,3,122,130,221,197,6,92,49,60,158,226,248,102,159,193,190,97,70,10,246,40,12,226,123,100,31,122,231,222,227,94,135,132, - 225,189,62,198,124,75,75,95,56,224,25,110,0,192,254,60,202,251,12,116,239,140,20,8,40,180,174,2,36,46,33,190,38,37,45,15,164,232,15,4, - 225,82,248,221,88,114,34,75,90,130,135,48,22,9,8,252,130,248,187,164,37,56,14,165,9,146,21,2,3,78,37,146,77,40,197,132,193,224,74,161, - 113,169,94,217,15,35,102,2,180,3,234,77,130,25,129,39,177,254,53,73,195,153,66,77,140,247,33,62,0,25,190,41,167,36,202,40,12,82,84,181, - 15,164,64,127,34,240,69,108,28,15,161,154,106,142,51,52,156,40,174,113,228,202,114,197,105,57,111,41,53,129,126,112,62,198,80,45,112,148,16,243, - 89,124,209,19,140,71,74,162,76,175,204,247,13,1,13,32,131,168,89,60,34,54,222,61,112,170,168,198,151,145,185,176,138,200,94,116,191,197,53,95, - 253,252,24,220,238,208,243,227,179,217,245,197,171,51,124,17,229,226,213,255,0,80,75,1,2,20,0,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,0,0,0,0,1,0,32,0,0,0,0,0,0,0,100,111,99,117,109,101,110,116,45,110,101,119,46, - 115,118,103,80,75,1,2,20,0,20,0,0,0,8,0,96,128,249,52,242,213,5,70,140,20,0,0,25,120,0,0,17,0,0,0,0,0,0,0,1, - 0,32,0,0,0,252,13,0,0,100,111,99,117,109,101,110,116,45,111,112,101,110,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,96,125, - 250,52,34,86,64,46,27,23,0,0,165,116,0,0,17,0,0,0,0,0,0,0,1,0,32,0,0,0,183,34,0,0,100,111,99,117,109,101,110,116, - 45,115,97,118,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,118,128,249,52,254,120,218,95,213,23,0,0,110,124,0,0,20,0,0, - 0,0,0,0,0,1,0,32,0,0,0,1,58,0,0,100,111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,80,75,1,2,20, - 0,20,0,2,0,8,0,106,128,249,52,126,63,165,149,12,18,0,0,232,90,0,0,18,0,0,0,0,0,0,0,1,0,32,0,0,0,8,82,0, - 0,100,111,99,117,109,101,110,116,45,112,114,105,110,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,121,128,249,52,162,251,72,104,220, - 10,0,0,238,60,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,68,100,0,0,101,100,105,116,45,99,111,112,121,46,115,118,103,80,75, - 1,2,20,0,20,0,2,0,8,0,125,128,249,52,153,109,230,156,183,23,0,0,27,89,0,0,12,0,0,0,0,0,0,0,1,0,32,0,0,0, - 75,111,0,0,101,100,105,116,45,99,117,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,136,128,249,52,38,221,82,145,115,17,0,0, - 142,92,0,0,14,0,0,0,0,0,0,0,1,0,32,0,0,0,44,135,0,0,101,100,105,116,45,112,97,115,116,101,46,115,118,103,80,75,1,2, - 20,0,20,0,2,0,8,0,130,128,249,52,145,40,234,161,189,30,0,0,76,213,0,0,15,0,0,0,0,0,0,0,1,0,32,0,0,0,203,152, - 0,0,101,100,105,116,45,100,101,108,101,116,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,131,128,249,52,23,55,187,63,234,22,0, - 0,20,138,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,181,183,0,0,101,100,105,116,45,102,105,110,100,46,115,118,103,80,75,1,2, - 20,0,20,0,2,0,8,0,141,128,249,52,100,188,189,164,140,9,0,0,25,36,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,202,206, - 0,0,101,100,105,116,45,117,110,100,111,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,143,128,249,52,187,167,102,138,170,9,0,0,119, - 36,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,129,216,0,0,101,100,105,116,45,114,101,100,111,46,115,118,103,80,75,1,2,20,0, - 20,0,2,0,8,0,171,128,249,52,75,77,50,197,89,10,0,0,186,54,0,0,23,0,0,0,0,0,0,0,1,0,32,0,0,0,86,226,0,0, - 109,101,100,105,97,45,115,101,101,107,45,98,97,99,107,119,97,114,100,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,174,128,249,52,207, - 153,178,73,172,10,0,0,72,56,0,0,22,0,0,0,0,0,0,0,1,0,32,0,0,0,228,236,0,0,109,101,100,105,97,45,115,101,101,107,45, - 102,111,114,119,97,114,100,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,168,128,249,52,105,10,147,139,124,11,0,0,198,82,0,0,23, - 0,0,0,0,0,0,0,1,0,32,0,0,0,196,247,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,115,116,111,112,46,115,118,103, - 80,75,1,2,20,0,20,0,2,0,8,0,164,128,249,52,67,149,237,100,185,11,0,0,111,89,0,0,24,0,0,0,0,0,0,0,1,0,32,0, - 0,0,117,3,1,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,112,97,117,115,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0, - 8,0,165,128,249,52,158,228,190,4,151,9,0,0,193,42,0,0,24,0,0,0,0,0,0,0,1,0,32,0,0,0,100,15,1,0,109,101,100,105, - 97,45,112,108,97,121,98,97,99,107,45,115,116,97,114,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,4,134,250,52,115,77,182,120, - 141,10,0,0,123,45,0,0,16,0,0,0,0,0,0,0,1,0,32,0,0,0,49,25,1,0,109,101,100,105,97,45,114,101,99,111,114,100,46,115, - 118,103,80,75,1,2,20,0,20,0,2,0,8,0,225,128,249,52,157,141,185,194,180,16,0,0,195,74,0,0,22,0,0,0,0,0,0,0,1,0, - 32,0,0,0,236,35,1,0,112,114,101,102,101,114,101,110,99,101,115,45,115,121,115,116,101,109,46,115,118,103,80,75,1,2,20,0,20,0,2,0, - 8,0,183,128,249,52,199,174,1,222,145,13,0,0,154,63,0,0,18,0,0,0,0,0,0,0,1,0,32,0,0,0,212,52,1,0,115,121,115,116, - 101,109,45,108,111,103,45,111,117,116,46,115,118,103,80,75,5,6,0,0,0,0,20,0,20,0,249,4,0,0,149,66,1,0,0,0,0,0}; -const char* BinaryData::icons_zip = (const char*) temp6; - -static const unsigned char temp7[] = {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, - 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,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,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,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,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,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,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,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,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,32,32,32,32,32,32,112,117,98,108,105,99,32,67,111,109,98,111,66,111,120,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,73,110,116,101,114,112,114,111,99,101,115,115,67,111, - 109,109,115,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,114,118,101,114,32,61,32,110,101,119,32,68, - 101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,40,42,116,104,105,115,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,84,40,34,73,110,116,101,114,112,114,111,99,101,115,115,32,67,111,109, - 109,117,110,105,99,97,116,105,111,110,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,108,108,32, - 111,117,114,32,85,73,32,98,105,116,115,32,97,110,100,32,112,105,101,99,101,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,109,111,100,101,83,101,108,101,99,116,111,114,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120, - 32,40,84,40,34,109,111,100,101,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115, - 101,116,66,111,117,110,100,115,32,40,49,48,48,44,32,50,53,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,40,110, - 101,119,32,76,97,98,101,108,32,40,109,111,100,101,83,101,108,101,99,116,111,114,45,62,103,101,116,78,97,109,101,40,41,44,32,109,111,100,101,83, - 101,108,101,99,116,111,114,45,62,103,101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32, - 40,109,111,100,101,83,101,108,101,99,116,111,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108, - 101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,40,68,105,115,99,111,110,110,101,99,116,101,100,41,34,41,44,32,56,41,59, - 13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13, - 10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,78,97,109,101,100, - 32,112,105,112,101,32,40,108,105,115,116,101,110,105,110,103,41,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101, - 108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,78,97,109,101,100,32,112,105,112,101,32,40,99,111,110,110,101,99,116,32, - 116,111,32,101,120,105,115,116,105,110,103,32,112,105,112,101,41,34,41,44,32,53,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101, - 108,101,99,116,111,114,45,62,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108, - 101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,83,111,99,107,101,116,32,40,108,105,115,116,101,110,105,110,103,41,34,41,44, - 32,50,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34, - 83,111,99,107,101,116,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103,32,115,111,99,107,101,116,41,34,41,44,32,54, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73, - 100,32,40,56,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,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,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40, - 112,105,112,101,78,97,109,101,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,112,105,112,101,32,110,97,109,101,58, - 34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,48,44, - 32,54,48,44,32,49,51,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,77,117,108, - 116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,84,101, - 120,116,32,40,84,40,34,106,117,99,101,32,100,101,109,111,32,112,105,112,101,34,41,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32, - 76,97,98,101,108,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,78,97,109,101,40,41,44,32,112,105,112,101,78,97,109,101,45,62,103,101, - 116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,112,105,112,101,78,97,109,101,44,32, - 116,114,117,101,41,59,13,10,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,115,111,99, - 107,101,116,78,117,109,98,101,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,115,111,99,107,101,116,32,112,111, - 114,116,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,66,111,117,110,100, - 115,32,40,51,53,48,44,32,54,48,44,32,56,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,78,117,109,98, - 101,114,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101, - 116,78,117,109,98,101,114,45,62,115,101,116,84,101,120,116,32,40,84,40,34,49,50,51,52,53,34,41,41,59,13,10,32,32,32,32,32,32,32,32, - 115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,73,110,112,117,116,82,101,115,116,114,105,99,116,105,111,110,115,32,40,53,44,32,84, - 40,34,48,49,50,51,52,53,54,55,56,57,34,41,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,115,111, - 99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,78,97,109,101,40,41,44,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116, - 78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,115,111,99,107,101,116,78,117,109,98,101, - 114,44,32,116,114,117,101,41,59,13,10,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, - 115,111,99,107,101,116,72,111,115,116,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,115,111,99,107,101,116,32,104, - 111,115,116,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72,111,115,116,45,62,115,101,116,66,111,117,110,100,115, - 32,40,53,51,48,44,32,54,48,44,32,49,51,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72,111,115,116, - 45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72, - 111,115,116,45,62,115,101,116,84,101,120,116,32,40,84,40,34,108,111,99,97,108,104,111,115,116,34,41,41,59,13,10,32,32,32,32,32,32,32,32, - 115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,73,110,112,117,116,82,101,115,116,114,105,99,116,105,111,110,115,32,40,53,49,50,41, - 59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,78,97, - 109,101,40,41,44,32,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67, - 111,109,112,111,110,101,110,116,32,40,115,111,99,107,101,116,72,111,115,116,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,115,101,110,100,84,101,120,116,32,61,32,110,101,119,32,84,101,120,116,69,100, - 105,116,111,114,32,40,84,40,34,115,101,110,100,116,101,120,116,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116, - 45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32, - 32,115,101,110,100,84,101,120,116,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32, - 32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,82,101,97,100,79,110,108,121,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32, - 32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,84,101,120,116,32,40,84,40,34,116,101,115,116,105,110,103,32,49,50,51,52,34,41,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,115,101,110,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,84,40,34,115,101,110,100,34,41,44,32,84,40,34,70,105,114,101,115,32, - 111,102,102,32,116,104,101,32,109,101,115,115,97,103,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110, - 45,62,115,101,116,66,111,117,110,100,115,32,40,50,52,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32, - 32,32,115,101,110,100,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,40,41,59,13,10,32, - 32,32,32,32,32,32,32,115,101,110,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,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,105,110,99,111,109, - 105,110,103,77,101,115,115,97,103,101,115,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,109,101,115,115,97,103,101, - 115,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,82,101,97, - 100,79,110,108,121,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45, - 62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77, - 101,115,115,97,103,101,115,45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,44,32,49,53,48,44,32,53,48,48,44,32,50,53,48,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,108,108,32,116,104,105,115,32,116,111,32,115,101,116,32,117,112,32,101,118,101,114,121,116, - 104,105,110,103,39,115,32,115,116,97,116,101,32,99,111,114,114,101,99,116,108,121,46,13,10,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111, - 120,67,104,97,110,103,101,100,32,40,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,73,110,116,101,114,112,114,111,99,101,115, - 115,67,111,109,109,115,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,32, - 32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,101,114,118,101,114,59,13,10,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,98,117,116,116,111,110,67, - 108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,32,98,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, - 105,102,32,40,98,117,116,116,111,110,32,61,61,32,115,101,110,100,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,101,32,115,101,110,100,32,98,117,116,116,111,110,32,104,97,115,32,98,101,101,110,32,112,114, - 101,115,115,101,100,44,32,115,111,32,119,114,105,116,101,32,111,117,116,32,116,104,101,32,99,111,110,116,101,110,116,115,32,111,102,32,116,104,101,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,101,120,116,32,98,111,120,32,116,111,32,116,104,101,32,115,111,99,107,101,116,32,111, - 114,32,112,105,112,101,44,32,100,101,112,101,110,100,105,110,103,32,111,110,32,119,104,105,99,104,32,105,115,32,97,99,116,105,118,101,46,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,115,101,110,100,84,101,120,116,45,62, - 103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,77,101,109,111,114,121,66,108,111,99,107,32,109,101,115, - 115,97,103,101,68,97,116,97,32,40,40,99,111,110,115,116,32,99,104,97,114,42,41,32,116,101,120,116,44,32,116,101,120,116,46,108,101,110,103,116, - 104,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,97,99,116,105,118,101, - 67,111,110,110,101,99,116,105,111,110,115,46,115,105,122,101,40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,33,32,97,99,116,105,118,101,67,111,110,110,101, - 99,116,105,111,110,115,91,105,93,45,62,115,101,110,100,77,101,115,115,97,103,101,32,40,109,101,115,115,97,103,101,68,97,116,97,41,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47, - 32,116,104,101,32,119,114,105,116,101,32,102,97,105,108,101,100,44,32,115,111,32,105,110,100,105,99,97,116,101,32,116,104,97,116,32,116,104,101,32, - 99,111,110,110,101,99,116,105,111,110,32,104,97,115,32,98,114,111,107,101,110,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,115,101,110,100,32,109,101,115,115,97,103,101,32,102,97,105,108, - 101,100,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120, - 67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,84, - 104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,117,115,101,114,32,112,105,99,107,115,32,97,32,100,105,102,102, - 101,114,101,110,116,32,109,111,100,101,32,102,114,111,109,32,116,104,101,32,100,114,111,112,45,100,111,119,110,32,108,105,115,116,46,46,13,10,32,32, - 32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,109,111,100,101,73,100,32,61,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,103, - 101,116,83,101,108,101,99,116,101,100,73,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,105,102,32,40,109,111,100,101,73,100,32,60,32,56,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,111,112,101,110,32,40,40,109,111,100,101,73,100,32,38,32,50,41,32,33,61,32,48,44,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,40,109,111,100,101,73,100,32,38,32,52,41,32,33,61,32,48,41,59,13,10,32,32,32,32,32,32,32,32, - 125,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,47,47,32,74,117,115,116,32,99,108,111,115,101,115,32,97,110,121, - 32,99,111,110,110,101,99,116,105,111,110,115,32,116,104,97,116,32,97,114,101,32,99,117,114,114,101,110,116,108,121,32,111,112,101,110,46,13,10,32, - 32,32,32,118,111,105,100,32,99,108,111,115,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,101,114,118,101,114,45,62, - 115,116,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,99,108,101,97,114, - 40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,82,101,115,101,116,32,116,104,101,32,85,73,32,115,116,117,102,102,32,116,111,32, - 97,32,100,105,115,97,98,108,101,100,32,115,116,97,116,101,46,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116,45,62,115,101,116, - 86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110,45,62,115,101, - 116,86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97, - 103,101,115,45,62,115,101,116,84,101,120,116,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,102,97,108,115,101,41,59,13,10,32,32, - 32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,34,84,111,32,100,101,109,111,110,115,116,114,97,116,101,32,110,97,109,101,100,32,112,105,112,101,115,44,32,121,111,117,39,108,108,32,110, - 101,101,100,32,116,111,32,114,117,110,32,116,119,111,32,105,110,115,116,97,110,99,101,115,32,111,102,32,116,104,101,32,74,117,99,101,68,101,109,111, - 32,97,112,112,108,105,99,97,116,105,111,110,32,111,110,32,116,104,105,115,32,109,97,99,104,105,110,101,46,32,79,110,32,34,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,34,111,110,101,32,111,102,32,116,104,101,109,44,32,115,101,108,101,99,116,32,92,34,110,97,109,101,100,32,112,105,112, - 101,32,40,108,105,115,116,101,110,105,110,103,41,92,34,44,32,97,110,100,32,116,104,101,110,32,111,110,32,116,104,101,32,111,116,104,101,114,44,32, - 115,101,108,101,99,116,32,92,34,110,97,109,101,100,32,112,105,112,101,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103, - 32,112,105,112,101,41,92,34,46,32,84,104,101,110,32,109,101,115,115,97,103,101,115,32,116,104,97,116,32,121,111,117,32,34,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,34,115,101,110,100,32,102,114,111,109,32,116,104,101,32,39,115,101,110,100,101,114,39,32,97,112,112,32,115,104,111,117, - 108,100,32,97,112,112,101,97,114,32,111,110,32,116,104,101,32,108,105,115,116,101,110,101,114,32,97,112,112,46,32,84,104,101,32,92,34,112,105,112, - 101,32,110,97,109,101,92,34,32,102,105,101,108,100,32,108,101,116,115,32,121,111,117,32,99,104,111,111,115,101,32,97,32,110,97,109,101,32,102,111, - 114,32,116,104,101,32,112,105,112,101,92,110,92,110,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,84,111,32,100,101,109,111,110,115,116, - 114,97,116,101,32,115,111,99,107,101,116,115,44,32,121,111,117,32,99,97,110,32,101,105,116,104,101,114,32,114,117,110,32,116,119,111,32,105,110,115, - 116,97,110,99,101,115,32,111,102,32,116,104,101,32,97,112,112,32,111,110,32,116,104,101,32,115,97,109,101,32,109,97,99,104,105,110,101,44,32,111, - 114,32,111,110,32,100,105,102,102,101,114,101,110,116,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,109,97,99,104,105,110,101,115,32, - 111,110,32,121,111,117,114,32,110,101,116,119,111,114,107,46,32,73,110,32,101,97,99,104,32,111,110,101,32,101,110,116,101,114,32,97,32,115,111,99, - 107,101,116,32,110,117,109,98,101,114,44,32,116,104,101,110,32,111,110,32,111,110,101,32,111,102,32,116,104,101,32,97,112,112,115,44,32,115,101,108, - 101,99,116,32,116,104,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,92,34,83,111,99,107,101,116,32,40,108,105,115,116,101,110, - 105,110,103,41,92,34,32,109,111,100,101,46,32,79,110,32,116,104,101,32,111,116,104,101,114,44,32,101,110,116,101,114,32,116,104,101,32,104,111,115, - 116,32,97,100,100,114,101,115,115,32,111,102,32,116,104,101,32,108,105,115,116,101,110,105,110,103,32,97,112,112,44,32,97,110,100,32,115,101,108,101, - 99,116,32,92,34,83,111,99,107,101,116,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103,32,115,111,99,107,101,116,41, - 92,34,46,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,77,101,115,115,97,103,101,115,32,115,104,111,117,108,100,32,116,104,101,110, - 32,98,101,32,98,101,32,115,101,110,116,32,98,101,116,119,101,101,110,32,116,104,101,32,97,112,112,115,32,105,110,32,116,104,101,32,115,97,109,101, - 32,119,97,121,32,97,115,32,116,104,114,111,117,103,104,32,116,104,101,32,110,97,109,101,100,32,112,105,112,101,115,46,34,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,111,112,101,110,32,40,98,111,111,108,32,97,115,83,111,99,107,101,116,44,32,98,111,111,108, - 32,97,115,83,101,110,100,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,47,47,32,77,97,107,101,32,116,104,101,32,97,112,112,114,111,112,114,105,97,116,101,32,98,105,116,115,32,111,102,32,85, - 73,32,118,105,115,105,98,108,101,46,46,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,86,105,115,105,98,108, - 101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110,45,62,115,101,116,86,105,115,105,98,108, - 101,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115, - 101,116,84,101,120,116,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32, - 105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,116,114,121,32,116,111,32,111,112,101,110,32,116,104,101,32,115,111,99,107,101,116,32,111,114, - 32,112,105,112,101,46,46,46,13,10,32,32,32,32,32,32,32,32,98,111,111,108,32,111,112,101,110,101,100,79,107,32,61,32,102,97,108,115,101,59, - 13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,97,115,83,101,110,100,101,114,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,47,47,32,105,102,32,119,101,39,114,101,32,99,111,110,110,101,99,116,105,110,103,32,116,111,32,97,110,32,101, - 120,105,115,116,105,110,103,32,115,101,114,118,101,114,44,32,119,101,32,99,97,110,32,106,117,115,116,32,99,114,101,97,116,101,32,97,32,99,111,110, - 110,101,99,116,105,111,110,32,111,98,106,101,99,116,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,100,105,114,101,99,116,108,121,46, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110, - 42,32,110,101,119,67,111,110,110,101,99,116,105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111, - 110,110,101,99,116,105,111,110,32,40,42,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,97,115,83, - 111,99,107,101,116,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111, - 112,101,110,101,100,79,107,32,61,32,110,101,119,67,111,110,110,101,99,116,105,111,110,45,62,99,111,110,110,101,99,116,84,111,83,111,99,107,101,116, - 32,40,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,84,101,120,116,40,41,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,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,32,32,32,32, - 32,32,32,32,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,84,101,120,116,40,41,46,103,101,116,73,110,116,86,97,108,117,101, - 40,41,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,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,32,32,32,32,32,32,32,32,32,49,48,48,48,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,110,101,119,67,111,110,110,101,99,116,105,111,110, - 45,62,99,111,110,110,101,99,116,84,111,80,105,112,101,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79, - 107,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100, - 100,32,40,110,101,119,67,111,110,110,101,99,116,105,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32, - 32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,47,47,32,105,102,32,119,101,39,114,101,32,115,116,97,114,116,105,110,103,32,117,112,32,97,32,115,101,114,118,101,114,44,32,119, - 101,32,110,101,101,100,32,116,111,32,116,101,108,108,32,116,104,101,32,115,101,114,118,101,114,32,116,111,32,115,116,97,114,116,32,119,97,105,116,105, - 110,103,32,102,111,114,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,99,108,105,101,110,116,115,32,116,111,32,99,111,110,110,101,99, - 116,46,32,73,116,39,108,108,32,116,104,101,110,32,99,114,101,97,116,101,32,99,111,110,110,101,99,116,105,111,110,32,111,98,106,101,99,116,115,32, - 102,111,114,32,117,115,32,119,104,101,110,32,99,108,105,101,110,116,115,32,97,114,114,105,118,101,46,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,105,102,32,40,97,115,83,111,99,107,101,116,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,115,101,114,118,101,114,45,62,98,101,103,105,110,87,97,105,116,105,110,103,70,111, - 114,83,111,99,107,101,116,32,40,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,84,101,120,116,40,41,46,103,101,116,73,110,116,86, - 97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79,107, - 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40, - 34,87,97,105,116,105,110,103,32,102,111,114,32,97,110,111,116,104,101,114,32,97,112,112,32,116,111,32,99,111,110,110,101,99,116,32,116,111,32,116, - 104,105,115,32,115,111,99,107,101,116,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,42,32,110,101,119,67,111,110,110,101,99,116, - 105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,40,42,116, - 104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,110,101,119,67, - 111,110,110,101,99,116,105,111,110,45,62,99,114,101,97,116,101,80,105,112,101,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,84,101,120,116, - 40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79,107,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,112, - 112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,87,97,105,116,105,110,103,32,102,111,114,32,97,110,111,116,104,101,114,32,97,112,112,32, - 116,111,32,99,111,110,110,101,99,116,32,116,111,32,116,104,105,115,32,112,105,112,101,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100,100,32,40,110,101,119,67,111,110, - 110,101,99,116,105,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,13, - 10,32,32,32,32,32,32,32,32,105,102,32,40,33,32,111,112,101,110,101,100,79,107,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,56,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103, - 101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,73,110,116, - 101,114,112,114,111,99,101,115,115,32,67,111,109,109,115,32,68,101,109,111,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,70,97,105,108,101,100,32,116,111,32,111, - 112,101,110,32,116,104,101,32,115,111,99,107,101,116,32,111,114,32,112,105,112,101,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,125, - 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,99,111,110,115,116, - 32,83,116,114,105,110,103,38,32,109,101,115,115,97,103,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105, - 110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,67,97,114,101,116,80,111,115,105,116,105,111,110,32,40,73,78,84,95,77,65,88,41,59,13, - 10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,105,110,115,101,114,116,84,101,120,116,65,116,67, - 117,114,115,111,114,32,40,109,101,115,115,97,103,101,32,43,32,84,40,34,92,110,34,41,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111, - 109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,67,97,114,101,116,80,111,115,105,116,105,111,110,32,40,73,78,84,95,77,65,88,41, - 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,99,108,97,115,115,32,68,101,109,111,73,110,116,101,114,112,114,111, - 99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,32,58,32,112,117,98,108,105,99,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110, - 110,101,99,116,105,111,110,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109, - 115,68,101,109,111,38,32,111,119,110,101,114,59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,111,117,114,78,117,109,98,101,114,59,13,10,13, - 10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111, - 110,110,101,99,116,105,111,110,32,40,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,38,32,111,119,110,101,114,95,41, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,40, - 116,114,117,101,41,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,32,40,111,119,110,101,114,95,41,13,10,32,32, - 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,116,97,116,105,99,32,105,110,116,32,116,111,116,97,108,67,111,110, - 110,101,99,116,105,111,110,115,32,61,32,48,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,117,114,78,117,109,98,101,114,32,61,32,43, - 43,116,111,116,97,108,67,111,110,110,101,99,116,105,111,110,115,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32, - 32,126,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,40,41,13,10,32,32,32,32,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,110,101,99,116,105,111,110,77, - 97,100,101,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101, - 110,100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110,110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111, - 117,114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45,32,99,111,110,110,101,99,116,105,111,110,32,115,116,97,114,116,101,100,34,41,41,59, - 13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,110,101,99,116,105,111,110,76,111, - 115,116,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101,110, - 100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110,110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111,117, - 114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45,32,99,111,110,110,101,99,116,105,111,110,32,108,111,115,116,34,41,41,59,13,10,32,32, - 32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,109,101,115,115,97,103,101,82,101,99,101,105,118,101,100,32, - 40,99,111,110,115,116,32,77,101,109,111,114,121,66,108,111,99,107,38,32,109,101,115,115,97,103,101,41,13,10,32,32,32,32,32,32,32,32,123,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110, - 110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111,117,114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45, - 32,109,101,115,115,97,103,101,32,114,101,99,101,105,118,101,100,58,32,34,41,32,43,32,109,101,115,115,97,103,101,46,116,111,83,116,114,105,110,103, - 40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,59,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,99,108,97, - 115,115,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,32,32,58,32, - 112,117,98,108,105,99,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,13,10,32,32,32, - 32,123,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,38,32,111,119,110,101,114, - 59,13,10,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101, - 115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,40,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109, - 111,38,32,111,119,110,101,114,95,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,111,119,110,101,114,32,40,111,119,110,101,114,95,41, - 13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,126,68,101,109,111,73, - 110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,40,41,13,10,32,32,32,32,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101, - 99,116,105,111,110,42,32,99,114,101,97,116,101,67,111,110,110,101,99,116,105,111,110,79,98,106,101,99,116,40,41,13,10,32,32,32,32,32,32,32, - 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105, - 111,110,42,32,110,101,119,67,111,110,110,101,99,116,105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115, - 67,111,110,110,101,99,116,105,111,110,32,40,111,119,110,101,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114, - 46,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100,100,32,40,110,101,119,67,111,110,110,101,99,116,105,111,110,41,59,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32,32, - 32,32,32,32,125,13,10,32,32,32,32,125,59,13,10,13,10,32,32,32,32,79,119,110,101,100,65,114,114,97,121,32,60,68,101,109,111,73,110,116, - 101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,44,32,67,114,105,116,105,99,97,108,83,101,99,116,105,111,110,62,32,97,99, - 116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,59,13,10,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,67,111, - 109,98,111,66,111,120,42,32,109,111,100,101,83,101,108,101,99,116,111,114,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115, - 101,110,100,84,101,120,116,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,115,101,110,100,66,117,116,116,111,110,59,13,10,32, - 32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,59,13,10,13,10,32,32,32,32, - 84,101,120,116,69,100,105,116,111,114,42,32,112,105,112,101,78,97,109,101,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115, - 111,99,107,101,116,78,117,109,98,101,114,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115,111,99,107,101,116,72,111,115,116, - 59,13,10,13,10,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101, - 114,42,32,115,101,114,118,101,114,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,73, - 110,116,101,114,112,114,111,99,101,115,115,67,111,109,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,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::interprocesscommsdemo_cpp = (const char*) temp7; - -static const unsigned char temp8[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,140,0,0,0,86,8,6,0,0,0,29,101,126,119,0,0,0,9,112,72,89, - 115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,4,103,65,77,65,0,0,177,142,124,251,81,147,0,0,0,32,99,72,82,77,0,0, - 122,37,0,0,128,131,0,0,249,255,0,0,128,233,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,111,146,95,197,70,0,0,59,48,73,68, - 65,84,120,218,98,100,160,30,96,68,195,76,72,24,89,140,17,77,223,63,32,254,143,70,255,67,226,195,212,12,58,160,163,163,192,112,252,248,20,6, - 38,38,102,134,55,111,62,50,240,240,112,50,176,178,178,48,252,249,243,7,136,255,49,48,2,125,202,206,206,6,246,198,143,31,191,24,254,3,125,35, - 38,38,204,240,244,233,75,6,102,102,38,134,159,63,127,51,60,124,248,146,129,139,139,157,97,235,214,19,12,143,30,189,98,48,53,85,103,200,204,156, - 128,213,190,89,179,138,24,230,205,219,193,16,23,231,6,182,251,247,239,191,12,2,2,60,12,191,126,253,102,48,48,80,97,248,242,229,59,208,158,159, - 12,188,188,220,96,243,65,118,130,0,19,19,35,3,27,27,43,208,77,127,25,62,124,248,204,32,44,204,15,118,203,185,115,183,24,56,57,217,193,248, - 196,137,171,12,147,39,111,96,40,43,139,96,72,75,235,133,235,69,7,0,1,196,66,165,132,2,75,8,204,72,152,9,137,141,45,65,49,64,19,4, - 58,254,11,197,127,160,9,229,47,84,253,255,193,154,112,70,18,0,8,32,22,10,18,9,3,82,9,194,12,53,11,134,33,137,132,145,145,153,135,139, - 139,131,135,137,129,79,130,157,89,76,137,147,133,239,195,31,166,223,172,204,76,204,223,127,253,248,7,148,254,247,135,145,241,247,163,207,95,223,255,98, - 102,251,244,241,231,207,47,63,126,254,250,5,53,31,148,80,126,67,19,14,114,226,249,135,148,184,70,1,157,1,64,0,177,80,80,162,48,33,37,16, - 54,36,54,147,58,31,187,132,190,176,128,150,40,195,31,25,35,17,110,77,101,182,223,42,66,172,255,20,152,153,126,113,178,75,112,252,102,98,97,96, - 249,245,150,241,223,159,95,255,254,254,253,199,244,251,219,23,158,119,31,24,217,95,221,254,202,117,235,236,135,159,87,175,252,102,60,127,237,237,167,103, - 223,127,255,253,137,84,218,252,134,98,228,210,103,52,209,208,25,0,4,16,11,137,9,133,17,169,186,97,5,98,118,104,98,97,226,224,226,226,209,226, - 100,81,12,22,102,117,52,227,254,229,166,166,240,95,147,75,150,139,157,149,7,168,64,138,143,129,153,135,141,129,137,157,153,129,153,139,133,129,145,153, - 145,225,239,247,191,12,255,254,254,99,248,247,243,47,195,159,15,191,36,255,190,255,161,109,242,138,193,209,255,41,243,159,167,175,254,61,188,41,37,113, - 250,228,95,174,131,203,110,63,62,249,229,231,175,55,64,181,32,123,126,65,49,35,82,105,51,154,112,232,8,0,2,136,133,196,82,133,25,169,68,1, - 37,22,14,102,96,43,207,94,90,66,39,77,150,63,90,155,227,131,163,160,224,55,17,97,123,25,6,118,5,30,6,70,78,86,104,139,4,24,159,255, - 128,248,47,144,243,23,88,56,252,254,207,192,12,52,129,25,212,42,4,38,36,118,9,110,80,203,12,28,239,255,127,252,101,17,123,246,69,89,245,234, - 71,101,187,187,31,195,35,4,101,206,46,121,243,103,225,154,59,207,246,125,248,241,235,27,52,193,124,135,210,191,209,26,206,163,128,198,0,32,128,136, - 73,48,200,13,90,88,66,1,151,44,138,226,226,146,9,50,66,193,190,252,31,35,100,245,222,74,243,26,9,51,176,137,202,48,48,130,34,31,216,90, - 103,120,253,17,90,123,252,7,165,14,160,14,94,6,6,110,49,96,146,99,135,152,252,27,24,255,191,190,48,48,124,254,4,140,114,160,58,22,62,6, - 70,22,38,6,14,121,126,6,14,21,1,6,190,247,223,24,249,206,189,51,41,59,249,85,219,138,85,116,235,212,231,223,231,157,125,241,238,38,212,45, - 63,160,9,231,55,82,21,197,48,154,112,104,11,0,2,136,133,200,146,133,5,90,5,113,2,49,23,63,63,63,119,172,170,180,71,24,251,151,4,5, - 241,215,58,226,126,226,12,108,192,72,102,248,241,15,92,122,48,124,127,3,140,82,160,114,41,29,160,106,41,96,41,34,15,212,41,7,76,48,146,192, - 4,194,198,240,255,205,107,160,90,96,98,145,6,38,30,30,110,6,70,182,175,12,12,183,22,51,48,60,61,4,180,13,152,168,190,255,1,39,7,54, - 96,119,79,196,89,154,65,64,239,59,39,255,158,231,33,58,87,24,172,151,243,139,77,157,245,240,253,134,175,63,126,195,170,198,239,80,119,254,129,86, - 83,116,3,90,90,10,12,255,128,37,39,184,112,28,33,0,32,128,88,8,148,44,76,72,85,16,40,177,112,178,178,177,113,149,104,43,36,68,178,63, - 43,16,117,227,97,225,53,82,97,96,4,69,211,7,104,124,253,1,70,190,146,7,3,131,124,48,195,255,23,192,4,116,15,88,32,252,249,195,240,255, - 246,78,6,134,199,64,246,219,151,12,255,63,188,4,138,1,227,153,79,132,129,129,87,152,129,81,223,137,129,41,174,10,82,56,60,61,2,76,154,60, - 208,18,8,168,255,215,63,96,193,195,193,32,22,169,194,192,113,246,149,100,230,182,23,77,50,236,34,178,181,55,223,206,248,246,243,23,44,65,35,131, - 191,244,42,101,242,243,131,193,99,27,44,44,44,35,38,193,0,4,16,11,129,6,46,72,158,3,86,178,136,10,9,10,149,42,11,39,4,138,60,73, - 148,13,145,100,97,147,1,150,42,159,127,67,218,39,160,56,250,11,76,4,134,165,64,182,37,195,191,169,93,12,255,15,111,0,202,1,171,37,198,255, - 144,10,3,220,10,2,22,12,160,0,102,7,26,255,245,57,3,195,167,39,12,255,175,93,96,248,247,250,57,3,83,94,50,3,195,51,96,130,249,15, - 29,114,249,243,13,82,85,129,74,46,160,62,62,19,80,149,199,201,20,188,252,65,58,219,127,33,158,170,59,239,39,124,254,254,243,3,90,87,255,63, - 189,218,52,223,190,253,28,113,85,18,64,0,177,224,72,44,176,198,45,59,44,177,136,9,241,11,53,107,201,20,120,138,60,137,146,142,87,96,96,226, - 2,166,163,143,191,160,73,11,72,252,250,12,172,98,172,24,254,179,0,19,75,158,31,3,195,155,59,12,12,130,64,53,140,220,144,4,192,200,136,105, - 19,27,11,68,156,253,55,195,255,203,59,128,49,144,199,192,32,160,12,108,251,92,1,138,241,49,48,200,58,48,48,136,153,1,93,2,44,224,94,28, - 7,150,80,251,25,56,36,88,25,164,146,85,24,252,22,221,143,254,253,95,248,87,221,189,247,83,191,124,251,142,62,248,55,218,237,166,17,0,8,32, - 38,60,189,33,88,53,196,205,203,203,45,80,161,44,150,234,204,254,40,82,60,88,134,129,137,19,152,16,190,253,65,77,4,255,129,241,195,175,192,192, - 112,227,2,48,177,220,5,70,52,176,45,194,8,77,143,216,18,11,92,223,127,136,181,255,25,33,205,215,255,64,66,64,150,129,193,102,6,208,230,88, - 96,41,245,138,225,255,238,251,12,255,185,162,24,24,236,129,98,127,249,129,53,214,47,6,241,112,89,6,95,137,111,177,69,178,124,49,192,210,7,152, - 42,25,120,160,238,101,67,234,250,51,210,42,224,128,205,56,6,54,96,130,255,63,194,146,36,64,0,177,224,40,93,88,161,85,17,15,19,11,11,119, - 153,186,116,156,47,223,171,100,153,24,25,70,54,49,96,188,124,3,54,19,254,1,91,165,127,128,152,137,25,146,153,255,1,171,143,47,207,128,9,197, - 6,168,147,3,210,149,38,182,199,254,15,168,159,157,139,225,63,211,79,6,70,94,25,6,6,245,2,134,255,139,150,50,252,91,213,3,52,255,55,164, - 156,88,197,205,192,20,211,194,192,232,63,143,129,225,88,38,3,187,200,11,6,133,20,5,150,132,149,79,50,31,255,19,123,62,255,246,243,237,12,152, - 243,80,52,27,17,238,237,205,97,208,212,148,103,248,253,251,15,120,46,102,164,0,128,0,98,193,147,88,64,185,150,35,68,73,194,201,159,227,117,146, - 84,144,4,19,187,172,0,48,81,0,235,237,63,192,174,176,152,46,176,202,240,4,170,146,135,36,150,251,235,192,189,28,70,147,16,6,70,73,29,134, - 255,207,207,1,147,27,23,180,125,67,160,31,246,239,47,3,35,23,23,48,177,0,19,163,92,37,195,255,249,115,24,254,173,104,103,96,16,226,2,13, - 9,66,27,192,191,25,254,77,47,100,96,124,255,26,216,64,238,101,96,56,152,192,192,2,116,142,180,175,4,123,214,179,39,37,143,165,4,222,237,121, - 246,225,40,3,98,46,138,198,137,102,100,78,107,1,4,16,19,150,4,3,42,210,185,64,197,187,190,140,152,122,150,48,115,150,140,13,23,15,151,134, - 16,48,177,0,115,251,79,96,91,69,209,157,129,65,165,137,225,223,241,79,12,255,102,0,75,130,13,192,106,72,22,216,203,49,169,6,182,107,142,48, - 48,166,86,2,195,147,25,220,59,34,10,0,115,41,131,28,176,237,34,105,204,240,127,239,65,134,127,203,58,161,237,31,102,72,149,5,194,172,192,116, - 44,192,201,240,127,69,27,195,255,237,251,25,24,76,27,129,13,230,79,12,108,178,188,12,138,86,92,162,133,82,156,105,124,156,236,18,48,183,35,85, - 77,84,175,150,216,217,89,25,20,20,196,193,165,203,72,3,0,1,196,132,165,116,97,7,7,58,19,19,79,12,247,255,64,21,217,207,42,2,118,192, - 106,226,43,48,211,254,124,207,192,32,101,196,240,95,36,150,225,95,77,18,195,255,137,192,170,99,239,60,134,255,11,107,25,254,101,185,48,252,191,5, - 212,42,99,207,192,104,164,206,192,232,16,6,140,208,239,68,68,215,127,112,19,149,81,223,158,129,225,253,51,134,127,139,90,129,46,248,15,25,199,65, - 46,24,64,137,6,212,195,18,224,96,248,55,179,24,216,77,7,230,112,195,92,160,29,239,24,248,109,36,25,84,133,191,153,186,138,240,152,193,186,255, - 12,136,249,45,170,183,101,108,109,117,25,156,157,45,192,203,9,70,26,0,8,32,38,36,26,185,161,203,105,38,204,167,225,40,198,226,33,236,34,6, - 108,187,2,165,126,3,219,43,124,192,12,172,10,76,36,125,13,12,255,175,3,123,45,226,192,42,132,31,216,184,21,229,97,248,255,229,33,195,191,150, - 56,134,127,135,111,49,48,240,170,50,48,70,151,48,48,8,11,3,245,253,196,223,232,5,149,66,108,192,210,68,207,142,225,223,166,89,12,12,207,129, - 13,102,78,104,207,10,75,218,2,39,36,150,191,12,255,250,243,129,250,156,24,24,68,12,25,88,184,255,50,136,90,8,49,68,11,50,70,137,241,241, - 136,34,37,26,86,90,148,50,30,30,230,12,191,126,125,3,175,51,25,105,0,32,128,152,144,122,70,136,210,5,72,251,10,176,122,41,104,51,8,115, - 40,10,66,70,94,65,3,114,250,69,12,255,246,159,102,248,127,122,11,48,162,184,161,173,131,255,16,154,7,216,13,230,252,203,240,191,63,135,225,255, - 242,201,12,140,42,250,192,68,3,172,162,190,253,6,183,81,112,130,31,63,24,24,21,13,129,145,207,198,240,127,7,176,65,203,197,70,184,87,5,74, - 80,175,238,51,252,219,186,26,152,128,129,189,167,47,63,24,4,204,69,25,76,181,152,116,2,196,184,29,145,134,3,216,105,81,202,128,26,185,255,255, - 143,204,30,59,64,0,161,207,19,129,90,152,172,186,194,124,170,206,18,140,118,124,230,66,144,17,141,31,159,128,173,75,75,96,196,235,48,48,44,239, - 2,150,32,160,72,69,235,145,131,186,213,172,64,113,54,70,134,127,211,202,24,254,111,158,201,192,20,146,207,192,104,237,205,192,240,249,27,246,68,0, - 18,2,117,165,173,128,141,231,179,187,24,24,94,60,134,152,65,40,50,64,242,92,64,251,79,108,6,38,5,57,160,171,129,133,10,11,35,131,152,147, - 8,147,63,239,55,15,17,14,86,113,104,98,225,128,102,4,170,37,24,97,97,190,17,89,178,192,0,64,0,33,15,255,195,74,24,78,123,94,54,11, - 69,69,22,73,86,41,96,149,3,90,170,199,2,84,162,153,1,108,220,46,102,248,255,234,17,48,26,216,113,84,25,255,33,114,192,200,252,55,173,156, - 225,255,165,195,12,76,249,83,24,24,37,20,128,37,205,87,204,68,3,170,142,4,128,85,158,186,62,195,255,125,171,33,19,148,196,2,96,194,250,255, - 226,26,195,255,71,192,68,198,13,44,5,191,253,98,96,1,186,87,85,146,89,83,157,141,73,141,1,177,244,130,21,234,63,138,99,89,80,144,135,97, - 193,130,10,6,62,62,174,17,91,194,0,4,16,19,218,168,46,7,31,7,7,176,217,194,102,206,165,12,12,103,102,160,240,175,143,224,17,215,255,31, - 248,24,254,111,155,14,108,199,176,224,47,1,64,221,104,208,56,204,143,143,12,255,38,229,0,35,83,0,216,107,106,3,38,142,255,144,82,8,150,176, - 64,209,247,21,88,29,153,186,2,35,251,35,195,255,59,231,129,250,56,137,119,57,168,132,251,7,44,158,126,124,129,118,205,255,49,48,177,50,51,240, - 136,179,178,121,72,241,25,1,5,57,145,74,24,170,12,228,153,152,168,51,168,171,203,128,215,226,142,84,0,16,64,76,72,237,23,240,210,5,101,110, - 118,25,57,222,255,42,236,114,188,144,238,46,104,88,94,41,138,225,255,198,249,192,46,243,107,160,10,14,194,163,26,160,68,195,3,44,157,110,93,1, - 246,164,114,129,61,166,96,6,70,39,96,91,227,227,87,200,186,23,208,92,18,168,199,195,196,204,192,104,235,203,240,255,216,14,200,200,9,177,211,190, - 224,169,8,96,15,69,72,5,216,107,3,54,196,191,189,134,183,109,5,244,5,24,116,4,88,13,57,217,217,249,145,74,25,88,9,67,81,130,81,86, - 150,2,207,31,49,50,142,220,42,9,32,128,152,208,186,211,108,214,50,162,26,130,252,127,248,89,69,56,33,75,16,68,13,128,61,32,96,233,114,112, - 5,48,17,176,146,22,230,252,92,12,255,118,47,97,248,183,115,49,3,83,124,21,3,179,148,28,3,179,0,176,113,44,46,193,240,143,23,72,91,184, - 49,48,74,43,50,48,221,60,2,44,137,136,72,136,32,187,65,137,234,55,176,154,252,242,159,129,209,47,3,216,131,123,0,100,191,1,138,131,74,195, - 63,12,156,138,252,12,138,66,127,228,204,101,196,229,25,80,151,143,82,212,91,146,145,17,101,72,76,244,24,145,93,105,100,0,16,64,24,171,232,228, - 153,254,40,242,74,178,48,48,129,86,203,253,249,13,78,48,12,55,46,51,48,188,121,6,84,193,206,64,210,228,9,176,4,249,207,193,198,240,111,58, - 176,11,252,249,37,195,67,159,28,134,162,83,239,24,12,215,61,98,16,93,246,152,65,115,213,117,134,234,186,122,134,39,160,201,104,113,113,134,255,184, - 74,24,80,35,19,132,65,83,17,239,128,13,240,111,76,12,76,105,61,12,76,46,192,154,231,194,36,160,102,46,72,159,27,52,29,193,193,204,32,40, - 194,204,41,201,193,42,5,205,8,172,212,232,94,255,253,251,15,88,186,252,26,209,165,11,8,0,4,16,11,82,131,151,149,133,141,157,75,136,233,143, - 40,155,40,43,98,132,21,216,3,249,127,249,20,98,86,154,148,4,3,82,11,76,100,44,108,204,12,87,167,214,50,68,157,254,201,112,233,198,55,184, - 244,199,123,15,24,218,128,120,181,0,59,195,2,55,25,6,43,126,126,134,63,239,63,0,173,129,218,13,234,142,131,150,117,254,6,141,48,3,53,136, - 74,48,48,26,88,50,48,121,69,3,171,73,96,252,31,205,132,148,54,156,66,208,210,9,226,54,14,118,70,22,177,255,191,164,144,252,198,204,128,186, - 71,138,164,22,171,142,142,34,3,43,176,125,244,23,228,22,6,150,17,157,96,0,2,136,5,169,132,97,21,226,229,225,230,103,102,228,7,151,46,255, - 161,93,101,240,114,107,38,72,247,26,148,203,97,99,47,132,27,26,160,21,186,12,255,129,237,149,247,252,98,12,89,155,47,48,92,122,250,21,171,202, - 219,31,126,50,228,28,124,206,176,219,67,156,129,239,215,15,240,216,13,35,43,208,78,80,181,197,39,204,192,32,167,206,192,104,236,196,192,232,24,201, - 192,40,10,76,7,223,143,3,75,61,96,21,41,1,44,253,64,203,97,222,223,3,186,9,180,206,134,7,156,168,57,68,216,24,164,25,255,74,48,113, - 112,112,254,251,241,227,51,165,85,18,104,115,217,203,151,239,193,139,165,70,58,0,8,32,22,164,110,53,51,31,7,59,23,31,203,31,94,54,208,36, - 32,168,87,3,154,203,121,115,137,129,209,45,144,225,255,110,96,163,247,45,48,114,184,217,32,189,39,144,28,56,248,255,65,26,185,176,68,4,79,76, - 255,193,187,2,152,57,217,25,118,63,254,204,112,8,71,98,129,129,243,47,191,49,172,122,202,202,144,105,23,196,240,91,92,133,129,73,89,139,129,145, - 31,152,88,152,217,24,24,5,128,165,220,47,96,17,115,249,24,144,254,4,196,192,4,245,93,153,225,191,128,41,3,147,148,40,3,131,42,80,238,218, - 20,6,134,15,192,46,54,151,16,48,229,51,51,40,113,51,72,137,11,240,241,62,127,241,227,45,3,98,67,29,89,9,6,212,43,2,85,73,163,128, - 129,1,32,128,88,144,138,106,230,255,255,255,51,179,241,48,49,177,10,177,65,218,3,108,192,132,243,112,47,3,163,149,43,3,83,235,6,134,255,75, - 187,25,254,63,185,2,236,14,191,7,134,226,23,200,178,4,80,187,131,157,5,210,155,98,99,101,96,100,231,102,248,15,234,93,49,178,51,252,231,6, - 150,16,242,10,12,219,182,93,33,202,49,135,88,101,25,50,67,114,129,118,0,27,178,15,174,49,252,59,119,128,129,225,245,19,6,198,223,63,25,254, - 127,7,54,54,191,1,219,47,44,144,46,249,127,112,175,138,133,225,47,176,219,206,96,31,201,192,20,94,199,192,120,165,14,232,238,207,12,140,192,42, - 144,129,249,31,200,15,172,12,168,59,49,241,86,73,220,192,134,247,215,175,63,70,83,5,30,0,16,64,200,221,77,38,54,38,70,86,102,22,96,75, - 149,25,22,166,76,144,241,142,147,192,200,208,78,102,96,108,234,100,248,255,238,51,164,1,252,230,45,164,20,226,3,182,31,68,36,64,43,182,193,51, - 202,140,192,72,252,15,140,216,255,64,189,140,28,60,12,255,217,217,25,62,95,200,99,96,56,123,159,160,99,222,92,63,203,240,191,55,158,225,207,157, - 251,12,140,224,113,21,144,11,129,13,103,112,239,8,24,231,124,156,136,248,6,181,167,64,37,27,104,156,104,213,100,134,255,34,114,12,140,150,1,192, - 174,252,44,96,161,196,194,240,129,225,247,215,47,191,126,255,37,118,12,70,65,65,130,97,225,194,10,6,103,231,226,209,170,7,15,0,8,32,22,164, - 65,250,255,34,172,76,188,220,191,127,112,253,7,70,6,35,100,52,12,148,140,32,244,153,118,96,162,152,196,192,168,234,207,192,96,148,10,140,6,121, - 134,255,79,239,50,48,220,187,8,44,13,174,67,22,119,63,186,206,240,255,213,83,134,255,63,190,3,75,128,191,12,127,64,123,144,120,217,24,100,158, - 61,33,202,49,226,156,140,12,191,129,250,254,113,115,65,218,75,56,219,166,140,136,222,19,104,92,136,27,216,40,126,114,13,200,118,3,175,31,254,7, - 76,200,140,191,126,48,51,254,253,131,126,24,0,214,177,24,49,49,1,134,141,27,155,25,68,69,5,71,19,11,1,0,16,64,40,11,168,190,254,103, - 252,245,243,15,243,223,127,191,129,109,15,14,88,33,3,12,223,31,239,33,221,107,45,96,175,228,45,7,195,255,233,211,25,254,159,223,193,240,255,205, - 99,200,158,34,216,234,58,164,188,12,42,21,64,109,230,63,124,252,12,142,226,124,12,147,136,232,97,57,203,242,50,252,248,14,108,159,0,75,142,255, - 196,110,221,128,141,30,203,169,50,64,214,73,252,101,248,245,238,47,168,243,244,255,47,68,14,57,145,96,36,22,121,121,113,134,29,59,186,24,20,21, - 37,192,167,39,140,2,252,0,32,128,144,19,12,211,227,247,31,63,189,20,227,126,255,231,253,47,65,102,65,96,241,15,202,160,160,53,48,226,38,12, - 12,6,221,12,255,22,207,102,248,191,121,26,176,13,243,22,50,249,7,154,40,4,173,170,99,68,138,15,120,227,23,50,226,251,27,152,248,76,133,89, - 25,34,53,133,24,150,95,123,139,211,33,118,146,156,12,14,18,236,12,63,222,190,102,224,98,36,161,117,10,181,143,81,76,22,152,176,95,128,221,242, - 231,235,31,96,149,196,242,229,199,239,63,255,208,218,44,40,41,86,86,86,140,97,215,174,110,6,53,53,25,134,215,175,63,142,232,73,69,98,1,64, - 0,177,32,5,228,255,215,31,191,124,127,243,139,227,227,95,208,110,0,112,23,26,88,212,179,113,51,48,232,86,51,252,155,221,195,240,127,229,36,6, - 6,33,96,195,66,152,23,181,123,13,143,134,255,104,227,109,192,138,13,88,197,176,124,249,194,80,162,193,195,240,230,63,15,195,238,123,47,129,137,16, - 181,97,105,98,106,198,208,98,38,196,192,113,247,16,176,128,98,34,45,226,254,2,75,36,94,81,6,70,69,13,96,47,233,8,3,168,225,243,231,235, - 23,134,215,63,255,124,248,251,235,215,31,44,245,26,152,47,41,41,196,176,115,103,55,131,146,146,52,195,167,79,95,25,24,71,211,10,81,0,32,128, - 152,24,16,107,94,65,253,227,191,47,152,121,94,254,249,249,31,210,251,1,173,129,145,182,6,246,90,62,48,252,223,58,25,88,217,115,65,218,12,200, - 221,104,60,173,12,80,188,179,2,99,226,223,251,55,12,194,192,58,102,202,148,73,12,253,254,38,12,94,242,220,12,150,210,60,12,110,10,124,12,157, - 230,194,12,11,188,213,25,228,99,75,129,213,144,0,3,235,159,159,144,132,70,172,15,126,0,19,181,146,62,48,17,179,51,48,188,187,10,238,157,125, - 123,247,155,225,29,3,203,103,6,212,61,74,240,181,189,114,114,226,12,123,247,246,49,104,106,202,50,124,251,246,125,196,143,222,146,2,0,2,176,114, - 245,42,17,196,64,120,50,73,60,214,221,205,33,200,117,250,26,130,149,173,141,118,190,193,21,247,22,182,231,139,248,8,87,249,28,214,119,219,184,90, - 136,39,194,178,183,201,248,101,179,224,54,130,11,22,97,32,132,252,205,144,249,230,99,38,241,133,241,163,22,170,214,214,95,187,15,114,61,219,138,174, - 226,28,192,118,155,74,96,99,154,67,248,27,73,26,117,192,210,7,57,52,107,60,201,213,29,249,247,87,186,221,63,211,245,197,41,125,122,166,66,11, - 205,96,32,135,167,71,226,124,78,217,242,158,204,195,10,6,211,66,239,246,119,208,43,244,195,60,99,139,234,242,6,110,18,161,123,243,70,190,203,105, - 255,210,180,213,65,215,35,131,241,24,234,181,214,178,88,156,200,102,179,134,27,58,27,94,22,53,120,54,153,92,50,18,134,187,96,214,170,40,50,118, - 46,83,198,88,213,117,29,130,188,132,173,172,61,146,200,92,91,107,4,238,57,164,165,228,95,178,35,18,44,4,200,199,180,81,26,163,85,89,230,218, - 185,99,28,139,99,25,140,74,227,20,214,183,18,153,106,31,63,88,97,14,144,146,184,165,105,27,249,22,64,44,12,136,131,122,192,248,232,227,103,15, - 159,242,51,127,21,121,253,157,155,149,157,9,178,157,4,212,86,97,98,32,121,161,60,35,176,136,97,254,254,157,129,77,70,133,129,211,59,138,225,223, - 220,42,134,239,160,29,40,172,140,12,2,108,144,54,14,51,11,43,3,187,172,36,3,211,190,5,12,12,170,189,12,172,197,64,188,8,216,141,23,230, - 135,110,97,193,2,128,61,153,191,159,190,48,48,124,255,6,158,46,96,176,112,98,96,120,212,5,172,62,153,25,126,60,252,194,240,244,11,199,235,43, - 239,62,191,128,249,13,88,162,48,197,197,185,114,185,185,153,50,105,107,43,114,8,9,9,1,195,23,114,180,23,35,120,30,130,233,63,43,235,119,80, - 59,6,182,185,31,47,0,245,164,128,181,29,19,63,63,55,208,44,62,150,23,47,222,242,156,63,127,71,233,235,215,31,18,63,127,254,18,252,249,243, - 183,0,208,2,112,243,159,153,153,233,15,59,59,235,91,14,14,246,247,124,124,220,207,140,141,85,239,139,136,240,255,4,170,253,249,237,219,143,159,160, - 200,38,167,128,3,37,2,144,59,128,102,51,11,8,112,115,112,114,114,49,61,123,246,88,232,226,197,59,234,223,190,253,20,253,241,227,151,40,80,30, - 214,117,1,29,89,246,137,147,147,253,13,55,55,251,43,11,11,237,155,192,140,243,21,216,59,252,243,253,251,207,31,255,192,41,159,56,71,0,4,16, - 114,130,1,159,130,240,224,231,239,215,247,190,242,61,82,191,245,94,147,213,68,144,129,225,205,101,96,163,215,154,129,129,147,7,50,183,131,43,18,113, - 213,121,95,254,48,176,199,37,51,236,60,113,146,225,192,166,195,12,44,156,28,64,11,191,65,124,1,244,52,51,180,41,164,199,203,197,16,180,162,139, - 129,181,110,41,195,57,183,92,134,117,179,39,49,176,114,112,161,164,127,240,142,123,160,223,100,121,89,25,162,164,248,24,184,223,1,27,228,118,1,12, - 140,124,192,68,253,234,12,176,11,207,195,240,237,238,99,134,91,63,152,30,188,248,244,245,19,200,95,192,92,247,215,203,203,156,239,217,179,183,145,19, - 38,172,149,102,103,103,249,13,140,76,70,164,128,255,15,12,52,246,152,24,151,35,42,42,50,43,112,37,24,72,9,244,31,116,30,29,179,181,181,54, - 251,207,159,63,133,118,236,56,173,177,111,223,57,247,107,215,30,152,0,19,140,44,48,199,10,1,149,242,162,117,38,96,59,49,223,3,19,205,59,51, - 51,141,251,250,250,74,7,34,34,156,118,169,168,72,61,83,82,146,122,255,242,229,251,63,164,148,57,80,149,76,202,202,82,108,194,194,252,194,91,182, - 28,215,171,173,157,239,125,229,202,3,147,203,151,239,129,230,208,132,25,32,107,129,144,251,154,160,56,254,4,244,239,123,43,43,173,39,42,42,210,71, - 226,227,61,182,233,233,41,221,253,253,251,207,59,160,245,191,129,238,255,15,74,59,248,18,48,64,0,193,18,12,252,132,167,47,255,24,62,159,252,203, - 115,199,249,213,87,77,96,140,1,219,5,55,24,24,149,128,246,170,152,49,48,220,216,199,192,192,205,67,92,41,6,178,21,88,186,48,73,43,51,48, - 57,6,50,236,204,201,100,152,114,21,20,135,159,176,42,143,209,18,98,8,22,5,182,153,166,150,49,156,85,242,98,104,187,8,106,130,124,198,170,214, - 66,146,155,33,72,82,152,129,135,95,136,225,191,127,10,3,195,227,141,96,231,255,251,246,143,225,253,195,191,127,119,188,248,118,9,216,221,6,181,172, - 127,113,115,115,252,5,118,157,57,167,77,219,232,245,248,241,43,19,92,206,85,86,150,6,150,68,18,171,176,141,4,131,138,114,96,143,138,81,94,94, - 130,19,88,245,240,239,218,117,198,177,167,103,101,200,237,219,79,220,128,129,204,77,112,82,13,50,1,42,246,227,199,79,177,67,135,46,106,0,177,231, - 188,121,219,243,156,156,12,87,149,150,70,172,85,87,151,185,46,37,37,242,25,88,50,252,198,55,14,4,58,4,17,88,162,129,26,236,108,170,170,210, - 252,23,46,220,53,8,9,105,204,184,114,229,190,59,48,210,9,185,3,148,55,5,129,9,67,240,232,209,171,74,64,108,183,114,229,129,116,59,59,189, - 77,85,85,49,11,61,61,205,175,8,11,243,125,126,247,238,211,175,127,120,154,29,0,1,196,194,128,122,28,216,47,96,15,230,231,209,87,111,111,62, - 187,205,224,36,252,237,55,55,195,127,208,2,240,135,12,76,206,17,12,255,46,2,19,12,215,127,226,166,100,64,99,32,192,210,229,95,114,22,100,228, - 247,206,5,252,161,10,234,130,243,240,48,48,190,188,201,240,247,238,107,252,165,22,208,236,63,159,191,50,252,11,44,100,96,18,3,58,251,208,6,96, - 190,22,98,248,117,245,3,195,229,167,127,31,28,255,252,235,46,212,95,191,128,57,234,47,40,194,89,88,152,240,142,200,1,171,8,166,23,47,222,193, - 166,18,224,39,64,128,78,198,116,118,54,102,1,150,64,60,192,8,82,203,204,236,207,62,120,240,98,24,52,7,147,13,128,246,73,111,222,124,188,16, - 152,248,130,83,82,188,167,53,55,39,46,251,240,225,203,251,53,107,14,126,193,217,33,252,251,143,177,169,41,129,83,92,92,80,180,172,108,86,210,210, - 165,123,178,128,98,34,228,186,1,88,109,9,3,237,79,220,189,251,172,87,118,118,192,132,210,210,176,149,95,190,252,120,109,98,162,254,245,232,209,43, - 88,83,13,64,0,49,33,85,71,160,5,4,160,92,249,247,228,203,183,247,118,62,101,187,244,241,216,43,96,2,1,134,203,221,181,12,140,118,142,12, - 140,114,234,64,85,223,25,8,86,186,160,30,214,7,96,105,97,228,192,240,223,39,137,225,231,190,149,12,127,191,227,159,124,4,21,115,191,254,252,99, - 248,201,193,206,240,251,35,254,4,243,15,216,45,255,107,21,206,240,207,59,140,225,223,217,22,96,218,4,205,27,49,50,188,61,245,158,97,221,139,95, - 167,63,252,248,245,158,1,114,66,213,15,96,23,29,124,10,231,255,255,12,120,135,2,129,213,18,211,219,183,159,80,86,230,129,246,78,183,183,167,176, - 2,171,15,209,222,222,213,1,126,126,213,75,129,137,37,142,210,196,130,12,128,237,29,185,169,83,55,180,5,7,55,244,190,122,245,65,53,40,200,142, - 223,211,211,12,35,128,99,99,221,152,252,253,173,248,126,252,248,173,25,30,222,212,182,104,209,174,90,74,18,11,90,117,43,62,101,202,250,182,240,240, - 230,150,47,95,190,171,206,157,91,202,99,110,174,137,53,146,1,2,136,9,169,74,250,5,77,48,63,128,38,252,88,251,238,207,241,123,71,62,253,252, - 5,58,76,227,243,45,200,146,2,183,84,32,251,31,254,2,6,212,151,254,10,76,28,98,138,12,140,37,253,12,255,128,9,229,207,165,195,12,255,64, - 59,23,241,37,130,255,144,142,24,232,72,152,63,172,248,247,42,255,151,80,5,38,150,40,134,255,215,187,24,254,191,189,201,192,200,207,199,240,237,202, - 91,134,51,55,254,62,217,243,254,215,101,168,127,64,13,216,159,192,18,230,15,49,221,102,96,196,49,127,253,250,29,190,12,2,52,17,217,221,157,193, - 22,22,230,32,90,87,55,47,164,182,118,222,212,55,111,62,170,208,106,120,99,255,254,243,161,65,65,117,83,174,94,125,96,208,209,145,202,239,232,104, - 0,119,180,156,156,24,67,122,186,15,231,147,39,111,212,146,146,58,187,143,29,187,26,197,64,253,29,157,140,39,78,92,139,138,137,105,237,2,150,116, - 74,157,157,233,60,160,1,77,116,0,16,64,176,18,230,15,82,41,3,62,63,238,196,139,183,15,246,190,103,63,247,229,40,168,148,1,182,91,46,207, - 96,96,114,7,150,50,198,46,192,102,200,103,236,165,12,51,19,100,119,192,95,30,6,166,220,54,6,70,41,96,151,239,202,49,134,127,111,159,50,252, - 99,97,37,88,194,128,11,138,255,12,132,87,228,115,179,51,252,187,61,153,225,255,211,195,12,140,188,194,12,127,191,253,97,120,190,231,37,195,214,55, - 127,78,190,250,254,243,45,3,226,56,179,159,192,46,228,111,96,79,5,100,36,35,254,46,242,63,70,96,162,129,171,41,44,12,97,13,15,119,20,236, - 233,89,21,0,108,44,55,49,64,246,107,209,20,0,27,230,86,101,101,51,171,128,93,98,185,204,76,63,46,72,162,96,100,0,86,23,236,192,106,72, - 172,180,116,102,222,173,91,79,28,105,233,134,219,183,159,186,148,151,207,202,149,146,18,18,139,143,119,103,67,151,7,8,32,88,9,243,27,41,144,65, - 75,226,128,13,132,191,95,150,190,248,122,242,238,177,143,95,127,222,3,10,255,1,150,242,143,231,48,48,149,79,102,96,20,146,7,170,248,12,169,122, - 96,9,7,52,171,253,13,168,245,47,59,80,205,108,6,70,96,94,252,255,244,28,195,255,27,151,24,254,253,254,78,176,119,5,63,181,249,63,225,54, - 245,255,207,15,129,248,9,195,127,118,96,167,4,216,245,127,187,227,17,195,233,231,92,119,86,191,253,121,22,154,232,191,66,241,119,96,149,244,27,216, - 83,250,71,168,144,1,245,156,128,13,78,112,117,4,236,246,50,6,4,88,115,3,123,65,86,253,253,107,90,128,98,2,36,134,251,95,164,118,33,73, - 3,29,55,111,62,118,171,171,155,159,47,35,35,198,165,169,41,199,0,116,7,11,176,65,42,92,85,53,39,227,216,177,43,49,68,118,185,63,243,241, - 113,221,7,246,132,206,233,232,40,156,86,83,147,61,11,236,210,223,7,138,127,34,70,63,176,218,77,156,52,105,125,88,96,160,173,128,139,139,49,74, - 196,1,4,16,11,3,226,244,109,88,162,129,5,54,247,133,15,223,238,207,121,43,180,167,98,215,75,127,197,116,96,10,120,178,155,129,65,200,128,129, - 177,114,33,195,255,154,64,96,71,17,152,136,56,160,171,240,64,163,195,194,82,12,76,133,115,24,24,117,128,61,203,131,233,12,12,198,157,12,255,30, - 109,99,160,194,130,125,180,100,206,2,94,199,203,196,251,157,225,243,185,103,12,119,47,252,251,60,237,19,235,174,15,223,64,179,164,224,4,255,5,169, - 132,1,214,134,44,127,9,57,0,188,34,244,31,164,187,29,17,225,200,6,108,252,169,2,171,161,74,96,34,18,36,198,73,28,28,108,239,36,37,133, - 47,1,139,241,187,192,200,122,7,140,156,31,80,59,57,128,109,35,145,107,215,30,106,189,126,253,65,7,104,30,222,146,10,216,19,59,174,171,171,116, - 6,88,53,113,128,70,223,92,92,140,216,129,93,101,227,213,171,15,198,17,114,3,176,26,125,14,236,38,239,5,118,183,175,1,253,253,18,88,178,62, - 7,250,11,212,240,103,249,245,235,55,232,160,2,41,96,207,206,224,194,133,59,174,191,126,253,193,231,47,166,25,51,54,229,0,123,80,103,188,189,45, - 142,31,56,112,225,43,208,221,224,132,15,16,64,44,72,153,27,86,37,193,2,156,11,24,130,156,179,30,190,63,36,197,194,43,156,185,230,129,141,168, - 159,12,3,227,149,73,12,140,166,77,12,76,253,123,25,254,45,239,96,96,184,127,9,60,127,195,168,227,192,192,20,2,108,227,176,1,219,59,7,74, - 32,37,15,171,8,3,227,199,15,144,118,13,85,107,92,96,11,150,139,153,225,235,189,79,12,143,182,188,253,219,251,154,123,235,225,7,207,111,64,19, - 201,23,104,130,7,31,209,10,26,253,100,103,103,35,234,200,15,208,212,19,63,63,55,147,141,141,46,47,176,7,226,3,236,134,155,18,28,200,98,97, - 254,102,100,164,186,222,192,64,121,255,207,159,127,94,191,126,253,241,221,139,23,239,129,221,227,63,255,65,109,39,144,253,252,252,60,28,126,126,150,66, - 192,110,177,204,225,195,151,131,129,145,102,141,54,86,3,90,98,113,3,24,65,43,140,140,212,246,191,123,247,249,30,176,219,254,17,88,42,176,25,27, - 171,75,166,164,116,103,0,149,72,224,11,16,96,73,178,19,232,238,213,31,62,124,125,112,243,230,147,79,111,222,124,248,3,108,68,255,1,118,213,255, - 179,179,179,50,1,187,204,47,164,164,132,175,1,75,157,51,134,134,170,123,129,189,163,248,251,247,159,91,225,25,156,148,154,54,109,67,100,79,79,230, - 13,13,13,185,159,192,174,59,120,124,10,32,128,144,19,204,31,164,54,204,23,6,216,217,118,255,255,178,78,125,241,115,191,210,49,86,9,79,230,167, - 42,34,33,114,12,12,39,170,129,85,78,56,3,115,126,5,80,7,27,195,127,208,80,254,47,96,124,61,233,101,96,120,113,26,178,124,147,133,3,58, - 194,68,214,186,107,252,69,46,43,51,195,175,23,192,196,178,254,229,223,233,175,185,247,172,189,247,252,12,208,252,159,208,129,155,79,72,37,204,47,96, - 149,196,12,236,82,19,156,252,2,201,130,46,149,0,70,62,7,48,146,229,129,57,58,156,144,59,184,184,56,158,250,250,90,206,228,229,229,58,117,228, - 200,149,119,192,4,246,253,243,103,208,86,209,255,200,7,51,130,70,123,89,128,165,206,91,77,77,249,151,94,94,230,247,110,221,146,186,176,103,207,185, - 248,223,191,255,8,0,205,120,98,105,169,181,93,67,67,118,23,176,36,122,56,111,222,246,55,247,238,61,255,14,108,83,253,171,173,141,229,62,117,234, - 186,62,176,116,114,193,231,14,99,99,181,117,192,196,54,23,216,24,126,7,44,61,62,2,219,98,63,25,144,142,109,3,118,159,25,159,62,125,195,4, - 196,172,151,46,221,251,108,97,161,245,209,199,199,242,221,182,109,199,255,220,189,251,220,14,151,185,199,143,95,243,62,123,246,246,202,132,4,143,119,37, - 37,211,193,9,6,32,128,88,144,219,156,72,213,210,55,104,224,131,119,14,190,254,242,253,85,195,115,150,245,252,71,24,163,237,120,158,73,241,187,73, - 51,48,222,91,14,44,93,54,130,215,208,50,254,1,186,239,251,59,72,87,7,116,2,38,168,189,242,247,43,164,221,3,58,151,8,52,105,204,200,76, - 76,229,11,77,91,248,231,32,254,127,251,197,240,114,223,199,255,171,95,242,28,154,115,239,209,97,96,108,127,135,38,148,143,80,119,127,131,38,254,223, - 192,4,3,140,48,230,127,132,183,107,255,3,117,163,153,92,93,77,184,54,109,58,234,9,236,41,168,19,40,254,95,132,134,58,244,3,75,145,83,27, - 54,28,126,247,230,205,167,175,12,136,51,131,255,34,53,205,152,128,221,95,230,247,239,191,48,3,35,244,43,48,81,125,118,116,52,90,229,231,103,245, - 30,200,86,54,51,211,216,11,76,40,119,119,239,62,251,17,152,80,62,3,115,54,200,237,191,129,9,236,191,137,137,58,251,228,201,235,125,128,237,43, - 54,92,238,0,150,26,231,29,29,13,23,238,218,117,250,41,48,49,128,252,255,19,152,224,65,13,125,80,239,240,31,82,27,13,228,14,22,96,98,98, - 61,116,232,210,143,239,223,127,254,246,247,183,158,184,100,201,94,145,87,175,222,107,225,232,57,138,29,63,126,213,43,40,200,230,12,208,158,31,192,70, - 249,95,128,0,98,65,107,168,193,186,215,95,25,144,182,159,128,216,247,222,127,126,82,207,196,179,182,113,199,199,16,139,79,191,37,69,131,129,221,102, - 208,84,193,151,183,144,6,47,11,15,106,19,22,52,177,245,230,16,3,163,71,40,3,195,66,96,169,243,253,51,161,153,60,160,11,191,129,71,135,25, - 254,225,223,50,251,237,227,255,255,235,190,243,157,92,240,232,209,209,191,191,127,127,129,38,150,15,208,4,3,47,93,32,254,97,100,33,102,242,27,52, - 184,7,44,41,88,129,129,204,117,250,244,77,15,2,202,127,3,75,138,121,156,156,236,199,86,175,222,255,6,152,88,190,48,32,78,38,255,139,101,214, - 13,190,127,253,241,227,215,63,215,175,63,252,13,88,170,108,84,84,148,100,219,191,255,194,183,59,119,158,126,7,70,206,15,104,34,7,31,143,15,172, - 94,88,129,137,76,242,234,213,251,166,120,242,215,79,79,79,179,37,188,188,156,239,128,213,204,111,103,103,35,70,9,9,33,38,65,65,94,102,160,24, - 176,93,197,14,95,127,242,237,219,15,166,79,159,190,3,19,238,103,230,23,47,222,49,126,252,248,245,151,136,136,192,43,15,15,211,133,139,22,237,106, - 129,198,51,6,216,189,251,140,129,143,143,133,44,176,84,250,178,110,221,225,127,0,1,196,130,165,117,255,139,1,117,131,62,108,161,56,243,133,183,95, - 238,22,255,231,91,94,127,228,71,160,235,183,219,138,34,129,10,12,204,66,60,144,147,169,64,9,4,214,21,1,31,254,3,140,244,123,91,25,24,77, - 108,24,152,51,39,51,48,148,23,227,28,234,135,116,201,217,129,213,156,53,3,163,154,41,3,227,205,103,12,12,199,38,226,84,250,244,55,195,251,99, - 239,63,95,255,247,231,207,103,104,34,121,15,77,48,159,160,137,253,7,172,135,2,46,180,192,19,140,132,18,204,127,6,33,33,94,96,145,125,95,27, - 216,117,149,195,167,22,212,14,80,80,144,216,183,106,213,129,183,192,196,242,9,106,31,52,129,98,189,166,135,9,169,215,244,251,243,231,111,191,128,37, - 202,87,80,163,246,31,100,90,251,47,122,130,3,54,124,57,158,63,127,171,241,252,249,59,113,92,238,16,16,224,189,5,108,167,112,1,221,96,199,205, - 205,249,11,148,8,128,213,207,223,39,79,94,255,3,173,41,2,54,124,255,35,15,27,128,252,8,44,193,152,128,13,96,102,96,2,101,3,102,12,214, - 175,95,127,112,1,19,215,195,207,159,191,99,29,99,2,86,99,90,192,182,157,44,48,108,110,131,220,7,16,64,44,88,122,182,176,82,230,27,82,3, - 4,182,54,150,225,206,187,79,143,170,255,114,175,126,203,204,225,238,249,242,150,142,180,135,36,51,151,46,176,90,2,237,11,250,254,23,177,209,158,17, - 186,88,255,76,35,3,131,86,30,3,163,62,176,157,119,238,1,238,102,185,186,33,3,99,72,8,80,27,176,196,186,126,19,127,246,254,243,247,55,176, - 246,248,14,44,118,65,137,229,29,20,127,64,43,93,254,146,210,120,2,86,73,160,198,49,243,151,47,223,228,129,69,183,40,62,165,192,134,233,150,135, - 15,95,190,1,226,143,176,222,24,3,254,147,200,97,43,255,224,99,94,160,29,26,72,227,77,200,55,180,128,79,52,6,70,16,168,20,0,37,92,156, - 163,185,192,106,83,123,243,230,227,205,148,246,32,8,100,40,145,39,79,94,137,75,75,139,176,3,171,246,31,0,1,196,130,99,56,228,55,3,234,197, - 89,76,200,51,159,143,62,126,125,94,246,245,251,250,67,111,121,111,199,188,122,110,101,97,252,73,74,212,74,152,129,69,158,23,162,236,215,95,72,137, - 3,58,45,10,116,210,193,213,105,12,12,111,223,224,119,246,247,59,192,146,101,34,208,178,31,12,140,95,191,19,154,121,248,207,193,206,246,25,152,131, - 222,65,75,23,228,182,11,114,78,39,126,224,228,47,104,150,150,137,25,152,227,196,24,240,108,111,4,182,93,222,105,106,202,94,1,150,46,159,144,18, - 203,111,34,22,127,160,223,58,199,136,69,238,31,100,24,5,88,47,114,113,176,2,75,24,65,2,99,71,212,56,180,158,17,121,246,30,27,56,118,236, - 154,60,176,123,207,201,207,207,245,25,32,128,88,240,120,236,23,218,140,43,3,210,82,136,63,191,254,252,251,179,238,249,199,83,59,95,49,223,246,127, - 205,160,19,124,233,135,161,153,54,135,148,168,1,31,19,139,44,55,3,51,31,59,176,124,1,54,30,64,91,79,64,51,254,255,158,19,152,124,252,201, - 192,196,199,203,240,239,39,104,46,233,43,161,233,253,63,28,28,108,31,129,141,59,88,233,242,17,169,161,11,75,44,68,206,146,34,192,199,143,95,184, - 46,95,190,47,133,79,13,176,157,243,136,149,149,245,203,151,47,160,147,10,224,165,10,177,137,243,63,82,137,130,75,14,84,229,49,177,178,50,11,30, - 60,120,81,158,97,16,128,55,111,62,138,242,240,112,113,0,195,156,9,32,128,112,37,24,88,32,252,198,145,11,224,235,103,190,2,203,239,101,207,63, - 31,219,254,150,229,170,253,147,223,234,62,103,190,106,25,203,176,203,73,200,48,115,114,200,114,50,252,19,226,96,248,47,202,202,192,128,127,238,143,225, - 215,251,95,12,111,15,61,103,248,250,234,223,159,71,215,254,252,194,55,20,15,90,59,4,204,233,159,129,189,26,88,35,247,27,52,183,255,197,209,232, - 36,170,100,6,213,237,192,18,134,147,64,239,232,13,27,27,243,119,96,21,134,220,192,37,165,52,35,164,150,145,131,131,149,9,88,221,178,2,219,14, - 204,131,33,193,0,195,4,52,210,205,6,106,115,1,4,16,11,1,143,253,65,227,255,71,155,221,6,69,18,168,30,226,126,255,235,207,175,13,47,255, - 124,216,246,154,233,138,206,211,191,146,14,119,57,149,52,184,190,202,9,179,126,224,19,145,251,205,247,225,254,103,54,124,169,230,233,171,191,95,150,156, - 103,187,121,235,195,247,103,215,191,253,3,229,114,99,124,53,8,176,161,246,25,180,138,12,154,96,126,160,181,1,200,152,177,5,23,205,76,4,83,54, - 3,104,30,149,229,15,176,58,36,39,177,16,5,126,255,254,11,74,188,12,12,52,60,201,156,164,58,11,216,198,1,246,34,65,203,78,25,1,2,136, - 80,130,249,143,214,30,248,143,212,40,254,137,52,255,196,3,197,156,191,254,253,251,117,238,227,183,175,64,252,128,137,145,145,93,74,144,87,192,140,147, - 67,250,198,151,47,160,197,75,56,123,31,247,127,253,127,245,237,237,167,115,192,134,220,103,1,62,110,22,2,195,53,127,248,249,121,190,1,115,251,55, - 180,54,4,217,27,160,129,213,219,71,80,219,129,157,157,21,239,141,19,192,94,8,63,55,55,23,51,180,203,138,115,4,57,46,206,21,124,227,43,176, - 43,203,240,246,237,39,240,13,174,160,109,184,192,98,157,193,220,92,147,65,67,67,14,60,246,3,90,48,181,98,197,126,208,196,35,162,57,247,253,23, - 8,255,7,117,162,6,67,130,249,253,27,86,210,49,50,0,4,16,11,145,69,40,172,219,247,15,109,118,27,121,194,242,11,100,148,142,1,118,84,24, - 251,191,255,255,57,158,126,248,252,243,206,183,95,127,62,252,253,167,78,160,33,251,135,131,133,249,11,211,191,255,239,249,121,57,241,46,136,249,254,253, - 55,31,104,209,53,176,39,241,139,80,98,97,132,2,80,175,4,159,153,204,204,140,223,128,213,192,15,21,21,169,87,87,174,224,222,214,251,225,195,87, - 101,14,14,22,54,89,89,81,150,91,183,30,99,77,44,229,229,17,12,29,29,105,224,0,126,246,236,53,3,176,171,206,48,101,202,122,240,145,103,155, - 55,31,99,200,200,8,96,240,240,240,0,7,229,159,63,95,192,247,22,212,215,47,132,59,249,197,139,183,255,191,125,251,241,89,79,79,241,197,149,43, - 247,112,198,139,163,163,193,34,25,25,209,251,160,1,57,38,42,95,218,4,218,236,1,44,193,65,85,255,31,9,9,161,251,192,4,255,229,211,167,175, - 255,0,2,136,216,4,195,128,212,174,65,94,210,9,171,150,190,66,19,10,236,20,110,216,145,167,156,44,204,76,156,60,156,108,172,31,153,153,126,19, - 40,246,126,1,115,247,59,96,99,239,53,48,247,138,227,159,243,249,205,205,197,197,14,26,160,34,120,213,13,176,171,204,4,154,75,1,230,88,124,99, - 43,255,152,153,89,126,126,253,250,19,88,213,113,189,132,250,149,25,123,125,254,93,4,216,107,208,243,244,52,187,125,242,228,117,148,19,169,164,164,68, - 24,146,146,60,24,170,171,99,128,165,202,71,112,130,121,255,254,11,176,148,129,156,137,3,76,100,192,18,234,55,195,55,208,172,62,184,157,254,23,200, - 254,204,32,46,46,196,160,165,37,207,112,237,218,67,216,8,235,255,87,175,62,254,1,102,136,215,248,123,55,12,191,4,5,121,142,29,59,118,253,51, - 40,130,169,185,17,15,100,30,104,196,24,24,126,63,206,158,189,245,21,232,182,207,192,18,242,31,64,0,17,123,58,14,250,245,50,255,24,48,23,94, - 193,18,14,7,3,226,108,57,78,160,39,184,129,197,48,43,144,254,129,191,132,97,250,9,236,74,190,5,210,175,120,120,56,94,1,213,127,251,247,239, - 63,174,134,47,31,176,52,224,16,21,229,255,143,150,232,192,155,224,144,142,230,96,212,210,146,99,126,246,236,13,223,247,239,63,241,149,48,63,64,118, - 191,121,243,225,47,27,27,219,83,96,64,189,5,86,21,98,184,194,242,228,201,107,94,190,190,22,219,129,57,156,117,243,230,227,240,30,143,159,159,37, - 248,162,240,247,239,63,131,170,56,80,169,133,220,5,102,128,236,171,131,76,67,32,142,172,249,15,84,199,194,16,24,104,3,75,48,224,48,6,86,205, - 255,128,57,251,5,116,216,0,107,247,26,88,18,90,25,25,169,174,123,252,248,229,167,151,47,223,147,115,150,218,127,44,61,97,6,180,30,241,111,164, - 17,232,127,0,1,196,68,134,5,200,35,147,63,144,170,35,216,136,43,168,50,6,13,186,128,54,42,191,96,102,102,126,201,199,199,245,26,152,16,190, - 19,74,48,124,124,220,239,128,17,254,6,88,68,191,1,54,44,241,174,221,216,189,251,140,158,141,141,46,143,148,148,48,220,163,81,81,206,12,89,89, - 254,112,53,160,91,234,237,236,244,153,175,94,125,104,0,44,9,120,241,148,110,127,88,88,152,190,220,188,249,248,167,128,0,247,117,69,69,201,71,248, - 236,62,127,254,142,237,222,189,231,189,242,242,130,248,92,93,141,153,65,119,15,76,158,156,11,190,157,254,213,171,247,88,55,198,65,182,133,252,1,150, - 38,130,12,34,34,2,172,175,95,63,87,184,126,253,166,42,43,43,27,55,48,225,51,163,95,214,117,227,198,163,191,192,112,187,1,77,52,184,186,187, - 218,192,132,165,21,30,238,244,7,216,99,252,130,52,159,70,8,131,87,227,43,43,75,125,141,140,116,254,174,175,175,252,13,24,254,232,106,62,67,11, - 0,228,129,201,127,0,1,196,68,102,170,68,222,203,132,60,97,249,21,105,94,7,132,223,3,75,130,119,192,6,234,7,32,253,11,127,130,97,252,3, - 140,172,79,192,156,248,1,24,1,207,129,109,148,23,248,212,159,62,125,211,13,152,32,196,99,99,221,56,69,68,32,37,77,69,69,4,3,176,170,96, - 0,205,163,128,34,49,61,221,155,93,86,86,76,4,88,34,184,224,27,140,3,173,150,151,147,19,187,123,233,210,221,31,192,72,248,12,12,200,67,4, - 194,128,103,210,164,117,165,55,110,60,182,236,234,74,231,207,204,244,3,39,26,80,59,2,219,36,39,104,244,31,52,87,5,204,60,140,189,189,89,28, - 234,234,50,210,161,161,13,53,86,86,57,75,22,45,218,225,105,103,167,43,230,230,102,10,114,43,44,103,255,7,150,30,191,128,37,229,107,96,227,248, - 12,62,135,108,219,118,34,94,71,71,94,42,55,55,232,31,48,195,125,131,198,3,94,12,244,239,215,130,130,224,63,211,167,23,114,3,75,40,243,222, - 222,76,161,41,83,242,152,130,131,237,126,138,137,9,194,226,17,166,254,7,82,59,241,63,64,0,81,218,207,255,143,111,140,6,132,129,17,255,207,194, - 66,139,235,254,253,231,214,175,95,127,84,195,101,16,176,190,190,107,106,170,190,247,212,169,27,111,180,181,21,191,1,91,230,134,143,31,191,214,192,221, - 240,5,111,214,250,9,244,248,89,91,91,221,223,47,94,188,255,107,108,172,6,26,182,103,184,124,249,62,99,90,154,15,71,104,168,163,240,162,69,59, - 163,118,236,56,29,135,47,193,200,201,137,95,3,186,113,205,166,77,199,62,1,219,24,255,93,93,77,190,157,57,115,211,1,232,6,94,220,115,165,255, - 249,247,238,61,103,1,76,172,31,50,50,252,158,3,19,217,239,87,175,62,48,72,75,139,252,7,149,108,160,196,3,42,85,64,37,199,187,119,159,89, - 162,163,157,89,129,145,207,247,249,243,55,157,196,196,174,186,163,71,175,196,0,221,47,189,125,251,41,175,179,103,111,243,2,115,250,157,212,84,239,111, - 64,45,255,79,156,184,254,31,52,231,195,195,195,197,174,161,33,251,15,232,22,47,96,66,196,26,87,95,190,252,16,191,118,237,145,28,208,191,23,98, - 99,93,223,0,219,96,127,94,190,124,247,11,88,242,254,1,38,12,48,6,186,17,216,120,229,4,225,191,160,197,221,211,167,23,176,3,195,73,14,152, - 232,51,38,78,92,219,126,236,216,85,99,96,41,243,35,38,198,245,123,124,188,219,23,160,59,129,102,188,255,13,218,113,1,204,200,255,64,109,42,88, - 85,9,16,64,52,233,182,35,77,37,176,1,3,80,160,185,57,201,72,91,91,97,3,150,182,16,28,3,3,124,87,123,123,170,37,208,131,82,192,46, - 169,50,208,241,173,12,152,251,162,209,241,15,95,95,203,217,219,182,181,155,127,254,188,85,252,245,235,245,98,175,94,173,19,251,250,117,135,232,233,211, - 211,245,195,195,29,219,161,185,4,159,25,192,4,98,60,161,168,40,84,27,88,10,138,2,75,10,137,236,236,0,3,111,111,243,73,132,244,65,241,87, - 96,36,172,1,230,210,200,59,119,150,40,125,253,186,77,236,203,151,173,98,223,190,109,23,249,250,117,187,40,144,22,187,119,111,153,252,130,5,21,238, - 137,137,158,221,192,158,199,61,108,230,104,104,200,239,93,186,180,58,224,229,203,181,226,192,94,22,39,48,114,185,197,196,4,196,106,106,98,205,117,117, - 149,54,18,114,7,176,116,58,14,44,49,194,128,254,151,121,255,126,19,255,143,31,59,57,128,246,179,0,195,133,5,68,63,124,184,130,227,195,135,205, - 252,175,94,173,151,92,176,160,220,91,65,65,226,0,186,25,64,251,78,2,237,46,59,121,114,170,206,223,191,123,4,110,221,90,4,90,4,143,18,185, - 0,1,68,139,35,33,145,83,226,95,78,78,118,80,215,140,152,225,243,255,192,122,248,15,48,210,126,3,219,8,76,65,65,118,71,128,189,160,135,192, - 6,164,2,30,61,236,192,70,103,10,48,135,56,232,233,41,93,4,86,125,119,65,250,63,126,252,162,124,235,214,83,253,71,143,94,170,18,242,35,176, - 52,120,109,106,170,121,252,232,209,203,159,129,85,0,104,247,223,159,35,71,46,189,11,8,176,217,113,225,194,61,203,167,79,95,155,16,112,55,23,176, - 183,20,12,196,46,51,102,108,126,10,236,9,93,1,54,218,159,128,38,234,64,126,2,246,144,148,158,63,127,167,114,243,230,35,57,160,217,56,123,127, - 55,110,60,116,138,137,105,51,2,230,240,105,21,21,209,203,129,37,211,147,201,147,215,255,60,123,246,230,107,39,39,195,77,183,110,61,49,255,249,243, - 23,78,253,143,31,191,178,200,201,153,56,103,238,220,173,7,76,77,53,118,133,134,58,92,1,150,50,159,64,235,148,129,97,2,108,91,125,224,89,185, - 114,191,46,176,180,114,189,112,225,174,53,176,167,41,140,110,6,80,141,89,103,231,10,163,133,11,119,197,3,237,92,223,218,154,188,88,84,84,224,46, - 242,0,46,64,0,209,26,49,171,168,72,243,244,247,103,235,1,75,152,117,4,74,152,157,147,38,229,154,74,74,10,131,102,103,69,128,85,141,174,143, - 143,101,47,145,185,156,108,12,172,206,22,148,150,134,27,10,11,243,138,192,6,32,129,165,128,72,112,176,173,78,122,186,111,38,144,253,138,214,110,64, - 47,53,59,58,82,179,102,207,46,230,3,207,68,112,115,136,231,228,4,26,132,134,218,183,163,205,147,17,194,255,128,153,245,62,16,223,5,246,82,31, - 129,14,35,32,197,29,192,166,196,141,29,59,186,236,59,59,211,80,246,252,0,4,208,160,186,162,27,84,95,2,123,43,224,217,242,253,251,47,124,52, - 49,81,219,15,204,37,23,104,101,159,128,0,207,29,43,43,157,45,39,78,92,123,255,246,237,103,216,44,247,31,96,238,251,181,115,231,153,247,192,54, - 198,73,96,181,54,9,88,242,189,167,87,24,88,90,106,175,215,212,148,223,191,113,227,49,112,164,131,54,237,239,219,119,238,19,80,108,39,80,110,13, - 41,77,3,96,59,79,1,136,149,128,254,144,37,180,145,15,173,71,247,33,63,63,168,251,227,199,207,183,230,205,219,134,50,137,11,16,64,131,44,193, - 48,1,123,18,224,4,243,23,216,173,252,122,229,202,131,59,129,129,54,51,64,167,14,80,189,232,99,102,250,232,231,103,53,11,216,13,190,13,44,166, - 191,194,18,11,108,108,9,216,13,255,182,99,199,169,183,192,42,107,59,176,120,239,101,101,101,166,117,162,249,7,108,180,175,4,182,25,38,207,154,181, - 229,205,214,173,39,96,61,147,223,192,176,248,4,116,203,115,7,7,131,249,102,102,26,43,105,28,7,31,226,227,221,219,216,217,217,142,84,86,206,249, - 118,243,230,19,148,4,3,16,64,131,42,193,64,22,242,128,215,161,254,5,182,204,127,239,217,115,246,51,11,11,203,89,96,119,111,42,48,130,63,81, - 203,30,208,188,81,80,144,45,176,228,96,221,15,236,25,189,253,254,29,116,8,48,124,230,25,54,245,241,19,216,83,248,186,101,203,241,247,64,245,123, - 128,37,77,15,176,122,120,66,163,72,250,14,236,153,205,240,244,52,155,181,124,249,190,231,192,196,242,11,122,154,3,56,193,0,123,100,63,79,159,190, - 249,97,215,174,211,143,237,237,13,22,185,184,24,207,103,64,93,126,66,21,192,199,199,245,56,38,198,165,147,155,155,125,15,176,253,244,233,222,189,231, - 127,209,7,248,0,2,136,214,211,231,76,66,66,124,172,192,92,33,120,238,220,109,135,215,175,63,104,226,235,86,219,216,232,238,61,118,236,202,219,247, - 239,191,128,151,87,2,139,210,255,160,33,118,93,93,229,231,192,54,208,125,96,215,92,25,40,38,68,97,53,244,24,216,54,154,10,12,156,157,235,214, - 29,122,9,236,242,126,101,64,44,186,194,152,102,0,13,135,63,121,242,250,15,176,49,251,28,232,190,171,64,251,89,129,141,67,57,42,117,24,254,1, - 123,145,23,129,137,119,178,140,140,200,206,109,219,78,190,184,112,225,206,39,6,212,197,228,240,161,139,231,207,223,254,249,246,237,199,47,43,43,237,59, - 138,138,146,15,95,188,120,43,5,108,28,83,99,127,245,31,96,87,250,0,48,99,78,2,154,127,106,221,186,195,111,222,190,5,207,103,252,70,115,3, - 3,64,0,81,45,193,4,4,88,51,168,171,203,129,118,238,145,157,96,172,173,117,246,30,61,10,79,48,224,241,253,119,239,190,252,125,240,224,197,95, - 96,119,251,53,48,194,46,1,187,189,127,64,235,92,255,253,35,120,204,6,106,87,134,139,253,185,153,153,230,86,47,47,243,41,192,72,63,179,101,203, - 177,87,64,123,190,32,13,123,163,247,228,224,13,64,96,59,224,31,48,183,253,2,22,128,31,128,126,185,4,108,160,223,5,29,137,241,241,227,87,94, - 160,59,200,217,66,251,93,78,78,236,146,189,189,254,42,160,159,231,61,124,248,242,218,246,237,39,95,62,122,244,234,51,116,100,245,55,142,6,46,195, - 203,151,239,126,223,185,243,244,151,152,152,224,51,11,11,205,179,130,130,60,31,128,238,224,6,186,81,136,129,196,229,16,192,146,237,179,178,178,228,41, - 71,71,131,197,90,90,10,43,47,93,186,119,103,223,190,11,111,63,127,6,237,119,134,175,2,64,89,236,5,16,64,84,235,86,7,6,58,48,196,197, - 249,50,120,120,228,48,0,27,140,212,234,154,255,1,237,55,2,182,51,62,109,221,122,252,175,174,174,210,79,61,61,229,199,90,90,242,123,129,185,94, - 19,152,56,13,128,221,86,5,232,32,30,11,108,231,34,104,62,9,148,176,128,85,200,75,80,195,22,152,27,111,42,42,74,92,2,150,22,55,65,141, - 233,91,183,30,129,6,232,96,139,197,113,37,22,6,228,238,36,208,252,127,199,142,93,251,123,253,250,227,239,70,70,170,239,77,77,213,79,219,219,235, - 41,62,125,250,70,21,216,229,213,2,70,26,200,29,160,19,168,216,127,253,250,203,140,212,144,255,15,26,90,0,246,84,94,241,242,114,62,150,145,17, - 189,5,236,57,222,4,118,187,239,2,75,136,103,192,220,252,13,216,117,255,12,116,251,55,164,196,251,27,173,180,131,205,219,253,0,157,107,4,44,225, - 254,1,195,227,151,130,130,196,87,125,125,229,167,33,33,118,251,129,213,170,18,176,205,167,3,12,43,245,175,95,191,203,0,221,203,243,243,39,98,1, - 22,51,51,227,127,160,27,126,129,118,104,242,242,114,63,80,82,146,184,6,76,248,55,126,255,254,123,23,24,150,175,14,29,186,252,5,152,161,97,107, - 139,144,195,5,101,21,0,64,0,86,174,93,5,97,32,8,166,240,93,136,17,67,64,11,187,20,246,130,31,225,239,248,27,254,141,32,136,118,22,54, - 134,8,98,19,11,69,66,26,73,206,83,99,188,92,116,150,168,4,81,43,171,107,151,153,217,205,110,118,238,254,38,24,206,147,27,1,195,97,95,233, - 118,123,202,96,48,251,135,104,94,132,69,81,28,155,166,45,86,171,237,169,217,212,61,8,96,137,12,29,161,114,228,0,98,17,253,134,46,165,204,211, - 223,85,218,13,233,186,234,226,60,163,100,135,32,134,77,38,230,1,25,28,0,200,75,10,20,161,124,183,88,166,69,243,90,135,120,30,23,227,241,60, - 32,3,23,200,119,241,73,89,116,58,173,17,68,81,192,52,149,129,128,85,223,231,85,114,236,147,41,11,83,159,168,215,107,59,33,34,65,211,23,200, - 62,90,150,205,17,203,229,241,68,218,147,156,235,27,73,183,207,9,148,196,34,101,44,215,107,39,220,108,220,51,170,13,3,38,182,97,52,102,237,182, - 81,66,195,154,69,211,94,70,172,26,225,65,158,93,52,239,129,166,85,104,19,127,133,168,133,227,236,217,116,186,228,116,237,133,177,99,58,142,240,23, - 46,119,1,88,185,130,20,132,97,32,136,180,13,169,6,91,74,63,231,19,250,209,222,122,20,138,120,243,172,32,181,138,155,180,56,19,68,66,91,15, - 130,47,200,50,179,187,217,100,50,249,243,197,157,243,98,117,85,237,62,9,227,81,91,205,148,209,57,59,243,223,21,166,85,238,165,7,16,110,41,18, - 162,170,123,144,116,214,58,81,198,172,147,162,48,199,52,213,49,1,18,17,94,167,15,32,143,224,8,186,137,96,235,8,85,87,9,102,132,241,71,149, - 222,75,31,93,247,120,34,121,239,109,123,186,33,134,139,194,4,205,132,41,203,109,156,101,38,122,63,195,161,31,104,192,54,59,32,110,135,138,167,13, - 196,34,177,37,80,250,237,194,204,178,132,213,244,207,97,63,156,163,144,72,62,77,102,125,211,28,174,232,32,138,9,147,231,155,136,254,164,152,182,79, - 128,139,174,227,234,122,63,34,30,203,3,5,141,108,232,106,225,250,18,196,241,245,125,209,75,0,81,49,193,192,54,220,131,102,100,217,65,219,72,65, - 129,245,15,116,161,38,144,205,249,233,211,87,65,2,221,220,223,192,92,248,239,207,159,127,184,18,13,242,44,249,79,96,32,176,2,205,103,6,97,96, - 195,149,233,209,163,151,200,247,9,32,71,46,250,162,175,191,104,237,3,98,75,187,191,12,168,107,129,192,215,6,1,221,193,2,172,14,152,129,24,60, - 29,2,44,214,209,151,121,34,207,179,33,187,5,157,102,96,32,110,231,193,127,180,196,14,43,21,88,126,253,250,3,194,160,99,52,152,161,238,96,196, - 18,38,200,75,83,144,39,144,255,50,16,177,106,17,32,128,168,150,96,64,235,61,129,110,7,93,88,196,102,98,162,255,117,201,146,202,223,155,54,29, - 103,6,237,85,6,230,114,49,96,149,161,141,79,63,176,136,127,15,12,116,240,38,118,92,141,79,44,145,15,187,81,142,17,75,224,160,7,208,63,180, - 226,254,63,153,237,42,6,6,196,102,191,63,12,136,173,56,204,72,9,133,9,139,190,127,120,48,169,110,249,135,68,195,220,193,140,230,14,38,164,156, - 76,200,29,127,137,76,176,12,0,1,68,181,4,3,172,67,153,183,110,61,97,222,216,184,192,55,45,205,231,180,177,177,250,189,148,20,175,127,87,175, - 62,144,234,235,91,147,8,76,249,98,248,244,3,219,28,239,65,117,233,151,47,63,254,19,81,61,252,69,242,36,242,254,41,108,106,145,3,130,26,51, - 174,255,208,74,29,38,180,34,150,17,135,91,24,112,12,195,83,218,206,67,46,69,25,25,240,95,196,129,173,138,69,47,205,241,2,128,0,162,90,130, - 1,21,135,63,127,126,227,57,125,250,102,4,16,231,1,235,210,107,192,58,253,43,176,103,162,2,108,160,17,60,99,69,79,79,233,209,139,23,239,190, - 3,171,46,66,251,137,176,237,237,97,36,160,150,22,128,20,119,208,195,45,255,177,180,17,168,238,22,128,0,162,86,130,97,2,182,214,89,120,121,185, - 224,199,63,3,27,119,90,63,126,16,55,24,9,76,88,79,128,221,224,199,192,22,251,95,10,170,139,193,0,6,211,237,231,52,113,11,64,0,81,35, - 193,128,139,62,96,195,19,212,51,32,241,158,98,8,208,208,144,3,141,75,220,132,30,90,51,50,175,156,31,34,0,32,128,168,53,151,4,218,56,206, - 12,44,81,72,190,87,17,52,71,100,103,167,183,238,206,157,39,159,159,62,125,243,135,129,70,155,195,70,1,117,0,64,0,81,109,242,17,116,2,37, - 104,171,41,137,9,230,151,171,171,241,66,96,123,231,212,190,125,23,190,48,144,182,79,121,20,12,0,0,8,32,170,37,152,183,111,63,253,3,157,222, - 200,195,195,249,150,24,245,236,236,108,111,65,147,128,192,234,104,205,218,181,135,94,3,75,151,31,12,228,237,85,30,5,116,4,0,1,68,141,201,71, - 112,183,246,237,219,143,204,10,10,18,191,221,220,76,46,8,10,242,222,228,224,96,125,207,201,201,254,19,116,100,216,191,127,12,160,35,180,126,2,19, - 211,39,208,46,58,29,29,197,77,62,62,22,115,89,89,153,15,109,217,114,226,249,163,71,175,96,147,128,196,28,155,49,10,6,16,0,4,16,35,149, - 204,0,37,60,54,62,62,110,78,57,57,113,62,57,57,81,65,96,194,16,0,109,96,3,118,183,65,43,229,133,65,231,154,241,240,112,188,227,228,100, - 123,247,234,213,135,239,87,175,62,252,112,255,254,243,207,223,190,253,128,237,125,65,94,98,48,10,6,41,0,8,32,106,237,173,132,29,113,6,218,237, - 8,218,249,200,193,194,194,194,14,44,65,216,5,5,121,88,4,4,120,152,128,189,32,208,249,43,255,222,188,249,8,154,219,1,221,19,4,219,204,143, - 60,183,67,179,173,12,163,128,58,0,32,128,24,169,104,14,108,152,30,148,104,96,183,130,192,206,199,67,62,144,8,54,143,129,124,139,202,223,209,196, - 50,52,0,64,0,49,82,217,44,88,245,132,126,19,61,174,9,48,228,33,254,209,196,50,4,0,64,128,1,0,102,20,176,16,7,130,12,56,0,0, - 0,0,73,69,78,68,174,66,96,130,0,0}; -const char* BinaryData::juce_png = (const char*) temp8; - -static const unsigned char temp9[] = {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, - 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,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,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,13,10,42,47,13, - 10,13,10,35,105,102,100,101,102,32,95,87,73,78,51,50,13,10,32,35,105,110,99,108,117,100,101,32,60,119,105,110,100,111,119,115,46,104,62,13, - 10,35,101,108,105,102,32,33,32,100,101,102,105,110,101,100,32,40,76,73,78,85,88,41,13,10,32,35,105,110,99,108,117,100,101,32,60,67,97,114, - 98,111,110,46,104,62,13,10,32,35,105,110,99,108,117,100,101,32,60,77,111,118,105,101,115,46,104,62,13,10,35,101,110,100,105,102,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,79,80,69,78,71,76,13,10,13,10,35,105,102,100,101,102,32,95,87,73,78,51,50,13,10,32,35,105,110,99,108,117,100,101,32, - 60,103,108,47,103,108,46,104,62,13,10,32,35,105,110,99,108,117,100,101,32,60,103,108,47,103,108,117,46,104,62,13,10,35,101,108,105,102,32,100, - 101,102,105,110,101,100,32,40,76,73,78,85,88,41,13,10,32,35,105,110,99,108,117,100,101,32,60,71,76,47,103,108,46,104,62,13,10,32,35,105, - 110,99,108,117,100,101,32,60,71,76,47,103,108,117,116,46,104,62,13,10,32,35,117,110,100,101,102,32,75,101,121,80,114,101,115,115,13,10,35,101, - 108,115,101,13,10,32,35,105,110,99,108,117,100,101,32,60,65,71,76,47,97,103,108,46,104,62,13,10,32,35,105,110,99,108,117,100,101,32,60,71, - 76,85,84,47,103,108,117,116,46,104,62,13,10,35,101,110,100,105,102,13,10,13,10,35,105,102,110,100,101,102,32,71,76,95,66,71,82,65,95,69, - 88,84,13,10,32,35,100,101,102,105,110,101,32,71,76,95,66,71,82,65,95,69,88,84,32,48,120,56,48,101,49,13,10,35,101,110,100,105,102,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,68,101,109,111,79,112,101,110,71,76,67,97,110,118,97,115,32,32,58,32,112,117,98,108,105,99,32,79,112, - 101,110,71,76,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,32,112,117,98,108,105,99,32,84,105,109,101,114,13,10,123,13,10,32,32,32,32,102,108,111,97,116,32,114,111,116,97,116,105,111,110,44,32,100, - 101,108,116,97,59,13,10,32,32,32,32,73,109,97,103,101,42,32,105,109,97,103,101,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32, - 32,68,101,109,111,79,112,101,110,71,76,67,97,110,118,97,115,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,111,116,97, - 116,105,111,110,32,61,32,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,100,101,108,116,97,32,61,32,49,46,48,102,59,13,10,13,10,32, - 32,32,32,32,32,32,32,73,109,97,103,101,42,32,105,109,32,61,32,73,109,97,103,101,70,105,108,101,70,111,114,109,97,116,58,58,108,111,97,100, - 70,114,111,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116,97,58,58, - 106,117,99,101,95,112,110,103,83,105,122,101,41,59,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,32,61,32,110,101,119,32,73,109,97,103, - 101,32,40,73,109,97,103,101,58,58,82,71,66,44,32,53,49,50,44,32,53,49,50,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32, - 32,71,114,97,112,104,105,99,115,32,103,32,40,42,105,109,97,103,101,41,59,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108, - 32,40,67,111,108,111,117,114,115,58,58,119,104,105,116,101,41,59,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,32, - 40,105,109,44,32,48,44,32,48,44,32,53,49,50,44,32,53,49,50,44,32,48,44,32,48,44,32,105,109,45,62,103,101,116,87,105,100,116,104,40, - 41,44,32,105,109,45,62,103,101,116,72,101,105,103,104,116,40,41,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,105,109,59, - 13,10,13,10,32,32,32,32,32,32,32,32,115,116,97,114,116,84,105,109,101,114,32,40,50,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 47,47,32,74,117,115,116,32,102,111,114,32,100,101,109,111,32,112,117,114,112,111,115,101,115,44,32,108,101,116,39,115,32,100,117,109,112,32,97,32, - 108,105,115,116,32,111,102,32,97,108,108,32,116,104,101,32,97,118,97,105,108,97,98,108,101,32,112,105,120,101,108,32,102,111,114,109,97,116,115,46, - 46,13,10,32,32,32,32,32,32,32,32,79,119,110,101,100,65,114,114,97,121,32,60,79,112,101,110,71,76,80,105,120,101,108,70,111,114,109,97,116, - 62,32,97,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,59,13,10,32,32,32,32,32,32,32,32,79,112,101,110,71,76, - 80,105,120,101,108,70,111,114,109,97,116,58,58,103,101,116,65,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,32,40,116, - 104,105,115,44,32,97,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,97,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116, - 115,46,115,105,122,101,40,41,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99, - 111,110,115,116,32,79,112,101,110,71,76,80,105,120,101,108,70,111,114,109,97,116,42,32,99,111,110,115,116,32,112,105,120,70,111,114,109,97,116,32, - 61,32,97,118,97,105,108,97,98,108,101,80,105,120,101,108,70,111,114,109,97,116,115,91,105,93,59,13,10,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,83,116,114,105,110,103,32,102,111,114,109,97,116,68,101,115,99,114,105,112,116,105,111,110,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,102,111,114,109,97,116,68,101,115,99,114,105,112,116,105,111,110,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,105,32, - 60,60,32,34,58,32,82,71,66,65,61,40,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,114,101,100,66,105,116,115,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,103,114,101,101,110,66,105, - 116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62, - 98,108,117,101,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111, - 114,109,97,116,45,62,97,108,112,104,97,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,41,44,32,100,101, - 112,116,104,61,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,100,101,112,116,104,66,117,102,102,101,114,66,105,116,115,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,115,116,101,110,99,105,108,61,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45, - 62,115,116,101,110,99,105,108,66,117,102,102,101,114,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32, - 97,99,99,117,109,32,82,71,66,65,61,40,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110, - 66,117,102,102,101,114,82,101,100,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32, - 112,105,120,70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110,66,117,102,102,101,114,71,114,101,101,110,66,105,116,115,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,99,99,117, - 109,117,108,97,116,105,111,110,66,117,102,102,101,114,66,108,117,101,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60, - 32,34,44,32,34,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,97,99,99,117,109,117,108,97,116,105,111,110,66,117,102,102,101,114,65,108, - 112,104,97,66,105,116,115,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,34,41,44,32,102,117,108,108,45,115,99,101,110,101, - 32,65,65,61,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,60,32,112,105,120,70,111,114,109,97,116,45,62,102,117,108,108,83, - 99,101,110,101,65,110,116,105,65,108,105,97,115,105,110,103,78,117,109,83,97,109,112,108,101,115,59,13,10,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,76,111,103,103,101,114,58,58,111,117,116,112,117,116,68,101,98,117,103,83,116,114,105,110,103,32,40,102,111,114,109,97,116,68,101,115,99, - 114,105,112,116,105,111,110,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111, - 79,112,101,110,71,76,67,97,110,118,97,115,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,32,105,109, - 97,103,101,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,119,104,101,110,32,116,104,101,32,99,111,109,112,111,110,101,110,116, - 32,99,114,101,97,116,101,115,32,97,32,110,101,119,32,105,110,116,101,114,110,97,108,32,99,111,110,116,101,120,116,44,32,116,104,105,115,32,105,115, - 32,99,97,108,108,101,100,44,32,97,110,100,13,10,32,32,32,32,47,47,32,119,101,39,108,108,32,117,115,101,32,116,104,101,32,111,112,112,111,114, - 116,117,110,105,116,121,32,116,111,32,99,114,101,97,116,101,32,116,104,101,32,116,101,120,116,117,114,101,115,32,110,101,101,100,101,100,46,13,10,32, - 32,32,32,118,111,105,100,32,110,101,119,79,112,101,110,71,76,67,111,110,116,101,120,116,67,114,101,97,116,101,100,40,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,47,47,32,40,110,111,32,110,101,101,100,32,116,111,32,99,97,108,108,32,109,97,107,101,67,117,114,114,101,110, - 116,67,111,110,116,101,120,116,65,99,116,105,118,101,40,41,44,32,97,115,32,116,104,97,116,32,119,105,108,108,32,104,97,118,101,13,10,32,32,32, - 32,32,32,32,32,47,47,32,98,101,101,110,32,100,111,110,101,32,102,111,114,32,117,115,32,98,101,102,111,114,101,32,116,104,101,32,109,101,116,104, - 111,100,32,99,97,108,108,41,46,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,67,111,108,111,114,32,40,48,46,48,102,44,32,48, - 46,48,102,44,32,48,46,48,102,44,32,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,68,101,112,116,104,32, - 40,49,46,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,68,101,112,116,104,70,117,110,99,32,40,71,76,95,76,69,83,83,41,59, - 13,10,32,32,32,32,32,32,32,32,103,108,69,110,97,98,108,101,32,40,71,76,95,68,69,80,84,72,95,84,69,83,84,41,59,13,10,32,32,32, - 32,32,32,32,32,103,108,69,110,97,98,108,101,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,41,59,13,10,32,32,32,32,32,32,32,32, - 103,108,69,110,97,98,108,101,32,40,71,76,95,66,76,69,78,68,41,59,13,10,32,32,32,32,32,32,32,32,103,108,83,104,97,100,101,77,111,100, - 101,108,32,40,71,76,95,83,77,79,79,84,72,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101, - 114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,71,76,95,84,69,88,84,85,82,69,95,87,82,65,80,95,83,44,32,71,76, - 95,67,76,65,77,80,41,59,13,10,32,32,32,32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69, - 88,84,85,82,69,95,50,68,44,32,71,76,95,84,69,88,84,85,82,69,95,87,82,65,80,95,84,44,32,71,76,95,67,76,65,77,80,41,59,13, - 10,32,32,32,32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44, - 32,71,76,95,84,69,88,84,85,82,69,95,77,65,71,95,70,73,76,84,69,82,44,32,71,76,95,76,73,78,69,65,82,41,59,13,10,32,32,32, - 32,32,32,32,32,103,108,84,101,120,80,97,114,97,109,101,116,101,114,105,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68,44,32,71,76,95, - 84,69,88,84,85,82,69,95,77,73,78,95,70,73,76,84,69,82,44,32,71,76,95,76,73,78,69,65,82,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,103,108,80,105,120,101,108,83,116,111,114,101,105,32,40,71,76,95,85,78,80,65,67,75,95,65,76,73,71,78,77,69,78,84,44,32,52, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,115,116,114,105,100,101,44,32,112,105,120,83,116,114,105,100,101,59,13,10,32,32, - 32,32,32,32,32,32,99,111,110,115,116,32,118,111,105,100,42,32,112,105,120,101,108,115,32,61,32,105,109,97,103,101,45,62,108,111,99,107,80,105, - 120,101,108,68,97,116,97,82,101,97,100,79,110,108,121,32,40,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41, - 44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,44,32,115,116,114,105,100,101,44,32,112,105,120,83,116,114,105,100,101,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,84,101,120,73,109,97,103,101,50,68,32,40,71,76,95,84,69,88,84,85,82,69,95,50,68, - 44,32,48,44,32,52,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105, - 103,104,116,40,41,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,48,44,32,71,76,95,82,71,66,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,71,76,95,85,78,83,73,71,78,69,68,95,66,89,84,69, - 44,32,112,105,120,101,108,115,41,59,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,45,62,114,101,108,101,97,115,101,80,105,120,101,108,68, - 97,116,97,82,101,97,100,79,110,108,121,32,40,112,105,120,101,108,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,72,105,110,116,32, - 40,71,76,95,76,73,78,69,95,83,77,79,79,84,72,95,72,73,78,84,44,32,71,76,95,78,73,67,69,83,84,41,59,13,10,32,32,32,32,32, - 32,32,32,103,108,72,105,110,116,32,40,71,76,95,80,79,73,78,84,95,83,77,79,79,84,72,95,72,73,78,84,44,32,71,76,95,78,73,67,69, - 83,84,41,59,13,10,32,32,32,32,32,32,32,32,103,108,66,108,101,110,100,70,117,110,99,32,40,71,76,95,83,82,67,95,65,76,80,72,65,44, - 32,71,76,95,79,78,69,95,77,73,78,85,83,95,83,82,67,95,65,76,80,72,65,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, - 118,111,105,100,32,109,111,117,115,101,68,114,97,103,32,40,99,111,110,115,116,32,77,111,117,115,101,69,118,101,110,116,38,32,101,41,13,10,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,100,101,108,116,97,32,61,32,101,46,103,101,116,68,105,115,116,97,110,99,101,70,114,111,109,68,114, - 97,103,83,116,97,114,116,88,40,41,32,47,32,49,48,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,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,110,100,101,114,79,112,101,110,71,76,40,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,67,111,108,111,114,32,40,48,46,56,102,44,32,48,46,48,102,44,32,48,46,52, - 102,44,32,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,32,40,71,76,95,67,79,76,79,82,95,66,85,70, - 70,69,82,95,66,73,84,32,124,32,71,76,95,68,69,80,84,72,95,66,85,70,70,69,82,95,66,73,84,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,103,108,77,97,116,114,105,120,77,111,100,101,40,71,76,95,80,82,79,74,69,67,84,73,79,78,41,59,13,10,32,32,32,32,32,32,32, - 32,103,108,76,111,97,100,73,100,101,110,116,105,116,121,40,41,59,13,10,32,32,32,32,32,32,32,32,103,108,79,114,116,104,111,32,40,48,46,48, - 44,32,103,101,116,87,105,100,116,104,40,41,44,32,48,46,48,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,48,44,32,49,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,52,102,32,40,49,46,48,102,44,32,49,46,48,102,44,32,49,46,48,102,44,32,102, - 97,98,115,102,32,40,58,58,115,105,110,102,32,40,114,111,116,97,116,105,111,110,32,47,32,49,48,48,46,48,102,41,41,41,59,13,10,32,32,32, - 32,32,32,32,32,103,108,66,101,103,105,110,40,71,76,95,81,85,65,68,83,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84, - 101,120,67,111,111,114,100,50,105,32,40,48,44,32,48,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,53,48,46,48,102,44,32,103,101,116, - 72,101,105,103,104,116,40,41,32,45,32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111, - 114,100,50,105,32,40,49,44,32,48,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,103,101,116,87,105,100,116,104,40,41,32,45,32,53,48, - 46,48,102,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 103,108,84,101,120,67,111,111,114,100,50,105,32,40,49,44,32,49,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,103,101,116,87,105,100,116, - 104,40,41,32,45,32,53,48,46,48,102,44,32,53,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67, - 111,111,114,100,50,105,32,40,48,44,32,49,41,59,32,103,108,86,101,114,116,101,120,50,102,32,40,53,48,46,48,102,44,32,53,48,46,48,102,41, - 59,13,10,32,32,32,32,32,32,32,32,103,108,69,110,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,77,97,116,114,105,120,77, - 111,100,101,32,40,71,76,95,80,82,79,74,69,67,84,73,79,78,41,59,13,10,32,32,32,32,32,32,32,32,103,108,76,111,97,100,73,100,101,110, - 116,105,116,121,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,67,108,101,97,114,32,40,71,76,95,68,69,80,84,72,95,66,85,70, - 70,69,82,95,66,73,84,41,59,13,10,32,32,32,32,32,32,32,32,103,108,117,80,101,114,115,112,101,99,116,105,118,101,32,40,52,53,46,48,102, - 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,103,101,116,87,105,100,116,104,40,41,32,47,32, - 40,71,76,102,108,111,97,116,41,32,103,101,116,72,101,105,103,104,116,40,41,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,48,46,49,102,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,49, - 48,48,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,77,97,116,114,105,120,77,111,100,101,32,40,71,76,95,77,79,68,69, - 76,86,73,69,87,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,108,76,111,97,100,73,100,101,110,116,105,116,121,40,41,59,13,10,32,32, - 32,32,32,32,32,32,103,108,80,117,115,104,77,97,116,114,105,120,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84, - 114,97,110,115,108,97,116,101,102,32,40,48,46,48,102,44,32,48,46,48,102,44,32,45,53,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,103,108,82,111,116,97,116,101,102,32,40,114,111,116,97,116,105,111,110,44,32,48,46,53,102,44,32,49,46,48,102,44,32,48,46,48, - 102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,66,101,103,105,110,32,40,71,76,95,81,85,65,68,83,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,48,46,48,102,44,32,49,46,48,102,44, - 32,48,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40, - 48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49, - 46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102, - 44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41, - 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46, - 48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59, - 32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,49,46,48,102,44,32,48,46,48,102,44,32,48,46,48,102, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44, - 32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48, - 102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32, - 103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101, - 114,116,101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,103,108,67,111,108,111,114,51,102,32,40,48,46,48,102,44,32,48,46,48,102,44,32,49,46,48,102,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102, - 41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103, - 108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114, - 116,101,120,51,102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51, - 102,40,32,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,103,108,67,111,108,111,114,51,102,32,40,49,46,48,102,44,32,49,46,48,102,44,32,48,46,48,102,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108, - 86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116, - 101,120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102, - 40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 103,108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46, - 48,102,44,32,45,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108, - 67,111,108,111,114,51,102,32,40,48,46,48,102,44,32,49,46,48,102,44,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101, - 120,51,102,40,32,49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40, - 32,49,46,48,102,44,32,32,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103, - 108,84,101,120,67,111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48, - 102,44,32,32,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120, - 67,111,111,114,100,50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,32,49,46,48,102,44,32,45, - 49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,67,111,108,111,114, - 51,102,32,40,49,46,48,102,44,32,48,46,48,102,44,32,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,103,108,84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45, - 49,46,48,102,44,32,45,49,46,48,102,44,32,45,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108, - 84,101,120,67,111,111,114,100,50,102,40,48,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102, - 44,32,45,49,46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67, - 111,111,114,100,50,102,40,49,46,48,102,44,32,49,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49, - 46,48,102,44,32,32,49,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,108,84,101,120,67,111,111,114,100, - 50,102,40,49,46,48,102,44,32,48,46,48,102,41,59,32,103,108,86,101,114,116,101,120,51,102,40,45,49,46,48,102,44,32,32,49,46,48,102,44, - 32,45,49,46,48,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,108,69,110,100,40,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,103,108,80,111,112,77,97,116,114,105,120,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105, - 109,101,114,67,97,108,108,98,97,99,107,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,111,116,97,116,105,111,110,32,43, - 61,32,100,101,108,116,97,59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,125, - 59,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,79,112,101,110,71,76,68,101,109,111,32,32,58,32,112,117,98,108,105,99,32,67,111,109,112,111,110, - 101,110,116,13,10,123,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,79,112,101,110,71,76,67,97,110,118,97,115,42,32,99,97,110,118, - 97,115,59,13,10,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,79,112,101,110,71,76,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,84,40,34,79,112,101,110,71,76,34,41,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,99,97,110,118,97,115,32,61,32,110,101,119,32,68,101,109,111,79,112,101,110,71,76,67,97,110,118,97,115,40,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,99,97,110,118,97,115,41,59,13,10, - 32,32,32,32,125,13,10,13,10,32,32,32,32,126,79,112,101,110,71,76,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,99,97,110,118,97,115,45,62,115,101,116, - 66,111,117,110,100,115,32,40,49,48,44,32,49,48,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,48,41,59,13,10,32,32,32,32,125,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,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*) temp9; - -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, - 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,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,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,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,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,115,116,97,116,105,99,32,102,108,111,97,116,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,13,10,123,13,10,32,32,32,32,114, - 101,116,117,114,110,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97, - 116,40,41,32,42,32,51,48,48,46,48,102,32,45,32,49,53,48,46,48,102,59,13,10,125,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,80, - 97,116,104,115,65,110,100,84,114,97,110,115,102,111,114,109,115,68,101,109,111,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,32,32,32,32,32,32,32,112,117,98,108, - 105,99,32,83,108,105,100,101,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,32,32,32,32,32,32,32,112,117,98,108,105,99,32,67,111,109,98,111,66,111,120,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,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,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,84,40,34,80,97,116,104,115,34,41,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,78,111,32,112,97,114,116,115,32,111,102,32,116,104,105,115,32,99,111,109,112,111,110,101, - 110,116,32,97,114,101,32,115,101,109,105,45,116,114,97,110,115,112,97,114,101,110,116,44,32,115,111,32,99,97,108,108,105,110,103,32,115,101,116,79, - 112,97,113,117,101,40,41,13,10,32,32,32,32,32,32,32,32,47,47,32,97,108,108,111,119,115,32,116,104,101,32,114,101,100,114,97,119,32,115,121, - 115,116,101,109,32,116,111,32,101,120,112,108,111,105,116,32,116,104,105,115,32,102,97,99,116,32,97,110,100,32,111,112,116,105,109,105,115,101,32,114, - 101,112,97,105,110,116,105,110,103,46,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,82,97,110,100,111,109,83,104,97,112,101,40,41,59,13,10,32,32,32,32,32,32,32, - 32,103,101,110,101,114,97,116,101,73,109,97,103,101,40,41,59,13,10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,68,114,97,119,97, - 98,108,101,40,41,59,13,10,32,32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,83,86,71,68,114,97,119,97,98,108,101,40,41,59,13,10, - 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,116,121,112,101,67,104,111,111,115,101,114, - 32,32,32,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120,32,40,84,40,34,116,121,112,101,34,41,41,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,115,99,97,108,101,83,108,105,100,101,114,32,32,32,32,61,32,110,101, - 119,32,83,108,105,100,101,114,32,40,84,40,34,115,99,97,108,101,34,41,41,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,97,110,103,108,101,83,108,105,100,101,114,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32, - 40,84,40,34,97,110,103,108,101,34,41,41,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,120,83,108,105,100,101,114,32,32,32,32,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,120,34,41,41,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,121,83,108,105,100,101,114,32,32,32, - 32,32,32,32,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,121,34,41,41,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,111,112,97,99,105,116,121,83,108,105,100,101,114,32,32,61,32,110,101,119,32,83,108, - 105,100,101,114,32,40,84,40,34,111,112,97,99,105,116,121,34,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97, - 98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,116,121,112,101,58,34,41,41,41,32,32,32,32,32,45,62,97, - 116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,116,121,112,101,67,104,111,111,115,101,114,44,32,116,114,117,101,41,59,13,10,32, - 32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,115,99,97, - 108,101,58,34,41,41,41,32,32,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,115,99,97,108,101,83,108,105, - 100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58, - 58,101,109,112,116,121,44,32,84,40,34,97,110,103,108,101,58,34,41,41,41,32,32,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111, - 110,101,110,116,32,40,97,110,103,108,101,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32, - 76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,120,32,111,102,102,115,101,116,58,34,41,41,41,32,45, - 62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,120,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,32,32,32, - 32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,84,40,34,121,32,111,102,102, - 115,101,116,58,34,41,41,41,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,121,83,108,105,100,101,114,44,32,116, - 114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121, - 44,32,84,40,34,111,112,97,99,105,116,121,58,34,41,41,41,32,32,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40, - 111,112,97,99,105,116,121,83,108,105,100,101,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111, - 111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,115,111,108,105,100,32,99, - 111,108,111,117,114,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116, - 101,109,32,40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,108,105,110,101,97,114,32,103,114,97,100,105,101,110,116,32,102,105, - 108,108,34,41,44,32,50,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32, - 40,84,40,34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,114,97,100,105,97,108,32,103,114,97,100,105,101,110,116,32,102,105,108,108,34, - 41,44,32,51,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40, - 34,114,97,110,100,111,109,32,115,104,97,112,101,32,45,32,116,105,108,101,100,32,105,109,97,103,101,32,102,105,108,108,34,41,44,32,56,41,59,13, - 10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32, - 45,32,108,111,119,32,113,117,97,108,105,116,121,34,41,44,32,52,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101, - 114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32,45,32,104,105,103,104,32,113,117,97,108,105,116,121,34,41,44,32,53, - 41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97, - 103,101,32,45,32,99,111,108,111,117,114,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,54,41,59,13, - 10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32, - 45,32,103,114,97,100,105,101,110,116,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,55,41,59,13,10, - 32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,105,109,97,103,101,32,45, - 32,97,108,112,104,97,109,97,112,45,102,105,108,108,101,100,32,97,108,112,104,97,32,99,104,97,110,110,101,108,34,41,44,32,57,41,59,13,10,32, - 32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,100,114,97,119,97,98,108,101, - 32,111,98,106,101,99,116,34,41,44,32,49,48,41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115,101,114,45,62,97,100, - 100,73,116,101,109,32,40,84,40,34,83,86,71,32,111,98,106,101,99,116,34,41,44,32,49,49,41,59,13,10,32,32,32,32,32,32,32,32,116,121, - 112,101,67,104,111,111,115,101,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,49,49,41,59,13,10,32,32,32,32,32,32,32,32, - 116,121,112,101,67,104,111,111,115,101,114,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,115,99,97,108,101,83,108,105,100,101,114,32,32,32,45,62,97,100,100,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,110,103,108,101,83,108,105,100,101,114,32,32,32,45,62,97,100,100,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,120,83,108,105,100,101,114,32,32,32,32,32,32,32,45,62,97,100,100,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,121,83,108,105,100,101,114,32,32,32,32,32,32,32,45,62,97,100,100,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,111,112,97,99,105,116,121,83,108,105,100,101,114,32,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,115,99,97,108,101,83,108,105,100, - 101,114,45,62,115,101,116,82,97,110,103,101,32,40,48,46,48,49,44,32,49,48,46,48,44,32,48,46,48,48,49,41,59,13,10,32,32,32,32,32, - 32,32,32,115,99,97,108,101,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,49,46,48,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,46,48,44,32,49,46,48,44,32,48,46,48, - 48,49,41,59,13,10,32,32,32,32,32,32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,48,44,32,49,48,44,32, - 48,46,48,48,49,41,59,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,45,49,48,44,32,49,48,44,32,48, - 46,48,48,49,41,59,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,48,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103,101,32,40,48,44,32,49,44, - 32,48,46,48,49,41,59,13,10,32,32,32,32,32,32,32,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,86,97,108,117,101, - 32,40,49,46,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,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,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,105,109,97,103,101,59,13,10,13,10,32,32,32,32,32,32,32,32,100,101, - 108,101,116,101,32,100,114,97,119,97,98,108,101,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,118,103,68,114,97,119,97,98, - 108,101,59,13,10,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,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,67,104,101,99,107,101,114,66,111,97,114,100,32,40,48,44,32,48,44,32,103,101,116, - 87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,53,48,44,32,53,48,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,32,32,32,67,111,108,111,117,114,32,40,48,120,102,102,101,48,101,48,101,48,41,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,32,32,32,67,111,108,111,117,114,115,58,58,119,104,105,116,101,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,116,121,112,101,32,61,32,116,121,112,101,67,104,111,111,115,101,114,45,62,103,101,116,83, - 101,108,101,99,116,101,100,73,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,121,112,101,32,61,61,32,49,41,13,10, - 32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111, - 117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100, - 101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,80,97,116, - 104,32,40,115,104,97,112,101,44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32, - 32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,50,32,124,124,32,116,121,112,101,32,61,61,32,51,41,13, - 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98, - 32,40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105, - 116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,53,102,44,32,103,101,116,72,101,105,103, - 104,116,40,41,32,42,32,48,46,53,102,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,32, - 32,32,32,32,67,111,108,111,117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99, - 105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,54,102,44,32,103,101,116,72,101,105, - 103,104,116,40,41,32,42,32,48,46,55,102,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, - 32,32,32,32,32,116,121,112,101,32,61,61,32,51,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117, - 115,104,32,40,38,103,98,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,80,97,116,104,32,40,115,104,97,112,101, - 44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101, - 108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,56,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,73,109,97,103,101,66,114,117,115,104,32,105,98,32,40,105,109,97,103,101,44,32,49,48,48,44,32,49,48,48,44,32,40,102,108,111,97, - 116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,103,46,115,101,116,66,114,117,115,104,32,40,38,105,98,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102, - 105,108,108,80,97,116,104,32,40,115,104,97,112,101,44,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,59,13,10,32,32,32,32,32,32, - 32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,52,32,124,124,32,116,121,112,101,32, - 61,61,32,53,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,121,112,101,32,61, - 61,32,52,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,73,109,97,103,101,82,101,115,97,109,112,108,105, - 110,103,81,117,97,108,105,116,121,32,40,71,114,97,112,104,105,99,115,58,58,108,111,119,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116, - 121,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103, - 46,115,101,116,73,109,97,103,101,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116,121,32,40,71,114,97,112,104,105,99,115,58,58,109,101, - 100,105,117,109,82,101,115,97,109,112,108,105,110,103,81,117,97,108,105,116,121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103, - 46,115,101,116,79,112,97,99,105,116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86, - 97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109, - 97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116, - 87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110, - 115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105, - 100,116,104,40,41,44,32,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,41,59,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105, - 102,32,40,116,121,112,101,32,61,61,32,54,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46, - 115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111, - 97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40, - 105,109,97,103,101,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,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62, - 103,101,116,72,101,105,103,104,116,40,41,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,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105, - 111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44,32,45,48,46,53,102,32,42,32,105, - 109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116, - 84,114,97,110,115,102,111,114,109,40,41,41,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, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, - 32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,55,41,13,10,32,32, - 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98,32,40,67, - 111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83, - 108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,53,102,44,32,103,101,116,72,101,105,103,104,116,40, - 41,32,42,32,48,46,53,102,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,32,32,32,32, - 32,67,111,108,111,117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121, - 83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,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,32,32,32,32,32,103,101,116,87,105,100,116,104,40,41,32,42,32,48,46,54,102,44,32,103,101,116,72,101,105,103,104,116, - 40,41,32,42,32,48,46,55,102,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,32,32,32, - 32,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117,115,104,32,40,38,103,98, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73,109,97,103,101,84,114,97, - 110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40, - 41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58, - 58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87,105,100,116,104,40,41,44, - 32,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111, - 119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101, - 32,61,61,32,57,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,73,109,97,103,101,66,114,117,115, - 104,32,105,98,32,40,105,109,97,103,101,44,32,49,48,48,44,32,49,48,48,44,32,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108, - 105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,66,114,117, - 115,104,32,40,38,105,98,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,109,97,103,101,32,33,61,32,48,41, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,73, - 109,97,103,101,84,114,97,110,115,102,111,114,109,101,100,32,40,105,109,97,103,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,44,32,48,44,32,105,109,97,103,101,45,62,103,101, - 116,87,105,100,116,104,40,41,44,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,102,102,105,110,101,84,114,97, - 110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,87, - 105,100,116,104,40,41,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,45, - 48,46,53,102,32,42,32,105,109,97,103,101,45,62,103,101,116,72,101,105,103,104,116,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101, - 100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,116,121,112,101,32,61, - 61,32,49,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,79,112,97,99,105, - 116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,119,44,32,104,59,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,100,114,97,119,97,98,108,101,45,62,103,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,114,97,119,97,98,108,101,45,62,100,114,97,119,32,40,103,44,32,65,102,102,105,110,101, - 84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,120,32,45,32,48,46,53,102,32,42,32,119,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,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,32,32,32,32,32,32,32,32,32,32,32,45,121,32,45,32,48,46,53,102,32,42,32,104,41,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,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121, - 32,40,103,101,116,84,114,97,110,115,102,111,114,109,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, - 101,108,115,101,32,105,102,32,40,116,121,112,101,32,61,61,32,49,49,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,103,46,115,101,116,79,112,97,99,105,116,121,32,40,40,102,108,111,97,116,41,32,111,112,97,99,105,116,121,83,108,105,100,101,114, - 45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,108,111,97,116,32,120,44,32,121, - 44,32,119,44,32,104,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,45,62,103,101,116,66,111,117, - 110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119, - 97,98,108,101,45,62,100,114,97,119,32,40,103,44,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116, - 105,111,110,32,40,45,120,32,45,32,48,46,53,102,32,42,32,119,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, +static const unsigned char temp3[] = {60,68,69,77,79,95,84,65,66,76,69,95,68,65,84,65,62,13,10,32,32,32,32,60,67,79,76,85,77,78,83,62,13,10,32,32,32,32,32,32, + 32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,49,34,32,110,97,109,101,61,34,73,68,34,32,119,105,100,116,104,61,34, + 53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,50,34,32,110,97,109,101, + 61,34,65,114,116,105,115,116,34,32,119,105,100,116,104,61,34,49,53,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78, + 32,99,111,108,117,109,110,73,100,61,34,51,34,32,110,97,109,101,61,34,83,111,110,103,34,32,119,105,100,116,104,61,34,50,48,48,34,47,62,13, + 10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,52,34,32,110,97,109,101,61,34,65,108,98,117, + 109,34,32,119,105,100,116,104,61,34,49,48,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110, + 73,100,61,34,53,34,32,110,97,109,101,61,34,82,97,116,105,110,103,34,32,119,105,100,116,104,61,34,49,50,48,34,47,62,13,10,32,32,32,32, + 32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,54,34,32,110,97,109,101,61,34,71,101,110,114,101,34,32,119,105, + 100,116,104,61,34,56,48,34,47,62,13,10,32,32,32,32,32,32,32,32,60,67,79,76,85,77,78,32,99,111,108,117,109,110,73,100,61,34,55,34, + 32,110,97,109,101,61,34,76,101,110,103,116,104,34,32,119,105,100,116,104,61,34,56,48,34,47,62,13,10,32,32,32,32,60,47,67,79,76,85,77, + 78,83,62,13,10,32,32,32,32,60,68,65,84,65,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,49,34,32,65, + 114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110, + 103,61,34,84,97,120,109,97,110,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,51,57,34,32,82,97, + 116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,50,34,32,65,114,116,105,115,116, + 61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110,103,61,34,69,108, + 101,97,110,111,114,32,82,105,103,98,121,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,48,55,34,32, + 82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,51,34,32,65,114,116,105, + 115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32,83,111,110,103,61,34, + 73,39,109,32,111,110,108,121,32,83,108,101,101,112,105,110,103,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34, + 51,58,48,49,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,52, + 34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,101,118,111,108,118,101,114,34,32, + 83,111,110,103,61,34,89,101,108,108,111,119,32,83,117,98,109,97,114,105,110,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110, + 103,116,104,61,34,50,58,52,48,34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73, + 68,61,34,48,53,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82,117,98,98,101, + 114,32,83,111,117,108,34,32,83,111,110,103,61,34,68,114,105,118,101,32,77,121,32,67,97,114,34,32,71,101,110,114,101,61,34,82,111,99,107,34, + 32,76,101,110,103,116,104,61,34,50,58,51,48,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84, + 69,77,32,73,68,61,34,48,54,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108,98,117,109,61,34,82, + 117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,78,111,114,119,101,103,105,97,110,32,87,111,111,100,34,32,71,101,110,114,101,61, + 34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,48,53,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32, + 32,32,32,60,73,84,69,77,32,73,68,61,34,48,55,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34,32,65,108, + 98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,78,111,119,104,101,114,101,32,77,97,110,34,32,71,101,110, + 114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,52,34,32,82,97,116,105,110,103,61,34,53,34,47,62,13,10,32,32, + 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,56,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34, + 32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,84,104,101,32,87,111,114,100,34,32,71,101,110, + 114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,51,34,32,82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32, + 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,48,57,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116,108,101,115,34, + 32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,87,104,97,116,32,71,111,101,115,32,79,110,34, + 32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,53,48,34,32,82,97,116,105,110,103,61,34,51,34,47,62, + 13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,48,34,32,65,114,116,105,115,116,61,34,84,104,101,32,66,101,97,116, + 108,101,115,34,32,65,108,98,117,109,61,34,82,117,98,98,101,114,32,83,111,117,108,34,32,83,111,110,103,61,34,73,110,32,77,121,32,76,105,102, + 101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,50,55,34,32,82,97,116,105,110,103,61,34,49,34, + 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,49,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97, + 117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,76,97,122,121, + 32,67,97,108,109,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,54,58,51,54,34,32,82,97, + 116,105,110,103,61,34,54,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,50,34,32,65,114,116,105,115,116, + 61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111, + 110,103,61,34,70,108,117,102,102,121,32,84,117,102,116,115,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116, + 104,61,34,51,58,48,53,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61, + 34,49,51,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,86,105,99,116,111, + 114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,79,111,109,105,110,103,109,97,107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97, + 108,34,32,76,101,110,103,116,104,61,34,50,58,52,50,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32,32,60, + 73,84,69,77,32,73,68,61,34,49,52,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117, + 109,61,34,86,105,99,116,111,114,105,97,108,97,110,100,34,32,83,111,110,103,61,34,70,101,101,116,45,76,105,107,101,32,70,105,110,115,34,32,71, + 101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,50,54,34,32,82,97,116,105,110,103,61,34,49,34, + 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,53,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97, + 117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103, + 61,34,75,110,111,119,32,87,104,111,32,89,111,117,32,65,114,101,32,65,116,32,69,118,101,114,121,32,65,103,101,34,32,71,101,110,114,101,61,34, + 69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,52,50,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32, + 32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,54,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110, + 115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103,61,34,69,118,97,110, + 103,101,108,105,110,101,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,52,58,51,49,34,32,82, + 97,116,105,110,103,61,34,53,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,55,34,32,65,114,116,105,115, + 116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70,111,117,114,32,67,97,108,101,110,100,97,114,32,67, + 97,102,101,34,32,83,111,110,103,61,34,66,108,117,101,98,101,97,114,100,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76, + 101,110,103,116,104,61,34,51,58,53,54,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77, + 32,73,68,61,34,49,56,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,70, + 111,117,114,32,67,97,108,101,110,100,97,114,32,67,97,102,101,34,32,83,111,110,103,61,34,83,113,117,101,101,122,101,45,87,97,120,34,32,71,101, + 110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,52,57,34,32,82,97,116,105,110,103,61,34,49,34,47, + 62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,49,57,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117, + 32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103, + 61,34,67,104,101,114,114,121,45,67,111,108,111,117,114,101,100,32,70,117,110,107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34, + 32,76,101,110,103,116,104,61,34,51,58,49,51,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84, + 69,77,32,73,68,61,34,50,48,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61, + 34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103,61,34,73,99,101,98,108,105,110,107,32,76,117,99, + 107,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,49,56,34,32,82,97,116,105,110,103, + 61,34,55,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,49,34,32,65,114,116,105,115,116,61,34,67,111, + 99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117,109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34, + 32,83,111,110,103,61,34,70,105,102,116,121,45,70,105,102,116,121,32,67,108,111,119,110,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97, + 108,34,32,76,101,110,103,116,104,61,34,51,58,49,53,34,32,82,97,116,105,110,103,61,34,50,34,47,62,13,10,32,32,32,32,32,32,32,32,60, + 73,84,69,77,32,73,68,61,34,50,50,34,32,65,114,116,105,115,116,61,34,67,111,99,116,101,97,117,32,84,119,105,110,115,34,32,65,108,98,117, + 109,61,34,72,101,97,118,101,110,32,79,114,32,76,97,115,32,86,101,103,97,115,34,32,83,111,110,103,61,34,70,111,116,122,101,112,111,108,105,116, + 105,99,34,32,71,101,110,114,101,61,34,69,116,104,101,114,105,97,108,34,32,76,101,110,103,116,104,61,34,51,58,51,48,34,32,82,97,116,105,110, + 103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,51,34,32,65,114,116,105,115,116,61,34,82, + 111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79,102,116,101,110,32,68,114,101,97,109,32,111,102,32, + 84,114,97,105,110,115,34,32,83,111,110,103,61,34,78,111,99,116,117,114,110,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110, + 103,116,104,61,34,49,58,52,50,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73, + 68,61,34,50,52,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73, + 32,79,102,116,101,110,32,68,114,101,97,109,32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,85,110,99,111,114,114,101,99,116,101, + 100,32,80,101,114,115,111,110,97,108,105,116,121,32,84,114,97,105,116,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116, + 104,61,34,49,58,52,53,34,32,82,97,116,105,110,103,61,34,53,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61, + 34,50,53,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79, + 102,116,101,110,32,68,114,101,97,109,32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,77,121,32,70,97,118,111,117,114,105,116,101, + 32,66,117,105,108,100,105,110,103,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,52,57,34,32,82, + 97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,54,34,32,65,114,116,105,115, + 116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,73,32,79,102,116,101,110,32,68,114,101,97,109, + 32,111,102,32,84,114,97,105,110,115,34,32,83,111,110,103,61,34,72,101,97,114,116,102,117,108,32,111,102,32,76,101,97,118,101,115,34,32,71,101, + 110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,51,48,34,32,82,97,116,105,110,103,61,34,55,34,47,62,13,10,32, + 32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,55,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104, + 99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110,103,61,34,80,101,110,101,108,111,112,101,39,115,32,65,110,103, + 108,101,115,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,51,58,49,56,34,32,82,97,116,105,110,103,61,34, + 49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,56,34,32,65,114,116,105,115,116,61,34,82,111,98,121, + 110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110,103,61,34,89,111,117,32,82,101,109, + 105,110,100,32,77,101,32,79,102,32,89,111,117,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,49,53, + 34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,50,57,34,32,65,114, + 116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,76,117,120,111,114,34,32,83,111,110, + 103,61,34,84,104,101,32,87,111,108,102,32,72,111,117,115,101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34, + 51,58,50,51,34,32,82,97,116,105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,48, + 34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,74,101,119,101,108,115, + 32,70,111,114,32,83,111,112,104,105,97,34,32,83,111,110,103,61,34,77,101,120,105,99,97,110,32,71,111,100,34,32,71,101,110,114,101,61,34,82, + 111,99,107,34,32,76,101,110,103,116,104,61,34,50,58,53,55,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10,32,32,32,32,32,32,32, + 32,60,73,84,69,77,32,73,68,61,34,51,49,34,32,65,114,116,105,115,116,61,34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32, + 65,108,98,117,109,61,34,74,101,119,101,108,115,32,70,111,114,32,83,111,112,104,105,97,34,32,83,111,110,103,61,34,84,104,101,32,67,104,101,101, + 115,101,32,65,108,97,114,109,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,48,51,34,32,82,97,116, + 105,110,103,61,34,49,34,47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,50,34,32,65,114,116,105,115,116,61, + 34,82,111,98,121,110,32,72,105,116,99,104,99,111,99,107,34,32,65,108,98,117,109,61,34,74,101,119,101,108,115,32,70,111,114,32,83,111,112,104, + 105,97,34,32,83,111,110,103,61,34,78,111,44,32,73,32,68,111,110,39,116,32,82,101,109,101,109,98,101,114,32,71,117,105,108,100,102,111,114,100, + 34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,52,53,34,32,82,97,116,105,110,103,61,34,54,34,47, + 62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,51,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114, + 114,101,116,116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,66,97,98,121,32,76,101,109,111,110,97,100, + 101,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,49,48,34,32,82,97,116,105,110,103,61,34,50,34, + 47,62,13,10,32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,52,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97, + 114,114,101,116,116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,68,111,109,105,110,111,101,115,34,32,71, + 101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,52,58,48,56,34,32,82,97,116,105,110,103,61,34,51,34,47,62,13,10, + 32,32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,53,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114,114,101,116, + 116,34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,71,105,103,111,108,111,32,65,117,110,116,34,32,71,101, + 110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,53,58,52,54,34,32,82,97,116,105,110,103,61,34,52,34,47,62,13,10,32, + 32,32,32,32,32,32,32,60,73,84,69,77,32,73,68,61,34,51,54,34,32,65,114,116,105,115,116,61,34,83,121,100,32,66,97,114,114,101,116,116, + 34,32,65,108,98,117,109,61,34,66,97,114,114,101,116,116,34,32,83,111,110,103,61,34,69,102,102,101,114,118,101,115,99,105,110,103,32,69,108,101, + 112,104,97,110,116,34,32,71,101,110,114,101,61,34,82,111,99,107,34,32,76,101,110,103,116,104,61,34,49,58,53,50,34,32,82,97,116,105,110,103, + 61,34,53,34,47,62,13,10,32,32,32,32,60,47,68,65,84,65,62,13,10,60,47,68,69,77,79,95,84,65,66,76,69,95,68,65,84,65,62,0,0}; +const char* BinaryData::demo_table_data_xml = (const char*) temp3; + +static const unsigned char temp4[] = {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, + 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,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,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,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,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,13,10,32,32,32,32,84,104,105,115,32,99,108,97,115,115,32,115,104,111,119,115,32,104,111,119,32,116,111,32,105,109,112,108, + 101,109,101,110,116,32,97,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101,108,32,116,111,32,115,104,111,119,32,105,110,32,97,32,84, + 97,98,108,101,76,105,115,116,66,111,120,46,13,10,42,47,13,10,99,108,97,115,115,32,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101, + 110,116,32,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,32,32,32,32,32,112,117,98,108,105,99,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101, + 108,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,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110, + 101,110,116,40,41,13,10,32,32,32,32,32,32,32,32,58,32,102,111,110,116,32,40,49,52,46,48,102,41,44,13,10,32,32,32,32,32,32,32,32, + 32,32,100,101,109,111,68,97,116,97,32,40,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,76,111,97,100,32,115, + 111,109,101,32,100,97,116,97,32,102,114,111,109,32,97,110,32,101,109,98,101,100,100,101,100,32,88,77,76,32,102,105,108,101,46,46,13,10,32,32, + 32,32,32,32,32,32,108,111,97,100,68,97,116,97,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114,101,97,116,101,32,111, + 117,114,32,116,97,98,108,101,32,99,111,109,112,111,110,101,110,116,32,97,110,100,32,97,100,100,32,105,116,32,116,111,32,116,104,105,115,32,99,111, + 109,112,111,110,101,110,116,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,116,97, + 98,108,101,32,61,32,110,101,119,32,84,97,98,108,101,76,105,115,116,66,111,120,32,40,84,40,34,100,101,109,111,32,116,97,98,108,101,34,41,44, + 32,116,104,105,115,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,103,105,118,101,32,105,116,32,97,32,98,111,114,100,101,114,13, + 10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,115,101,116,67,111,108,111,117,114,32,40,76,105,115,116,66,111,120,58,58,111,117,116,108, + 105,110,101,67,111,108,111,117,114,73,100,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,116,97, + 98,108,101,45,62,115,101,116,79,117,116,108,105,110,101,84,104,105,99,107,110,101,115,115,32,40,49,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,47,47,32,65,100,100,32,115,111,109,101,32,99,111,108,117,109,110,115,32,116,111,32,116,104,101,32,116,97,98,108,101,32,104,101,97,100,101,114, + 44,32,98,97,115,101,100,32,111,110,32,116,104,101,32,99,111,108,117,109,110,32,108,105,115,116,32,105,110,32,111,117,114,32,100,97,116,97,98,97, + 115,101,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,99, + 111,108,117,109,110,76,105,115,116,44,32,99,111,108,117,109,110,88,109,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,97,100,100,67,111,108,117,109,110,32,40,99,111,108, + 117,109,110,88,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,84,40,34,110,97,109,101,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,45,121,32,45,32,48,46,53,102,32,42,32,104,41,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,32,32,32,32,32,32,32,32,32,32,46,102,111,108,108,111,119,101,100,66,121,32,40,103,101,116,84,114,97,110,115,102,111,114, - 109,40,41,41,41,59,13,10,32,32,32,32,32,32,32,32,125,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,99,111,110,115,116,32,105,110,116,32,120,32,61,32,49,48,48, - 59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,121,32,61,32,52,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,67,104,111,111,115, - 101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32, - 121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,115,99,97,108,101,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115, - 32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32, - 32,32,32,32,32,97,110,103,108,101,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32, - 50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,120,83,108,105,100,101,114,45, - 62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43, - 61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,121,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44, - 32,51,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,50,56,59,13,10,32,32,32,32,32,32,32,32,111,112, - 97,99,105,116,121,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,51,48,48,44,32,50,52,41,59,13, - 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,108,105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83, - 108,105,100,101,114,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32, - 125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120,67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42, - 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,112, - 114,105,118,97,116,101,58,13,10,32,32,32,32,80,97,116,104,32,115,104,97,112,101,59,13,10,32,32,32,32,73,109,97,103,101,42,32,105,109,97, - 103,101,59,13,10,32,32,32,32,68,114,97,119,97,98,108,101,42,32,100,114,97,119,97,98,108,101,59,13,10,32,32,32,32,68,114,97,119,97,98, - 108,101,67,111,109,112,111,115,105,116,101,42,32,115,118,103,68,114,97,119,97,98,108,101,59,13,10,13,10,32,32,32,32,67,111,109,98,111,66,111, - 120,42,32,116,121,112,101,67,104,111,111,115,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,115,99,97,108,101,83,108,105,100,101,114, - 59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,97,110,103,108,101,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42, - 32,120,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,121,83,108,105,100,101,114,59,13,10,32,32,32,32,83,108,105, - 100,101,114,42,32,111,112,97,99,105,116,121,83,108,105,100,101,114,59,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101, - 82,97,110,100,111,109,83,104,97,112,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,104,97,112,101,46,115,116,97,114, - 116,78,101,119,83,117,98,80,97,116,104,32,40,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101, - 114,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,55,59,32, - 43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,104,97,112,101,46,108,105,110,101,84, - 111,32,40,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,115,104,97,112,101,46,113,117,97,100,114,97,116,105,99,84,111,32,40,114,97,110,100,111,109,78,117,109,98, - 101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,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,32,32,32,32,32,32,114,97,110,100,111,109,78,117,109,98,101,114,40,41,44,32,114,97,110,100,111,109,78,117,109,98, - 101,114,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,115,104,97,112,101,46,99,108,111,115,101, - 83,117,98,80,97,116,104,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101,73,109, - 97,103,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,32,61,32,73,109,97,103,101,70,105,108,101,70, - 111,114,109,97,116,58,58,108,111,97,100,70,114,111,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66, - 105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, - 118,111,105,100,32,103,101,110,101,114,97,116,101,68,114,97,119,97,98,108,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, - 47,47,32,99,114,101,97,116,101,32,97,32,99,111,109,112,111,115,105,116,101,32,100,114,97,119,97,98,108,101,32,111,98,106,101,99,116,46,46,13, - 10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,42,32,100,99,32,61,32,110,101,119,32,68,114,97, - 119,97,98,108,101,67,111,109,112,111,115,105,116,101,40,41,59,13,10,32,32,32,32,32,32,32,32,100,114,97,119,97,98,108,101,32,61,32,100,99, - 59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,46,46,97,100,100,32,97,32,112,97,116,104,115,32,100,114,97,119,97,98,108,101,32,116, - 111,32,105,116,46,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,100,112,59,13,10,32,32,32,32,32, - 32,32,32,100,112,46,115,101,116,80,97,116,104,32,40,115,104,97,112,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,112,46,115,101,116, - 79,117,116,108,105,110,101,32,40,52,46,48,102,44,32,67,111,108,111,117,114,115,58,58,98,108,117,101,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,71,114,97,100,105,101,110,116,66,114,117,115,104,32,103,98,32,40,67,111,108,111,117,114,71,114,97,100,105,101,110,116,32,40,67,111,108,111, - 117,114,115,58,58,114,101,100,46,119,105,116,104,65,108,112,104,97,32,40,48,46,52,102,41,44,32,45,49,48,48,46,48,102,44,32,45,49,48,48, - 46,48,102,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,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,67,111,108,111,117,114,115,58,58,103,114,101,101,110,46,119,105,116,104,65,108,112,104,97,32,40,48,46,54,102,41,44, - 32,49,48,48,46,48,102,44,32,49,48,48,46,48,102,44,32,102,97,108,115,101,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,112,46, - 115,101,116,70,105,108,108,66,114,117,115,104,32,40,103,98,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116, - 68,114,97,119,97,98,108,101,32,40,100,112,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,46,46,97,100,100,32,97,110,32,105,109, - 97,103,101,32,100,114,97,119,97,98,108,101,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,73,109,97,103,101,32,100,105, - 59,13,10,32,32,32,32,32,32,32,32,100,105,46,115,101,116,73,109,97,103,101,32,40,105,109,97,103,101,44,32,102,97,108,115,101,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116,68,114,97,119,97,98,108,101,32,40,100,105,44,32,65,102,102,105,110,101, - 84,114,97,110,115,102,111,114,109,58,58,115,99,97,108,101,32,40,48,46,51,102,44,32,48,46,56,102,41,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,47,47,32,46,46,97,110,100,32,97,32,116,101,120,116,32,111,98,106,101,99,116,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97, - 98,108,101,84,101,120,116,32,100,116,59,13,10,32,32,32,32,32,32,32,32,100,116,46,115,101,116,84,101,120,116,32,40,84,40,34,74,85,67,69, - 32,68,114,97,119,97,98,108,101,115,34,41,44,32,70,111,110,116,32,40,51,48,46,48,102,44,32,70,111,110,116,58,58,98,111,108,100,41,41,59, - 13,10,32,32,32,32,32,32,32,32,100,116,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,103,114,101,101,110,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,100,99,45,62,105,110,115,101,114,116,68,114,97,119,97,98,108,101,32,40,100,116,44,32,65,102,102,105, - 110,101,84,114,97,110,115,102,111,114,109,58,58,116,114,97,110,115,108,97,116,105,111,110,32,40,45,56,48,46,48,102,44,32,45,50,48,46,48,102, - 41,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,32,32,32,32,32,32,32,32,32,32,32,46, - 115,99,97,108,101,100,32,40,50,46,48,102,44,32,48,46,56,102,41,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,32,32,32,32,32,32,32,32,32,32,32,46,114,111,116,97,116,101,100,32,40,45,49,46,51,102,41,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,110,101,114,97,116,101,83,86,71,68,114,97,119,97,98,108,101,40,41,13,10,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,32,61,32,48,59,13,10,13,10,32,32,32,32,32,32,32, - 32,77,101,109,111,114,121,73,110,112,117,116,83,116,114,101,97,109,32,105,99,111,110,115,70,105,108,101,83,116,114,101,97,109,32,40,66,105,110,97, - 114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,44,32,66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112, - 83,105,122,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,90,105,112,70,105,108,101,32,105,99,111,110,115,32,40,38,105, - 99,111,110,115,70,105,108,101,83,116,114,101,97,109,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,76,111, - 97,100,32,97,32,114,97,110,100,111,109,32,83,86,71,32,102,105,108,101,32,102,114,111,109,32,111,117,114,32,101,109,98,101,100,100,101,100,32,105, - 99,111,110,115,46,122,105,112,32,102,105,108,101,46,13,10,32,32,32,32,32,32,32,32,73,110,112,117,116,83,116,114,101,97,109,42,32,115,118,103, - 70,105,108,101,83,116,114,101,97,109,13,10,32,32,32,32,32,32,32,32,32,32,32,32,61,32,105,99,111,110,115,46,99,114,101,97,116,101,83,116, - 114,101,97,109,70,111,114,69,110,116,114,121,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46, - 110,101,120,116,73,110,116,32,40,105,99,111,110,115,46,103,101,116,78,117,109,69,110,116,114,105,101,115,40,41,41,41,59,13,10,13,10,32,32,32, - 32,32,32,32,32,105,102,32,40,115,118,103,70,105,108,101,83,116,114,101,97,109,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,42,32,108,111,97,100,101,100,83,86,71,32,61,32,68,114,97,119,97, - 98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109,97,103,101,68,97,116,97,83,116,114,101,97,109,32,40,42,115,118,103,70,105,108,101, - 83,116,114,101,97,109,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,108,111,97,100,101,100,83,86,71,32,33,61, - 32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116, - 111,32,109,97,107,101,32,111,117,114,32,105,99,111,110,32,116,104,101,32,114,105,103,104,116,32,115,105,122,101,44,32,119,101,39,108,108,32,112,117, - 116,32,105,116,32,105,110,115,105,100,101,32,97,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,44,32,97,110,100,32,97,112,112, - 108,121,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,116,114,97,110,115,102,111,114,109,32,116,111,32,103,101, - 116,32,105,116,32,116,111,32,116,104,101,32,115,105,122,101,32,119,101,32,119,97,110,116,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,119,44,32,104,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 108,111,97,100,101,100,83,86,71,45,62,103,101,116,66,111,117,110,100,115,32,40,120,44,32,121,44,32,119,44,32,104,41,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,115,99,97,108,101,70,97,99,116,111,114,32,61,32,51,48, - 48,46,48,102,32,47,32,106,109,97,120,32,40,119,44,32,104,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115, - 118,103,68,114,97,119,97,98,108,101,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,67,111,109,112,111,115,105,116,101,40,41,59,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,118,103,68,114,97,119,97,98,108,101,45,62,105,110,115,101,114,116,68,114,97,119,97,98, - 108,101,32,40,108,111,97,100,101,100,83,86,71,44,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,115,99,97,108,101,32,40,115, - 99,97,108,101,70,97,99,116,111,114,44,32,115,99,97,108,101,70,97,99,116,111,114,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,118,103,70,105,108,101,83,116,114,101,97,109,59,13,10, - 32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,65,102,102,105,110,101,84,114,97,110, - 115,102,111,114,109,32,103,101,116,84,114,97,110,115,102,111,114,109,40,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,114,101,116,117,114,110,32,65,102,102,105,110,101,84,114,97,110,115,102,111,114,109,58,58,114,111,116,97,116,105,111,110,32,40,102,108,111, - 97,116,95,80,105,32,42,32,50,46,48,102,32,42,32,40,102,108,111,97,116,41,32,97,110,103,108,101,83,108,105,100,101,114,45,62,103,101,116,86, - 97,108,117,101,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,115,99,97,108,101,100,32,40,40,102,108,111,97,116, - 41,32,115,99,97,108,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,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,40,102,108,111,97,116,41,32,115,99,97,108,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108, - 117,101,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,116,114,97,110,115,108,97,116,101,100,32,40,103,101,116,87, - 105,100,116,104,40,41,32,42,32,48,46,53,102,32,43,32,40,102,108,111,97,116,41,32,120,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117, - 101,40,41,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,32,32,32,32,103,101,116,72,101, - 105,103,104,116,40,41,32,42,32,48,46,53,102,32,43,32,40,102,108,111,97,116,41,32,121,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117, - 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*) temp10; + 32,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,99,111,108,117,109,110,73,100, + 34,41,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,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,119,105, + 100,116,104,34,41,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,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,53,48,44,32,52,48,48,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,97,98,108,101,72,101,97,100,101,114,67,111,109,112,111, + 110,101,110,116,58,58,100,101,102,97,117,108,116,70,108,97,103,115,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32, + 32,32,32,47,47,32,119,101,32,99,111,117,108,100,32,110,111,119,32,99,104,97,110,103,101,32,115,111,109,101,32,105,110,105,116,105,97,108,32,115, + 101,116,116,105,110,103,115,46,46,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,115, + 101,116,83,111,114,116,67,111,108,117,109,110,73,100,32,40,49,44,32,116,114,117,101,41,59,32,47,47,32,115,111,114,116,32,102,111,114,119,97,114, + 100,115,32,98,121,32,116,104,101,32,73,68,32,99,111,108,117,109,110,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72, + 101,97,100,101,114,40,41,45,62,115,101,116,67,111,108,117,109,110,86,105,115,105,98,108,101,32,40,55,44,32,102,97,108,115,101,41,59,32,47,47, + 32,104,105,100,101,32,116,104,101,32,34,108,101,110,103,116,104,34,32,99,111,108,117,109,110,32,117,110,116,105,108,32,116,104,101,32,117,115,101,114, + 32,115,104,111,119,115,32,105,116,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,117,110,45,99,111,109,109,101,110,116,32,116,104,105,115,32, + 108,105,110,101,32,116,111,32,104,97,118,101,32,97,32,103,111,32,111,102,32,115,116,114,101,116,99,104,45,116,111,45,102,105,116,32,109,111,100,101, + 13,10,32,32,32,32,32,32,32,32,47,47,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,115,101,116,83,116,114,101, + 116,99,104,84,111,70,105,116,65,99,116,105,118,101,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45, + 62,115,101,116,77,117,108,116,105,112,108,101,83,101,108,101,99,116,105,111,110,69,110,97,98,108,101,100,32,40,116,114,117,101,41,59,13,10,32,32, + 32,32,125,13,10,13,10,32,32,32,32,126,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101,110,116,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,13,10,32,32,32,32,32,32,32, + 32,100,101,108,101,116,101,32,100,101,109,111,68,97,116,97,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,47,47, + 32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100, + 101,108,44,32,97,110,100,32,109,117,115,116,32,114,101,116,117,114,110,32,116,104,101,32,116,111,116,97,108,32,110,117,109,98,101,114,32,111,102,32, + 114,111,119,115,32,105,110,32,111,117,114,32,116,97,98,108,101,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40,41,13, + 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,117,109,82,111,119,115,59,13,10,32,32,32,32,125,13,10, + 13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105, + 115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,115,104,111,117,108,100,32,102,105,108,108,32,105,110,32,116,104,101,32,98,97,99,107,103, + 114,111,117,110,100,32,111,102,32,116,104,101,32,119,104,111,108,101,32,114,111,119,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,82,111, + 119,66,97,99,107,103,114,111,117,110,100,32,40,71,114,97,112,104,105,99,115,38,32,103,44,32,105,110,116,32,114,111,119,78,117,109,98,101,114,44, + 32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,116,44,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116, + 101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,98,108,117, + 101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32, + 102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,109,117,115,116,32,112,97,105,110,116,32,97, + 110,121,32,99,101,108,108,115,32,116,104,97,116,32,97,114,101,110,39,116,32,117,115,105,110,103,32,99,117,115,116,111,109,13,10,32,32,32,32,47, + 47,32,99,111,109,112,111,110,101,110,116,115,46,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,67,101,108,108,32,40,71,114,97,112,104, + 105,99,115,38,32,103,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,114,111,119,78,117,109,98, + 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,105,110,116,32,99,111,108,117,109,110,73,100,44,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104, + 116,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116, + 101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115, + 58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,102,111,110,116,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,99,111,110,115,116,32,88,109,108,69,108,101,109,101,110,116,42,32,114,111,119,69,108,101,109,101,110,116,32,61,32,100, + 97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78,117,109,98,101,114,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,69,108,101,109,101,110,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,114,111,119,69,108,101,109, + 101,110,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109, + 101,70,111,114,67,111,108,117,109,110,73,100,32,40,99,111,108,117,109,110,73,100,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,103,46,100,114,97,119,84,101,120,116,32,40,116,101,120,116,44,32,50,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105, + 103,104,116,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116,114,117,101,41,59,13, + 10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117, + 114,115,58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,50,102,41,41,59,13,10,32,32,32,32,32,32,32,32,103,46, + 102,105,108,108,82,101,99,116,32,40,119,105,100,116,104,32,45,32,49,44,32,48,44,32,49,44,32,104,101,105,103,104,116,41,59,13,10,32,32,32, + 32,125,13,10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98, + 108,101,76,105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,116,101,108,108,115,32,117,115,32,116,104,97,116,32,116,104,101,32,117,115, + 101,114,32,104,97,115,32,99,108,105,99,107,101,100,32,97,32,116,97,98,108,101,32,104,101,97,100,101,114,13,10,32,32,32,32,47,47,32,116,111, + 32,99,104,97,110,103,101,32,116,104,101,32,115,111,114,116,32,111,114,100,101,114,46,13,10,32,32,32,32,118,111,105,100,32,115,111,114,116,79,114, + 100,101,114,67,104,97,110,103,101,100,32,40,105,110,116,32,110,101,119,83,111,114,116,67,111,108,117,109,110,73,100,44,32,99,111,110,115,116,32,98, + 111,111,108,32,105,115,70,111,114,119,97,114,100,115,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,110,101,119,83, + 111,114,116,67,111,108,117,109,110,73,100,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,68,101,109,111,68,97,116,97,83,111,114,116,101,114,32,115,111,114,116,101,114,32,40,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109, + 101,70,111,114,67,111,108,117,109,110,73,100,32,40,110,101,119,83,111,114,116,67,111,108,117,109,110,73,100,41,44,32,105,115,70,111,114,119,97,114, + 100,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,45,62,115,111,114,116,67,104,105,108,100,69,108,101, + 109,101,110,116,115,32,40,115,111,114,116,101,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,117,112, + 100,97,116,101,67,111,110,116,101,110,116,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, + 47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77, + 111,100,101,108,44,32,97,110,100,32,109,117,115,116,32,117,112,100,97,116,101,32,97,110,121,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101, + 110,116,115,32,116,104,97,116,32,119,101,39,114,101,32,117,115,105,110,103,13,10,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,114,101,102, + 114,101,115,104,67,111,109,112,111,110,101,110,116,70,111,114,67,101,108,108,32,40,105,110,116,32,114,111,119,78,117,109,98,101,114,44,32,105,110,116, + 32,99,111,108,117,109,110,73,100,44,32,98,111,111,108,32,105,115,82,111,119,83,101,108,101,99,116,101,100,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110, + 116,42,32,101,120,105,115,116,105,110,103,67,111,109,112,111,110,101,110,116,84,111,85,112,100,97,116,101,41,13,10,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,105,102,32,40,99,111,108,117,109,110,73,100,32,61,61,32,53,41,32,47,47,32,73,102,32,105,116,39,115,32,116,104,101,32, + 114,97,116,105,110,103,115,32,99,111,108,117,109,110,44,32,119,101,39,108,108,32,114,101,116,117,114,110,32,111,117,114,32,99,117,115,116,111,109,32, + 99,111,109,112,111,110,101,110,116,46,46,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,82,97,116,105, + 110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,42,32,114,97,116,105,110,103,115,66,111,120,32,61,32,40,82, + 97,116,105,110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,42,41,32,101,120,105,115,116,105,110,103,67,111,109, + 112,111,110,101,110,116,84,111,85,112,100,97,116,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,97,110,32, + 101,120,105,115,116,105,110,103,32,99,111,109,112,111,110,101,110,116,32,105,115,32,98,101,105,110,103,32,112,97,115,115,101,100,45,105,110,32,102,111, + 114,32,117,112,100,97,116,105,110,103,44,32,119,101,39,108,108,32,114,101,45,117,115,101,32,105,116,44,32,98,117,116,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,47,47,32,105,102,32,110,111,116,44,32,119,101,39,108,108,32,104,97,118,101,32,116,111,32,99,114,101,97,116,101,32,111,110, + 101,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,97,116,105,110,103,115,66,111,120,32,61,61,32,48,41,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,97,116,105,110,103,115,66,111,120,32,61,32,110,101,119,32,82,97,116,105,110,103,67,111,108, + 117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,40,42,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,114,97,116,105,110,103,115,66,111,120,45,62,115,101,116,82,111,119,65,110,100,67,111,108,117,109,110,32,40,114,111,119,78,117,109,98,101, + 114,44,32,99,111,108,117,109,110,73,100,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,114,97,116,105, + 110,103,115,66,111,120,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,102,111,114,32,97,110,121,32,111,116,104,101,114,32,99,111,108,117,109,110, + 44,32,106,117,115,116,32,114,101,116,117,114,110,32,48,44,32,97,115,32,119,101,39,108,108,32,98,101,32,112,97,105,110,116,105,110,103,32,116,104, + 101,115,101,32,99,111,108,117,109,110,115,32,100,105,114,101,99,116,108,121,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,97,115, + 115,101,114,116,32,40,101,120,105,115,116,105,110,103,67,111,109,112,111,110,101,110,116,84,111,85,112,100,97,116,101,32,61,61,32,48,41,59,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76, + 105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,115,104,111,117,108,100,32,99,104,111,111,115,101,32,116,104,101,32,98,101,115,116,32, + 119,105,100,116,104,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,13,10,32,32,32,32,47,47,32,99,111,108,117,109,110,46,13, + 10,32,32,32,32,105,110,116,32,103,101,116,67,111,108,117,109,110,65,117,116,111,83,105,122,101,87,105,100,116,104,32,40,105,110,116,32,99,111,108, + 117,109,110,73,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,99,111,108,117,109,110,73,100,32,61,61,32,53, + 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,49,48,48,59,32,47,47,32,40,116,104,105,115,32,105,115,32,116, + 104,101,32,114,97,116,105,110,103,115,32,99,111,108,117,109,110,44,32,99,111,110,116,97,105,110,105,110,103,32,97,32,99,117,115,116,111,109,32,99, + 111,109,112,111,110,101,110,116,41,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,119,105,100,101,115,116,32,61,32,51,50,59,13,10,13, + 10,32,32,32,32,32,32,32,32,47,47,32,102,105,110,100,32,116,104,101,32,119,105,100,101,115,116,32,98,105,116,32,111,102,32,116,101,120,116,32, + 105,110,32,116,104,105,115,32,99,111,108,117,109,110,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,103, + 101,116,78,117,109,82,111,119,115,40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,99,111,110,115,116,32,88,109,108,69,108,101,109,101,110,116,42,32,114,111,119,69,108,101,109,101,110,116,32,61,32,100, + 97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,105,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,105,102,32,40,114,111,119,69,108,101,109,101,110,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,114,111,119, + 69,108,101,109,101,110,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,103,101,116,65,116,116,114,105,98,117,116, + 101,78,97,109,101,70,111,114,67,111,108,117,109,110,73,100,32,40,99,111,108,117,109,110,73,100,41,41,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,119,105,100,101,115,116,32,61,32,106,109,97,120,32,40,119,105,100,101,115,116,44,32,102,111,110,116,46,103,101, + 116,83,116,114,105,110,103,87,105,100,116,104,32,40,116,101,120,116,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, + 32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,119,105,100,101,115,116,32,43,32,56,59,13,10,32, + 32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,65,32,99,111,117,112,108,101,32,111,102,32,113,117,105,99,107,32,109,101,116,104,111,100,115, + 32,116,111,32,115,101,116,32,97,110,100,32,103,101,116,32,116,104,101,32,34,114,97,116,105,110,103,34,32,118,97,108,117,101,32,119,104,101,110,32, + 116,104,101,32,117,115,101,114,13,10,32,32,32,32,47,47,32,99,104,97,110,103,101,115,32,116,104,101,32,99,111,109,98,111,32,98,111,120,13,10, + 32,32,32,32,105,110,116,32,103,101,116,82,97,116,105,110,103,32,40,99,111,110,115,116,32,105,110,116,32,114,111,119,78,117,109,98,101,114,44,32, + 99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32, + 32,32,114,101,116,117,114,110,32,100,97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78, + 117,109,98,101,114,41,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,40,84,40,34,82,97,116,105,110,103,34,41,41,59,13,10, + 32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,101,116,82,97,116,105,110,103,32,40,99,111,110,115,116,32,105,110,116,32,114, + 111,119,78,117,109,98,101,114,44,32,99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,44,32,99,111,110,115,116,32,105,110,116,32, + 110,101,119,82,97,116,105,110,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,45,62,103,101,116, + 67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78,117,109,98,101,114,41,45,62,115,101,116,65,116,116,114,105,98,117,116,101,32,40, + 84,40,34,82,97,116,105,110,103,34,41,44,32,110,101,119,82,97,116,105,110,103,41,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,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,47,47,32,112, + 111,115,105,116,105,111,110,32,111,117,114,32,116,97,98,108,101,32,119,105,116,104,32,97,32,103,97,112,32,97,114,111,117,110,100,32,105,116,115,32, + 101,100,103,101,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,115,101,116,66,111,117,110,100,115,73,110,115,101,116,32,40,66,111,114, + 100,101,114,83,105,122,101,32,40,56,41,41,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,97,98,108,101,76,105,115,116,66,111,120,42,32,116,97,98,108,101,59,32,32,32,32,47,47,32,116,104,101,32,116,97,98,108,101,32,99,111,109, + 112,111,110,101,110,116,32,105,116,115,101,108,102,13,10,32,32,32,32,70,111,110,116,32,102,111,110,116,59,13,10,13,10,32,32,32,32,88,109,108, + 69,108,101,109,101,110,116,42,32,100,101,109,111,68,97,116,97,59,32,32,32,47,47,32,84,104,105,115,32,105,115,32,116,104,101,32,88,77,76,32, + 100,111,99,117,109,101,110,116,32,108,111,97,100,101,100,32,102,114,111,109,32,116,104,101,32,101,109,98,101,100,100,101,100,32,102,105,108,101,32,34, + 100,101,109,111,32,116,97,98,108,101,32,100,97,116,97,46,120,109,108,34,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,99,111, + 108,117,109,110,76,105,115,116,59,32,47,47,32,65,32,112,111,105,110,116,101,114,32,116,111,32,116,104,101,32,115,117,98,45,110,111,100,101,32,111, + 102,32,100,101,109,111,68,97,116,97,32,116,104,97,116,32,99,111,110,116,97,105,110,115,32,116,104,101,32,108,105,115,116,32,111,102,32,99,111,108, + 117,109,110,115,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,100,97,116,97,76,105,115,116,59,32,32,32,47,47,32,65,32,112, + 111,105,110,116,101,114,32,116,111,32,116,104,101,32,115,117,98,45,110,111,100,101,32,111,102,32,100,101,109,111,68,97,116,97,32,116,104,97,116,32, + 99,111,110,116,97,105,110,115,32,116,104,101,32,108,105,115,116,32,111,102,32,100,97,116,97,32,114,111,119,115,13,10,32,32,32,32,105,110,116,32, + 110,117,109,82,111,119,115,59,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,101,32,110,117,109,98,101,114,32,111,102,32,114,111,119, + 115,32,111,102,32,100,97,116,97,32,119,101,39,118,101,32,103,111,116,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,47,47,32,84,104,105,115, + 32,105,115,32,97,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101,110,116,32,99,111,110,116,97,105,110,105,110,103,32,97,32,99,111,109,98, + 111,32,98,111,120,44,32,119,104,105,99,104,32,119,101,39,114,101,32,103,111,105,110,103,32,116,111,32,112,117,116,32,105,110,115,105,100,101,13,10, + 32,32,32,32,47,47,32,111,117,114,32,116,97,98,108,101,39,115,32,34,114,97,116,105,110,103,34,32,99,111,108,117,109,110,46,13,10,32,32,32, + 32,99,108,97,115,115,32,82,97,116,105,110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,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,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,67,111,109,98,111,66,111,120,76,105,115, + 116,101,110,101,114,13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,82,97,116,105,110, + 103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,40,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101, + 110,116,38,32,111,119,110,101,114,95,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,111,119,110,101,114,32,40,111,119,110,101,114,95, + 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,106,117,115,116,32,112,117,116,32,97,32, + 99,111,109,98,111,32,98,111,120,32,105,110,115,105,100,101,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,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,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67, + 111,109,98,111,66,111,120,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99, + 111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,102,97,98,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,103,114,111,111,118,121,34,41,44,32,50,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,104,101,112,34, + 41,44,32,51,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84, + 40,34,110,101,97,116,34,41,44,32,52,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100, + 73,116,101,109,32,40,84,40,34,119,105,108,100,34,41,44,32,53,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66, + 111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,115,119,105,110,103,105,110,34,41,44,32,54,41,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,109,97,100,32,102,111,114,32,105,116,34,41,44,32, + 55,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,119,104,101,110,32,116,104,101,32,99,111,109,98,111,32,105,115,32, + 99,104,97,110,103,101,100,44,32,119,101,39,108,108,32,103,101,116,32,97,32,99,97,108,108,98,97,99,107,46,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,99,111,109,98,111,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,32,32,32,32,32, + 32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,87,97,110,116,115,75,101,121,98,111,97,114,100,70,111,99,117,115,32,40, + 102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,126,82,97,116,105,110,103,67,111,108, + 117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,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,32,32,32,32,125,13,10,13,10, + 32,32,32,32,32,32,32,32,118,111,105,100,32,114,101,115,105,122,101,100,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,66,111,117,110,100,115,73,110,115,101,116,32,40,66,111,114,100,101,114,83, + 105,122,101,32,40,50,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,79,117,114,32,100, + 101,109,111,32,99,111,100,101,32,119,105,108,108,32,99,97,108,108,32,116,104,105,115,32,119,104,101,110,32,119,101,32,109,97,121,32,110,101,101,100, + 32,116,111,32,117,112,100,97,116,101,32,111,117,114,32,99,111,110,116,101,110,116,115,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,115,101, + 116,82,111,119,65,110,100,67,111,108,117,109,110,32,40,99,111,110,115,116,32,105,110,116,32,110,101,119,82,111,119,44,32,99,111,110,115,116,32,105, + 110,116,32,110,101,119,67,111,108,117,109,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,111, + 119,32,61,32,110,101,119,82,111,119,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,108,117,109,110,73,100,32,61,32,110,101,119,67, + 111,108,117,109,110,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,83,101,108,101,99,116,101, + 100,73,100,32,40,111,119,110,101,114,46,103,101,116,82,97,116,105,110,103,32,40,114,111,119,44,32,99,111,108,117,109,110,73,100,41,44,32,116,114, + 117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120, + 67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,84,104,97,116,72,97,115,67,104,97,110,103,101, + 100,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,115,101,116,82,97,116,105, + 110,103,32,40,114,111,119,44,32,99,111,108,117,109,110,73,100,44,32,99,111,109,98,111,66,111,120,45,62,103,101,116,83,101,108,101,99,116,101,100, + 73,100,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32, + 32,32,32,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101,110,116,38,32,111,119,110,101,114,59,13,10,32,32,32,32,32,32,32,32,67, + 111,109,98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,114,111,119,44,32,99,111,108, + 117,109,110,73,100,59,13,10,32,32,32,32,125,59,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,47,47,32,65,32,99,111,109,112,97,114,97, + 116,111,114,32,117,115,101,100,32,116,111,32,115,111,114,116,32,111,117,114,32,100,97,116,97,32,119,104,101,110,32,116,104,101,32,117,115,101,114,32, + 99,108,105,99,107,115,32,97,32,99,111,108,117,109,110,32,104,101,97,100,101,114,13,10,32,32,32,32,99,108,97,115,115,32,68,101,109,111,68,97, + 116,97,83,111,114,116,101,114,13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101, + 109,111,68,97,116,97,83,111,114,116,101,114,32,40,99,111,110,115,116,32,83,116,114,105,110,103,32,97,116,116,114,105,98,117,116,101,84,111,83,111, + 114,116,95,44,32,98,111,111,108,32,102,111,114,119,97,114,100,115,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,97,116,116,114,105, + 98,117,116,101,84,111,83,111,114,116,32,40,97,116,116,114,105,98,117,116,101,84,111,83,111,114,116,95,41,44,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,100,105,114,101,99,116,105,111,110,32,40,102,111,114,119,97,114,100,115,32,63,32,49,32,58,32,45,49,41,13,10,32,32,32, + 32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,99,111,109,112,97,114,101, + 69,108,101,109,101,110,116,115,32,40,88,109,108,69,108,101,109,101,110,116,42,32,102,105,114,115,116,44,32,88,109,108,69,108,101,109,101,110,116,42, + 32,115,101,99,111,110,100,41,32,99,111,110,115,116,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105, + 110,116,32,114,101,115,117,108,116,32,61,32,102,105,114,115,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,97, + 116,116,114,105,98,117,116,101,84,111,83,111,114,116,41,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,32,32,46,99,111,109,112,97,114,101,76,101,120,105,99,111,103,114,97,112,104,105,99,97,108,108,121,32,40,115,101,99,111,110,100,45,62,103, + 101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,97,116,116,114,105,98,117,116,101,84,111,83,111,114,116,41,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,114,101,115,117,108,116,32,61,32,102,105,114,115,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116, + 101,32,40,84,40,34,73,68,34,41,41,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,32,32, + 46,99,111,109,112,97,114,101,76,101,120,105,99,111,103,114,97,112,104,105,99,97,108,108,121,32,40,115,101,99,111,110,100,45,62,103,101,116,83,116, + 114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,84,40,34,73,68,34,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,114,101,116,117,114,110,32,100,105,114,101,99,116,105,111,110,32,42,32,114,101,115,117,108,116,59,13,10,32,32,32,32,32,32,32,32,125,13,10, + 13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,97,116,116, + 114,105,98,117,116,101,84,111,83,111,114,116,59,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,100,105,114,101,99,116,105, + 111,110,59,13,10,32,32,32,32,125,59,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,47,47,32,116,104,105,115,32,108,111,97,100,115,32,116, + 104,101,32,101,109,98,101,100,100,101,100,32,100,97,116,97,98,97,115,101,32,88,77,76,32,102,105,108,101,32,105,110,116,111,32,109,101,109,111,114, + 121,13,10,32,32,32,32,118,111,105,100,32,108,111,97,100,68,97,116,97,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,88, + 109,108,68,111,99,117,109,101,110,116,32,100,97,116,97,68,111,99,32,40,83,116,114,105,110,103,32,40,40,99,111,110,115,116,32,99,104,97,114,42, + 41,32,66,105,110,97,114,121,68,97,116,97,58,58,100,101,109,111,95,116,97,98,108,101,95,100,97,116,97,95,120,109,108,41,41,59,13,10,32,32, + 32,32,32,32,32,32,100,101,109,111,68,97,116,97,32,61,32,100,97,116,97,68,111,99,46,103,101,116,68,111,99,117,109,101,110,116,69,108,101,109, + 101,110,116,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,32,61,32,100,101,109,111,68,97,116,97,45,62,103, + 101,116,67,104,105,108,100,66,121,78,97,109,101,32,40,84,40,34,68,65,84,65,34,41,41,59,13,10,32,32,32,32,32,32,32,32,99,111,108,117, + 109,110,76,105,115,116,32,61,32,100,101,109,111,68,97,116,97,45,62,103,101,116,67,104,105,108,100,66,121,78,97,109,101,32,40,84,40,34,67,79, + 76,85,77,78,83,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,110,117,109,82,111,119,115,32,61,32,100,97,116,97,76,105,115,116,45, + 62,103,101,116,78,117,109,67,104,105,108,100,69,108,101,109,101,110,116,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47, + 32,40,97,32,117,116,105,108,105,116,121,32,109,101,116,104,111,100,32,116,111,32,115,101,97,114,99,104,32,111,117,114,32,88,77,76,32,102,111,114, + 32,116,104,101,32,97,116,116,114,105,98,117,116,101,32,116,104,97,116,32,109,97,116,99,104,101,115,32,97,32,99,111,108,117,109,110,32,73,68,41, + 13,10,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109,101,70,111,114,67,111, + 108,117,109,110,73,100,32,40,99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,41,32,99,111,110,115,116,13,10,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,102,111,114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,99,111,108,117,109, + 110,76,105,115,116,44,32,99,111,108,117,109,110,88,109,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,105,102,32,40,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,99,111,108,117, + 109,110,73,100,34,41,32,61,61,32,99,111,108,117,109,110,73,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116, + 117,114,110,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,84,40,34,110,97,109, + 101,34,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,83,116,114,105,110,103, + 58,58,101,109,112,116,121,59,13,10,32,32,32,32,125,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,84,97,98,108,101,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,84,97,98,108,101, + 68,101,109,111,67,111,109,112,111,110,101,110,116,40,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::tabledemo_cpp = (const char*) temp4; + +static const unsigned char temp5[] = {82,73,70,70,4,181,0,0,87,65,86,69,102,109,116,32,16,0,0,0,1,0,1,0,34,86,0,0,68,172,0,0,2,0,16,0,98,101,120,116, + 92,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,114,97,99,107,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,50,48,48,54,45,49,48,45,48,52,49,50,58,49,52,58,48,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,100,97,116,97,124,178,0,0,0,0,0,0,250,255,248,255,0,0,253,255,255,255,0,0,253,255,249,255,249,255,248,255, + 252,255,249,255,0,0,4,0,1,0,255,255,4,0,7,0,255,255,4,0,249,255,252,255,1,0,255,255,0,0,255,255,255,255,3,0,3,0,1,0, + 4,0,252,255,4,0,253,255,255,255,250,255,248,255,241,255,248,255,3,0,6,0,6,0,1,0,7,0,1,0,253,255,253,255,246,255,245,255,242,255, + 246,255,252,255,252,255,249,255,1,0,255,255,0,0,255,255,255,255,253,255,3,0,0,0,253,255,250,255,249,255,245,255,246,255,249,255,248,255,255,255, + 3,0,6,0,0,0,255,255,250,255,4,0,7,0,6,0,0,0,255,255,249,255,252,255,0,0,0,0,6,0,3,0,255,255,0,0,250,255,0,0, + 3,0,4,0,3,0,1,0,4,0,4,0,7,0,3,0,255,255,255,255,246,255,248,255,253,255,3,0,253,255,1,0,252,255,4,0,253,255,6,0, + 3,0,253,255,253,255,252,255,255,255,253,255,253,255,0,0,255,255,0,0,0,0,3,0,7,0,4,0,1,0,255,255,242,255,250,255,255,255,8,0, + 0,0,3,0,0,0,3,0,0,0,249,255,248,255,250,255,0,0,252,255,0,0,253,255,250,255,248,255,253,255,0,0,252,255,0,0,1,0,252,255, + 0,0,250,255,253,255,0,0,4,0,0,0,250,255,255,255,253,255,252,255,3,0,253,255,248,255,0,0,252,255,0,0,249,255,244,255,249,255,252,255, + 255,255,249,255,253,255,246,255,250,255,248,255,1,0,6,0,3,0,0,0,253,255,246,255,250,255,255,255,246,255,249,255,1,0,255,255,253,255,1,0, + 3,0,6,0,1,0,250,255,255,255,252,255,1,0,253,255,0,0,255,255,253,255,0,0,253,255,250,255,250,255,253,255,248,255,255,255,250,255,248,255, + 0,0,253,255,252,255,6,0,3,0,3,0,250,255,255,255,255,255,250,255,249,255,253,255,1,0,4,0,6,0,4,0,255,255,253,255,253,255,255,255, + 255,255,250,255,1,0,253,255,250,255,255,255,249,255,252,255,255,255,255,255,6,0,6,0,8,0,4,0,255,255,1,0,1,0,3,0,255,255,4,0, + 4,0,1,0,250,255,3,0,253,255,253,255,4,0,250,255,255,255,255,255,255,255,249,255,248,255,255,255,3,0,248,255,3,0,248,255,0,0,4,0, + 4,0,253,255,252,255,252,255,246,255,248,255,250,255,250,255,253,255,6,0,3,0,6,0,4,0,6,0,7,0,12,0,6,0,10,0,15,0,14,0, + 6,0,6,0,255,255,248,255,252,255,1,0,3,0,8,0,3,0,3,0,8,0,0,0,1,0,10,0,10,0,7,0,6,0,6,0,10,0,6,0, + 4,0,252,255,4,0,11,0,18,0,14,0,10,0,15,0,11,0,10,0,14,0,15,0,17,0,18,0,17,0,17,0,17,0,11,0,12,0,11,0, + 17,0,12,0,14,0,7,0,10,0,12,0,11,0,4,0,3,0,253,255,255,255,1,0,0,0,250,255,253,255,6,0,4,0,7,0,7,0,4,0, + 1,0,3,0,1,0,3,0,252,255,246,255,248,255,249,255,252,255,0,0,0,0,253,255,255,255,250,255,246,255,249,255,253,255,8,0,6,0,25,0, + 19,0,19,0,18,0,18,0,24,0,24,0,25,0,26,0,30,0,26,0,22,0,28,0,15,0,15,0,8,0,11,0,10,0,7,0,25,0,24,0, + 32,0,44,0,43,0,57,0,51,0,53,0,48,0,46,0,40,0,35,0,29,0,24,0,21,0,8,0,0,0,250,255,239,255,237,255,228,255,227,255, + 223,255,228,255,227,255,228,255,228,255,239,255,239,255,242,255,244,255,245,255,245,255,237,255,223,255,214,255,202,255,191,255,174,255,162,255,155,255,138,255, + 138,255,130,255,127,255,120,255,111,255,111,255,108,255,105,255,102,255,98,255,99,255,99,255,97,255,99,255,104,255,113,255,127,255,145,255,151,255,165,255, + 169,255,180,255,192,255,187,255,180,255,166,255,162,255,156,255,154,255,148,255,149,255,156,255,172,255,187,255,196,255,188,255,194,255,188,255,191,255,181,255, + 181,255,180,255,173,255,170,255,167,255,156,255,141,255,112,255,87,255,57,255,26,255,0,255,231,254,216,254,214,254,211,254,220,254,229,254,239,254,254,254, + 29,255,69,255,104,255,133,255,142,255,166,255,195,255,210,255,232,255,250,255,4,0,253,255,235,255,209,255,180,255,165,255,162,255,165,255,170,255,185,255, + 191,255,184,255,183,255,173,255,154,255,127,255,104,255,99,255,112,255,133,255,156,255,170,255,176,255,173,255,136,255,115,255,79,255,52,255,37,255,37,255, + 50,255,62,255,65,255,65,255,72,255,51,255,11,255,218,254,185,254,171,254,196,254,3,255,79,255,167,255,3,0,89,0,169,0,233,0,33,1,78,1, + 132,1,191,1,243,1,28,2,52,2,48,2,20,2,222,1,141,1,35,1,172,0,54,0,221,255,158,255,130,255,142,255,185,255,238,255,44,0,101,0, + 147,0,150,0,127,0,76,0,7,0,195,255,98,255,254,254,175,254,131,254,105,254,98,254,108,254,119,254,135,254,152,254,163,254,178,254,195,254,221,254, + 254,254,18,255,15,255,254,254,209,254,141,254,72,254,23,254,244,253,6,254,38,254,110,254,213,254,58,255,142,255,220,255,28,0,83,0,134,0,180,0, + 220,0,22,1,90,1,161,1,236,1,54,2,126,2,194,2,250,2,42,3,84,3,107,3,132,3,143,3,143,3,139,3,127,3,91,3,70,3,41,3, + 244,2,187,2,147,2,104,2,84,2,79,2,77,2,78,2,85,2,93,2,84,2,54,2,10,2,202,1,144,1,81,1,14,1,194,0,126,0,72,0, + 55,0,60,0,105,0,157,0,216,0,14,1,54,1,96,1,117,1,136,1,155,1,154,1,164,1,175,1,180,1,194,1,222,1,3,2,49,2,125,2, + 211,2,39,3,103,3,159,3,186,3,172,3,128,3,75,3,19,3,200,2,125,2,50,2,248,1,179,1,117,1,54,1,248,0,183,0,118,0,61,0, + 24,0,0,0,255,255,7,0,43,0,90,0,148,0,213,0,28,1,108,1,193,1,10,2,75,2,147,2,211,2,15,3,67,3,95,3,117,3,141,3, + 142,3,131,3,109,3,85,3,55,3,15,3,226,2,196,2,142,2,85,2,14,2,198,1,117,1,39,1,205,0,101,0,244,255,122,255,242,254,112,254, + 228,253,109,253,1,253,172,252,114,252,89,252,82,252,92,252,128,252,196,252,10,253,91,253,168,253,228,253,19,254,52,254,63,254,52,254,30,254,242,253, + 206,253,166,253,128,253,100,253,96,253,102,253,123,253,154,253,193,253,242,253,37,254,85,254,124,254,163,254,177,254,167,254,153,254,139,254,116,254,80,254, + 11,254,171,253,96,253,42,253,9,253,237,252,219,252,240,252,24,253,77,253,177,253,49,254,175,254,39,255,140,255,209,255,11,0,65,0,115,0,125,0, + 96,0,73,0,51,0,1,0,205,255,176,255,191,255,228,255,249,255,252,255,255,255,245,255,232,255,209,255,174,255,147,255,116,255,61,255,227,254,124,254, + 1,254,142,253,74,253,59,253,27,253,240,252,186,252,142,252,96,252,68,252,24,252,245,251,229,251,241,251,21,252,84,252,151,252,193,252,200,252,161,252, + 77,252,219,251,94,251,244,250,163,250,143,250,177,250,4,251,97,251,207,251,79,252,185,252,248,252,21,253,75,253,207,253,146,254,131,255,127,0,71,1, + 225,1,90,2,181,2,239,2,13,3,21,3,44,3,41,3,37,3,251,2,207,2,149,2,79,2,233,1,56,1,86,0,115,255,191,254,65,254,239,253, + 203,253,204,253,224,253,36,254,128,254,239,254,80,255,151,255,166,255,131,255,54,255,167,254,218,253,243,252,27,252,132,251,58,251,40,251,56,251,96,251, + 125,251,129,251,74,251,234,250,130,250,57,250,21,250,14,250,49,250,94,250,151,250,231,250,86,251,193,251,18,252,63,252,86,252,113,252,120,252,96,252, + 61,252,24,252,23,252,48,252,118,252,228,252,134,253,78,254,40,255,10,0,201,0,93,1,191,1,13,2,84,2,174,2,5,3,82,3,154,3,213,3, + 26,4,74,4,90,4,108,4,144,4,186,4,254,4,75,5,174,5,10,6,104,6,148,6,162,6,125,6,78,6,29,6,252,5,246,5,4,6,21,6, + 61,6,118,6,162,6,166,6,119,6,36,6,201,5,77,5,211,4,106,4,253,3,128,3,17,3,153,2,50,2,208,1,132,1,97,1,104,1,132,1, + 184,1,252,1,75,2,189,2,45,3,163,3,251,3,76,4,155,4,228,4,27,5,69,5,91,5,99,5,87,5,80,5,58,5,39,5,19,5,231,4, + 193,4,167,4,137,4,90,4,51,4,24,4,30,4,59,4,106,4,166,4,231,4,45,5,112,5,173,5,239,5,48,6,93,6,109,6,80,6,29,6, + 221,5,135,5,43,5,220,4,134,4,47,4,208,3,143,3,78,3,24,3,222,2,153,2,90,2,43,2,251,1,216,1,187,1,171,1,178,1,211,1, + 7,2,43,2,74,2,68,2,255,1,162,1,49,1,172,0,43,0,191,255,115,255,86,255,87,255,115,255,180,255,4,0,87,0,140,0,151,0,130,0, + 66,0,226,255,99,255,217,254,54,254,148,253,244,252,110,252,241,251,151,251,90,251,57,251,65,251,104,251,190,251,35,252,149,252,9,253,99,253,174,253, + 221,253,239,253,235,253,208,253,185,253,152,253,99,253,33,253,225,252,158,252,99,252,49,252,17,252,5,252,2,252,27,252,82,252,176,252,49,253,192,253, + 78,254,220,254,81,255,169,255,224,255,221,255,184,255,91,255,214,254,62,254,152,253,3,253,139,252,46,252,237,251,196,251,182,251,227,251,48,252,121,252, + 199,252,35,253,174,253,36,254,134,254,235,254,66,255,130,255,167,255,151,255,99,255,19,255,156,254,27,254,181,253,103,253,49,253,235,252,147,252,60,252, + 244,251,209,251,204,251,190,251,150,251,104,251,60,251,10,251,224,250,202,250,184,250,184,250,215,250,65,251,226,251,163,252,132,253,102,254,14,255,83,255, + 57,255,223,254,94,254,207,253,60,253,160,252,20,252,193,251,147,251,118,251,101,251,99,251,83,251,57,251,14,251,7,251,11,251,64,251,183,251,86,252, + 241,252,100,253,179,253,9,254,113,254,224,254,68,255,163,255,7,0,90,0,165,0,217,0,6,1,7,1,183,0,8,0,22,255,8,254,24,253,107,252, + 17,252,9,252,35,252,86,252,163,252,253,252,92,253,142,253,100,253,192,252,197,251,130,250,57,249,254,247,26,247,120,246,5,246,200,245,180,245,211,245, + 254,245,24,246,3,246,204,245,168,245,164,245,198,245,25,246,147,246,52,247,197,247,37,248,112,248,185,248,14,249,142,249,69,250,72,251,131,252,215,253, + 23,255,54,0,33,1,191,1,2,2,25,2,35,2,63,2,117,2,207,2,107,3,73,4,108,5,184,6,251,7,60,9,149,10,214,11,240,12,197,13, + 110,14,239,14,77,15,132,15,139,15,89,15,211,14,13,14,54,13,105,12,201,11,84,11,5,11,232,10,222,10,189,10,144,10,70,10,239,9,96,9, + 146,8,157,7,150,6,126,5,116,4,114,3,138,2,165,1,202,0,15,0,112,255,236,254,148,254,105,254,120,254,211,254,104,255,43,0,20,1,14,2, + 3,3,221,3,116,4,227,4,69,5,185,5,33,6,155,6,33,7,157,7,2,8,118,8,216,8,35,9,64,9,64,9,49,9,30,9,12,9,255,8, + 240,8,208,8,150,8,67,8,243,7,155,7,45,7,205,6,107,6,21,6,202,5,153,5,102,5,83,5,84,5,81,5,102,5,108,5,106,5,134,5, + 202,5,42,6,180,6,93,7,32,8,236,8,170,9,103,10,246,10,66,11,73,11,7,11,108,10,149,9,133,8,83,7,37,6,239,4,224,3,211,2, + 226,1,22,1,129,0,255,255,113,255,198,254,9,254,42,253,57,252,42,251,14,250,236,248,214,247,215,246,12,246,97,245,14,245,6,245,68,245,197,245, + 111,246,12,247,160,247,33,248,148,248,216,248,242,248,235,248,234,248,221,248,241,248,28,249,98,249,176,249,15,250,119,250,240,250,117,251,241,251,93,252, + 193,252,16,253,81,253,125,253,153,253,167,253,163,253,168,253,167,253,128,253,81,253,56,253,89,253,152,253,210,253,218,253,197,253,186,253,215,253,38,254, + 119,254,196,254,1,255,65,255,137,255,220,255,46,0,134,0,209,0,9,1,54,1,83,1,79,1,49,1,32,1,25,1,249,0,145,0,4,0,91,255, + 164,254,12,254,159,253,55,253,194,252,103,252,43,252,2,252,200,251,118,251,40,251,249,250,198,250,133,250,37,250,187,249,77,249,235,248,149,248,48,248, + 196,247,130,247,107,247,114,247,124,247,114,247,24,247,125,246,203,245,4,245,53,244,152,243,66,243,26,243,37,243,79,243,108,243,133,243,177,243,233,243, + 35,244,73,244,144,244,53,245,74,246,179,247,102,249,75,251,39,253,227,254,112,0,227,1,45,3,110,4,115,5,39,6,127,6,80,6,209,5,1,5, + 225,3,63,2,55,0,228,253,154,251,158,249,56,248,121,247,69,247,121,247,243,247,159,248,116,249,55,250,202,250,21,251,33,251,197,250,255,249,25,249, + 49,248,67,247,103,246,129,245,168,244,248,243,109,243,33,243,14,243,46,243,98,243,142,243,191,243,6,244,115,244,20,245,197,245,88,246,187,246,34,247, + 148,247,19,248,203,248,147,249,98,250,25,251,162,251,42,252,163,252,10,253,105,253,195,253,78,254,5,255,4,0,74,1,229,2,149,4,44,6,147,7, + 186,8,189,9,108,10,214,10,1,11,16,11,52,11,152,11,253,11,144,12,69,13,243,13,180,14,106,15,23,16,182,16,61,17,217,17,154,18,25,19, + 78,19,47,19,197,18,61,18,167,17,250,16,73,16,179,15,116,15,114,15,161,15,217,15,16,16,30,16,226,15,113,15,174,14,151,13,41,12,144,10, + 241,8,85,7,206,5,110,4,64,3,78,2,172,1,69,1,51,1,86,1,198,1,140,2,145,3,153,4,149,5,100,6,10,7,112,7,130,7,81,7, + 238,6,115,6,237,5,140,5,95,5,122,5,225,5,123,6,13,7,132,7,254,7,131,8,6,9,142,9,22,10,168,10,94,11,246,11,125,12,220,12, + 22,13,36,13,231,12,98,12,188,11,250,10,51,10,123,9,236,8,139,8,56,8,227,7,140,7,38,7,183,6,89,6,235,5,153,5,79,5,25,5, + 235,4,196,4,157,4,85,4,254,3,132,3,232,2,74,2,139,1,213,0,7,0,21,255,23,254,67,253,121,252,186,251,70,251,25,251,56,251,150,251, + 31,252,215,252,145,253,58,254,178,254,200,254,113,254,190,253,204,252,168,251,100,250,37,249,232,247,194,246,201,245,2,245,129,244,65,244,55,244,90,244, + 158,244,233,244,74,245,190,245,53,246,135,246,186,246,194,246,205,246,207,246,254,246,78,247,150,247,213,247,243,247,51,248,134,248,252,248,118,249,219,249, + 75,250,181,250,25,251,125,251,240,251,84,252,171,252,240,252,69,253,175,253,49,254,174,254,44,255,136,255,178,255,169,255,105,255,34,255,239,254,247,254, + 54,255,115,255,141,255,144,255,134,255,140,255,191,255,29,0,173,0,57,1,129,1,118,1,47,1,6,1,213,0,132,0,8,0,77,255,92,254,34,253, + 182,251,107,250,111,249,157,248,245,247,95,247,247,246,161,246,73,246,216,245,7,245,216,243,55,242,64,240,47,238,112,236,55,235,156,234,100,234,111,234, + 228,234,182,235,195,236,220,237,193,238,131,239,84,240,73,241,119,242,235,243,64,245,70,246,232,246,94,247,202,247,12,248,119,248,39,249,54,250,70,251, + 77,252,44,253,195,253,2,254,211,253,70,253,85,252,36,251,223,249,221,248,119,248,223,248,228,249,49,251,133,252,224,253,7,255,4,0,162,0,217,0, + 125,0,162,255,106,254,39,253,5,252,32,251,151,250,158,250,229,250,29,251,6,251,169,250,24,250,95,249,133,248,132,247,103,246,56,245,31,244,23,243, + 19,242,17,241,45,240,133,239,53,239,57,239,190,239,172,240,251,241,137,243,49,245,167,246,184,247,106,248,224,248,61,249,145,249,31,250,49,251,194,252, + 182,254,224,0,39,3,147,5,255,7,53,10,68,12,6,14,136,15,203,16,176,17,77,18,166,18,8,19,159,19,81,20,44,21,73,22,152,23,249,24, + 88,26,196,27,25,29,29,30,245,30,109,31,118,31,249,30,65,30,98,29,92,28,97,27,89,26,72,25,50,24,66,23,116,22,212,21,78,21,225,20, + 131,20,249,19,22,19,230,17,96,16,168,14,240,12,90,11,4,10,236,8,238,7,36,7,145,6,42,6,230,5,159,5,137,5,173,5,235,5,72,6, + 198,6,94,7,34,8,216,8,128,9,2,10,74,10,80,10,27,10,204,9,111,9,250,8,126,8,243,7,61,7,129,6,253,5,223,5,47,6,201,6, + 154,7,102,8,49,9,27,10,11,11,219,11,122,12,231,12,26,13,21,13,237,12,202,12,174,12,152,12,112,12,29,12,165,11,234,10,246,9,240,8, + 3,8,56,7,161,6,47,6,6,6,50,6,134,6,223,6,24,7,61,7,68,7,40,7,226,6,90,6,159,5,166,4,124,3,50,2,188,0,34,255, + 134,253,23,252,227,250,18,250,162,249,158,249,209,249,51,250,137,250,219,250,244,250,186,250,33,250,252,248,80,247,81,245,47,243,40,241,85,239,219,237, + 241,236,149,236,209,236,155,237,193,238,32,240,164,241,40,243,139,244,201,245,181,246,81,247,145,247,163,247,128,247,31,247,109,246,143,245,139,244,126,243, + 170,242,48,242,11,242,0,242,250,241,54,242,192,242,203,243,16,245,96,246,181,247,242,248,54,250,96,251,67,252,190,252,200,252,146,252,34,252,81,251, + 31,250,26,249,144,248,101,248,117,248,224,248,130,249,51,250,248,250,12,252,114,253,7,255,151,0,254,1,229,2,82,3,71,3,236,2,59,2,28,1, + 199,255,72,254,128,252,150,250,181,248,88,247,118,246,187,245,247,244,91,244,35,244,255,243,208,243,90,243,135,242,110,241,9,240,112,238,173,236,218,234, + 95,233,159,232,47,232,233,231,249,231,101,232,23,233,172,233,180,233,77,233,220,232,7,233,200,233,251,234,79,236,163,237,198,238,236,239,243,240,225,241, + 187,242,145,243,130,244,165,245,172,246,178,247,105,248,3,249,98,249,108,249,239,248,29,248,84,247,34,247,192,247,16,249,226,250,10,253,21,255,222,0, + 60,2,45,3,177,3,202,3,105,3,142,2,35,1,76,255,62,253,112,251,250,249,224,248,11,248,172,247,156,247,196,247,18,248,31,248,213,247,44,247, + 61,246,97,245,132,244,195,243,180,242,121,241,98,240,216,239,254,239,226,240,61,242,235,243,155,245,253,246,9,248,229,248,88,249,149,249,185,249,65,250, + 79,251,212,252,36,255,20,2,93,5,218,8,47,12,20,15,79,17,20,19,101,20,104,21,67,22,51,23,62,24,40,25,244,25,160,26,48,27,163,27, + 24,28,189,28,134,29,90,30,93,31,180,32,3,34,9,35,157,35,171,35,88,35,6,35,168,34,49,34,192,33,118,33,81,33,39,33,254,32,184,32, + 101,32,204,31,221,30,139,29,232,27,47,26,77,24,124,22,237,20,129,19,48,18,30,17,67,16,138,15,216,14,65,14,198,13,105,13,85,13,130,13, + 226,13,104,14,246,14,85,15,102,15,21,15,118,14,162,13,170,12,192,11,227,10,214,9,214,8,237,7,36,7,105,6,171,5,216,4,247,3,62,3, + 183,2,129,2,139,2,218,2,77,3,254,3,189,4,160,5,138,6,86,7,219,7,9,8,28,8,32,8,41,8,61,8,107,8,198,8,27,9,102,9, + 124,9,114,9,67,9,248,8,132,8,6,8,117,7,215,6,73,6,220,5,147,5,98,5,98,5,137,5,209,5,1,6,6,6,188,5,41,5,47,4, + 183,2,220,0,210,254,168,252,144,250,164,248,33,247,12,246,101,245,29,245,53,245,107,245,128,245,136,245,74,245,229,244,49,244,76,243,56,242,15,241, + 226,239,186,238,174,237,228,236,102,236,98,236,188,236,109,237,80,238,72,239,88,240,137,241,207,242,51,244,72,245,251,245,48,246,250,245,139,245,13,245, + 98,244,119,243,99,242,94,241,98,240,140,239,187,238,248,237,82,237,155,236,254,235,204,235,70,236,83,237,132,238,244,239,171,241,140,243,86,245,186,246, + 181,247,103,248,54,249,196,249,209,249,115,249,15,249,15,249,123,249,65,250,75,251,106,252,102,253,0,254,8,254,1,254,134,254,148,255,120,0,222,0, + 212,0,97,0,172,255,243,254,29,254,248,252,82,251,154,249,13,248,207,246,208,245,249,244,241,243,178,242,60,241,75,239,212,236,1,234,80,231,254,228, + 3,227,93,225,243,223,72,223,45,223,80,223,72,223,44,223,40,223,130,223,120,224,62,226,100,228,166,230,168,232,57,234,38,235,156,235,242,235,115,236, + 36,237,53,238,149,239,52,241,228,242,211,244,2,247,15,249,108,250,202,250,53,250,61,249,133,248,98,248,239,248,21,250,204,251,51,254,18,1,31,4, + 46,7,113,9,184,10,163,10,34,9,148,6,85,3,248,255,171,252,216,249,152,247,227,245,169,244,212,243,155,243,216,243,7,244,31,244,43,244,86,244, + 121,244,175,244,177,244,140,244,57,244,213,243,106,243,90,243,221,243,249,244,111,246,48,248,239,249,101,251,99,252,250,252,17,253,246,252,207,252,222,252, + 172,253,52,255,135,1,116,4,101,7,59,10,238,12,80,15,109,17,86,19,232,20,178,22,192,24,153,26,59,28,210,29,53,31,83,32,196,32,182,32, + 81,32,201,31,177,31,97,32,194,33,151,35,145,37,97,39,229,40,14,42,238,42,115,43,130,43,68,43,252,42,202,42,130,42,250,41,88,41,177,40, + 228,39,222,38,172,37,101,36,23,35,233,33,191,32,111,31,57,30,36,29,247,27,178,26,90,25,235,23,174,22,200,21,114,21,120,21,163,21,9,22, + 137,22,195,22,148,22,225,21,219,20,119,19,224,17,67,16,169,14,51,13,35,12,129,11,40,11,231,10,127,10,190,9,135,8,235,6,69,5,177,3, + 23,2,211,0,227,255,50,255,217,254,177,254,241,254,130,255,64,0,31,1,17,2,20,3,88,4,176,5,253,6,16,8,218,8,159,9,73,10,186,10, + 235,10,239,10,234,10,192,10,130,10,33,10,188,9,80,9,237,8,143,8,218,7,46,7,104,6,195,5,48,5,173,4,58,4,146,3,171,2,100,1, + 201,255,18,254,124,252,10,251,167,249,84,248,46,247,59,246,82,245,184,244,15,244,100,243,202,242,240,241,27,241,35,240,49,239,107,238,177,237,239,236, + 23,236,76,235,106,234,205,233,119,233,83,233,136,233,28,234,15,235,177,236,206,238,74,241,198,243,201,245,31,247,182,247,207,247,102,247,127,246,9,245, + 33,243,243,240,154,238,50,236,98,234,14,233,252,231,206,230,185,229,29,229,44,229,160,229,65,230,23,231,25,232,64,233,164,234,14,236,77,237,134,238, + 12,240,156,241,148,242,191,242,135,242,105,242,73,242,55,242,112,242,26,243,172,243,208,243,166,243,137,243,237,243,205,244,55,246,236,247,154,249,245,250, + 24,252,1,253,178,253,220,253,91,253,84,252,241,250,91,249,182,247,254,245,32,244,67,242,121,240,134,238,144,236,102,234,119,232,217,230,166,229,171,228, + 203,227,56,227,17,227,36,227,245,226,101,226,194,225,120,225,202,225,209,226,167,228,4,231,124,233,196,235,165,237,35,239,79,240,27,241,125,241,160,241, + 240,241,109,242,48,243,35,244,75,245,149,246,95,247,163,247,2,247,189,245,101,244,109,243,205,242,146,242,232,242,237,243,169,245,195,247,248,249,89,252, + 77,254,145,255,234,255,169,255,195,254,109,253,169,251,24,250,41,249,182,248,49,248,149,247,154,246,168,245,119,244,82,243,62,242,114,241,38,241,98,241, + 34,242,242,242,158,243,33,244,166,244,18,245,171,245,187,246,79,248,109,250,250,252,136,255,214,1,62,3,202,3,168,3,176,2,31,1,210,255,16,255, + 245,254,102,255,111,0,82,2,214,4,200,7,48,11,192,14,116,18,254,21,111,25,146,28,90,31,139,33,105,35,183,36,94,37,175,37,162,37,101,37, + 62,37,79,37,191,37,215,38,124,40,198,42,85,45,5,48,187,50,58,53,28,55,101,56,2,57,213,56,255,55,138,54,217,52,230,50,224,48,47,47, + 192,45,159,44,198,43,220,42,9,42,63,41,154,40,251,39,81,39,107,38,107,37,27,36,127,34,218,32,61,31,227,29,185,28,157,27,144,26,141,25, + 166,24,48,24,241,23,189,23,166,23,130,23,59,23,202,22,53,22,96,21,54,20,165,18,54,17,168,15,23,14,116,12,227,10,127,9,41,8,191,6, + 61,5,179,3,102,2,132,1,208,0,136,0,140,0,234,0,87,1,232,1,146,2,81,3,40,4,75,5,190,6,42,8,69,9,206,9,237,9,196,9, + 48,9,241,7,120,6,25,5,254,3,53,3,217,2,8,3,147,3,44,4,221,4,106,5,159,5,144,5,76,5,198,4,222,3,203,2,144,1,98,0, + 50,255,242,253,147,252,29,251,177,249,130,248,125,247,243,246,197,246,5,247,99,247,159,247,190,247,74,247,115,246,13,245,84,243,51,241,206,238,162,236, + 92,234,64,232,130,230,77,229,188,228,168,228,15,229,216,229,217,230,43,232,178,233,38,235,91,236,1,237,245,236,138,236,14,236,132,235,197,234,229,233, + 223,232,217,231,1,231,80,230,234,229,124,229,23,229,195,228,82,228,182,227,162,227,19,228,163,228,69,229,243,229,145,230,93,231,83,232,125,233,199,234, + 86,236,198,237,150,238,176,238,97,238,10,238,220,237,10,238,143,238,16,239,10,239,90,238,69,237,68,236,210,235,9,236,213,236,219,237,206,238,222,239, + 99,241,3,243,42,244,170,244,173,244,44,244,10,243,184,241,131,240,89,239,11,238,149,236,219,234,212,232,188,230,88,228,227,225,232,223,73,222,223,220, + 209,219,147,219,61,220,61,221,237,221,241,221,138,221,142,221,23,222,37,223,195,224,28,227,236,229,164,232,242,234,19,237,21,239,253,240,145,242,201,243, + 143,244,74,245,49,246,71,247,127,248,142,249,238,249,21,249,33,247,97,244,149,241,71,239,237,237,141,237,49,238,125,239,166,241,118,244,23,248,247,251, + 130,255,237,1,248,2,189,2,161,1,212,255,202,253,251,251,245,250,118,250,58,250,138,249,109,248,247,246,76,245,163,243,69,242,134,241,130,241,77,242, + 113,243,139,244,201,245,221,246,148,247,246,247,8,248,123,248,54,249,108,250,10,252,220,253,94,255,129,0,27,1,147,0,50,255,56,253,110,251,79,250, + 89,250,179,251,74,254,158,1,187,5,135,10,102,15,0,20,245,23,142,27,219,30,117,33,70,35,147,36,132,37,90,38,41,39,236,39,123,40,8,41, + 213,41,12,43,164,44,175,46,75,49,3,52,158,54,82,57,235,59,19,62,114,63,23,64,54,64,203,63,166,62,234,60,206,58,147,56,162,54,203,52, + 241,50,101,49,234,47,116,46,209,44,21,43,66,41,154,39,38,38,231,36,218,35,184,34,111,33,24,32,202,30,163,29,153,28,224,27,140,27,95,27, + 97,27,153,27,246,27,121,28,240,28,20,29,207,28,20,28,27,27,242,25,179,24,77,23,222,21,82,20,191,18,1,17,2,15,28,13,138,11,66,10, + 32,9,42,8,118,7,36,7,235,6,248,6,22,7,46,7,81,7,114,7,76,7,162,6,207,5,9,5,189,4,163,4,220,4,189,4,180,4,126,4, + 77,4,220,3,163,3,123,3,136,3,197,3,149,4,188,5,224,6,238,7,193,8,66,9,63,9,223,8,43,8,105,7,181,6,7,6,57,5,62,4, + 39,3,36,2,209,0,47,255,171,253,49,252,233,250,237,249,37,249,166,248,126,248,164,248,163,248,91,248,81,247,154,245,65,243,77,240,68,237,14,234, + 216,230,39,228,21,226,191,224,8,224,243,223,97,224,50,225,133,226,78,228,178,230,60,233,168,235,180,237,205,238,35,239,249,238,86,238,71,237,204,235, + 13,234,125,232,32,231,90,230,62,230,47,230,23,230,189,229,88,229,231,228,139,228,74,228,106,228,160,228,213,228,244,228,5,229,27,229,102,229,210,229, + 207,230,8,232,229,232,74,233,180,233,17,234,92,234,182,234,44,235,137,235,91,235,172,234,236,233,244,232,4,232,202,231,115,232,68,233,219,233,189,234, + 43,236,228,237,133,239,154,240,237,240,199,240,163,240,216,239,13,238,239,235,20,234,64,232,27,230,175,227,246,224,57,222,174,219,173,217,26,216,168,214, + 130,213,249,212,76,213,140,214,39,216,134,217,86,218,21,219,28,220,153,221,152,223,28,226,232,228,180,231,66,234,140,236,180,238,193,240,151,242,10,244, + 82,245,109,246,128,247,139,248,209,249,22,251,233,251,136,251,252,249,188,247,89,245,69,243,214,241,41,241,98,241,87,242,58,244,19,247,181,250,138,254, + 220,1,98,4,217,5,255,5,245,4,233,2,54,0,188,253,212,251,180,250,14,250,228,249,202,249,159,249,68,249,159,248,156,247,124,246,166,245,244,244, + 209,244,218,244,241,244,212,244,133,244,152,244,220,244,52,245,171,245,183,246,94,248,201,250,166,253,58,0,250,1,185,2,179,2,168,1,209,255,206,253, + 63,252,139,251,82,252,173,254,23,2,134,6,169,11,152,17,95,23,117,28,176,32,30,36,147,38,111,40,192,41,94,42,221,42,58,43,163,43,11,44, + 79,44,252,44,64,46,0,48,68,50,27,53,46,56,96,59,132,62,120,65,247,67,167,69,108,70,95,70,93,69,114,67,238,64,185,61,64,58,228,54, + 2,52,186,49,218,47,145,46,176,45,220,44,231,43,12,43,51,42,110,41,192,40,17,40,230,38,61,37,109,35,244,33,171,32,90,31,127,30,210,29, + 135,29,144,29,170,29,198,29,4,30,19,30,252,29,196,29,54,29,145,28,172,27,144,26,44,25,140,23,5,22,121,20,105,18,81,16,72,14,183,12, + 74,11,247,9,95,8,154,6,3,5,196,3,194,2,251,1,68,1,209,0,104,0,39,0,230,255,106,255,234,254,216,254,59,255,216,255,143,0,128,1, + 114,2,67,3,233,3,130,4,186,4,199,4,232,4,66,5,191,5,162,6,108,7,63,8,248,8,178,9,244,9,193,9,69,9,182,8,243,7,194,6, + 142,5,54,4,171,2,238,0,243,254,183,252,151,250,52,249,109,248,4,248,153,247,38,247,193,246,56,246,90,245,3,244,170,241,216,238,238,235,13,233, + 84,230,255,227,33,226,163,224,207,223,137,223,235,223,159,224,205,225,82,227,11,229,21,231,27,233,244,234,112,236,119,237,244,237,223,237,134,237,188,236, + 171,235,96,234,34,233,79,232,180,231,108,231,41,231,180,230,74,230,164,229,199,228,204,227,220,226,32,226,224,225,210,225,156,225,125,225,209,225,150,226, + 229,227,1,229,1,230,3,231,217,231,132,232,2,233,47,233,83,233,136,233,135,233,39,233,78,232,69,231,61,230,87,229,4,229,58,229,211,229,178,230, + 251,231,93,233,246,234,159,236,56,238,131,239,55,240,55,240,47,239,59,237,153,234,173,231,96,228,225,224,86,221,55,218,156,215,163,213,43,212,226,210, + 215,209,73,209,24,209,74,209,174,209,5,210,246,209,235,209,56,210,41,211,224,212,113,215,169,218,12,222,118,225,30,229,202,232,87,236,149,239,120,242, + 230,244,183,246,74,248,4,250,41,252,128,254,157,0,31,2,142,2,7,2,123,0,76,254,16,252,36,250,59,249,98,249,159,250,175,252,105,255,106,2, + 162,5,117,8,178,10,178,11,29,11,51,9,151,6,226,3,135,1,241,255,147,255,120,255,172,255,109,255,178,254,17,253,186,250,245,247,169,245,216,243, + 95,242,244,240,248,239,96,239,50,239,28,239,96,239,204,239,74,240,103,241,106,243,239,245,206,248,175,251,56,254,21,0,187,0,137,0,183,255,128,254, + 145,253,56,253,179,253,27,255,87,1,204,4,82,9,93,14,187,19,234,24,180,29,244,33,125,37,248,39,149,41,181,42,144,43,114,44,75,45,44,46, + 85,47,116,48,213,49,147,51,181,53,18,56,118,58,7,61,209,63,151,66,8,69,203,70,207,71,87,72,30,72,250,70,187,68,154,65,68,62,200,58, + 147,55,246,52,10,51,219,49,55,49,180,48,12,48,8,47,212,45,118,44,11,43,135,41,239,39,83,38,216,36,97,35,56,34,86,33,222,32,155,32, + 146,32,130,32,60,32,244,31,180,31,96,31,224,30,241,29,251,28,182,27,128,26,71,25,25,24,99,22,36,20,239,17,217,15,193,13,155,11,196,9, + 153,8,218,7,129,7,22,7,104,6,191,5,185,4,186,3,117,2,76,1,226,255,200,254,67,254,229,253,210,253,22,254,227,254,190,255,177,0,141,1, + 21,2,169,2,52,3,145,3,186,3,232,3,72,4,245,4,250,5,33,7,132,8,174,9,159,10,91,11,171,11,135,11,5,11,17,10,228,8,141,7, + 1,6,37,4,21,2,42,0,103,254,179,252,212,250,243,248,175,247,160,246,143,245,161,244,3,244,115,243,28,243,180,242,161,241,214,239,113,237,199,234, + 89,232,217,229,156,227,127,225,202,223,156,222,57,222,85,222,199,222,127,223,195,224,117,226,143,228,195,230,225,232,200,234,58,236,47,237,181,237,183,237, + 5,237,225,235,135,234,79,233,58,232,149,231,108,231,148,231,202,231,195,231,58,231,112,230,76,229,38,228,81,227,159,226,255,225,126,225,86,225,162,225, + 25,226,231,226,38,228,157,229,134,230,188,230,237,230,55,231,104,231,138,231,0,232,58,232,177,231,87,230,255,228,31,228,212,227,44,228,197,228,125,229, + 74,230,79,231,141,232,164,233,125,234,40,235,120,235,40,235,17,234,122,232,80,230,210,227,55,225,103,222,116,219,127,216,125,213,109,210,169,207,146,205, + 230,203,186,202,57,202,132,202,7,203,38,203,236,202,204,202,24,203,255,203,188,205,28,208,61,211,243,214,11,219,65,223,47,227,183,230,82,234,40,238, + 25,242,150,245,37,248,3,250,225,251,33,254,151,0,194,2,15,4,47,4,124,3,9,2,40,0,52,254,223,252,136,252,219,252,186,253,70,255,154,1, + 175,4,227,7,138,10,44,12,150,12,235,11,106,10,120,8,66,6,76,4,19,3,133,2,193,2,114,3,192,3,70,3,45,2,181,0,192,254,147,252, + 76,250,26,248,125,246,197,244,102,243,180,242,108,242,173,242,115,243,170,244,41,246,200,247,80,250,19,253,231,255,93,2,85,4,19,5,210,4,232,3, + 186,2,118,1,126,0,114,0,97,1,44,3,183,5,12,9,244,12,74,17,253,21,222,26,150,31,232,35,136,39,16,42,216,43,233,44,139,45,140,45, + 21,45,208,44,54,45,45,46,229,47,53,50,31,53,133,56,1,60,61,63,22,66,108,68,109,70,244,71,210,72,230,72,62,72,243,70,246,68,122,66, + 201,63,26,61,92,58,60,56,162,54,121,53,125,52,96,51,31,50,177,48,55,47,214,45,148,44,7,43,63,41,96,39,204,37,105,36,45,35,254,33, + 39,33,119,32,205,31,13,31,23,30,2,29,23,28,79,27,117,26,40,25,194,23,152,22,154,21,157,20,98,19,158,17,215,15,57,14,180,12,98,11, + 37,10,78,9,186,8,68,8,143,7,115,6,241,4,109,3,237,1,133,0,137,255,169,254,138,254,203,254,94,255,25,0,249,0,236,1,250,2,12,4, + 236,4,144,5,8,6,86,6,162,6,4,7,159,7,52,8,228,8,226,9,50,11,181,12,124,14,69,16,160,17,133,18,181,18,73,18,22,17,57,15, + 51,13,253,10,139,8,24,6,188,3,101,1,220,254,49,252,119,249,56,247,150,245,96,244,174,243,73,243,230,242,162,242,233,241,73,241,250,239,235,237, + 34,235,92,232,98,229,151,226,250,223,179,221,206,219,87,218,127,217,31,217,36,217,247,217,172,219,20,222,165,224,238,226,163,228,144,229,45,230,128,230, + 104,230,20,230,116,229,38,229,250,228,62,229,222,229,126,230,239,230,127,231,234,231,7,232,113,231,199,230,238,229,15,229,95,228,140,227,118,226,205,225, + 181,225,111,226,85,227,42,228,69,229,178,230,233,231,141,232,236,232,18,233,99,233,196,233,154,233,144,232,250,230,218,229,150,229,221,229,30,230,252,229, + 235,229,238,229,34,230,192,230,130,231,233,231,172,231,127,231,89,231,141,230,12,229,106,227,151,225,250,222,201,219,23,217,147,214,105,211,50,208,79,205, + 14,203,35,201,119,199,152,198,138,198,228,198,74,199,38,199,225,198,193,198,69,199,191,200,89,203,115,206,243,209,29,214,210,218,150,223,246,227,240,231, + 47,236,110,240,216,243,81,246,91,248,158,250,145,253,234,0,76,4,197,6,204,7,189,7,21,7,194,5,47,4,129,2,92,1,206,0,234,0,230,1, + 200,3,93,6,64,9,23,12,65,14,77,15,10,15,137,13,187,11,160,9,164,7,216,5,218,4,41,5,26,6,237,6,195,6,134,5,163,3,160,1, + 165,255,222,253,102,252,229,250,88,249,128,248,37,248,2,248,4,248,22,248,61,248,196,248,244,249,230,251,145,254,168,1,236,4,193,7,44,9,14,9, + 229,7,143,6,227,4,67,3,79,2,14,2,167,2,15,4,187,6,144,10,16,15,247,19,0,25,199,29,228,33,40,37,12,39,251,39,74,40,89,40, + 71,40,34,40,53,40,0,41,203,42,92,45,104,48,214,51,137,55,191,59,243,63,204,67,242,70,96,73,64,75,174,76,98,77,36,77,232,75,150,73, + 221,70,255,67,61,65,161,62,108,60,176,58,115,57,29,56,141,54,218,52,212,50,250,48,109,47,60,46,16,45,111,43,196,41,93,40,245,38,118,37, + 170,35,197,33,88,32,98,31,167,30,160,29,102,28,42,27,54,26,255,24,144,23,33,22,207,20,238,19,86,19,108,18,245,16,28,15,22,13,40,11, + 226,8,177,6,186,4,62,3,30,2,87,1,190,0,51,0,214,255,159,255,165,255,181,255,221,255,51,0,190,0,72,1,178,1,3,2,85,2,217,2, + 134,3,114,4,159,5,208,6,158,7,41,8,178,8,105,9,17,10,43,11,190,12,135,14,105,16,71,18,220,19,63,21,38,22,98,22,233,21,97,20, + 59,18,163,15,145,12,113,9,68,6,105,3,198,0,4,254,107,251,224,248,20,247,160,245,161,244,203,243,32,243,103,242,245,241,42,241,21,240,49,238, + 182,235,28,233,79,230,200,227,25,225,78,222,252,219,242,217,74,216,13,215,45,214,24,214,142,214,174,215,65,217,40,219,5,221,147,222,224,223,238,224, + 152,225,234,225,163,225,53,225,131,224,224,223,184,223,90,224,132,225,200,226,232,227,240,228,160,229,177,229,102,229,236,228,114,228,164,227,171,226,0,226, + 73,225,158,224,199,224,166,225,164,226,92,227,28,228,196,228,240,228,232,228,22,229,198,229,138,230,83,231,22,232,83,232,234,231,53,231,162,230,63,230, + 228,229,157,229,238,229,77,230,188,230,65,231,194,231,205,231,33,231,9,230,201,228,53,227,66,225,44,223,236,220,144,218,208,215,226,212,248,209,6,207, + 82,204,25,202,87,200,7,199,226,197,104,197,211,197,137,198,233,198,233,198,156,198,186,198,202,199,186,201,124,204,236,207,34,212,235,216,230,221,110,226, + 148,230,157,234,252,238,44,243,183,246,241,249,34,253,151,0,67,4,122,7,228,9,58,11,88,11,164,10,66,9,171,7,22,6,81,5,87,5,246,5, + 141,6,165,7,153,9,37,12,193,14,191,16,199,17,12,18,72,17,233,15,215,13,201,11,62,10,85,9,239,8,12,9,24,9,142,8,96,7,213,5, + 99,4,133,2,166,0,111,255,69,254,12,253,191,251,222,250,101,250,72,250,91,250,145,250,50,251,73,252,52,254,107,0,214,2,5,5,154,6,54,7, + 55,6,54,4,153,1,18,255,33,253,255,251,7,252,244,252,181,254,179,1,145,5,250,9,243,14,230,19,120,24,171,28,6,32,17,34,213,34,4,35, + 9,35,251,34,242,34,27,35,253,35,176,37,87,40,183,43,145,47,139,51,138,55,137,59,122,63,235,66,207,69,24,72,135,73,255,73,132,73,1,72, + 215,69,36,67,130,64,235,61,161,59,254,57,213,56,226,55,29,55,25,54,253,52,154,51,249,49,149,48,121,47,67,46,159,44,171,42,0,41,153,39, + 58,38,133,36,192,34,1,33,191,31,167,30,72,29,240,27,219,26,238,25,98,25,231,24,70,24,148,23,189,22,164,21,53,20,48,18,192,15,35,13, + 204,10,193,8,202,6,218,4,145,3,42,3,19,3,247,2,239,2,52,3,106,3,152,3,147,3,171,3,170,3,177,3,19,4,124,4,4,5,212,5, + 163,6,121,7,82,8,34,9,207,9,65,10,204,10,73,11,142,11,7,12,217,12,28,14,175,15,141,17,82,19,230,20,42,22,203,22,235,22,81,22, + 232,20,29,19,202,16,117,14,30,12,139,9,79,7,5,5,52,2,238,254,227,251,184,249,247,247,93,246,212,244,126,243,69,242,15,241,255,239,89,238, + 45,236,233,233,79,231,120,228,191,225,196,222,81,220,21,218,16,216,9,214,18,212,136,210,35,210,81,210,69,211,8,213,21,215,51,217,78,219,158,220, + 79,221,61,221,49,221,97,221,193,221,51,222,217,222,209,223,8,225,81,226,180,227,210,228,153,229,167,229,235,228,180,227,164,226,35,226,90,225,57,224, + 162,223,185,223,220,223,185,223,191,223,105,224,29,226,158,227,92,228,138,228,5,229,163,229,14,230,50,230,70,230,195,230,71,231,98,231,230,230,8,230, + 220,229,188,230,199,231,139,232,154,233,219,234,103,235,55,235,206,234,28,234,240,232,108,231,192,229,233,227,190,225,180,223,151,221,98,219,197,216,75,213, + 145,209,26,206,164,203,97,202,50,201,0,200,83,199,86,199,242,199,158,200,165,200,253,199,74,199,36,199,14,200,10,202,70,205,27,210,139,215,146,220, + 17,225,189,229,153,234,101,239,210,243,247,247,218,251,41,255,30,2,235,4,153,7,175,9,18,11,127,11,202,10,20,9,252,6,224,4,206,3,210,3, + 90,4,124,5,130,7,192,10,86,14,230,17,218,20,51,23,184,24,238,24,116,23,219,20,207,17,8,15,210,12,187,11,76,11,239,10,51,10,177,9, + 207,8,112,7,205,5,191,4,44,4,221,3,78,3,142,2,85,1,4,0,253,254,44,254,132,253,253,252,196,252,150,253,225,254,119,0,90,2,33,4, + 43,5,153,4,239,2,147,0,0,254,104,251,169,249,229,248,239,248,15,250,226,251,85,254,105,1,87,5,196,9,85,14,215,18,81,23,240,26,90,29, + 194,30,172,31,65,32,220,32,229,33,72,35,226,36,5,39,162,41,31,45,51,49,128,53,216,57,7,62,223,65,129,69,126,72,138,74,177,75,60,76, + 237,75,144,74,50,72,87,69,114,66,176,63,40,61,49,59,209,57,177,56,173,55,160,54,33,53,43,51,55,49,178,47,59,46,128,44,91,42,17,40, + 190,37,126,35,125,33,123,31,145,29,182,28,45,28,250,27,185,27,115,27,49,27,196,26,2,26,37,25,220,23,168,22,152,21,114,20,224,18,61,17, + 3,15,210,12,224,10,182,8,191,6,115,5,243,4,196,4,177,4,159,4,84,4,23,4,22,4,52,4,58,4,145,4,133,5,123,6,29,7,166,7, + 95,8,23,9,218,9,200,10,160,11,48,12,241,12,193,13,174,14,142,15,85,16,41,17,29,18,74,19,93,20,49,21,224,21,124,22,12,23,254,22, + 202,22,71,22,49,21,158,19,130,17,37,15,102,12,75,9,50,6,35,3,221,255,100,252,51,249,164,246,155,244,5,243,174,241,114,240,114,239,103,238, + 105,237,47,236,197,234,237,232,185,230,145,228,201,225,136,222,73,219,56,216,245,213,245,211,91,210,135,209,157,209,157,210,29,212,13,214,16,216,36,218, + 122,219,64,220,3,220,161,219,242,219,172,220,23,221,59,221,146,221,15,222,236,222,216,223,239,224,212,225,83,226,101,226,255,225,48,225,45,224,225,223, + 188,223,139,223,177,223,20,224,122,224,248,224,242,225,128,227,206,228,101,229,117,229,119,229,95,229,81,229,106,229,70,229,38,229,152,229,156,229,215,228, + 6,228,198,227,71,228,85,229,248,230,155,232,194,233,77,234,250,234,110,235,255,234,197,233,182,232,165,231,61,230,103,228,241,226,181,225,234,223,226,221, + 133,219,246,216,20,214,79,211,106,209,89,208,112,207,94,206,92,205,192,204,1,205,135,205,134,205,218,204,112,204,16,205,187,206,70,209,252,212,185,217, + 190,222,107,227,172,231,171,235,187,239,205,243,175,247,28,251,222,253,62,0,183,2,23,5,115,7,193,9,81,11,180,11,196,10,16,9,87,7,239,5, + 52,5,249,4,108,5,65,6,187,7,12,10,64,13,175,16,211,19,247,21,210,22,63,22,95,20,200,17,246,14,155,12,83,11,102,11,137,11,144,11, + 76,11,240,10,48,10,30,9,244,7,130,6,3,5,179,3,138,2,103,1,64,0,122,255,247,254,157,254,106,254,239,254,213,255,69,1,204,2,83,4, + 151,5,76,6,244,5,149,4,196,1,16,254,122,250,116,247,168,245,238,244,125,245,45,247,206,249,89,253,162,1,71,6,184,10,203,14,126,18,154,21, + 246,23,152,25,176,26,160,27,148,28,159,29,142,30,190,31,150,33,245,35,215,38,134,42,199,46,71,51,204,55,20,60,221,63,217,66,3,69,58,70, + 195,70,168,70,190,69,238,67,68,65,176,62,45,60,252,57,46,56,174,54,121,53,111,52,136,51,62,50,180,48,51,47,168,45,230,43,22,42,63,40, + 233,37,141,35,118,33,107,31,191,29,52,28,2,27,126,26,89,26,112,26,79,26,54,26,22,26,218,25,71,25,130,24,173,23,155,22,129,21,29,20, + 137,18,207,16,233,14,11,13,45,11,102,9,194,7,93,6,149,5,246,4,108,4,253,3,236,3,249,3,73,4,199,4,148,5,152,6,115,7,60,8, + 246,8,142,9,229,9,44,10,110,10,192,10,213,10,54,11,148,11,21,12,159,12,6,13,128,13,24,14,246,14,58,16,108,17,190,18,252,19,59,21, + 15,22,146,22,130,22,6,22,16,21,133,19,2,17,240,13,108,10,216,6,131,3,48,0,53,253,249,249,23,247,191,244,228,242,137,241,116,240,211,239, + 53,239,100,238,23,237,92,235,42,233,102,230,38,227,250,223,216,220,213,217,20,215,10,213,227,211,43,211,228,210,15,211,167,211,221,212,85,214,131,216, + 160,218,69,220,194,221,56,222,150,222,197,222,164,222,182,222,204,222,213,222,246,222,98,223,63,224,72,225,28,226,100,226,28,226,151,225,8,225,0,225, + 4,225,248,224,62,225,230,225,93,226,62,226,68,226,146,226,65,227,186,227,28,228,134,228,199,228,31,229,181,229,131,230,55,231,147,231,241,231,7,232, + 180,231,136,231,231,231,194,232,136,233,111,234,105,235,70,236,152,236,194,236,40,237,94,237,12,237,134,236,90,236,178,235,154,234,255,232,97,231,192,229, + 186,227,166,225,51,223,147,220,36,218,241,215,0,214,62,212,228,210,248,209,160,209,240,209,100,210,218,210,36,211,98,211,242,211,220,212,147,214,148,217, + 201,221,74,226,219,230,83,235,173,239,57,243,113,246,100,249,248,251,70,254,130,0,225,2,11,5,230,6,117,8,156,9,239,9,1,9,58,7,242,4, + 64,3,157,2,205,2,103,3,128,4,87,6,44,9,180,12,251,15,83,18,198,19,5,20,104,19,219,17,128,15,212,12,195,10,203,9,64,9,106,9, + 75,9,62,9,201,8,233,7,0,7,32,6,192,4,41,3,137,1,26,0,134,254,10,253,216,251,36,251,238,250,82,251,255,251,80,253,111,255,220,1, + 81,4,48,6,18,7,137,6,218,4,52,2,249,254,194,251,206,248,158,246,107,245,96,245,200,246,52,249,78,252,8,0,34,4,102,8,122,12,242,15, + 141,18,173,20,110,22,239,23,46,25,68,26,55,27,84,28,188,29,71,31,38,33,130,35,90,38,173,41,39,45,159,48,247,51,14,55,164,57,221,59, + 100,61,112,62,186,62,56,62,220,60,211,58,51,56,173,53,156,51,28,50,57,49,73,48,121,47,109,46,5,45,46,43,4,41,219,38,253,36,22,35, + 95,33,216,31,50,30,16,29,41,28,142,27,2,27,154,26,45,26,3,26,234,25,190,25,79,25,152,24,189,23,243,22,221,21,204,20,230,19,64,19, + 177,18,225,17,168,16,2,15,11,13,247,10,2,9,57,7,252,5,54,5,160,4,26,4,213,3,192,3,165,3,171,3,217,3,65,4,184,4,62,5, + 184,5,57,6,140,6,244,6,61,7,137,7,186,7,234,7,7,8,79,8,167,8,45,9,153,9,33,10,193,10,158,11,174,12,238,13,30,15,40,16, + 22,17,234,17,113,18,165,18,61,18,77,17,181,15,112,13,199,10,85,7,142,3,142,255,190,251,108,248,178,245,234,243,120,242,164,241,163,240,24,240, + 208,239,97,239,211,238,181,237,43,236,81,234,8,232,148,229,227,226,243,223,79,221,78,219,228,217,109,217,137,217,57,218,40,219,110,220,160,221,8,223, + 220,224,103,226,237,227,27,229,216,229,61,230,185,230,22,231,248,230,185,230,99,230,86,230,117,230,181,230,80,231,68,232,236,232,117,233,197,233,196,233, + 132,233,35,233,170,232,42,232,148,231,232,230,130,230,124,230,245,230,172,231,104,232,125,233,132,234,77,235,149,235,189,235,4,236,66,236,117,236,123,236, + 94,236,202,235,83,235,49,235,119,235,231,235,223,236,46,238,54,239,186,239,102,240,74,241,97,242,198,242,205,242,121,242,175,241,129,240,245,238,90,237, + 179,235,24,234,130,232,183,230,33,229,208,227,254,226,56,226,64,225,54,224,193,223,227,223,52,224,174,224,90,225,53,226,41,227,91,228,231,229,22,232, + 203,234,188,237,193,240,152,243,42,246,164,248,3,251,85,253,173,255,241,1,181,3,48,5,94,6,128,7,110,8,1,9,37,9,139,8,112,7,241,5, + 152,4,200,3,120,3,206,3,124,4,180,5,227,6,92,8,47,10,30,12,245,13,24,15,2,15,53,14,212,12,174,11,221,10,108,10,65,10,96,10, + 144,10,173,10,132,10,183,9,38,8,108,6,16,5,154,3,179,2,244,1,49,1,119,0,220,255,90,255,9,255,5,255,113,255,114,0,179,1,75,3, + 249,4,98,6,60,7,43,7,62,6,159,4,54,2,155,255,24,253,17,251,249,249,122,249,212,249,252,250,205,252,39,255,137,1,183,3,187,5,216,7, + 249,9,206,11,94,13,162,14,136,15,45,16,124,16,206,16,41,17,126,17,22,18,31,19,167,20,106,22,136,24,214,26,15,29,15,31,2,33,153,34, + 189,35,122,36,118,36,199,35,160,34,133,33,128,32,103,31,55,30,56,29,107,28,132,27,135,26,67,25,195,23,60,22,16,21,240,19,210,18,189,17, + 231,16,31,16,74,15,157,14,193,13,8,13,204,12,179,12,154,12,86,12,82,12,115,12,180,12,237,12,212,12,181,12,210,12,252,12,252,12,161,12, + 75,12,196,11,22,11,58,10,45,9,230,7,168,6,148,5,180,4,249,3,35,3,111,2,17,2,27,2,71,2,157,2,5,3,120,3,231,3,92,4, + 174,4,218,4,11,5,70,5,137,5,246,5,64,6,102,6,101,6,114,6,137,6,168,6,209,6,28,7,97,7,205,7,64,8,240,8,150,9,65,10, + 225,10,26,11,50,11,2,11,132,10,41,10,106,9,149,8,97,7,245,5,59,4,84,2,68,0,18,254,3,252,60,250,243,248,192,247,10,247,140,246, + 17,246,96,245,144,244,191,243,227,242,30,242,145,240,47,239,221,237,133,236,135,235,190,234,167,233,254,232,150,232,97,232,209,232,39,233,187,233,179,234, + 243,235,249,236,194,237,118,238,213,238,71,239,106,239,196,239,43,240,89,240,59,240,66,240,103,240,111,240,135,240,243,240,60,241,98,241,130,241,132,241, + 98,241,66,241,26,241,229,240,157,240,50,240,185,239,151,239,161,239,241,239,131,240,56,241,251,241,72,242,159,242,220,242,249,242,14,243,21,243,30,243, + 14,243,166,242,38,242,213,241,197,241,4,242,156,242,82,243,53,244,237,244,184,245,114,246,51,247,196,247,15,248,45,248,83,248,65,248,220,247,62,247, + 146,246,196,245,201,244,174,243,166,242,188,241,22,241,212,240,229,240,248,240,248,240,1,241,94,241,228,241,83,242,145,242,28,243,234,243,248,244,103,246, + 43,248,250,249,227,251,213,253,162,255,93,1,230,2,37,4,95,5,151,6,216,7,251,8,253,9,184,10,122,11,41,12,143,12,93,12,119,11,51,10, + 218,8,201,7,49,7,197,6,194,6,217,6,104,7,64,8,53,9,55,10,63,11,64,12,208,12,183,12,0,12,18,11,35,10,138,9,134,9,237,9, + 142,10,235,10,19,11,253,10,78,10,109,9,41,8,181,6,84,5,11,4,244,2,74,2,223,1,164,1,135,1,122,1,79,1,57,1,99,1,194,1, + 117,2,82,3,232,3,37,4,213,3,247,2,130,1,174,255,142,253,250,251,222,250,50,250,50,250,183,250,179,251,9,253,139,254,11,0,125,1,182,2, + 190,3,178,4,117,5,252,5,47,6,19,6,195,5,108,5,66,5,101,5,162,5,69,6,31,7,46,8,117,9,29,11,177,12,11,14,73,15,116,16, + 63,17,164,17,238,17,32,18,206,17,0,17,11,16,193,14,126,13,69,12,36,11,33,10,100,9,218,8,78,8,158,7,212,6,30,6,99,5,163,4, + 13,4,135,3,8,3,178,2,120,2,70,2,28,2,23,2,106,2,210,2,39,3,128,3,240,3,145,4,57,5,162,5,203,5,28,6,127,6,188,6, + 231,6,213,6,144,6,11,6,124,5,33,5,153,4,29,4,202,3,152,3,109,3,70,3,26,3,222,2,172,2,151,2,182,2,235,2,39,3,127,3, + 232,3,66,4,141,4,166,4,167,4,189,4,231,4,4,5,33,5,76,5,159,5,203,5,212,5,220,5,4,6,47,6,147,6,228,6,122,7,27,8, + 143,8,201,8,179,8,157,8,75,8,187,7,54,7,83,6,144,5,138,4,145,3,114,2,78,1,26,0,182,254,118,253,28,252,240,250,37,250,116,249, + 39,249,5,249,188,248,51,248,80,247,78,246,153,245,188,244,253,243,58,243,109,242,209,241,76,241,211,240,125,240,13,240,212,239,223,239,25,240,107,240, + 2,241,189,241,130,242,90,243,169,243,206,243,172,243,138,243,162,243,251,243,61,244,151,244,238,244,100,245,229,245,67,246,95,246,55,246,244,245,88,245, + 227,244,101,244,7,244,0,244,36,244,116,244,147,244,202,244,21,245,108,245,151,245,130,245,103,245,43,245,212,244,158,244,191,244,248,244,46,245,140,245, + 214,245,186,245,148,245,125,245,165,245,86,246,23,247,229,247,178,248,65,249,201,249,89,250,7,251,168,251,7,252,75,252,60,252,17,252,198,251,103,251, + 39,251,11,251,223,250,151,250,87,250,83,250,118,250,179,250,230,250,88,251,189,251,245,251,23,252,60,252,114,252,151,252,196,252,35,253,214,253,189,254, + 228,255,60,1,185,2,19,4,68,5,72,6,103,7,88,8,57,9,222,9,120,10,30,11,241,11,181,12,125,13,236,13,41,14,29,14,190,13,17,13, + 39,12,252,10,229,9,251,8,79,8,13,8,194,7,158,7,70,8,41,9,2,10,220,10,54,11,48,11,247,10,139,10,249,9,135,9,203,8,125,8, + 52,8,238,7,143,7,57,7,238,6,253,6,17,7,17,7,223,6,143,6,3,6,113,5,184,4,18,4,125,3,6,3,248,2,193,2,156,2,161,2, + 114,2,34,2,223,1,86,1,127,0,158,255,166,254,189,253,235,252,35,252,140,251,60,251,251,250,31,251,151,251,75,252,78,253,137,254,230,255,21,1, + 42,2,218,2,87,3,93,3,8,3,110,2,179,1,231,0,32,0,134,255,41,255,47,255,181,255,141,0,118,1,102,2,53,3,188,3,251,3,40,4, + 112,4,162,4,185,4,227,4,206,4,130,4,38,4,143,3,165,2,172,1,234,0,91,0,159,255,25,255,225,254,159,254,116,254,137,254,120,254,87,254, + 65,254,228,253,134,253,236,252,82,252,223,251,197,251,252,251,74,252,190,252,113,253,112,254,55,255,227,255,111,0,191,0,9,1,114,1,222,1,48,2, + 138,2,255,2,143,3,211,3,175,3,109,3,53,3,232,2,194,2,201,2,215,2,1,3,63,3,117,3,118,3,70,3,225,2,140,2,103,2,99,2, + 89,2,75,2,117,2,214,2,30,3,100,3,168,3,225,3,37,4,77,4,85,4,81,4,73,4,84,4,102,4,135,4,232,4,51,5,134,5,207,5, + 228,5,228,5,199,5,147,5,75,5,12,5,189,4,117,4,247,3,89,3,194,2,255,1,47,1,107,0,130,255,239,254,127,254,27,254,185,253,39,253, + 120,252,232,251,94,251,215,250,139,250,101,250,3,250,169,249,221,248,52,248,196,247,203,246,45,246,136,245,255,244,188,244,172,244,223,244,11,245,36,245, + 104,245,252,245,154,246,239,246,53,247,121,247,124,247,146,247,123,247,53,247,35,247,6,247,110,247,4,248,98,248,181,248,200,248,177,248,76,248,208,247, + 96,247,22,247,212,246,160,246,156,246,160,246,221,246,40,247,113,247,168,247,178,247,161,247,128,247,100,247,63,247,66,247,80,247,77,247,102,247,154,247, + 254,247,83,248,137,248,246,248,87,249,214,249,104,250,249,250,121,251,202,251,70,252,194,252,110,253,22,254,166,254,243,254,25,255,54,255,58,255,5,255, + 159,254,73,254,33,254,16,254,49,254,115,254,234,254,142,255,15,0,143,0,240,0,97,1,175,1,241,1,92,2,181,2,235,2,27,3,93,3,214,3, + 138,4,131,5,119,6,125,7,104,8,67,9,239,9,91,10,134,10,188,10,18,11,141,11,246,11,29,12,90,12,156,12,26,13,94,13,74,13,219,12, + 95,12,228,11,93,11,164,10,208,9,91,9,59,9,59,9,92,9,170,9,197,9,23,10,73,10,35,10,236,9,127,9,27,9,179,8,135,8,84,8, + 225,7,151,7,31,7,198,6,69,6,217,5,79,5,228,4,163,4,213,4,247,4,52,5,111,5,40,5,217,4,90,4,197,3,46,3,133,2,28,2, + 223,1,164,1,75,1,166,0,226,255,29,255,99,254,128,253,133,252,173,251,226,250,111,250,83,250,118,250,27,251,9,252,70,253,108,254,130,255,60,0, + 168,0,241,0,17,1,24,1,230,0,125,0,10,0,102,255,209,254,106,254,51,254,12,254,24,254,62,254,130,254,162,254,170,254,5,255,141,255,217,255, + 0,0,228,255,148,255,44,255,199,254,42,254,118,253,240,252,196,252,165,252,143,252,139,252,79,252,2,252,154,251,56,251,172,250,53,250,246,249,199,249, + 199,249,221,249,10,250,44,250,89,250,140,250,197,250,6,251,93,251,166,251,247,251,103,252,237,252,123,253,58,254,39,255,205,255,94,0,202,0,51,1, + 133,1,204,1,32,2,118,2,211,2,26,3,88,3,121,3,109,3,92,3,99,3,132,3,141,3,157,3,142,3,116,3,73,3,251,2,131,2,31,2, + 208,1,178,1,141,1,114,1,103,1,105,1,126,1,154,1,202,1,233,1,14,2,63,2,107,2,124,2,140,2,186,2,37,3,95,3,136,3,116,3, + 118,3,174,3,210,3,22,4,2,4,231,3,153,3,3,3,93,2,166,1,234,0,79,0,250,255,205,255,145,255,127,255,84,255,54,255,250,254,191,254, + 159,254,127,254,58,254,244,253,152,253,75,253,5,253,189,252,114,252,20,252,101,251,109,250,144,249,216,248,99,248,61,248,1,248,190,247,220,247,37,248, + 121,248,227,248,54,249,94,249,165,249,250,249,57,250,112,250,96,250,65,250,37,250,230,249,165,249,73,249,32,249,26,249,73,249,105,249,98,249,93,249, + 91,249,77,249,86,249,70,249,84,249,136,249,142,249,134,249,119,249,72,249,11,249,177,248,94,248,52,248,29,248,91,248,164,248,239,248,19,249,62,249, + 94,249,100,249,124,249,184,249,255,249,155,250,72,251,30,252,255,252,208,253,91,254,243,254,105,255,217,255,51,0,105,0,145,0,184,0,227,0,11,1, + 39,1,28,1,15,1,240,0,198,0,212,0,233,0,14,1,89,1,169,1,222,1,71,2,183,2,67,3,220,3,96,4,171,4,241,4,45,5,151,5, + 53,6,206,6,99,7,226,7,95,8,247,8,124,9,235,9,119,10,229,10,36,11,47,11,56,11,61,11,72,11,50,11,37,11,40,11,26,11,25,11, + 199,10,83,10,226,9,154,9,132,9,143,9,163,9,201,9,246,9,31,10,23,10,218,9,131,9,9,9,149,8,43,8,165,7,235,6,73,6,174,5, + 84,5,44,5,15,5,241,4,227,4,211,4,180,4,124,4,62,4,243,3,189,3,139,3,135,3,196,3,185,3,159,3,99,3,248,2,126,2,23,2, + 175,1,89,1,27,1,193,0,73,0,180,255,254,254,20,254,45,253,78,252,139,251,11,251,202,250,224,250,97,251,43,252,13,253,202,253,121,254,235,254, + 76,255,113,255,140,255,174,255,194,255,187,255,246,255,244,255,196,255,123,255,39,255,211,254,142,254,84,254,55,254,31,254,1,254,208,253,153,253,63,253, + 211,252,164,252,133,252,61,252,220,251,93,251,206,250,104,250,3,250,178,249,122,249,109,249,142,249,162,249,167,249,123,249,43,249,207,248,128,248,79,248, + 40,248,43,248,123,248,252,248,155,249,58,250,234,250,136,251,14,252,106,252,149,252,176,252,236,252,28,253,110,253,233,253,106,254,253,254,129,255,0,0, + 133,0,234,0,72,1,151,1,209,1,0,2,25,2,111,2,215,2,28,3,88,3,89,3,49,3,254,2,189,2,117,2,52,2,241,1,202,1,164,1, + 126,1,78,1,255,0,197,0,140,0,108,0,62,0,19,0,235,255,209,255,208,255,234,255,29,0,129,0,248,0,89,1,141,1,128,1,90,1,79,1, + 75,1,92,1,132,1,132,1,139,1,135,1,96,1,21,1,172,0,69,0,241,255,187,255,116,255,69,255,62,255,34,255,58,255,106,255,123,255,151,255, + 142,255,129,255,162,255,191,255,203,255,195,255,166,255,105,255,249,254,134,254,244,253,120,253,34,253,186,252,125,252,254,251,153,251,68,251,75,251,43,251, + 79,251,112,251,161,251,18,252,99,252,127,252,145,252,74,252,52,252,31,252,23,252,205,251,142,251,117,251,82,251,67,251,43,251,223,250,165,250,159,250, + 191,250,235,250,6,251,28,251,61,251,93,251,50,251,252,250,144,250,31,250,227,249,158,249,134,249,130,249,165,249,190,249,255,249,44,250,60,250,109,250, + 159,250,169,250,181,250,204,250,17,251,126,251,255,251,174,252,113,253,38,254,210,254,140,255,39,0,168,0,17,1,126,1,209,1,35,2,90,2,132,2, + 161,2,207,2,250,2,45,3,62,3,51,3,37,3,3,3,225,2,215,2,236,2,17,3,116,3,221,3,95,4,218,4,62,5,183,5,105,6,240,6, + 126,7,225,7,48,8,128,8,197,8,251,8,44,9,75,9,150,9,244,9,63,10,114,10,144,10,130,10,149,10,166,10,148,10,74,10,249,9,174,9, + 121,9,67,9,8,9,212,8,210,8,214,8,3,9,41,9,75,9,102,9,96,9,74,9,3,9,172,8,50,8,118,7,158,6,207,5,15,5,145,4, + 76,4,250,3,218,3,243,3,12,4,253,3,246,3,210,3,159,3,139,3,64,3,182,2,23,2,137,1,22,1,212,0,162,0,155,0,223,0,17,1, + 76,1,65,1,4,1,163,0,101,0,0,0,152,255,50,255,169,254,49,254,174,253,49,253,218,252,192,252,182,252,214,252,30,253,95,253,159,253,197,253, + 231,253,26,254,76,254,108,254,153,254,187,254,200,254,205,254,214,254,169,254,135,254,126,254,76,254,41,254,239,253,138,253,38,253,163,252,63,252,243,251, + 146,251,46,251,217,250,140,250,64,250,60,250,12,250,190,249,75,249,198,248,40,248,131,247,247,246,150,246,114,246,160,246,243,246,48,247,130,247,185,247, + 250,247,34,248,80,248,115,248,214,248,86,249,6,250,155,250,47,251,196,251,82,252,232,252,78,253,171,253,244,253,34,254,84,254,112,254,174,254,254,254, + 98,255,198,255,51,0,144,0,11,1,111,1,198,1,16,2,48,2,66,2,107,2,140,2,158,2,146,2,110,2,56,2,237,1,136,1,61,1,244,0, + 205,0,199,0,190,0,169,0,119,0,40,0,196,255,75,255,221,254,163,254,144,254,175,254,209,254,19,255,69,255,94,255,97,255,75,255,119,255,154,255, + 195,255,178,255,149,255,140,255,101,255,69,255,9,255,221,254,203,254,232,254,227,254,223,254,229,254,0,255,16,255,33,255,55,255,75,255,91,255,91,255, + 104,255,147,255,184,255,238,255,47,0,107,0,150,0,155,0,133,0,98,0,3,0,140,255,25,255,178,254,113,254,49,254,5,254,236,253,231,253,207,253, + 186,253,177,253,153,253,153,253,107,253,63,253,57,253,78,253,71,253,91,253,63,253,20,253,244,252,217,252,211,252,183,252,164,252,133,252,124,252,111,252, + 89,252,70,252,50,252,60,252,34,252,2,252,218,251,169,251,126,251,100,251,67,251,56,251,90,251,122,251,139,251,151,251,153,251,136,251,154,251,164,251, + 202,251,7,252,73,252,157,252,3,253,124,253,233,253,73,254,175,254,34,255,163,255,33,0,186,0,76,1,223,1,131,2,46,3,185,3,41,4,88,4, + 126,4,142,4,162,4,141,4,108,4,78,4,69,4,120,4,146,4,167,4,206,4,243,4,25,5,63,5,108,5,145,5,174,5,244,5,54,6,140,6, + 2,7,130,7,3,8,96,8,142,8,197,8,215,8,9,9,71,9,131,9,106,9,81,9,118,9,131,9,160,9,167,9,149,9,157,9,146,9,125,9, + 62,9,243,8,186,8,144,8,79,8,254,7,159,7,115,7,87,7,115,7,141,7,175,7,201,7,158,7,75,7,158,6,224,5,241,4,88,4,202,3, + 116,3,110,3,135,3,121,3,103,3,57,3,38,3,5,3,232,2,149,2,57,2,222,1,121,1,7,1,165,0,65,0,217,255,201,255,199,255,202,255, + 228,255,14,0,62,0,120,0,127,0,94,0,40,0,227,255,130,255,41,255,231,254,192,254,146,254,103,254,62,254,243,253,188,253,143,253,103,253,88,253, + 89,253,103,253,107,253,114,253,114,253,124,253,120,253,96,253,44,253,5,253,246,252,26,253,19,253,197,252,128,252,77,252,49,252,21,252,209,251,137,251, + 114,251,117,251,96,251,32,251,193,250,78,250,209,249,80,249,196,248,62,248,175,247,80,247,2,247,190,246,125,246,75,246,73,246,136,246,255,246,127,247, + 5,248,177,248,97,249,234,249,90,250,129,250,165,250,208,250,57,251,197,251,93,252,247,252,161,253,34,254,162,254,243,254,66,255,131,255,201,255,253,255, + 40,0,64,0,94,0,173,0,13,1,104,1,211,1,43,2,110,2,131,2,115,2,52,2,230,1,153,1,114,1,103,1,103,1,117,1,130,1,107,1, + 51,1,216,0,134,0,55,0,235,255,144,255,59,255,0,255,211,254,157,254,113,254,81,254,56,254,31,254,9,254,232,253,226,253,228,253,243,253,240,253, + 1,254,242,253,251,253,238,253,8,254,0,254,24,254,23,254,18,254,6,254,44,254,60,254,81,254,139,254,171,254,224,254,246,254,252,254,249,254,246,254, + 9,255,51,255,130,255,185,255,1,0,36,0,66,0,87,0,86,0,65,0,58,0,17,0,14,0,235,255,173,255,80,255,7,255,196,254,189,254,180,254, + 162,254,159,254,151,254,113,254,48,254,4,254,229,253,207,253,202,253,193,253,210,253,225,253,232,253,229,253,231,253,181,253,161,253,154,253,153,253,166,253, + 163,253,156,253,120,253,80,253,6,253,165,252,73,252,234,251,194,251,190,251,215,251,252,251,46,252,102,252,110,252,103,252,71,252,63,252,60,252,78,252, + 124,252,186,252,27,253,116,253,240,253,101,254,198,254,68,255,192,255,39,0,115,0,187,0,22,1,123,1,226,1,115,2,235,2,89,3,171,3,250,3, + 56,4,123,4,181,4,217,4,1,5,0,5,0,5,27,5,40,5,66,5,131,5,216,5,43,6,115,6,147,6,156,6,147,6,138,6,122,6,129,6, + 163,6,191,6,224,6,45,7,128,7,201,7,31,8,93,8,126,8,129,8,131,8,165,8,179,8,180,8,208,8,17,9,59,9,91,9,87,9,32,9, + 236,8,182,8,113,8,18,8,130,7,223,6,152,6,46,6,225,5,145,5,122,5,91,5,81,5,50,5,214,4,103,4,251,3,111,3,12,3,189,2, + 135,2,99,2,56,2,35,2,234,1,193,1,168,1,94,1,58,1,245,0,202,0,163,0,108,0,65,0,26,0,238,255,209,255,142,255,77,255,43,255, + 254,254,241,254,44,255,124,255,208,255,21,0,55,0,62,0,18,0,198,255,137,255,75,255,66,255,73,255,62,255,61,255,33,255,21,255,242,254,206,254, + 135,254,83,254,29,254,226,253,179,253,91,253,21,253,237,252,210,252,176,252,121,252,46,252,211,251,146,251,148,251,151,251,169,251,209,251,36,252,122,252, + 181,252,160,252,103,252,24,252,164,251,36,251,122,250,180,249,28,249,174,248,92,248,43,248,8,248,245,247,12,248,44,248,37,248,31,248,23,248,49,248, + 113,248,216,248,83,249,221,249,121,250,35,251,223,251,113,252,221,252,53,253,107,253,164,253,224,253,27,254,108,254,209,254,76,255,191,255,40,0,107,0, + 143,0,159,0,191,0,211,0,229,0,0,1,24,1,51,1,58,1,56,1,64,1,67,1,75,1,85,1,83,1,76,1,50,1,21,1,235,0,217,0, + 204,0,168,0,130,0,54,0,205,255,109,255,23,255,191,254,112,254,45,254,244,253,186,253,156,253,125,253,81,253,27,253,205,252,165,252,138,252,117,252, + 104,252,106,252,140,252,182,252,217,252,235,252,2,253,46,253,94,253,141,253,178,253,210,253,236,253,15,254,38,254,59,254,87,254,112,254,163,254,214,254, + 21,255,72,255,131,255,163,255,219,255,15,0,65,0,91,0,108,0,105,0,108,0,108,0,102,0,84,0,71,0,69,0,51,0,15,0,199,255,98,255, + 9,255,207,254,173,254,167,254,169,254,177,254,164,254,130,254,131,254,167,254,171,254,167,254,155,254,153,254,145,254,167,254,195,254,202,254,178,254,157,254, + 141,254,130,254,126,254,85,254,44,254,20,254,217,253,136,253,60,253,5,253,228,252,233,252,235,252,241,252,241,252,244,252,250,252,6,253,24,253,33,253, + 67,253,138,253,214,253,66,254,188,254,43,255,160,255,32,0,130,0,237,0,105,1,225,1,86,2,178,2,255,2,49,3,98,3,128,3,167,3,195,3, + 226,3,20,4,92,4,204,4,55,5,148,5,219,5,17,6,58,6,101,6,155,6,195,6,210,6,253,6,46,7,79,7,94,7,115,7,112,7,76,7, + 53,7,50,7,36,7,17,7,27,7,39,7,69,7,75,7,130,7,223,7,13,8,61,8,97,8,151,8,182,8,234,8,251,8,218,8,172,8,99,8, + 57,8,225,7,105,7,0,7,144,6,30,6,183,5,83,5,246,4,145,4,29,4,179,3,88,3,9,3,200,2,142,2,108,2,57,2,251,1,179,1, + 153,1,105,1,81,1,33,1,248,0,198,0,127,0,105,0,55,0,253,255,242,255,206,255,202,255,191,255,173,255,137,255,116,255,95,255,72,255,34,255, + 3,255,238,254,254,254,34,255,84,255,131,255,192,255,226,255,242,255,252,255,241,255,232,255,252,255,6,0,242,255,217,255,206,255,205,255,188,255,156,255, + 115,255,55,255,227,254,103,254,239,253,134,253,24,253,178,252,81,252,230,251,147,251,70,251,13,251,216,250,206,250,229,250,13,251,61,251,117,251,161,251, + 204,251,236,251,222,251,158,251,81,251,251,250,127,250,7,250,155,249,50,249,218,248,160,248,124,248,110,248,108,248,153,248,236,248,57,249,119,249,154,249, + 167,249,169,249,176,249,219,249,31,250,173,250,108,251,70,252,9,253,177,253,41,254,113,254,148,254,169,254,184,254,207,254,242,254,40,255,112,255,176,255, + 216,255,10,0,75,0,144,0,197,0,226,0,234,0,230,0,233,0,204,0,176,0,155,0,150,0,162,0,175,0,180,0,172,0,173,0,159,0,129,0, + 51,0,228,255,159,255,119,255,93,255,75,255,18,255,200,254,116,254,19,254,196,253,114,253,56,253,30,253,239,252,208,252,157,252,107,252,77,252,30,252, + 248,251,211,251,197,251,186,251,186,251,227,251,16,252,102,252,179,252,10,253,88,253,146,253,188,253,220,253,239,253,12,254,56,254,85,254,148,254,223,254, + 69,255,156,255,230,255,24,0,69,0,105,0,114,0,118,0,102,0,98,0,107,0,111,0,123,0,116,0,102,0,69,0,29,0,4,0,3,0,248,255, + 206,255,177,255,112,255,58,255,29,255,245,254,15,255,62,255,95,255,133,255,167,255,141,255,120,255,117,255,90,255,65,255,47,255,33,255,52,255,70,255, + 95,255,95,255,43,255,12,255,247,254,234,254,224,254,151,254,109,254,90,254,49,254,33,254,243,253,178,253,152,253,148,253,145,253,127,253,130,253,153,253, + 226,253,48,254,135,254,235,254,79,255,187,255,51,0,168,0,27,1,147,1,244,1,72,2,142,2,218,2,28,3,56,3,59,3,44,3,41,3,63,3, + 114,3,167,3,235,3,59,4,126,4,223,4,59,5,165,5,15,6,94,6,183,6,248,6,46,7,68,7,96,7,117,7,162,7,194,7,200,7,220,7, + 216,7,200,7,194,7,153,7,96,7,86,7,78,7,89,7,105,7,122,7,155,7,225,7,43,8,96,8,142,8,147,8,143,8,122,8,67,8,247,7, + 136,7,248,6,118,6,32,6,198,5,120,5,55,5,210,4,108,4,4,4,181,3,75,3,218,2,120,2,16,2,166,1,96,1,38,1,9,1,244,0, + 217,0,208,0,170,0,109,0,50,0,242,255,170,255,115,255,84,255,63,255,69,255,52,255,58,255,44,255,23,255,242,254,202,254,191,254,188,254,191,254, + 193,254,210,254,220,254,243,254,29,255,79,255,130,255,149,255,165,255,191,255,212,255,237,255,241,255,248,255,24,0,66,0,73,0,97,0,87,0,47,0, + 8,0,201,255,137,255,58,255,192,254,42,254,139,253,254,252,132,252,32,252,194,251,97,251,17,251,215,250,134,250,103,250,85,250,115,250,152,250,179,250, + 190,250,190,250,194,250,213,250,219,250,216,250,198,250,180,250,150,250,122,250,69,250,40,250,6,250,252,249,36,250,65,250,87,250,98,250,121,250,159,250, + 188,250,215,250,0,251,71,251,153,251,234,251,46,252,117,252,196,252,52,253,179,253,58,254,162,254,234,254,36,255,75,255,93,255,105,255,94,255,97,255, + 112,255,148,255,188,255,239,255,39,0,116,0,181,0,234,0,0,1,247,0,211,0,157,0,105,0,54,0,6,0,223,255,202,255,208,255,202,255,169,255, + 138,255,75,255,0,255,177,254,112,254,72,254,37,254,29,254,37,254,23,254,242,253,171,253,116,253,44,253,219,252,158,252,97,252,67,252,71,252,96,252, + 95,252,85,252,73,252,31,252,25,252,13,252,20,252,59,252,120,252,182,252,19,253,92,253,146,253,200,253,242,253,42,254,90,254,121,254,171,254,221,254, + 34,255,102,255,183,255,244,255,61,0,122,0,162,0,176,0,159,0,154,0,158,0,150,0,140,0,141,0,108,0,69,0,55,0,32,0,25,0,1,0, + 12,0,18,0,22,0,22,0,1,0,231,255,196,255,183,255,219,255,14,0,72,0,89,0,98,0,48,0,250,255,217,255,176,255,162,255,129,255,133,255, + 160,255,185,255,224,255,239,255,238,255,213,255,165,255,145,255,93,255,57,255,26,255,47,255,57,255,22,255,207,254,121,254,48,254,251,253,11,254,33,254, + 72,254,123,254,216,254,44,255,134,255,216,255,57,0,157,0,248,0,85,1,190,1,43,2,139,2,214,2,253,2,20,3,31,3,49,3,67,3,75,3, + 96,3,160,3,222,3,30,4,87,4,121,4,170,4,217,4,29,5,120,5,219,5,58,6,123,6,201,6,252,6,17,7,46,7,42,7,50,7,72,7, + 100,7,132,7,144,7,165,7,168,7,162,7,194,7,168,7,161,7,162,7,161,7,122,7,68,7,42,7,32,7,45,7,65,7,82,7,61,7,18,7, + 219,6,134,6,40,6,178,5,37,5,149,4,19,4,152,3,57,3,2,3,218,2,219,2,203,2,133,2,23,2,136,1,7,1,133,0,48,0,253,255, + 244,255,212,255,221,255,199,255,191,255,178,255,159,255,144,255,127,255,105,255,98,255,88,255,83,255,72,255,62,255,62,255,40,255,14,255,238,254,220,254, + 205,254,216,254,1,255,21,255,50,255,69,255,86,255,113,255,147,255,147,255,137,255,129,255,145,255,163,255,173,255,174,255,188,255,206,255,241,255,15,0, + 21,0,248,255,187,255,112,255,16,255,166,254,60,254,206,253,109,253,19,253,175,252,78,252,7,252,175,251,65,251,216,250,111,250,17,250,237,249,228,249, + 249,249,54,250,104,250,163,250,213,250,233,250,251,250,229,250,253,250,50,251,110,251,165,251,211,251,229,251,244,251,248,251,16,252,14,252,6,252,248,251, + 251,251,18,252,38,252,66,252,124,252,205,252,30,253,105,253,154,253,171,253,178,253,204,253,240,253,37,254,94,254,174,254,254,254,65,255,109,255,133,255, + 123,255,106,255,105,255,104,255,115,255,165,255,235,255,72,0,147,0,187,0,194,0,168,0,109,0,46,0,219,255,145,255,75,255,40,255,7,255,239,254, + 228,254,192,254,152,254,102,254,49,254,253,253,190,253,148,253,134,253,127,253,107,253,102,253,99,253,73,253,27,253,217,252,114,252,57,252,32,252,41,252, + 57,252,84,252,113,252,110,252,106,252,75,252,63,252,56,252,81,252,131,252,193,252,255,252,87,253,161,253,221,253,12,254,52,254,120,254,171,254,247,254, + 72,255,151,255,250,255,64,0,122,0,154,0,181,0,176,0,177,0,172,0,180,0,176,0,179,0,166,0,173,0,170,0,175,0,183,0,145,0,134,0, + 136,0,132,0,152,0,172,0,176,0,180,0,180,0,180,0,154,0,133,0,129,0,141,0,147,0,136,0,141,0,94,0,39,0,248,255,212,255,230,255, + 234,255,11,0,54,0,87,0,101,0,98,0,71,0,25,0,231,255,198,255,209,255,232,255,231,255,227,255,239,255,206,255,160,255,88,255,33,255,254,254, + 4,255,40,255,80,255,158,255,230,255,64,0,136,0,169,0,222,0,13,1,75,1,151,1,229,1,59,2,129,2,217,2,17,3,51,3,55,3,41,3, + 46,3,93,3,125,3,168,3,208,3,217,3,239,3,8,4,23,4,62,4,87,4,160,4,1,5,119,5,205,5,8,6,64,6,104,6,126,6,133,6, + 137,6,162,6,180,6,212,6,252,6,27,7,72,7,86,7,50,7,251,6,162,6,65,6,244,5,188,5,141,5,97,5,41,5,249,4,234,4,206,4, + 192,4,188,4,182,4,146,4,69,4,228,3,110,3,241,2,96,2,252,1,208,1,184,1,212,1,222,1,189,1,94,1,251,0,115,0,238,255,133,255, + 63,255,16,255,3,255,5,255,29,255,95,255,131,255,144,255,136,255,116,255,90,255,84,255,75,255,59,255,61,255,75,255,106,255,134,255,141,255,149,255, + 142,255,156,255,145,255,122,255,105,255,87,255,93,255,84,255,97,255,113,255,162,255,210,255,250,255,248,255,235,255,202,255,176,255,134,255,84,255,50,255, + 47,255,69,255,72,255,41,255,0,255,211,254,170,254,101,254,9,254,178,253,92,253,255,252,150,252,35,252,178,251,79,251,3,251,208,250,176,250,144,250, + 108,250,85,250,89,250,93,250,108,250,123,250,177,250,247,250,46,251,94,251,154,251,191,251,234,251,75,252,146,252,200,252,255,252,42,253,89,253,128,253, + 128,253,131,253,127,253,121,253,112,253,114,253,134,253,163,253,190,253,229,253,249,253,253,253,1,254,4,254,8,254,18,254,38,254,70,254,120,254,181,254, + 231,254,30,255,76,255,109,255,160,255,194,255,196,255,205,255,216,255,212,255,217,255,235,255,250,255,242,255,226,255,183,255,124,255,69,255,7,255,213,254, + 180,254,128,254,84,254,37,254,8,254,226,253,202,253,182,253,189,253,185,253,167,253,167,253,148,253,125,253,94,253,49,253,27,253,13,253,15,253,1,253, + 9,253,13,253,5,253,17,253,5,253,251,252,255,252,251,252,254,252,27,253,64,253,112,253,152,253,196,253,246,253,40,254,81,254,116,254,156,254,228,254, + 44,255,112,255,209,255,36,0,122,0,176,0,201,0,201,0,191,0,199,0,184,0,206,0,206,0,224,0,233,0,2,1,7,1,6,1,7,1,9,1, + 17,1,9,1,25,1,29,1,21,1,22,1,13,1,14,1,0,1,212,0,183,0,114,0,61,0,25,0,255,255,10,0,29,0,65,0,78,0,84,0, + 82,0,82,0,115,0,101,0,93,0,87,0,84,0,90,0,82,0,96,0,82,0,86,0,105,0,125,0,145,0,154,0,159,0,136,0,87,0,39,0, + 226,255,185,255,184,255,216,255,244,255,28,0,64,0,100,0,129,0,169,0,209,0,27,1,108,1,219,1,72,2,178,2,15,3,66,3,96,3,128,3, + 139,3,146,3,175,3,185,3,192,3,213,3,244,3,249,3,250,3,6,4,29,4,45,4,73,4,110,4,166,4,0,5,66,5,130,5,178,5,214,5, + 10,6,50,6,76,6,97,6,101,6,123,6,126,6,129,6,98,6,75,6,19,6,221,5,137,5,65,5,225,4,146,4,77,4,0,4,189,3,125,3, + 75,3,28,3,5,3,215,2,199,2,176,2,164,2,120,2,66,2,241,1,151,1,65,1,234,0,163,0,126,0,66,0,24,0,230,255,178,255,109,255, + 37,255,250,254,196,254,182,254,187,254,206,254,205,254,228,254,241,254,243,254,252,254,18,255,51,255,113,255,167,255,202,255,223,255,239,255,4,0,6,0, + 7,0,255,255,241,255,224,255,212,255,201,255,180,255,166,255,154,255,174,255,198,255,252,255,33,0,65,0,65,0,35,0,246,255,220,255,166,255,123,255, + 76,255,47,255,0,255,246,254,232,254,206,254,184,254,138,254,70,254,2,254,186,253,112,253,46,253,214,252,142,252,92,252,49,252,28,252,2,252,216,251, + 193,251,166,251,136,251,104,251,75,251,42,251,25,251,27,251,42,251,67,251,104,251,166,251,255,251,99,252,196,252,33,253,121,253,202,253,13,254,67,254, + 108,254,135,254,163,254,181,254,181,254,167,254,149,254,119,254,98,254,77,254,56,254,33,254,27,254,30,254,48,254,56,254,65,254,76,254,77,254,91,254, + 113,254,135,254,171,254,217,254,14,255,73,255,98,255,124,255,117,255,113,255,83,255,77,255,65,255,39,255,43,255,54,255,57,255,66,255,66,255,50,255, + 15,255,223,254,164,254,105,254,55,254,6,254,228,253,210,253,185,253,164,253,154,253,141,253,135,253,113,253,94,253,99,253,109,253,123,253,112,253,98,253, + 88,253,81,253,88,253,103,253,134,253,153,253,172,253,182,253,199,253,207,253,224,253,0,254,29,254,59,254,98,254,139,254,187,254,223,254,30,255,75,255, + 140,255,210,255,8,0,69,0,100,0,115,0,139,0,152,0,161,0,176,0,194,0,204,0,224,0,249,0,29,1,51,1,92,1,133,1,157,1,183,1, + 200,1,197,1,180,1,165,1,140,1,125,1,121,1,89,1,64,1,31,1,238,0,181,0,118,0,54,0,3,0,228,255,228,255,245,255,24,0,68,0, + 94,0,91,0,72,0,54,0,51,0,54,0,46,0,54,0,79,0,120,0,159,0,170,0,186,0,175,0,183,0,188,0,215,0,224,0,233,0,219,0, + 206,0,148,0,91,0,36,0,0,0,241,255,249,255,22,0,68,0,127,0,198,0,255,0,85,1,147,1,234,1,34,2,85,2,154,2,219,2,28,3, + 96,3,159,3,183,3,220,3,251,3,38,4,58,4,55,4,41,4,29,4,18,4,9,4,9,4,20,4,74,4,126,4,202,4,27,5,81,5,142,5, + 173,5,183,5,202,5,213,5,230,5,237,5,228,5,201,5,183,5,144,5,122,5,91,5,43,5,228,4,144,4,40,4,200,3,118,3,24,3,200,2, + 104,2,27,2,200,1,125,1,76,1,33,1,21,1,10,1,20,1,28,1,244,0,183,0,97,0,17,0,181,255,102,255,50,255,15,255,247,254,238,254, + 235,254,229,254,211,254,195,254,169,254,134,254,117,254,101,254,88,254,110,254,159,254,195,254,250,254,48,255,94,255,122,255,144,255,165,255,178,255,174,255, + 173,255,173,255,165,255,140,255,134,255,129,255,130,255,140,255,178,255,219,255,232,255,248,255,6,0,14,0,29,0,24,0,0,0,248,255,234,255,198,255, + 149,255,98,255,65,255,21,255,211,254,152,254,88,254,16,254,203,253,171,253,132,253,100,253,85,253,82,253,88,253,98,253,74,253,48,253,243,252,215,252, + 199,252,183,252,187,252,168,252,160,252,138,252,133,252,106,252,71,252,54,252,60,252,73,252,103,252,142,252,197,252,28,253,130,253,221,253,40,254,92,254, + 134,254,173,254,216,254,0,255,30,255,54,255,58,255,70,255,61,255,43,255,16,255,249,254,229,254,213,254,200,254,187,254,167,254,130,254,103,254,87,254, + 70,254,83,254,110,254,128,254,139,254,142,254,133,254,123,254,121,254,116,254,108,254,115,254,138,254,180,254,202,254,227,254,241,254,249,254,235,254,223,254, + 192,254,180,254,152,254,134,254,102,254,69,254,41,254,249,253,211,253,186,253,166,253,125,253,94,253,70,253,63,253,60,253,46,253,63,253,81,253,102,253, + 116,253,125,253,132,253,113,253,112,253,124,253,142,253,190,253,249,253,40,254,94,254,138,254,157,254,170,254,184,254,213,254,246,254,52,255,112,255,165,255, + 224,255,19,0,50,0,57,0,93,0,118,0,130,0,148,0,150,0,141,0,159,0,186,0,213,0,242,0,17,1,60,1,108,1,150,1,189,1,202,1, + 193,1,187,1,169,1,150,1,125,1,99,1,68,1,45,1,18,1,251,0,212,0,180,0,134,0,90,0,68,0,32,0,255,255,223,255,198,255,178,255, + 195,255,191,255,201,255,202,255,220,255,234,255,6,0,58,0,104,0,126,0,151,0,190,0,217,0,0,1,21,1,36,1,35,1,29,1,27,1,22,1, + 20,1,27,1,252,0,241,0,219,0,194,0,155,0,141,0,158,0,204,0,21,1,79,1,100,1,133,1,171,1,191,1,222,1,254,1,30,2,74,2, + 153,2,229,2,41,3,118,3,156,3,195,3,231,3,253,3,20,4,37,4,33,4,37,4,56,4,48,4,63,4,78,4,84,4,98,4,109,4,130,4, + 155,4,199,4,242,4,8,5,11,5,239,4,218,4,204,4,185,4,166,4,141,4,113,4,76,4,31,4,236,3,160,3,67,3,240,2,142,2,66,2, + 219,1,140,1,60,1,238,0,159,0,97,0,57,0,32,0,24,0,12,0,6,0,237,255,199,255,136,255,77,255,18,255,223,254,198,254,178,254,167,254, + 157,254,157,254,138,254,123,254,112,254,69,254,62,254,78,254,92,254,115,254,134,254,156,254,187,254,232,254,21,255,62,255,104,255,112,255,119,255,108,255, + 90,255,72,255,45,255,36,255,50,255,88,255,137,255,163,255,195,255,209,255,248,255,15,0,18,0,26,0,50,0,79,0,80,0,71,0,30,0,230,255, + 172,255,97,255,18,255,196,254,139,254,102,254,67,254,54,254,22,254,243,253,196,253,160,253,132,253,112,253,113,253,117,253,152,253,189,253,210,253,220,253, + 213,253,192,253,181,253,177,253,179,253,196,253,210,253,211,253,221,253,222,253,211,253,213,253,220,253,221,253,221,253,229,253,238,253,5,254,19,254,56,254, + 99,254,141,254,171,254,200,254,245,254,16,255,65,255,119,255,158,255,181,255,206,255,214,255,224,255,228,255,212,255,194,255,151,255,111,255,65,255,16,255, + 216,254,170,254,131,254,127,254,134,254,141,254,141,254,134,254,120,254,105,254,91,254,83,254,77,254,96,254,137,254,167,254,193,254,207,254,214,254,227,254, + 213,254,202,254,177,254,139,254,109,254,73,254,45,254,27,254,249,253,218,253,195,253,177,253,174,253,166,253,160,253,152,253,136,253,130,253,110,253,125,253, + 142,253,167,253,217,253,240,253,239,253,243,253,240,253,253,253,19,254,52,254,102,254,142,254,184,254,245,254,27,255,83,255,112,255,134,255,167,255,187,255, + 226,255,248,255,35,0,78,0,116,0,147,0,168,0,180,0,186,0,199,0,216,0,227,0,231,0,255,0,14,1,31,1,50,1,75,1,114,1,135,1, + 144,1,140,1,122,1,89,1,56,1,24,1,253,0,233,0,202,0,177,0,150,0,132,0,116,0,100,0,101,0,91,0,76,0,48,0,6,0,232,255, + 172,255,129,255,113,255,129,255,165,255,208,255,6,0,40,0,62,0,102,0,141,0,204,0,240,0,21,1,65,1,101,1,125,1,130,1,141,1,144,1, + 136,1,158,1,172,1,190,1,176,1,191,1,204,1,204,1,204,1,186,1,171,1,136,1,137,1,160,1,183,1,197,1,225,1,250,1,28,2,52,2, + 86,2,146,2,185,2,228,2,48,3,96,3,136,3,186,3,243,3,70,4,121,4,170,4,195,4,189,4,167,4,148,4,130,4,90,4,54,4,29,4, + 26,4,30,4,51,4,69,4,73,4,87,4,96,4,96,4,74,4,33,4,240,3,164,3,113,3,62,3,35,3,236,2,192,2,142,2,85,2,18,2, + 172,1,86,1,0,1,170,0,104,0,39,0,238,255,173,255,116,255,81,255,50,255,41,255,16,255,242,254,199,254,160,254,130,254,90,254,73,254,56,254, + 55,254,62,254,70,254,87,254,85,254,98,254,109,254,126,254,133,254,139,254,137,254,121,254,134,254,148,254,155,254,184,254,200,254,211,254,231,254,235,254, + 234,254,223,254,209,254,221,254,246,254,14,255,68,255,113,255,152,255,185,255,214,255,242,255,8,0,11,0,7,0,22,0,26,0,8,0,228,255,187,255, + 148,255,102,255,30,255,243,254,191,254,156,254,124,254,105,254,80,254,67,254,54,254,51,254,62,254,59,254,48,254,44,254,34,254,22,254,15,254,9,254, + 24,254,45,254,65,254,102,254,141,254,177,254,203,254,234,254,7,255,26,255,33,255,12,255,249,254,241,254,228,254,223,254,207,254,180,254,171,254,160,254, + 149,254,124,254,105,254,113,254,131,254,174,254,227,254,23,255,79,255,140,255,188,255,219,255,227,255,235,255,230,255,227,255,220,255,210,255,187,255,160,255, + 130,255,88,255,39,255,241,254,184,254,144,254,116,254,96,254,83,254,80,254,92,254,113,254,124,254,128,254,120,254,115,254,106,254,88,254,78,254,80,254, + 90,254,95,254,112,254,128,254,146,254,138,254,119,254,63,254,4,254,218,253,192,253,181,253,175,253,174,253,177,253,189,253,207,253,206,253,184,253,175,253, + 168,253,163,253,156,253,157,253,152,253,170,253,184,253,208,253,244,253,22,254,52,254,112,254,169,254,217,254,11,255,45,255,99,255,144,255,165,255,184,255, + 205,255,237,255,12,0,43,0,75,0,107,0,129,0,175,0,206,0,231,0,255,0,11,1,18,1,38,1,54,1,54,1,50,1,38,1,31,1,11,1, + 11,1,14,1,20,1,29,1,32,1,11,1,231,0,186,0,143,0,104,0,89,0,71,0,73,0,76,0,76,0,72,0,61,0,39,0,8,0,238,255, + 224,255,228,255,213,255,209,255,188,255,188,255,198,255,230,255,19,0,58,0,111,0,127,0,175,0,220,0,233,0,33,1,71,1,126,1,176,1,225,1, + 3,2,32,2,46,2,56,2,63,2,77,2,88,2,84,2,85,2,79,2,74,2,45,2,21,2,247,1,243,1,243,1,237,1,244,1,6,2,39,2, + 89,2,132,2,150,2,171,2,192,2,230,2,6,3,34,3,98,3,160,3,214,3,6,4,31,4,36,4,42,4,27,4,12,4,0,4,242,3,236,3, + 229,3,221,3,210,3,186,3,161,3,141,3,123,3,113,3,88,3,60,3,27,3,233,2,165,2,103,2,52,2,240,1,180,1,146,1,107,1,79,1, + 57,1,17,1,215,0,155,0,82,0,253,255,177,255,115,255,57,255,12,255,221,254,199,254,169,254,153,254,128,254,98,254,94,254,74,254,66,254,58,254, + 65,254,58,254,56,254,56,254,66,254,94,254,113,254,139,254,166,254,184,254,206,254,207,254,203,254,187,254,173,254,156,254,119,254,110,254,110,254,130,254, + 146,254,171,254,210,254,0,255,27,255,48,255,65,255,84,255,113,255,147,255,159,255,160,255,174,255,173,255,170,255,145,255,126,255,117,255,129,255,156,255, + 177,255,183,255,187,255,160,255,127,255,73,255,11,255,228,254,193,254,191,254,211,254,221,254,223,254,205,254,196,254,182,254,171,254,153,254,141,254,135,254, + 152,254,175,254,203,254,223,254,239,254,16,255,51,255,73,255,94,255,112,255,140,255,169,255,174,255,170,255,160,255,133,255,99,255,66,255,27,255,3,255, + 235,254,234,254,227,254,217,254,218,254,221,254,228,254,241,254,3,255,26,255,45,255,61,255,65,255,75,255,84,255,99,255,122,255,127,255,126,255,124,255, + 113,255,102,255,73,255,57,255,36,255,9,255,225,254,175,254,133,254,102,254,83,254,85,254,98,254,109,254,113,254,121,254,106,254,106,254,95,254,70,254, + 40,254,26,254,11,254,8,254,0,254,8,254,22,254,58,254,62,254,62,254,52,254,27,254,254,253,222,253,195,253,178,253,177,253,181,253,192,253,215,253, + 228,253,247,253,251,253,249,253,250,253,254,253,4,254,11,254,29,254,62,254,106,254,155,254,202,254,0,255,48,255,81,255,124,255,162,255,213,255,250,255, + 33,0,53,0,80,0,101,0,127,0,157,0,186,0,205,0,231,0,4,1,25,1,49,1,67,1,75,1,87,1,87,1,81,1,68,1,47,1,39,1, + 27,1,10,1,244,0,223,0,191,0,154,0,127,0,115,0,105,0,101,0,102,0,104,0,94,0,79,0,50,0,14,0,242,255,226,255,221,255,232,255, + 244,255,24,0,40,0,53,0,51,0,51,0,36,0,18,0,25,0,42,0,65,0,97,0,141,0,175,0,223,0,241,0,21,1,69,1,111,1,150,1, + 168,1,205,1,245,1,25,2,66,2,88,2,107,2,100,2,118,2,117,2,107,2,85,2,70,2,57,2,42,2,34,2,6,2,12,2,31,2,46,2, + 78,2,93,2,113,2,135,2,154,2,181,2,200,2,223,2,240,2,246,2,255,2,10,3,27,3,60,3,74,3,95,3,121,3,150,3,167,3,177,3, + 170,3,164,3,168,3,172,3,165,3,132,3,96,3,34,3,229,2,174,2,120,2,66,2,23,2,240,1,186,1,140,1,87,1,32,1,241,0,197,0, + 147,0,120,0,98,0,73,0,37,0,4,0,214,255,181,255,123,255,75,255,8,255,229,254,189,254,153,254,144,254,135,254,127,254,134,254,133,254,119,254, + 108,254,98,254,102,254,110,254,119,254,116,254,109,254,105,254,96,254,108,254,138,254,151,254,169,254,200,254,214,254,211,254,191,254,157,254,133,254,133,254, + 148,254,175,254,205,254,0,255,61,255,102,255,108,255,115,255,112,255,97,255,80,255,52,255,22,255,8,255,245,254,4,255,15,255,32,255,45,255,47,255, + 66,255,84,255,108,255,136,255,149,255,162,255,162,255,152,255,145,255,133,255,116,255,95,255,75,255,73,255,63,255,68,255,59,255,54,255,66,255,76,255, + 90,255,109,255,129,255,140,255,141,255,133,255,119,255,126,255,137,255,149,255,160,255,173,255,210,255,235,255,246,255,244,255,219,255,185,255,163,255,142,255, + 126,255,105,255,111,255,105,255,102,255,102,255,87,255,73,255,50,255,25,255,253,254,211,254,203,254,207,254,224,254,241,254,252,254,12,255,14,255,33,255, + 43,255,45,255,40,255,23,255,21,255,18,255,12,255,5,255,247,254,224,254,202,254,162,254,123,254,85,254,62,254,44,254,41,254,56,254,67,254,92,254, + 106,254,103,254,87,254,59,254,24,254,12,254,1,254,12,254,40,254,81,254,120,254,139,254,152,254,128,254,91,254,69,254,38,254,6,254,233,253,236,253, + 231,253,246,253,16,254,41,254,69,254,85,254,92,254,131,254,142,254,163,254,174,254,213,254,1,255,23,255,51,255,98,255,162,255,227,255,3,0,43,0, + 79,0,108,0,139,0,173,0,190,0,204,0,229,0,244,0,251,0,6,1,7,1,9,1,25,1,39,1,49,1,68,1,90,1,104,1,97,1,87,1, + 51,1,9,1,224,0,195,0,169,0,147,0,144,0,130,0,127,0,119,0,101,0,80,0,47,0,7,0,231,255,206,255,203,255,210,255,212,255,231,255, + 235,255,235,255,253,255,1,0,17,0,32,0,58,0,84,0,101,0,114,0,123,0,130,0,148,0,177,0,205,0,244,0,28,1,60,1,85,1,97,1, + 110,1,129,1,166,1,202,1,236,1,0,2,24,2,59,2,81,2,96,2,104,2,96,2,89,2,81,2,95,2,99,2,118,2,128,2,139,2,149,2, + 128,2,129,2,140,2,142,2,158,2,175,2,172,2,158,2,139,2,121,2,121,2,110,2,103,2,131,2,160,2,192,2,221,2,248,2,28,3,62,3, + 92,3,116,3,116,3,107,3,75,3,46,3,241,2,199,2,153,2,111,2,59,2,250,1,183,1,115,1,60,1,15,1,224,0,184,0,150,0,98,0, + 69,0,26,0,226,255,180,255,129,255,109,255,95,255,93,255,84,255,66,255,45,255,29,255,7,255,245,254,210,254,198,254,181,254,174,254,171,254,175,254, + 175,254,162,254,149,254,144,254,139,254,138,254,127,254,137,254,126,254,103,254,70,254,40,254,40,254,54,254,67,254,101,254,139,254,184,254,225,254,247,254, + 249,254,253,254,5,255,8,255,5,255,249,254,249,254,9,255,15,255,12,255,242,254,229,254,210,254,189,254,177,254,187,254,195,254,193,254,211,254,228,254, + 236,254,250,254,19,255,65,255,117,255,156,255,185,255,210,255,223,255,214,255,201,255,181,255,160,255,160,255,170,255,188,255,202,255,219,255,219,255,241,255, + 245,255,245,255,231,255,227,255,223,255,220,255,208,255,203,255,196,255,199,255,206,255,226,255,231,255,238,255,224,255,224,255,224,255,228,255,224,255,235,255, + 235,255,230,255,231,255,230,255,226,255,205,255,178,255,142,255,108,255,66,255,19,255,241,254,223,254,199,254,181,254,170,254,167,254,187,254,187,254,192,254, + 203,254,223,254,231,254,250,254,252,254,253,254,3,255,254,254,1,255,246,254,235,254,203,254,169,254,130,254,102,254,69,254,51,254,38,254,41,254,38,254, + 52,254,60,254,69,254,85,254,92,254,108,254,108,254,113,254,109,254,110,254,123,254,146,254,159,254,192,254,214,254,216,254,207,254,187,254,156,254,113,254, + 90,254,56,254,55,254,52,254,65,254,85,254,131,254,180,254,209,254,252,254,16,255,40,255,54,255,83,255,129,255,167,255,224,255,14,0,46,0,86,0, + 111,0,137,0,165,0,181,0,187,0,195,0,208,0,217,0,233,0,240,0,241,0,251,0,253,0,6,1,13,1,17,1,9,1,255,0,238,0,235,0, + 222,0,217,0,204,0,193,0,180,0,180,0,170,0,166,0,169,0,151,0,134,0,90,0,35,0,250,255,205,255,191,255,188,255,190,255,195,255,199,255, + 192,255,187,255,188,255,191,255,206,255,232,255,15,0,50,0,101,0,150,0,191,0,217,0,247,0,10,1,7,1,2,1,252,0,252,0,20,1,43,1, + 75,1,105,1,125,1,137,1,151,1,161,1,191,1,227,1,255,1,3,2,14,2,27,2,48,2,84,2,100,2,113,2,131,2,158,2,175,2,169,2, + 174,2,157,2,162,2,144,2,125,2,78,2,45,2,34,2,5,2,254,1,240,1,254,1,2,2,21,2,46,2,45,2,71,2,96,2,115,2,158,2, + 179,2,192,2,194,2,179,2,176,2,139,2,115,2,86,2,57,2,20,2,230,1,178,1,126,1,82,1,25,1,230,0,173,0,114,0,76,0,33,0, + 253,255,212,255,160,255,120,255,94,255,63,255,45,255,19,255,15,255,9,255,9,255,14,255,21,255,15,255,15,255,0,255,236,254,232,254,228,254,238,254, + 231,254,221,254,203,254,182,254,146,254,124,254,101,254,103,254,108,254,109,254,119,254,110,254,92,254,74,254,74,254,84,254,110,254,157,254,206,254,7,255, + 41,255,55,255,62,255,54,255,41,255,12,255,236,254,206,254,185,254,184,254,184,254,175,254,175,254,185,254,195,254,200,254,213,254,217,254,228,254,216,254, + 242,254,1,255,21,255,29,255,61,255,98,255,144,255,188,255,216,255,232,255,244,255,3,0,4,0,246,255,237,255,246,255,3,0,29,0,50,0,55,0, + 53,0,37,0,25,0,22,0,10,0,8,0,1,0,1,0,10,0,7,0,3,0,0,0,252,255,235,255,230,255,228,255,239,255,7,0,28,0,37,0, + 46,0,39,0,33,0,8,0,252,255,221,255,199,255,180,255,155,255,141,255,120,255,99,255,70,255,43,255,11,255,229,254,207,254,188,254,175,254,167,254, + 169,254,178,254,192,254,213,254,234,254,252,254,247,254,241,254,235,254,227,254,214,254,206,254,189,254,177,254,164,254,144,254,141,254,110,254,90,254,58,254, + 31,254,20,254,33,254,51,254,90,254,121,254,157,254,193,254,216,254,221,254,218,254,210,254,221,254,224,254,223,254,245,254,4,255,22,255,32,255,30,255, + 9,255,250,254,224,254,207,254,198,254,198,254,199,254,211,254,250,254,43,255,75,255,111,255,152,255,203,255,227,255,253,255,21,0,47,0,72,0,97,0, + 123,0,145,0,159,0,173,0,183,0,184,0,190,0,183,0,183,0,199,0,219,0,251,0,20,1,28,1,20,1,252,0,224,0,198,0,166,0,141,0, + 129,0,126,0,133,0,154,0,172,0,195,0,206,0,198,0,176,0,133,0,90,0,43,0,14,0,246,255,232,255,223,255,206,255,194,255,187,255,163,255, + 160,255,159,255,165,255,172,255,196,255,220,255,12,0,62,0,120,0,166,0,206,0,249,0,17,1,32,1,36,1,43,1,57,1,64,1,79,1,78,1, + 76,1,71,1,81,1,86,1,97,1,123,1,135,1,150,1,157,1,176,1,197,1,225,1,245,1,9,2,42,2,75,2,118,2,140,2,143,2,149,2, + 151,2,157,2,161,2,124,2,100,2,67,2,36,2,3,2,232,1,205,1,194,1,197,1,196,1,211,1,215,1,244,1,17,2,42,2,61,2,61,2, + 61,2,46,2,20,2,10,2,240,1,230,1,211,1,197,1,178,1,164,1,143,1,123,1,96,1,74,1,35,1,253,0,216,0,169,0,104,0,29,0, + 202,255,136,255,93,255,69,255,50,255,41,255,41,255,33,255,29,255,12,255,239,254,220,254,202,254,205,254,214,254,236,254,245,254,7,255,19,255,18,255, + 12,255,239,254,206,254,170,254,133,254,94,254,78,254,60,254,40,254,37,254,41,254,63,254,98,254,116,254,139,254,157,254,175,254,185,254,191,254,209,254, + 220,254,229,254,232,254,245,254,246,254,234,254,232,254,214,254,193,254,173,254,173,254,171,254,166,254,156,254,156,254,173,254,180,254,210,254,231,254,247,254, + 15,255,33,255,52,255,76,255,101,255,117,255,141,255,177,255,196,255,227,255,245,255,14,0,36,0,46,0,48,0,57,0,65,0,80,0,86,0,84,0, + 82,0,80,0,80,0,73,0,64,0,60,0,53,0,53,0,57,0,53,0,44,0,50,0,53,0,61,0,44,0,37,0,35,0,39,0,50,0,57,0, + 75,0,89,0,91,0,68,0,36,0,0,0,228,255,201,255,190,255,181,255,173,255,174,255,170,255,154,255,129,255,104,255,76,255,48,255,27,255,253,254, + 238,254,234,254,234,254,229,254,234,254,236,254,234,254,229,254,217,254,203,254,198,254,189,254,199,254,202,254,207,254,207,254,192,254,162,254,139,254,121,254, + 123,254,112,254,108,254,117,254,119,254,121,254,145,254,157,254,173,254,202,254,234,254,4,255,29,255,44,255,48,255,62,255,65,255,51,255,43,255,44,255, + 43,255,48,255,51,255,55,255,57,255,51,255,45,255,51,255,63,255,70,255,102,255,138,255,177,255,220,255,252,255,28,0,46,0,65,0,89,0,98,0, + 111,0,122,0,132,0,147,0,162,0,176,0,190,0,195,0,201,0,199,0,205,0,212,0,209,0,206,0,209,0,204,0,183,0,172,0,145,0,123,0, + 109,0,97,0,108,0,114,0,144,0,159,0,162,0,162,0,137,0,115,0,75,0,51,0,29,0,17,0,255,255,234,255,212,255,180,255,167,255,162,255, + 156,255,160,255,173,255,181,255,206,255,238,255,24,0,65,0,104,0,133,0,166,0,188,0,217,0,224,0,249,0,15,1,47,1,78,1,100,1,108,1, + 119,1,126,1,123,1,125,1,119,1,107,1,107,1,122,1,144,1,155,1,179,1,191,1,226,1,233,1,248,1,0,2,5,2,17,2,38,2,64,2, + 81,2,81,2,81,2,64,2,54,2,23,2,252,1,250,1,247,1,241,1,227,1,214,1,208,1,198,1,190,1,187,1,191,1,202,1,208,1,205,1, + 189,1,176,1,151,1,114,1,89,1,61,1,45,1,42,1,21,1,18,1,24,1,25,1,15,1,11,1,255,0,231,0,186,0,130,0,68,0,252,255, + 195,255,159,255,129,255,102,255,72,255,51,255,37,255,21,255,18,255,11,255,247,254,238,254,232,254,234,254,223,254,223,254,220,254,216,254,221,254,220,254, + 218,254,210,254,187,254,188,254,157,254,126,254,83,254,59,254,29,254,23,254,19,254,23,254,54,254,87,254,126,254,148,254,160,254,175,254,180,254,185,254, + 187,254,187,254,196,254,203,254,207,254,217,254,228,254,242,254,236,254,236,254,238,254,249,254,247,254,245,254,228,254,220,254,217,254,224,254,231,254,0,255, + 23,255,62,255,94,255,120,255,144,255,180,255,199,255,232,255,6,0,21,0,48,0,62,0,73,0,90,0,87,0,91,0,98,0,101,0,107,0,109,0, + 109,0,108,0,101,0,87,0,86,0,87,0,86,0,90,0,83,0,78,0,80,0,84,0,93,0,109,0,111,0,109,0,97,0,87,0,79,0,72,0, + 55,0,57,0,57,0,44,0,43,0,37,0,17,0,248,255,228,255,205,255,198,255,187,255,173,255,166,255,162,255,154,255,145,255,131,255,117,255,106,255, + 87,255,72,255,45,255,9,255,245,254,224,254,213,254,211,254,203,254,189,254,187,254,188,254,196,254,193,254,202,254,209,254,207,254,191,254,187,254,181,254, + 180,254,174,254,162,254,171,254,177,254,181,254,175,254,175,254,170,254,175,254,203,254,235,254,21,255,57,255,91,255,120,255,124,255,124,255,104,255,80,255, + 69,255,58,255,55,255,63,255,73,255,106,255,126,255,151,255,167,255,176,255,174,255,188,255,212,255,246,255,11,0,36,0,47,0,60,0,66,0,71,0, + 71,0,72,0,83,0,86,0,94,0,118,0,133,0,139,0,161,0,175,0,180,0,188,0,180,0,166,0,148,0,139,0,129,0,120,0,132,0,129,0, + 140,0,143,0,151,0,151,0,136,0,127,0,115,0,104,0,87,0,79,0,66,0,64,0,55,0,50,0,30,0,17,0,245,255,216,255,191,255,180,255, + 184,255,188,255,208,255,228,255,250,255,19,0,42,0,64,0,76,0,93,0,116,0,130,0,145,0,173,0,208,0,231,0,10,1,36,1,53,1,81,1, + 107,1,126,1,139,1,151,1,165,1,169,1,164,1,162,1,146,1,141,1,140,1,154,1,165,1,171,1,176,1,179,1,168,1,165,1,168,1,171,1, + 182,1,183,1,196,1,205,1,211,1,200,1,193,1,183,1,178,1,173,1,191,1,209,1,208,1,200,1,205,1,194,1,171,1,148,1,123,1,99,1, + 64,1,35,1,7,1,241,0,222,0,206,0,199,0,184,0,177,0,165,0,159,0,163,0,155,0,157,0,155,0,137,0,105,0,73,0,32,0,3,0, + 230,255,209,255,188,255,173,255,154,255,123,255,79,255,47,255,25,255,11,255,15,255,25,255,37,255,41,255,30,255,14,255,249,254,218,254,187,254,177,254, + 166,254,163,254,162,254,163,254,151,254,139,254,130,254,105,254,91,254,76,254,66,254,67,254,76,254,96,254,117,254,108,254,102,254,92,254,95,254,102,254, + 120,254,141,254,159,254,189,254,206,254,217,254,216,254,231,254,245,254,12,255,18,255,27,255,37,255,48,255,39,255,26,255,3,255,246,254,3,255,5,255, + 29,255,50,255,83,255,122,255,159,255,196,255,230,255,0,0,32,0,58,0,84,0,109,0,134,0,145,0,145,0,143,0,130,0,136,0,136,0,136,0, + 144,0,162,0,159,0,150,0,143,0,134,0,134,0,122,0,118,0,133,0,139,0,130,0,130,0,130,0,137,0,140,0,133,0,129,0,125,0,107,0, + 97,0,66,0,43,0,21,0,250,255,231,255,245,255,241,255,250,255,10,0,12,0,18,0,250,255,230,255,202,255,183,255,170,255,156,255,155,255,148,255, + 147,255,134,255,112,255,91,255,65,255,41,255,1,255,220,254,184,254,159,254,139,254,144,254,169,254,188,254,210,254,224,254,224,254,216,254,200,254,205,254, + 205,254,209,254,211,254,217,254,232,254,232,254,235,254,238,254,249,254,254,254,7,255,14,255,25,255,33,255,57,255,81,255,102,255,123,255,126,255,133,255, + 140,255,129,255,124,255,126,255,137,255,141,255,156,255,181,255,196,255,220,255,244,255,7,0,29,0,39,0,30,0,25,0,15,0,22,0,22,0,19,0, + 29,0,42,0,47,0,65,0,75,0,82,0,87,0,87,0,94,0,96,0,102,0,109,0,115,0,120,0,126,0,118,0,111,0,104,0,109,0,107,0, + 109,0,122,0,122,0,127,0,137,0,133,0,126,0,102,0,68,0,58,0,43,0,33,0,26,0,26,0,22,0,14,0,252,255,238,255,238,255,246,255, + 3,0,8,0,15,0,32,0,42,0,47,0,55,0,61,0,66,0,79,0,86,0,104,0,116,0,139,0,163,0,201,0,222,0,3,1,42,1,71,1, + 87,1,108,1,128,1,158,1,179,1,196,1,205,1,211,1,215,1,204,1,200,1,175,1,153,1,122,1,97,1,83,1,75,1,83,1,90,1,105,1, + 107,1,119,1,122,1,123,1,126,1,118,1,129,1,137,1,157,1,175,1,172,1,182,1,178,1,173,1,173,1,166,1,161,1,150,1,126,1,82,1, + 36,1,238,0,188,0,154,0,122,0,118,0,108,0,107,0,107,0,108,0,105,0,105,0,89,0,66,0,54,0,47,0,33,0,32,0,24,0,25,0, + 24,0,10,0,8,0,249,255,221,255,185,255,141,255,106,255,79,255,65,255,54,255,58,255,55,255,45,255,30,255,21,255,14,255,234,254,209,254,184,254, + 169,254,138,254,123,254,117,254,113,254,116,254,115,254,119,254,119,254,121,254,121,254,108,254,101,254,96,254,92,254,80,254,60,254,54,254,41,254,30,254, + 45,254,70,254,108,254,137,254,167,254,193,254,220,254,246,254,7,255,25,255,41,255,57,255,63,255,59,255,51,255,45,255,40,255,58,255,73,255,97,255, + 117,255,140,255,169,255,188,255,198,255,206,255,224,255,249,255,24,0,55,0,89,0,125,0,151,0,169,0,175,0,162,0,157,0,144,0,150,0,155,0, + 172,0,186,0,184,0,195,0,195,0,190,0,198,0,193,0,202,0,199,0,191,0,177,0,170,0,166,0,158,0,155,0,151,0,137,0,129,0,118,0, + 101,0,82,0,60,0,40,0,26,0,14,0,7,0,253,255,244,255,248,255,3,0,19,0,33,0,37,0,35,0,29,0,11,0,246,255,231,255,213,255, + 199,255,188,255,167,255,149,255,131,255,102,255,79,255,55,255,27,255,0,255,225,254,193,254,199,254,193,254,203,254,217,254,216,254,223,254,225,254,228,254, + 228,254,229,254,243,254,246,254,253,254,15,255,23,255,43,255,62,255,73,255,84,255,99,255,95,255,104,255,98,255,98,255,93,255,97,255,93,255,109,255, + 116,255,138,255,152,255,167,255,181,255,187,255,195,255,188,255,192,255,199,255,210,255,226,255,235,255,249,255,0,0,8,0,17,0,6,0,253,255,253,255, + 255,255,252,255,7,0,11,0,26,0,30,0,50,0,61,0,68,0,72,0,72,0,68,0,64,0,53,0,62,0,60,0,71,0,80,0,98,0,104,0, + 101,0,109,0,108,0,102,0,94,0,76,0,60,0,55,0,35,0,35,0,32,0,22,0,21,0,11,0,252,255,241,255,231,255,237,255,239,255,255,255, + 19,0,36,0,48,0,47,0,50,0,46,0,32,0,24,0,29,0,36,0,46,0,55,0,82,0,108,0,139,0,162,0,191,0,215,0,238,0,10,1, + 36,1,76,1,112,1,150,1,176,1,184,1,187,1,194,1,193,1,191,1,193,1,189,1,178,1,157,1,135,1,103,1,71,1,54,1,43,1,45,1, + 36,1,46,1,47,1,45,1,46,1,49,1,65,1,93,1,94,1,105,1,126,1,140,1,132,1,128,1,136,1,130,1,118,1,92,1,74,1,36,1, + 0,1,220,0,188,0,150,0,112,0,79,0,51,0,42,0,28,0,24,0,8,0,1,0,252,255,244,255,234,255,235,255,224,255,219,255,223,255,238,255, + 245,255,3,0,7,0,3,0,231,255,210,255,191,255,178,255,154,255,137,255,122,255,98,255,83,255,68,255,43,255,22,255,253,254,234,254,211,254,195,254, + 192,254,170,254,167,254,151,254,139,254,128,254,117,254,108,254,109,254,120,254,123,254,135,254,127,254,108,254,102,254,94,254,81,254,87,254,77,254,77,254, + 80,254,92,254,92,254,115,254,127,254,155,254,185,254,216,254,246,254,19,255,37,255,51,255,52,255,54,255,58,255,51,255,61,255,83,255,119,255,163,255, + 203,255,235,255,250,255,7,0,0,0,241,255,238,255,245,255,6,0,17,0,36,0,72,0,102,0,126,0,145,0,151,0,159,0,162,0,169,0,170,0, + 170,0,170,0,183,0,199,0,220,0,216,0,227,0,222,0,229,0,238,0,229,0,216,0,204,0,181,0,172,0,165,0,150,0,148,0,130,0,111,0, + 93,0,76,0,62,0,46,0,36,0,30,0,26,0,22,0,19,0,14,0,26,0,25,0,26,0,21,0,21,0,22,0,33,0,36,0,30,0,15,0, + 253,255,224,255,194,255,163,255,133,255,116,255,95,255,88,255,77,255,65,255,54,255,44,255,33,255,18,255,1,255,243,254,220,254,214,254,213,254,214,254, + 227,254,239,254,4,255,16,255,32,255,50,255,63,255,76,255,98,255,119,255,147,255,159,255,170,255,190,255,187,255,188,255,159,255,160,255,159,255,155,255, + 158,255,165,255,169,255,185,255,206,255,234,255,242,255,0,0,252,255,234,255,223,255,212,255,202,255,201,255,194,255,212,255,230,255,249,255,11,0,24,0, + 18,0,11,0,1,0,248,255,250,255,10,0,17,0,30,0,57,0,66,0,71,0,79,0,66,0,64,0,54,0,40,0,40,0,36,0,48,0,75,0, + 87,0,97,0,97,0,98,0,82,0,62,0,36,0,11,0,253,255,249,255,10,0,29,0,36,0,29,0,19,0,3,0,245,255,235,255,237,255,241,255, + 250,255,6,0,19,0,28,0,25,0,32,0,35,0,22,0,29,0,28,0,28,0,42,0,53,0,73,0,93,0,112,0,145,0,163,0,188,0,220,0, + 252,0,29,1,51,1,68,1,82,1,100,1,114,1,121,1,132,1,139,1,146,1,137,1,130,1,119,1,110,1,101,1,90,1,76,1,50,1,36,1, + 7,1,249,0,249,0,242,0,242,0,255,0,252,0,11,1,13,1,31,1,32,1,49,1,54,1,53,1,56,1,57,1,56,1,38,1,24,1,6,1, + 242,0,226,0,198,0,177,0,150,0,134,0,109,0,73,0,35,0,7,0,241,255,224,255,210,255,202,255,195,255,196,255,192,255,202,255,212,255,213,255, + 231,255,230,255,231,255,220,255,214,255,209,255,203,255,201,255,191,255,180,255,180,255,172,255,154,255,133,255,102,255,73,255,39,255,5,255,235,254,207,254, + 191,254,185,254,188,254,195,254,181,254,171,254,170,254,153,254,135,254,113,254,91,254,87,254,87,254,92,254,106,254,124,254,133,254,127,254,128,254,113,254, + 103,254,94,254,95,254,112,254,127,254,151,254,169,254,191,254,210,254,223,254,246,254,4,255,37,255,44,255,51,255,61,255,81,255,97,255,133,255,173,255, + 210,255,248,255,24,0,40,0,43,0,40,0,25,0,14,0,12,0,14,0,24,0,35,0,62,0,87,0,101,0,111,0,136,0,150,0,151,0,154,0, + 155,0,165,0,177,0,193,0,206,0,230,0,229,0,230,0,235,0,234,0,227,0,222,0,209,0,215,0,206,0,194,0,179,0,166,0,141,0,122,0, + 104,0,96,0,84,0,76,0,64,0,58,0,53,0,50,0,48,0,42,0,29,0,21,0,11,0,1,0,246,255,235,255,232,255,242,255,244,255,248,255, + 253,255,242,255,221,255,212,255,184,255,165,255,149,255,138,255,129,255,126,255,126,255,134,255,129,255,113,255,99,255,75,255,54,255,40,255,22,255,12,255, + 254,254,253,254,14,255,23,255,25,255,47,255,69,255,99,255,131,255,147,255,176,255,202,255,214,255,230,255,232,255,241,255,248,255,249,255,11,0,11,0, + 14,0,12,0,245,255,238,255,237,255,232,255,224,255,221,255,228,255,245,255,248,255,235,255,231,255,227,255,223,255,213,255,209,255,195,255,201,255,208,255, + 216,255,237,255,246,255,0,0,6,0,4,0,4,0,7,0,10,0,22,0,22,0,36,0,51,0,54,0,57,0,61,0,64,0,61,0,55,0,54,0, + 62,0,61,0,60,0,54,0,47,0,33,0,24,0,7,0,6,0,15,0,15,0,15,0,26,0,29,0,24,0,18,0,12,0,3,0,4,0,249,255, + 253,255,3,0,7,0,10,0,8,0,6,0,6,0,10,0,17,0,35,0,44,0,61,0,89,0,93,0,101,0,114,0,126,0,145,0,169,0,183,0, + 206,0,244,0,14,1,29,1,45,1,45,1,38,1,43,1,54,1,58,1,63,1,57,1,63,1,69,1,74,1,86,1,79,1,81,1,74,1,61,1, + 36,1,17,1,244,0,231,0,219,0,220,0,226,0,238,0,235,0,234,0,233,0,229,0,231,0,241,0,241,0,253,0,245,0,240,0,240,0,230,0, + 226,0,206,0,198,0,183,0,169,0,145,0,126,0,107,0,73,0,48,0,26,0,242,255,213,255,201,255,190,255,185,255,184,255,185,255,180,255,190,255, + 206,255,209,255,201,255,187,255,166,255,165,255,156,255,165,255,162,255,165,255,180,255,178,255,167,255,159,255,142,255,112,255,91,255,61,255,29,255,1,255, + 229,254,214,254,188,254,171,254,169,254,153,254,151,254,146,254,135,254,126,254,113,254,112,254,109,254,102,254,96,254,102,254,126,254,135,254,145,254,148,254, + 145,254,144,254,149,254,151,254,138,254,146,254,155,254,167,254,188,254,196,254,207,254,224,254,235,254,7,255,34,255,61,255,91,255,129,255,165,255,201,255, + 226,255,241,255,0,0,8,0,19,0,17,0,17,0,33,0,37,0,47,0,53,0,62,0,69,0,79,0,97,0,91,0,105,0,116,0,118,0,129,0, + 137,0,147,0,162,0,177,0,186,0,195,0,195,0,195,0,205,0,201,0,208,0,205,0,204,0,206,0,198,0,191,0,186,0,187,0,175,0,168,0, + 152,0,133,0,111,0,107,0,104,0,100,0,84,0,76,0,55,0,43,0,28,0,17,0,7,0,10,0,248,255,248,255,241,255,242,255,234,255,219,255, + 212,255,202,255,191,255,185,255,185,255,169,255,170,255,174,255,177,255,181,255,188,255,187,255,174,255,160,255,151,255,134,255,124,255,105,255,104,255,94,255, + 73,255,61,255,50,255,45,255,44,255,79,255,81,255,93,255,113,255,133,255,160,255,187,255,209,255,234,255,244,255,252,255,15,0,40,0,55,0,71,0, + 89,0,80,0,83,0,64,0,44,0,17,0,253,255,239,255,228,255,221,255,216,255,221,255,219,255,234,255,237,255,234,255,230,255,220,255,220,255,212,255, + 198,255,191,255,194,255,206,255,212,255,238,255,250,255,12,0,24,0,25,0,22,0,19,0,14,0,11,0,15,0,25,0,35,0,43,0,51,0,61,0, + 61,0,53,0,40,0,21,0,12,0,3,0,253,255,6,0,14,0,32,0,26,0,25,0,22,0,22,0,6,0,255,255,252,255,0,0,0,0,3,0, + 7,0,7,0,11,0,6,0,1,0,255,255,250,255,249,255,255,255,18,0,39,0,53,0,84,0,107,0,120,0,127,0,137,0,150,0,158,0,173,0, + 186,0,197,0,217,0,229,0,244,0,255,0,4,1,17,1,27,1,27,1,28,1,15,1,15,1,25,1,38,1,42,1,57,1,58,1,63,1,51,1, + 40,1,29,1,17,1,255,0,237,0,226,0,216,0,209,0,205,0,201,0,193,0,187,0,175,0,169,0,166,0,162,0,162,0,162,0,165,0,168,0, + 168,0,173,0,172,0,158,0,150,0,139,0,133,0,129,0,123,0,114,0,100,0,72,0,47,0,3,0,227,255,203,255,192,255,195,255,185,255,187,255, + 180,255,173,255,170,255,162,255,152,255,145,255,138,255,134,255,133,255,129,255,144,255,148,255,156,255,147,255,145,255,141,255,136,255,115,255,81,255,57,255, + 33,255,4,255,231,254,203,254,182,254,171,254,170,254,174,254,173,254,171,254,166,254,163,254,151,254,134,254,127,254,127,254,133,254,139,254,141,254,151,254, + 151,254,156,254,152,254,156,254,167,254,177,254,184,254,196,254,207,254,205,254,216,254,227,254,241,254,4,255,30,255,57,255,97,255,130,255,169,255,191,255, + 206,255,210,255,213,255,210,255,213,255,216,255,220,255,234,255,11,0,37,0,68,0,90,0,102,0,102,0,119,0,120,0,118,0,122,0,109,0,104,0, + 120,0,127,0,143,0,151,0,162,0,175,0,186,0,191,0,188,0,191,0,198,0,206,0,212,0,220,0,226,0,216,0,205,0,195,0,180,0,172,0, + 162,0,157,0,151,0,148,0,133,0,119,0,107,0,89,0,73,0,65,0,47,0,33,0,15,0,4,0,255,255,246,255,241,255,235,255,223,255,208,255, + 210,255,202,255,195,255,184,255,181,255,177,255,173,255,174,255,177,255,173,255,188,255,191,255,192,255,198,255,194,255,184,255,173,255,166,255,158,255,154,255, + 154,255,142,255,134,255,127,255,123,255,126,255,116,255,129,255,129,255,144,255,158,255,177,255,195,255,206,255,228,255,249,255,14,0,36,0,51,0,69,0, + 83,0,79,0,82,0,79,0,66,0,58,0,51,0,42,0,24,0,4,0,244,255,238,255,234,255,227,255,227,255,228,255,231,255,228,255,221,255,216,255, + 216,255,205,255,196,255,191,255,192,255,192,255,203,255,214,255,235,255,245,255,3,0,17,0,14,0,14,0,253,255,253,255,252,255,244,255,250,255,7,0, + 17,0,26,0,24,0,26,0,18,0,14,0,8,0,4,0,0,0,255,255,3,0,0,0,1,0,0,0,255,255,1,0,1,0,0,0,7,0,8,0, + 11,0,14,0,17,0,11,0,3,0,7,0,1,0,1,0,11,0,17,0,37,0,51,0,60,0,68,0,78,0,87,0,116,0,137,0,150,0,163,0, + 173,0,179,0,186,0,197,0,195,0,199,0,209,0,220,0,219,0,229,0,222,0,231,0,231,0,241,0,242,0,247,0,0,1,3,1,253,0,4,1, + 13,1,13,1,13,1,3,1,4,1,0,1,235,0,216,0,202,0,197,0,180,0,172,0,162,0,147,0,133,0,114,0,105,0,89,0,80,0,78,0, + 72,0,84,0,101,0,114,0,118,0,122,0,130,0,125,0,118,0,107,0,93,0,71,0,57,0,40,0,21,0,252,255,220,255,198,255,181,255,173,255, + 159,255,163,255,156,255,148,255,140,255,129,255,120,255,109,255,105,255,104,255,102,255,104,255,112,255,109,255,112,255,111,255,101,255,90,255,68,255,47,255, + 29,255,8,255,254,254,252,254,239,254,235,254,227,254,223,254,216,254,213,254,216,254,210,254,196,254,184,254,167,254,149,254,137,254,130,254,128,254,138,254, + 135,254,135,254,139,254,149,254,160,254,178,254,195,254,209,254,220,254,232,254,241,254,253,254,1,255,14,255,39,255,59,255,94,255,120,255,138,255,166,255, + 183,255,194,255,199,255,202,255,201,255,212,255,216,255,221,255,245,255,7,0,26,0,55,0,97,0,134,0,157,0,172,0,172,0,161,0,145,0,123,0, + 108,0,105,0,111,0,129,0,152,0,172,0,206,0,223,0,230,0,224,0,223,0,209,0,197,0,194,0,188,0,197,0,191,0,197,0,195,0,201,0, + 184,0,188,0,184,0,179,0,166,0,150,0,137,0,129,0,108,0,91,0,78,0,66,0,57,0,46,0,33,0,22,0,7,0,249,255,237,255,216,255, + 202,255,192,255,192,255,192,255,201,255,212,255,210,255,209,255,209,255,206,255,203,255,201,255,205,255,210,255,213,255,223,255,227,255,230,255,221,255,213,255, + 208,255,196,255,199,255,212,255,208,255,217,255,216,255,219,255,220,255,209,255,208,255,212,255,206,255,205,255,219,255,235,255,253,255,11,0,28,0,35,0, + 44,0,46,0,54,0,61,0,60,0,60,0,53,0,40,0,39,0,32,0,26,0,18,0,17,0,11,0,3,0,253,255,239,255,237,255,231,255,231,255, + 220,255,216,255,209,255,208,255,206,255,214,255,216,255,216,255,223,255,221,255,230,255,232,255,234,255,244,255,250,255,3,0,252,255,255,255,246,255,248,255, + 255,255,0,0,4,0,11,0,17,0,19,0,28,0,22,0,21,0,22,0,24,0,14,0,19,0,22,0,24,0,25,0,17,0,28,0,21,0,28,0, + 36,0,33,0,32,0,35,0,32,0,32,0,30,0,29,0,32,0,42,0,53,0,53,0,57,0,69,0,75,0,86,0,93,0,109,0,123,0,139,0, + 158,0,169,0,175,0,193,0,198,0,201,0,204,0,201,0,206,0,201,0,206,0,202,0,217,0,223,0,222,0,217,0,216,0,220,0,217,0,222,0, + 222,0,216,0,220,0,229,0,226,0,231,0,219,0,206,0,201,0,170,0,152,0,133,0,107,0,91,0,80,0,64,0,58,0,53,0,46,0,53,0, + 57,0,61,0,60,0,60,0,71,0,71,0,69,0,62,0,60,0,54,0,50,0,43,0,28,0,18,0,10,0,255,255,239,255,216,255,202,255,183,255, + 176,255,176,255,166,255,162,255,155,255,147,255,144,255,136,255,120,255,99,255,83,255,66,255,63,255,62,255,58,255,55,255,54,255,58,255,57,255,55,255, + 39,255,32,255,26,255,23,255,5,255,7,255,253,254,14,255,8,255,9,255,4,255,253,254,239,254,223,254,205,254,191,254,180,254,166,254,169,254,169,254, + 166,254,167,254,173,254,174,254,170,254,175,254,177,254,184,254,199,254,210,254,223,254,239,254,4,255,15,255,40,255,62,255,77,255,91,255,101,255,115,255, + 126,255,140,255,159,255,176,255,190,255,210,255,223,255,235,255,244,255,0,0,11,0,26,0,46,0,60,0,84,0,102,0,125,0,141,0,162,0,159,0, + 155,0,141,0,133,0,143,0,151,0,166,0,190,0,205,0,219,0,224,0,226,0,216,0,206,0,199,0,191,0,186,0,180,0,172,0,172,0,169,0, + 180,0,179,0,177,0,180,0,175,0,165,0,154,0,144,0,132,0,111,0,96,0,86,0,80,0,79,0,72,0,57,0,40,0,19,0,253,255,244,255, + 224,255,220,255,217,255,203,255,212,255,220,255,217,255,223,255,227,255,232,255,232,255,228,255,230,255,224,255,234,255,230,255,234,255,237,255,244,255,252,255, + 3,0,12,0,14,0,12,0,6,0,255,255,0,0,246,255,245,255,248,255,239,255,235,255,245,255,248,255,0,0,6,0,11,0,6,0,14,0,6,0, + 17,0,28,0,29,0,29,0,36,0,32,0,26,0,26,0,17,0,18,0,21,0,14,0,15,0,12,0,3,0,7,0,253,255,237,255,223,255,210,255, + 213,255,213,255,208,255,210,255,199,255,194,255,194,255,194,255,190,255,194,255,201,255,210,255,217,255,230,255,230,255,231,255,234,255,235,255,235,255,232,255, + 235,255,238,255,245,255,255,255,8,0,18,0,25,0,21,0,19,0,19,0,28,0,33,0,47,0,47,0,55,0,66,0,62,0,60,0,55,0,54,0, + 53,0,50,0,51,0,51,0,54,0,55,0,61,0,54,0,42,0,30,0,18,0,28,0,26,0,43,0,55,0,73,0,83,0,94,0,108,0,116,0, + 137,0,144,0,161,0,175,0,186,0,198,0,197,0,194,0,197,0,193,0,197,0,197,0,205,0,201,0,205,0,204,0,199,0,193,0,186,0,198,0, + 204,0,193,0,193,0,187,0,187,0,180,0,173,0,170,0,168,0,155,0,140,0,112,0,91,0,60,0,39,0,28,0,32,0,33,0,43,0,47,0, + 47,0,44,0,32,0,29,0,12,0,10,0,255,255,0,0,1,0,245,255,246,255,241,255,244,255,244,255,237,255,227,255,227,255,216,255,208,255,199,255, + 185,255,173,255,165,255,160,255,163,255,156,255,154,255,142,255,129,255,106,255,83,255,62,255,41,255,36,255,27,255,30,255,32,255,41,255,41,255,50,255, + 50,255,62,255,52,255,44,255,51,255,40,255,41,255,36,255,34,255,27,255,18,255,12,255,4,255,253,254,250,254,243,254,234,254,223,254,210,254,206,254, + 210,254,216,254,217,254,207,254,203,254,193,254,198,254,195,254,200,254,223,254,231,254,250,254,15,255,33,255,40,255,52,255,65,255,73,255,73,255,81,255, + 98,255,116,255,144,255,170,255,184,255,209,255,228,255,245,255,252,255,14,0,19,0,29,0,30,0,42,0,57,0,73,0,101,0,122,0,147,0,175,0, + 193,0,208,0,209,0,205,0,194,0,191,0,194,0,201,0,205,0,217,0,220,0,227,0,224,0,213,0,202,0,191,0,188,0,190,0,191,0,195,0, + 194,0,186,0,180,0,181,0,177,0,176,0,162,0,166,0,151,0,143,0,127,0,122,0,109,0,97,0,82,0,66,0,58,0,47,0,25,0,15,0, + 6,0,0,0,252,255,242,255,228,255,216,255,212,255,219,255,228,255,230,255,238,255,244,255,0,0,248,255,241,255,242,255,238,255,248,255,250,255,3,0, + 17,0,25,0,21,0,30,0,29,0,35,0,32,0,35,0,29,0,21,0,14,0,10,0,11,0,15,0,25,0,21,0,24,0,26,0,22,0,24,0, + 18,0,14,0,8,0,8,0,255,255,3,0,7,0,15,0,21,0,18,0,25,0,35,0,36,0,35,0,28,0,19,0,10,0,249,255,238,255,221,255, + 219,255,214,255,209,255,195,255,190,255,178,255,169,255,169,255,167,255,167,255,184,255,201,255,216,255,227,255,239,255,235,255,230,255,220,255,217,255,217,255, + 223,255,242,255,250,255,0,0,14,0,22,0,26,0,25,0,26,0,25,0,24,0,28,0,37,0,50,0,65,0,69,0,90,0,93,0,98,0,98,0, + 89,0,80,0,78,0,75,0,69,0,72,0,65,0,61,0,48,0,37,0,30,0,25,0,28,0,26,0,36,0,47,0,57,0,71,0,79,0,91,0, + 107,0,122,0,140,0,143,0,145,0,152,0,155,0,158,0,172,0,181,0,172,0,176,0,170,0,175,0,169,0,180,0,176,0,175,0,179,0,168,0, + 173,0,175,0,168,0,158,0,150,0,145,0,133,0,119,0,102,0,93,0,76,0,72,0,57,0,54,0,53,0,39,0,36,0,32,0,22,0,15,0, + 11,0,10,0,1,0,241,255,227,255,209,255,191,255,183,255,174,255,169,255,176,255,183,255,185,255,183,255,185,255,195,255,198,255,190,255,190,255,187,255, + 178,255,177,255,173,255,176,255,177,255,158,255,144,255,119,255,94,255,75,255,59,255,55,255,51,255,48,255,50,255,32,255,26,255,18,255,26,255,33,255, + 47,255,55,255,59,255,59,255,73,255,69,255,59,255,50,255,45,255,41,255,37,255,33,255,27,255,21,255,23,255,23,255,19,255,22,255,12,255,9,255, + 8,255,0,255,247,254,236,254,234,254,223,254,220,254,214,254,218,254,227,254,229,254,247,254,0,255,12,255,23,255,25,255,26,255,40,255,48,255,61,255, + 70,255,91,255,116,255,142,255,167,255,191,255,208,255,224,255,238,255,252,255,14,0,22,0,36,0,46,0,60,0,79,0,96,0,104,0,123,0,141,0, + 173,0,186,0,201,0,213,0,230,0,237,0,231,0,229,0,215,0,202,0,194,0,187,0,193,0,202,0,215,0,215,0,212,0,201,0,201,0,204,0, + 201,0,191,0,188,0,186,0,190,0,183,0,175,0,169,0,166,0,159,0,148,0,139,0,140,0,120,0,105,0,86,0,76,0,62,0,57,0,46,0, + 44,0,35,0,28,0,12,0,6,0,252,255,252,255,241,255,239,255,244,255,244,255,248,255,0,0,10,0,12,0,25,0,37,0,42,0,46,0,48,0, + 37,0,30,0,30,0,35,0,35,0,40,0,44,0,47,0,58,0,72,0,71,0,72,0,65,0,58,0,51,0,42,0,39,0,37,0,29,0,30,0, + 35,0,28,0,15,0,17,0,12,0,12,0,14,0,17,0,24,0,29,0,33,0,37,0,36,0,28,0,24,0,24,0,12,0,4,0,253,255,239,255, + 226,255,219,255,202,255,198,255,198,255,199,255,194,255,190,255,187,255,190,255,190,255,191,255,187,255,198,255,195,255,201,255,209,255,217,255,227,255,237,255, + 239,255,244,255,250,255,255,255,0,0,10,0,17,0,29,0,39,0,47,0,43,0,54,0,57,0,62,0,78,0,82,0,94,0,100,0,104,0,98,0, + 102,0,97,0,96,0,84,0,82,0,76,0,68,0,64,0,60,0,54,0,57,0,50,0,51,0,46,0,42,0,40,0,37,0,47,0,51,0,65,0, + 79,0,83,0,101,0,111,0,125,0,139,0,148,0,148,0,152,0,155,0,157,0,161,0,162,0,165,0,169,0,173,0,176,0,175,0,172,0,165,0, + 161,0,152,0,148,0,139,0,134,0,126,0,114,0,94,0,76,0,61,0,54,0,39,0,39,0,46,0,39,0,40,0,33,0,29,0,22,0,4,0, + 241,255,216,255,203,255,188,255,173,255,172,255,159,255,165,255,159,255,145,255,145,255,145,255,142,255,134,255,136,255,144,255,151,255,165,255,163,255,162,255, + 158,255,154,255,156,255,144,255,136,255,123,255,119,255,108,255,95,255,86,255,79,255,81,255,73,255,63,255,61,255,57,255,54,255,48,255,51,255,54,255, + 44,255,43,255,47,255,44,255,48,255,57,255,62,255,68,255,63,255,59,255,54,255,54,255,55,255,57,255,58,255,62,255,54,255,61,255,65,255,58,255, + 50,255,36,255,23,255,9,255,8,255,3,255,1,255,7,255,7,255,3,255,0,255,243,254,242,254,239,254,1,255,14,255,26,255,43,255,57,255,70,255, + 84,255,81,255,101,255,112,255,133,255,147,255,165,255,177,255,194,255,201,255,224,255,234,255,6,0,30,0,51,0,72,0,93,0,109,0,123,0,125,0, + 141,0,151,0,175,0,186,0,205,0,219,0,234,0,235,0,230,0,220,0,213,0,209,0,202,0,204,0,201,0,209,0,216,0,216,0,213,0,204,0, + 206,0,194,0,183,0,184,0,179,0,186,0,181,0,173,0,165,0,155,0,147,0,130,0,125,0,129,0,122,0,120,0,119,0,105,0,107,0,89,0, + 78,0,66,0,51,0,46,0,40,0,35,0,33,0,25,0,17,0,15,0,14,0,11,0,4,0,15,0,25,0,22,0,21,0,28,0,26,0,35,0, + 33,0,39,0,36,0,35,0,29,0,32,0,37,0,40,0,53,0,65,0,78,0,79,0,79,0,83,0,86,0,72,0,68,0,62,0,46,0,36,0, + 40,0,37,0,42,0,37,0,42,0,62,0,55,0,57,0,60,0,55,0,55,0,46,0,43,0,33,0,28,0,19,0,17,0,253,255,245,255,244,255, + 234,255,220,255,208,255,208,255,201,255,201,255,205,255,205,255,216,255,216,255,212,255,203,255,191,255,187,255,178,255,177,255,183,255,196,255,208,255,227,255, + 237,255,252,255,255,255,253,255,252,255,4,0,11,0,15,0,26,0,28,0,47,0,61,0,69,0,80,0,83,0,80,0,75,0,79,0,78,0,68,0, + 75,0,75,0,80,0,86,0,83,0,89,0,86,0,84,0,84,0,78,0,71,0,69,0,61,0,58,0,54,0,46,0,50,0,51,0,48,0,50,0, + 58,0,61,0,72,0,75,0,87,0,94,0,100,0,114,0,119,0,122,0,126,0,136,0,137,0,152,0,151,0,158,0,154,0,155,0,158,0,157,0, + 155,0,151,0,147,0,139,0,122,0,97,0,91,0,68,0,65,0,53,0,43,0,32,0,30,0,26,0,30,0,30,0,22,0,30,0,17,0,253,255, + 237,255,214,255,194,255,172,255,165,255,155,255,149,255,145,255,144,255,148,255,138,255,133,255,124,255,120,255,123,255,126,255,117,255,122,255,115,255,117,255, + 117,255,117,255,116,255,115,255,115,255,117,255,120,255,126,255,133,255,127,255,123,255,115,255,104,255,95,255,81,255,91,255,90,255,80,255,81,255,75,255, + 70,255,63,255,61,255,55,255,47,255,43,255,52,255,54,255,65,255,66,255,81,255,81,255,80,255,75,255,81,255,83,255,75,255,79,255,73,255,68,255, + 55,255,47,255,39,255,26,255,25,255,15,255,19,255,12,255,22,255,23,255,21,255,9,255,3,255,252,254,252,254,250,254,1,255,14,255,23,255,36,255, + 43,255,55,255,69,255,88,255,104,255,116,255,126,255,130,255,155,255,177,255,198,255,221,255,238,255,7,0,29,0,50,0,69,0,97,0,114,0,126,0, + 139,0,140,0,145,0,161,0,170,0,179,0,195,0,201,0,212,0,219,0,222,0,217,0,213,0,206,0,211,0,211,0,206,0,205,0,215,0,223,0, + 220,0,223,0,205,0,198,0,187,0,184,0,175,0,169,0,162,0,159,0,154,0,143,0,134,0,129,0,127,0,126,0,122,0,130,0,122,0,119,0, + 104,0,94,0,80,0,75,0,61,0,51,0,51,0,42,0,37,0,37,0,35,0,30,0,25,0,30,0,24,0,33,0,30,0,25,0,25,0,28,0, + 29,0,36,0,37,0,44,0,58,0,71,0,73,0,75,0,78,0,75,0,71,0,76,0,71,0,76,0,82,0,72,0,76,0,64,0,51,0,48,0, + 43,0,42,0,39,0,50,0,58,0,64,0,73,0,79,0,80,0,71,0,55,0,50,0,46,0,28,0,24,0,19,0,12,0,7,0,253,255,245,255, + 231,255,223,255,223,255,216,255,219,255,216,255,223,255,224,255,221,255,213,255,202,255,195,255,187,255,178,255,183,255,184,255,181,255,185,255,191,255,202,255, + 212,255,226,255,232,255,252,255,1,0,8,0,11,0,18,0,25,0,29,0,46,0,53,0,60,0,58,0,54,0,54,0,54,0,57,0,51,0,60,0, + 60,0,60,0,68,0,61,0,62,0,73,0,76,0,76,0,82,0,83,0,75,0,71,0,60,0,55,0,46,0,47,0,47,0,51,0,54,0,60,0, + 47,0,51,0,53,0,55,0,58,0,55,0,68,0,79,0,89,0,97,0,104,0,120,0,132,0,134,0,141,0,139,0,140,0,139,0,148,0,148,0, + 140,0,136,0,125,0,116,0,96,0,91,0,78,0,66,0,51,0,46,0,40,0,32,0,26,0,14,0,10,0,6,0,0,0,245,255,232,255,219,255, + 205,255,184,255,170,255,165,255,156,255,158,255,154,255,141,255,142,255,138,255,129,255,129,255,130,255,124,255,117,255,101,255,91,255,97,255,91,255,95,255, + 98,255,99,255,108,255,115,255,116,255,124,255,129,255,129,255,129,255,138,255,140,255,140,255,136,255,140,255,141,255,142,255,126,255,119,255,117,255,109,255, + 109,255,94,255,83,255,81,255,75,255,72,255,65,255,69,255,66,255,68,255,70,255,76,255,76,255,87,255,97,255,94,255,91,255,80,255,77,255,77,255, + 70,255,73,255,66,255,63,255,63,255,50,255,40,255,30,255,25,255,19,255,26,255,32,255,18,255,21,255,14,255,8,255,9,255,14,255,21,255,32,255, + 47,255,57,255,73,255,90,255,106,255,116,255,123,255,136,255,147,255,163,255,183,255,202,255,234,255,6,0,18,0,33,0,54,0,65,0,87,0,97,0, + 116,0,134,0,144,0,154,0,152,0,161,0,169,0,175,0,191,0,212,0,217,0,227,0,219,0,222,0,212,0,204,0,213,0,209,0,213,0,212,0, + 212,0,211,0,208,0,204,0,193,0,181,0,173,0,166,0,154,0,148,0,141,0,140,0,133,0,125,0,129,0,123,0,132,0,118,0,127,0,120,0, + 120,0,118,0,108,0,105,0,94,0,84,0,71,0,61,0,60,0,50,0,61,0,47,0,46,0,40,0,40,0,32,0,40,0,39,0,30,0,32,0, + 28,0,29,0,35,0,48,0,61,0,61,0,66,0,79,0,83,0,83,0,78,0,75,0,60,0,62,0,58,0,61,0,64,0,66,0,68,0,68,0, + 66,0,68,0,72,0,73,0,73,0,76,0,79,0,83,0,83,0,82,0,72,0,66,0,58,0,57,0,48,0,35,0,32,0,15,0,18,0,10,0, + 248,255,253,255,245,255,239,255,235,255,230,255,231,255,228,255,226,255,216,255,206,255,198,255,187,255,181,255,184,255,187,255,190,255,194,255,198,255,206,255, + 216,255,227,255,241,255,245,255,253,255,8,0,19,0,29,0,33,0,33,0,29,0,26,0,17,0,17,0,22,0,15,0,22,0,36,0,33,0,35,0, + 44,0,50,0,61,0,64,0,75,0,78,0,83,0,79,0,79,0,76,0,80,0,79,0,79,0,82,0,73,0,68,0,65,0,55,0,57,0,44,0, + 48,0,43,0,48,0,51,0,57,0,53,0,51,0,48,0,55,0,72,0,84,0,96,0,107,0,115,0,119,0,119,0,130,0,130,0,133,0,136,0, + 136,0,127,0,123,0,104,0,93,0,83,0,73,0,62,0,48,0,47,0,33,0,26,0,14,0,255,255,250,255,246,255,226,255,206,255,180,255,180,255, + 170,255,170,255,170,255,162,255,159,255,155,255,147,255,148,255,136,255,124,255,116,255,111,255,104,255,97,255,91,255,97,255,95,255,97,255,97,255,91,255, + 87,255,88,255,97,255,98,255,101,255,112,255,116,255,116,255,120,255,126,255,129,255,148,255,160,255,173,255,176,255,178,255,172,255,170,255,162,255,152,255, + 136,255,120,255,111,255,116,255,111,255,106,255,111,255,108,255,97,255,94,255,88,255,84,255,87,255,86,255,87,255,93,255,97,255,98,255,87,255,88,255, + 86,255,87,255,88,255,91,255,91,255,80,255,80,255,70,255,55,255,36,255,37,255,48,255,40,255,44,255,41,255,40,255,41,255,44,255,36,255,40,255, + 52,255,63,255,73,255,90,255,98,255,106,255,123,255,129,255,149,255,160,255,178,255,198,255,221,255,237,255,6,0,21,0,25,0,43,0,54,0,75,0, + 98,0,107,0,115,0,125,0,126,0,143,0,155,0,163,0,175,0,191,0,209,0,213,0,206,0,211,0,213,0,205,0,208,0,209,0,215,0,212,0, + 215,0,215,0,213,0,198,0,188,0,177,0,163,0,150,0,150,0,139,0,144,0,145,0,144,0,141,0,145,0,139,0,139,0,136,0,133,0,123,0, + 126,0,111,0,104,0,105,0,98,0,91,0,84,0,75,0,62,0,55,0,48,0,51,0,48,0,42,0,44,0,40,0,37,0,42,0,35,0,28,0, + 29,0,32,0,39,0,39,0,51,0,72,0,69,0,79,0,86,0,82,0,84,0,87,0,83,0,72,0,66,0,55,0,58,0,61,0,62,0,62,0, + 84,0,83,0,80,0,82,0,72,0,65,0,65,0,69,0,71,0,69,0,71,0,68,0,64,0,66,0,66,0,66,0,65,0,57,0,44,0,28,0, + 17,0,8,0,8,0,7,0,252,255,248,255,239,255,232,255,221,255,213,255,205,255,198,255,202,255,202,255,201,255,202,255,208,255,209,255,203,255,206,255, + 210,255,223,255,234,255,237,255,242,255,245,255,252,255,6,0,253,255,1,0,12,0,1,0,8,0,4,0,4,0,3,0,11,0,17,0,21,0,26,0, + 30,0,35,0,48,0,61,0,64,0,58,0,58,0,54,0,54,0,57,0,58,0,54,0,60,0,65,0,62,0,65,0,64,0,65,0,55,0,55,0, + 47,0,43,0,37,0,35,0,26,0,28,0,29,0,26,0,26,0,37,0,46,0,53,0,69,0,82,0,86,0,93,0,100,0,111,0,118,0,109,0, + 105,0,101,0,96,0,84,0,72,0,72,0,62,0,51,0,36,0,26,0,21,0,11,0,6,0,248,255,232,255,220,255,203,255,183,255,177,255,160,255, + 154,255,148,255,149,255,151,255,154,255,141,255,133,255,123,255,115,255,120,255,113,255,112,255,112,255,104,255,101,255,95,255,94,255,88,255,90,255,90,255, + 86,255,90,255,88,255,95,255,102,255,104,255,108,255,115,255,111,255,122,255,131,255,149,255,170,255,181,255,187,255,192,255,196,255,195,255,202,255,194,255, + 192,255,180,255,169,255,162,255,155,255,147,255,142,255,134,255,133,255,123,255,120,255,109,255,98,255,91,255,93,255,93,255,80,255,80,255,84,255,93,255, + 98,255,102,255,111,255,116,255,112,255,109,255,97,255,87,255,70,255,58,255,47,255,37,255,34,255,39,255,50,255,63,255,66,255,70,255,76,255,79,255, + 87,255,86,255,95,255,102,255,111,255,127,255,144,255,156,255,167,255,176,255,195,255,216,255,227,255,244,255,250,255,4,0,14,0,22,0,35,0,42,0, + 48,0,65,0,75,0,79,0,94,0,111,0,119,0,144,0,144,0,163,0,175,0,180,0,186,0,194,0,195,0,197,0,198,0,202,0,208,0,206,0, + 209,0,206,0,204,0,199,0,190,0,180,0,161,0,150,0,139,0,139,0,143,0,145,0,150,0,147,0,150,0,148,0,147,0,136,0,114,0,112,0, + 119,0,112,0,107,0,105,0,100,0,91,0,84,0,72,0,69,0,60,0,68,0,62,0,58,0,58,0,54,0,43,0,43,0,43,0,43,0,36,0, + 39,0,36,0,42,0,48,0,55,0,53,0,65,0,62,0,72,0,78,0,76,0,71,0,73,0,80,0,72,0,66,0,64,0,65,0,64,0,65,0, + 65,0,61,0,62,0,73,0,69,0,71,0,80,0,86,0,84,0,91,0,93,0,97,0,96,0,93,0,83,0,86,0,76,0,66,0,64,0,57,0, + 42,0,36,0,25,0,25,0,15,0,12,0,4,0,245,255,242,255,235,255,230,255,228,255,226,255,226,255,230,255,227,255,234,255,227,255,220,255,231,255, + 235,255,230,255,231,255,238,255,235,255,238,255,241,255,238,255,242,255,248,255,241,255,242,255,237,255,237,255,244,255,250,255,253,255,1,0,14,0,22,0, + 25,0,30,0,37,0,47,0,55,0,39,0,43,0,47,0,47,0,54,0,64,0,58,0,61,0,65,0,64,0,53,0,57,0,54,0,57,0,55,0, + 42,0,37,0,43,0,32,0,22,0,12,0,10,0,17,0,26,0,40,0,42,0,48,0,46,0,61,0,61,0,65,0,76,0,75,0,82,0,75,0, + 73,0,79,0,71,0,61,0,58,0,47,0,44,0,40,0,32,0,25,0,14,0,6,0,245,255,226,255,214,255,203,255,190,255,174,255,165,255,148,255, + 142,255,137,255,137,255,126,255,123,255,120,255,113,255,104,255,102,255,95,255,98,255,95,255,97,255,99,255,109,255,102,255,104,255,95,255,97,255,94,255, + 95,255,94,255,97,255,98,255,104,255,106,255,115,255,119,255,119,255,133,255,144,255,149,255,165,255,174,255,191,255,198,255,209,255,208,255,205,255,205,255, + 203,255,195,255,194,255,194,255,190,255,178,255,167,255,156,255,154,255,136,255,130,255,123,255,120,255,117,255,105,255,98,255,91,255,88,255,87,255,90,255, + 99,255,105,255,113,255,122,255,126,255,120,255,122,255,115,255,105,255,95,255,86,255,77,255,72,255,72,255,61,255,68,255,68,255,80,255,87,255,104,255, + 98,255,109,255,109,255,115,255,127,255,134,255,149,255,169,255,183,255,199,255,214,255,223,255,227,255,239,255,239,255,253,255,7,0,11,0,17,0,29,0, + 35,0,40,0,43,0,55,0,68,0,72,0,82,0,93,0,115,0,127,0,136,0,150,0,161,0,172,0,181,0,184,0,193,0,187,0,184,0,184,0, + 176,0,181,0,183,0,183,0,181,0,173,0,170,0,159,0,147,0,130,0,130,0,133,0,136,0,134,0,141,0,134,0,130,0,129,0,120,0,107,0, + 107,0,100,0,100,0,96,0,94,0,80,0,80,0,76,0,69,0,65,0,62,0,65,0,71,0,72,0,68,0,69,0,66,0,66,0,53,0,47,0, + 44,0,55,0,54,0,53,0,51,0,54,0,51,0,53,0,64,0,71,0,64,0,57,0,64,0,69,0,76,0,80,0,73,0,69,0,64,0,62,0, + 53,0,53,0,50,0,58,0,66,0,66,0,80,0,89,0,100,0,100,0,109,0,116,0,118,0,114,0,107,0,108,0,96,0,101,0,78,0,78,0, + 66,0,71,0,69,0,55,0,46,0,39,0,22,0,10,0,253,255,245,255,237,255,235,255,237,255,241,255,244,255,242,255,249,255,242,255,238,255,237,255, + 234,255,237,255,238,255,224,255,228,255,230,255,232,255,231,255,231,255,230,255,230,255,242,255,237,255,241,255,239,255,245,255,255,255,1,0,3,0,14,0, + 22,0,25,0,29,0,28,0,35,0,33,0,40,0,37,0,36,0,29,0,29,0,26,0,37,0,43,0,46,0,53,0,61,0,60,0,64,0,55,0, + 48,0,44,0,39,0,29,0,24,0,29,0,29,0,33,0,26,0,36,0,36,0,37,0,48,0,50,0,50,0,50,0,51,0,54,0,51,0,53,0, + 57,0,51,0,48,0,43,0,42,0,35,0,26,0,26,0,24,0,18,0,8,0,0,0,238,255,227,255,217,255,199,255,192,255,184,255,173,255,169,255, + 155,255,141,255,130,255,120,255,119,255,115,255,117,255,115,255,116,255,112,255,113,255,106,255,109,255,109,255,109,255,119,255,123,255,129,255,131,255,130,255, + 126,255,124,255,108,255,111,255,119,255,120,255,123,255,133,255,144,255,147,255,149,255,156,255,163,255,178,255,180,255,185,255,191,255,201,255,209,255,217,255, + 217,255,221,255,221,255,223,255,219,255,212,255,202,255,188,255,183,255,169,255,154,255,140,255,129,255,130,255,123,255,123,255,122,255,117,255,115,255,111,255, + 117,255,117,255,116,255,111,255,120,255,119,255,126,255,117,255,113,255,113,255,116,255,106,255,106,255,94,255,93,255,98,255,94,255,102,255,102,255,120,255, + 117,255,117,255,131,255,137,255,142,255,151,255,159,255,173,255,185,255,194,255,199,255,217,255,226,255,227,255,242,255,252,255,3,0,12,0,8,0,18,0, + 22,0,32,0,37,0,43,0,53,0,55,0,68,0,72,0,82,0,93,0,100,0,109,0,120,0,141,0,144,0,169,0,168,0,168,0,165,0,168,0, + 159,0,154,0,148,0,158,0,162,0,170,0,161,0,165,0,158,0,148,0,141,0,134,0,132,0,125,0,127,0,115,0,116,0,120,0,108,0,94,0, + 86,0,89,0,80,0,76,0,71,0,64,0,64,0,60,0,62,0,65,0,58,0,58,0,65,0,65,0,66,0,75,0,69,0,72,0,79,0,73,0, + 66,0,61,0,60,0,54,0,62,0,61,0,65,0,54,0,55,0,50,0,53,0,50,0,44,0,42,0,43,0,48,0,51,0,50,0,54,0,53,0, + 57,0,58,0,50,0,46,0,51,0,51,0,55,0,68,0,80,0,89,0,100,0,107,0,118,0,127,0,120,0,108,0,105,0,97,0,80,0,71,0, + 64,0,66,0,76,0,69,0,75,0,69,0,60,0,46,0,30,0,19,0,1,0,248,255,244,255,242,255,241,255,249,255,246,255,246,255,248,255,238,255, + 235,255,227,255,220,255,214,255,213,255,224,255,224,255,228,255,235,255,228,255,234,255,228,255,234,255,234,255,232,255,246,255,250,255,249,255,255,255,0,0, + 0,0,4,0,3,0,0,0,0,0,7,0,10,0,8,0,17,0,19,0,24,0,22,0,29,0,28,0,32,0,32,0,43,0,48,0,48,0,43,0, + 40,0,36,0,33,0,29,0,37,0,36,0,33,0,36,0,32,0,35,0,32,0,33,0,29,0,26,0,28,0,25,0,36,0,46,0,42,0,33,0, + 28,0,30,0,29,0,25,0,25,0,14,0,18,0,17,0,6,0,1,0,253,255,245,255,239,255,230,255,224,255,216,255,203,255,201,255,190,255,181,255, + 162,255,147,255,129,255,126,255,126,255,124,255,119,255,120,255,127,255,119,255,119,255,126,255,124,255,124,255,129,255,131,255,137,255,138,255,138,255,142,255, + 145,255,138,255,138,255,136,255,140,255,145,255,144,255,147,255,149,255,152,255,159,255,165,255,166,255,174,255,180,255,174,255,184,255,190,255,196,255,208,255, + 216,255,221,255,223,255,231,255,227,255,227,255,216,255,212,255,203,255,191,255,184,255,172,255,169,255,159,255,145,255,138,255,137,255,133,255,130,255,127,255, + 122,255,123,255,123,255,123,255,116,255,123,255,113,255,119,255,120,255,124,255,117,255,131,255,129,255,123,255,127,255,130,255,129,255,137,255,136,255,144,255, + 141,255,145,255,142,255,145,255,151,255,163,255,178,255,191,255,198,255,214,255,216,255,220,255,223,255,230,255,232,255,244,255,1,0,11,0,18,0,28,0, + 22,0,29,0,29,0,35,0,39,0,44,0,54,0,62,0,69,0,83,0,86,0,91,0,97,0,104,0,109,0,132,0,133,0,143,0,140,0,141,0, + 141,0,137,0,145,0,143,0,141,0,144,0,141,0,139,0,148,0,144,0,140,0,126,0,126,0,130,0,119,0,119,0,114,0,105,0,100,0,96,0, + 90,0,83,0,80,0,83,0,76,0,71,0,62,0,58,0,50,0,46,0,44,0,48,0,48,0,55,0,58,0,64,0,75,0,78,0,78,0,76,0, + 76,0,73,0,66,0,65,0,61,0,58,0,55,0,60,0,68,0,69,0,64,0,55,0,47,0,44,0,42,0,35,0,36,0,33,0,37,0,44,0, + 50,0,51,0,53,0,55,0,46,0,60,0,61,0,72,0,71,0,73,0,82,0,97,0,104,0,105,0,109,0,112,0,115,0,111,0,115,0,105,0, + 101,0,86,0,73,0,68,0,73,0,68,0,58,0,55,0,53,0,39,0,36,0,24,0,17,0,12,0,7,0,255,255,239,255,231,255,231,255,228,255, + 224,255,220,255,220,255,220,255,217,255,219,255,228,255,224,255,224,255,230,255,232,255,235,255,237,255,238,255,244,255,239,255,241,255,230,255,244,255,244,255, + 241,255,239,255,242,255,242,255,245,255,246,255,6,0,0,0,12,0,7,0,8,0,3,0,11,0,8,0,17,0,18,0,19,0,24,0,26,0,22,0, + 24,0,26,0,25,0,26,0,29,0,42,0,40,0,42,0,37,0,44,0,44,0,33,0,37,0,28,0,26,0,22,0,12,0,19,0,18,0,22,0, + 18,0,14,0,12,0,14,0,19,0,17,0,12,0,10,0,4,0,3,0,0,0,253,255,237,255,231,255,227,255,216,255,206,255,198,255,185,255,177,255, + 166,255,158,255,149,255,151,255,138,255,140,255,140,255,144,255,136,255,136,255,134,255,134,255,137,255,137,255,137,255,142,255,154,255,149,255,152,255,149,255, + 155,255,154,255,156,255,155,255,155,255,156,255,151,255,152,255,158,255,158,255,162,255,169,255,172,255,176,255,170,255,169,255,174,255,178,255,183,255,184,255, + 190,255,196,255,209,255,216,255,217,255,209,255,213,255,214,255,214,255,214,255,199,255,201,255,201,255,191,255,180,255,173,255,160,255,155,255,145,255,136,255, + 133,255,134,255,133,255,130,255,130,255,133,255,133,255,129,255,126,255,127,255,127,255,131,255,127,255,131,255,136,255,141,255,149,255,155,255,166,255,173,255, + 170,255,178,255,170,255,176,255,184,255,184,255,185,255,198,255,199,255,206,255,220,255,231,255,232,255,241,255,237,255,245,255,249,255,253,255,3,0,10,0, + 19,0,29,0,35,0,32,0,30,0,42,0,44,0,54,0,54,0,55,0,65,0,71,0,82,0,87,0,98,0,107,0,108,0,116,0,130,0,130,0, + 130,0,129,0,134,0,127,0,127,0,127,0,118,0,127,0,126,0,126,0,126,0,123,0,118,0,118,0,115,0,105,0,107,0,100,0,86,0,86,0, + 89,0,82,0,79,0,75,0,73,0,75,0,76,0,61,0,60,0,43,0,39,0,35,0,42,0,50,0,51,0,57,0,66,0,71,0,73,0,68,0, + 71,0,73,0,66,0,65,0,53,0,61,0,61,0,60,0,54,0,57,0,57,0,51,0,50,0,40,0,42,0,39,0,35,0,35,0,33,0,29,0, + 32,0,42,0,40,0,48,0,46,0,55,0,57,0,69,0,76,0,80,0,79,0,86,0,93,0,101,0,105,0,101,0,108,0,115,0,111,0,108,0, + 112,0,112,0,111,0,104,0,104,0,86,0,75,0,71,0,64,0,61,0,54,0,40,0,35,0,18,0,12,0,3,0,252,255,238,255,237,255,228,255, + 219,255,212,255,199,255,202,255,203,255,209,255,216,255,217,255,220,255,221,255,224,255,228,255,226,255,231,255,239,255,242,255,239,255,242,255,242,255,246,255, + 230,255,234,255,234,255,228,255,228,255,231,255,237,255,246,255,1,0,3,0,6,0,11,0,3,0,3,0,250,255,252,255,253,255,1,0,3,0,6,0, + 11,0,12,0,14,0,28,0,24,0,35,0,32,0,24,0,15,0,21,0,15,0,10,0,12,0,18,0,22,0,18,0,19,0,19,0,10,0,7,0, + 10,0,15,0,8,0,1,0,12,0,4,0,0,0,252,255,255,255,244,255,246,255,238,255,234,255,227,255,221,255,213,255,208,255,198,255,191,255,188,255, + 181,255,174,255,177,255,167,255,163,255,162,255,159,255,162,255,158,255,156,255,145,255,145,255,144,255,142,255,144,255,145,255,141,255,151,255,160,255,170,255, + 170,255,167,255,167,255,173,255,181,255,187,255,183,255,187,255,178,255,173,255,169,255,169,255,170,255,176,255,183,255,181,255,190,255,188,255,196,255,203,255, + 209,255,205,255,205,255,209,255,209,255,214,255,214,255,206,255,210,255,206,255,203,255,209,255,206,255,196,255,199,255,199,255,198,255,183,255,174,255,165,255, + 156,255,152,255,148,255,144,255,149,255,148,255,152,255,147,255,142,255,133,255,138,255,138,255,136,255,142,255,144,255,140,255,148,255,142,255,154,255,160,255, + 170,255,177,255,176,255,183,255,183,255,190,255,194,255,198,255,212,255,217,255,223,255,224,255,238,255,238,255,242,255,248,255,250,255,248,255,253,255,6,0, + 12,0,17,0,21,0,21,0,32,0,37,0,43,0,48,0,53,0,58,0,62,0,68,0,75,0,84,0,94,0,100,0,105,0,115,0,112,0,112,0, + 119,0,120,0,122,0,125,0,120,0,129,0,127,0,123,0,120,0,109,0,114,0,109,0,112,0,109,0,111,0,107,0,102,0,90,0,91,0,83,0, + 82,0,75,0,69,0,68,0,72,0,75,0,75,0,80,0,76,0,76,0,64,0,61,0,50,0,55,0,54,0,61,0,61,0,69,0,66,0,66,0, + 55,0,65,0,65,0,55,0,57,0,55,0,50,0,43,0,43,0,50,0,51,0,47,0,48,0,51,0,54,0,53,0,53,0,54,0,51,0,48,0, + 43,0,46,0,39,0,37,0,37,0,50,0,54,0,65,0,66,0,72,0,69,0,71,0,79,0,86,0,82,0,89,0,84,0,94,0,94,0,94,0, + 93,0,94,0,93,0,96,0,93,0,89,0,91,0,90,0,78,0,69,0,61,0,50,0,37,0,24,0,11,0,6,0,249,255,246,255,230,255,231,255, + 226,255,212,255,212,255,208,255,198,255,199,255,201,255,203,255,205,255,210,255,216,255,217,255,220,255,216,255,217,255,226,255,216,255,216,255,232,255,228,255, + 227,255,231,255,232,255,234,255,230,255,235,255,232,255,230,255,237,255,238,255,244,255,245,255,244,255,248,255,246,255,249,255,1,0,4,0,14,0,6,0, + 7,0,8,0,8,0,10,0,17,0,21,0,17,0,21,0,11,0,6,0,7,0,3,0,8,0,4,0,7,0,17,0,19,0,19,0,19,0,15,0, + 19,0,10,0,6,0,7,0,7,0,6,0,4,0,250,255,241,255,244,255,227,255,224,255,219,255,217,255,210,255,210,255,210,255,206,255,202,255,209,255, + 210,255,209,255,205,255,199,255,203,255,195,255,192,255,184,255,176,255,170,255,172,255,166,255,170,255,163,255,158,255,162,255,169,255,172,255,183,255,177,255, + 180,255,185,255,185,255,185,255,190,255,184,255,185,255,194,255,191,255,184,255,181,255,181,255,174,255,177,255,181,255,185,255,194,255,188,255,201,255,210,255, + 209,255,210,255,205,255,209,255,201,255,206,255,212,255,210,255,210,255,209,255,206,255,205,255,196,255,196,255,195,255,201,255,196,255,192,255,196,255,178,255, + 176,255,177,255,170,255,167,255,166,255,166,255,163,255,165,255,167,255,162,255,159,255,155,255,148,255,142,255,147,255,147,255,151,255,147,255,158,255,165,255, + 173,255,173,255,178,255,184,255,190,255,195,255,199,255,201,255,210,255,217,255,220,255,226,255,228,255,235,255,238,255,241,255,249,255,0,0,7,0,8,0, + 12,0,17,0,18,0,28,0,25,0,24,0,28,0,29,0,35,0,47,0,58,0,58,0,65,0,76,0,84,0,84,0,91,0,94,0,91,0,96,0, + 102,0,107,0,107,0,111,0,112,0,122,0,120,0,123,0,126,0,118,0,108,0,101,0,89,0,97,0,91,0,90,0,91,0,97,0,91,0,82,0, + 73,0,64,0,61,0,65,0,57,0,62,0,64,0,66,0,79,0,80,0,80,0,78,0,75,0,75,0,71,0,64,0,64,0,60,0,62,0,62,0, + 58,0,57,0,60,0,60,0,54,0,50,0,46,0,47,0,47,0,37,0,39,0,39,0,39,0,43,0,50,0,47,0,46,0,48,0,54,0,51,0, + 43,0,40,0,30,0,37,0,42,0,48,0,53,0,61,0,55,0,62,0,66,0,75,0,78,0,80,0,82,0,93,0,96,0,93,0,94,0,93,0, + 96,0,93,0,89,0,87,0,87,0,87,0,79,0,78,0,80,0,68,0,60,0,50,0,36,0,26,0,12,0,12,0,3,0,249,255,242,255,239,255, + 239,255,228,255,226,255,219,255,210,255,208,255,206,255,196,255,194,255,196,255,201,255,208,255,205,255,208,255,205,255,205,255,209,255,209,255,208,255,214,255, + 221,255,226,255,227,255,234,255,237,255,241,255,246,255,246,255,242,255,249,255,248,255,252,255,1,0,255,255,0,0,253,255,6,0,3,0,7,0,6,0, + 0,0,10,0,12,0,17,0,11,0,8,0,4,0,3,0,255,255,252,255,6,0,4,0,7,0,4,0,0,0,6,0,8,0,11,0,14,0,21,0, + 19,0,15,0,14,0,14,0,10,0,1,0,249,255,245,255,234,255,230,255,228,255,232,255,220,255,223,255,216,255,217,255,208,255,206,255,209,255,206,255, + 205,255,205,255,205,255,201,255,199,255,201,255,198,255,201,255,198,255,194,255,190,255,184,255,191,255,191,255,187,255,187,255,187,255,188,255,194,255,192,255, + 192,255,192,255,187,255,192,255,191,255,191,255,194,255,192,255,185,255,188,255,191,255,194,255,191,255,187,255,187,255,192,255,191,255,195,255,199,255,202,255, + 212,255,219,255,214,255,216,255,206,255,206,255,210,255,212,255,209,255,205,255,206,255,203,255,205,255,198,255,196,255,201,255,198,255,191,255,192,255,191,255, + 195,255,191,255,187,255,181,255,183,255,184,255,187,255,188,255,190,255,184,255,183,255,173,255,178,255,170,255,167,255,159,255,165,255,165,255,167,255,174,255, + 181,255,188,255,184,255,198,255,196,255,195,255,196,255,203,255,205,255,214,255,220,255,223,255,234,255,237,255,235,255,244,255,250,255,255,255,4,0,18,0, + 12,0,11,0,15,0,25,0,37,0,35,0,39,0,48,0,43,0,43,0,44,0,53,0,57,0,62,0,61,0,68,0,71,0,72,0,76,0,79,0, + 87,0,90,0,96,0,102,0,97,0,98,0,101,0,115,0,120,0,125,0,119,0,107,0,105,0,105,0,90,0,87,0,93,0,90,0,94,0,97,0, + 93,0,80,0,80,0,73,0,65,0,60,0,64,0,61,0,66,0,73,0,76,0,78,0,84,0,82,0,80,0,75,0,73,0,71,0,65,0,65,0, + 62,0,51,0,48,0,48,0,46,0,44,0,40,0,47,0,44,0,44,0,43,0,50,0,44,0,40,0,39,0,42,0,42,0,46,0,40,0,40,0, + 30,0,37,0,36,0,37,0,39,0,48,0,47,0,51,0,55,0,58,0,65,0,66,0,73,0,80,0,84,0,91,0,84,0,94,0,93,0,83,0, + 83,0,82,0,82,0,75,0,71,0,66,0,60,0,60,0,62,0,50,0,36,0,28,0,18,0,11,0,4,0,1,0,0,0,0,0,253,255,246,255, + 237,255,228,255,224,255,220,255,214,255,206,255,198,255,201,255,199,255,201,255,194,255,194,255,196,255,195,255,202,255,196,255,199,255,201,255,208,255,206,255, + 214,255,221,255,224,255,220,255,221,255,228,255,227,255,234,255,239,255,252,255,249,255,1,0,1,0,252,255,253,255,249,255,255,255,3,0,253,255,0,0, + 1,0,7,0,4,0,12,0,7,0,7,0,7,0,7,0,3,0,244,255,253,255,248,255,249,255,245,255,0,0,0,0,3,0,11,0,12,0,12,0, + 15,0,6,0,3,0,6,0,253,255,249,255,245,255,245,255,244,255,244,255,241,255,234,255,230,255,226,255,216,255,217,255,208,255,208,255,206,255,216,255, + 219,255,210,255,216,255,205,255,210,255,213,255,213,255,208,255,206,255,202,255,203,255,196,255,187,255,185,255,190,255,181,255,181,255,192,255,187,255,190,255, + 195,255,199,255,203,255,202,255,190,255,199,255,203,255,198,255,194,255,187,255,188,255,187,255,191,255,187,255,188,255,180,255,191,255,184,255,190,255,187,255, + 195,255,198,255,202,255,202,255,209,255,208,255,210,255,213,255,212,255,212,255,214,255,216,255,206,255,213,255,210,255,208,255,205,255,202,255,198,255,203,255, + 199,255,195,255,194,255,191,255,192,255,190,255,183,255,191,255,187,255,187,255,180,255,177,255,173,255,167,255,169,255,166,255,173,255,178,255,180,255,181,255, + 188,255,194,255,198,255,196,255,203,255,203,255,199,255,199,255,206,255,213,255,213,255,219,255,230,255,231,255,242,255,242,255,242,255,250,255,252,255,7,0, + 15,0,19,0,30,0,30,0,26,0,30,0,30,0,30,0,42,0,47,0,55,0,54,0,51,0,61,0,55,0,64,0,62,0,62,0,65,0,76,0, + 75,0,79,0,82,0,82,0,82,0,86,0,84,0,83,0,89,0,97,0,90,0,101,0,100,0,97,0,101,0,102,0,97,0,97,0,94,0,84,0, + 90,0,76,0,72,0,80,0,72,0,76,0,64,0,61,0,60,0,61,0,58,0,75,0,75,0,75,0,79,0,69,0,71,0,66,0,57,0,53,0, + 48,0,50,0,51,0,46,0,42,0,46,0,53,0,47,0,47,0,42,0,37,0,36,0,32,0,32,0,33,0,35,0,36,0,39,0,29,0,28,0, + 30,0,32,0,28,0,29,0,32,0,33,0,35,0,44,0,51,0,55,0,64,0,68,0,69,0,80,0,83,0,86,0,82,0,79,0,87,0,83,0, + 72,0,62,0,64,0,57,0,58,0,61,0,64,0,66,0,62,0,53,0,44,0,30,0,25,0,21,0,18,0,255,255,255,255,250,255,245,255,245,255, + 244,255,234,255,231,255,228,255,217,255,213,255,210,255,213,255,212,255,210,255,214,255,206,255,209,255,209,255,205,255,206,255,206,255,198,255,205,255,206,255, + 206,255,205,255,212,255,216,255,217,255,227,255,231,255,235,255,242,255,244,255,0,0,3,0,0,0,4,0,6,0,4,0,7,0,255,255,0,0,255,255, + 6,0,8,0,14,0,15,0,17,0,18,0,8,0,3,0,0,0,1,0,4,0,7,0,7,0,4,0,3,0,4,0,1,0,250,255,11,0,12,0, + 10,0,7,0,255,255,3,0,250,255,241,255,234,255,237,255,230,255,238,255,237,255,241,255,237,255,235,255,238,255,228,255,228,255,226,255,219,255,212,255, + 217,255,221,255,208,255,212,255,212,255,209,255,201,255,210,255,210,255,206,255,210,255,205,255,203,255,194,255,196,255,190,255,192,255,194,255,196,255,198,255, + 199,255,196,255,192,255,194,255,190,255,195,255,198,255,188,255,184,255,180,255,181,255,187,255,195,255,196,255,191,255,195,255,195,255,188,255,188,255,187,255, + 185,255,194,255,191,255,195,255,196,255,199,255,195,255,201,255,201,255,205,255,201,255,202,255,203,255,213,255,216,255,213,255,212,255,208,255,199,255,198,255, + 209,255,209,255,209,255,210,255,208,255,206,255,199,255,191,255,176,255,172,255,172,255,176,255,187,255,178,255,185,255,187,255,184,255,185,255,191,255,195,255, + 195,255,202,255,203,255,210,255,210,255,208,255,212,255,213,255,219,255,226,255,230,255,231,255,232,255,234,255,238,255,234,255,237,255,245,255,255,255,4,0, + 7,0,12,0,12,0,24,0,24,0,26,0,28,0,30,0,33,0,33,0,33,0,39,0,47,0,43,0,48,0,55,0,60,0,61,0,61,0,57,0, + 57,0,57,0,55,0,57,0,68,0,69,0,71,0,71,0,72,0,78,0,72,0,82,0,83,0,93,0,96,0,93,0,93,0,89,0,87,0,89,0, + 91,0,82,0,83,0,84,0,78,0,76,0,71,0,69,0,75,0,68,0,69,0,71,0,68,0,78,0,69,0,65,0,69,0,61,0,64,0,64,0, + 53,0,57,0,58,0,47,0,54,0,51,0,55,0,46,0,43,0,43,0,43,0,33,0,36,0,32,0,30,0,29,0,29,0,22,0,14,0,14,0, + 21,0,36,0,39,0,36,0,35,0,40,0,43,0,42,0,42,0,48,0,60,0,48,0,54,0,66,0,55,0,62,0,62,0,62,0,69,0,64,0, + 66,0,65,0,64,0,62,0,64,0,64,0,58,0,46,0,51,0,47,0,40,0,35,0,30,0,19,0,15,0,8,0,1,0,255,255,238,255,238,255, + 238,255,237,255,239,255,235,255,232,255,226,255,228,255,221,255,213,255,219,255,213,255,212,255,208,255,205,255,213,255,212,255,212,255,216,255,213,255,209,255, + 206,255,206,255,214,255,216,255,219,255,220,255,228,255,234,255,244,255,246,255,255,255,1,0,1,0,8,0,4,0,4,0,12,0,14,0,12,0,10,0, + 15,0,22,0,18,0,28,0,24,0,21,0,15,0,18,0,12,0,14,0,17,0,17,0,19,0,19,0,17,0,12,0,4,0,1,0,0,0,249,255, + 252,255,1,0,3,0,250,255,248,255,248,255,242,255,237,255,237,255,227,255,230,255,231,255,235,255,235,255,238,255,230,255,235,255,219,255,221,255,227,255, + 228,255,221,255,210,255,209,255,210,255,210,255,210,255,212,255,216,255,208,255,209,255,195,255,195,255,195,255,196,255,196,255,191,255,187,255,195,255,198,255, + 201,255,203,255,206,255,196,255,195,255,205,255,201,255,195,255,194,255,191,255,195,255,192,255,190,255,190,255,187,255,195,255,198,255,196,255,196,255,192,255, + 192,255,187,255,195,255,195,255,195,255,202,255,206,255,210,255,208,255,212,255,206,255,205,255,213,255,213,255,217,255,223,255,223,255,223,255,228,255,227,255, + 220,255,221,255,216,255,217,255,223,255,212,255,203,255,201,255,195,255,196,255,190,255,192,255,191,255,191,255,188,255,192,255,194,255,201,255,201,255,205,255, + 206,255,209,255,209,255,216,255,210,255,212,255,217,255,221,255,220,255,226,255,230,255,235,255,241,255,242,255,245,255,250,255,237,255,241,255,250,255,252,255, + 7,0,11,0,18,0,18,0,29,0,24,0,24,0,33,0,32,0,36,0,35,0,33,0,39,0,48,0,46,0,43,0,44,0,60,0,64,0,57,0, + 62,0,68,0,62,0,60,0,64,0,66,0,65,0,61,0,73,0,75,0,78,0,72,0,79,0,75,0,83,0,76,0,83,0,86,0,80,0,86,0, + 89,0,90,0,90,0,87,0,89,0,84,0,87,0,83,0,82,0,82,0,71,0,65,0,61,0,60,0,54,0,55,0,60,0,60,0,66,0,64,0, + 69,0,61,0,57,0,61,0,48,0,42,0,32,0,37,0,36,0,39,0,39,0,39,0,37,0,36,0,36,0,24,0,28,0,25,0,24,0,25,0, + 22,0,28,0,33,0,28,0,30,0,33,0,33,0,35,0,35,0,37,0,39,0,36,0,33,0,30,0,33,0,33,0,33,0,30,0,33,0,32,0, + 43,0,40,0,40,0,44,0,44,0,40,0,42,0,33,0,32,0,28,0,28,0,22,0,30,0,28,0,24,0,15,0,6,0,3,0,253,255,244,255, + 237,255,226,255,221,255,226,255,226,255,223,255,234,255,226,255,230,255,228,255,220,255,212,255,212,255,212,255,208,255,203,255,203,255,206,255,210,255,213,255, + 220,255,230,255,224,255,223,255,227,255,226,255,226,255,226,255,231,255,238,255,237,255,238,255,241,255,245,255,250,255,0,0,250,255,255,255,7,0,11,0, + 15,0,15,0,15,0,17,0,14,0,15,0,30,0,25,0,24,0,21,0,22,0,24,0,24,0,12,0,18,0,15,0,15,0,7,0,8,0,7,0, + 0,0,252,255,246,255,245,255,244,255,252,255,248,255,237,255,239,255,244,255,238,255,237,255,237,255,235,255,230,255,231,255,221,255,228,255,232,255,234,255, + 232,255,231,255,226,255,228,255,219,255,214,255,216,255,216,255,212,255,212,255,212,255,205,255,210,255,206,255,195,255,199,255,187,255,190,255,190,255,187,255, + 188,255,196,255,201,255,205,255,209,255,194,255,190,255,199,255,192,255,191,255,181,255,181,255,183,255,181,255,183,255,185,255,191,255,199,255,195,255,190,255, + 188,255,185,255,190,255,194,255,192,255,192,255,195,255,202,255,205,255,205,255,206,255,213,255,212,255,210,255,208,255,209,255,210,255,217,255,213,255,213,255, + 219,255,221,255,219,255,219,255,217,255,213,255,208,255,203,255,201,255,198,255,196,255,195,255,192,255,194,255,196,255,192,255,192,255,198,255,203,255,205,255, + 213,255,213,255,220,255,227,255,234,255,231,255,227,255,235,255,237,255,238,255,245,255,245,255,249,255,248,255,248,255,253,255,255,255,4,0,4,0,3,0, + 0,0,3,0,8,0,10,0,17,0,15,0,26,0,32,0,33,0,32,0,30,0,29,0,39,0,40,0,37,0,39,0,37,0,50,0,53,0,62,0, + 60,0,54,0,61,0,65,0,66,0,66,0,69,0,64,0,60,0,64,0,71,0,76,0,73,0,78,0,83,0,80,0,76,0,78,0,83,0,82,0, + 79,0,87,0,80,0,76,0,78,0,82,0,86,0,90,0,83,0,76,0,72,0,61,0,61,0,57,0,61,0,53,0,55,0,68,0,72,0,69,0, + 66,0,66,0,60,0,48,0,51,0,47,0,39,0,42,0,42,0,46,0,47,0,42,0,37,0,35,0,39,0,32,0,28,0,28,0,19,0,19,0, + 29,0,28,0,35,0,28,0,32,0,32,0,37,0,36,0,39,0,32,0,35,0,25,0,14,0,18,0,17,0,24,0,24,0,35,0,30,0,29,0, + 33,0,33,0,30,0,32,0,30,0,24,0,21,0,21,0,21,0,22,0,18,0,14,0,12,0,8,0,14,0,10,0,8,0,8,0,1,0,1,0, + 250,255,241,255,237,255,234,255,231,255,234,255,237,255,231,255,221,255,217,255,220,255,223,255,224,255,226,255,228,255,224,255,221,255,219,255,214,255,220,255, + 220,255,227,255,226,255,228,255,227,255,230,255,228,255,232,255,232,255,234,255,235,255,239,255,245,255,249,255,255,255,3,0,6,0,11,0,18,0,24,0, + 19,0,18,0,19,0,26,0,24,0,26,0,24,0,24,0,29,0,36,0,26,0,29,0,25,0,19,0,18,0,18,0,12,0,17,0,11,0,10,0, + 8,0,12,0,7,0,255,255,246,255,241,255,242,255,244,255,246,255,246,255,245,255,242,255,235,255,228,255,230,255,223,255,226,255,227,255,230,255,237,255, + 232,255,230,255,231,255,231,255,232,255,231,255,213,255,212,255,206,255,196,255,196,255,194,255,192,255,195,255,194,255,195,255,192,255,188,255,195,255,195,255, + 190,255,187,255,183,255,191,255,187,255,190,255,190,255,187,255,190,255,187,255,188,255,187,255,188,255,190,255,188,255,192,255,194,255,191,255,194,255,190,255, + 191,255,191,255,192,255,187,255,190,255,190,255,190,255,201,255,203,255,198,255,203,255,206,255,209,255,212,255,210,255,206,255,201,255,209,255,210,255,213,255, + 217,255,217,255,214,255,214,255,217,255,219,255,216,255,210,255,208,255,212,255,213,255,208,255,213,255,210,255,209,255,208,255,206,255,209,255,212,255,210,255, + 214,255,219,255,221,255,220,255,228,255,231,255,238,255,238,255,234,255,239,255,238,255,246,255,244,255,244,255,250,255,4,0,255,255,253,255,1,0,4,0, + 3,0,14,0,14,0,18,0,19,0,19,0,29,0,24,0,24,0,21,0,29,0,33,0,39,0,39,0,42,0,46,0,48,0,46,0,47,0,51,0, + 39,0,50,0,50,0,61,0,57,0,66,0,61,0,62,0,64,0,62,0,61,0,61,0,66,0,68,0,71,0,79,0,79,0,80,0,75,0,76,0, + 75,0,73,0,83,0,91,0,86,0,93,0,83,0,73,0,83,0,84,0,80,0,79,0,79,0,73,0,71,0,69,0,68,0,58,0,57,0,54,0, + 62,0,61,0,58,0,57,0,55,0,57,0,54,0,51,0,48,0,39,0,36,0,32,0,33,0,33,0,33,0,36,0,32,0,37,0,32,0,32,0, + 29,0,25,0,19,0,21,0,19,0,22,0,22,0,21,0,18,0,24,0,21,0,21,0,19,0,18,0,17,0,15,0,15,0,11,0,14,0,19,0, + 10,0,11,0,10,0,15,0,8,0,14,0,11,0,14,0,14,0,11,0,6,0,8,0,10,0,8,0,4,0,6,0,1,0,3,0,1,0,253,255, + 255,255,249,255,241,255,231,255,232,255,232,255,231,255,230,255,231,255,228,255,230,255,228,255,241,255,232,255,232,255,230,255,231,255,235,255,242,255,238,255, + 232,255,227,255,231,255,238,255,239,255,235,255,237,255,235,255,238,255,241,255,244,255,249,255,246,255,253,255,4,0,14,0,14,0,12,0,17,0,14,0, + 24,0,24,0,22,0,25,0,22,0,25,0,21,0,21,0,24,0,30,0,30,0,30,0,36,0,24,0,19,0,24,0,21,0,21,0,11,0,12,0, + 10,0,8,0,8,0,1,0,3,0,1,0,3,0,255,255,249,255,249,255,241,255,238,255,237,255,239,255,238,255,230,255,231,255,230,255,232,255,228,255, + 234,255,234,255,231,255,235,255,237,255,228,255,224,255,213,255,217,255,210,255,210,255,214,255,212,255,214,255,206,255,205,255,198,255,198,255,196,255,191,255, + 184,255,174,255,170,255,173,255,187,255,184,255,180,255,178,255,177,255,178,255,187,255,198,255,194,255,195,255,192,255,195,255,203,255,198,255,192,255,196,255, + 198,255,198,255,188,255,198,255,196,255,203,255,206,255,209,255,199,255,198,255,199,255,206,255,214,255,210,255,212,255,213,255,213,255,220,255,217,255,217,255, + 214,255,214,255,206,255,209,255,208,255,210,255,217,255,216,255,216,255,219,255,220,255,223,255,223,255,221,255,223,255,220,255,220,255,216,255,219,255,216,255, + 217,255,219,255,226,255,232,255,228,255,231,255,234,255,244,255,237,255,234,255,235,255,248,255,248,255,250,255,255,255,6,0,0,0,14,0,17,0,12,0, + 14,0,18,0,15,0,18,0,19,0,19,0,18,0,14,0,22,0,19,0,26,0,24,0,29,0,33,0,35,0,37,0,37,0,42,0,44,0,43,0, + 47,0,46,0,50,0,48,0,47,0,51,0,57,0,60,0,57,0,65,0,62,0,65,0,66,0,58,0,61,0,64,0,66,0,68,0,65,0,66,0, + 68,0,66,0,73,0,76,0,76,0,78,0,76,0,69,0,69,0,78,0,72,0,69,0,66,0,66,0,61,0,61,0,58,0,69,0,57,0,57,0, + 53,0,54,0,46,0,46,0,46,0,47,0,48,0,40,0,47,0,42,0,46,0,40,0,39,0,46,0,47,0,46,0,40,0,37,0,33,0,30,0, + 35,0,25,0,26,0,24,0,12,0,14,0,10,0,12,0,14,0,8,0,14,0,10,0,10,0,12,0,15,0,12,0,11,0,14,0,7,0,11,0, + 1,0,1,0,0,0,255,255,252,255,8,0,3,0,3,0,4,0,250,255,252,255,252,255,252,255,249,255,252,255,253,255,252,255,249,255,250,255,252,255, + 245,255,248,255,248,255,239,255,242,255,238,255,235,255,230,255,235,255,232,255,230,255,228,255,228,255,235,255,226,255,238,255,231,255,227,255,226,255,230,255, + 230,255,235,255,230,255,231,255,230,255,239,255,232,255,239,255,237,255,238,255,241,255,238,255,250,255,4,0,3,0,10,0,8,0,7,0,10,0,12,0, + 17,0,22,0,19,0,19,0,29,0,21,0,26,0,25,0,21,0,24,0,28,0,28,0,33,0,25,0,28,0,24,0,24,0,18,0,14,0,14,0, + 10,0,6,0,3,0,3,0,3,0,252,255,250,255,246,255,246,255,248,255,242,255,238,255,241,255,242,255,244,255,242,255,237,255,237,255,230,255,232,255, + 234,255,228,255,224,255,223,255,226,255,220,255,221,255,226,255,224,255,221,255,219,255,212,255,205,255,208,255,201,255,199,255,198,255,201,255,192,255,192,255, + 185,255,188,255,181,255,180,255,177,255,181,255,180,255,184,255,181,255,178,255,195,255,201,255,202,255,195,255,187,255,191,255,199,255,195,255,202,255,203,255, + 205,255,202,255,208,255,213,255,203,255,210,255,206,255,209,255,209,255,208,255,203,255,203,255,202,255,212,255,213,255,224,255,227,255,214,255,221,255,219,255, + 223,255,219,255,212,255,220,255,216,255,219,255,219,255,224,255,228,255,216,255,223,255,220,255,228,255,227,255,230,255,228,255,227,255,224,255,219,255,224,255, + 223,255,221,255,226,255,227,255,234,255,239,255,241,255,245,255,249,255,255,255,6,0,255,255,0,0,1,0,253,255,0,0,0,0,4,0,15,0,11,0, + 7,0,14,0,14,0,24,0,26,0,28,0,18,0,26,0,22,0,21,0,22,0,18,0,22,0,28,0,26,0,25,0,29,0,37,0,37,0,37,0, + 44,0,40,0,47,0,48,0,55,0,55,0,55,0,54,0,62,0,62,0,60,0,66,0,68,0,64,0,60,0,65,0,64,0,57,0,60,0,57,0, + 60,0,64,0,64,0,66,0,73,0,76,0,76,0,75,0,73,0,76,0,75,0,75,0,75,0,73,0,71,0,78,0,72,0,68,0,64,0,64,0, + 57,0,48,0,47,0,48,0,46,0,46,0,42,0,40,0,42,0,43,0,47,0,47,0,42,0,33,0,30,0,29,0,32,0,29,0,29,0,29,0, + 29,0,24,0,28,0,22,0,21,0,19,0,22,0,17,0,19,0,12,0,15,0,10,0,17,0,11,0,7,0,6,0,6,0,6,0,4,0,11,0, + 10,0,8,0,3,0,255,255,253,255,248,255,249,255,248,255,249,255,246,255,252,255,249,255,245,255,250,255,249,255,246,255,248,255,245,255,241,255,246,255, + 248,255,246,255,246,255,252,255,250,255,252,255,252,255,237,255,242,255,235,255,241,255,241,255,239,255,231,255,232,255,234,255,238,255,228,255,231,255,227,255, + 239,255,242,255,238,255,234,255,230,255,238,255,239,255,234,255,237,255,238,255,248,255,255,255,248,255,250,255,250,255,3,0,4,0,10,0,3,0,8,0, + 252,255,7,0,10,0,12,0,11,0,15,0,24,0,19,0,28,0,30,0,32,0,33,0,30,0,25,0,21,0,25,0,25,0,21,0,18,0,18,0, + 14,0,12,0,21,0,17,0,8,0,7,0,6,0,252,255,250,255,246,255,249,255,252,255,249,255,249,255,242,255,235,255,238,255,244,255,242,255,241,255, + 234,255,235,255,232,255,231,255,221,255,214,255,224,255,224,255,223,255,228,255,226,255,227,255,221,255,220,255,226,255,219,255,208,255,206,255,202,255,199,255, + 195,255,191,255,187,255,187,255,177,255,180,255,181,255,184,255,185,255,184,255,190,255,195,255,195,255,201,255,203,255,202,255,201,255,199,255,205,255,205,255, + 209,255,209,255,216,255,216,255,209,255,208,255,214,255,210,255,216,255,214,255,214,255,208,255,210,255,216,255,217,255,221,255,220,255,223,255,221,255,219,255, + 221,255,221,255,227,255,214,255,217,255,216,255,216,255,221,255,224,255,226,255,228,255,228,255,226,255,234,255,231,255,220,255,227,255,230,255,230,255,235,255, + 234,255,235,255,238,255,244,255,238,255,239,255,239,255,245,255,241,255,246,255,244,255,250,255,253,255,0,0,0,0,253,255,3,0,8,0,6,0,15,0, + 10,0,12,0,11,0,15,0,11,0,15,0,21,0,24,0,15,0,15,0,18,0,25,0,24,0,30,0,22,0,32,0,28,0,29,0,37,0,36,0, + 36,0,36,0,35,0,35,0,43,0,43,0,46,0,43,0,43,0,46,0,37,0,44,0,47,0,46,0,48,0,53,0,53,0,54,0,57,0,53,0, + 54,0,48,0,53,0,53,0,58,0,51,0,54,0,55,0,55,0,62,0,61,0,61,0,62,0,57,0,55,0,51,0,57,0,50,0,51,0,53,0, + 51,0,54,0,48,0,48,0,42,0,43,0,46,0,44,0,39,0,32,0,33,0,35,0,32,0,36,0,29,0,28,0,28,0,24,0,28,0,28,0, + 25,0,24,0,22,0,24,0,17,0,15,0,17,0,18,0,17,0,8,0,6,0,4,0,4,0,6,0,6,0,12,0,11,0,11,0,6,0,255,255, + 252,255,246,255,252,255,249,255,239,255,239,255,234,255,244,255,238,255,241,255,242,255,245,255,246,255,244,255,248,255,249,255,245,255,245,255,241,255,242,255, + 241,255,249,255,250,255,248,255,248,255,249,255,250,255,246,255,237,255,241,255,239,255,238,255,234,255,238,255,237,255,237,255,238,255,231,255,237,255,231,255, + 231,255,234,255,235,255,231,255,239,255,244,255,245,255,245,255,246,255,249,255,253,255,249,255,252,255,250,255,1,0,3,0,252,255,252,255,0,0,1,0, + 7,0,15,0,15,0,10,0,17,0,17,0,28,0,22,0,30,0,30,0,32,0,37,0,30,0,36,0,30,0,25,0,21,0,18,0,19,0,24,0, + 24,0,26,0,21,0,25,0,11,0,10,0,8,0,255,255,0,0,253,255,249,255,253,255,246,255,248,255,245,255,237,255,239,255,237,255,234,255,232,255, + 239,255,238,255,231,255,234,255,226,255,231,255,231,255,237,255,237,255,234,255,231,255,226,255,210,255,209,255,214,255,213,255,214,255,214,255,217,255,213,255, + 206,255,201,255,196,255,190,255,183,255,183,255,184,255,187,255,191,255,185,255,194,255,199,255,202,255,205,255,195,255,202,255,203,255,209,255,208,255,214,255, + 219,255,223,255,214,255,216,255,210,255,216,255,219,255,219,255,223,255,219,255,223,255,216,255,217,255,220,255,223,255,221,255,221,255,227,255,228,255,217,255, + 220,255,223,255,221,255,228,255,226,255,230,255,226,255,232,255,231,255,228,255,238,255,232,255,234,255,238,255,245,255,246,255,249,255,244,255,249,255,245,255, + 248,255,241,255,245,255,248,255,248,255,249,255,246,255,248,255,246,255,249,255,252,255,245,255,3,0,255,255,0,0,255,255,1,0,4,0,4,0,4,0, + 6,0,7,0,6,0,8,0,18,0,21,0,24,0,19,0,26,0,22,0,15,0,22,0,22,0,19,0,25,0,25,0,36,0,26,0,22,0,24,0, + 30,0,22,0,32,0,30,0,35,0,32,0,39,0,36,0,35,0,39,0,46,0,43,0,43,0,46,0,43,0,46,0,53,0,48,0,48,0,58,0, + 60,0,50,0,50,0,50,0,55,0,53,0,44,0,46,0,50,0,60,0,62,0,60,0,60,0,61,0,53,0,48,0,48,0,50,0,48,0,46,0, + 48,0,50,0,48,0,50,0,47,0,44,0,43,0,39,0,32,0,36,0,26,0,29,0,25,0,21,0,17,0,21,0,18,0,26,0,19,0,18,0, + 15,0,18,0,17,0,15,0,12,0,11,0,10,0,14,0,15,0,11,0,15,0,19,0,12,0,7,0,4,0,1,0,8,0,8,0,8,0,3,0, + 4,0,253,255,250,255,246,255,252,255,248,255,244,255,238,255,238,255,235,255,232,255,235,255,237,255,237,255,231,255,234,255,239,255,238,255,249,255,252,255, + 252,255,0,0,250,255,255,255,0,0,1,0,252,255,248,255,241,255,238,255,237,255,235,255,230,255,237,255,237,255,239,255,241,255,237,255,237,255,226,255, + 234,255,234,255,238,255,238,255,242,255,239,255,241,255,246,255,244,255,244,255,249,255,0,0,248,255,3,0,3,0,7,0,8,0,7,0,10,0,0,0, + 4,0,8,0,6,0,7,0,12,0,15,0,24,0,19,0,22,0,24,0,22,0,25,0,26,0,22,0,24,0,25,0,28,0,22,0,18,0,18,0, + 11,0,15,0,21,0,21,0,18,0,15,0,8,0,12,0,4,0,7,0,10,0,1,0,250,255,246,255,244,255,235,255,235,255,235,255,232,255,239,255, + 234,255,231,255,239,255,248,255,241,255,241,255,238,255,230,255,227,255,226,255,217,255,223,255,220,255,223,255,221,255,216,255,212,255,209,255,199,255,199,255, + 205,255,206,255,202,255,201,255,212,255,205,255,202,255,203,255,205,255,210,255,208,255,206,255,208,255,208,255,209,255,203,255,206,255,213,255,208,255,212,255, + 214,255,213,255,217,255,214,255,220,255,213,255,214,255,213,255,219,255,221,255,220,255,223,255,230,255,224,255,224,255,231,255,230,255,226,255,230,255,227,255, + 234,255,231,255,230,255,235,255,228,255,224,255,227,255,231,255,231,255,232,255,234,255,238,255,241,255,231,255,231,255,235,255,242,255,237,255,238,255,241,255, + 248,255,246,255,244,255,250,255,249,255,248,255,248,255,245,255,250,255,253,255,246,255,1,0,0,0,255,255,253,255,248,255,245,255,249,255,250,255,248,255, + 248,255,255,255,255,255,4,0,1,0,6,0,8,0,8,0,10,0,10,0,12,0,18,0,25,0,26,0,22,0,30,0,25,0,28,0,24,0,28,0, + 29,0,33,0,28,0,29,0,32,0,22,0,25,0,33,0,32,0,35,0,37,0,36,0,29,0,28,0,28,0,32,0,37,0,37,0,43,0,43,0, + 48,0,46,0,44,0,36,0,33,0,32,0,33,0,36,0,46,0,42,0,47,0,48,0,48,0,46,0,36,0,42,0,32,0,37,0,33,0,29,0, + 40,0,39,0,39,0,33,0,37,0,36,0,32,0,30,0,28,0,28,0,29,0,29,0,25,0,18,0,14,0,15,0,18,0,17,0,10,0,15,0, + 8,0,4,0,17,0,12,0,19,0,15,0,11,0,17,0,14,0,19,0,17,0,14,0,7,0,8,0,14,0,10,0,12,0,14,0,11,0,8,0, + 11,0,0,0,4,0,248,255,245,255,241,255,238,255,239,255,238,255,237,255,245,255,246,255,238,255,238,255,238,255,241,255,242,255,244,255,250,255,0,0, + 246,255,1,0,252,255,0,0,253,255,252,255,255,255,255,255,252,255,248,255,250,255,250,255,246,255,250,255,244,255,244,255,245,255,242,255,237,255,234,255, + 241,255,239,255,239,255,239,255,239,255,237,255,249,255,248,255,255,255,248,255,249,255,244,255,249,255,252,255,252,255,0,0,3,0,7,0,4,0,7,0, + 14,0,8,0,14,0,18,0,12,0,15,0,17,0,26,0,19,0,19,0,19,0,24,0,22,0,25,0,32,0,26,0,30,0,24,0,22,0,22,0, + 19,0,22,0,22,0,18,0,18,0,25,0,12,0,7,0,10,0,11,0,11,0,7,0,255,255,252,255,253,255,250,255,250,255,245,255,244,255,245,255, + 244,255,242,255,237,255,241,255,231,255,235,255,230,255,221,255,224,255,223,255,224,255,232,255,227,255,221,255,217,255,219,255,213,255,221,255,214,255,216,255, + 210,255,210,255,202,255,202,255,196,255,202,255,209,255,210,255,210,255,217,255,214,255,219,255,212,255,213,255,213,255,214,255,214,255,209,255,209,255,209,255, + 212,255,210,255,216,255,216,255,216,255,217,255,227,255,226,255,228,255,228,255,221,255,224,255,227,255,235,255,228,255,238,255,237,255,231,255,237,255,241,255, + 242,255,235,255,235,255,238,255,244,255,235,255,242,255,242,255,241,255,242,255,239,255,245,255,246,255,250,255,244,255,244,255,245,255,244,255,239,255,242,255, + 239,255,245,255,246,255,245,255,252,255,255,255,253,255,0,0,3,0,6,0,8,0,3,0,0,0,252,255,0,0,255,255,255,255,252,255,253,255,253,255, + 252,255,246,255,248,255,0,0,253,255,0,0,0,0,255,255,253,255,252,255,1,0,8,0,18,0,22,0,22,0,24,0,26,0,18,0,26,0,24,0, + 19,0,19,0,18,0,19,0,15,0,18,0,28,0,22,0,22,0,17,0,25,0,30,0,33,0,29,0,24,0,32,0,35,0,35,0,36,0,35,0, + 33,0,35,0,48,0,37,0,35,0,32,0,39,0,43,0,37,0,40,0,39,0,40,0,39,0,43,0,37,0,30,0,33,0,35,0,33,0,26,0, + 29,0,30,0,33,0,35,0,32,0,33,0,24,0,19,0,25,0,21,0,17,0,12,0,4,0,14,0,11,0,10,0,12,0,15,0,11,0,8,0, + 4,0,3,0,6,0,6,0,10,0,6,0,6,0,10,0,4,0,3,0,8,0,3,0,6,0,1,0,3,0,0,0,253,255,253,255,4,0,7,0, + 6,0,7,0,4,0,0,0,0,0,248,255,245,255,242,255,235,255,239,255,239,255,238,255,241,255,237,255,232,255,231,255,241,255,234,255,252,255,252,255, + 252,255,249,255,248,255,252,255,253,255,0,0,1,0,252,255,3,0,4,0,1,0,250,255,253,255,252,255,250,255,248,255,242,255,246,255,249,255,249,255, + 248,255,248,255,245,255,248,255,245,255,252,255,244,255,242,255,241,255,245,255,3,0,252,255,3,0,4,0,0,0,255,255,255,255,0,0,11,0,18,0, + 17,0,15,0,17,0,17,0,22,0,29,0,22,0,24,0,22,0,26,0,30,0,33,0,35,0,35,0,39,0,32,0,32,0,32,0,25,0,22,0, + 21,0,17,0,15,0,14,0,11,0,12,0,11,0,7,0,14,0,14,0,8,0,255,255,1,0,1,0,252,255,249,255,248,255,246,255,242,255,238,255, + 242,255,242,255,242,255,232,255,235,255,235,255,235,255,234,255,237,255,234,255,239,255,228,255,226,255,227,255,223,255,220,255,221,255,216,255,212,255,212,255, + 220,255,216,255,223,255,221,255,212,255,210,255,208,255,212,255,213,255,213,255,217,255,214,255,212,255,210,255,224,255,226,255,224,255,221,255,221,255,219,255, + 220,255,226,255,214,255,219,255,223,255,226,255,223,255,227,255,220,255,226,255,227,255,232,255,235,255,237,255,235,255,239,255,238,255,242,255,244,255,245,255, + 248,255,252,255,249,255,0,0,1,0,1,0,252,255,255,255,250,255,244,255,245,255,248,255,245,255,244,255,246,255,245,255,246,255,246,255,248,255,246,255, + 249,255,245,255,242,255,245,255,250,255,255,255,252,255,255,255,3,0,252,255,249,255,252,255,4,0,7,0,4,0,0,0,0,0,0,0,253,255,0,0, + 253,255,250,255,4,0,255,255,4,0,4,0,1,0,8,0,3,0,0,0,0,0,6,0,3,0,6,0,1,0,17,0,18,0,26,0,21,0,24,0, + 25,0,24,0,22,0,22,0,22,0,19,0,18,0,22,0,22,0,28,0,25,0,22,0,25,0,25,0,18,0,24,0,21,0,21,0,30,0,30,0, + 29,0,33,0,42,0,37,0,42,0,37,0,36,0,40,0,39,0,43,0,37,0,35,0,37,0,24,0,25,0,25,0,25,0,22,0,19,0,25,0, + 26,0,19,0,17,0,21,0,17,0,15,0,11,0,19,0,19,0,19,0,15,0,17,0,12,0,15,0,15,0,19,0,12,0,6,0,1,0,252,255, + 0,0,7,0,1,0,3,0,8,0,6,0,7,0,1,0,14,0,14,0,6,0,8,0,8,0,1,0,3,0,255,255,252,255,252,255,250,255,255,255, + 250,255,253,255,0,0,6,0,0,0,249,255,255,255,255,255,249,255,250,255,244,255,248,255,245,255,239,255,231,255,232,255,237,255,241,255,244,255,252,255, + 248,255,245,255,239,255,245,255,241,255,250,255,250,255,1,0,246,255,255,255,255,255,255,255,255,255,253,255,250,255,255,255,1,0,253,255,250,255,248,255, + 246,255,246,255,246,255,252,255,249,255,252,255,250,255,255,255,249,255,250,255,250,255,249,255,248,255,252,255,249,255,6,0,3,0,11,0,8,0,15,0, + 17,0,14,0,17,0,17,0,21,0,26,0,26,0,29,0,29,0,29,0,24,0,19,0,17,0,19,0,19,0,14,0,21,0,19,0,24,0,19,0, + 21,0,21,0,19,0,14,0,21,0,6,0,10,0,15,0,6,0,3,0,4,0,3,0,4,0,255,255,253,255,245,255,244,255,244,255,241,255,241,255, + 238,255,245,255,241,255,238,255,235,255,235,255,232,255,232,255,231,255,232,255,235,255,235,255,231,255,228,255,221,255,221,255,223,255,223,255,230,255,213,255, + 213,255,216,255,210,255,208,255,203,255,212,255,212,255,206,255,210,255,212,255,208,255,216,255,210,255,209,255,213,255,206,255,213,255,223,255,221,255,227,255, + 230,255,232,255,228,255,226,255,230,255,224,255,226,255,224,255,226,255,230,255,234,255,228,255,230,255,232,255,231,255,227,255,232,255,235,255,239,255,244,255, + 237,255,252,255,249,255,249,255,250,255,252,255,252,255,0,0,248,255,255,255,252,255,250,255,3,0,1,0,252,255,248,255,246,255,245,255,245,255,245,255, + 246,255,242,255,249,255,249,255,245,255,250,255,249,255,252,255,253,255,1,0,1,0,4,0,0,0,3,0,6,0,3,0,8,0,7,0,7,0,250,255, + 4,0,252,255,246,255,253,255,252,255,3,0,4,0,250,255,249,255,239,255,250,255,249,255,4,0,0,0,11,0,11,0,15,0,17,0,21,0,14,0, + 17,0,21,0,21,0,25,0,22,0,22,0,28,0,35,0,25,0,26,0,24,0,26,0,25,0,24,0,18,0,26,0,24,0,26,0,28,0,19,0, + 29,0,30,0,25,0,26,0,35,0,35,0,28,0,22,0,28,0,28,0,33,0,30,0,30,0,37,0,37,0,39,0,28,0,22,0,19,0,18,0, + 10,0,12,0,14,0,15,0,11,0,12,0,14,0,17,0,8,0,8,0,8,0,10,0,19,0,4,0,6,0,8,0,11,0,8,0,6,0,6,0, + 8,0,1,0,252,255,253,255,1,0,253,255,1,0,1,0,8,0,7,0,7,0,7,0,4,0,6,0,255,255,252,255,253,255,255,255,252,255,250,255, + 6,0,6,0,0,0,6,0,3,0,0,0,249,255,249,255,255,255,246,255,249,255,250,255,248,255,244,255,245,255,249,255,244,255,252,255,245,255,244,255, + 242,255,245,255,237,255,237,255,244,255,244,255,250,255,255,255,1,0,253,255,255,255,255,255,6,0,4,0,4,0,253,255,255,255,0,0,1,0,252,255, + 241,255,250,255,252,255,255,255,0,0,255,255,1,0,253,255,244,255,245,255,239,255,244,255,248,255,3,0,8,0,7,0,11,0,3,0,10,0,14,0, + 14,0,14,0,15,0,22,0,26,0,24,0,26,0,26,0,22,0,26,0,32,0,33,0,33,0,33,0,29,0,30,0,30,0,36,0,29,0,21,0, + 19,0,18,0,19,0,21,0,17,0,17,0,18,0,12,0,7,0,4,0,1,0,252,255,255,255,4,0,3,0,248,255,242,255,242,255,238,255,241,255, + 238,255,239,255,237,255,239,255,241,255,235,255,232,255,231,255,230,255,234,255,231,255,232,255,230,255,234,255,235,255,234,255,227,255,230,255,231,255,220,255, + 217,255,210,255,213,255,217,255,217,255,219,255,220,255,219,255,226,255,223,255,212,255,220,255,220,255,220,255,210,255,223,255,230,255,224,255,227,255,231,255, + 231,255,231,255,234,255,226,255,232,255,237,255,241,255,235,255,232,255,231,255,232,255,237,255,235,255,234,255,0,0}; +const char* BinaryData::cello_wav = (const char*) temp5; -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 temp6[] = {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, @@ -5756,99 +2242,409 @@ static const unsigned char temp11[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 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,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,81,85,73,67,75,84,73,77,69,32,38,38,32,33,32,74,85,67,69,95,76,73,78,85,88,13,10,13,10,47,47,61, + 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,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,47,32,116,104,105,115,32,105,115,32,116,104,101,32,108,105,115,116,98,111,120,32,99,111,110,116,97,105,110,105,110,103,32,116,104,101,32,100, + 114,97,103,103,97,98,108,101,32,115,111,117,114,99,101,32,99,111,109,112,111,110,101,110,116,115,46,46,13,10,13,10,99,108,97,115,115,32,68,114, + 97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,32,32,58,32,112,117,98,108,105,99,32,76,105,115,116,66,111,120,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,32,32,32,32,32,32,112,117,98,108,105,99,32,76,105, + 115,116,66,111,120,77,111,100,101,108,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,61,61,61,61,61,61,61,61,61,13,10,47, - 47,32,115,111,32,116,104,97,116,32,119,101,32,99,97,110,32,101,97,115,105,108,121,32,104,97,118,101,32,116,119,111,32,81,84,32,119,105,110,100, - 111,119,115,32,101,97,99,104,32,119,105,116,104,32,97,32,102,105,108,101,32,98,114,111,119,115,101,114,44,32,119,114,97,112,32,116,104,105,115,32, - 117,112,32,97,115,32,97,32,99,108,97,115,115,46,46,13,10,99,108,97,115,115,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105, - 116,104,70,105,108,101,66,114,111,119,115,101,114,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,117,98,108, - 105,99,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,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,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,40,41,13,10, - 32,32,32,32,123,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,113,116,67,111,109,112, - 32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,77,111,118,105,101,67,111,109,112,111,110,101,110,116,40,41,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,47,47,32,97,110,100,32,97,32,102,105,108,101,45,99,104,111,111,115,101,114,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,102,105,108,101,67,104,111,111,115,101,114,32,61,32,110,101,119,32,70,105,108,101, - 110,97,109,101,67,111,109,112,111,110,101,110,116,32,40,84,40,34,109,111,118,105,101,34,41,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,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,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,110,111,110,101,120,105,115,116,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,102,97,108,115,101,44,32,102,97,108,115,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,42,46,42,34,41,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,83,116,114,105,110,103,58,58,101,109,112,116,121,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,40,99,104,111,111,115,101,32,97,32,118,105,100,101,111,32,102,105,108,101,32, - 116,111,32,112,108,97,121,41,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45,62,97,100,100,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101, - 116,66,114,111,119,115,101,66,117,116,116,111,110,84,101,120,116,32,40,84,40,34,98,114,111,119,115,101,34,41,41,59,13,10,32,32,32,32,125,13, - 10,13,10,32,32,32,32,126,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,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,113,116,67,111,109,112,45,62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32, - 103,101,116,72,101,105,103,104,116,40,41,32,45,32,51,48,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45, - 62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,50,52,44,32,103,101,116,87,105,100,116, - 104,40,41,44,32,50,52,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,102,105,108,101,110,97,109,101,67,111,109, - 112,111,110,101,110,116,67,104,97,110,103,101,100,32,40,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,42,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,117,115, - 101,114,32,99,104,97,110,103,101,115,32,116,104,101,32,102,105,108,101,110,97,109,101,32,105,110,32,116,104,101,32,102,105,108,101,32,99,104,111,111, - 115,101,114,32,98,111,120,13,10,32,32,32,32,32,32,32,32,105,102,32,40,113,116,67,111,109,112,45,62,108,111,97,100,77,111,118,105,101,32,40, - 102,105,108,101,67,104,111,111,115,101,114,45,62,103,101,116,67,117,114,114,101,110,116,70,105,108,101,40,41,44,32,116,114,117,101,41,41,13,10,32, - 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,108,111,97,100,101,100,32,116,104,101,32,102,105,108,101, - 32,111,107,44,32,115,111,32,108,101,116,39,115,32,115,116,97,114,116,32,105,116,32,112,108,97,121,105,110,103,46,46,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,113,116,67,111,109,112,45,62,112,108,97,121,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32, - 32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105, - 110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105, - 110,103,73,99,111,110,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,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,84,40,34,67,111,117,108,100,110,39,116,32,108,111,97,100,32,116,104,101,32,102,105,108,101,33,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,84,40,34,83,111,114,114,121,44,32,81,117,105,99,107,84,105,109,101,32,100,105,100,110,39,116,32,109,97,110,97,103,101,32,116,111,32,108, - 111,97,100,32,116,104,97,116,32,102,105,108,101,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10, - 112,114,105,118,97,116,101,58,13,10,32,32,32,32,81,117,105,99,107,84,105,109,101,77,111,118,105,101,67,111,109,112,111,110,101,110,116,42,32,113, - 116,67,111,109,112,59,13,10,32,32,32,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,42,32,102,105,108,101,67,104,111,111,115, - 101,114,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,13,10,32,32,32,32,68,114,97,103,65,110, + 100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,41,13,10,32,32,32,32,32,32,32,32,58,32,76,105,115,116,66,111,120,32,40,84,40, + 34,100,43,100,32,115,111,117,114,99,101,34,41,44,32,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,101,108, + 108,115,32,116,104,101,32,76,105,115,116,66,111,120,32,116,104,97,116,32,116,104,105,115,32,111,98,106,101,99,116,32,115,117,112,112,108,105,101,115, + 32,116,104,101,32,105,110,102,111,32,97,98,111,117,116,13,10,32,32,32,32,32,32,32,32,47,47,32,105,116,115,32,114,111,119,115,46,13,10,32, + 32,32,32,32,32,32,32,115,101,116,77,111,100,101,108,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,77,117, + 108,116,105,112,108,101,83,101,108,101,99,116,105,111,110,69,110,97,98,108,101,100,32,40,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13, + 10,32,32,32,32,126,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,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,81,117,105,99,107,84,105,109,101,68,101,109,111,32,32,58,32,112,117, - 98,108,105,99,32,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,13,10,32,32,32,32,47,47,32,84,104,101,32,102,111,108,108,111,119,105,110,103,32,109,101,116,104,111,100, + 115,32,105,109,112,108,101,109,101,110,116,32,116,104,101,32,110,101,99,101,115,115,97,114,121,32,118,105,114,116,117,97,108,32,102,117,110,99,116,105, + 111,110,115,32,102,114,111,109,32,76,105,115,116,66,111,120,77,111,100,101,108,44,13,10,32,32,32,32,47,47,32,116,101,108,108,105,110,103,32,116, + 104,101,32,108,105,115,116,98,111,120,32,104,111,119,32,109,97,110,121,32,114,111,119,115,32,116,104,101,114,101,32,97,114,101,44,32,112,97,105,110, + 116,105,110,103,32,116,104,101,109,44,32,101,116,99,46,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40,41,13,10,32, + 32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,51,48,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118, + 111,105,100,32,112,97,105,110,116,76,105,115,116,66,111,120,73,116,101,109,32,40,105,110,116,32,114,111,119,78,117,109,98,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,32,32,71,114,97,112,104,105,99,115,38,32,103,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,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116, + 32,104,101,105,103,104,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,32,32,98,111,111, + 108,32,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119, + 73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111, + 117,114,115,58,58,108,105,103,104,116,98,108,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32, + 40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,104,101, + 105,103,104,116,32,42,32,48,46,55,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,84,40,34, + 82,111,119,32,78,117,109,98,101,114,32,34,41,32,43,32,83,116,114,105,110,103,32,40,114,111,119,78,117,109,98,101,114,32,43,32,49,41,44,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,53,44,32,48,44,32,119,105,100,116,104,44,32,104,101,105,103,104,116, + 44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101, + 110,116,114,101,100,76,101,102,116,44,32,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,83,116, + 114,105,110,103,32,103,101,116,68,114,97,103,83,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,32,40,99,111,110,115,116,32,83,112,97, + 114,115,101,83,101,116,60,105,110,116,62,38,32,115,101,108,101,99,116,101,100,82,111,119,115,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,47,47,32,102,111,114,32,111,117,114,32,100,114,97,103,32,100,101,115,99,116,114,105,112,116,105,111,110,44,32,119,101,39,108,108,32,106, + 117,115,116,32,109,97,107,101,32,97,32,108,105,115,116,32,111,102,32,116,104,101,32,115,101,108,101,99,116,101,100,13,10,32,32,32,32,32,32,32, + 32,47,47,32,114,111,119,32,110,117,109,98,101,114,115,32,45,32,116,104,105,115,32,119,105,108,108,32,98,101,32,112,105,99,107,101,100,32,117,112, + 32,98,121,32,116,104,101,32,100,114,97,103,32,116,97,114,103,101,116,32,97,110,100,32,100,105,115,112,108,97,121,101,100,32,105,110,13,10,32,32, + 32,32,32,32,32,32,47,47,32,105,116,115,32,98,111,120,46,13,10,32,32,32,32,32,32,32,32,83,116,114,105,110,103,32,100,101,115,99,59,13, + 10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,115,101,108,101,99,116,101,100,82, + 111,119,115,46,115,105,122,101,40,41,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,40,115, + 101,108,101,99,116,101,100,82,111,119,115,32,91,105,93,32,43,32,49,41,32,60,60,32,84,40,34,32,34,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,114,101,116,117,114,110,32,100,101,115,99,46,116,114,105,109,40,41,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,13,10,32,32,32,32,81,117, - 105,99,107,84,105,109,101,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,84, - 40,34,81,117,105,99,107,84,105,109,101,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,109,111,118,105, - 101,32,99,111,109,112,111,110,101,110,116,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,113,116,67,111,109,112,49,32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66, - 114,111,119,115,101,114,40,41,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,113, - 116,67,111,109,112,50,32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119, - 115,101,114,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,81,117,105,99,107,84,105,109,101,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,113,116,67,111,109,112,49,45,62,115,101,116,66,111,117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,48,53,102,44,32,48,46,48,53, - 102,44,32,48,46,52,50,53,102,44,32,48,46,57,102,41,59,13,10,32,32,32,32,32,32,32,32,113,116,67,111,109,112,50,45,62,115,101,116,66, - 111,117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,53,50,53,102,44,32,48,46,48,53,102,44,32,48,46,52,50,53,102,44,32,48,46, - 57,102,41,59,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,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,13,10,32, + 32,32,32,47,47,32,116,104,105,115,32,106,117,115,116,32,102,105,108,108,115,32,105,110,32,116,104,101,32,98,97,99,107,103,114,111,117,110,100,32, + 111,102,32,116,104,101,32,108,105,115,116,98,111,120,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115, + 38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58, + 58,119,104,105,116,101,46,119,105,116,104,65,108,112,104,97,32,40,48,46,55,102,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, + 47,42,118,111,105,100,32,108,105,115,116,66,111,120,73,116,101,109,67,108,105,99,107,101,100,32,40,105,110,116,32,114,111,119,44,32,99,111,110,115, + 116,32,77,111,117,115,101,69,118,101,110,116,38,32,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101, + 110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49,44,32,34,115,100,102,115,100,102,115,34,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,109,46,115,104,111,119,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,65,108,101,114,116, + 87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102, + 111,73,99,111,110,44,32,34,97,115,100,102,115,97,100,102,97,100,115,34,44,32,34,115,114,100,102,115,100,102,97,34,41,59,13,10,32,32,32,32, + 32,32,32,32,68,111,99,117,109,101,110,116,87,105,110,100,111,119,42,32,100,119,32,61,32,110,101,119,32,68,111,99,117,109,101,110,116,87,105,110, + 100,111,119,32,40,34,115,102,100,115,100,34,44,32,67,111,108,111,117,114,115,58,58,119,104,105,116,101,44,32,68,111,99,117,109,101,110,116,87,105, + 110,100,111,119,58,58,97,108,108,66,117,116,116,111,110,115,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,100,119,45,62,115,101, + 116,66,111,117,110,100,115,32,40,49,48,48,44,32,49,48,48,44,32,53,48,48,44,32,53,48,48,41,59,13,10,32,32,32,32,32,32,32,32,100, + 119,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,125,42,47,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,47,47,32,97,110,100,32,116,104,105,115,32,105,115,32,97,32,99,111,109,112,111,110,101,110,116,32,116,104,97,116,32,99,97,110,32,104,97, + 118,101,32,116,104,105,110,103,115,32,100,114,111,112,112,101,100,32,111,110,116,111,32,105,116,46,46,13,10,13,10,99,108,97,115,115,32,68,114,97, + 103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,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,32,32,32,32,32,32,112,117,98,108,105,99,32,68, + 114,97,103,65,110,100,68,114,111,112,84,97,114,103,101,116,13,10,123,13,10,32,32,32,32,98,111,111,108,32,115,111,109,101,116,104,105,110,103,73, + 115,66,101,105,110,103,68,114,97,103,103,101,100,79,118,101,114,59,13,10,32,32,32,32,83,116,114,105,110,103,32,109,101,115,115,97,103,101,59,13, + 10,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,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114, + 103,101,116,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114, + 97,103,103,101,100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,13,10,32,32,32,32,32,32,32,32,109,101,115,115,97,103,101,32,61,32, + 84,40,34,68,114,97,103,45,97,110,100,45,100,114,111,112,32,115,111,109,101,32,114,111,119,115,32,102,114,111,109,32,116,104,101,32,116,111,112,45, + 108,101,102,116,32,98,111,120,32,111,110,116,111,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,33,34,41,59,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,126,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,40,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61, + 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,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,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38, + 32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58, + 103,114,101,101,110,46,119,105,116,104,65,108,112,104,97,32,40,48,46,50,102,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,100, + 114,97,119,32,97,32,114,101,100,32,108,105,110,101,32,97,114,111,117,110,100,32,116,104,101,32,99,111,109,112,32,105,102,32,116,104,101,32,117,115, + 101,114,39,115,32,99,117,114,114,101,110,116,108,121,32,100,114,97,103,103,105,110,103,32,115,111,109,101,116,104,105,110,103,32,111,118,101,114,32,105, + 116,46,46,13,10,32,32,32,32,32,32,32,32,105,102,32,40,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114,97,103,103,101,100, + 79,118,101,114,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117, + 114,32,40,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99, + 116,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,51,41,59,13,10,32, + 32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115, + 58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,49,52,46,48,102,41,59,13,10,32, + 32,32,32,32,32,32,32,103,46,100,114,97,119,70,105,116,116,101,100,84,101,120,116,32,40,109,101,115,115,97,103,101,44,32,49,48,44,32,48,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,44,32,74,117,115,116,105,102,105,99,97, + 116,105,111,110,58,58,99,101,110,116,114,101,100,44,32,52,41,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,98, + 111,111,108,32,105,115,73,110,116,101,114,101,115,116,101,100,73,110,68,114,97,103,83,111,117,114,99,101,32,40,99,111,110,115,116,32,83,116,114,105, + 110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,67,111,109,112, + 111,110,101,110,116,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,110,111,114,109,97,108,108,121,32,121,111,117,39,100, + 32,99,104,101,99,107,32,116,104,101,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,32,118,97,108,117,101,32,116,111,32,115,101, + 101,32,105,102,32,105,116,39,115,32,116,104,101,13,10,32,32,32,32,32,32,32,32,47,47,32,115,111,114,116,32,111,102,32,111,98,106,101,99,116, + 32,116,104,97,116,32,121,111,117,39,114,101,32,105,110,116,101,114,101,115,116,101,100,32,105,110,32,98,101,102,111,114,101,32,114,101,116,117,114,110, + 105,110,103,32,116,114,117,101,44,32,98,117,116,32,102,111,114,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,100,101,109,111,44,32, + 119,101,39,108,108,32,115,97,121,32,121,101,115,32,116,111,32,97,110,121,116,104,105,110,103,46,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,118,111,105,100,32,105,116,101,109,68,114,97,103,69,110,116, + 101,114,32,40,99,111,110,115,116,32,83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120, + 44,32,105,110,116,32,121,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110, + 103,68,114,97,103,103,101,100,79,118,101,114,32,61,32,116,114,117,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59, + 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,97,103,77,111,118,101,32,40,99,111,110,115,116,32, + 83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120,44,32,105,110,116,32,121,41,13,10,32,32, + 32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,97,103,69,120,105,116,32,40,99,111,110, + 115,116,32,83,116,114,105,110,103,38,32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,67,111,109,112,111,110,101,110,116, + 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103,73,115,66,101,105,110,103,68,114,97,103,103,101, + 100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32, + 125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,68,114,111,112,112,101,100,32,40,99,111,110,115,116,32,83,116,114,105,110,103,38, + 32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,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,67,111,109,112,111,110,101,110,116,42,32,115,111,117,114,99,101,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,105,110,116,32,120,44,32,105,110,116,32,121,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,109,101,115,115,97,103,101,32,61,32,84,40,34,108,97,115,116,32,114,111,119,115,32,100,114,111,112,112,101,100,58,32,34,41,32,43, + 32,115,111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,59,13,10,13,10,32,32,32,32,32,32,32,32,115,111,109,101,116,104,105,110,103, + 73,115,66,101,105,110,103,68,114,97,103,103,101,100,79,118,101,114,32,61,32,102,97,108,115,101,59,13,10,32,32,32,32,32,32,32,32,114,101,112, + 97,105,110,116,40,41,59,13,10,32,32,32,32,125,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,68,114,97,103,65,110,100,68, + 114,111,112,68,101,109,111,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,68,114,97,103,65,110,100,68,114,111,112,67,111,110,116,97,105,110, + 101,114,13,10,123,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,81,117,105,99,107, - 84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,42,32,113,116,67,111,109,112,49,59,13,10,32,32,32, - 32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,42,32,113,116,67,111,109,112,50, - 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,13,10,32,32,32,32,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,42,32, + 115,111,117,114,99,101,59,13,10,32,32,32,32,68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,42,32,116,97,114,103, + 101,116,59,13,10,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,81,117,105,99,107,84,105,109,101,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,81,117,105,99,107,84,105,109,101,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::quicktimedemo_cpp = (const char*) temp11; + 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,114,97,103,65,110,100,68,114,111,112,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,84,40,34,68,114,97,103,45,97,110,100, + 45,68,114,111,112,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,111,117,114,99,101,32,61,32,110,101,119,32,68,114,97,103,65,110, + 100,68,114,111,112,68,101,109,111,83,111,117,114,99,101,40,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,115,111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,97,114,103,101,116,32,61,32,110,101,119,32, + 68,114,97,103,65,110,100,68,114,111,112,68,101,109,111,84,97,114,103,101,116,40,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,116,97,114,103,101,116,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,114,97, + 103,65,110,100,68,114,111,112,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,115,111,117,114,99,101,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32, + 49,48,44,32,50,53,48,44,32,49,53,48,41,59,13,10,32,32,32,32,32,32,32,32,116,97,114,103,101,116,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,50,54,48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,49,54,48,44,32, + 50,53,48,44,32,49,53,48,41,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,47,47,32,40,110,101,101,100,32, + 116,111,32,112,117,116,32,116,104,105,115,32,105,110,32,116,111,32,100,105,115,97,109,98,105,103,117,97,116,101,32,116,104,101,32,110,101,119,47,100, + 101,108,101,116,101,32,111,112,101,114,97,116,111,114,115,32,117,115,101,100,32,105,110,32,116,104,101,13,10,32,32,32,32,47,47,32,116,119,111,32, + 98,97,115,101,32,99,108,97,115,115,101,115,41,46,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,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,68,114,97, + 103,65,110,100,68,114,111,112,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,68,114,97,103,65,110, + 100,68,114,111,112,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::draganddropdemo_cpp = (const char*) temp6; -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, +static const unsigned char temp7[] = {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; +const char* BinaryData::readme__what_this_directory_is_for_txt = (const char*) temp7; + +static const unsigned char temp8[] = {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, + 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,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,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,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,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,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,32,58,32,112,117,98,108,105,99,32,84,114,101,101, + 86,105,101,119,73,116,101,109,13,10,123,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,120,109,108,59,13,10,13,10,112,117,98, + 108,105,99,58,13,10,32,32,32,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40,88,109,108,69,108,101,109,101,110,116,42,32, + 99,111,110,115,116,32,120,109,108,95,41,13,10,32,32,32,32,32,32,32,32,58,32,120,109,108,32,40,120,109,108,95,41,13,10,32,32,32,32,123, + 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,40,41,13,10,32,32,32,32, + 123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,105,110,116,32,103,101,116,73,116,101,109,87,105,100,116,104,40,41,32,99,111,110,115,116, + 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,120,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105, + 98,117,116,101,32,40,84,40,34,119,105,100,116,104,34,41,44,32,45,49,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110, + 115,116,32,83,116,114,105,110,103,32,103,101,116,85,110,105,113,117,101,78,97,109,101,40,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114, + 110,32,120,109,108,45,62,103,101,116,84,97,103,78,97,109,101,40,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,83,116,114,105,110,103,58,58,101,109,112,116,121,59,13,10,32,32,32,32,125,13,10,13,10, + 32,32,32,32,98,111,111,108,32,109,105,103,104,116,67,111,110,116,97,105,110,83,117,98,73,116,101,109,115,40,41,13,10,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,120,109,108,32,33,61,32,48,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,38,38,32,120,109,108,45,62,103,101,116,70,105,114,115,116,67,104,105,108,100,69,108,101,109,101,110,116,40,41,32,33,61,32,48,59,13,10,32, + 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,73,116,101,109,32,40,71,114,97,112,104,105,99,115,38,32,103,44, + 32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,116,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, + 105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47, + 32,105,102,32,116,104,105,115,32,105,116,101,109,32,105,115,32,115,101,108,101,99,116,101,100,44,32,102,105,108,108,32,105,116,32,119,105,116,104,32, + 97,32,98,97,99,107,103,114,111,117,110,100,32,99,111,108,111,117,114,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105, + 115,83,101,108,101,99,116,101,100,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32, + 40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,48,46,51,102,41,41,59,13,10,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,47,47,32,117,115,101,32,97,32,34,99,111,108,111,117,114,34,32,97,116,116,114,105,98,117,116,101,32,105,110,32, + 116,104,101,32,120,109,108,32,116,97,103,32,102,111,114,32,116,104,105,115,32,110,111,100,101,32,116,111,32,115,101,116,32,116,104,101,32,116,101,120, + 116,32,99,111,108,111,117,114,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108, + 111,117,114,32,40,120,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,84,40,34,99,111,108,111,117,114,34, + 41,44,32,84,40,34,102,102,48,48,48,48,48,48,34,41,41,46,103,101,116,72,101,120,86,97,108,117,101,51,50,40,41,41,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,104,101,105,103,104,116,32,42,32,48,46,55,102,41,59,13,10, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,100,114,97,119,32,116,104,101,32,120,109,108,32,101,108,101,109,101,110,116,39,115,32, + 116,97,103,32,110,97,109,101,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,120,109,108,45, + 62,103,101,116,84,97,103,78,97,109,101,40,41,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, + 52,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105,103,104,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,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116,114, + 117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,79, + 112,101,110,110,101,115,115,67,104,97,110,103,101,100,32,40,98,111,111,108,32,105,115,78,111,119,79,112,101,110,41,13,10,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,105,102,32,40,105,115,78,111,119,79,112,101,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,47,47,32,105,102,32,119,101,39,118,101,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,110,101,32,115,111,44,32, + 119,101,39,108,108,32,110,111,119,32,97,100,100,32,116,104,101,32,116,114,101,101,39,115,32,115,117,98,45,105,116,101,109,115,46,32,89,111,117,32, + 99,111,117,108,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,108,115,111,32,99,104,111,111,115,101,32,116,111,32,100,101,108, + 101,116,101,32,116,104,101,32,101,120,105,115,116,105,110,103,32,111,110,101,115,32,97,110,100,32,114,101,102,114,101,115,104,32,116,104,101,109,32,105, + 102,32,116,104,97,116,39,115,32,109,111,114,101,32,115,117,105,116,97,98,108,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105, + 110,32,121,111,117,114,32,97,112,112,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,103,101,116,78,117,109,83,117,98,73,116, + 101,109,115,40,41,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,100,32,97,100,100,32,115,117,98,45,105,116,101,109,115,32,116,111,32,116,104,105,115,32, + 110,111,100,101,32,111,102,32,116,104,101,32,116,114,101,101,44,32,99,111,114,114,101,115,112,111,110,100,105,110,103,32,116,111,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,101,97,99,104,32,115,117,98,45,101,108,101,109,101,110,116,32,105,110,32,116,104,101,32,88, + 77,76,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111, + 114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,120,109,108,44,32,99,104,105,108,100,41,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,97,100,100,83,117,98,73,116,101,109,32,40,110,101,119,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40,99,104,105, + 108,100,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, + 32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105,110,32,116,104, + 105,115,32,99,97,115,101,44,32,119,101,39,108,108,32,108,101,97,118,101,32,97,110,121,32,115,117,98,45,105,116,101,109,115,32,105,110,32,116,104, + 101,32,116,114,101,101,32,119,104,101,110,32,116,104,101,32,110,111,100,101,32,103,101,116,115,32,99,108,111,115,101,100,44,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,47,47,32,116,104,111,117,103,104,32,121,111,117,32,99,111,117,108,100,32,99,104,111,111,115,101,32,116,111,32,100,101,108, + 101,116,101,32,116,104,101,109,32,105,102,32,116,104,97,116,39,115,32,109,111,114,101,32,97,112,112,114,111,112,114,105,97,116,101,32,102,111,114,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,121,111,117,114,32,97,112,112,108,105,99,97,116,105,111,110,46,13,10,32,32,32,32,32, + 32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,103,101,116,68,114,97,103,83, + 111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114, + 110,32,84,40,34,84,114,101,101,86,105,101,119,32,73,116,101,109,115,34,41,59,13,10,32,32,32,32,125,13,10,125,59,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,84,114,101,101,86,105,101,119,68,101,109,111,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,112,117,98,108,105,99,32,68,114,97,103,65,110,100,68,114,111,112, + 67,111,110,116,97,105,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,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,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,116,114,101,101, + 88,109,108,59,13,10,13,10,32,32,32,32,84,114,101,101,86,105,101,119,73,116,101,109,42,32,114,111,111,116,73,116,101,109,59,13,10,32,32,32, + 32,84,114,101,101,86,105,101,119,42,32,116,114,101,101,86,105,101,119,59,13,10,13,10,32,32,32,32,70,105,108,101,84,114,101,101,67,111,109,112, + 111,110,101,110,116,42,32,102,105,108,101,84,114,101,101,67,111,109,112,59,13,10,32,32,32,32,68,105,114,101,99,116,111,114,121,67,111,110,116,101, + 110,116,115,76,105,115,116,42,32,100,105,114,101,99,116,111,114,121,76,105,115,116,59,13,10,32,32,32,32,84,105,109,101,83,108,105,99,101,84,104, + 114,101,97,100,32,116,104,114,101,97,100,59,13,10,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,116,121,112,101,66,117,116,116, + 111,110,59,13,10,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,84,114,101,101,86,105,101,119,68,101,109,111,40,41, + 13,10,32,32,32,32,32,32,32,32,58,32,116,114,101,101,86,105,101,119,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,114,111,111, + 116,73,116,101,109,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,102,105,108,101,84,114,101,101,67,111,109,112,32,40,48,41,44,13, + 10,32,32,32,32,32,32,32,32,32,32,100,105,114,101,99,116,111,114,121,76,105,115,116,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32, + 32,116,104,114,101,97,100,32,40,34,68,101,109,111,32,102,105,108,101,32,116,114,101,101,32,116,104,114,101,97,100,34,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,84,40,34,84,114,101,101,32,86,105,101,119,115,34,41,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,114,101,101,88,109,108,83,116,114,105,110,103,32,40,66,105,110,97, + 114,121,68,97,116,97,58,58,116,114,101,101,100,101,109,111,95,120,109,108,41,59,13,10,32,32,32,32,32,32,32,32,88,109,108,68,111,99,117,109, + 101,110,116,32,112,97,114,115,101,114,32,40,116,114,101,101,88,109,108,83,116,114,105,110,103,41,59,13,10,32,32,32,32,32,32,32,32,116,114,101, + 101,88,109,108,32,61,32,112,97,114,115,101,114,46,103,101,116,68,111,99,117,109,101,110,116,69,108,101,109,101,110,116,40,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,114,111,111,116,73,116,101,109,32,61,32,110,101,119,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40, + 116,114,101,101,88,109,108,41,59,13,10,32,32,32,32,32,32,32,32,114,111,111,116,73,116,101,109,45,62,115,101,116,79,112,101,110,32,40,116,114, + 117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,110,100,32,116,104,101,32,114,111,111,116,32,111,102,32,116,104,101,32, + 117,115,101,114,39,115,32,104,111,109,101,32,100,114,105,118,101,44,32,97,110,100,32,115,101,116,32,116,104,97,116,32,97,115,32,111,117,114,32,114, + 111,111,116,46,46,13,10,32,32,32,32,32,32,32,32,70,105,108,101,32,102,111,108,100,101,114,32,40,70,105,108,101,58,58,103,101,116,83,112,101, + 99,105,97,108,76,111,99,97,116,105,111,110,32,40,70,105,108,101,58,58,117,115,101,114,72,111,109,101,68,105,114,101,99,116,111,114,121,41,41,59, + 13,10,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,102,111,108,100,101,114,46,103,101,116,80,97,114,101,110,116,68,105,114,101,99,116,111, + 114,121,40,41,32,33,61,32,102,111,108,100,101,114,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,108,100,101,114,32,61,32,102,111, + 108,100,101,114,46,103,101,116,80,97,114,101,110,116,68,105,114,101,99,116,111,114,121,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,105, + 114,101,99,116,111,114,121,76,105,115,116,32,61,32,110,101,119,32,68,105,114,101,99,116,111,114,121,67,111,110,116,101,110,116,115,76,105,115,116,32, + 40,48,44,32,116,104,114,101,97,100,41,59,13,10,32,32,32,32,32,32,32,32,100,105,114,101,99,116,111,114,121,76,105,115,116,45,62,115,101,116, + 68,105,114,101,99,116,111,114,121,32,40,102,111,108,100,101,114,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32, + 32,116,104,114,101,97,100,46,115,116,97,114,116,84,104,114,101,97,100,32,40,51,41,59,13,10,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,116,121,112,101,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,84,40,34,84,121,112,101,32,111,102,32,116,114,101,101,118,105,101,119,46,46,46,34,41,41,41,59,13,10,32,32,32,32,32,32,32, + 32,116,121,112,101,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,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,65,108,119,97,121,115,79,110,84,111,112,32,40,116,114,117,101, + 41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,84,114,105,103,103,101,114,101,100,79,110,77,111, + 117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,104,111,119,67,117,115,116,111,109,84,114,101, + 101,86,105,101,119,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,114,101,101,86,105,101,119,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,13,10,32, + 32,32,32,32,32,32,32,100,101,108,101,116,101,32,114,111,111,116,73,116,101,109,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, + 116,114,101,101,88,109,108,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,100,105,114,101,99,116,111,114,121,76,105,115,116,59,13, + 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10, + 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,103,114,101, + 121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,114,101,101,86,105,101,119,32,33,61,32,48,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99,116,32,40,116,114,101,101,86,105,101,119,45,62,103,101,116,88,40,41,44,32,116,114,101, + 101,86,105,101,119,45,62,103,101,116,89,40,41,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, + 116,114,101,101,86,105,101,119,45,62,103,101,116,87,105,100,116,104,40,41,44,32,116,114,101,101,86,105,101,119,45,62,103,101,116,72,101,105,103,104, + 116,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,102,105,108,101,84,114,101,101,67,111,109,112,32,33,61,32,48,41,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99,116,32,40,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103, + 101,116,88,40,41,44,32,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,89,40,41,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,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,87,105,100,116,104,40,41,44,32, + 102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,72,101,105,103,104,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,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,105,102,32,40,116,114,101, + 101,86,105,101,119,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,101,101,86,105,101,119,45,62,115,101,116,66,111, + 117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,48,53,102,44,32,48,46,48,55,102,44,32,48,46,57,102,44,32,48,46,57,102,41,59, + 13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,102,105,108,101,84,114,101,101,67,111,109,112,32,33,61,32,48,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,84,114,101,101,67,111,109,112,45,62,115,101,116,66,111,117,110,100,115,82,101,108,97,116,105, + 118,101,32,40,48,46,48,53,102,44,32,48,46,48,55,102,44,32,48,46,57,102,44,32,48,46,57,102,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,116,121,112,101,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,48,41,59, + 13,10,32,32,32,32,32,32,32,32,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110, + 32,40,52,48,44,32,49,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,104,111,119,67,117,115,116,111,109, + 84,114,101,101,86,105,101,119,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,110,100,90,101,114,111, + 32,40,116,114,101,101,86,105,101,119,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,102,105,108, + 101,84,114,101,101,67,111,109,112,41,59,13,10,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,116,114,101,101,86,105,101,119,32,61,32,110,101,119,32,84,114,101,101,86,105,101,119,40,41,41,59,13,10,32,32,32,32,32,32,32,32,116, + 114,101,101,86,105,101,119,45,62,115,101,116,82,111,111,116,73,116,101,109,32,40,114,111,111,116,73,116,101,109,41,59,13,10,32,32,32,32,32,32, + 32,32,116,114,101,101,86,105,101,119,45,62,115,101,116,77,117,108,116,105,83,101,108,101,99,116,69,110,97,98,108,101,100,32,40,116,114,117,101,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,115,105,122,101,100,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111, + 105,100,32,115,104,111,119,70,105,108,101,84,114,101,101,67,111,109,112,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,110,100,90,101,114,111,32,40,116,114,101,101,86,105,101,119,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65, + 110,100,90,101,114,111,32,40,102,105,108,101,84,114,101,101,67,111,109,112,41,59,13,10,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,105,108,101,84,114,101,101,67,111,109,112,32,61,32,110,101,119,32,70,105,108,101,84,114,101,101, + 67,111,109,112,111,110,101,110,116,32,40,42,100,105,114,101,99,116,111,114,121,76,105,115,116,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 114,101,115,105,122,101,100,40,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,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32, + 109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49,44,32,84,40,34,67,117,115,116,111,109,32,116,114,101,101, + 118,105,101,119,32,115,104,111,119,105,110,103,32,97,110,32,88,77,76,32,116,114,101,101,34,41,41,59,13,10,32,32,32,32,32,32,32,32,109,46, + 97,100,100,73,116,101,109,32,40,50,44,32,84,40,34,70,105,108,101,84,114,101,101,67,111,109,112,111,110,101,110,116,32,115,104,111,119,105,110,103, + 32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110, + 116,32,114,32,61,32,109,46,115,104,111,119,65,116,32,40,116,121,112,101,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 105,102,32,40,114,32,61,61,32,49,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,104,111,119, + 67,117,115,116,111,109,84,114,101,101,86,105,101,119,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108, + 115,101,32,105,102,32,40,114,32,61,61,32,50,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115, + 104,111,119,70,105,108,101,84,114,101,101,67,111,109,112,40,41,59,13,10,32,32,32,32,32,32,32,32,125,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,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,84,114,101,101,86,105,101,119,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,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*) temp8; + +static const unsigned char temp9[] = {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*) temp9; -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 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, @@ -5882,285 +2678,90 @@ static const unsigned char temp13[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 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,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,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,13,10,32,32,32,32,84,104,105,115,32,99,108,97,115,115,32,115,104,111,119,115,32,104,111,119,32,116,111,32,105,109,112,108, - 101,109,101,110,116,32,97,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101,108,32,116,111,32,115,104,111,119,32,105,110,32,97,32,84, - 97,98,108,101,76,105,115,116,66,111,120,46,13,10,42,47,13,10,99,108,97,115,115,32,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101, - 110,116,32,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,32,32,32,32,32,112,117,98,108,105,99,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101, - 108,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, + 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,81,85,73,67,75,84,73,77,69,32,38,38,32,33,32,74,85,67,69,95,76,73,78,85,88,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,13,10,32,32,32,32,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110, - 101,110,116,40,41,13,10,32,32,32,32,32,32,32,32,58,32,102,111,110,116,32,40,49,52,46,48,102,41,44,13,10,32,32,32,32,32,32,32,32, - 32,32,100,101,109,111,68,97,116,97,32,40,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,76,111,97,100,32,115, - 111,109,101,32,100,97,116,97,32,102,114,111,109,32,97,110,32,101,109,98,101,100,100,101,100,32,88,77,76,32,102,105,108,101,46,46,13,10,32,32, - 32,32,32,32,32,32,108,111,97,100,68,97,116,97,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114,101,97,116,101,32,111, - 117,114,32,116,97,98,108,101,32,99,111,109,112,111,110,101,110,116,32,97,110,100,32,97,100,100,32,105,116,32,116,111,32,116,104,105,115,32,99,111, - 109,112,111,110,101,110,116,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,116,97, - 98,108,101,32,61,32,110,101,119,32,84,97,98,108,101,76,105,115,116,66,111,120,32,40,84,40,34,100,101,109,111,32,116,97,98,108,101,34,41,44, - 32,116,104,105,115,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,103,105,118,101,32,105,116,32,97,32,98,111,114,100,101,114,13, - 10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,115,101,116,67,111,108,111,117,114,32,40,76,105,115,116,66,111,120,58,58,111,117,116,108, - 105,110,101,67,111,108,111,117,114,73,100,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,116,97, - 98,108,101,45,62,115,101,116,79,117,116,108,105,110,101,84,104,105,99,107,110,101,115,115,32,40,49,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,47,47,32,65,100,100,32,115,111,109,101,32,99,111,108,117,109,110,115,32,116,111,32,116,104,101,32,116,97,98,108,101,32,104,101,97,100,101,114, - 44,32,98,97,115,101,100,32,111,110,32,116,104,101,32,99,111,108,117,109,110,32,108,105,115,116,32,105,110,32,111,117,114,32,100,97,116,97,98,97, - 115,101,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,99, - 111,108,117,109,110,76,105,115,116,44,32,99,111,108,117,109,110,88,109,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,97,100,100,67,111,108,117,109,110,32,40,99,111,108, - 117,109,110,88,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,84,40,34,110,97,109,101,34,41,44,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,13,10,47, + 47,32,115,111,32,116,104,97,116,32,119,101,32,99,97,110,32,101,97,115,105,108,121,32,104,97,118,101,32,116,119,111,32,81,84,32,119,105,110,100, + 111,119,115,32,101,97,99,104,32,119,105,116,104,32,97,32,102,105,108,101,32,98,114,111,119,115,101,114,44,32,119,114,97,112,32,116,104,105,115,32, + 117,112,32,97,115,32,97,32,99,108,97,115,115,46,46,13,10,99,108,97,115,115,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105, + 116,104,70,105,108,101,66,114,111,119,115,101,114,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,117,98,108, + 105,99,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,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,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,40,41,13,10, + 32,32,32,32,123,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,113,116,67,111,109,112, + 32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,77,111,118,105,101,67,111,109,112,111,110,101,110,116,40,41,41,59,13,10,13,10,32,32, + 32,32,32,32,32,32,47,47,32,97,110,100,32,97,32,102,105,108,101,45,99,104,111,111,115,101,114,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,102,105,108,101,67,104,111,111,115,101,114,32,61,32,110,101,119,32,70,105,108,101, + 110,97,109,101,67,111,109,112,111,110,101,110,116,32,40,84,40,34,109,111,118,105,101,34,41,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,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,32,32, - 32,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,99,111,108,117,109,110,73,100, - 34,41,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,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,119,105, - 100,116,104,34,41,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,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,53,48,44,32,52,48,48,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,97,98,108,101,72,101,97,100,101,114,67,111,109,112,111, - 110,101,110,116,58,58,100,101,102,97,117,108,116,70,108,97,103,115,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32, - 32,32,32,47,47,32,119,101,32,99,111,117,108,100,32,110,111,119,32,99,104,97,110,103,101,32,115,111,109,101,32,105,110,105,116,105,97,108,32,115, - 101,116,116,105,110,103,115,46,46,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,115, - 101,116,83,111,114,116,67,111,108,117,109,110,73,100,32,40,49,44,32,116,114,117,101,41,59,32,47,47,32,115,111,114,116,32,102,111,114,119,97,114, - 100,115,32,98,121,32,116,104,101,32,73,68,32,99,111,108,117,109,110,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,103,101,116,72, - 101,97,100,101,114,40,41,45,62,115,101,116,67,111,108,117,109,110,86,105,115,105,98,108,101,32,40,55,44,32,102,97,108,115,101,41,59,32,47,47, - 32,104,105,100,101,32,116,104,101,32,34,108,101,110,103,116,104,34,32,99,111,108,117,109,110,32,117,110,116,105,108,32,116,104,101,32,117,115,101,114, - 32,115,104,111,119,115,32,105,116,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,117,110,45,99,111,109,109,101,110,116,32,116,104,105,115,32, - 108,105,110,101,32,116,111,32,104,97,118,101,32,97,32,103,111,32,111,102,32,115,116,114,101,116,99,104,45,116,111,45,102,105,116,32,109,111,100,101, - 13,10,32,32,32,32,32,32,32,32,47,47,32,116,97,98,108,101,45,62,103,101,116,72,101,97,100,101,114,40,41,45,62,115,101,116,83,116,114,101, - 116,99,104,84,111,70,105,116,65,99,116,105,118,101,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45, - 62,115,101,116,77,117,108,116,105,112,108,101,83,101,108,101,99,116,105,111,110,69,110,97,98,108,101,100,32,40,116,114,117,101,41,59,13,10,32,32, - 32,32,125,13,10,13,10,32,32,32,32,126,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101,110,116,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,13,10,32,32,32,32,32,32,32, - 32,100,101,108,101,116,101,32,100,101,109,111,68,97,116,97,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,47,47, - 32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100, - 101,108,44,32,97,110,100,32,109,117,115,116,32,114,101,116,117,114,110,32,116,104,101,32,116,111,116,97,108,32,110,117,109,98,101,114,32,111,102,32, - 114,111,119,115,32,105,110,32,111,117,114,32,116,97,98,108,101,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40,41,13, - 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,117,109,82,111,119,115,59,13,10,32,32,32,32,125,13,10, - 13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105, - 115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,115,104,111,117,108,100,32,102,105,108,108,32,105,110,32,116,104,101,32,98,97,99,107,103, - 114,111,117,110,100,32,111,102,32,116,104,101,32,119,104,111,108,101,32,114,111,119,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,82,111, - 119,66,97,99,107,103,114,111,117,110,100,32,40,71,114,97,112,104,105,99,115,38,32,103,44,32,105,110,116,32,114,111,119,78,117,109,98,101,114,44, - 32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,116,44,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116, - 101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,98,108,117, - 101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32, - 102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,109,117,115,116,32,112,97,105,110,116,32,97, - 110,121,32,99,101,108,108,115,32,116,104,97,116,32,97,114,101,110,39,116,32,117,115,105,110,103,32,99,117,115,116,111,109,13,10,32,32,32,32,47, - 47,32,99,111,109,112,111,110,101,110,116,115,46,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,67,101,108,108,32,40,71,114,97,112,104, - 105,99,115,38,32,103,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,114,111,119,78,117,109,98, - 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,105,110,116,32,99,111,108,117,109,110,73,100,44,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104, - 116,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116, - 101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115, - 58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,102,111,110,116,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,99,111,110,115,116,32,88,109,108,69,108,101,109,101,110,116,42,32,114,111,119,69,108,101,109,101,110,116,32,61,32,100, - 97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78,117,109,98,101,114,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,69,108,101,109,101,110,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,114,111,119,69,108,101,109, - 101,110,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109, - 101,70,111,114,67,111,108,117,109,110,73,100,32,40,99,111,108,117,109,110,73,100,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,103,46,100,114,97,119,84,101,120,116,32,40,116,101,120,116,44,32,50,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105, - 103,104,116,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116,114,117,101,41,59,13, - 10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117, - 114,115,58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,50,102,41,41,59,13,10,32,32,32,32,32,32,32,32,103,46, - 102,105,108,108,82,101,99,116,32,40,119,105,100,116,104,32,45,32,49,44,32,48,44,32,49,44,32,104,101,105,103,104,116,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98, - 108,101,76,105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,116,101,108,108,115,32,117,115,32,116,104,97,116,32,116,104,101,32,117,115, - 101,114,32,104,97,115,32,99,108,105,99,107,101,100,32,97,32,116,97,98,108,101,32,104,101,97,100,101,114,13,10,32,32,32,32,47,47,32,116,111, - 32,99,104,97,110,103,101,32,116,104,101,32,115,111,114,116,32,111,114,100,101,114,46,13,10,32,32,32,32,118,111,105,100,32,115,111,114,116,79,114, - 100,101,114,67,104,97,110,103,101,100,32,40,105,110,116,32,110,101,119,83,111,114,116,67,111,108,117,109,110,73,100,44,32,99,111,110,115,116,32,98, - 111,111,108,32,105,115,70,111,114,119,97,114,100,115,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,110,101,119,83, - 111,114,116,67,111,108,117,109,110,73,100,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,68,101,109,111,68,97,116,97,83,111,114,116,101,114,32,115,111,114,116,101,114,32,40,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109, - 101,70,111,114,67,111,108,117,109,110,73,100,32,40,110,101,119,83,111,114,116,67,111,108,117,109,110,73,100,41,44,32,105,115,70,111,114,119,97,114, - 100,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,45,62,115,111,114,116,67,104,105,108,100,69,108,101, - 109,101,110,116,115,32,40,115,111,114,116,101,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,117,112, - 100,97,116,101,67,111,110,116,101,110,116,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, - 47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76,105,115,116,66,111,120,77, - 111,100,101,108,44,32,97,110,100,32,109,117,115,116,32,117,112,100,97,116,101,32,97,110,121,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101, - 110,116,115,32,116,104,97,116,32,119,101,39,114,101,32,117,115,105,110,103,13,10,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,114,101,102, - 114,101,115,104,67,111,109,112,111,110,101,110,116,70,111,114,67,101,108,108,32,40,105,110,116,32,114,111,119,78,117,109,98,101,114,44,32,105,110,116, - 32,99,111,108,117,109,110,73,100,44,32,98,111,111,108,32,105,115,82,111,119,83,101,108,101,99,116,101,100,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110, - 116,42,32,101,120,105,115,116,105,110,103,67,111,109,112,111,110,101,110,116,84,111,85,112,100,97,116,101,41,13,10,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,105,102,32,40,99,111,108,117,109,110,73,100,32,61,61,32,53,41,32,47,47,32,73,102,32,105,116,39,115,32,116,104,101,32, - 114,97,116,105,110,103,115,32,99,111,108,117,109,110,44,32,119,101,39,108,108,32,114,101,116,117,114,110,32,111,117,114,32,99,117,115,116,111,109,32, - 99,111,109,112,111,110,101,110,116,46,46,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,82,97,116,105, - 110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,42,32,114,97,116,105,110,103,115,66,111,120,32,61,32,40,82, - 97,116,105,110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,42,41,32,101,120,105,115,116,105,110,103,67,111,109, - 112,111,110,101,110,116,84,111,85,112,100,97,116,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,97,110,32, - 101,120,105,115,116,105,110,103,32,99,111,109,112,111,110,101,110,116,32,105,115,32,98,101,105,110,103,32,112,97,115,115,101,100,45,105,110,32,102,111, - 114,32,117,112,100,97,116,105,110,103,44,32,119,101,39,108,108,32,114,101,45,117,115,101,32,105,116,44,32,98,117,116,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,47,47,32,105,102,32,110,111,116,44,32,119,101,39,108,108,32,104,97,118,101,32,116,111,32,99,114,101,97,116,101,32,111,110, - 101,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,97,116,105,110,103,115,66,111,120,32,61,61,32,48,41,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,97,116,105,110,103,115,66,111,120,32,61,32,110,101,119,32,82,97,116,105,110,103,67,111,108, - 117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,40,42,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,114,97,116,105,110,103,115,66,111,120,45,62,115,101,116,82,111,119,65,110,100,67,111,108,117,109,110,32,40,114,111,119,78,117,109,98,101, - 114,44,32,99,111,108,117,109,110,73,100,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,114,97,116,105, - 110,103,115,66,111,120,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,102,111,114,32,97,110,121,32,111,116,104,101,114,32,99,111,108,117,109,110, - 44,32,106,117,115,116,32,114,101,116,117,114,110,32,48,44,32,97,115,32,119,101,39,108,108,32,98,101,32,112,97,105,110,116,105,110,103,32,116,104, - 101,115,101,32,99,111,108,117,109,110,115,32,100,105,114,101,99,116,108,121,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,97,115, - 115,101,114,116,32,40,101,120,105,115,116,105,110,103,67,111,109,112,111,110,101,110,116,84,111,85,112,100,97,116,101,32,61,61,32,48,41,59,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13, - 10,13,10,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,111,118,101,114,108,111,97,100,101,100,32,102,114,111,109,32,84,97,98,108,101,76, - 105,115,116,66,111,120,77,111,100,101,108,44,32,97,110,100,32,115,104,111,117,108,100,32,99,104,111,111,115,101,32,116,104,101,32,98,101,115,116,32, - 119,105,100,116,104,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,13,10,32,32,32,32,47,47,32,99,111,108,117,109,110,46,13, - 10,32,32,32,32,105,110,116,32,103,101,116,67,111,108,117,109,110,65,117,116,111,83,105,122,101,87,105,100,116,104,32,40,105,110,116,32,99,111,108, - 117,109,110,73,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,99,111,108,117,109,110,73,100,32,61,61,32,53, - 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,49,48,48,59,32,47,47,32,40,116,104,105,115,32,105,115,32,116, - 104,101,32,114,97,116,105,110,103,115,32,99,111,108,117,109,110,44,32,99,111,110,116,97,105,110,105,110,103,32,97,32,99,117,115,116,111,109,32,99, - 111,109,112,111,110,101,110,116,41,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,119,105,100,101,115,116,32,61,32,51,50,59,13,10,13, - 10,32,32,32,32,32,32,32,32,47,47,32,102,105,110,100,32,116,104,101,32,119,105,100,101,115,116,32,98,105,116,32,111,102,32,116,101,120,116,32, - 105,110,32,116,104,105,115,32,99,111,108,117,109,110,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,103, - 101,116,78,117,109,82,111,119,115,40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,99,111,110,115,116,32,88,109,108,69,108,101,109,101,110,116,42,32,114,111,119,69,108,101,109,101,110,116,32,61,32,100, - 97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,105,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,105,102,32,40,114,111,119,69,108,101,109,101,110,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,114,111,119, - 69,108,101,109,101,110,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,103,101,116,65,116,116,114,105,98,117,116, - 101,78,97,109,101,70,111,114,67,111,108,117,109,110,73,100,32,40,99,111,108,117,109,110,73,100,41,41,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,119,105,100,101,115,116,32,61,32,106,109,97,120,32,40,119,105,100,101,115,116,44,32,102,111,110,116,46,103,101, - 116,83,116,114,105,110,103,87,105,100,116,104,32,40,116,101,120,116,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, - 32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,119,105,100,101,115,116,32,43,32,56,59,13,10,32, - 32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,65,32,99,111,117,112,108,101,32,111,102,32,113,117,105,99,107,32,109,101,116,104,111,100,115, - 32,116,111,32,115,101,116,32,97,110,100,32,103,101,116,32,116,104,101,32,34,114,97,116,105,110,103,34,32,118,97,108,117,101,32,119,104,101,110,32, - 116,104,101,32,117,115,101,114,13,10,32,32,32,32,47,47,32,99,104,97,110,103,101,115,32,116,104,101,32,99,111,109,98,111,32,98,111,120,13,10, - 32,32,32,32,105,110,116,32,103,101,116,82,97,116,105,110,103,32,40,99,111,110,115,116,32,105,110,116,32,114,111,119,78,117,109,98,101,114,44,32, - 99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32, - 32,32,114,101,116,117,114,110,32,100,97,116,97,76,105,115,116,45,62,103,101,116,67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78, - 117,109,98,101,114,41,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,40,84,40,34,82,97,116,105,110,103,34,41,41,59,13,10, - 32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,101,116,82,97,116,105,110,103,32,40,99,111,110,115,116,32,105,110,116,32,114, - 111,119,78,117,109,98,101,114,44,32,99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,44,32,99,111,110,115,116,32,105,110,116,32, - 110,101,119,82,97,116,105,110,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,45,62,103,101,116, - 67,104,105,108,100,69,108,101,109,101,110,116,32,40,114,111,119,78,117,109,98,101,114,41,45,62,115,101,116,65,116,116,114,105,98,117,116,101,32,40, - 84,40,34,82,97,116,105,110,103,34,41,44,32,110,101,119,82,97,116,105,110,103,41,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,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,47,47,32,112, - 111,115,105,116,105,111,110,32,111,117,114,32,116,97,98,108,101,32,119,105,116,104,32,97,32,103,97,112,32,97,114,111,117,110,100,32,105,116,115,32, - 101,100,103,101,13,10,32,32,32,32,32,32,32,32,116,97,98,108,101,45,62,115,101,116,66,111,117,110,100,115,73,110,115,101,116,32,40,66,111,114, - 100,101,114,83,105,122,101,32,40,56,41,41,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,97,98,108,101,76,105,115,116,66,111,120,42,32,116,97,98,108,101,59,32,32,32,32,47,47,32,116,104,101,32,116,97,98,108,101,32,99,111,109, - 112,111,110,101,110,116,32,105,116,115,101,108,102,13,10,32,32,32,32,70,111,110,116,32,102,111,110,116,59,13,10,13,10,32,32,32,32,88,109,108, - 69,108,101,109,101,110,116,42,32,100,101,109,111,68,97,116,97,59,32,32,32,47,47,32,84,104,105,115,32,105,115,32,116,104,101,32,88,77,76,32, - 100,111,99,117,109,101,110,116,32,108,111,97,100,101,100,32,102,114,111,109,32,116,104,101,32,101,109,98,101,100,100,101,100,32,102,105,108,101,32,34, - 100,101,109,111,32,116,97,98,108,101,32,100,97,116,97,46,120,109,108,34,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,99,111, - 108,117,109,110,76,105,115,116,59,32,47,47,32,65,32,112,111,105,110,116,101,114,32,116,111,32,116,104,101,32,115,117,98,45,110,111,100,101,32,111, - 102,32,100,101,109,111,68,97,116,97,32,116,104,97,116,32,99,111,110,116,97,105,110,115,32,116,104,101,32,108,105,115,116,32,111,102,32,99,111,108, - 117,109,110,115,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,100,97,116,97,76,105,115,116,59,32,32,32,47,47,32,65,32,112, - 111,105,110,116,101,114,32,116,111,32,116,104,101,32,115,117,98,45,110,111,100,101,32,111,102,32,100,101,109,111,68,97,116,97,32,116,104,97,116,32, - 99,111,110,116,97,105,110,115,32,116,104,101,32,108,105,115,116,32,111,102,32,100,97,116,97,32,114,111,119,115,13,10,32,32,32,32,105,110,116,32, - 110,117,109,82,111,119,115,59,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,101,32,110,117,109,98,101,114,32,111,102,32,114,111,119, - 115,32,111,102,32,100,97,116,97,32,119,101,39,118,101,32,103,111,116,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,47,47,32,84,104,105,115, - 32,105,115,32,97,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101,110,116,32,99,111,110,116,97,105,110,105,110,103,32,97,32,99,111,109,98, - 111,32,98,111,120,44,32,119,104,105,99,104,32,119,101,39,114,101,32,103,111,105,110,103,32,116,111,32,112,117,116,32,105,110,115,105,100,101,13,10, - 32,32,32,32,47,47,32,111,117,114,32,116,97,98,108,101,39,115,32,34,114,97,116,105,110,103,34,32,99,111,108,117,109,110,46,13,10,32,32,32, - 32,99,108,97,115,115,32,82,97,116,105,110,103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,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,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,67,111,109,98,111,66,111,120,76,105,115, - 116,101,110,101,114,13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,82,97,116,105,110, - 103,67,111,108,117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,32,40,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101, - 110,116,38,32,111,119,110,101,114,95,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,111,119,110,101,114,32,40,111,119,110,101,114,95, - 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,106,117,115,116,32,112,117,116,32,97,32, - 99,111,109,98,111,32,98,111,120,32,105,110,115,105,100,101,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,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,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67, - 111,109,98,111,66,111,120,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99, - 111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,102,97,98,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,103,114,111,111,118,121,34,41,44,32,50,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,104,101,112,34, - 41,44,32,51,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84, - 40,34,110,101,97,116,34,41,44,32,52,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100, - 73,116,101,109,32,40,84,40,34,119,105,108,100,34,41,44,32,53,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66, - 111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,115,119,105,110,103,105,110,34,41,44,32,54,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,109,97,100,32,102,111,114,32,105,116,34,41,44,32, - 55,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,119,104,101,110,32,116,104,101,32,99,111,109,98,111,32,105,115,32, - 99,104,97,110,103,101,100,44,32,119,101,39,108,108,32,103,101,116,32,97,32,99,97,108,108,98,97,99,107,46,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,99,111,109,98,111,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,32,32,32,32,32, - 32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,87,97,110,116,115,75,101,121,98,111,97,114,100,70,111,99,117,115,32,40, - 102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,126,82,97,116,105,110,103,67,111,108, - 117,109,110,67,117,115,116,111,109,67,111,109,112,111,110,101,110,116,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,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,32,32,32,32,125,13,10,13,10, - 32,32,32,32,32,32,32,32,118,111,105,100,32,114,101,115,105,122,101,100,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,66,111,117,110,100,115,73,110,115,101,116,32,40,66,111,114,100,101,114,83, - 105,122,101,32,40,50,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,79,117,114,32,100, - 101,109,111,32,99,111,100,101,32,119,105,108,108,32,99,97,108,108,32,116,104,105,115,32,119,104,101,110,32,119,101,32,109,97,121,32,110,101,101,100, - 32,116,111,32,117,112,100,97,116,101,32,111,117,114,32,99,111,110,116,101,110,116,115,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,115,101, - 116,82,111,119,65,110,100,67,111,108,117,109,110,32,40,99,111,110,115,116,32,105,110,116,32,110,101,119,82,111,119,44,32,99,111,110,115,116,32,105, - 110,116,32,110,101,119,67,111,108,117,109,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,111, - 119,32,61,32,110,101,119,82,111,119,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,108,117,109,110,73,100,32,61,32,110,101,119,67, - 111,108,117,109,110,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,83,101,108,101,99,116,101, - 100,73,100,32,40,111,119,110,101,114,46,103,101,116,82,97,116,105,110,103,32,40,114,111,119,44,32,99,111,108,117,109,110,73,100,41,44,32,116,114, - 117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120, - 67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,84,104,97,116,72,97,115,67,104,97,110,103,101, - 100,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,115,101,116,82,97,116,105, - 110,103,32,40,114,111,119,44,32,99,111,108,117,109,110,73,100,44,32,99,111,109,98,111,66,111,120,45,62,103,101,116,83,101,108,101,99,116,101,100, - 73,100,40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32, - 32,32,32,84,97,98,108,101,68,101,109,111,67,111,109,112,111,110,101,110,116,38,32,111,119,110,101,114,59,13,10,32,32,32,32,32,32,32,32,67, - 111,109,98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,114,111,119,44,32,99,111,108, - 117,109,110,73,100,59,13,10,32,32,32,32,125,59,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, + 32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,110,111,110,101,120,105,115,116,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,102,97,108,115,101,44,32,102,97,108,115,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,42,46,42,34,41,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,83,116,114,105,110,103,58,58,101,109,112,116,121,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,40,99,104,111,111,115,101,32,97,32,118,105,100,101,111,32,102,105,108,101,32, + 116,111,32,112,108,97,121,41,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45,62,97,100,100,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101, + 116,66,114,111,119,115,101,66,117,116,116,111,110,84,101,120,116,32,40,84,40,34,98,114,111,119,115,101,34,41,41,59,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,126,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,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,113,116,67,111,109,112,45,62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32, + 103,101,116,72,101,105,103,104,116,40,41,32,45,32,51,48,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45, + 62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,50,52,44,32,103,101,116,87,105,100,116, + 104,40,41,44,32,50,52,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,102,105,108,101,110,97,109,101,67,111,109, + 112,111,110,101,110,116,67,104,97,110,103,101,100,32,40,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,42,41,13,10,32,32,32,32, + 123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,117,115, + 101,114,32,99,104,97,110,103,101,115,32,116,104,101,32,102,105,108,101,110,97,109,101,32,105,110,32,116,104,101,32,102,105,108,101,32,99,104,111,111, + 115,101,114,32,98,111,120,13,10,32,32,32,32,32,32,32,32,105,102,32,40,113,116,67,111,109,112,45,62,108,111,97,100,77,111,118,105,101,32,40, + 102,105,108,101,67,104,111,111,115,101,114,45,62,103,101,116,67,117,114,114,101,110,116,70,105,108,101,40,41,44,32,116,114,117,101,41,41,13,10,32, + 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,108,111,97,100,101,100,32,116,104,101,32,102,105,108,101, + 32,111,107,44,32,115,111,32,108,101,116,39,115,32,115,116,97,114,116,32,105,116,32,112,108,97,121,105,110,103,46,46,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,113,116,67,111,109,112,45,62,112,108,97,121,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32, + 32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105, + 110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105, + 110,103,73,99,111,110,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,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,84,40,34,67,111,117,108,100,110,39,116,32,108,111,97,100,32,116,104,101,32,102,105,108,101,33,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,84,40,34,83,111,114,114,121,44,32,81,117,105,99,107,84,105,109,101,32,100,105,100,110,39,116,32,109,97,110,97,103,101,32,116,111,32,108, + 111,97,100,32,116,104,97,116,32,102,105,108,101,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10, + 112,114,105,118,97,116,101,58,13,10,32,32,32,32,81,117,105,99,107,84,105,109,101,77,111,118,105,101,67,111,109,112,111,110,101,110,116,42,32,113, + 116,67,111,109,112,59,13,10,32,32,32,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,42,32,102,105,108,101,67,104,111,111,115, + 101,114,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,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,47,47,32,65,32,99,111,109,112,97,114,97, - 116,111,114,32,117,115,101,100,32,116,111,32,115,111,114,116,32,111,117,114,32,100,97,116,97,32,119,104,101,110,32,116,104,101,32,117,115,101,114,32, - 99,108,105,99,107,115,32,97,32,99,111,108,117,109,110,32,104,101,97,100,101,114,13,10,32,32,32,32,99,108,97,115,115,32,68,101,109,111,68,97, - 116,97,83,111,114,116,101,114,13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101, - 109,111,68,97,116,97,83,111,114,116,101,114,32,40,99,111,110,115,116,32,83,116,114,105,110,103,32,97,116,116,114,105,98,117,116,101,84,111,83,111, - 114,116,95,44,32,98,111,111,108,32,102,111,114,119,97,114,100,115,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,97,116,116,114,105, - 98,117,116,101,84,111,83,111,114,116,32,40,97,116,116,114,105,98,117,116,101,84,111,83,111,114,116,95,41,44,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,100,105,114,101,99,116,105,111,110,32,40,102,111,114,119,97,114,100,115,32,63,32,49,32,58,32,45,49,41,13,10,32,32,32, - 32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,99,111,109,112,97,114,101, - 69,108,101,109,101,110,116,115,32,40,88,109,108,69,108,101,109,101,110,116,42,32,102,105,114,115,116,44,32,88,109,108,69,108,101,109,101,110,116,42, - 32,115,101,99,111,110,100,41,32,99,111,110,115,116,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105, - 110,116,32,114,101,115,117,108,116,32,61,32,102,105,114,115,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,97, - 116,116,114,105,98,117,116,101,84,111,83,111,114,116,41,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,32,32,46,99,111,109,112,97,114,101,76,101,120,105,99,111,103,114,97,112,104,105,99,97,108,108,121,32,40,115,101,99,111,110,100,45,62,103, - 101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,97,116,116,114,105,98,117,116,101,84,111,83,111,114,116,41,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,114,101,115,117,108,116,32,61,32,102,105,114,115,116,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116, - 101,32,40,84,40,34,73,68,34,41,41,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,32,32, - 46,99,111,109,112,97,114,101,76,101,120,105,99,111,103,114,97,112,104,105,99,97,108,108,121,32,40,115,101,99,111,110,100,45,62,103,101,116,83,116, - 114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,84,40,34,73,68,34,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,114,101,116,117,114,110,32,100,105,114,101,99,116,105,111,110,32,42,32,114,101,115,117,108,116,59,13,10,32,32,32,32,32,32,32,32,125,13,10, - 13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,97,116,116, - 114,105,98,117,116,101,84,111,83,111,114,116,59,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,100,105,114,101,99,116,105, - 111,110,59,13,10,32,32,32,32,125,59,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,13,10,99,108,97,115,115,32,81,117,105,99,107,84,105,109,101,68,101,109,111,32,32,58,32,112,117, + 98,108,105,99,32,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,13,10,32,32,32,32,47,47,32,116,104,105,115,32,108,111,97,100,115,32,116, - 104,101,32,101,109,98,101,100,100,101,100,32,100,97,116,97,98,97,115,101,32,88,77,76,32,102,105,108,101,32,105,110,116,111,32,109,101,109,111,114, - 121,13,10,32,32,32,32,118,111,105,100,32,108,111,97,100,68,97,116,97,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,88, - 109,108,68,111,99,117,109,101,110,116,32,100,97,116,97,68,111,99,32,40,83,116,114,105,110,103,32,40,40,99,111,110,115,116,32,99,104,97,114,42, - 41,32,66,105,110,97,114,121,68,97,116,97,58,58,100,101,109,111,95,116,97,98,108,101,95,100,97,116,97,95,120,109,108,41,41,59,13,10,32,32, - 32,32,32,32,32,32,100,101,109,111,68,97,116,97,32,61,32,100,97,116,97,68,111,99,46,103,101,116,68,111,99,117,109,101,110,116,69,108,101,109, - 101,110,116,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,97,116,97,76,105,115,116,32,61,32,100,101,109,111,68,97,116,97,45,62,103, - 101,116,67,104,105,108,100,66,121,78,97,109,101,32,40,84,40,34,68,65,84,65,34,41,41,59,13,10,32,32,32,32,32,32,32,32,99,111,108,117, - 109,110,76,105,115,116,32,61,32,100,101,109,111,68,97,116,97,45,62,103,101,116,67,104,105,108,100,66,121,78,97,109,101,32,40,84,40,34,67,79, - 76,85,77,78,83,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,110,117,109,82,111,119,115,32,61,32,100,97,116,97,76,105,115,116,45, - 62,103,101,116,78,117,109,67,104,105,108,100,69,108,101,109,101,110,116,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47, - 32,40,97,32,117,116,105,108,105,116,121,32,109,101,116,104,111,100,32,116,111,32,115,101,97,114,99,104,32,111,117,114,32,88,77,76,32,102,111,114, - 32,116,104,101,32,97,116,116,114,105,98,117,116,101,32,116,104,97,116,32,109,97,116,99,104,101,115,32,97,32,99,111,108,117,109,110,32,73,68,41, - 13,10,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,103,101,116,65,116,116,114,105,98,117,116,101,78,97,109,101,70,111,114,67,111, - 108,117,109,110,73,100,32,40,99,111,110,115,116,32,105,110,116,32,99,111,108,117,109,110,73,100,41,32,99,111,110,115,116,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,102,111,114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,99,111,108,117,109, - 110,76,105,115,116,44,32,99,111,108,117,109,110,88,109,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,105,102,32,40,99,111,108,117,109,110,88,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105,98,117,116,101,32,84,40,34,99,111,108,117, - 109,110,73,100,34,41,32,61,61,32,99,111,108,117,109,110,73,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116, - 117,114,110,32,99,111,108,117,109,110,88,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,84,40,34,110,97,109, - 101,34,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,83,116,114,105,110,103, - 58,58,101,109,112,116,121,59,13,10,32,32,32,32,125,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,13,10,32,32,32,32,81,117, + 105,99,107,84,105,109,101,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,84, + 40,34,81,117,105,99,107,84,105,109,101,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,109,111,118,105, + 101,32,99,111,109,112,111,110,101,110,116,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,113,116,67,111,109,112,49,32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66, + 114,111,119,115,101,114,40,41,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,113, + 116,67,111,109,112,50,32,61,32,110,101,119,32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119, + 115,101,114,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,81,117,105,99,107,84,105,109,101,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,113,116,67,111,109,112,49,45,62,115,101,116,66,111,117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,48,53,102,44,32,48,46,48,53, + 102,44,32,48,46,52,50,53,102,44,32,48,46,57,102,41,59,13,10,32,32,32,32,32,32,32,32,113,116,67,111,109,112,50,45,62,115,101,116,66, + 111,117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,53,50,53,102,44,32,48,46,48,53,102,44,32,48,46,52,50,53,102,44,32,48,46, + 57,102,41,59,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114, - 101,97,116,101,84,97,98,108,101,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,84,97,98,108,101, - 68,101,109,111,67,111,109,112,111,110,101,110,116,40,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::tabledemo_cpp = (const char*) temp13; + 61,61,61,61,61,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,81,117,105,99,107, + 84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,42,32,113,116,67,111,109,112,49,59,13,10,32,32,32, + 32,81,117,105,99,107,84,105,109,101,87,105,110,100,111,119,87,105,116,104,70,105,108,101,66,114,111,119,115,101,114,42,32,113,116,67,111,109,112,50, + 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,81,117,105,99,107,84,105,109,101,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,81,117,105,99,107,84,105,109,101,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::quicktimedemo_cpp = (const char*) temp10; -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 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, @@ -6197,450 +2798,1201 @@ static const unsigned char temp14[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 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,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,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,32,112,117,98,108,105,99, - 32,65,115,121,110,99,85,112,100,97,116,101,114,13,10,123,13,10,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,115,105,122,101,44,32, - 100,120,44,32,100,121,44,32,119,44,32,104,44,32,112,97,114,101,110,116,87,105,100,116,104,44,32,112,97,114,101,110,116,72,101,105,103,104,116,59, - 13,10,32,32,32,32,102,108,111,97,116,32,105,110,110,101,114,88,44,32,105,110,110,101,114,89,59,13,10,32,32,32,32,67,111,108,111,117,114,32, - 99,111,108,111,117,114,59,13,10,32,32,32,32,67,114,105,116,105,99,97,108,83,101,99,116,105,111,110,32,108,111,99,107,59,13,10,32,32,32,32, - 105,110,116,32,116,104,114,101,97,100,73,100,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,66,111,117,110,99,105,110,103,66,97, - 108,108,67,111,109,112,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,120,32,61,32,82,97,110,100,111,109,58,58,103,101,116, - 83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,50,48,48,46,48,102,59,13,10,32,32, - 32,32,32,32,32,32,121,32,61,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116, - 70,108,111,97,116,40,41,32,42,32,50,48,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,87,105,100,116,104,32,61, - 32,53,48,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,72,101,105,103,104,116,32,61,32,53,48,59,13,10,32,32,32,32,32,32, - 32,32,105,110,110,101,114,88,32,61,32,48,59,13,10,32,32,32,32,32,32,32,32,105,110,110,101,114,89,32,61,32,48,59,13,10,32,32,32,32, - 32,32,32,32,116,104,114,101,97,100,73,100,32,61,32,48,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116, - 32,115,112,101,101,100,32,61,32,53,46,48,102,59,32,47,47,32,103,105,118,101,32,101,97,99,104,32,98,97,108,108,32,97,32,102,105,120,101,100, - 32,115,112,101,101,100,32,115,111,32,119,101,32,99,97,110,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,32,32,32,32,32,32,32,32,32,47,47,32,115,101,101,32,116,104,101,32,101,102,102,101,99,116,115,32,111,102,32,116,104,114,101,97,100, - 32,112,114,105,111,114,105,116,121,32,111,110,32,104,111,119,32,102,97,115,116,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,32,32,32,32,32,32,32,32,32,47,47,32,116,104,101,121,32,97,99,116,117,97,108,108,121,32,103,111,46,13,10,32, - 32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,97,110,103,108,101,32,61,32,82,97,110,100,111,109,58,58,103,101,116,83,121, - 115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,102,108,111,97,116,95,80,105,32,42,32,50,46, - 48,102,59,13,10,13,10,32,32,32,32,32,32,32,32,100,120,32,61,32,115,105,110,102,32,40,97,110,103,108,101,41,32,42,32,115,112,101,101,100, - 59,13,10,32,32,32,32,32,32,32,32,100,121,32,61,32,99,111,115,102,32,40,97,110,103,108,101,41,32,42,32,115,112,101,101,100,59,13,10,13, - 10,32,32,32,32,32,32,32,32,115,105,122,101,32,61,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40, - 41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,51,48,46,48,102,32,43,32,51,48,46,48,102,59,13,10,13,10,32,32,32,32,32,32, - 32,32,99,111,108,111,117,114,32,61,32,67,111,108,111,117,114,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100, - 111,109,40,41,46,110,101,120,116,73,110,116,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,119,105, - 116,104,65,108,112,104,97,32,40,48,46,53,102,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,119,105,116, - 104,66,114,105,103,104,116,110,101,115,115,32,40,48,46,55,102,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,66,111,117,110,99, - 105,110,103,66,97,108,108,67,111,109,112,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32, - 112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,115,101, - 116,67,111,108,111,117,114,32,40,99,111,108,111,117,114,41,59,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,69,108,108,105,112,115,101, - 32,40,105,110,110,101,114,88,44,32,105,110,110,101,114,89,44,32,115,105,122,101,44,32,115,105,122,101,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32, - 32,103,46,115,101,116,70,111,110,116,32,40,49,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32, - 40,83,116,114,105,110,103,58,58,116,111,72,101,120,83,116,114,105,110,103,32,40,116,104,114,101,97,100,73,100,41,44,32,48,44,32,48,44,32,103, - 101,116,87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99, - 101,110,116,114,101,100,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,114,101,110, - 116,83,105,122,101,67,104,97,110,103,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,87,105,100, - 116,104,32,61,32,103,101,116,80,97,114,101,110,116,87,105,100,116,104,40,41,32,45,32,115,105,122,101,59,13,10,32,32,32,32,32,32,32,32,112, - 97,114,101,110,116,72,101,105,103,104,116,32,61,32,103,101,116,80,97,114,101,110,116,72,101,105,103,104,116,40,41,32,45,32,115,105,122,101,59,13, - 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,104,97,110,100,108,101,65,115,121,110,99,85,112,100,97,116,101,40,41,13,10, - 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,99,111,112,101,100,76,111,99,107,32,115,108,32,40,108,111,99,107, - 41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,66,111,117,110,100,115,32,40,40,40,105,110,116,41,32,120,41,32,45,32,50,44,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,121,41,32,45,32,50,44,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,115,105,122,101,41,32,43,32,52,44,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,115,105,122,101,41,32,43,32,52,41,59,13,10,13,10,32,32,32,32,32, - 32,32,32,105,110,110,101,114,88,32,61,32,120,32,45,32,103,101,116,88,40,41,59,13,10,32,32,32,32,32,32,32,32,105,110,110,101,114,89,32, - 61,32,121,32,45,32,103,101,116,89,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,109,111,118,101,66,97,108,108,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32, - 32,32,99,111,110,115,116,32,83,99,111,112,101,100,76,111,99,107,32,115,108,32,40,108,111,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,116,104,114,101,97,100,73,100,32,61,32,84,104,114,101,97,100,58,58,103,101,116,67,117,114,114,101,110,116,84,104,114,101,97,100,73,100,40,41, - 59,32,47,47,32,116,104,105,115,32,105,115,32,115,111,32,116,104,101,32,99,111,109,112,111,110,101,110,116,32,99,97,110,32,112,114,105,110,116,32, - 116,104,101,32,116,104,114,101,97,100,32,73,68,32,105,110,115,105,100,101,32,116,104,101,32,98,97,108,108,13,10,13,10,32,32,32,32,32,32,32, - 32,120,32,43,61,32,100,120,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,100,121,59,13,10,13,10,32,32,32,32,32,32,32,32,105, - 102,32,40,120,32,60,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,120,32,61,32,102,97,98,115,102,32,40,100,120,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,120,32,62,32,112,97,114,101,110,116,87,105,100,116,104,41,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,100,120,32,61,32,45,102,97,98,115,102,32,40,100,120,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,121,32, - 60,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,121,32,61,32,102,97,98,115,102,32,40,100,121,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,105,102,32,40,121,32,62,32,112,97,114,101,110,116,72,101,105,103,104,116,41,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,100,121,32,61,32,45,102,97,98,115,102,32,40,100,121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115, - 32,99,97,108,108,101,100,32,111,110,32,97,32,98,97,99,107,103,114,111,117,110,100,32,116,104,114,101,97,100,44,32,115,111,32,119,101,32,100,111, - 110,39,116,32,119,97,110,116,32,116,111,32,99,97,108,108,13,10,32,32,32,32,32,32,32,32,47,47,32,97,110,121,32,85,73,32,99,111,100,101, - 32,102,114,111,109,32,104,101,114,101,32,45,32,105,110,115,116,101,97,100,32,119,101,39,108,108,32,116,114,105,103,103,101,114,32,97,110,32,101,118, - 101,110,116,32,116,104,97,116,32,119,105,108,108,32,117,112,100,97,116,101,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,99,111,109, - 112,111,110,101,110,116,39,115,32,112,111,115,105,116,105,111,110,32,108,97,116,101,114,46,32,84,104,105,115,32,105,115,32,97,32,115,97,102,101,32, - 119,97,121,32,116,111,32,97,118,111,105,100,32,100,101,97,100,108,111,99,107,115,13,10,32,32,32,32,32,32,32,32,116,114,105,103,103,101,114,65, - 115,121,110,99,85,112,100,97,116,101,40,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,125,59,13,10,13,10,13,10,47,47,61,61,61,61,61,61,61,61,61,61,61,61, + 61,13,10,47,42,42,32,79,117,114,32,100,101,109,111,32,115,121,110,116,104,32,111,110,108,121,32,104,97,115,32,111,110,101,32,116,121,112,101,32, + 111,102,32,115,111,117,110,100,44,32,97,110,100,32,105,116,39,115,32,118,101,114,121,32,98,97,115,105,99,46,46,13,10,42,47,13,10,99,108,97, + 115,115,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,58,32,112,117,98,108,105,99,32,83,121,110,116,104,101,115,105,115,101,114,83,111,117, + 110,100,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,40,99,111,110,115,116, + 32,66,105,116,65,114,114,97,121,38,32,109,105,100,105,78,111,116,101,115,95,41,13,10,32,32,32,32,32,32,32,32,58,32,109,105,100,105,78,111, + 116,101,115,32,40,109,105,100,105,78,111,116,101,115,95,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111, + 111,108,32,97,112,112,108,105,101,115,84,111,78,111,116,101,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,78,111,116,101,78,117,109,98, + 101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,109,105,100,105,78,111,116,101,115,32,91,109,105, + 100,105,78,111,116,101,78,117,109,98,101,114,93,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111,111,108,32,97,112,112,108,105,101, + 115,84,111,67,104,97,110,110,101,108,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,67,104,97,110,110,101,108,41,32,32,32,32,32,32, + 32,32,32,32,32,123,32,114,101,116,117,114,110,32,116,114,117,101,59,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,47, + 47,32,116,104,105,115,32,119,105,108,108,32,99,111,110,116,97,105,110,32,116,104,101,32,110,111,116,101,115,32,116,104,97,116,32,116,104,105,115,32, + 115,111,117,110,100,32,105,115,32,97,116,116,97,99,104,101,100,32,116,111,46,13,10,32,32,32,32,66,105,116,65,114,114,97,121,32,109,105,100,105, + 78,111,116,101,115,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,47,42,42,32,79,117,114,32,100,101,109,111,32,115,121,110,116,104,32,118,111,105, + 99,101,32,106,117,115,116,32,112,108,97,121,115,32,97,32,115,105,110,101,32,119,97,118,101,46,46,13,10,42,47,13,10,99,108,97,115,115,32,83, + 105,110,101,87,97,118,101,86,111,105,99,101,32,32,58,32,112,117,98,108,105,99,32,83,121,110,116,104,101,115,105,115,101,114,86,111,105,99,101,13, + 10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,83,105,110,101,87,97,118,101,86,111,105,99,101,40,41,13,10,32,32,32,32,32,32, + 32,32,58,32,97,110,103,108,101,68,101,108,116,97,32,40,48,46,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102, + 32,40,48,46,48,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,98,111,111,108,32,99,97,110,80,108,97,121, + 83,111,117,110,100,32,40,83,121,110,116,104,101,115,105,115,101,114,83,111,117,110,100,42,32,115,111,117,110,100,41,13,10,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,100,121,110,97,109,105,99,95,99,97,115,116,32,60,83,105,110,101,87,97,118,101,83,111,117, + 110,100,42,62,32,40,115,111,117,110,100,41,32,33,61,32,48,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,116, + 97,114,116,78,111,116,101,32,40,99,111,110,115,116,32,105,110,116,32,109,105,100,105,78,111,116,101,78,117,109,98,101,114,44,32,99,111,110,115,116, + 32,102,108,111,97,116,32,118,101,108,111,99,105,116,121,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,83,121, + 110,116,104,101,115,105,115,101,114,83,111,117,110,100,42,32,115,111,117,110,100,44,32,99,111,110,115,116,32,105,110,116,32,99,117,114,114,101,110,116, + 80,105,116,99,104,87,104,101,101,108,80,111,115,105,116,105,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,117,114,114, + 101,110,116,65,110,103,108,101,32,61,32,48,46,48,59,13,10,32,32,32,32,32,32,32,32,108,101,118,101,108,32,61,32,118,101,108,111,99,105,116, + 121,32,42,32,48,46,49,53,59,13,10,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,61,32,48,46,48,59,13,10,13,10,32,32,32, + 32,32,32,32,32,100,111,117,98,108,101,32,99,121,99,108,101,115,80,101,114,83,101,99,111,110,100,32,61,32,77,105,100,105,77,101,115,115,97,103, + 101,58,58,103,101,116,77,105,100,105,78,111,116,101,73,110,72,101,114,116,122,32,40,109,105,100,105,78,111,116,101,78,117,109,98,101,114,41,59,13, + 10,32,32,32,32,32,32,32,32,100,111,117,98,108,101,32,99,121,99,108,101,115,80,101,114,83,97,109,112,108,101,32,61,32,99,121,99,108,101,115, + 80,101,114,83,101,99,111,110,100,32,47,32,103,101,116,83,97,109,112,108,101,82,97,116,101,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 97,110,103,108,101,68,101,108,116,97,32,61,32,99,121,99,108,101,115,80,101,114,83,97,109,112,108,101,32,42,32,50,46,48,32,42,32,100,111,117, + 98,108,101,95,80,105,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,116,111,112,78,111,116,101,32,40,99,111,110, + 115,116,32,98,111,111,108,32,97,108,108,111,119,84,97,105,108,79,102,102,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102, + 32,40,97,108,108,111,119,84,97,105,108,79,102,102,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 47,47,32,115,116,97,114,116,32,97,32,116,97,105,108,45,111,102,102,32,98,121,32,115,101,116,116,105,110,103,32,116,104,105,115,32,102,108,97,103, + 46,32,84,104,101,32,114,101,110,100,101,114,32,99,97,108,108,98,97,99,107,32,119,105,108,108,32,112,105,99,107,32,117,112,32,111,110,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,97,110,100,32,100,111,32,97,32,102,97,100,101,32,111,117,116,44,32,99,97, + 108,108,105,110,103,32,99,108,101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,32,119,104,101,110,32,105,116,39,115,32,102,105,110,105,115, + 104,101,100,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,61,61,32,48,46,48,41,32, + 47,47,32,119,101,32,111,110,108,121,32,110,101,101,100,32,116,111,32,98,101,103,105,110,32,97,32,116,97,105,108,45,111,102,102,32,105,102,32,105, + 116,39,115,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,105,110,103,32,115,111,32,45,32,116,104,101,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,32,32,32,32,32,32,32,47,47,32,115,116,111,112,78,111,116,101,32,109,101,116,104, + 111,100,32,99,111,117,108,100,32,98,101,32,99,97,108,108,101,100,32,109,111,114,101,32,116,104,97,110,32,111,110,99,101,46,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,61,32,49,46,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32, + 32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,119, + 101,39,114,101,32,98,101,105,110,103,32,116,111,108,100,32,116,111,32,115,116,111,112,32,112,108,97,121,105,110,103,32,105,109,109,101,100,105,97,116, + 101,108,121,44,32,115,111,32,114,101,115,101,116,32,101,118,101,114,121,116,104,105,110,103,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,99,108,101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,110,103,108,101, + 68,101,108,116,97,32,61,32,48,46,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111, + 105,100,32,112,105,116,99,104,87,104,101,101,108,77,111,118,101,100,32,40,99,111,110,115,116,32,105,110,116,32,110,101,119,86,97,108,117,101,41,13, + 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,110,39,116,32,98,101,32,98,111,116,104,101,114,101,100,32,105,109,112, + 108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,102,111,114,32,116,104,101,32,100,101,109,111,33,13,10,32,32,32,32,125,13,10,13,10,32, + 32,32,32,118,111,105,100,32,99,111,110,116,114,111,108,108,101,114,77,111,118,101,100,32,40,99,111,110,115,116,32,105,110,116,32,99,111,110,116,114, + 111,108,108,101,114,78,117,109,98,101,114,44,32,99,111,110,115,116,32,105,110,116,32,110,101,119,86,97,108,117,101,41,13,10,32,32,32,32,123,13, + 10,32,32,32,32,32,32,32,32,47,47,32,110,111,116,32,105,110,116,101,114,101,115,116,101,100,32,105,110,32,99,111,110,116,114,111,108,108,101,114, + 115,32,105,110,32,116,104,105,115,32,99,97,115,101,46,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,101,110,100,101, + 114,78,101,120,116,66,108,111,99,107,32,40,65,117,100,105,111,83,97,109,112,108,101,66,117,102,102,101,114,38,32,111,117,116,112,117,116,66,117,102, + 102,101,114,44,32,105,110,116,32,115,116,97,114,116,83,97,109,112,108,101,44,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32, + 32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,97,110,103,108,101,68,101,108,116,97,32,33,61,32,48,46,48,41,13,10,32,32, + 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,62,32,48,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,45,45,110, + 117,109,83,97,109,112,108,101,115,32,62,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,99,117,114,114,101,110,116,83,97,109,112,108, + 101,32,61,32,40,102,108,111,97,116,41,32,40,115,105,110,32,40,99,117,114,114,101,110,116,65,110,103,108,101,41,32,42,32,108,101,118,101,108,32, + 42,32,116,97,105,108,79,102,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40, + 105,110,116,32,105,32,61,32,111,117,116,112,117,116,66,117,102,102,101,114,46,103,101,116,78,117,109,67,104,97,110,110,101,108,115,40,41,59,32,45, + 45,105,32,62,61,32,48,59,41,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,42,111,117,116,112, + 117,116,66,117,102,102,101,114,46,103,101,116,83,97,109,112,108,101,68,97,116,97,32,40,105,44,32,115,116,97,114,116,83,97,109,112,108,101,41,32, + 43,61,32,99,117,114,114,101,110,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,99,117,114,114,101,110,116,65,110,103,108,101,32,43,61,32,97,110,103,108,101,68,101,108,116,97,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,43,43,115,116,97,114,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,116,97,105,108,79,102,102,32,42,61,32,48,46,57,57,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,105,102,32,40,116,97,105,108,79,102,102,32,60,61,32,48,46,48,48,53,41,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,123,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,99,108, + 101,97,114,67,117,114,114,101,110,116,78,111,116,101,40,41,59,13,10,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,97,110,103,108,101,68,101,108,116,97,32,61,32,48,46,48,59,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,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,119,104,105,108,101,32,40,45,45,110,117,109,83,97,109,112,108,101,115,32,62,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32, + 99,117,114,114,101,110,116,83,97,109,112,108,101,32,61,32,40,102,108,111,97,116,41,32,40,115,105,110,32,40,99,117,114,114,101,110,116,65,110,103, + 108,101,41,32,42,32,108,101,118,101,108,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114, + 32,40,105,110,116,32,105,32,61,32,111,117,116,112,117,116,66,117,102,102,101,114,46,103,101,116,78,117,109,67,104,97,110,110,101,108,115,40,41,59, + 32,45,45,105,32,62,61,32,48,59,41,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,42,111,117, + 116,112,117,116,66,117,102,102,101,114,46,103,101,116,83,97,109,112,108,101,68,97,116,97,32,40,105,44,32,115,116,97,114,116,83,97,109,112,108,101, + 41,32,43,61,32,99,117,114,114,101,110,116,83,97,109,112,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,99,117,114,114,101,110,116,65,110,103,108,101,32,43,61,32,97,110,103,108,101,68,101,108,116,97,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,43,43,115,116,97,114,116,83,97,109,112,108,101,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10, + 13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,100,111,117,98,108,101,32,99,117,114,114,101,110,116,65,110,103,108,101,44,32,97,110,103, + 108,101,68,101,108,116,97,44,32,108,101,118,101,108,44,32,116,97,105,108,79,102,102,59,13,10,125,59,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,84,104, + 105,115,32,105,115,32,97,110,32,97,117,100,105,111,32,115,111,117,114,99,101,32,116,104,97,116,32,115,116,114,101,97,109,115,32,116,104,101,32,111, + 117,116,112,117,116,32,111,102,32,111,117,114,32,100,101,109,111,32,115,121,110,116,104,46,13,10,42,47,13,10,99,108,97,115,115,32,83,121,110,116, + 104,65,117,100,105,111,83,111,117,114,99,101,32,32,58,32,112,117,98,108,105,99,32,65,117,100,105,111,83,111,117,114,99,101,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,47,47,32,116,104,105,115,32,99,111,108,108,101,99,116,115,32,114,101,97,108,45, + 116,105,109,101,32,109,105,100,105,32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,109,105,100,105,32,105,110,112,117,116,32,100, + 101,118,105,99,101,44,32,97,110,100,13,10,32,32,32,32,47,47,32,116,117,114,110,115,32,116,104,101,109,32,105,110,116,111,32,98,108,111,99,107, + 115,32,116,104,97,116,32,119,101,32,99,97,110,32,112,114,111,99,101,115,115,32,105,110,32,111,117,114,32,97,117,100,105,111,32,99,97,108,108,98, + 97,99,107,13,10,32,32,32,32,77,105,100,105,77,101,115,115,97,103,101,67,111,108,108,101,99,116,111,114,32,109,105,100,105,67,111,108,108,101,99, + 116,111,114,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,114,101,112,114,101,115,101,110,116,115,32,116,104,101,32,115,116,97,116,101, + 32,111,102,32,119,104,105,99,104,32,107,101,121,115,32,111,110,32,111,117,114,32,111,110,45,115,99,114,101,101,110,32,107,101,121,98,111,97,114,100, + 32,97,114,101,32,104,101,108,100,13,10,32,32,32,32,47,47,32,100,111,119,110,46,32,87,104,101,110,32,116,104,101,32,109,111,117,115,101,32,105, + 115,32,99,108,105,99,107,101,100,32,111,110,32,116,104,101,32,107,101,121,98,111,97,114,100,32,99,111,109,112,111,110,101,110,116,44,32,116,104,105, + 115,32,111,98,106,101,99,116,32,97,108,115,111,13,10,32,32,32,32,47,47,32,103,101,110,101,114,97,116,101,115,32,109,105,100,105,32,109,101,115, + 115,97,103,101,115,32,102,111,114,32,116,104,105,115,44,32,119,104,105,99,104,32,119,101,32,99,97,110,32,112,97,115,115,32,111,110,32,116,111,32, + 111,117,114,32,115,121,110,116,104,46,13,10,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,83,116,97,116,101,32,107,101,121,98,111,97, + 114,100,83,116,97,116,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,101,32,115,121,110,116,104,32,105,116,115,101,108,102,33,13,10,32,32, + 32,32,83,121,110,116,104,101,115,105,115,101,114,32,115,121,110,116,104,59,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,83,121,110,116,104,65, + 117,100,105,111,83,111,117,114,99,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,39,108,108,32,98,101, + 32,109,105,120,105,110,103,32,116,119,111,32,100,105,102,102,101,114,101,110,116,32,116,121,112,101,115,32,111,102,32,115,111,117,110,100,44,32,115,111, + 32,104,101,114,101,32,119,101,39,108,108,32,99,114,101,97,116,101,32,116,119,111,13,10,32,32,32,32,32,32,32,32,47,47,32,115,101,116,115,32, + 111,102,32,110,111,116,101,32,109,97,112,115,44,32,112,117,116,116,105,110,103,32,101,97,99,104,32,115,111,117,110,100,32,111,110,32,97,32,100,105, + 102,102,101,114,101,110,116,32,111,99,116,97,118,101,32,111,102,32,116,104,101,32,107,101,121,98,111,97,114,100,58,13,10,32,32,32,32,32,32,32, + 32,66,105,116,65,114,114,97,121,32,115,105,110,101,119,97,118,101,78,111,116,101,115,44,32,115,97,109,112,108,101,114,78,111,116,101,115,59,13,10, + 13,10,32,32,32,32,32,32,32,32,105,110,116,32,105,59,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32, + 60,32,49,50,56,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40, + 40,40,105,32,47,32,49,50,41,32,38,32,49,41,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,105, + 110,101,119,97,118,101,78,111,116,101,115,46,115,101,116,66,105,116,32,40,105,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115, + 101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,115,97,109,112,108,101,114,78,111,116,101,115,46,115,101,116,66,105,116,32,40, + 105,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,119,97,118,101,32, + 115,111,117,110,100,44,32,119,104,105,99,104,32,119,105,108,108,32,103,101,116,32,97,112,112,108,105,101,100,32,116,111,32,115,111,109,101,32,111,102, + 32,116,104,101,32,110,111,116,101,115,46,46,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,83,111,117,110,100,32,40,110,101, + 119,32,83,105,110,101,87,97,118,101,83,111,117,110,100,32,40,115,105,110,101,119,97,118,101,78,111,116,101,115,41,41,59,13,10,13,10,32,32,32, + 32,32,32,32,32,47,47,32,103,105,118,101,32,111,117,114,32,115,121,110,116,104,32,97,32,102,101,119,32,118,111,105,99,101,115,32,116,104,97,116, + 32,99,97,110,32,112,108,97,121,32,116,104,101,32,119,97,118,101,32,115,111,117,110,100,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32, + 40,105,32,61,32,52,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100, + 100,86,111,105,99,101,32,40,110,101,119,32,83,105,110,101,87,97,118,101,86,111,105,99,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,87,97,118,65,117,100,105,111,70,111,114,109,97,116,32,119,97,118,70,111,114,109,97,116,59,13,10,32,32,32,32,32,32,32,32,65,117,100,105, + 111,70,111,114,109,97,116,82,101,97,100,101,114,42,32,97,117,100,105,111,82,101,97,100,101,114,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 61,32,119,97,118,70,111,114,109,97,116,46,99,114,101,97,116,101,82,101,97,100,101,114,70,111,114,32,40,110,101,119,32,77,101,109,111,114,121,73, + 110,112,117,116,83,116,114,101,97,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,99,101,108,108,111,95,119,97,118,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,66,105,110,97,114,121,68,97,116,97,58,58,99,101,108,108,111,95,119,97, + 118,83,105,122,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,83,111,117,110,100,32,40,110,101,119,32, + 83,97,109,112,108,101,114,83,111,117,110,100,32,40,84,40,34,100,101,109,111,32,115,111,117,110,100,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,42,97,117,100,105,111, + 82,101,97,100,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,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,115,97,109,112,108,101,114,78,111,116,101,115,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,55,52,44,32,32,32,47,47,32,114,111,111, + 116,32,109,105,100,105,32,110,111,116,101,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,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48,46,49,44,32,32,47,47,32,97,116,116,97,99,107,32,116,105,109,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,48, + 46,49,44,32,32,47,47,32,114,101,108,101,97,115,101,32,116,105,109,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,49,48,46,48,32,32,47,47,32,109,97,120,105,109,117,109, + 32,115,97,109,112,108,101,32,108,101,110,103,116,104,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, + 97,117,100,105,111,82,101,97,100,101,114,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,103,105,118,101,32,116,104,101,32, + 115,121,110,116,104,32,115,111,109,101,32,115,97,109,112,108,101,114,32,118,111,105,99,101,115,32,116,111,32,112,108,97,121,32,116,104,101,32,115,97, + 109,112,108,101,100,32,115,111,117,110,100,46,46,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,32,61,32,52,59,32,45,45,105,32,62, + 61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,121,110,116,104,46,97,100,100,86,111,105,99,101,32,40,110,101,119,32,83, + 97,109,112,108,101,114,86,111,105,99,101,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,114,101,112,97, + 114,101,84,111,80,108,97,121,32,40,105,110,116,32,115,97,109,112,108,101,115,80,101,114,66,108,111,99,107,69,120,112,101,99,116,101,100,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,100,111,117,98,108,101,32,115,97,109,112,108,101,82,97,116, + 101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,109,105,100,105,67,111,108,108,101,99,116,111,114,46,114,101,115,101,116,32,40, + 115,97,109,112,108,101,82,97,116,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,121,110,116,104,46,115,101,116,67,117,114,114,101,110,116, + 80,108,97,121,98,97,99,107,83,97,109,112,108,101,82,97,116,101,32,40,115,97,109,112,108,101,82,97,116,101,41,59,13,10,32,32,32,32,125,13, + 10,13,10,32,32,32,32,118,111,105,100,32,114,101,108,101,97,115,101,82,101,115,111,117,114,99,101,115,40,41,13,10,32,32,32,32,123,13,10,32, + 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,103,101,116,78,101,120,116,65,117,100,105,111,66,108,111,99,107,32,40,99,111,110,115, + 116,32,65,117,100,105,111,83,111,117,114,99,101,67,104,97,110,110,101,108,73,110,102,111,38,32,98,117,102,102,101,114,84,111,70,105,108,108,41,13, + 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,115,121,110,116,104,32,97,108,119,97,121,115,32,97,100,100,115, + 32,105,116,115,32,111,117,116,112,117,116,32,116,111,32,116,104,101,32,97,117,100,105,111,32,98,117,102,102,101,114,44,32,115,111,32,119,101,32,104, + 97,118,101,32,116,111,32,99,108,101,97,114,32,105,116,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,114,115,116,46,46,13,10,32,32,32, + 32,32,32,32,32,98,117,102,102,101,114,84,111,70,105,108,108,46,99,108,101,97,114,65,99,116,105,118,101,66,117,102,102,101,114,82,101,103,105,111, + 110,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,108,108,32,97,32,109,105,100,105,32,98,117,102,102,101,114,32,119,105, + 116,104,32,105,110,99,111,109,105,110,103,32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,109,105,100,105,32,105,110,112,117,116, + 46,13,10,32,32,32,32,32,32,32,32,77,105,100,105,66,117,102,102,101,114,32,105,110,99,111,109,105,110,103,77,105,100,105,59,13,10,32,32,32, + 32,32,32,32,32,109,105,100,105,67,111,108,108,101,99,116,111,114,46,114,101,109,111,118,101,78,101,120,116,66,108,111,99,107,79,102,77,101,115,115, + 97,103,101,115,32,40,105,110,99,111,109,105,110,103,77,105,100,105,44,32,98,117,102,102,101,114,84,111,70,105,108,108,46,110,117,109,83,97,109,112, + 108,101,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,112,97,115,115,32,116,104,101,115,101,32,109,101,115,115,97,103,101,115,32, + 116,111,32,116,104,101,32,107,101,121,98,111,97,114,100,32,115,116,97,116,101,32,115,111,32,116,104,97,116,32,105,116,32,99,97,110,32,117,112,100, + 97,116,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,47,47,32,116,111,32,115,104,111,119,32,111,110, + 45,115,99,114,101,101,110,32,119,104,105,99,104,32,107,101,121,115,32,97,114,101,32,98,101,105,110,103,32,112,114,101,115,115,101,100,32,111,110,32, + 116,104,101,32,112,104,121,115,105,99,97,108,32,109,105,100,105,32,107,101,121,98,111,97,114,100,46,13,10,32,32,32,32,32,32,32,32,47,47,32, + 84,104,105,115,32,99,97,108,108,32,119,105,108,108,32,97,108,115,111,32,97,100,100,32,109,105,100,105,32,109,101,115,115,97,103,101,115,32,116,111, + 32,116,104,101,32,98,117,102,102,101,114,32,119,104,105,99,104,32,119,101,114,101,32,103,101,110,101,114,97,116,101,100,32,98,121,13,10,32,32,32, + 32,32,32,32,32,47,47,32,116,104,101,32,109,111,117,115,101,45,99,108,105,99,107,105,110,103,32,111,110,32,116,104,101,32,111,110,45,115,99,114, + 101,101,110,32,107,101,121,98,111,97,114,100,46,13,10,32,32,32,32,32,32,32,32,107,101,121,98,111,97,114,100,83,116,97,116,101,46,112,114,111, + 99,101,115,115,78,101,120,116,77,105,100,105,66,117,102,102,101,114,32,40,105,110,99,111,109,105,110,103,77,105,100,105,44,32,48,44,32,98,117,102, + 102,101,114,84,111,70,105,108,108,46,110,117,109,83,97,109,112,108,101,115,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 47,47,32,97,110,100,32,110,111,119,32,103,101,116,32,116,104,101,32,115,121,110,116,104,32,116,111,32,112,114,111,99,101,115,115,32,116,104,101,32, + 109,105,100,105,32,101,118,101,110,116,115,32,97,110,100,32,103,101,110,101,114,97,116,101,32,105,116,115,32,111,117,116,112,117,116,46,13,10,32,32, + 32,32,32,32,32,32,115,121,110,116,104,46,114,101,110,100,101,114,78,101,120,116,66,108,111,99,107,32,40,42,98,117,102,102,101,114,84,111,70,105, + 108,108,46,98,117,102,102,101,114,44,32,105,110,99,111,109,105,110,103,77,105,100,105,44,32,48,44,32,98,117,102,102,101,114,84,111,70,105,108,108, + 46,110,117,109,83,97,109,112,108,101,115,41,59,13,10,32,32,32,32,125,13,10,125,59,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,13,10,99,108,97,115,115,32,68,101,109,111,84,104, - 114,101,97,100,32,32,32,32,58,32,112,117,98,108,105,99,32,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,112,117,98,108,105,99,32,84,104,114,101,97,100,13,10,123,13,10,32,32,32,32, - 105,110,116,32,105,110,116,101,114,118,97,108,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68,101,109,111,84,104,114,101,97,100, - 40,41,13,10,32,32,32,32,32,32,32,32,58,32,84,104,114,101,97,100,32,40,84,40,34,74,117,99,101,32,68,101,109,111,32,84,104,114,101,97, - 100,34,41,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,110,116,101,114,118,97,108,32,61,32,82,97,110,100,111,109,58,58, - 103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,53,48,41,32,43,32,54,59,13,10,13,10,32, - 32,32,32,32,32,32,32,47,47,32,103,105,118,101,32,116,104,101,32,116,104,114,101,97,100,115,32,97,32,114,97,110,100,111,109,32,112,114,105,111, - 114,105,116,121,44,32,115,111,32,115,111,109,101,32,119,105,108,108,32,109,111,118,101,32,109,111,114,101,13,10,32,32,32,32,32,32,32,32,47,47, - 32,115,109,111,111,116,104,108,121,32,116,104,97,110,32,111,116,104,101,114,115,46,46,13,10,32,32,32,32,32,32,32,32,115,116,97,114,116,84,104, - 114,101,97,100,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32, - 40,51,41,32,43,32,51,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,104,114,101,97,100,40,41,13,10,32, - 32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,97,108,108,111,119,32,116,104,101,32,116,104,114,101,97,100,32,50,32,115,101,99,111, - 110,100,115,32,116,111,32,115,116,111,112,32,99,108,101,97,110,108,121,32,45,32,115,104,111,117,108,100,32,98,101,32,112,108,101,110,116,121,32,111, - 102,32,116,105,109,101,46,13,10,32,32,32,32,32,32,32,32,115,116,111,112,84,104,114,101,97,100,32,40,50,48,48,48,41,59,13,10,32,32,32, - 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,117,110,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32, - 116,104,105,115,32,105,115,32,116,104,101,32,99,111,100,101,32,116,104,97,116,32,114,117,110,115,32,116,104,105,115,32,116,104,114,101,97,100,32,45, - 32,119,101,39,108,108,32,108,111,111,112,32,99,111,110,116,105,110,117,111,117,115,108,121,44,13,10,32,32,32,32,32,32,32,32,47,47,32,117,112, - 100,97,116,105,110,103,32,116,104,101,32,99,111,45,111,114,100,105,110,97,116,101,115,32,111,102,32,111,117,114,32,98,108,111,98,46,13,10,13,10, - 32,32,32,32,32,32,32,32,47,47,32,116,104,114,101,97,100,83,104,111,117,108,100,69,120,105,116,40,41,32,114,101,116,117,114,110,115,32,116,114, - 117,101,32,119,104,101,110,32,116,104,101,32,115,116,111,112,84,104,114,101,97,100,40,41,32,109,101,116,104,111,100,32,104,97,115,32,98,101,101,110, - 13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,108,108,101,100,44,32,115,111,32,119,101,32,115,104,111,117,108,100,32,99,104,101,99,107,32, - 105,116,32,111,102,116,101,110,44,32,97,110,100,32,101,120,105,116,32,97,115,32,115,111,111,110,32,97,115,32,105,116,32,103,101,116,115,32,102,108, - 97,103,103,101,100,46,13,10,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,33,32,116,104,114,101,97,100,83,104,111,117,108,100,69,120,105, - 116,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,111,118,101,66,97,108,108,40,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,115,108,101,101,112,32,97,32,98,105,116,32,115,111,32,116,104,101,32,116,104, - 114,101,97,100,115,32,100,111,110,39,116,32,97,108,108,32,103,114,105,110,100,32,116,104,101,32,67,80,85,32,116,111,32,97,32,104,97,108,116,46, - 46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,97,105,116,32,40,105,110,116,101,114,118,97,108,41,59,13,10,32,32,32,32,32,32,32, - 32,125,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,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,13,10,99,108,97,115,115,32,65,117,100,105, + 111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,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,32,32,32,32,32,32,32,32,32,32,112, + 117,98,108,105,99,32,84,105,109,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,32, + 32,32,32,32,32,32,32,32,32,112,117,98,108,105,99,32,65,117,100,105,111,73,79,68,101,118,105,99,101,67,97,108,108,98,97,99,107,13,10,123, + 13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121, + 40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,98,117,102,102,101,114,80,111,115,32,61,32,48,59,13,10,32,32,32,32,32, + 32,32,32,98,117,102,102,101,114,83,105,122,101,32,61,32,50,48,52,56,59,13,10,32,32,32,32,32,32,32,32,99,105,114,99,117,108,97,114,66, + 117,102,102,101,114,32,61,32,40,102,108,111,97,116,42,41,32,106,117,99,101,95,99,97,108,108,111,99,32,40,115,105,122,101,111,102,32,40,102,108, + 111,97,116,41,32,42,32,98,117,102,102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117, + 116,76,101,118,101,108,32,61,32,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,110,117,109,83,97,109,112,108,101,115,73,110,32,61,32,48, + 59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32, + 115,116,97,114,116,84,105,109,101,114,32,40,49,48,48,48,32,47,32,53,48,41,59,32,32,47,47,32,114,101,112,97,105,110,116,32,101,118,101,114, + 121,32,49,47,53,48,32,111,102,32,97,32,115,101,99,111,110,100,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,65,117,100,105,111,73, + 110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,106,117, + 99,101,95,102,114,101,101,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32, + 118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32, + 32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46, + 115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,104,97,108,102,72,101,105,103,104,116,32,61,32,103,101,116,72,101,105,103,104,116,40,41, + 32,42,32,48,46,53,102,59,13,10,13,10,32,32,32,32,32,32,32,32,105,110,116,32,98,112,32,61,32,98,117,102,102,101,114,80,111,115,59,13, + 10,13,10,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,120,32,61,32,103,101,116,87,105,100,116,104,40,41,59,32,45,45,120,32, + 62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116, + 32,115,97,109,112,108,101,115,65,103,111,32,61,32,103,101,116,87,105,100,116,104,40,41,32,45,32,120,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,108,101,118,101,108,32,61,32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,32,91,40, + 98,112,32,43,32,98,117,102,102,101,114,83,105,122,101,32,45,32,115,97,109,112,108,101,115,65,103,111,41,32,37,32,98,117,102,102,101,114,83,105, + 122,101,93,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,108,101,118,101,108,32,62,32,48,46,48,49,102,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,76,105,110,101,32,40,40,102,108,111,97,116,41,32,120,44,32,104, + 97,108,102,72,101,105,103,104,116,32,45,32,104,97,108,102,72,101,105,103,104,116,32,42,32,108,101,118,101,108,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,32,32,32,40,102,108,111,97,116,41,32,120,44,32,104,97,108,102,72,101,105,103, + 104,116,32,43,32,104,97,108,102,72,101,105,103,104,116,32,42,32,108,101,118,101,108,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32, + 32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105,109,101,114,67,97,108,108,98,97,99,107,40,41,13,10,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,100, + 100,83,97,109,112,108,101,32,40,99,111,110,115,116,32,102,108,111,97,116,32,115,97,109,112,108,101,41,13,10,32,32,32,32,123,13,10,32,32,32, + 32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,43,61,32,102,97,98,115,102,32,40,115,97,109,112,108,101,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,115,97,109,112,108,101,115,84,111,65,118,101,114,97,103,101,32, + 61,32,49,50,56,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,43,43,110,117,109,83,97,109,112,108,101,115,73,110,32,62,32,115, + 97,109,112,108,101,115,84,111,65,118,101,114,97,103,101,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,32,91,98,117,102,102,101,114,80,111,115,43,43,32,37,32,98,117,102,102,101,114,83,105,122, + 101,93,32,61,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,47,32,115,97,109,112,108,101,115,84,111,65,118,101,114,97,103, + 101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,117,109,83,97,109,112,108,101,115,73,110,32,61,32,48,59,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,73,110,112,117,116,76,101,118,101,108,32,61,32,48,46,48,102,59,13,10,32,32,32,32, + 32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,73,79,67,97, + 108,108,98,97,99,107,32,40,99,111,110,115,116,32,102,108,111,97,116,42,42,32,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,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,32,32,32,32,32,32,32,105,110,116,32,116,111,116, + 97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,102,108,111,97,116,42,42,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97,116,97,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,32,32,32,32,32,32,32,105,110,116,32,116,111,116, + 97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,116,111,116,97,108,78,117,109,73,110,112,117,116,67, + 104,97,110,110,101,108,115,59,32,43,43,105,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102, + 32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,32,91,105,93,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,106,32,61,32,48,59,32,106,32,60, + 32,110,117,109,83,97,109,112,108,101,115,59,32,43,43,106,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97, + 100,100,83,97,109,112,108,101,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,32,91,105,93,91,106,93,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32, + 32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,65,98, + 111,117,116,84,111,83,116,97,114,116,32,40,65,117,100,105,111,73,79,68,101,118,105,99,101,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,122,101,114,111,109,101,109,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,44,32,115,105,122,101,111,102,32,40,102,108,111, + 97,116,41,32,42,32,98,117,102,102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,117, + 100,105,111,68,101,118,105,99,101,83,116,111,112,112,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,122,101,114,111,109, + 101,109,32,40,99,105,114,99,117,108,97,114,66,117,102,102,101,114,44,32,115,105,122,101,111,102,32,40,102,108,111,97,116,41,32,42,32,98,117,102, + 102,101,114,83,105,122,101,41,59,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,102,108,111,97,116,42, + 32,99,105,114,99,117,108,97,114,66,117,102,102,101,114,59,13,10,32,32,32,32,102,108,111,97,116,32,99,117,114,114,101,110,116,73,110,112,117,116, + 76,101,118,101,108,59,13,10,32,32,32,32,105,110,116,32,118,111,108,97,116,105,108,101,32,98,117,102,102,101,114,80,111,115,44,32,98,117,102,102, + 101,114,83,105,122,101,44,32,110,117,109,83,97,109,112,108,101,115,73,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,13,10,99,108,97,115,115,32,68,101,109,111,84,104,114,101,97,100,80,111,111,108,74,111,98, - 32,32,58,32,112,117,98,108,105,99,32,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,32,32,112,117,98,108,105,99,32,84,104,114,101,97,100,80,111,111,108,74,111,98,13,10,123, - 13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68,101,109,111,84,104,114,101,97,100,80,111,111,108,74,111,98,40,41,13,10,32,32,32,32, - 32,32,32,32,58,32,84,104,114,101,97,100,80,111,111,108,74,111,98,32,40,84,40,34,68,101,109,111,32,84,104,114,101,97,100,112,111,111,108,32, - 74,111,98,34,41,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,104,114,101,97,100,80, - 111,111,108,74,111,98,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,74,111,98,83,116,97,116,117,115,32, - 114,117,110,74,111,98,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,116,104,101,32, - 99,111,100,101,32,116,104,97,116,32,114,117,110,115,32,116,104,105,115,32,106,111,98,46,32,73,116,39,108,108,32,98,101,32,114,101,112,101,97,116, - 101,100,108,121,32,99,97,108,108,101,100,32,117,110,116,105,108,32,119,101,32,114,101,116,117,114,110,13,10,32,32,32,32,32,32,32,32,47,47,32, - 106,111,98,72,97,115,70,105,110,105,115,104,101,100,32,105,110,115,116,101,97,100,32,111,102,32,106,111,98,78,101,101,100,115,82,117,110,110,105,110, - 103,65,103,97,105,110,46,13,10,13,10,32,32,32,32,32,32,32,32,109,111,118,101,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32,32,32, - 84,104,114,101,97,100,58,58,115,108,101,101,112,32,40,51,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,106,111, - 98,78,101,101,100,115,82,117,110,110,105,110,103,65,103,97,105,110,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114, - 101,109,111,118,101,100,70,114,111,109,81,117,101,117,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,84,104,105, - 115,32,105,115,32,99,97,108,108,101,100,32,116,111,32,116,101,108,108,32,117,115,32,116,104,97,116,32,111,117,114,32,106,111,98,32,104,97,115,32, - 98,101,101,110,32,114,101,109,111,118,101,100,32,102,114,111,109,32,116,104,101,32,112,111,111,108,46,13,10,32,32,32,32,32,32,32,32,47,47,32, - 73,110,32,116,104,105,115,32,99,97,115,101,32,116,104,101,114,101,39,115,32,110,111,32,110,101,101,100,32,116,111,32,100,111,32,97,110,121,116,104, - 105,110,103,32,104,101,114,101,46,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,125,59,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,13,10,99,108,97,115,115,32,65, + 117,100,105,111,68,101,109,111,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,112,117,98,108,105,99,32,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,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,112,117,98,108,105,99,32,66,117,116,116,111,110,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,112,117,98,108,105,99,32,67,104,97,110,103,101, + 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,112,117,98,108,105,99,32,65,117,100, + 105,111,73,79,68,101,118,105,99,101,67,97,108,108,98,97,99,107,13,10,123,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,13,10,99,108,97,115,115,32,84,104,114,101,97,100,105,110,103,68,101,109, - 111,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,112,117,98,108,105,99,32,84,105,109,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,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,32,32,32,32,98,111,111,108,32, - 105,115,85,115,105,110,103,80,111,111,108,59,13,10,32,32,32,32,84,104,114,101,97,100,80,111,111,108,32,112,111,111,108,59,13,10,32,32,32,32, - 84,101,120,116,66,117,116,116,111,110,42,32,99,111,110,116,114,111,108,66,117,116,116,111,110,59,13,10,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,13,10,32,32,32,32,70,105,108,101,110,97,109, + 101,67,111,109,112,111,110,101,110,116,42,32,102,105,108,101,67,104,111,111,115,101,114,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110, + 42,32,112,108,97,121,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,115,116,111,112,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,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117,116,116,111,110,59, + 13,10,13,10,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,42,32,107,101,121,98,111,97,114,100,67, + 111,109,112,111,110,101,110,116,59,13,10,32,32,32,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121, + 42,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,59,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,13,10,32,32,32,32,84,104,114,101,97,100,105,110,103,68,101,109,111,40,41,13,10,32,32,32,32,32,32,32,32,58,32,112,111,111,108, - 32,40,51,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,115,85,115,105,110,103,80,111,111,108,32,61,32,102,97,108,115,101, - 59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,84,40,34,77,117,108,116,105,116,104,114,101,97,100,105,110,103,34, - 41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,125,13, - 10,13,10,32,32,32,32,126,84,104,114,101,97,100,105,110,103,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, - 112,111,111,108,46,114,101,109,111,118,101,65,108,108,74,111,98,115,32,40,116,114,117,101,44,32,50,48,48,48,41,59,13,10,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,47, - 47,32,116,104,105,115,32,103,101,116,115,32,99,97,108,108,101,100,32,119,104,101,110,32,97,32,99,111,109,112,111,110,101,110,116,32,105,115,32,97, - 100,100,101,100,32,111,114,32,114,101,109,111,118,101,100,32,102,114,111,109,32,97,32,112,97,114,101,110,116,32,99,111,109,112,111,110,101,110,116,46, - 13,10,32,32,32,32,118,111,105,100,32,112,97,114,101,110,116,72,105,101,114,97,114,99,104,121,67,104,97,110,103,101,100,40,41,13,10,32,32,32, - 32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,39,108,108,32,117,115,101,32,116,104,105,115,32,97,115,32,97,110,32,111,112,112,111, - 114,116,117,110,105,116,121,32,116,111,32,115,116,97,114,116,32,97,110,100,32,115,116,111,112,32,116,104,101,32,116,104,114,101,97,100,115,44,32,115, - 111,32,116,104,97,116,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,32,100,111,110,39,116,32,108,101,97,118,101,32,116,104,101,109,32,103, - 111,105,110,103,32,119,104,101,110,32,116,104,101,32,99,111,109,112,111,110,101,110,116,39,115,32,110,111,116,32,97,99,116,117,97,108,108,121,32,118, - 105,115,105,98,108,101,46,13,10,32,32,32,32,32,32,32,32,115,116,111,112,84,105,109,101,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,112,111,111,108,46,114,101,109,111,118,101,65,108,108,74,111,98,115,32,40,116,114,117,101,44,32,52,48,48,48,41,59,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,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,99,111,110,116,114,111,108,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,84,40,34,84,104,114,101,97,100,32,116,121,112,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110,116,114, - 111,108,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,48,41,59,13,10,32,32, - 32,32,32,32,32,32,99,111,110,116,114,111,108,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32, - 40,50,48,44,32,50,48,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110,116,114,111,108,66,117,116,116,111,110,45,62,115,101,116,84,114,105, - 103,103,101,114,101,100,79,110,77,111,117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110,116,114, - 111,108,66,117,116,116,111,110,45,62,115,101,116,65,108,119,97,121,115,79,110,84,111,112,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32, - 32,32,99,111,110,116,114,111,108,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,105,102,32,40,105,115,83,104,111,119,105,110,103,40,41,41,13,10,32,32,32,32,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101, - 110,116,115,40,41,32,60,32,53,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,100,100,65,66,97,108,108,40,41,59,13, - 10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,116,97,114,116,84,105,109,101,114,32,40,50,48,48,48,41,59,13,10,32,32,32,32,32, - 32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38, - 32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58, - 119,104,105,116,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,101,116,85,115,105,110,103,80,111,111,108,32, - 40,98,111,111,108,32,117,115,101,80,111,111,108,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,115,85,115,105,110,103,80,111, - 111,108,32,61,32,117,115,101,80,111,111,108,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,72,105,101,114,97,114,99,104,121,67,104, - 97,110,103,101,100,40,41,59,32,47,47,32,114,101,115,101,116,115,32,101,118,101,114,121,116,104,105,110,103,13,10,32,32,32,32,125,13,10,13,10, - 32,32,32,32,118,111,105,100,32,97,100,100,65,66,97,108,108,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40, - 105,115,85,115,105,110,103,80,111,111,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109, - 111,84,104,114,101,97,100,80,111,111,108,74,111,98,42,32,110,101,119,67,111,109,112,32,61,32,110,101,119,32,68,101,109,111,84,104,114,101,97,100, - 80,111,111,108,74,111,98,40,41,59,13,10,32,32,32,32,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,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,101,119,67,111,109,112,45,62,112,97,114,101,110, - 116,83,105,122,101,67,104,97,110,103,101,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,112,111,111,108,46,97,100,100,74, - 111,98,32,40,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10, - 32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,84,104,114,101,97,100,42,32,110,101,119,67,111, - 109,112,32,61,32,110,101,119,32,68,101,109,111,84,104,114,101,97,100,40,41,59,13,10,32,32,32,32,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,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,101, - 119,67,111,109,112,45,62,112,97,114,101,110,116,83,105,122,101,67,104,97,110,103,101,100,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10, - 32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,101,109,111,118,101,65,66,97,108,108,40,41,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,105,102,32,40,105,115,85,115,105,110,103,80,111,111,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,84,104,114,101,97,100,80,111,111,108,74,111,98,42,32,106,111,98,84,111,82,101,109,111,118,101,32,61,32,112,111, - 111,108,46,103,101,116,74,111,98,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120, - 116,73,110,116,32,40,112,111,111,108,46,103,101,116,78,117,109,74,111,98,115,40,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,105,102,32,40,106,111,98,84,111,82,101,109,111,118,101,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,111,111,108,46,114,101,109,111,118,101,74,111,98,32,40,106,111,98,84,111,82,101,109, - 111,118,101,44,32,116,114,117,101,44,32,52,48,48,48,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116, - 101,32,106,111,98,84,111,82,101,109,111,118,101,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125, - 13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105, - 102,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,62,32,49,41,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,98,97,108,108,32, - 61,32,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,49,32,43,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116, - 101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116, - 115,40,41,32,45,32,49,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,100,121,110,97,109,105, - 99,95,99,97,115,116,32,60,66,117,116,116,111,110,42,62,32,40,98,97,108,108,41,32,61,61,32,48,41,32,47,47,32,100,111,110,39,116,32,100, - 101,108,101,116,101,32,111,117,114,32,98,117,116,116,111,110,33,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,100, - 101,108,101,116,101,32,98,97,108,108,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32, - 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105,109,101,114,67,97,108,108,98,97,99,107,40,41,13,10,32,32,32,32,123,13, - 10,32,32,32,32,32,32,32,32,105,102,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110, - 101,120,116,66,111,111,108,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,103, - 101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,60,61,32,49,48,41,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,97,100,100,65,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101, - 108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,103,101,116,78,117,109,67,104, - 105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,62,32,51,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101, - 109,111,118,101,65,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32,32,32,125,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,117,116,116,111,110,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101, - 109,32,40,49,44,32,84,40,34,85,115,101,32,111,110,101,32,116,104,114,101,97,100,32,112,101,114,32,98,97,108,108,34,41,44,32,116,114,117,101, - 44,32,33,32,105,115,85,115,105,110,103,80,111,111,108,41,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,50,44, - 32,84,40,34,85,115,101,32,97,32,116,104,114,101,97,100,32,112,111,111,108,34,41,44,32,116,114,117,101,44,32,105,115,85,115,105,110,103,80,111, - 111,108,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,114,101,115,32,61,32,109,46,115,104,111,119,65,116, - 32,40,98,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,32,33,61,32,48,41,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,115,101,116,85,115,105,110,103,80,111,111,108,32,40,114,101,115,32,61,61,32,50,41,59,13,10,32,32,32,32,125, - 13,10,125,59,13,10,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,13,10,32,32,32,32,47,47,32,116,104,105, + 115,32,119,114,97,112,115,32,116,104,101,32,97,99,116,117,97,108,32,97,117,100,105,111,32,100,101,118,105,99,101,13,10,32,32,32,32,65,117,100, + 105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,59,13,10,13,10,32, + 32,32,32,47,47,32,116,104,105,115,32,97,108,108,111,119,115,32,97,110,32,97,117,100,105,111,32,115,111,117,114,99,101,32,116,111,32,98,101,32, + 115,116,114,101,97,109,101,100,32,116,111,32,116,104,101,32,73,79,32,100,101,118,105,99,101,13,10,32,32,32,32,65,117,100,105,111,83,111,117,114, + 99,101,80,108,97,121,101,114,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,59,13,10,13,10,32,32,32,32,47,47,32,116,104, + 105,115,32,99,111,110,116,114,111,108,115,32,116,104,101,32,112,108,97,121,98,97,99,107,32,111,102,32,97,32,112,111,115,105,116,105,111,110,97,98, + 108,101,32,97,117,100,105,111,32,115,116,114,101,97,109,44,32,104,97,110,100,108,105,110,103,32,116,104,101,13,10,32,32,32,32,47,47,32,115,116, + 97,114,116,105,110,103,47,115,116,111,112,112,105,110,103,32,97,110,100,32,115,97,109,112,108,101,45,114,97,116,101,32,99,111,110,118,101,114,115,105, + 111,110,13,10,32,32,32,32,65,117,100,105,111,84,114,97,110,115,112,111,114,116,83,111,117,114,99,101,32,116,114,97,110,115,112,111,114,116,83,111, + 117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,115,111,117,114,99,101,32,99,111,110,116,97,105,110,115,32,111,117,114, + 32,115,121,110,116,104,44,32,97,110,100,32,103,101,110,101,114,97,116,101,115,32,105,116,115,32,111,117,116,112,117,116,13,10,32,32,32,32,83,121, + 110,116,104,65,117,100,105,111,83,111,117,114,99,101,32,115,121,110,116,104,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104, + 105,115,32,115,111,117,114,99,101,32,105,115,32,117,115,101,100,32,116,111,32,109,105,120,32,116,111,103,101,116,104,101,114,32,116,104,101,32,111,117, + 116,112,117,116,32,102,114,111,109,32,111,117,114,32,115,121,110,116,104,32,115,111,117,114,99,101,13,10,32,32,32,32,47,47,32,97,110,100,32,119, + 97,118,101,32,112,108,97,121,101,114,32,115,111,117,114,99,101,13,10,32,32,32,32,77,105,120,101,114,65,117,100,105,111,83,111,117,114,99,101,32, + 109,105,120,101,114,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,116,104,101,32,97,99,116,117,97, + 108,32,115,116,114,101,97,109,32,116,104,97,116,39,115,32,103,111,105,110,103,32,116,111,32,114,101,97,100,32,102,114,111,109,32,116,104,101,32,97, + 117,100,105,111,32,102,105,108,101,46,13,10,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114,83,111,117,114,99,101,42, + 32,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,59,13,10,13,10,32,32,32,32,70,105,108,101,32,99,117,114, + 114,101,110,116,70,105,108,101,59,13,10,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,84,104,114,101,97,100,105,110,103, - 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,84,104,114,101,97,100,105,110,103,68,101,109,111,40, - 41,59,13,10,125,13,10,0,0}; -const char* BinaryData::threadingdemo_cpp = (const char*) temp14; - -static const unsigned char temp15[] = {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*) temp15; - -static const unsigned char temp16[] = {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,13,10,32,32,32,32,65,117,100,105,111,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,84,40,34,65,117,100,105,111,34,41,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,61,32,48,59, + 13,10,13,10,32,32,32,32,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,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,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,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,13,10,32,32,32,32,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,77,97,110,97,103,101,114, + 32,102,111,114,109,97,116,77,97,110,97,103,101,114,59,13,10,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,114, + 101,103,105,115,116,101,114,66,97,115,105,99,70,111,114,109,97,116,115,40,41,59,13,10,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,105,108,101,67,104,111,111,115,101,114,32,61,32,110,101,119,32,70,105,108,101,110,97,109,101,67, + 111,109,112,111,110,101,110,116,32,40,84,40,34,97,117,100,105,111,102,105,108,101,34,41,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,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,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,110,111,110,101,120,105,115,116,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,102,97,108,115,101,44,32,102,97,108,115,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,103,101,116,87,105,108, + 100,99,97,114,100,70,111,114,65,108,108,70,111,114,109,97,116,115,40,41,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,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,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,83,116,114,105,110,103,58,58,101,109,112,116,121,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,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,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,84,40,34,40,99,104,111,111,115,101,32,97,32,87,65,86,32,111,114,32,65,73,70,70,32,102,105,108,101,32,116,111,32, + 112,108,97,121,41,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,45,62,97,100,100,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101,116,66,114, + 111,119,115,101,66,117,116,116,111,110,84,101,120,116,32,40,84,40,34,98,114,111,119,115,101,34,41,41,59,13,10,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,112,108,97,121,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,84,40,34,112,108,97,121,34,41,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,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,32,32,32,32,32,32,84,40,34, + 99,108,105,99,107,32,104,101,114,101,32,116,111,32,112,108,97,121,32,116,104,101,32,99,117,114,114,101,110,116,32,97,117,100,105,111,32,102,105,108, + 101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,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,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,67,111, + 108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114, + 115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116, + 67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,79,110,67,111,108,111,117,114,73,100,44,32,67,111, + 108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45, + 62,115,101,116,67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101,100,79,110,82, + 105,103,104,116,41,59,13,10,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,115,116,111, + 112,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,84,40,34,115,116,111,112,34,41,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,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,32,32,32,32,32,32,84,40,34,99,108,105,99,107,32,104,101,114,101,32,116,111,32,112,108,97,121,32,116,104,101,32, + 99,117,114,114,101,110,116,32,97,117,100,105,111,32,102,105,108,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,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, + 115,116,111,112,66,117,116,116,111,110,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111, + 110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66, + 117,116,116,111,110,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,79,110,67,111, + 108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116,116, + 111,110,45,62,115,101,116,67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101,100, + 79,110,76,101,102,116,41,59,13,10,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, + 117,100,105,111,83,101,116,116,105,110,103,115,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,84,40,34, + 115,104,111,119,32,97,117,100,105,111,32,115,101,116,116,105,110,103,115,46,46,46,34,41,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,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,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,99,108,105,99,107,32,104,101,114,101,32,116,111,32,99,104,97,110,103,101,32,116,104,101,32, + 97,117,100,105,111,32,100,101,118,105,99,101,32,115,101,116,116,105,110,103,115,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105, + 111,83,101,116,116,105,110,103,115,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,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,107,101,121,98,111,97,114, + 100,67,111,109,112,111,110,101,110,116,32,61,32,110,101,119,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,32,40, + 115,121,110,116,104,83,111,117,114,99,101,46,107,101,121,98,111,97,114,100,83,116,97,116,101,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,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,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,77,105,100,105,75,101,121,98,111,97,114,100,67,111,109,112,111,110, + 101,110,116,58,58,104,111,114,105,122,111,110,116,97,108,75,101,121,98,111,97,114,100,41,41,59,13,10,13,10,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,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,32,61,32,110, + 101,119,32,65,117,100,105,111,73,110,112,117,116,87,97,118,101,102,111,114,109,68,105,115,112,108,97,121,40,41,41,59,13,10,13,10,32,32,32,32, + 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,61,61,61,61,61,61,61,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,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,13,10,32,32,32,32,32,32,32,32,47,47,32,114,101,103,105,115,116,101,114,32,102,111,114,32,115,116,97,114,116,47,115,116,111,112, + 32,109,101,115,115,97,103,101,115,32,102,114,111,109,32,116,104,101,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,46,46,13,10,32, + 32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,97,100,100,67,104,97,110,103,101,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,97,110,100,32,105,110,105,116,105,97,108,105,115,101,32,116,104, + 101,32,100,101,118,105,99,101,32,109,97,110,97,103,101,114,32,119,105,116,104,32,110,111,32,115,101,116,116,105,110,103,115,32,115,111,32,116,104,97, + 116,32,105,116,32,112,105,99,107,115,32,97,13,10,32,32,32,32,32,32,32,32,47,47,32,100,101,102,97,117,108,116,32,100,101,118,105,99,101,32, + 116,111,32,117,115,101,46,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,101,114,114,111,114,32,40,97,117,100, + 105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,105,110,105,116,105,97,108,105,115,101,32,40,49,44,32,47,42,32,110,117,109,98,101,114, + 32,111,102,32,105,110,112,117,116,32,99,104,97,110,110,101,108,115,32,42,47,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,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,32,32,32,32,32,32,32, + 32,32,50,44,32,47,42,32,110,117,109,98,101,114,32,111,102,32,111,117,116,112,117,116,32,99,104,97,110,110,101,108,115,32,42,47,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,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,32,32,32,32,32,32,32,32,32,48,44,32,47,42,32,110,111,32,88,77,76,32,115,101,116,116,105,110,103,115,46,46, + 32,42,47,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,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,32,32,32,32,32,32,32,32,32,116,114,117,101,32,32,47,42,32,115,101,108,101,99,116,32, + 100,101,102,97,117,108,116,32,100,101,118,105,99,101,32,111,110,32,102,97,105,108,117,114,101,32,42,47,41,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,105,102,32,40,101,114,114,111,114,46,105,115,78,111,116,69,109,112,116,121,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40, + 65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,65,117,100,105,111,32,68,101,109, + 111,34,41,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,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,84,40,34,67,111,117,108,100,110,39,116,32,111,112,101,110,32,97,110,32,111,117,116,112,117,116,32,100,101,118,105,99,101, + 33,92,110,92,110,34,41,32,43,32,101,114,114,111,114,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108, + 115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,116,104,101,32,116,119, + 111,32,97,117,100,105,111,32,115,111,117,114,99,101,115,32,116,111,32,111,117,114,32,109,105,120,101,114,46,46,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,109,105,120,101,114,83,111,117,114,99,101,46,97,100,100,73,110,112,117,116,83,111,117,114,99,101,32,40,38,116,114,97,110,115,112,111, + 114,116,83,111,117,114,99,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,105,120,101,114,83,111,117,114, + 99,101,46,97,100,100,73,110,112,117,116,83,111,117,114,99,101,32,40,38,115,121,110,116,104,83,111,117,114,99,101,44,32,102,97,108,115,101,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,97,110,100,32,99,111,110,110,101,99,116,32,116,104,101,32,109,105,120, + 101,114,32,116,111,32,111,117,114,32,115,111,117,114,99,101,32,112,108,97,121,101,114,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,117, + 100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,115,101,116,83,111,117,114,99,101,32,40,38,109,105,120,101,114,83,111,117,114,99,101,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,115,116,97,114,116,32,116,104,101,32,73,79,32,100,101,118,105,99,101,32, + 112,117,108,108,105,110,103,32,105,116,115,32,100,97,116,97,32,102,114,111,109,32,111,117,114,32,99,97,108,108,98,97,99,107,46,46,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,115,101,116,65,117,100,105,111,67,97,108, + 108,98,97,99,107,32,40,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,119,101,32,110, + 101,101,100,32,116,111,32,115,101,110,100,32,109,105,100,105,32,105,110,112,117,116,32,116,111,32,111,117,114,32,115,121,110,116,104,32,102,111,114,32, + 112,114,111,99,101,115,115,105,110,103,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103, + 101,114,46,97,100,100,77,105,100,105,73,110,112,117,116,67,97,108,108,98,97,99,107,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32, + 38,115,121,110,116,104,83,111,117,114,99,101,46,109,105,100,105,67,111,108,108,101,99,116,111,114,41,59,13,10,32,32,32,32,32,32,32,32,125,13, + 10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,65,117,100,105,111,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,114,101,109,111,118,101,77,105,100,105,73,110,112,117,116,67,97,108, + 108,98,97,99,107,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,38,115,121,110,116,104,83,111,117,114,99,101,46,109,105,100,105,67, + 111,108,108,101,99,116,111,114,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,68,101,118,105,99,101,77,97,110,97,103,101,114,46,115, + 101,116,65,117,100,105,111,67,97,108,108,98,97,99,107,32,40,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114, + 116,83,111,117,114,99,101,46,114,101,109,111,118,101,67,104,97,110,103,101,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,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116,83,111,117,114,99,101,32,40,48,41,59,13,10, + 32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83, + 111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,115,101,116, + 83,111,117,114,99,101,32,40,48,41,59,13,10,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,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,13,10,99,108,97,115,115,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,32,58,32,112,117,98,108,105,99,32,84,114,101,101, - 86,105,101,119,73,116,101,109,13,10,123,13,10,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,120,109,108,59,13,10,13,10,112,117,98, - 108,105,99,58,13,10,32,32,32,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40,88,109,108,69,108,101,109,101,110,116,42,32, - 99,111,110,115,116,32,120,109,108,95,41,13,10,32,32,32,32,32,32,32,32,58,32,120,109,108,32,40,120,109,108,95,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,40,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,105,110,116,32,103,101,116,73,116,101,109,87,105,100,116,104,40,41,32,99,111,110,115,116, - 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,120,109,108,45,62,103,101,116,73,110,116,65,116,116,114,105, - 98,117,116,101,32,40,84,40,34,119,105,100,116,104,34,41,44,32,45,49,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110, - 115,116,32,83,116,114,105,110,103,32,103,101,116,85,110,105,113,117,101,78,97,109,101,40,41,32,99,111,110,115,116,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114, - 110,32,120,109,108,45,62,103,101,116,84,97,103,78,97,109,101,40,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,83,116,114,105,110,103,58,58,101,109,112,116,121,59,13,10,32,32,32,32,125,13,10,13,10, - 32,32,32,32,98,111,111,108,32,109,105,103,104,116,67,111,110,116,97,105,110,83,117,98,73,116,101,109,115,40,41,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,120,109,108,32,33,61,32,48,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,38,38,32,120,109,108,45,62,103,101,116,70,105,114,115,116,67,104,105,108,100,69,108,101,109,101,110,116,40,41,32,33,61,32,48,59,13,10,32, - 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,73,116,101,109,32,40,71,114,97,112,104,105,99,115,38,32,103,44, - 32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,116,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, - 105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47, - 32,105,102,32,116,104,105,115,32,105,116,101,109,32,105,115,32,115,101,108,101,99,116,101,100,44,32,102,105,108,108,32,105,116,32,119,105,116,104,32, - 97,32,98,97,99,107,103,114,111,117,110,100,32,99,111,108,111,117,114,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105, - 115,83,101,108,101,99,116,101,100,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32, - 40,67,111,108,111,117,114,115,58,58,98,108,117,101,46,119,105,116,104,65,108,112,104,97,32,40,48,46,51,102,41,41,59,13,10,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,47,47,32,117,115,101,32,97,32,34,99,111,108,111,117,114,34,32,97,116,116,114,105,98,117,116,101,32,105,110,32, - 116,104,101,32,120,109,108,32,116,97,103,32,102,111,114,32,116,104,105,115,32,110,111,100,101,32,116,111,32,115,101,116,32,116,104,101,32,116,101,120, - 116,32,99,111,108,111,117,114,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108, - 111,117,114,32,40,120,109,108,45,62,103,101,116,83,116,114,105,110,103,65,116,116,114,105,98,117,116,101,32,40,84,40,34,99,111,108,111,117,114,34, - 41,44,32,84,40,34,102,102,48,48,48,48,48,48,34,41,41,46,103,101,116,72,101,120,86,97,108,117,101,51,50,40,41,41,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,104,101,105,103,104,116,32,42,32,48,46,55,102,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,100,114,97,119,32,116,104,101,32,120,109,108,32,101,108,101,109,101,110,116,39,115,32, - 116,97,103,32,110,97,109,101,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,120,109,108,45, - 62,103,101,116,84,97,103,78,97,109,101,40,41,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, - 52,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105,103,104,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,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116,114, - 117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,105,116,101,109,79, - 112,101,110,110,101,115,115,67,104,97,110,103,101,100,32,40,98,111,111,108,32,105,115,78,111,119,79,112,101,110,41,13,10,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,105,102,32,40,105,115,78,111,119,79,112,101,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,47,47,32,105,102,32,119,101,39,118,101,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,110,101,32,115,111,44,32, - 119,101,39,108,108,32,110,111,119,32,97,100,100,32,116,104,101,32,116,114,101,101,39,115,32,115,117,98,45,105,116,101,109,115,46,32,89,111,117,32, - 99,111,117,108,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,108,115,111,32,99,104,111,111,115,101,32,116,111,32,100,101,108, - 101,116,101,32,116,104,101,32,101,120,105,115,116,105,110,103,32,111,110,101,115,32,97,110,100,32,114,101,102,114,101,115,104,32,116,104,101,109,32,105, - 102,32,116,104,97,116,39,115,32,109,111,114,101,32,115,117,105,116,97,98,108,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105, - 110,32,121,111,117,114,32,97,112,112,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,103,101,116,78,117,109,83,117,98,73,116, - 101,109,115,40,41,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,100,32,97,100,100,32,115,117,98,45,105,116,101,109,115,32,116,111,32,116,104,105,115,32, - 110,111,100,101,32,111,102,32,116,104,101,32,116,114,101,101,44,32,99,111,114,114,101,115,112,111,110,100,105,110,103,32,116,111,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,101,97,99,104,32,115,117,98,45,101,108,101,109,101,110,116,32,105,110,32,116,104,101,32,88, - 77,76,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,120,109,108,32,33,61,32,48,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111, - 114,69,97,99,104,88,109,108,67,104,105,108,100,69,108,101,109,101,110,116,32,40,42,120,109,108,44,32,99,104,105,108,100,41,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,97,100,100,83,117,98,73,116,101,109,32,40,110,101,119,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40,99,104,105, - 108,100,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, - 32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105,110,32,116,104, - 105,115,32,99,97,115,101,44,32,119,101,39,108,108,32,108,101,97,118,101,32,97,110,121,32,115,117,98,45,105,116,101,109,115,32,105,110,32,116,104, - 101,32,116,114,101,101,32,119,104,101,110,32,116,104,101,32,110,111,100,101,32,103,101,116,115,32,99,108,111,115,101,100,44,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,47,47,32,116,104,111,117,103,104,32,121,111,117,32,99,111,117,108,100,32,99,104,111,111,115,101,32,116,111,32,100,101,108, - 101,116,101,32,116,104,101,109,32,105,102,32,116,104,97,116,39,115,32,109,111,114,101,32,97,112,112,114,111,112,114,105,97,116,101,32,102,111,114,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,121,111,117,114,32,97,112,112,108,105,99,97,116,105,111,110,46,13,10,32,32,32,32,32, - 32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,103,101,116,68,114,97,103,83, - 111,117,114,99,101,68,101,115,99,114,105,112,116,105,111,110,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114, - 110,32,84,40,34,84,114,101,101,86,105,101,119,32,73,116,101,109,115,34,41,59,13,10,32,32,32,32,125,13,10,125,59,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,13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101, + 73,79,67,97,108,108,98,97,99,107,32,40,99,111,110,115,116,32,102,108,111,97,116,42,42,32,105,110,112,117,116,67,104,97,110,110,101,108,68,97, + 116,97,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,32,32,32,32,32,32,32,105,110,116, + 32,116,111,116,97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,102,108,111,97,116,42,42,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97, + 116,97,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,32,32,32,32,32,32,32,105,110,116, + 32,116,111,116,97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,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,32,32,32,32,32,32,32,105,110,116,32,110,117,109,83,97,109,112,108,101,115,41,13,10,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,47,47,32,112,97,115,115,32,116,104,101,32,97,117,100,105,111,32,99,97,108,108,98,97,99,107,32,111,110,32, + 116,111,32,111,117,114,32,112,108,97,121,101,114,32,115,111,117,114,99,101,44,32,97,110,100,32,97,108,115,111,32,116,104,101,32,119,97,118,101,102, + 111,114,109,32,100,105,115,112,108,97,121,32,99,111,109,112,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97, + 121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,73,79,67,97,108,108,98,97,99,107,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68, + 97,116,97,44,32,116,111,116,97,108,78,117,109,73,110,112,117,116,67,104,97,110,110,101,108,115,44,32,111,117,116,112,117,116,67,104,97,110,110,101, + 108,68,97,116,97,44,32,116,111,116,97,108,78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,44,32,110,117,109,83,97,109,112,108,101, + 115,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111,68,101,118, + 105,99,101,73,79,67,97,108,108,98,97,99,107,32,40,105,110,112,117,116,67,104,97,110,110,101,108,68,97,116,97,44,32,116,111,116,97,108,78,117, + 109,73,110,112,117,116,67,104,97,110,110,101,108,115,44,32,111,117,116,112,117,116,67,104,97,110,110,101,108,68,97,116,97,44,32,116,111,116,97,108, + 78,117,109,79,117,116,112,117,116,67,104,97,110,110,101,108,115,44,32,110,117,109,83,97,109,112,108,101,115,41,59,13,10,32,32,32,32,125,13,10, + 13,10,32,32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,65,117,100,105, + 111,73,79,68,101,118,105,99,101,42,32,100,101,118,105,99,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111, + 83,111,117,114,99,101,80,108,97,121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,100,101, + 118,105,99,101,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111, + 68,101,118,105,99,101,65,98,111,117,116,84,111,83,116,97,114,116,32,40,100,101,118,105,99,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32, + 32,32,32,118,111,105,100,32,97,117,100,105,111,68,101,118,105,99,101,83,116,111,112,112,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32, + 32,32,32,32,32,97,117,100,105,111,83,111,117,114,99,101,80,108,97,121,101,114,46,97,117,100,105,111,68,101,118,105,99,101,83,116,111,112,112,101, + 100,40,41,59,13,10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,97,117,100,105,111,68,101, + 118,105,99,101,83,116,111,112,112,101,100,40,41,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,118,111,105,100,32, + 112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,112, + 114,105,110,116,32,115,111,109,101,32,116,101,120,116,32,116,111,32,101,120,112,108,97,105,110,32,119,104,97,116,32,115,116,97,116,101,32,119,101,39, + 114,101,32,105,110,46,13,10,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58, + 98,108,97,99,107,41,59,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40,49,52,46,48,102,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,83,116,114,105,110,103,32,115,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,114,97,110,115,112,111,114, + 116,83,111,117,114,99,101,46,105,115,80,108,97,121,105,110,103,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,61,32,84,40, + 34,112,108,97,121,105,110,103,34,41,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115, + 32,61,32,84,40,34,115,116,111,112,112,101,100,34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,99,117,114,114,101,110,116,65, + 117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,43,61,32,84, + 40,34,32,45,32,110,111,32,115,111,117,114,99,101,32,102,105,108,101,32,115,101,108,101,99,116,101,100,34,41,59,13,10,32,32,32,32,32,32,32, + 32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,32,43,61,32,84,40,34,32,45,32,102,105,108,101,58,32,92,34,34,41, + 32,43,32,99,117,114,114,101,110,116,70,105,108,101,46,103,101,116,70,117,108,108,80,97,116,104,78,97,109,101,40,41,32,43,32,84,40,34,92,34, + 34,41,59,13,10,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,115,44,32,50,53,48,44,32,53,48,44,32,103, + 101,116,87,105,100,116,104,40,41,32,45,32,50,53,48,44,32,50,52,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116, + 114,101,100,76,101,102,116,44,32,116,114,117,101,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,102,105,108,101,67,104,111,111,115,101,114,45,62,115,101,116,66,111,117, + 110,100,115,32,40,49,48,44,32,49,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,50,48,44,32,50,52,41,59,13,10,32,32,32,32, + 32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,53,48,44,32,49,48,48,44,32, + 50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,49,48, + 44,32,53,48,44,32,49,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117, + 116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32, + 32,32,32,32,32,97,117,100,105,111,83,101,116,116,105,110,103,115,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70, + 105,116,84,101,120,116,40,41,59,13,10,32,32,32,32,32,32,32,32,107,101,121,98,111,97,114,100,67,111,109,112,111,110,101,110,116,45,62,115,101, + 116,66,111,117,110,100,115,32,40,49,48,44,32,50,48,48,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,50,48,44,32,54,48,41,59,13, + 10,32,32,32,32,32,32,32,32,119,97,118,101,102,111,114,109,67,111,109,112,111,110,101,110,116,45,62,115,101,116,66,111,117,110,100,115,32,40,49, + 48,44,32,51,48,48,44,32,52,48,48,44,32,56,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,66,117,116,116,111, + 110,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,117,112,100,97,116,101,66,117,116,116,111,110,115,40,41, + 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,112,108,97,121,66,117,116,116,111,110,45,62,115,101,116,69,110,97,98,108,101,100,32, + 40,99,117,114,114,101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,32,33,61,32,48,32,38,38,32,33,32,116,114,97,110,115,112, + 111,114,116,83,111,117,114,99,101,46,105,115,80,108,97,121,105,110,103,40,41,41,59,13,10,32,32,32,32,32,32,32,32,115,116,111,112,66,117,116, + 116,111,110,45,62,115,101,116,69,110,97,98,108,101,100,32,40,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,105,115,80,108,97,121,105, + 110,103,40,41,41,59,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,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,117,116,116,111,110,41,13,10,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,112,108,97,121,66,117,116,116,111,110,41,13,10, + 32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115, + 101,116,80,111,115,105,116,105,111,110,32,40,48,46,48,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116, + 83,111,117,114,99,101,46,115,116,97,114,116,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101, + 32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,115,116,111,112,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,116,111,112,40,41,59,13,10,32,32,32,32, + 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,97,117,100,105,111,83, + 101,116,116,105,110,103,115,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47, + 47,32,67,114,101,97,116,101,32,97,110,32,65,117,100,105,111,68,101,118,105,99,101,83,101,108,101,99,116,111,114,67,111,109,112,111,110,101,110,116, + 32,119,104,105,99,104,32,99,111,110,116,97,105,110,115,32,116,104,101,32,97,117,100,105,111,32,99,104,111,105,99,101,32,119,105,100,103,101,116,115, + 46,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,117,100,105,111,68,101,118,105,99,101,83,101,108,101,99,116,111,114,67,111, + 109,112,111,110,101,110,116,32,97,117,100,105,111,83,101,116,116,105,110,103,115,67,111,109,112,32,40,97,117,100,105,111,68,101,118,105,99,101,77,97, + 110,97,103,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,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,32,32,32,32,32,32,32,32,32,32,48,44,32,49,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,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,32,32,32,32,32,32,32,32,32,32,50,44,32,50,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,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,32,32,32,32,32,32,32,32, + 32,32,116,114,117,101,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,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,32,32,32,32,32,32,32,32,32,32,102,97,108,115,101,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,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,32,32,32,32,32,32,32,32,32,32,116,114,117,101,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,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,32,32,32,32,32,32, + 32,32,32,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,46,97,110,100,32,115,104,111, + 119,32,105,116,32,105,110,32,97,32,68,105,97,108,111,103,87,105,110,100,111,119,46,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97, + 117,100,105,111,83,101,116,116,105,110,103,115,67,111,109,112,46,115,101,116,83,105,122,101,32,40,53,48,48,44,32,52,53,48,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,68,105,97,108,111,103,87,105,110,100,111,119,58,58,115,104,111,119,77,111,100,97,108,68,105,97,108,111, + 103,32,40,84,40,34,65,117,100,105,111,32,83,101,116,116,105,110,103,115,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,38,97,117,100,105,111,83,101,116,116,105,110, + 103,115,67,111,109,112,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,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,116,104,105,115,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,108,111,117,114,115,58,58,97,122,117,114,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,102, + 105,108,101,110,97,109,101,67,111,109,112,111,110,101,110,116,67,104,97,110,103,101,100,32,40,70,105,108,101,110,97,109,101,67,111,109,112,111,110,101, + 110,116,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119, + 104,101,110,32,116,104,101,32,117,115,101,114,32,99,104,97,110,103,101,115,32,116,104,101,32,102,105,108,101,110,97,109,101,32,105,110,32,116,104,101, + 32,102,105,108,101,32,99,104,111,111,115,101,114,32,98,111,120,13,10,13,10,32,32,32,32,32,32,32,32,70,105,108,101,32,97,117,100,105,111,70, + 105,108,101,32,40,102,105,108,101,67,104,111,111,115,101,114,45,62,103,101,116,67,117,114,114,101,110,116,70,105,108,101,40,41,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,47,47,32,117,110,108,111,97,100,32,116,104,101,32,112,114,101,118,105,111,117,115,32,102,105,108,101,32,115,111,117,114, + 99,101,32,97,110,100,32,100,101,108,101,116,101,32,105,116,46,46,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117, + 114,99,101,46,115,116,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116, + 83,111,117,114,99,101,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,99,117,114,114, + 101,110,116,65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116, + 101,32,97,32,110,101,119,32,102,105,108,101,32,115,111,117,114,99,101,32,102,114,111,109,32,116,104,101,32,102,105,108,101,46,46,13,10,13,10,32, + 32,32,32,32,32,32,32,47,47,32,103,101,116,32,97,32,102,111,114,109,97,116,32,109,97,110,97,103,101,114,32,97,110,100,32,115,101,116,32,105, + 116,32,117,112,32,119,105,116,104,32,116,104,101,32,98,97,115,105,99,32,116,121,112,101,115,32,40,119,97,118,32,97,110,100,32,97,105,102,102,41, + 46,13,10,32,32,32,32,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,77,97,110,97,103,101,114,32,102,111,114,109,97,116,77,97,110,97, + 103,101,114,59,13,10,32,32,32,32,32,32,32,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,114,101,103,105,115,116,101,114,66,97,115,105, + 99,70,111,114,109,97,116,115,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114, + 42,32,114,101,97,100,101,114,32,61,32,102,111,114,109,97,116,77,97,110,97,103,101,114,46,99,114,101,97,116,101,82,101,97,100,101,114,70,111,114, + 32,40,97,117,100,105,111,70,105,108,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,101,97,100,101,114,32,33,61,32,48, + 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,70,105,108,101,32,61,32, + 97,117,100,105,111,70,105,108,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,65,117,100,105,111,70,105, + 108,101,83,111,117,114,99,101,32,61,32,110,101,119,32,65,117,100,105,111,70,111,114,109,97,116,82,101,97,100,101,114,83,111,117,114,99,101,32,40, + 114,101,97,100,101,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,46,46,97,110,100,32,112, + 108,117,103,32,105,116,32,105,110,116,111,32,111,117,114,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,116,114,97,110,115,112,111,114,116,83,111,117,114,99,101,46,115,101,116,83,111,117,114,99,101,32,40,99,117,114,114,101,110,116, + 65,117,100,105,111,70,105,108,101,83,111,117,114,99,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,51,50,55,54,56,44,32,47,47,32,116,101,108,108,115,32,105,116,32,116,111,32,98, + 117,102,102,101,114,32,116,104,105,115,32,109,97,110,121,32,115,97,109,112,108,101,115,32,97,104,101,97,100,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,97,100,101,114,45,62,115,97, + 109,112,108,101,82,97,116,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,66, + 117,116,116,111,110,115,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,104,97,110,103,101,76,105,115,116,101, + 110,101,114,67,97,108,108,98,97,99,107,32,40,118,111,105,100,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,99, + 97,108,108,98,97,99,107,32,102,114,111,109,32,116,104,101,32,116,114,97,110,115,112,111,114,116,32,115,111,117,114,99,101,32,116,111,32,116,101,108, + 108,32,117,115,32,116,104,97,116,32,112,108,97,121,32,104,97,115,13,10,32,32,32,32,32,32,32,32,47,47,32,115,116,97,114,116,101,100,32,111, + 114,32,115,116,111,112,112,101,100,44,32,115,111,32,117,112,100,97,116,101,32,111,117,114,32,98,117,116,116,111,110,115,46,46,13,10,32,32,32,32, + 32,32,32,32,117,112,100,97,116,101,66,117,116,116,111,110,115,40,41,59,13,10,32,32,32,32,125,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,84,114,101,101,86,105,101,119,68,101,109,111,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,112,117,98,108,105,99,32,68,114,97,103,65,110,100,68,114,111,112, - 67,111,110,116,97,105,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,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,32,32,32,32,88,109,108,69,108,101,109,101,110,116,42,32,116,114,101,101, - 88,109,108,59,13,10,13,10,32,32,32,32,84,114,101,101,86,105,101,119,73,116,101,109,42,32,114,111,111,116,73,116,101,109,59,13,10,32,32,32, - 32,84,114,101,101,86,105,101,119,42,32,116,114,101,101,86,105,101,119,59,13,10,13,10,32,32,32,32,70,105,108,101,84,114,101,101,67,111,109,112, - 111,110,101,110,116,42,32,102,105,108,101,84,114,101,101,67,111,109,112,59,13,10,32,32,32,32,68,105,114,101,99,116,111,114,121,67,111,110,116,101, - 110,116,115,76,105,115,116,42,32,100,105,114,101,99,116,111,114,121,76,105,115,116,59,13,10,32,32,32,32,84,105,109,101,83,108,105,99,101,84,104, - 114,101,97,100,32,116,104,114,101,97,100,59,13,10,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,116,121,112,101,66,117,116,116, - 111,110,59,13,10,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,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[] = {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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,84,114,101,101,86,105,101,119,68,101,109,111,40,41, - 13,10,32,32,32,32,32,32,32,32,58,32,116,114,101,101,86,105,101,119,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,114,111,111, - 116,73,116,101,109,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32,32,102,105,108,101,84,114,101,101,67,111,109,112,32,40,48,41,44,13, - 10,32,32,32,32,32,32,32,32,32,32,100,105,114,101,99,116,111,114,121,76,105,115,116,32,40,48,41,44,13,10,32,32,32,32,32,32,32,32,32, - 32,116,104,114,101,97,100,32,40,34,68,101,109,111,32,102,105,108,101,32,116,114,101,101,32,116,104,114,101,97,100,34,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,84,40,34,84,114,101,101,32,86,105,101,119,115,34,41,41,59,13,10,13,10, - 32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,114,101,101,88,109,108,83,116,114,105,110,103,32,40,66,105,110,97, - 114,121,68,97,116,97,58,58,116,114,101,101,100,101,109,111,95,120,109,108,41,59,13,10,32,32,32,32,32,32,32,32,88,109,108,68,111,99,117,109, - 101,110,116,32,112,97,114,115,101,114,32,40,116,114,101,101,88,109,108,83,116,114,105,110,103,41,59,13,10,32,32,32,32,32,32,32,32,116,114,101, - 101,88,109,108,32,61,32,112,97,114,115,101,114,46,103,101,116,68,111,99,117,109,101,110,116,69,108,101,109,101,110,116,40,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,114,111,111,116,73,116,101,109,32,61,32,110,101,119,32,84,114,101,101,86,105,101,119,68,101,109,111,73,116,101,109,32,40, - 116,114,101,101,88,109,108,41,59,13,10,32,32,32,32,32,32,32,32,114,111,111,116,73,116,101,109,45,62,115,101,116,79,112,101,110,32,40,116,114, - 117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,102,105,110,100,32,116,104,101,32,114,111,111,116,32,111,102,32,116,104,101,32, - 117,115,101,114,39,115,32,104,111,109,101,32,100,114,105,118,101,44,32,97,110,100,32,115,101,116,32,116,104,97,116,32,97,115,32,111,117,114,32,114, - 111,111,116,46,46,13,10,32,32,32,32,32,32,32,32,70,105,108,101,32,102,111,108,100,101,114,32,40,70,105,108,101,58,58,103,101,116,83,112,101, - 99,105,97,108,76,111,99,97,116,105,111,110,32,40,70,105,108,101,58,58,117,115,101,114,72,111,109,101,68,105,114,101,99,116,111,114,121,41,41,59, - 13,10,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,102,111,108,100,101,114,46,103,101,116,80,97,114,101,110,116,68,105,114,101,99,116,111, - 114,121,40,41,32,33,61,32,102,111,108,100,101,114,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,108,100,101,114,32,61,32,102,111, - 108,100,101,114,46,103,101,116,80,97,114,101,110,116,68,105,114,101,99,116,111,114,121,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,100,105, - 114,101,99,116,111,114,121,76,105,115,116,32,61,32,110,101,119,32,68,105,114,101,99,116,111,114,121,67,111,110,116,101,110,116,115,76,105,115,116,32, - 40,48,44,32,116,104,114,101,97,100,41,59,13,10,32,32,32,32,32,32,32,32,100,105,114,101,99,116,111,114,121,76,105,115,116,45,62,115,101,116, - 68,105,114,101,99,116,111,114,121,32,40,102,111,108,100,101,114,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32, - 32,116,104,114,101,97,100,46,115,116,97,114,116,84,104,114,101,97,100,32,40,51,41,59,13,10,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,116,121,112,101,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,84,40,34,84,121,112,101,32,111,102,32,116,114,101,101,118,105,101,119,46,46,46,34,41,41,41,59,13,10,32,32,32,32,32,32,32, - 32,116,121,112,101,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,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,65,108,119,97,121,115,79,110,84,111,112,32,40,116,114,117,101, - 41,59,13,10,32,32,32,32,32,32,32,32,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,84,114,105,103,103,101,114,101,100,79,110,77,111, - 117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,104,111,119,67,117,115,116,111,109,84,114,101, - 101,86,105,101,119,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,114,101,101,86,105,101,119,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,13,10,32, - 32,32,32,32,32,32,32,100,101,108,101,116,101,32,114,111,111,116,73,116,101,109,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, - 116,114,101,101,88,109,108,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,100,105,114,101,99,116,111,114,121,76,105,115,116,59,13, - 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10, - 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,103,114,101, - 121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,116,114,101,101,86,105,101,119,32,33,61,32,48,41,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99,116,32,40,116,114,101,101,86,105,101,119,45,62,103,101,116,88,40,41,44,32,116,114,101, - 101,86,105,101,119,45,62,103,101,116,89,40,41,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, - 116,114,101,101,86,105,101,119,45,62,103,101,116,87,105,100,116,104,40,41,44,32,116,114,101,101,86,105,101,119,45,62,103,101,116,72,101,105,103,104, - 116,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,102,105,108,101,84,114,101,101,67,111,109,112,32,33,61,32,48,41,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,82,101,99,116,32,40,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103, - 101,116,88,40,41,44,32,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,89,40,41,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,102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,87,105,100,116,104,40,41,44,32, - 102,105,108,101,84,114,101,101,67,111,109,112,45,62,103,101,116,72,101,105,103,104,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,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,105,102,32,40,116,114,101, - 101,86,105,101,119,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,114,101,101,86,105,101,119,45,62,115,101,116,66,111, - 117,110,100,115,82,101,108,97,116,105,118,101,32,40,48,46,48,53,102,44,32,48,46,48,55,102,44,32,48,46,57,102,44,32,48,46,57,102,41,59, - 13,10,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,102,105,108,101,84,114,101,101,67,111,109,112,32,33,61,32,48,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,84,114,101,101,67,111,109,112,45,62,115,101,116,66,111,117,110,100,115,82,101,108,97,116,105, - 118,101,32,40,48,46,48,53,102,44,32,48,46,48,55,102,44,32,48,46,57,102,44,32,48,46,57,102,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,116,121,112,101,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,48,41,59, - 13,10,32,32,32,32,32,32,32,32,116,121,112,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110, - 32,40,52,48,44,32,49,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,104,111,119,67,117,115,116,111,109, - 84,114,101,101,86,105,101,119,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,110,100,90,101,114,111, - 32,40,116,114,101,101,86,105,101,119,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65,110,100,90,101,114,111,32,40,102,105,108, - 101,84,114,101,101,67,111,109,112,41,59,13,10,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,116,114,101,101,86,105,101,119,32,61,32,110,101,119,32,84,114,101,101,86,105,101,119,40,41,41,59,13,10,32,32,32,32,32,32,32,32,116, - 114,101,101,86,105,101,119,45,62,115,101,116,82,111,111,116,73,116,101,109,32,40,114,111,111,116,73,116,101,109,41,59,13,10,32,32,32,32,32,32, - 32,32,116,114,101,101,86,105,101,119,45,62,115,101,116,77,117,108,116,105,83,101,108,101,99,116,69,110,97,98,108,101,100,32,40,116,114,117,101,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,115,105,122,101,100,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111, - 105,100,32,115,104,111,119,70,105,108,101,84,114,101,101,67,111,109,112,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,110,100,90,101,114,111,32,40,116,114,101,101,86,105,101,119,41,59,13,10,32,32,32,32,32,32,32,32,100,101,108,101,116,101,65, - 110,100,90,101,114,111,32,40,102,105,108,101,84,114,101,101,67,111,109,112,41,59,13,10,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,105,108,101,84,114,101,101,67,111,109,112,32,61,32,110,101,119,32,70,105,108,101,84,114,101,101, - 67,111,109,112,111,110,101,110,116,32,40,42,100,105,114,101,99,116,111,114,121,76,105,115,116,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 114,101,115,105,122,101,100,40,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,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32, - 109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49,44,32,84,40,34,67,117,115,116,111,109,32,116,114,101,101, - 118,105,101,119,32,115,104,111,119,105,110,103,32,97,110,32,88,77,76,32,116,114,101,101,34,41,41,59,13,10,32,32,32,32,32,32,32,32,109,46, - 97,100,100,73,116,101,109,32,40,50,44,32,84,40,34,70,105,108,101,84,114,101,101,67,111,109,112,111,110,101,110,116,32,115,104,111,119,105,110,103, - 32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110, - 116,32,114,32,61,32,109,46,115,104,111,119,65,116,32,40,116,121,112,101,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 105,102,32,40,114,32,61,61,32,49,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,104,111,119, - 67,117,115,116,111,109,84,114,101,101,86,105,101,119,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108, - 115,101,32,105,102,32,40,114,32,61,61,32,50,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115, - 104,111,119,70,105,108,101,84,114,101,101,67,111,109,112,40,41,59,13,10,32,32,32,32,32,32,32,32,125,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,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,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,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,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,84,114,101,101,86,105,101,119,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,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*) temp16; + 61,61,61,61,61,61,61,61,61,61,61,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,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,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,32,112,117,98,108,105,99, + 32,65,115,121,110,99,85,112,100,97,116,101,114,13,10,123,13,10,32,32,32,32,102,108,111,97,116,32,120,44,32,121,44,32,115,105,122,101,44,32, + 100,120,44,32,100,121,44,32,119,44,32,104,44,32,112,97,114,101,110,116,87,105,100,116,104,44,32,112,97,114,101,110,116,72,101,105,103,104,116,59, + 13,10,32,32,32,32,102,108,111,97,116,32,105,110,110,101,114,88,44,32,105,110,110,101,114,89,59,13,10,32,32,32,32,67,111,108,111,117,114,32, + 99,111,108,111,117,114,59,13,10,32,32,32,32,67,114,105,116,105,99,97,108,83,101,99,116,105,111,110,32,108,111,99,107,59,13,10,32,32,32,32, + 105,110,116,54,52,32,116,104,114,101,97,100,73,100,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,66,111,117,110,99,105,110,103, + 66,97,108,108,67,111,109,112,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,120,32,61,32,82,97,110,100,111,109,58,58,103, + 101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,50,48,48,46,48,102,59,13,10, + 32,32,32,32,32,32,32,32,121,32,61,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101, + 120,116,70,108,111,97,116,40,41,32,42,32,50,48,48,46,48,102,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,87,105,100,116,104, + 32,61,32,53,48,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,72,101,105,103,104,116,32,61,32,53,48,59,13,10,32,32,32,32, + 32,32,32,32,105,110,110,101,114,88,32,61,32,48,59,13,10,32,32,32,32,32,32,32,32,105,110,110,101,114,89,32,61,32,48,59,13,10,32,32, + 32,32,32,32,32,32,116,104,114,101,97,100,73,100,32,61,32,48,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111, + 97,116,32,115,112,101,101,100,32,61,32,53,46,48,102,59,32,47,47,32,103,105,118,101,32,101,97,99,104,32,98,97,108,108,32,97,32,102,105,120, + 101,100,32,115,112,101,101,100,32,115,111,32,119,101,32,99,97,110,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,32,32,32,32,32,32,32,32,32,47,47,32,115,101,101,32,116,104,101,32,101,102,102,101,99,116,115,32,111,102,32,116,104,114,101, + 97,100,32,112,114,105,111,114,105,116,121,32,111,110,32,104,111,119,32,102,97,115,116,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,32,32,32,32,32,32,32,32,32,47,47,32,116,104,101,121,32,97,99,116,117,97,108,108,121,32,103,111,46,13, + 10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,102,108,111,97,116,32,97,110,103,108,101,32,61,32,82,97,110,100,111,109,58,58,103,101,116, + 83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,102,108,111,97,116,95,80,105,32,42,32, + 50,46,48,102,59,13,10,13,10,32,32,32,32,32,32,32,32,100,120,32,61,32,115,105,110,102,32,40,97,110,103,108,101,41,32,42,32,115,112,101, + 101,100,59,13,10,32,32,32,32,32,32,32,32,100,121,32,61,32,99,111,115,102,32,40,97,110,103,108,101,41,32,42,32,115,112,101,101,100,59,13, + 10,13,10,32,32,32,32,32,32,32,32,115,105,122,101,32,61,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111, + 109,40,41,46,110,101,120,116,70,108,111,97,116,40,41,32,42,32,51,48,46,48,102,32,43,32,51,48,46,48,102,59,13,10,13,10,32,32,32,32, + 32,32,32,32,99,111,108,111,117,114,32,61,32,67,111,108,111,117,114,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97, + 110,100,111,109,40,41,46,110,101,120,116,73,110,116,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46, + 119,105,116,104,65,108,112,104,97,32,40,48,46,53,102,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,46,119, + 105,116,104,66,114,105,103,104,116,110,101,115,115,32,40,48,46,55,102,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,66,111,117, + 110,99,105,110,103,66,97,108,108,67,111,109,112,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105, + 100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99,115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46, + 115,101,116,67,111,108,111,117,114,32,40,99,111,108,111,117,114,41,59,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,69,108,108,105,112, + 115,101,32,40,105,110,110,101,114,88,44,32,105,110,110,101,114,89,44,32,115,105,122,101,44,32,115,105,122,101,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,103,46,115,101,116,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,32,32,32,32,32, + 32,32,32,103,46,115,101,116,70,111,110,116,32,40,49,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120, + 116,32,40,83,116,114,105,110,103,58,58,116,111,72,101,120,83,116,114,105,110,103,32,40,116,104,114,101,97,100,73,100,41,44,32,48,44,32,48,44, + 32,103,101,116,87,105,100,116,104,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,44,32,74,117,115,116,105,102,105,99,97,116,105,111,110,58, + 58,99,101,110,116,114,101,100,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,114, + 101,110,116,83,105,122,101,67,104,97,110,103,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,87, + 105,100,116,104,32,61,32,103,101,116,80,97,114,101,110,116,87,105,100,116,104,40,41,32,45,32,115,105,122,101,59,13,10,32,32,32,32,32,32,32, + 32,112,97,114,101,110,116,72,101,105,103,104,116,32,61,32,103,101,116,80,97,114,101,110,116,72,101,105,103,104,116,40,41,32,45,32,115,105,122,101, + 59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,104,97,110,100,108,101,65,115,121,110,99,85,112,100,97,116,101,40,41, + 13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,99,111,112,101,100,76,111,99,107,32,115,108,32,40,108,111, + 99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,66,111,117,110,100,115,32,40,40,40,105,110,116,41,32,120,41,32,45,32,50, + 44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,121,41,32,45,32,50,44,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,115,105,122,101,41,32,43,32,52,44,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,105,110,116,41,32,115,105,122,101,41,32,43,32,52,41,59,13,10,13,10,32,32,32, + 32,32,32,32,32,105,110,110,101,114,88,32,61,32,120,32,45,32,103,101,116,88,40,41,59,13,10,32,32,32,32,32,32,32,32,105,110,110,101,114, + 89,32,61,32,121,32,45,32,103,101,116,89,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,112,97,105,110,116,40,41,59,13,10,32, + 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,109,111,118,101,66,97,108,108,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,99,111,110,115,116,32,83,99,111,112,101,100,76,111,99,107,32,115,108,32,40,108,111,99,107,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,116,104,114,101,97,100,73,100,32,61,32,84,104,114,101,97,100,58,58,103,101,116,67,117,114,114,101,110,116,84,104,114,101,97,100,73,100, + 40,41,59,32,47,47,32,116,104,105,115,32,105,115,32,115,111,32,116,104,101,32,99,111,109,112,111,110,101,110,116,32,99,97,110,32,112,114,105,110, + 116,32,116,104,101,32,116,104,114,101,97,100,32,73,68,32,105,110,115,105,100,101,32,116,104,101,32,98,97,108,108,13,10,13,10,32,32,32,32,32, + 32,32,32,120,32,43,61,32,100,120,59,13,10,32,32,32,32,32,32,32,32,121,32,43,61,32,100,121,59,13,10,13,10,32,32,32,32,32,32,32, + 32,105,102,32,40,120,32,60,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,120,32,61,32,102,97,98,115,102,32,40,100,120,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,120,32,62,32,112,97,114,101,110,116,87,105,100,116,104,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,100,120,32,61,32,45,102,97,98,115,102,32,40,100,120,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40, + 121,32,60,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,121,32,61,32,102,97,98,115,102,32,40,100,121,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,105,102,32,40,121,32,62,32,112,97,114,101,110,116,72,101,105,103,104,116,41,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,100,121,32,61,32,45,102,97,98,115,102,32,40,100,121,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32, + 105,115,32,99,97,108,108,101,100,32,111,110,32,97,32,98,97,99,107,103,114,111,117,110,100,32,116,104,114,101,97,100,44,32,115,111,32,119,101,32, + 100,111,110,39,116,32,119,97,110,116,32,116,111,32,99,97,108,108,13,10,32,32,32,32,32,32,32,32,47,47,32,97,110,121,32,85,73,32,99,111, + 100,101,32,102,114,111,109,32,104,101,114,101,32,45,32,105,110,115,116,101,97,100,32,119,101,39,108,108,32,116,114,105,103,103,101,114,32,97,110,32, + 101,118,101,110,116,32,116,104,97,116,32,119,105,108,108,32,117,112,100,97,116,101,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,99, + 111,109,112,111,110,101,110,116,39,115,32,112,111,115,105,116,105,111,110,32,108,97,116,101,114,46,32,84,104,105,115,32,105,115,32,97,32,115,97,102, + 101,32,119,97,121,32,116,111,32,97,118,111,105,100,32,100,101,97,100,108,111,99,107,115,13,10,32,32,32,32,32,32,32,32,116,114,105,103,103,101, + 114,65,115,121,110,99,85,112,100,97,116,101,40,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,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,68,101,109,111, + 84,104,114,101,97,100,32,32,32,32,58,32,112,117,98,108,105,99,32,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,112,117,98,108,105,99,32,84,104,114,101,97,100,13,10,123,13,10,32,32, + 32,32,105,110,116,32,105,110,116,101,114,118,97,108,59,13,10,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68,101,109,111,84,104,114,101, + 97,100,40,41,13,10,32,32,32,32,32,32,32,32,58,32,84,104,114,101,97,100,32,40,84,40,34,74,117,99,101,32,68,101,109,111,32,84,104,114, + 101,97,100,34,41,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,110,116,101,114,118,97,108,32,61,32,82,97,110,100,111,109, + 58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,53,48,41,32,43,32,54,59,13,10,13, + 10,32,32,32,32,32,32,32,32,47,47,32,103,105,118,101,32,116,104,101,32,116,104,114,101,97,100,115,32,97,32,114,97,110,100,111,109,32,112,114, + 105,111,114,105,116,121,44,32,115,111,32,115,111,109,101,32,119,105,108,108,32,109,111,118,101,32,109,111,114,101,13,10,32,32,32,32,32,32,32,32, + 47,47,32,115,109,111,111,116,104,108,121,32,116,104,97,110,32,111,116,104,101,114,115,46,46,13,10,32,32,32,32,32,32,32,32,115,116,97,114,116, + 84,104,114,101,97,100,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110, + 116,32,40,51,41,32,43,32,51,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,104,114,101,97,100,40,41,13, + 10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,97,108,108,111,119,32,116,104,101,32,116,104,114,101,97,100,32,50,32,115,101, + 99,111,110,100,115,32,116,111,32,115,116,111,112,32,99,108,101,97,110,108,121,32,45,32,115,104,111,117,108,100,32,98,101,32,112,108,101,110,116,121, + 32,111,102,32,116,105,109,101,46,13,10,32,32,32,32,32,32,32,32,115,116,111,112,84,104,114,101,97,100,32,40,50,48,48,48,41,59,13,10,32, + 32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,117,110,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47, + 47,32,116,104,105,115,32,105,115,32,116,104,101,32,99,111,100,101,32,116,104,97,116,32,114,117,110,115,32,116,104,105,115,32,116,104,114,101,97,100, + 32,45,32,119,101,39,108,108,32,108,111,111,112,32,99,111,110,116,105,110,117,111,117,115,108,121,44,13,10,32,32,32,32,32,32,32,32,47,47,32, + 117,112,100,97,116,105,110,103,32,116,104,101,32,99,111,45,111,114,100,105,110,97,116,101,115,32,111,102,32,111,117,114,32,98,108,111,98,46,13,10, + 13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,114,101,97,100,83,104,111,117,108,100,69,120,105,116,40,41,32,114,101,116,117,114,110,115,32, + 116,114,117,101,32,119,104,101,110,32,116,104,101,32,115,116,111,112,84,104,114,101,97,100,40,41,32,109,101,116,104,111,100,32,104,97,115,32,98,101, + 101,110,13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,108,108,101,100,44,32,115,111,32,119,101,32,115,104,111,117,108,100,32,99,104,101,99, + 107,32,105,116,32,111,102,116,101,110,44,32,97,110,100,32,101,120,105,116,32,97,115,32,115,111,111,110,32,97,115,32,105,116,32,103,101,116,115,32, + 102,108,97,103,103,101,100,46,13,10,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,33,32,116,104,114,101,97,100,83,104,111,117,108,100,69, + 120,105,116,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,111,118,101,66,97,108,108,40, + 41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,115,108,101,101,112,32,97,32,98,105,116,32,115,111,32,116,104,101,32, + 116,104,114,101,97,100,115,32,100,111,110,39,116,32,97,108,108,32,103,114,105,110,100,32,116,104,101,32,67,80,85,32,116,111,32,97,32,104,97,108, + 116,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,97,105,116,32,40,105,110,116,101,114,118,97,108,41,59,13,10,32,32,32,32,32, + 32,32,32,125,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,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,68,101,109,111,84,104,114,101,97,100,80,111,111,108,74, + 111,98,32,32,58,32,112,117,98,108,105,99,32,66,111,117,110,99,105,110,103,66,97,108,108,67,111,109,112,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,32,32,112,117,98,108,105,99,32,84,104,114,101,97,100,80,111,111,108,74,111,98,13, + 10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68,101,109,111,84,104,114,101,97,100,80,111,111,108,74,111,98,40,41,13,10,32,32, + 32,32,32,32,32,32,58,32,84,104,114,101,97,100,80,111,111,108,74,111,98,32,40,84,40,34,68,101,109,111,32,84,104,114,101,97,100,112,111,111, + 108,32,74,111,98,34,41,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,104,114,101,97, + 100,80,111,111,108,74,111,98,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,74,111,98,83,116,97,116,117, + 115,32,114,117,110,74,111,98,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,105,115,32,116,104, + 101,32,99,111,100,101,32,116,104,97,116,32,114,117,110,115,32,116,104,105,115,32,106,111,98,46,32,73,116,39,108,108,32,98,101,32,114,101,112,101, + 97,116,101,100,108,121,32,99,97,108,108,101,100,32,117,110,116,105,108,32,119,101,32,114,101,116,117,114,110,13,10,32,32,32,32,32,32,32,32,47, + 47,32,106,111,98,72,97,115,70,105,110,105,115,104,101,100,32,105,110,115,116,101,97,100,32,111,102,32,106,111,98,78,101,101,100,115,82,117,110,110, + 105,110,103,65,103,97,105,110,46,13,10,13,10,32,32,32,32,32,32,32,32,109,111,118,101,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32, + 32,32,84,104,114,101,97,100,58,58,115,108,101,101,112,32,40,51,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32, + 106,111,98,78,101,101,100,115,82,117,110,110,105,110,103,65,103,97,105,110,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100, + 32,114,101,109,111,118,101,100,70,114,111,109,81,117,101,117,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,84, + 104,105,115,32,105,115,32,99,97,108,108,101,100,32,116,111,32,116,101,108,108,32,117,115,32,116,104,97,116,32,111,117,114,32,106,111,98,32,104,97, + 115,32,98,101,101,110,32,114,101,109,111,118,101,100,32,102,114,111,109,32,116,104,101,32,112,111,111,108,46,13,10,32,32,32,32,32,32,32,32,47, + 47,32,73,110,32,116,104,105,115,32,99,97,115,101,32,116,104,101,114,101,39,115,32,110,111,32,110,101,101,100,32,116,111,32,100,111,32,97,110,121, + 116,104,105,110,103,32,104,101,114,101,46,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,125,59,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,84,104,114,101,97,100,105,110,103,68, + 101,109,111,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,112,117,98,108,105,99,32,84,105,109,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,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,32,32,32,32,98,111,111, + 108,32,105,115,85,115,105,110,103,80,111,111,108,59,13,10,32,32,32,32,84,104,114,101,97,100,80,111,111,108,32,112,111,111,108,59,13,10,32,32, + 32,32,84,101,120,116,66,117,116,116,111,110,42,32,99,111,110,116,114,111,108,66,117,116,116,111,110,59,13,10,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,84,104,114,101,97,100,105,110,103,68,101,109,111,40,41,13,10,32,32,32,32,32,32,32,32,58,32,112,111, + 111,108,32,40,51,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,115,85,115,105,110,103,80,111,111,108,32,61,32,102,97,108, + 115,101,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,84,40,34,77,117,108,116,105,116,104,114,101,97,100,105,110, + 103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,79,112,97,113,117,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32, + 125,13,10,13,10,32,32,32,32,126,84,104,114,101,97,100,105,110,103,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32, + 32,32,112,111,111,108,46,114,101,109,111,118,101,65,108,108,74,111,98,115,32,40,116,114,117,101,44,32,50,48,48,48,41,59,13,10,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,47,47,32,116,104,105,115,32,103,101,116,115,32,99,97,108,108,101,100,32,119,104,101,110,32,97,32,99,111,109,112,111,110,101,110,116,32,105,115, + 32,97,100,100,101,100,32,111,114,32,114,101,109,111,118,101,100,32,102,114,111,109,32,97,32,112,97,114,101,110,116,32,99,111,109,112,111,110,101,110, + 116,46,13,10,32,32,32,32,118,111,105,100,32,112,97,114,101,110,116,72,105,101,114,97,114,99,104,121,67,104,97,110,103,101,100,40,41,13,10,32, + 32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,39,108,108,32,117,115,101,32,116,104,105,115,32,97,115,32,97,110,32,111,112, + 112,111,114,116,117,110,105,116,121,32,116,111,32,115,116,97,114,116,32,97,110,100,32,115,116,111,112,32,116,104,101,32,116,104,114,101,97,100,115,44, + 32,115,111,32,116,104,97,116,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,32,100,111,110,39,116,32,108,101,97,118,101,32,116,104,101,109, + 32,103,111,105,110,103,32,119,104,101,110,32,116,104,101,32,99,111,109,112,111,110,101,110,116,39,115,32,110,111,116,32,97,99,116,117,97,108,108,121, + 32,118,105,115,105,98,108,101,46,13,10,32,32,32,32,32,32,32,32,115,116,111,112,84,105,109,101,114,40,41,59,13,10,13,10,32,32,32,32,32, + 32,32,32,112,111,111,108,46,114,101,109,111,118,101,65,108,108,74,111,98,115,32,40,116,114,117,101,44,32,52,48,48,48,41,59,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,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,99,111,110,116,114,111,108,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,84,40,34,84,104,114,101,97,100,32,116,121,112,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110, + 116,114,111,108,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,48,41,59,13,10, + 32,32,32,32,32,32,32,32,99,111,110,116,114,111,108,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111, + 110,32,40,50,48,44,32,50,48,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110,116,114,111,108,66,117,116,116,111,110,45,62,115,101,116,84, + 114,105,103,103,101,114,101,100,79,110,77,111,117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,99,111,110, + 116,114,111,108,66,117,116,116,111,110,45,62,115,101,116,65,108,119,97,121,115,79,110,84,111,112,32,40,116,114,117,101,41,59,13,10,32,32,32,32, + 32,32,32,32,99,111,110,116,114,111,108,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,105,102,32,40,105,115,83,104,111,119,105,110,103,40,41,41,13,10,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,104,105,108,101,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111, + 110,101,110,116,115,40,41,32,60,32,53,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,100,100,65,66,97,108,108,40,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,116,97,114,116,84,105,109,101,114,32,40,50,48,48,48,41,59,13,10,32,32,32, + 32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,32,40,71,114,97,112,104,105,99, + 115,38,32,103,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115, + 58,58,119,104,105,116,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,101,116,85,115,105,110,103,80,111,111, + 108,32,40,98,111,111,108,32,117,115,101,80,111,111,108,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,115,85,115,105,110,103, + 80,111,111,108,32,61,32,117,115,101,80,111,111,108,59,13,10,32,32,32,32,32,32,32,32,112,97,114,101,110,116,72,105,101,114,97,114,99,104,121, + 67,104,97,110,103,101,100,40,41,59,32,47,47,32,114,101,115,101,116,115,32,101,118,101,114,121,116,104,105,110,103,13,10,32,32,32,32,125,13,10, + 13,10,32,32,32,32,118,111,105,100,32,97,100,100,65,66,97,108,108,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102, + 32,40,105,115,85,115,105,110,103,80,111,111,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68, + 101,109,111,84,104,114,101,97,100,80,111,111,108,74,111,98,42,32,110,101,119,67,111,109,112,32,61,32,110,101,119,32,68,101,109,111,84,104,114,101, + 97,100,80,111,111,108,74,111,98,40,41,59,13,10,32,32,32,32,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,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,101,119,67,111,109,112,45,62,112,97,114, + 101,110,116,83,105,122,101,67,104,97,110,103,101,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,112,111,111,108,46,97,100, + 100,74,111,98,32,40,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101, + 13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,84,104,114,101,97,100,42,32,110,101,119, + 67,111,109,112,32,61,32,110,101,119,32,68,101,109,111,84,104,114,101,97,100,40,41,59,13,10,32,32,32,32,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,110,101,119,67,111,109,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 110,101,119,67,111,109,112,45,62,112,97,114,101,110,116,83,105,122,101,67,104,97,110,103,101,100,40,41,59,13,10,32,32,32,32,32,32,32,32,125, + 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,101,109,111,118,101,65,66,97,108,108,40,41,13,10,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,115,85,115,105,110,103,80,111,111,108,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,84,104,114,101,97,100,80,111,111,108,74,111,98,42,32,106,111,98,84,111,82,101,109,111,118,101,32,61,32, + 112,111,111,108,46,103,101,116,74,111,98,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110, + 101,120,116,73,110,116,32,40,112,111,111,108,46,103,101,116,78,117,109,74,111,98,115,40,41,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,105,102,32,40,106,111,98,84,111,82,101,109,111,118,101,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,111,111,108,46,114,101,109,111,118,101,74,111,98,32,40,106,111,98,84,111,82, + 101,109,111,118,101,44,32,116,114,117,101,44,32,52,48,48,48,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108, + 101,116,101,32,106,111,98,84,111,82,101,109,111,118,101,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, + 32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,105,102,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,62,32,49,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,98,97,108, + 108,32,61,32,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,49,32,43,32,82,97,110,100,111,109,58,58,103,101,116,83,121, + 115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101, + 110,116,115,40,41,32,45,32,49,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,100,121,110,97, + 109,105,99,95,99,97,115,116,32,60,66,117,116,116,111,110,42,62,32,40,98,97,108,108,41,32,61,61,32,48,41,32,47,47,32,100,111,110,39,116, + 32,100,101,108,101,116,101,32,111,117,114,32,98,117,116,116,111,110,33,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,100,101,108,101,116,101,32,98,97,108,108,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13, + 10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,116,105,109,101,114,67,97,108,108,98,97,99,107,40,41,13,10,32,32,32,32, + 123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41, + 46,110,101,120,116,66,111,111,108,40,41,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32, + 40,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,60,61,32,49,48,41,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,97,100,100,65,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, + 32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,103,101,116,78,117,109, + 67,104,105,108,100,67,111,109,112,111,110,101,110,116,115,40,41,32,62,32,51,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 114,101,109,111,118,101,65,66,97,108,108,40,41,59,13,10,32,32,32,32,32,32,32,32,125,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,117,116,116,111,110,41,13,10,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73, + 116,101,109,32,40,49,44,32,84,40,34,85,115,101,32,111,110,101,32,116,104,114,101,97,100,32,112,101,114,32,98,97,108,108,34,41,44,32,116,114, + 117,101,44,32,33,32,105,115,85,115,105,110,103,80,111,111,108,41,59,13,10,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40, + 50,44,32,84,40,34,85,115,101,32,97,32,116,104,114,101,97,100,32,112,111,111,108,34,41,44,32,116,114,117,101,44,32,105,115,85,115,105,110,103, + 80,111,111,108,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,114,101,115,32,61,32,109,46,115,104,111,119, + 65,116,32,40,98,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,32,33,61,32,48,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,115,101,116,85,115,105,110,103,80,111,111,108,32,40,114,101,115,32,61,61,32,50,41,59,13,10,32,32,32, + 32,125,13,10,125,59,13,10,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,84,104,114,101,97,100,105, + 110,103,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,84,104,114,101,97,100,105,110,103,68,101,109, + 111,40,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::threadingdemo_cpp = (const char*) temp12; + +static const unsigned char temp13[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,140,0,0,0,86,8,6,0,0,0,29,101,126,119,0,0,0,9,112,72,89, + 115,0,0,11,19,0,0,11,19,1,0,154,156,24,0,0,0,4,103,65,77,65,0,0,177,142,124,251,81,147,0,0,0,32,99,72,82,77,0,0, + 122,37,0,0,128,131,0,0,249,255,0,0,128,233,0,0,117,48,0,0,234,96,0,0,58,152,0,0,23,111,146,95,197,70,0,0,59,48,73,68, + 65,84,120,218,98,100,160,30,96,68,195,76,72,24,89,140,17,77,223,63,32,254,143,70,255,67,226,195,212,12,58,160,163,163,192,112,252,248,20,6, + 38,38,102,134,55,111,62,50,240,240,112,50,176,178,178,48,252,249,243,7,136,255,49,48,2,125,202,206,206,6,246,198,143,31,191,24,254,3,125,35, + 38,38,204,240,244,233,75,6,102,102,38,134,159,63,127,51,60,124,248,146,129,139,139,157,97,235,214,19,12,143,30,189,98,48,53,85,103,200,204,156, + 128,213,190,89,179,138,24,230,205,219,193,16,23,231,6,182,251,247,239,191,12,2,2,60,12,191,126,253,102,48,48,80,97,248,242,229,59,208,158,159, + 12,188,188,220,96,243,65,118,130,0,19,19,35,3,27,27,43,208,77,127,25,62,124,248,204,32,44,204,15,118,203,185,115,183,24,56,57,217,193,248, + 196,137,171,12,147,39,111,96,40,43,139,96,72,75,235,133,235,69,7,0,1,196,66,165,132,2,75,8,204,72,152,9,137,141,45,65,49,64,19,4, + 58,254,11,197,127,160,9,229,47,84,253,255,193,154,112,70,18,0,8,32,22,10,18,9,3,82,9,194,12,53,11,134,33,137,132,145,145,153,135,139, + 139,131,135,137,129,79,130,157,89,76,137,147,133,239,195,31,166,223,172,204,76,204,223,127,253,248,7,148,254,247,135,145,241,247,163,207,95,223,255,98, + 102,251,244,241,231,207,47,63,126,254,250,5,53,31,148,80,126,67,19,14,114,226,249,135,148,184,70,1,157,1,64,0,177,80,80,162,48,33,37,16, + 54,36,54,147,58,31,187,132,190,176,128,150,40,195,31,25,35,17,110,77,101,182,223,42,66,172,255,20,152,153,126,113,178,75,112,252,102,98,97,96, + 249,245,150,241,223,159,95,255,254,254,253,199,244,251,219,23,158,119,31,24,217,95,221,254,202,117,235,236,135,159,87,175,252,102,60,127,237,237,167,103, + 223,127,255,253,137,84,218,252,134,98,228,210,103,52,209,208,25,0,4,16,11,137,9,133,17,169,186,97,5,98,118,104,98,97,226,224,226,226,209,226, + 100,81,12,22,102,117,52,227,254,229,166,166,240,95,147,75,150,139,157,149,7,168,64,138,143,129,153,135,141,129,137,157,153,129,153,139,133,129,145,153, + 145,225,239,247,191,12,255,254,254,99,248,247,243,47,195,159,15,191,36,255,190,255,161,109,242,138,193,209,255,41,243,159,167,175,254,61,188,41,37,113, + 250,228,95,174,131,203,110,63,62,249,229,231,175,55,64,181,32,123,126,65,49,35,82,105,51,154,112,232,8,0,2,136,133,196,82,133,25,169,68,1, + 37,22,14,102,96,43,207,94,90,66,39,77,150,63,90,155,227,131,163,160,224,55,17,97,123,25,6,118,5,30,6,70,78,86,104,139,4,24,159,255, + 128,248,47,144,243,23,88,56,252,254,207,192,12,52,129,25,212,42,4,38,36,118,9,110,80,203,12,28,239,255,127,252,101,17,123,246,69,89,245,234, + 71,101,187,187,31,195,35,4,101,206,46,121,243,103,225,154,59,207,246,125,248,241,235,27,52,193,124,135,210,191,209,26,206,163,128,198,0,32,128,136, + 73,48,200,13,90,88,66,1,151,44,138,226,226,146,9,50,66,193,190,252,31,35,100,245,222,74,243,26,9,51,176,137,202,48,48,130,34,31,216,90, + 103,120,253,17,90,123,252,7,165,14,160,14,94,6,6,110,49,96,146,99,135,152,252,27,24,255,191,190,48,48,124,254,4,140,114,160,58,22,62,6, + 70,22,38,6,14,121,126,6,14,21,1,6,190,247,223,24,249,206,189,51,41,59,249,85,219,138,85,116,235,212,231,223,231,157,125,241,238,38,212,45, + 63,160,9,231,55,82,21,197,48,154,112,104,11,0,2,136,133,200,146,133,5,90,5,113,2,49,23,63,63,63,119,172,170,180,71,24,251,151,4,5, + 241,215,58,226,126,226,12,108,192,72,102,248,241,15,92,122,48,124,127,3,140,82,160,114,41,29,160,106,41,96,41,34,15,212,41,7,76,48,146,192, + 4,194,198,240,255,205,107,160,90,96,98,145,6,38,30,30,110,6,70,182,175,12,12,183,22,51,48,60,61,4,180,13,152,168,190,255,1,39,7,54, + 96,119,79,196,89,154,65,64,239,59,39,255,158,231,33,58,87,24,172,151,243,139,77,157,245,240,253,134,175,63,126,195,170,198,239,80,119,254,129,86, + 83,116,3,90,90,10,12,255,128,37,39,184,112,28,33,0,32,128,88,8,148,44,76,72,85,16,40,177,112,178,178,177,113,149,104,43,36,68,178,63, + 43,16,117,227,97,225,53,82,97,96,4,69,211,7,104,124,253,1,70,190,146,7,3,131,124,48,195,255,23,192,4,116,15,88,32,252,249,195,240,255, + 246,78,6,134,199,64,246,219,151,12,255,63,188,4,138,1,227,153,79,132,129,129,87,152,129,81,223,137,129,41,174,10,82,56,60,61,2,76,154,60, + 208,18,8,168,255,215,63,96,193,195,193,32,22,169,194,192,113,246,149,100,230,182,23,77,50,236,34,178,181,55,223,206,248,246,243,23,44,65,35,131, + 191,244,42,101,242,243,131,193,99,27,44,44,44,35,38,193,0,4,16,11,129,6,46,72,158,3,86,178,136,10,9,10,149,42,11,39,4,138,60,73, + 148,13,145,100,97,147,1,150,42,159,127,67,218,39,160,56,250,11,76,4,134,165,64,182,37,195,191,169,93,12,255,15,111,0,202,1,171,37,198,255, + 144,10,3,220,10,2,22,12,160,0,102,7,26,255,245,57,3,195,167,39,12,255,175,93,96,248,247,250,57,3,83,94,50,3,195,51,96,130,249,15, + 29,114,249,243,13,82,85,129,74,46,160,62,62,19,80,149,199,201,20,188,252,65,58,219,127,33,158,170,59,239,39,124,254,254,243,3,90,87,255,63, + 189,218,52,223,190,253,28,113,85,18,64,0,177,224,72,44,176,198,45,59,44,177,136,9,241,11,53,107,201,20,120,138,60,137,146,142,87,96,96,226, + 2,166,163,143,191,160,73,11,72,252,250,12,172,98,172,24,254,179,0,19,75,158,31,3,195,155,59,12,12,130,64,53,140,220,144,4,192,200,136,105, + 19,27,11,68,156,253,55,195,255,203,59,128,49,144,199,192,32,160,12,108,251,92,1,138,241,49,48,200,58,48,48,136,153,1,93,2,44,224,94,28, + 7,150,80,251,25,56,36,88,25,164,146,85,24,252,22,221,143,254,253,95,248,87,221,189,247,83,191,124,251,142,62,248,55,218,237,166,17,0,8,32, + 38,60,189,33,88,53,196,205,203,203,45,80,161,44,150,234,204,254,40,82,60,88,134,129,137,19,152,16,190,253,65,77,4,255,129,241,195,175,192,192, + 112,227,2,48,177,220,5,70,52,176,45,194,8,77,143,216,18,11,92,223,127,136,181,255,25,33,205,215,255,64,66,64,150,129,193,102,6,208,230,88, + 96,41,245,138,225,255,238,251,12,255,185,162,24,24,236,129,98,127,249,129,53,214,47,6,241,112,89,6,95,137,111,177,69,178,124,49,192,210,7,152, + 42,25,120,160,238,101,67,234,250,51,210,42,224,128,205,56,6,54,96,130,255,63,194,146,36,64,0,177,224,40,93,88,161,85,17,15,19,11,11,119, + 153,186,116,156,47,223,171,100,153,24,25,70,54,49,96,188,124,3,54,19,254,1,91,165,127,128,152,137,25,146,153,255,1,171,143,47,207,128,9,197, + 6,168,147,3,210,149,38,182,199,254,15,168,159,157,139,225,63,211,79,6,70,94,25,6,6,245,2,134,255,139,150,50,252,91,213,3,52,255,55,164, + 156,88,197,205,192,20,211,194,192,232,63,143,129,225,88,38,3,187,200,11,6,133,20,5,150,132,149,79,50,31,255,19,123,62,255,246,243,237,12,152, + 243,80,52,27,17,238,237,205,97,208,212,148,103,248,253,251,15,120,46,102,164,0,128,0,98,193,147,88,64,185,150,35,68,73,194,201,159,227,117,146, + 84,144,4,19,187,172,0,48,81,0,235,237,63,192,174,176,152,46,176,202,240,4,170,146,135,36,150,251,235,192,189,28,70,147,16,6,70,73,29,134, + 255,207,207,1,147,27,23,180,125,67,160,31,246,239,47,3,35,23,23,48,177,0,19,163,92,37,195,255,249,115,24,254,173,104,103,96,16,226,2,13, + 9,66,27,192,191,25,254,77,47,100,96,124,255,26,216,64,238,101,96,56,152,192,192,2,116,142,180,175,4,123,214,179,39,37,143,165,4,222,237,121, + 246,225,40,3,98,46,138,198,137,102,100,78,107,1,4,16,19,150,4,3,42,210,185,64,197,187,190,140,152,122,150,48,115,150,140,13,23,15,151,134, + 16,48,177,0,115,251,79,96,91,69,209,157,129,65,165,137,225,223,241,79,12,255,102,0,75,130,13,192,106,72,22,216,203,49,169,6,182,107,142,48, + 48,166,86,2,195,147,25,220,59,34,10,0,115,41,131,28,176,237,34,105,204,240,127,239,65,134,127,203,58,161,237,31,102,72,149,5,194,172,192,116, + 44,192,201,240,127,69,27,195,255,237,251,25,24,76,27,129,13,230,79,12,108,178,188,12,138,86,92,162,133,82,156,105,124,156,236,18,48,183,35,85, + 77,84,175,150,216,217,89,25,20,20,196,193,165,203,72,3,0,1,196,132,165,116,97,7,7,58,19,19,79,12,247,255,64,21,217,207,42,2,118,192, + 106,226,43,48,211,254,124,207,192,32,101,196,240,95,36,150,225,95,77,18,195,255,137,192,170,99,239,60,134,255,11,107,25,254,101,185,48,252,191,5, + 212,42,99,207,192,104,164,206,192,232,16,6,140,208,239,68,68,215,127,112,19,149,81,223,158,129,225,253,51,134,127,139,90,129,46,248,15,25,199,65, + 46,24,64,137,6,212,195,18,224,96,248,55,179,24,216,77,7,230,112,195,92,160,29,239,24,248,109,36,25,84,133,191,153,186,138,240,152,193,186,255, + 12,136,249,45,170,183,101,108,109,117,25,156,157,45,192,203,9,70,26,0,8,32,38,36,26,185,161,203,105,38,204,167,225,40,198,226,33,236,34,6, + 108,187,2,165,126,3,219,43,124,192,12,172,10,76,36,125,13,12,255,175,3,123,45,226,192,42,132,31,216,184,21,229,97,248,255,229,33,195,191,150, + 56,134,127,135,111,49,48,240,170,50,48,70,151,48,48,8,11,3,245,253,196,223,232,5,149,66,108,192,210,68,207,142,225,223,166,89,12,12,207,129, + 13,102,78,104,207,10,75,218,2,39,36,150,191,12,255,250,243,129,250,156,24,24,68,12,25,88,184,255,50,136,90,8,49,68,11,50,70,137,241,241, + 136,34,37,26,86,90,148,50,30,30,230,12,191,126,125,3,175,51,25,105,0,32,128,152,144,122,70,136,210,5,72,251,10,176,122,41,104,51,8,115, + 40,10,66,70,94,65,3,114,250,69,12,255,246,159,102,248,127,122,11,48,162,184,161,173,131,255,16,154,7,216,13,230,252,203,240,191,63,135,225,255, + 242,201,12,140,42,250,192,68,3,172,162,190,253,6,183,81,112,130,31,63,24,24,21,13,129,145,207,198,240,127,7,176,65,203,197,70,184,87,5,74, + 80,175,238,51,252,219,186,26,152,128,129,189,167,47,63,24,4,204,69,25,76,181,152,116,2,196,184,29,145,134,3,216,105,81,202,128,26,185,255,255, + 143,204,30,59,64,0,161,207,19,129,90,152,172,186,194,124,170,206,18,140,118,124,230,66,144,17,141,31,159,128,173,75,75,96,196,235,48,48,44,239, + 2,150,32,160,72,69,235,145,131,186,213,172,64,113,54,70,134,127,211,202,24,254,111,158,201,192,20,146,207,192,104,237,205,192,240,249,27,246,68,0, + 18,2,117,165,173,128,141,231,179,187,24,24,94,60,134,152,65,40,50,64,242,92,64,251,79,108,6,38,5,57,160,171,129,133,10,11,35,131,152,147, + 8,147,63,239,55,15,17,14,86,113,104,98,225,128,102,4,170,37,24,97,97,190,17,89,178,192,0,64,0,33,15,255,195,74,24,78,123,94,54,11, + 69,69,22,73,86,41,96,149,3,90,170,199,2,84,162,153,1,108,220,46,102,248,255,234,17,48,26,216,113,84,25,255,33,114,192,200,252,55,173,156, + 225,255,165,195,12,76,249,83,24,24,37,20,128,37,205,87,204,68,3,170,142,4,128,85,158,186,62,195,255,125,171,33,19,148,196,2,96,194,250,255, + 226,26,195,255,71,192,68,198,13,44,5,191,253,98,96,1,186,87,85,146,89,83,157,141,73,141,1,177,244,130,21,234,63,138,99,89,80,144,135,97, + 193,130,10,6,62,62,174,17,91,194,0,4,16,19,218,168,46,7,31,7,7,176,217,194,102,206,165,12,12,103,102,160,240,175,143,224,17,215,255,31, + 248,24,254,111,155,14,108,199,176,224,47,1,64,221,104,208,56,204,143,143,12,255,38,229,0,35,83,0,216,107,106,3,38,142,255,144,82,8,150,176, + 64,209,247,21,88,29,153,186,2,35,251,35,195,255,59,231,129,250,56,137,119,57,168,132,251,7,44,158,126,124,129,118,205,255,49,48,177,50,51,240, + 136,179,178,121,72,241,25,1,5,57,145,74,24,170,12,228,153,152,168,51,168,171,203,128,215,226,142,84,0,16,64,76,72,237,23,240,210,5,101,110, + 118,25,57,222,255,42,236,114,188,144,238,46,104,88,94,41,138,225,255,198,249,192,46,243,107,160,10,14,194,163,26,160,68,195,3,44,157,110,93,1, + 246,164,114,129,61,166,96,6,70,39,96,91,227,227,87,200,186,23,208,92,18,168,199,195,196,204,192,104,235,203,240,255,216,14,200,200,9,177,211,190, + 224,169,8,96,15,69,72,5,216,107,3,54,196,191,189,134,183,109,5,244,5,24,116,4,88,13,57,217,217,249,145,74,25,88,9,67,81,130,81,86, + 150,2,207,31,49,50,142,220,42,9,32,128,152,208,186,211,108,214,50,162,26,130,252,127,248,89,69,56,33,75,16,68,13,128,61,32,96,233,114,112, + 5,48,17,176,146,22,230,252,92,12,255,118,47,97,248,183,115,49,3,83,124,21,3,179,148,28,3,179,0,176,113,44,46,193,240,143,23,72,91,184, + 49,48,74,43,50,48,221,60,2,44,137,136,72,136,32,187,65,137,234,55,176,154,252,242,159,129,209,47,3,216,131,123,0,100,191,1,138,131,74,195, + 63,12,156,138,252,12,138,66,127,228,204,101,196,229,25,80,151,143,82,212,91,146,145,17,101,72,76,244,24,145,93,105,100,0,16,64,24,171,232,228, + 153,254,40,242,74,178,48,48,129,86,203,253,249,13,78,48,12,55,46,51,48,188,121,6,84,193,206,64,210,228,9,176,4,249,207,193,198,240,111,58, + 176,11,252,249,37,195,67,159,28,134,162,83,239,24,12,215,61,98,16,93,246,152,65,115,213,117,134,234,186,122,134,39,160,201,104,113,113,134,255,184, + 74,24,80,35,19,132,65,83,17,239,128,13,240,111,76,12,76,105,61,12,76,46,192,154,231,194,36,160,102,46,72,159,27,52,29,193,193,204,32,40, + 194,204,41,201,193,42,5,205,8,172,212,232,94,255,253,251,15,88,186,252,26,209,165,11,8,0,4,16,11,82,131,151,149,133,141,157,75,136,233,143, + 40,155,40,43,98,132,21,216,3,249,127,249,20,98,86,154,148,4,3,82,11,76,100,44,108,204,12,87,167,214,50,68,157,254,201,112,233,198,55,184, + 244,199,123,15,24,218,128,120,181,0,59,195,2,55,25,6,43,126,126,134,63,239,63,0,173,129,218,13,234,142,131,150,117,254,6,141,48,3,53,136, + 74,48,48,26,88,50,48,121,69,3,171,73,96,252,31,205,132,148,54,156,66,208,210,9,226,54,14,118,70,22,177,255,191,164,144,252,198,204,128,186, + 71,138,164,22,171,142,142,34,3,43,176,125,244,23,228,22,6,150,17,157,96,0,2,136,5,169,132,97,21,226,229,225,230,103,102,228,7,151,46,255, + 161,93,101,240,114,107,38,72,247,26,148,203,97,99,47,132,27,26,160,21,186,12,255,129,237,149,247,252,98,12,89,155,47,48,92,122,250,21,171,202, + 219,31,126,50,228,28,124,206,176,219,67,156,129,239,215,15,240,216,13,35,43,208,78,80,181,197,39,204,192,32,167,206,192,104,236,196,192,232,24,201, + 192,40,10,76,7,223,143,3,75,61,96,21,41,1,44,253,64,203,97,222,223,3,186,9,180,206,134,7,156,168,57,68,216,24,164,25,255,74,48,113, + 112,112,254,251,241,227,51,165,85,18,104,115,217,203,151,239,193,139,165,70,58,0,8,32,22,164,110,53,51,31,7,59,23,31,203,31,94,54,208,36, + 32,168,87,3,154,203,121,115,137,129,209,45,144,225,255,110,96,163,247,45,48,114,184,217,32,189,39,144,28,56,248,255,65,26,185,176,68,4,79,76, + 255,193,187,2,152,57,217,25,118,63,254,204,112,8,71,98,129,129,243,47,191,49,172,122,202,202,144,105,23,196,240,91,92,133,129,73,89,139,129,145, + 31,152,88,152,217,24,24,5,128,165,220,47,96,17,115,249,24,144,254,4,196,192,4,245,93,153,225,191,128,41,3,147,148,40,3,131,42,80,238,218, + 20,6,134,15,192,46,54,151,16,48,229,51,51,40,113,51,72,137,11,240,241,62,127,241,227,45,3,98,67,29,89,9,6,212,43,2,85,73,163,128, + 129,1,32,128,88,144,138,106,230,255,255,255,51,179,241,48,49,177,10,177,65,218,3,108,192,132,243,112,47,3,163,149,43,3,83,235,6,134,255,75, + 187,25,254,63,185,2,236,14,191,7,134,226,23,200,178,4,80,187,131,157,5,210,155,98,99,101,96,100,231,102,248,15,234,93,49,178,51,252,231,6, + 150,16,242,10,12,219,182,93,33,202,49,135,88,101,25,50,67,114,129,118,0,27,178,15,174,49,252,59,119,128,129,225,245,19,6,198,223,63,25,254, + 127,7,54,54,191,1,219,47,44,144,46,249,127,112,175,138,133,225,47,176,219,206,96,31,201,192,20,94,199,192,120,165,14,232,238,207,12,140,192,42, + 144,129,249,31,200,15,172,12,168,59,49,241,86,73,220,192,134,247,215,175,63,70,83,5,30,0,16,64,200,221,77,38,54,38,70,86,102,22,96,75, + 149,25,22,166,76,144,241,142,147,192,200,208,78,102,96,108,234,100,248,255,238,51,164,1,252,230,45,164,20,226,3,182,31,68,36,64,43,182,193,51, + 202,140,192,72,252,15,140,216,255,64,189,140,28,60,12,255,217,217,25,62,95,200,99,96,56,123,159,160,99,222,92,63,203,240,191,55,158,225,207,157, + 251,12,140,224,113,21,144,11,129,13,103,112,239,8,24,231,124,156,136,248,6,181,167,64,37,27,104,156,104,213,100,134,255,34,114,12,140,150,1,192, + 174,252,44,96,161,196,194,240,129,225,247,215,47,191,126,255,37,118,12,70,65,65,130,97,225,194,10,6,103,231,226,209,170,7,15,0,8,32,22,164, + 65,250,255,34,172,76,188,220,191,127,112,253,7,70,6,35,100,52,12,148,140,32,244,153,118,96,162,152,196,192,168,234,207,192,96,148,10,140,6,121, + 134,255,79,239,50,48,220,187,8,44,13,174,67,22,119,63,186,206,240,255,213,83,134,255,63,190,3,75,128,191,12,127,64,123,144,120,217,24,100,158, + 61,33,202,49,226,156,140,12,191,129,250,254,113,115,65,218,75,56,219,166,140,136,222,19,104,92,136,27,216,40,126,114,13,200,118,3,175,31,254,7, + 76,200,140,191,126,48,51,254,253,131,126,24,0,214,177,24,49,49,1,134,141,27,155,25,68,69,5,71,19,11,1,0,16,64,40,11,168,190,254,103, + 252,245,243,15,243,223,127,191,129,109,15,14,88,33,3,12,223,31,239,33,221,107,45,96,175,228,45,7,195,255,233,211,25,254,159,223,193,240,255,205, + 99,200,158,34,216,234,58,164,188,12,42,21,64,109,230,63,124,252,12,142,226,124,12,147,136,232,97,57,203,242,50,252,248,14,108,159,0,75,142,255, + 196,110,221,128,141,30,203,169,50,64,214,73,252,101,248,245,238,47,168,243,244,255,47,68,14,57,145,96,36,22,121,121,113,134,29,59,186,24,20,21, + 37,192,167,39,140,2,252,0,32,128,144,19,12,211,227,247,31,63,189,20,227,126,255,231,253,47,65,102,65,96,241,15,202,160,160,53,48,226,38,12, + 12,6,221,12,255,22,207,102,248,191,121,26,176,13,243,22,50,249,7,154,40,4,173,170,99,68,138,15,120,227,23,50,226,251,27,152,248,76,133,89, + 25,34,53,133,24,150,95,123,139,211,33,118,146,156,12,14,18,236,12,63,222,190,102,224,98,36,161,117,10,181,143,81,76,22,152,176,95,128,221,242, + 231,235,31,96,149,196,242,229,199,239,63,255,208,218,44,40,41,86,86,86,140,97,215,174,110,6,53,53,25,134,215,175,63,142,232,73,69,98,1,64, + 0,177,32,5,228,255,215,31,191,124,127,243,139,227,227,95,208,110,0,112,23,26,88,212,179,113,51,48,232,86,51,252,155,221,195,240,127,229,36,6, + 6,33,96,195,66,152,23,181,123,13,143,134,255,104,227,109,192,138,13,88,197,176,124,249,194,80,162,193,195,240,230,63,15,195,238,123,47,129,137,16, + 181,97,105,98,106,198,208,98,38,196,192,113,247,16,176,128,98,34,45,226,254,2,75,36,94,81,6,70,69,13,96,47,233,8,3,168,225,243,231,235, + 23,134,215,63,255,124,248,251,235,215,31,44,245,26,152,47,41,41,196,176,115,103,55,131,146,146,52,195,167,79,95,25,24,71,211,10,81,0,32,128, + 152,24,16,107,94,65,253,227,191,47,152,121,94,254,249,249,31,210,251,1,173,129,145,182,6,246,90,62,48,252,223,58,25,88,217,115,65,218,12,200, + 221,104,60,173,12,80,188,179,2,99,226,223,251,55,12,194,192,58,102,202,148,73,12,253,254,38,12,94,242,220,12,150,210,60,12,110,10,124,12,157, + 230,194,12,11,188,213,25,228,99,75,129,213,144,0,3,235,159,159,144,132,70,172,15,126,0,19,181,146,62,48,17,179,51,48,188,187,10,238,157,125, + 123,247,155,225,29,3,203,103,6,212,61,74,240,181,189,114,114,226,12,123,247,246,49,104,106,202,50,124,251,246,125,196,143,222,146,2,0,2,176,114, + 245,42,17,196,64,120,50,73,60,214,221,205,33,200,117,250,26,130,149,173,141,118,190,193,21,247,22,182,231,139,248,8,87,249,28,214,119,219,184,90, + 136,39,194,178,183,201,248,101,179,224,54,130,11,22,97,32,132,252,205,144,249,230,99,38,241,133,241,163,22,170,214,214,95,187,15,114,61,219,138,174, + 226,28,192,118,155,74,96,99,154,67,248,27,73,26,117,192,210,7,57,52,107,60,201,213,29,249,247,87,186,221,63,211,245,197,41,125,122,166,66,11, + 205,96,32,135,167,71,226,124,78,217,242,158,204,195,10,6,211,66,239,246,119,208,43,244,195,60,99,139,234,242,6,110,18,161,123,243,70,190,203,105, + 255,210,180,213,65,215,35,131,241,24,234,181,214,178,88,156,200,102,179,134,27,58,27,94,22,53,120,54,153,92,50,18,134,187,96,214,170,40,50,118, + 46,83,198,88,213,117,29,130,188,132,173,172,61,146,200,92,91,107,4,238,57,164,165,228,95,178,35,18,44,4,200,199,180,81,26,163,85,89,230,218, + 185,99,28,139,99,25,140,74,227,20,214,183,18,153,106,31,63,88,97,14,144,146,184,165,105,27,249,22,64,44,12,136,131,122,192,248,232,227,103,15, + 159,242,51,127,21,121,253,157,155,149,157,9,178,157,4,212,86,97,98,32,121,161,60,35,176,136,97,254,254,157,129,77,70,133,129,211,59,138,225,223, + 220,42,134,239,160,29,40,172,140,12,2,108,144,54,14,51,11,43,3,187,172,36,3,211,190,5,12,12,170,189,12,172,197,64,188,8,216,141,23,230, + 135,110,97,193,2,128,61,153,191,159,190,48,48,124,255,6,158,46,96,176,112,98,96,120,212,5,172,62,153,25,126,60,252,194,240,244,11,199,235,43, + 239,62,191,128,249,13,88,162,48,197,197,185,114,185,185,153,50,105,107,43,114,8,9,9,1,195,23,114,180,23,35,120,30,130,233,63,43,235,119,80, + 59,6,182,185,31,47,0,245,164,128,181,29,19,63,63,55,208,44,62,150,23,47,222,242,156,63,127,71,233,235,215,31,18,63,127,254,18,252,249,243, + 183,0,208,2,112,243,159,153,153,233,15,59,59,235,91,14,14,246,247,124,124,220,207,140,141,85,239,139,136,240,255,4,170,253,249,237,219,143,159,160, + 200,38,167,128,3,37,2,144,59,128,102,51,11,8,112,115,112,114,114,49,61,123,246,88,232,226,197,59,234,223,190,253,20,253,241,227,151,40,80,30, + 214,117,1,29,89,246,137,147,147,253,13,55,55,251,43,11,11,237,155,192,140,243,21,216,59,252,243,253,251,207,31,255,192,41,159,56,71,0,4,16, + 114,130,1,159,130,240,224,231,239,215,247,190,242,61,82,191,245,94,147,213,68,144,129,225,205,101,96,163,215,154,129,129,147,7,50,183,131,43,18,113, + 213,121,95,254,48,176,199,37,51,236,60,113,146,225,192,166,195,12,44,156,28,64,11,191,65,124,1,244,52,51,180,41,164,199,203,197,16,180,162,139, + 129,181,110,41,195,57,183,92,134,117,179,39,49,176,114,112,161,164,127,240,142,123,160,223,100,121,89,25,162,164,248,24,184,223,1,27,228,118,1,12, + 140,124,192,68,253,234,12,176,11,207,195,240,237,238,99,134,91,63,152,30,188,248,244,245,19,200,95,192,92,247,215,203,203,156,239,217,179,183,145,19, + 38,172,149,102,103,103,249,13,140,76,70,164,128,255,15,12,52,246,152,24,151,35,42,42,50,43,112,37,24,72,9,244,31,116,30,29,179,181,181,54, + 251,207,159,63,133,118,236,56,173,177,111,223,57,247,107,215,30,152,0,19,140,44,48,199,10,1,149,242,162,117,38,96,59,49,223,3,19,205,59,51, + 51,141,251,250,250,74,7,34,34,156,118,169,168,72,61,83,82,146,122,255,242,229,251,63,164,148,57,80,149,76,202,202,82,108,194,194,252,194,91,182, + 28,215,171,173,157,239,125,229,202,3,147,203,151,239,129,230,208,132,25,32,107,129,144,251,154,160,56,254,4,244,239,123,43,43,173,39,42,42,210,71, + 226,227,61,182,233,233,41,221,253,253,251,207,59,160,245,191,129,238,255,15,74,59,248,18,48,64,0,193,18,12,252,132,167,47,255,24,62,159,252,203, + 115,199,249,213,87,77,96,140,1,219,5,55,24,24,149,128,246,170,152,49,48,220,216,199,192,192,205,67,92,41,6,178,21,88,186,48,73,43,51,48, + 57,6,50,236,204,201,100,152,114,21,20,135,159,176,42,143,209,18,98,8,22,5,182,153,166,150,49,156,85,242,98,104,187,8,106,130,124,198,170,214, + 66,146,155,33,72,82,152,129,135,95,136,225,191,127,10,3,195,227,141,96,231,255,251,246,143,225,253,195,191,127,119,188,248,118,9,216,221,6,181,172, + 127,113,115,115,252,5,118,157,57,167,77,219,232,245,248,241,43,19,92,206,85,86,150,6,150,68,18,171,176,141,4,131,138,114,96,143,138,81,94,94, + 130,19,88,245,240,239,218,117,198,177,167,103,101,200,237,219,79,220,128,129,204,77,112,82,13,50,1,42,246,227,199,79,177,67,135,46,106,0,177,231, + 188,121,219,243,156,156,12,87,149,150,70,172,85,87,151,185,46,37,37,242,25,88,50,252,198,55,14,4,58,4,17,88,162,129,26,236,108,170,170,210, + 252,23,46,220,53,8,9,105,204,184,114,229,190,59,48,210,9,185,3,148,55,5,129,9,67,240,232,209,171,74,64,108,183,114,229,129,116,59,59,189, + 77,85,85,49,11,61,61,205,175,8,11,243,125,126,247,238,211,175,127,120,154,29,0,1,196,194,128,122,28,216,47,96,15,230,231,209,87,111,111,62, + 187,205,224,36,252,237,55,55,195,127,208,2,240,135,12,76,206,17,12,255,46,2,19,12,215,127,226,166,100,64,99,32,192,210,229,95,114,22,100,228, + 247,206,5,252,161,10,234,130,243,240,48,48,190,188,201,240,247,238,107,252,165,22,208,236,63,159,191,50,252,11,44,100,96,18,3,58,251,208,6,96, + 190,22,98,248,117,245,3,195,229,167,127,31,28,255,252,235,46,212,95,191,128,57,234,47,40,194,89,88,152,240,142,200,1,171,8,166,23,47,222,193, + 166,18,224,39,64,128,78,198,116,118,54,102,1,150,64,60,192,8,82,203,204,236,207,62,120,240,98,24,52,7,147,13,128,246,73,111,222,124,188,16, + 152,248,130,83,82,188,167,53,55,39,46,251,240,225,203,251,53,107,14,126,193,217,33,252,251,143,177,169,41,129,83,92,92,80,180,172,108,86,210,210, + 165,123,178,128,98,34,228,186,1,88,109,9,3,237,79,220,189,251,172,87,118,118,192,132,210,210,176,149,95,190,252,120,109,98,162,254,245,232,209,43, + 88,83,13,64,0,49,33,85,71,160,5,4,160,92,249,247,228,203,183,247,118,62,101,187,244,241,216,43,96,2,1,134,203,221,181,12,140,118,142,12, + 140,114,234,64,85,223,25,8,86,186,160,30,214,7,96,105,97,228,192,240,223,39,137,225,231,190,149,12,127,191,227,159,124,4,21,115,191,254,252,99, + 248,201,193,206,240,251,35,254,4,243,15,216,45,255,107,21,206,240,207,59,140,225,223,217,22,96,218,4,205,27,49,50,188,61,245,158,97,221,139,95, + 167,63,252,248,245,158,1,114,66,213,15,96,23,29,124,10,231,255,255,12,120,135,2,129,213,18,211,219,183,159,80,86,230,129,246,78,183,183,167,176, + 2,171,15,209,222,222,213,1,126,126,213,75,129,137,37,142,210,196,130,12,128,237,29,185,169,83,55,180,5,7,55,244,190,122,245,65,53,40,200,142, + 223,211,211,12,35,128,99,99,221,152,252,253,173,248,126,252,248,173,25,30,222,212,182,104,209,174,90,74,18,11,90,117,43,62,101,202,250,182,240,240, + 230,150,47,95,190,171,206,157,91,202,99,110,174,137,53,146,1,2,136,9,169,74,250,5,77,48,63,128,38,252,88,251,238,207,241,123,71,62,253,252, + 5,58,76,227,243,45,200,146,2,183,84,32,251,31,254,2,6,212,151,254,10,76,28,98,138,12,140,37,253,12,255,128,9,229,207,165,195,12,255,64, + 59,23,241,37,130,255,144,142,24,232,72,152,63,172,248,247,42,255,151,80,5,38,150,40,134,255,215,187,24,254,191,189,201,192,200,207,199,240,237,202, + 91,134,51,55,254,62,217,243,254,215,101,168,127,64,13,216,159,192,18,230,15,49,221,102,96,196,49,127,253,250,29,190,12,2,52,17,217,221,157,193, + 22,22,230,32,90,87,55,47,164,182,118,222,212,55,111,62,170,208,106,120,99,255,254,243,161,65,65,117,83,174,94,125,96,208,209,145,202,239,232,104, + 0,119,180,156,156,24,67,122,186,15,231,147,39,111,212,146,146,58,187,143,29,187,26,197,64,253,29,157,140,39,78,92,139,138,137,105,237,2,150,116, + 74,157,157,233,60,160,1,77,116,0,16,64,176,18,230,15,82,41,3,62,63,238,196,139,183,15,246,190,103,63,247,229,40,168,148,1,182,91,46,207, + 96,96,114,7,150,50,198,46,192,102,200,103,236,165,12,51,19,100,119,192,95,30,6,166,220,54,6,70,41,96,151,239,202,49,134,127,111,159,50,252, + 99,97,37,88,194,128,11,138,255,12,132,87,228,115,179,51,252,187,61,153,225,255,211,195,12,140,188,194,12,127,191,253,97,120,190,231,37,195,214,55, + 127,78,190,250,254,243,45,3,226,56,179,159,192,46,228,111,96,79,5,100,36,35,254,46,242,63,70,96,162,129,171,41,44,12,97,13,15,119,20,236, + 233,89,21,0,108,44,55,49,64,246,107,209,20,0,27,230,86,101,101,51,171,128,93,98,185,204,76,63,46,72,162,96,100,0,86,23,236,192,106,72, + 172,180,116,102,222,173,91,79,28,105,233,134,219,183,159,186,148,151,207,202,149,146,18,18,139,143,119,103,67,151,7,8,32,88,9,243,27,41,144,65, + 75,226,128,13,132,191,95,150,190,248,122,242,238,177,143,95,127,222,3,10,255,1,150,242,143,231,48,48,149,79,102,96,20,146,7,170,248,12,169,122, + 96,9,7,52,171,253,13,168,245,47,59,80,205,108,6,70,96,94,252,255,244,28,195,255,27,151,24,254,253,254,78,176,119,5,63,181,249,63,225,54, + 245,255,207,15,129,248,9,195,127,118,96,167,4,216,245,127,187,227,17,195,233,231,92,119,86,191,253,121,22,154,232,191,66,241,119,96,149,244,27,216, + 83,250,71,168,144,1,245,156,128,13,78,112,117,4,236,246,50,6,4,88,115,3,123,65,86,253,253,107,90,128,98,2,36,134,251,95,164,118,33,73, + 3,29,55,111,62,118,171,171,155,159,47,35,35,198,165,169,41,199,0,116,7,11,176,65,42,92,85,53,39,227,216,177,43,49,68,118,185,63,243,241, + 113,221,7,246,132,206,233,232,40,156,86,83,147,61,11,236,210,223,7,138,127,34,70,63,176,218,77,156,52,105,125,88,96,160,173,128,139,139,49,74, + 196,1,4,16,11,3,226,244,109,88,162,129,5,54,247,133,15,223,238,207,121,43,180,167,98,215,75,127,197,116,96,10,120,178,155,129,65,200,128,129, + 177,114,33,195,255,154,64,96,71,17,152,136,56,160,171,240,64,163,195,194,82,12,76,133,115,24,24,117,128,61,203,131,233,12,12,198,157,12,255,30, + 109,99,160,194,130,125,180,100,206,2,94,199,203,196,251,157,225,243,185,103,12,119,47,252,251,60,237,19,235,174,15,223,64,179,164,224,4,255,5,169, + 132,1,214,134,44,127,9,57,0,188,34,244,31,164,187,29,17,225,200,6,108,252,169,2,171,161,74,96,34,18,36,198,73,28,28,108,239,36,37,133, + 47,1,139,241,187,192,200,122,7,140,156,31,80,59,57,128,109,35,145,107,215,30,106,189,126,253,65,7,104,30,222,146,10,216,19,59,174,171,171,116, + 6,88,53,113,128,70,223,92,92,140,216,129,93,101,227,213,171,15,198,17,114,3,176,26,125,14,236,38,239,5,118,183,175,1,253,253,18,88,178,62, + 7,250,11,212,240,103,249,245,235,55,232,160,2,41,96,207,206,224,194,133,59,174,191,126,253,193,231,47,166,25,51,54,229,0,123,80,103,188,189,45, + 142,31,56,112,225,43,208,221,224,132,15,16,64,44,72,153,27,86,37,193,2,156,11,24,130,156,179,30,190,63,36,197,194,43,156,185,230,129,141,168, + 159,12,3,227,149,73,12,140,166,77,12,76,253,123,25,254,45,239,96,96,184,127,9,60,127,195,168,227,192,192,20,2,108,227,176,1,219,59,7,74, + 32,37,15,171,8,3,227,199,15,144,118,13,85,107,92,96,11,150,139,153,225,235,189,79,12,143,182,188,253,219,251,154,123,235,225,7,207,111,64,19, + 201,23,104,130,7,31,209,10,26,253,100,103,103,35,234,200,15,208,212,19,63,63,55,147,141,141,46,47,176,7,226,3,236,134,155,18,28,200,98,97, + 254,102,100,164,186,222,192,64,121,255,207,159,127,94,191,126,253,241,221,139,23,239,129,221,227,63,255,65,109,39,144,253,252,252,60,28,126,126,150,66, + 192,110,177,204,225,195,151,131,129,145,102,141,54,86,3,90,98,113,3,24,65,43,140,140,212,246,191,123,247,249,30,176,219,254,17,88,42,176,25,27, + 171,75,166,164,116,103,0,149,72,224,11,16,96,73,178,19,232,238,213,31,62,124,125,112,243,230,147,79,111,222,124,248,3,108,68,255,1,118,213,255, + 179,179,179,50,1,187,204,47,164,164,132,175,1,75,157,51,134,134,170,123,129,189,163,248,251,247,159,91,225,25,156,148,154,54,109,67,100,79,79,230, + 13,13,13,185,159,192,174,59,120,124,10,32,128,144,19,204,31,164,54,204,23,6,216,217,118,255,255,178,78,125,241,115,191,210,49,86,9,79,230,167, + 42,34,33,114,12,12,39,170,129,85,78,56,3,115,126,5,80,7,27,195,127,208,80,254,47,96,124,61,233,101,96,120,113,26,178,124,147,133,3,58, + 194,68,214,186,107,252,69,46,43,51,195,175,23,192,196,178,254,229,223,233,175,185,247,172,189,247,252,12,208,252,159,208,129,155,79,72,37,204,47,96, + 149,196,12,236,82,19,156,252,2,201,130,46,149,0,70,62,7,48,146,229,129,57,58,156,144,59,184,184,56,158,250,250,90,206,228,229,229,58,117,228, + 200,149,119,192,4,246,253,243,103,208,86,209,255,200,7,51,130,70,123,89,128,165,206,91,77,77,249,151,94,94,230,247,110,221,146,186,176,103,207,185, + 248,223,191,255,8,0,205,120,98,105,169,181,93,67,67,118,23,176,36,122,56,111,222,246,55,247,238,61,255,14,108,83,253,171,173,141,229,62,117,234, + 186,62,176,116,114,193,231,14,99,99,181,117,192,196,54,23,216,24,126,7,44,61,62,2,219,98,63,25,144,142,109,3,118,159,25,159,62,125,195,4, + 196,172,151,46,221,251,108,97,161,245,209,199,199,242,221,182,109,199,255,220,189,251,220,14,151,185,199,143,95,243,62,123,246,246,202,132,4,143,119,37, + 37,211,193,9,6,32,128,88,144,219,156,72,213,210,55,104,224,131,119,14,190,254,242,253,85,195,115,150,245,252,71,24,163,237,120,158,73,241,187,73, + 51,48,222,91,14,44,93,54,130,215,208,50,254,1,186,239,251,59,72,87,7,116,2,38,168,189,242,247,43,164,221,3,58,151,8,52,105,204,200,76, + 76,229,11,77,91,248,231,32,254,127,251,197,240,114,223,199,255,171,95,242,28,154,115,239,209,97,96,108,127,135,38,148,143,80,119,127,131,38,254,223, + 192,4,3,140,48,230,127,132,183,107,255,3,117,163,153,92,93,77,184,54,109,58,234,9,236,41,168,19,40,254,95,132,134,58,244,3,75,145,83,27, + 54,28,126,247,230,205,167,175,12,136,51,131,255,34,53,205,152,128,221,95,230,247,239,191,48,3,35,244,43,48,81,125,118,116,52,90,229,231,103,245, + 30,200,86,54,51,211,216,11,76,40,119,119,239,62,251,17,152,80,62,3,115,54,200,237,191,129,9,236,191,137,137,58,251,228,201,235,125,128,237,43, + 54,92,238,0,150,26,231,29,29,13,23,238,218,117,250,41,48,49,128,252,255,19,152,224,65,13,125,80,239,240,31,82,27,13,228,14,22,96,98,98, + 61,116,232,210,143,239,223,127,254,246,247,183,158,184,100,201,94,145,87,175,222,107,225,232,57,138,29,63,126,213,43,40,200,230,12,208,158,31,192,70, + 249,95,128,0,98,65,107,168,193,186,215,95,25,144,182,159,128,216,247,222,127,126,82,207,196,179,182,113,199,199,16,139,79,191,37,69,131,129,221,102, + 208,84,193,151,183,144,6,47,11,15,106,19,22,52,177,245,230,16,3,163,71,40,3,195,66,96,169,243,253,51,161,153,60,160,11,191,129,71,135,25, + 254,225,223,50,251,237,227,255,255,235,190,243,157,92,240,232,209,209,191,191,127,127,129,38,150,15,208,4,3,47,93,32,254,97,100,33,102,242,27,52, + 184,7,44,41,88,129,129,204,117,250,244,77,15,2,202,127,3,75,138,121,156,156,236,199,86,175,222,255,6,152,88,190,48,32,78,38,255,139,101,214, + 13,190,127,253,241,227,215,63,215,175,63,252,13,88,170,108,84,84,148,100,219,191,255,194,183,59,119,158,126,7,70,206,15,104,34,7,31,143,15,172, + 94,88,129,137,76,242,234,213,251,166,120,242,215,79,79,79,179,37,188,188,156,239,128,213,204,111,103,103,35,70,9,9,33,38,65,65,94,102,160,24, + 176,93,197,14,95,127,242,237,219,15,166,79,159,190,3,19,238,103,230,23,47,222,49,126,252,248,245,151,136,136,192,43,15,15,211,133,139,22,237,106, + 129,198,51,6,216,189,251,140,129,143,143,133,44,176,84,250,178,110,221,225,127,0,1,196,130,165,117,255,139,1,117,131,62,108,161,56,243,133,183,95, + 238,22,255,231,91,94,127,228,71,160,235,183,219,138,34,129,10,12,204,66,60,144,147,169,64,9,4,214,21,1,31,254,3,140,244,123,91,25,24,77, + 108,24,152,51,39,51,48,148,23,227,28,234,135,116,201,217,129,213,156,53,3,163,154,41,3,227,205,103,12,12,199,38,226,84,250,244,55,195,251,99, + 239,63,95,255,247,231,207,103,104,34,121,15,77,48,159,160,137,253,7,172,135,2,46,180,192,19,140,132,18,204,127,6,33,33,94,96,145,125,95,27, + 216,117,149,195,167,22,212,14,80,80,144,216,183,106,213,129,183,192,196,242,9,106,31,52,129,98,189,166,135,9,169,215,244,251,243,231,111,191,128,37, + 202,87,80,163,246,31,100,90,251,47,122,130,3,54,124,57,158,63,127,171,241,252,249,59,113,92,238,16,16,224,189,5,108,167,112,1,221,96,199,205, + 205,249,11,148,8,128,213,207,223,39,79,94,255,3,173,41,2,54,124,255,35,15,27,128,252,8,44,193,152,128,13,96,102,96,2,101,3,102,12,214, + 175,95,127,112,1,19,215,195,207,159,191,99,29,99,2,86,99,90,192,182,157,44,48,108,110,131,220,7,16,64,44,88,122,182,176,82,230,27,82,3, + 4,182,54,150,225,206,187,79,143,170,255,114,175,126,203,204,225,238,249,242,150,142,180,135,36,51,151,46,176,90,2,237,11,250,254,23,177,209,158,17, + 186,88,255,76,35,3,131,86,30,3,163,62,176,157,119,238,1,238,102,185,186,33,3,99,72,8,80,27,176,196,186,126,19,127,246,254,243,247,55,176, + 246,248,14,44,118,65,137,229,29,20,127,64,43,93,254,146,210,120,2,86,73,160,198,49,243,151,47,223,228,129,69,183,40,62,165,192,134,233,150,135, + 15,95,190,1,226,143,176,222,24,3,254,147,200,97,43,255,224,99,94,160,29,26,72,227,77,200,55,180,128,79,52,6,70,16,168,20,0,37,92,156, + 163,185,192,106,83,123,243,230,227,205,148,246,32,8,100,40,145,39,79,94,137,75,75,139,176,3,171,246,31,0,1,196,130,99,56,228,55,3,234,197, + 89,76,200,51,159,143,62,126,125,94,246,245,251,250,67,111,121,111,199,188,122,110,101,97,252,73,74,212,74,152,129,69,158,23,162,236,215,95,72,137, + 3,58,45,10,116,210,193,213,105,12,12,111,223,224,119,246,247,59,192,146,101,34,208,178,31,12,140,95,191,19,154,121,248,207,193,206,246,25,152,131, + 222,65,75,23,228,182,11,114,78,39,126,224,228,47,104,150,150,137,25,152,227,196,24,240,108,111,4,182,93,222,105,106,202,94,1,150,46,159,144,18, + 203,111,34,22,127,160,223,58,199,136,69,238,31,100,24,5,88,47,114,113,176,2,75,24,65,2,99,71,212,56,180,158,17,121,246,30,27,56,118,236, + 154,60,176,123,207,201,207,207,245,25,32,128,88,240,120,236,23,218,140,43,3,210,82,136,63,191,254,252,251,179,238,249,199,83,59,95,49,223,246,127, + 205,160,19,124,233,135,161,153,54,135,148,168,1,31,19,139,44,55,3,51,31,59,176,124,1,54,30,64,91,79,64,51,254,255,158,19,152,124,252,201, + 192,196,199,203,240,239,39,104,46,233,43,161,233,253,63,28,28,108,31,129,141,59,88,233,242,17,169,161,11,75,44,68,206,146,34,192,199,143,95,184, + 46,95,190,47,133,79,13,176,157,243,136,149,149,245,203,151,47,160,147,10,224,165,10,177,137,243,63,82,137,130,75,14,84,229,49,177,178,50,11,30, + 60,120,81,158,97,16,128,55,111,62,138,242,240,112,113,0,195,156,9,32,128,112,37,24,88,32,252,198,145,11,224,235,103,190,2,203,239,101,207,63, + 31,219,254,150,229,170,253,147,223,234,62,103,190,106,25,203,176,203,73,200,48,115,114,200,114,50,252,19,226,96,248,47,202,202,192,128,127,238,143,225, + 215,251,95,12,111,15,61,103,248,250,234,223,159,71,215,254,252,194,55,20,15,90,59,4,204,233,159,129,189,26,88,35,247,27,52,183,255,197,209,232, + 36,170,100,6,213,237,192,18,134,147,64,239,232,13,27,27,243,119,96,21,134,220,192,37,165,52,35,164,150,145,131,131,149,9,88,221,178,2,219,14, + 204,131,33,193,0,195,4,52,210,205,6,106,115,1,4,16,11,1,143,253,65,227,255,71,155,221,6,69,18,168,30,226,126,255,235,207,175,13,47,255, + 124,216,246,154,233,138,206,211,191,146,14,119,57,149,52,184,190,202,9,179,126,224,19,145,251,205,247,225,254,103,54,124,169,230,233,171,191,95,150,156, + 103,187,121,235,195,247,103,215,191,253,3,229,114,99,124,53,8,176,161,246,25,180,138,12,154,96,126,160,181,1,200,152,177,5,23,205,76,4,83,54, + 3,104,30,149,229,15,176,58,36,39,177,16,5,126,255,254,11,74,188,12,12,52,60,201,156,164,58,11,216,198,1,246,34,65,203,78,25,1,2,136, + 80,130,249,143,214,30,248,143,212,40,254,137,52,255,196,3,197,156,191,254,253,251,117,238,227,183,175,64,252,128,137,145,145,93,74,144,87,192,140,147, + 67,250,198,151,47,160,197,75,56,123,31,247,127,253,127,245,237,237,167,115,192,134,220,103,1,62,110,22,2,195,53,127,248,249,121,190,1,115,251,55, + 180,54,4,217,27,160,129,213,219,71,80,219,129,157,157,21,239,141,19,192,94,8,63,55,55,23,51,180,203,138,115,4,57,46,206,21,124,227,43,176, + 43,203,240,246,237,39,240,13,174,160,109,184,192,98,157,193,220,92,147,65,67,67,14,60,246,3,90,48,181,98,197,126,208,196,35,162,57,247,253,23, + 8,255,7,117,162,6,67,130,249,253,27,86,210,49,50,0,4,16,11,145,69,40,172,219,247,15,109,118,27,121,194,242,11,100,148,142,1,118,84,24, + 251,191,255,255,57,158,126,248,252,243,206,183,95,127,62,252,253,167,78,160,33,251,135,131,133,249,11,211,191,255,239,249,121,57,241,46,136,249,254,253, + 55,31,104,209,53,176,39,241,139,80,98,97,132,2,80,175,4,159,153,204,204,140,223,128,213,192,15,21,21,169,87,87,174,224,222,214,251,225,195,87, + 101,14,14,22,54,89,89,81,150,91,183,30,99,77,44,229,229,17,12,29,29,105,224,0,126,246,236,53,3,176,171,206,48,101,202,122,240,145,103,155, + 55,31,99,200,200,8,96,240,240,240,0,7,229,159,63,95,192,247,22,212,215,47,132,59,249,197,139,183,255,191,125,251,241,89,79,79,241,197,149,43, + 247,112,198,139,163,163,193,34,25,25,209,251,160,1,57,38,42,95,218,4,218,236,1,44,193,65,85,255,31,9,9,161,251,192,4,255,229,211,167,175, + 255,0,2,136,216,4,195,128,212,174,65,94,210,9,171,150,190,66,19,10,236,20,110,216,145,167,156,44,204,76,156,60,156,108,172,31,153,153,126,19, + 40,246,126,1,115,247,59,96,99,239,53,48,247,138,227,159,243,249,205,205,197,197,14,26,160,34,120,213,13,176,171,204,4,154,75,1,230,88,124,99, + 43,255,152,153,89,126,126,253,250,19,88,213,113,189,132,250,149,25,123,125,254,93,4,216,107,208,243,244,52,187,125,242,228,117,148,19,169,164,164,68, + 24,146,146,60,24,170,171,99,128,165,202,71,112,130,121,255,254,11,176,148,129,156,137,3,76,100,192,18,234,55,195,55,208,172,62,184,157,254,23,200, + 254,204,32,46,46,196,160,165,37,207,112,237,218,67,216,8,235,255,87,175,62,254,1,102,136,215,248,123,55,12,191,4,5,121,142,29,59,118,253,51, + 40,130,169,185,17,15,100,30,104,196,24,24,126,63,206,158,189,245,21,232,182,207,192,18,242,31,64,0,17,123,58,14,250,245,50,255,24,48,23,94, + 193,18,14,7,3,226,108,57,78,160,39,184,129,197,48,43,144,254,129,191,132,97,250,9,236,74,190,5,210,175,120,120,56,94,1,213,127,251,247,239, + 63,174,134,47,31,176,52,224,16,21,229,255,143,150,232,192,155,224,144,142,230,96,212,210,146,99,126,246,236,13,223,247,239,63,241,149,48,63,64,118, + 191,121,243,225,47,27,27,219,83,96,64,189,5,86,21,98,184,194,242,228,201,107,94,190,190,22,219,129,57,156,117,243,230,227,240,30,143,159,159,37, + 248,162,240,247,239,63,131,170,56,80,169,133,220,5,102,128,236,171,131,76,67,32,142,172,249,15,84,199,194,16,24,104,3,75,48,224,48,6,86,205, + 255,128,57,251,5,116,216,0,107,247,26,88,18,90,25,25,169,174,123,252,248,229,167,151,47,223,147,115,150,218,127,44,61,97,6,180,30,241,111,164, + 17,232,127,0,1,196,68,134,5,200,35,147,63,144,170,35,216,136,43,168,50,6,13,186,128,54,42,191,96,102,102,126,201,199,199,245,26,152,16,190, + 19,74,48,124,124,220,239,128,17,254,6,88,68,191,1,54,44,241,174,221,216,189,251,140,158,141,141,46,143,148,148,48,220,163,81,81,206,12,89,89, + 254,112,53,160,91,234,237,236,244,153,175,94,125,104,0,44,9,120,241,148,110,127,88,88,152,190,220,188,249,248,167,128,0,247,117,69,69,201,71,248, + 236,62,127,254,142,237,222,189,231,189,242,242,130,248,92,93,141,153,65,119,15,76,158,156,11,190,157,254,213,171,247,88,55,198,65,182,133,252,1,150, + 38,130,12,34,34,2,172,175,95,63,87,184,126,253,166,42,43,43,27,55,48,225,51,163,95,214,117,227,198,163,191,192,112,187,1,77,52,184,186,187, + 218,192,132,165,21,30,238,244,7,216,99,252,130,52,159,70,8,131,87,227,43,43,75,125,141,140,116,254,174,175,175,252,13,24,254,232,106,62,67,11, + 0,228,129,201,127,0,1,196,68,102,170,68,222,203,132,60,97,249,21,105,94,7,132,223,3,75,130,119,192,6,234,7,32,253,11,127,130,97,252,3, + 140,172,79,192,156,248,1,24,1,207,129,109,148,23,248,212,159,62,125,211,13,152,32,196,99,99,221,56,69,68,32,37,77,69,69,4,3,176,170,96, + 0,205,163,128,34,49,61,221,155,93,86,86,76,4,88,34,184,224,27,140,3,173,150,151,147,19,187,123,233,210,221,31,192,72,248,12,12,200,67,4, + 194,128,103,210,164,117,165,55,110,60,182,236,234,74,231,207,204,244,3,39,26,80,59,2,219,36,39,104,244,31,52,87,5,204,60,140,189,189,89,28, + 234,234,50,210,161,161,13,53,86,86,57,75,22,45,218,225,105,103,167,43,230,230,102,10,114,43,44,103,255,7,150,30,191,128,37,229,107,96,227,248, + 12,62,135,108,219,118,34,94,71,71,94,42,55,55,232,31,48,195,125,131,198,3,94,12,244,239,215,130,130,224,63,211,167,23,114,3,75,40,243,222, + 222,76,161,41,83,242,152,130,131,237,126,138,137,9,194,226,17,166,254,7,82,59,241,63,64,0,81,218,207,255,143,111,140,6,132,129,17,255,207,194, + 66,139,235,254,253,231,214,175,95,127,84,195,101,16,176,190,190,107,106,170,190,247,212,169,27,111,180,181,21,191,1,91,230,134,143,31,191,214,192,221, + 240,5,111,214,250,9,244,248,89,91,91,221,223,47,94,188,255,107,108,172,6,26,182,103,184,124,249,62,99,90,154,15,71,104,168,163,240,162,69,59, + 163,118,236,56,29,135,47,193,200,201,137,95,3,186,113,205,166,77,199,62,1,219,24,255,93,93,77,190,157,57,115,211,1,232,6,94,220,115,165,255, + 249,247,238,61,103,1,76,172,31,50,50,252,158,3,19,217,239,87,175,62,48,72,75,139,252,7,149,108,160,196,3,42,85,64,37,199,187,119,159,89, + 162,163,157,89,129,145,207,247,249,243,55,157,196,196,174,186,163,71,175,196,0,221,47,189,125,251,41,175,179,103,111,243,2,115,250,157,212,84,239,111, + 64,45,255,79,156,184,254,31,52,231,195,195,195,197,174,161,33,251,15,232,22,47,96,66,196,26,87,95,190,252,16,191,118,237,145,28,208,191,23,98, + 99,93,223,0,219,96,127,94,190,124,247,11,88,242,254,1,38,12,48,6,186,17,216,120,229,4,225,191,160,197,221,211,167,23,176,3,195,73,14,152, + 232,51,38,78,92,219,126,236,216,85,99,96,41,243,35,38,198,245,123,124,188,219,23,160,59,129,102,188,255,13,218,113,1,204,200,255,64,109,42,88, + 85,9,16,64,52,233,182,35,77,37,176,1,3,80,160,185,57,201,72,91,91,97,3,150,182,16,28,3,3,124,87,123,123,170,37,208,131,82,192,46, + 169,50,208,241,173,12,152,251,162,209,241,15,95,95,203,217,219,182,181,155,127,254,188,85,252,245,235,245,98,175,94,173,19,251,250,117,135,232,233,211, + 211,245,195,195,29,219,161,185,4,159,25,192,4,98,60,161,168,40,84,27,88,10,138,2,75,10,137,236,236,0,3,111,111,243,73,132,244,65,241,87, + 96,36,172,1,230,210,200,59,119,150,40,125,253,186,77,236,203,151,173,98,223,190,109,23,249,250,117,187,40,144,22,187,119,111,153,252,130,5,21,238, + 137,137,158,221,192,158,199,61,108,230,104,104,200,239,93,186,180,58,224,229,203,181,226,192,94,22,39,48,114,185,197,196,4,196,106,106,98,205,117,117, + 149,54,18,114,7,176,116,58,14,44,49,194,128,254,151,121,255,126,19,255,143,31,59,57,128,246,179,0,195,133,5,68,63,124,184,130,227,195,135,205, + 252,175,94,173,151,92,176,160,220,91,65,65,226,0,186,25,64,251,78,2,237,46,59,121,114,170,206,223,191,123,4,110,221,90,4,90,4,143,18,185, + 0,1,68,139,35,33,145,83,226,95,78,78,118,80,215,140,152,225,243,255,192,122,248,15,48,210,126,3,219,8,76,65,65,118,71,128,189,160,135,192, + 6,164,2,30,61,236,192,70,103,10,48,135,56,232,233,41,93,4,86,125,119,65,250,63,126,252,162,124,235,214,83,253,71,143,94,170,18,242,35,176, + 52,120,109,106,170,121,252,232,209,203,159,129,85,0,104,247,223,159,35,71,46,189,11,8,176,217,113,225,194,61,203,167,79,95,155,16,112,55,23,176, + 183,20,12,196,46,51,102,108,126,10,236,9,93,1,54,218,159,128,38,234,64,126,2,246,144,148,158,63,127,167,114,243,230,35,57,160,217,56,123,127, + 55,110,60,116,138,137,105,51,2,230,240,105,21,21,209,203,129,37,211,147,201,147,215,255,60,123,246,230,107,39,39,195,77,183,110,61,49,255,249,243, + 23,78,253,143,31,191,178,200,201,153,56,103,238,220,173,7,76,77,53,118,133,134,58,92,1,150,50,159,64,235,148,129,97,2,108,91,125,224,89,185, + 114,191,46,176,180,114,189,112,225,174,53,176,167,41,140,110,6,80,141,89,103,231,10,163,133,11,119,197,3,237,92,223,218,154,188,88,84,84,224,46, + 242,0,46,64,0,209,26,49,171,168,72,243,244,247,103,235,1,75,152,117,4,74,152,157,147,38,229,154,74,74,10,131,102,103,69,128,85,141,174,143, + 143,101,47,145,185,156,108,12,172,206,22,148,150,134,27,10,11,243,138,192,6,32,129,165,128,72,112,176,173,78,122,186,111,38,144,253,138,214,110,64, + 47,53,59,58,82,179,102,207,46,230,3,207,68,112,115,136,231,228,4,26,132,134,218,183,163,205,147,17,194,255,128,153,245,62,16,223,5,246,82,31, + 129,14,35,32,197,29,192,166,196,141,29,59,186,236,59,59,211,80,246,252,0,4,208,160,186,162,27,84,95,2,123,43,224,217,242,253,251,47,124,52, + 49,81,219,15,204,37,23,104,101,159,128,0,207,29,43,43,157,45,39,78,92,123,255,246,237,103,216,44,247,31,96,238,251,181,115,231,153,247,192,54, + 198,73,96,181,54,9,88,242,189,167,87,24,88,90,106,175,215,212,148,223,191,113,227,49,112,164,131,54,237,239,219,119,238,19,80,108,39,80,110,13, + 41,77,3,96,59,79,1,136,149,128,254,144,37,180,145,15,173,71,247,33,63,63,168,251,227,199,207,183,230,205,219,134,50,137,11,16,64,131,44,193, + 48,1,123,18,224,4,243,23,216,173,252,122,229,202,131,59,129,129,54,51,64,167,14,80,189,232,99,102,250,232,231,103,53,11,216,13,190,13,44,166, + 191,194,18,11,108,108,9,216,13,255,182,99,199,169,183,192,42,107,59,176,120,239,101,101,101,166,117,162,249,7,108,180,175,4,182,25,38,207,154,181, + 229,205,214,173,39,96,61,147,223,192,176,248,4,116,203,115,7,7,131,249,102,102,26,43,105,28,7,31,226,227,221,219,216,217,217,142,84,86,206,249, + 118,243,230,19,148,4,3,16,64,131,42,193,64,22,242,128,215,161,254,5,182,204,127,239,217,115,246,51,11,11,203,89,96,119,111,42,48,130,63,81, + 203,30,208,188,81,80,144,45,176,228,96,221,15,236,25,189,253,254,29,116,8,48,124,230,25,54,245,241,19,216,83,248,186,101,203,241,247,64,245,123, + 128,37,77,15,176,122,120,66,163,72,250,14,236,153,205,240,244,52,155,181,124,249,190,231,192,196,242,11,122,154,3,56,193,0,123,100,63,79,159,190, + 249,97,215,174,211,143,237,237,13,22,185,184,24,207,103,64,93,126,66,21,192,199,199,245,56,38,198,165,147,155,155,125,15,176,253,244,233,222,189,231, + 127,209,7,248,0,2,136,214,211,231,76,66,66,124,172,192,92,33,120,238,220,109,135,215,175,63,104,226,235,86,219,216,232,238,61,118,236,202,219,247, + 239,191,128,151,87,2,139,210,255,160,33,118,93,93,229,231,192,54,208,125,96,215,92,25,40,38,68,97,53,244,24,216,54,154,10,12,156,157,235,214, + 29,122,9,236,242,126,101,64,44,186,194,152,102,0,13,135,63,121,242,250,15,176,49,251,28,232,190,171,64,251,89,129,141,67,57,42,117,24,254,1, + 123,145,23,129,137,119,178,140,140,200,206,109,219,78,190,184,112,225,206,39,6,212,197,228,240,161,139,231,207,223,254,249,246,237,199,47,43,43,237,59, + 138,138,146,15,95,188,120,43,5,108,28,83,99,127,245,31,96,87,250,0,48,99,78,2,154,127,106,221,186,195,111,222,190,5,207,103,252,70,115,3, + 3,64,0,81,45,193,4,4,88,51,168,171,203,129,118,238,145,157,96,172,173,117,246,30,61,10,79,48,224,241,253,119,239,190,252,125,240,224,197,95, + 96,119,251,53,48,194,46,1,187,189,127,64,235,92,255,253,35,120,204,6,106,87,134,139,253,185,153,153,230,86,47,47,243,41,192,72,63,179,101,203, + 177,87,64,123,190,32,13,123,163,247,228,224,13,64,96,59,224,31,48,183,253,2,22,128,31,128,126,185,4,108,160,223,5,29,137,241,241,227,87,94, + 160,59,200,217,66,251,93,78,78,236,146,189,189,254,42,160,159,231,61,124,248,242,218,246,237,39,95,62,122,244,234,51,116,100,245,55,142,6,46,195, + 203,151,239,126,223,185,243,244,151,152,152,224,51,11,11,205,179,130,130,60,31,128,238,224,6,186,81,136,129,196,229,16,192,146,237,179,178,178,228,41, + 71,71,131,197,90,90,10,43,47,93,186,119,103,223,190,11,111,63,127,6,237,119,134,175,2,64,89,236,5,16,64,84,235,86,7,6,58,48,196,197, + 249,50,120,120,228,48,0,27,140,212,234,154,255,1,237,55,2,182,51,62,109,221,122,252,175,174,174,210,79,61,61,229,199,90,90,242,123,129,185,94, + 19,152,56,13,128,221,86,5,232,32,30,11,108,231,34,104,62,9,148,176,128,85,200,75,80,195,22,152,27,111,42,42,74,92,2,150,22,55,65,141, + 233,91,183,30,129,6,232,96,139,197,113,37,22,6,228,238,36,208,252,127,199,142,93,251,123,253,250,227,239,70,70,170,239,77,77,213,79,219,219,235, + 41,62,125,250,70,21,216,229,213,2,70,26,200,29,160,19,168,216,127,253,250,203,140,212,144,255,15,26,90,0,246,84,94,241,242,114,62,150,145,17, + 189,5,236,57,222,4,118,187,239,2,75,136,103,192,220,252,13,216,117,255,12,116,251,55,164,196,251,27,173,180,131,205,219,253,0,157,107,4,44,225, + 254,1,195,227,151,130,130,196,87,125,125,229,167,33,33,118,251,129,213,170,18,176,205,167,3,12,43,245,175,95,191,203,0,221,203,243,243,39,98,1, + 22,51,51,227,127,160,27,126,129,118,104,242,242,114,63,80,82,146,184,6,76,248,55,126,255,254,123,23,24,150,175,14,29,186,252,5,152,161,97,107, + 139,144,195,5,101,21,0,64,0,86,174,93,5,97,32,8,166,240,93,136,17,67,64,11,187,20,246,130,31,225,239,248,27,254,141,32,136,118,22,54, + 134,8,98,19,11,69,66,26,73,206,83,99,188,92,116,150,168,4,81,43,171,107,151,153,217,205,110,118,238,254,38,24,206,147,27,1,195,97,95,233, + 118,123,202,96,48,251,135,104,94,132,69,81,28,155,166,45,86,171,237,169,217,212,61,8,96,137,12,29,161,114,228,0,98,17,253,134,46,165,204,211, + 223,85,218,13,233,186,234,226,60,163,100,135,32,134,77,38,230,1,25,28,0,200,75,10,20,161,124,183,88,166,69,243,90,135,120,30,23,227,241,60, + 32,3,23,200,119,241,73,89,116,58,173,17,68,81,192,52,149,129,128,85,223,231,85,114,236,147,41,11,83,159,168,215,107,59,33,34,65,211,23,200, + 62,90,150,205,17,203,229,241,68,218,147,156,235,27,73,183,207,9,148,196,34,101,44,215,107,39,220,108,220,51,170,13,3,38,182,97,52,102,237,182, + 81,66,195,154,69,211,94,70,172,26,225,65,158,93,52,239,129,166,85,104,19,127,133,168,133,227,236,217,116,186,228,116,237,133,177,99,58,142,240,23, + 46,119,1,88,185,130,20,132,97,32,136,180,13,169,6,91,74,63,231,19,250,209,222,122,20,138,120,243,172,32,181,138,155,180,56,19,68,66,91,15, + 130,47,200,50,179,187,217,100,50,249,243,197,157,243,98,117,85,237,62,9,227,81,91,205,148,209,57,59,243,223,21,166,85,238,165,7,16,110,41,18, + 162,170,123,144,116,214,58,81,198,172,147,162,48,199,52,213,49,1,18,17,94,167,15,32,143,224,8,186,137,96,235,8,85,87,9,102,132,241,71,149, + 222,75,31,93,247,120,34,121,239,109,123,186,33,134,139,194,4,205,132,41,203,109,156,101,38,122,63,195,161,31,104,192,54,59,32,110,135,138,167,13, + 196,34,177,37,80,250,237,194,204,178,132,213,244,207,97,63,156,163,144,72,62,77,102,125,211,28,174,232,32,138,9,147,231,155,136,254,164,152,182,79, + 128,139,174,227,234,122,63,34,30,203,3,5,141,108,232,106,225,250,18,196,241,245,125,209,75,0,81,49,193,192,54,220,131,102,100,217,65,219,72,65, + 129,245,15,116,161,38,144,205,249,233,211,87,65,2,221,220,223,192,92,248,239,207,159,127,184,18,13,242,44,249,79,96,32,176,2,205,103,6,97,96, + 195,149,233,209,163,151,200,247,9,32,71,46,250,162,175,191,104,237,3,98,75,187,191,12,168,107,129,192,215,6,1,221,193,2,172,14,152,129,24,60, + 29,2,44,214,209,151,121,34,207,179,33,187,5,157,102,96,32,110,231,193,127,180,196,14,43,21,88,126,253,250,3,194,160,99,52,152,161,238,96,196, + 18,38,200,75,83,144,39,144,255,50,16,177,106,17,32,128,168,150,96,64,235,61,129,110,7,93,88,196,102,98,162,255,117,201,146,202,223,155,54,29, + 103,6,237,85,6,230,114,49,96,149,161,141,79,63,176,136,127,15,12,116,240,38,118,92,141,79,44,145,15,187,81,142,17,75,224,160,7,208,63,180, + 226,254,63,153,237,42,6,6,196,102,191,63,12,136,173,56,204,72,9,133,9,139,190,127,120,48,169,110,249,135,68,195,220,193,140,230,14,38,164,156, + 76,200,29,127,137,76,176,12,0,1,68,181,4,3,172,67,153,183,110,61,97,222,216,184,192,55,45,205,231,180,177,177,250,189,148,20,175,127,87,175, + 62,144,234,235,91,147,8,76,249,98,248,244,3,219,28,239,65,117,233,151,47,63,254,19,81,61,252,69,242,36,242,254,41,108,106,145,3,130,26,51, + 174,255,208,74,29,38,180,34,150,17,135,91,24,112,12,195,83,218,206,67,46,69,25,25,240,95,196,129,173,138,69,47,205,241,2,128,0,162,90,130, + 1,21,135,63,127,126,227,57,125,250,102,4,16,231,1,235,210,107,192,58,253,43,176,103,162,2,108,160,17,60,99,69,79,79,233,209,139,23,239,190, + 3,171,46,66,251,137,176,237,237,97,36,160,150,22,128,20,119,208,195,45,255,177,180,17,168,238,22,128,0,162,86,130,97,2,182,214,89,120,121,185, + 224,199,63,3,27,119,90,63,126,16,55,24,9,76,88,79,128,221,224,199,192,22,251,95,10,170,139,193,0,6,211,237,231,52,113,11,64,0,81,35, + 193,128,139,62,96,195,19,212,51,32,241,158,98,8,208,208,144,3,141,75,220,132,30,90,51,50,175,156,31,34,0,32,128,168,53,151,4,218,56,206, + 12,44,81,72,190,87,17,52,71,100,103,167,183,238,206,157,39,159,159,62,125,243,135,129,70,155,195,70,1,117,0,64,0,81,109,242,17,116,2,37, + 104,171,41,137,9,230,151,171,171,241,66,96,123,231,212,190,125,23,190,48,144,182,79,121,20,12,0,0,8,32,170,37,152,183,111,63,253,3,157,222, + 200,195,195,249,150,24,245,236,236,108,111,65,147,128,192,234,104,205,218,181,135,94,3,75,151,31,12,228,237,85,30,5,116,4,0,1,68,141,201,71, + 112,183,246,237,219,143,204,10,10,18,191,221,220,76,46,8,10,242,222,228,224,96,125,207,201,201,254,19,116,100,216,191,127,12,160,35,180,126,2,19, + 211,39,208,46,58,29,29,197,77,62,62,22,115,89,89,153,15,109,217,114,226,249,163,71,175,96,147,128,196,28,155,49,10,6,16,0,4,16,35,149, + 204,0,37,60,54,62,62,110,78,57,57,113,62,57,57,81,65,96,194,16,0,109,96,3,118,183,65,43,229,133,65,231,154,241,240,112,188,227,228,100, + 123,247,234,213,135,239,87,175,62,252,112,255,254,243,207,223,190,253,128,237,125,65,94,98,48,10,6,41,0,8,32,106,237,173,132,29,113,6,218,237, + 8,218,249,200,193,194,194,194,14,44,65,216,5,5,121,88,4,4,120,152,128,189,32,208,249,43,255,222,188,249,8,154,219,1,221,19,4,219,204,143, + 60,183,67,179,173,12,163,128,58,0,32,128,24,169,104,14,108,152,30,148,104,96,183,130,192,206,199,67,62,144,8,54,143,129,124,139,202,223,209,196, + 50,52,0,64,0,49,82,217,44,88,245,132,126,19,61,174,9,48,228,33,254,209,196,50,4,0,64,128,1,0,102,20,176,16,7,130,12,56,0,0, + 0,0,73,69,78,68,174,66,96,130,0,0}; +const char* BinaryData::juce_png = (const char*) temp13; -static const unsigned char temp17[] = {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 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, 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,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, @@ -6970,1010 +4322,3655 @@ static const unsigned char temp17[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,108,97,98,101,108,41,59,13,10,13,10, 32,32,32,32,114,101,116,117,114,110,32,112,97,103,101,59,13,10,125,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,115,116,97,116,105,99,32,67,111,109,112,111,110,101,110, - 116,42,32,99,114,101,97,116,101,82,97,100,105,111,66,117,116,116,111,110,80,97,103,101,40,41,13,10,123,13,10,32,32,32,32,68,101,109,111,80, - 97,103,101,67,111,109,112,42,32,112,97,103,101,32,61,32,110,101,119,32,68,101,109,111,80,97,103,101,67,111,109,112,40,41,59,13,10,13,10,32, - 32,32,32,71,114,111,117,112,67,111,109,112,111,110,101,110,116,42,32,103,114,111,117,112,32,61,32,110,101,119,32,71,114,111,117,112,67,111,109,112, - 111,110,101,110,116,32,40,84,40,34,103,114,111,117,112,34,41,44,32,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,115,34,41,41,59,13, - 10,32,32,32,32,103,114,111,117,112,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,44,32,50,48,44,32,50,50,48,44,32,49,52,48,41, - 59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,103,114,111,117,112,41,59,13, - 10,13,10,32,32,32,32,105,110,116,32,105,59,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32,60,32,52,59,32,43,43, - 105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,116,98,32,61,32,110,101, - 119,32,84,111,103,103,108,101,66,117,116,116,111,110,32,40,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,32,35,34,41,32,43,32,83,116, - 114,105,110,103,32,40,105,32,43,32,49,41,41,59,13,10,32,32,32,32,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101, - 86,105,115,105,98,108,101,32,40,116,98,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,82,97,100,105,111,71,114,111,117,112, - 73,100,32,40,49,50,51,52,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,66,111,117,110,100,115,32,40,52,53,44,32,52, - 54,32,43,32,105,32,42,32,50,50,44,32,49,56,48,44,32,50,50,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111, - 111,108,116,105,112,32,40,84,40,34,97,32,115,101,116,32,111,102,32,109,117,116,117,97,108,108,121,45,101,120,99,108,117,115,105,118,101,32,114,97, - 100,105,111,32,98,117,116,116,111,110,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61,61,32,48,41,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102,97, - 108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32,60,32,52,59,32,43, - 43,105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,110,111,114,109,97,108,44, - 32,111,118,101,114,59,13,10,13,10,32,32,32,32,32,32,32,32,80,97,116,104,32,112,59,13,10,32,32,32,32,32,32,32,32,112,46,97,100,100, - 83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44,32,105,32,43,32,53,44,32,50,48,46,48,102,44,32,53,48,46,48,102,44,32,45, - 48,46,50,102,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,80,97,116,104,32,40,112,41,59,13,10,32,32,32, - 32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116, - 98,108,117,101,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,79,117,116,108,105,110,101,32,40,52,46,48,102,44, - 32,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,80,97,116, - 104,32,40,112,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117, - 114,115,58,58,98,108,117,101,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,79,117,116,108,105,110,101,32,40,52,46,48, - 102,44,32,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,66, - 117,116,116,111,110,42,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,83,116,114,105,110,103,32,40, - 105,32,43,32,53,41,32,43,32,84,40,34,32,112,111,105,110,116,115,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73, - 109,97,103,101,65,98,111,118,101,84,101,120,116,76,97,98,101,108,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97, - 103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111,118,101,114,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,97,103,101, - 45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115, - 101,116,67,108,105,99,107,105,110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32, - 100,98,45,62,115,101,116,82,97,100,105,111,71,114,111,117,112,73,100,32,40,50,51,52,53,54,41,59,13,10,13,10,32,32,32,32,32,32,32,32, - 99,111,110,115,116,32,105,110,116,32,98,117,116,116,111,110,83,105,122,101,32,61,32,53,48,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62, - 115,101,116,66,111,117,110,100,115,32,40,50,53,32,43,32,105,32,42,32,98,117,116,116,111,110,83,105,122,101,44,32,49,56,48,44,32,98,117,116, - 116,111,110,83,105,122,101,44,32,98,117,116,116,111,110,83,105,122,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61, - 61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114, - 117,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32, - 60,32,52,59,32,43,43,105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,116,98, - 32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40,84,40,34,98,117,116,116,111,110,32,34,41,32,43,32,83,116,114,105,110,103, - 32,40,105,32,43,32,49,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105, - 115,105,98,108,101,32,40,116,98,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,108,105,99,107,105,110,103,84,111,103,103, - 108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,82,97,100,105,111,71,114, - 111,117,112,73,100,32,40,51,52,53,54,55,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,111,108,111,117,114,32,40,84, - 101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,119,104,105,116, - 101,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58, - 98,117,116,116,111,110,79,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,98,108,117,101,118,105,111,108,101,116,46,98,114, - 105,103,104,116,101,114,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,32, - 43,32,105,32,42,32,53,53,44,32,50,54,48,44,32,53,53,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116, - 67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,40,40,105,32,33,61,32,48,41,32,63,32,66,117,116,116,111,110,58,58,67,111,110,110, - 101,99,116,101,100,79,110,76,101,102,116,32,58,32,48,41,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,32,32,32,32,32,32,32,124,32,40,40,105,32,33,61,32,51,41,32,63,32,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101, - 100,79,110,82,105,103,104,116,32,58,32,48,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61,61,32,48,41,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102,97, - 108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,114,101,116,117,114,110,32,112,97,103,101,59,13,10,125,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,66,117,116,116,111,110,115,80,97,103,101,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,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,66,117,116,116,111,110,115,80,97,103,101,32,40,66,117,116,116, - 111,110,76,105,115,116,101,110,101,114,42,32,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32, - 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,13,10,115,116,97,116,105,99,32,67,111,109,112,111,110,101,110, + 116,42,32,99,114,101,97,116,101,82,97,100,105,111,66,117,116,116,111,110,80,97,103,101,40,41,13,10,123,13,10,32,32,32,32,68,101,109,111,80, + 97,103,101,67,111,109,112,42,32,112,97,103,101,32,61,32,110,101,119,32,68,101,109,111,80,97,103,101,67,111,109,112,40,41,59,13,10,13,10,32, + 32,32,32,71,114,111,117,112,67,111,109,112,111,110,101,110,116,42,32,103,114,111,117,112,32,61,32,110,101,119,32,71,114,111,117,112,67,111,109,112, + 111,110,101,110,116,32,40,84,40,34,103,114,111,117,112,34,41,44,32,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,115,34,41,41,59,13, + 10,32,32,32,32,103,114,111,117,112,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,44,32,50,48,44,32,50,50,48,44,32,49,52,48,41, + 59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,103,114,111,117,112,41,59,13, + 10,13,10,32,32,32,32,105,110,116,32,105,59,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32,60,32,52,59,32,43,43, + 105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,116,98,32,61,32,110,101, + 119,32,84,111,103,103,108,101,66,117,116,116,111,110,32,40,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,32,35,34,41,32,43,32,83,116, + 114,105,110,103,32,40,105,32,43,32,49,41,41,59,13,10,32,32,32,32,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101, + 86,105,115,105,98,108,101,32,40,116,98,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,82,97,100,105,111,71,114,111,117,112, + 73,100,32,40,49,50,51,52,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,66,111,117,110,100,115,32,40,52,53,44,32,52, + 54,32,43,32,105,32,42,32,50,50,44,32,49,56,48,44,32,50,50,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111, + 111,108,116,105,112,32,40,84,40,34,97,32,115,101,116,32,111,102,32,109,117,116,117,97,108,108,121,45,101,120,99,108,117,115,105,118,101,32,114,97, + 100,105,111,32,98,117,116,116,111,110,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61,61,32,48,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102,97, + 108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32,60,32,52,59,32,43, + 43,105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,110,111,114,109,97,108,44, + 32,111,118,101,114,59,13,10,13,10,32,32,32,32,32,32,32,32,80,97,116,104,32,112,59,13,10,32,32,32,32,32,32,32,32,112,46,97,100,100, + 83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44,32,105,32,43,32,53,44,32,50,48,46,48,102,44,32,53,48,46,48,102,44,32,45, + 48,46,50,102,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,80,97,116,104,32,40,112,41,59,13,10,32,32,32, + 32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116, + 98,108,117,101,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,79,117,116,108,105,110,101,32,40,52,46,48,102,44, + 32,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,80,97,116, + 104,32,40,112,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117, + 114,115,58,58,98,108,117,101,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,79,117,116,108,105,110,101,32,40,52,46,48, + 102,44,32,67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,66, + 117,116,116,111,110,42,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,83,116,114,105,110,103,32,40, + 105,32,43,32,53,41,32,43,32,84,40,34,32,112,111,105,110,116,115,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73, + 109,97,103,101,65,98,111,118,101,84,101,120,116,76,97,98,101,108,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97, + 103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111,118,101,114,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,97,103,101, + 45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115, + 101,116,67,108,105,99,107,105,110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32, + 100,98,45,62,115,101,116,82,97,100,105,111,71,114,111,117,112,73,100,32,40,50,51,52,53,54,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 99,111,110,115,116,32,105,110,116,32,98,117,116,116,111,110,83,105,122,101,32,61,32,53,48,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62, + 115,101,116,66,111,117,110,100,115,32,40,50,53,32,43,32,105,32,42,32,98,117,116,116,111,110,83,105,122,101,44,32,49,56,48,44,32,98,117,116, + 116,111,110,83,105,122,101,44,32,98,117,116,116,111,110,83,105,122,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61, + 61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114, + 117,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,48,59,32,105,32, + 60,32,52,59,32,43,43,105,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,116,98, + 32,61,32,110,101,119,32,84,101,120,116,66,117,116,116,111,110,32,40,84,40,34,98,117,116,116,111,110,32,34,41,32,43,32,83,116,114,105,110,103, + 32,40,105,32,43,32,49,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105, + 115,105,98,108,101,32,40,116,98,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,108,105,99,107,105,110,103,84,111,103,103, + 108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,82,97,100,105,111,71,114, + 111,117,112,73,100,32,40,51,52,53,54,55,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,111,108,111,117,114,32,40,84, + 101,120,116,66,117,116,116,111,110,58,58,98,117,116,116,111,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,119,104,105,116, + 101,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,67,111,108,111,117,114,32,40,84,101,120,116,66,117,116,116,111,110,58,58, + 98,117,116,116,111,110,79,110,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115,58,58,98,108,117,101,118,105,111,108,101,116,46,98,114, + 105,103,104,116,101,114,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,32, + 43,32,105,32,42,32,53,53,44,32,50,54,48,44,32,53,53,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116, + 67,111,110,110,101,99,116,101,100,69,100,103,101,115,32,40,40,40,105,32,33,61,32,48,41,32,63,32,66,117,116,116,111,110,58,58,67,111,110,110, + 101,99,116,101,100,79,110,76,101,102,116,32,58,32,48,41,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,32,32,32,32,32,32,32,124,32,40,40,105,32,33,61,32,51,41,32,63,32,66,117,116,116,111,110,58,58,67,111,110,110,101,99,116,101, + 100,79,110,82,105,103,104,116,32,58,32,48,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,105,32,61,61,32,48,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,116,98,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102,97, + 108,115,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,114,101,116,117,114,110,32,112,97,103,101,59,13,10,125,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,66,117,116,116,111,110,115,80,97,103,101,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,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,66,117,116,116,111,110,115,80,97,103,101,32,40,66,117,116,116, + 111,110,76,105,115,116,101,110,101,114,42,32,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 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,32,32,32,32,47,47,32,99,114,101,97,116,101,32,115,111,109,101,32,100,114,97,119,97,98,108,101,115,32,116, + 111,32,117,115,101,32,102,111,114,32,111,117,114,32,100,114,97,119,97,98,108,101,32,98,117,116,116,111,110,115,46,46,46,13,10,32,32,32,32,32, + 32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,110,111,114,109,97,108,44,32,111,118,101,114,59,13,10,13,10,32,32,32,32,32,32,32, + 32,80,97,116,104,32,112,59,13,10,32,32,32,32,32,32,32,32,112,46,97,100,100,83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44, + 32,53,44,32,50,48,46,48,102,44,32,53,48,46,48,102,44,32,48,46,50,102,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108, + 46,115,101,116,80,97,116,104,32,40,112,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,83,111,108,105,100,70,105, + 108,108,32,40,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,46,99,108,101,97,114,40,41,59, + 13,10,32,32,32,32,32,32,32,32,112,46,97,100,100,83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44,32,55,44,32,51,48,46,48, + 102,44,32,53,48,46,48,102,44,32,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,80,97,116,104,32,40, + 112,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117,114,115,58, + 58,112,105,110,107,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,79,117,116,108,105,110,101,32,40,53,46,48,102,44,32, + 67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,73,109,97,103, + 101,32,100,111,119,110,59,13,10,32,32,32,32,32,32,32,32,100,111,119,110,46,115,101,116,73,109,97,103,101,32,40,73,109,97,103,101,67,97,99, + 104,101,58,58,103,101,116,70,114,111,109,77,101,109,111,114,121,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44, + 32,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,44,32,116,114,117,101,41,59,13,10,32,32,32,32, + 32,32,32,32,100,111,119,110,46,115,101,116,79,118,101,114,108,97,121,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99, + 107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,51,102,41,41,59,13,10,13,10,32,32,32,32,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,32,32, + 32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45,97,98,111,118,101,45,116,101,120,116,32,98,117,116,116,111,110,32,102, + 114,111,109,32,116,104,101,115,101,32,100,114,97,119,97,98,108,101,115,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,66, + 117,116,116,111,110,42,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116,111, + 110,32,49,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,65,98,111,118,101,84,101,120,116,76,97,98, + 101,108,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111, + 118,101,114,44,32,38,100,111,119,110,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,51,48,44,32, + 56,48,44,32,56,48,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105, + 115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,119,105,116,104,32,97,32,108,97,98,101,108,34,41,41,59,13,10, + 13,10,32,32,32,32,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,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45,111, + 110,108,121,32,98,117,116,116,111,110,32,102,114,111,109,32,116,104,101,115,101,32,100,114,97,119,97,98,108,101,115,46,46,13,10,32,32,32,32,32, + 32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116,111,110,32,50,34, + 41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,70,105,116,116,101,100,41,59,13,10,32,32,32,32,32,32, + 32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111,118,101,114,44,32,38,100,111,119,110,41,59, + 13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,67,108,105,99,107,105,110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116, + 114,117,101,41,59,13,10,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,100,98,41,59, + 13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,57,48,44,32,51,48,44,32,56,48,44,32,56,48,41, + 59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105,115,32,105,115,32,97,110, + 32,105,109,97,103,101,45,111,110,108,121,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,34,41,41,59,13,10,32,32,32,32,32,32,32,32, + 100,98,45,62,97,100,100,66,117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,59,13, + 10,13,10,32,32,32,32,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,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45, + 111,110,45,98,117,116,116,111,110,45,115,104,97,112,101,32,98,117,116,116,111,110,32,102,114,111,109,32,116,104,101,32,115,97,109,101,32,100,114,97, + 119,97,98,108,101,115,46,46,13,10,32,32,32,32,32,32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111, + 110,32,40,84,40,34,66,117,116,116,111,110,32,51,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,79, + 110,66,117,116,116,111,110,66,97,99,107,103,114,111,117,110,100,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103, + 101,115,32,40,38,110,111,114,109,97,108,44,32,48,44,32,48,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50, + 48,48,44,32,51,48,44,32,49,49,48,44,32,50,53,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105, + 112,32,40,84,40,34,116,104,105,115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,111,110,32,97,32,115,116,97,110, + 100,97,114,100,32,98,117,116,116,111,110,32,98,97,99,107,103,114,111,117,110,100,34,41,41,59,13,10,13,10,32,32,32,32,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,32,32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116, + 111,110,32,52,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,79,110,66,117,116,116,111,110,66,97,99, + 107,103,114,111,117,110,100,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97, + 108,44,32,38,111,118,101,114,44,32,38,100,111,119,110,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,67,108,105,99,107,105, + 110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66, + 97,99,107,103,114,111,117,110,100,67,111,108,111,117,114,115,32,40,67,111,108,111,117,114,115,58,58,119,104,105,116,101,44,32,67,111,108,111,117,114, + 115,58,58,121,101,108,108,111,119,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,48,44,32,55,48,44,32, + 53,48,44,32,53,48,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105, + 115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,111,110,32,97,32,115,116,97,110,100,97,114,100,32,98,117,116,116, + 111,110,32,98,97,99,107,103,114,111,117,110,100,34,41,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,97,100,100,66,117,116,116,111,110, + 76,105,115,116,101,110,101,114,32,40,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,59,13,10,13,10,32,32,32,32,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,32,32,32,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,42,32,104,121,112,101,114,108,105,110,107,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,61,32,110,101,119,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,32,40,84,40,34,116,104,105,115,32,105, + 115,32,97,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,34,41,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,32,32,32,32,32,32,32,32,32,32,32,85,82,76,32,40,84,40,34,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,47,106,117,99,101,34,41,41,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,104,121,112,101,114,108,105,110,107,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49,51,48,44,32,50,48,48,44,32, + 50,52,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,104,121,112,101,114,108,105, + 110,107,41,59,13,10,13,10,32,32,32,32,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,32,32,32,32,73,109,97,103,101,66,117,116,116,111,110,42,32,105, + 109,97,103,101,66,117,116,116,111,110,32,61,32,110,101,119,32,73,109,97,103,101,66,117,116,116,111,110,32,40,84,40,34,105,109,97,103,101,98,117, + 116,116,111,110,34,41,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,105,109,97, + 103,101,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101,42,32,106,117,99,101,73,109,97,103,101,32,61, + 32,73,109,97,103,101,67,97,99,104,101,58,58,103,101,116,70,114,111,109,77,101,109,111,114,121,32,40,66,105,110,97,114,121,68,97,116,97,58,58, + 106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,59,13,10,32,32, + 32,32,32,32,32,32,73,109,97,103,101,67,97,99,104,101,58,58,105,110,99,82,101,102,101,114,101,110,99,101,67,111,117,110,116,32,40,106,117,99, + 101,73,109,97,103,101,41,59,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101,67,97,99,104,101,58,58,105,110,99,82,101,102,101,114,101,110, + 99,101,67,111,117,110,116,32,40,106,117,99,101,73,109,97,103,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,66,117,116, + 116,111,110,45,62,115,101,116,73,109,97,103,101,115,32,40,116,114,117,101,44,32,116,114,117,101,44,32,116,114,117,101,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,48,46, + 55,102,44,32,67,111,108,111,117,114,115,58,58,116,114,97,110,115,112,97,114,101,110,116,66,108,97,99,107,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,49,46,48,102,44, + 32,67,111,108,111,117,114,115,58,58,116,114,97,110,115,112,97,114,101,110,116,66,108,97,99,107,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,49,46,48,102,44,32,67,111, + 108,111,117,114,115,58,58,112,105,110,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,56,102,41,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,32,32,32,32,32,32,32,48,46,53,102,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,105,109,97,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,49,48,44,32,49,54, + 48,41,59,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40, + 34,105,109,97,103,101,32,98,117,116,116,111,110,32,45,32,115,104,111,119,105,110,103,32,97,108,112,104,97,45,99,104,97,110,110,101,108,32,104,105, + 116,45,116,101,115,116,105,110,103,32,97,110,100,32,99,111,108,111,117,114,32,111,118,101,114,108,97,121,32,119,104,101,110,32,99,108,105,99,107,101, + 100,34,41,41,59,13,10,13,10,32,32,32,32,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,32,32,32,32,67,111,108,111,117,114,67,104,97,110,103,101,66, + 117,116,116,111,110,42,32,99,111,108,111,117,114,67,104,97,110,103,101,66,117,116,116,111,110,32,61,32,110,101,119,32,67,111,108,111,117,114,67,104, + 97,110,103,101,66,117,116,116,111,110,40,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,99,111,108,111,117,114,67,104,97,110,103,101,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,99,111,108,111,117,114,67,104, + 97,110,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,51,53,48,44,32,51,48,41, + 59,13,10,13,10,32,32,32,32,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,32,32,32,32,97,110,105,109,97,116,101,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,84,40,34,99,108,105,99,107,32,116,111,32,97,110,105,109,97,116,101,46,46,46,34,41,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,97,110,105,109,97,116,101,66,117,116, + 116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,97,110,105,109,97,116,101,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116, + 104,84,111,70,105,116,84,101,120,116,32,40,50,52,41,59,13,10,32,32,32,32,32,32,32,32,97,110,105,109,97,116,101,66,117,116,116,111,110,45, + 62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,51,53,48,44,32,55,48,41,59,13,10,32,32,32,32,32,32,32,32, + 97,110,105,109,97,116,101,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,125,13,10,13,10,32,32,32,32,126,66,117,116,116,111,110,115,80,97,103,101,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,98,117,116,116,111,110,67,108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,41,13,10,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115, + 40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105, + 102,32,40,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,105,41,32,33,61,32,97,110,105,109,97,116,101,66,117,116,116,111, + 110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,110,105,109,97, + 116,111,114,46,97,110,105,109,97,116,101,67,111,109,112,111,110,101,110,116,32,40,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32, + 40,105,41,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,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,82,101,99,116,97,110,103,108,101,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110, + 100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,87,105,100,116,104,40,41,32,47,32,50,41,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,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,32,32,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116, + 32,40,103,101,116,72,101,105,103,104,116,40,41,32,47,32,50,41,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,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,32,32,32,32,54,48,32,43,32, + 82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,87,105, + 100,116,104,40,41,32,47,32,51,41,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,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,32,32,32,32,49,54,32,43,32,82,97,110,100,111,109,58,58, + 103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,72,101,105,103,104,116,40,41,32,47, + 32,54,41,41,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,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,53,48,48,32,43,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40, + 41,46,110,101,120,116,73,110,116,32,40,50,48,48,48,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82, + 97,110,100,111,109,40,41,46,110,101,120,116,68,111,117,98,108,101,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115, + 116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,68,111,117,98,108,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,101,120, + 116,66,117,116,116,111,110,42,32,97,110,105,109,97,116,101,66,117,116,116,111,110,59,13,10,32,32,32,32,67,111,109,112,111,110,101,110,116,65,110, + 105,109,97,116,111,114,32,97,110,105,109,97,116,111,114,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,115,116,97,116,105,99,32,67,111,109,112,111, + 110,101,110,116,42,32,99,114,101,97,116,101,77,105,115,99,80,97,103,101,40,41,13,10,123,13,10,32,32,32,32,68,101,109,111,80,97,103,101,67, + 111,109,112,42,32,112,97,103,101,32,61,32,110,101,119,32,68,101,109,111,80,97,103,101,67,111,109,112,40,41,59,13,10,13,10,32,32,32,32,84, + 101,120,116,69,100,105,116,111,114,42,32,116,101,120,116,69,100,105,116,111,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,40,41, + 59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,116,101,120,116,69,100,105,116, + 111,114,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,50,53,44, + 32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,84,101,120,116,32,40,84,40,34, + 115,105,110,103,108,101,45,108,105,110,101,32,116,101,120,116,32,98,111,120,34,41,41,59,13,10,13,10,32,32,32,32,116,101,120,116,69,100,105,116, + 111,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,112,97,115,115,119,111,114,100,34,41,44,32,40,116,99,104, + 97,114,41,32,48,120,50,48,50,50,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108, + 101,32,40,116,101,120,116,69,100,105,116,111,114,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,66,111,117,110, + 100,115,32,40,49,48,44,32,53,53,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115, + 101,116,84,101,120,116,32,40,84,40,34,112,97,115,115,119,111,114,100,34,41,41,59,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,67,111,109, + 98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120,32,40,84,40,34,99,111,109,98,111, + 34,41,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,99,111,109,98,111, + 66,111,120,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,48,44,32,50,53,44, + 32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,69,100,105,116,97,98,108,101,84,101,120, + 116,32,40,116,114,117,101,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,74,117,115,116,105,102,105,99,97,116,105,111, + 110,84,121,112,101,32,40,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,41,59,13,10,13,10,32,32,32,32,105, + 110,116,32,105,59,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,49,59,32,105,32,60,32,49,48,48,59,32,43,43,105,41,13,10,32,32, + 32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,99,111,109,98,111,32,98,111,120,32,105,116, + 101,109,32,34,41,32,43,32,83,116,114,105,110,103,32,40,105,41,44,32,105,41,59,13,10,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45, + 62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,49,41,59,13,10,13,10,32,32,32,32,68,114,97,103,79,110,116,111,68,101,115,107,116, + 111,112,68,101,109,111,67,111,109,112,42,32,100,32,61,32,110,101,119,32,68,114,97,103,79,110,116,111,68,101,115,107,116,111,112,68,101,109,111,67, + 111,109,112,32,40,112,97,103,101,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101, + 32,40,100,41,59,13,10,32,32,32,32,100,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,44,32,49,48,48,44,32,50,48,48,44,32,56, + 48,41,59,13,10,13,10,32,32,32,32,114,101,116,117,114,110,32,112,97,103,101,59,13,10,125,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,84,111, + 111,108,98,97,114,68,101,109,111,67,111,109,112,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,32,112,117,98,108,105,99,32,83,108,105,100,101,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,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,84,111,111,108,98,97,114,68, + 101,109,111,67,111,109,112,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99,111,109,109, + 97,110,100,77,97,110,97,103,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114,101,97,116,101,32,97,110, + 100,32,97,100,100,32,116,104,101,32,116,111,111,108,98,97,114,46,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,116,111,111,108,98,97,114,32,61,32,110,101,119,32,84,111,111,108,98,97,114,40,41,41,59,13,10,13,10,32,32, + 32,32,32,32,32,32,47,47,32,65,110,100,32,117,115,101,32,111,117,114,32,105,116,101,109,32,102,97,99,116,111,114,121,32,116,111,32,97,100,100, + 32,97,32,115,101,116,32,111,102,32,100,101,102,97,117,108,116,32,105,99,111,110,115,32,116,111,32,105,116,46,46,46,13,10,32,32,32,32,32,32, + 32,32,116,111,111,108,98,97,114,45,62,97,100,100,68,101,102,97,117,108,116,73,116,101,109,115,32,40,102,97,99,116,111,114,121,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,47,47,32,78,111,119,32,119,101,39,108,108,32,106,117,115,116,32,99,114,101,97,116,101,32,116,104,101,32,111,116, + 104,101,114,32,115,108,105,100,101,114,115,32,97,110,100,32,98,117,116,116,111,110,115,32,111,110,32,116,104,101,32,100,101,109,111,32,112,97,103,101, + 44,32,119,104,105,99,104,32,97,100,106,117,115,116,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,116,111,111,108,98,97,114,39,115, + 32,112,114,111,112,101,114,116,105,101,115,46,46,46,13,10,32,32,32,32,32,32,32,32,76,97,98,101,108,42,32,105,110,102,111,32,61,32,110,101, + 119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,65,115, + 32,119,101,108,108,32,97,115,32,115,104,111,119,105,110,103,32,111,102,102,32,116,111,111,108,98,97,114,115,44,32,116,104,105,115,32,100,101,109,111, + 32,105,108,108,117,115,116,114,97,116,101,115,32,104,111,119,32,116,111,32,115,116,111,114,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,34,97,32,115,101,116,32,111,102,32,83,86,71,32,102,105,108,101,115,32,105,110,32,97,32,90,105,112,32,102,105,108,101,44,32,101,109,98,101, + 100,32,116,104,97,116,32,105,110,32,121,111,117,114,32,97,112,112,108,105,99,97,116,105,111,110,44,32,97,110,100,32,114,101,97,100,32,34,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,34,116,104,101,109,32,98,97,99,107,32,105,110,32,97,116,32,114,117,110,116,105,109,101,46,92,110,92, + 110,84,104,101,32,105,99,111,110,32,105,109,97,103,101,115,32,104,101,114,101,32,97,114,101,32,116,97,107,101,110,32,102,114,111,109,32,116,104,101, + 32,111,112,101,110,45,115,111,117,114,99,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,84,97,110,103,111,32,105,99,111,110,32, + 112,114,111,106,101,99,116,46,34,41,59,13,10,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,105,110,102,111,41,59,13,10,32,32,32,32,32,32,32,32,105,110,102,111,45,62,115,101,116,74,117,115,116,105,102,105,99,97,116,105,111,110, + 84,121,112,101,32,40,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,116,111,112,76,101,102,116,41,59,13,10,32,32,32,32,32,32,32,32, + 105,110,102,111,45,62,115,101,116,66,111,117,110,100,115,32,40,56,48,44,32,56,48,44,32,52,53,48,44,32,49,48,48,41,59,13,10,32,32,32, + 32,32,32,32,32,105,110,102,111,45,62,115,101,116,73,110,116,101,114,99,101,112,116,115,77,111,117,115,101,67,108,105,99,107,115,32,40,102,97,108, + 115,101,44,32,102,97,108,115,101,41,59,13,10,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,100,101,112,116,104,83,108,105,100,101,114,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,116,111,111,108,98,97,114,32,100, + 101,112,116,104,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103, + 101,32,40,49,48,46,48,44,32,50,48,48,46,48,44,32,49,46,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100, + 101,114,45,62,115,101,116,86,97,108,117,101,32,40,53,48,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104, + 83,108,105,100,101,114,45,62,115,101,116,83,108,105,100,101,114,83,116,121,108,101,32,40,83,108,105,100,101,114,58,58,76,105,110,101,97,114,72,111, + 114,105,122,111,110,116,97,108,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,84,101,120,116, + 66,111,120,83,116,121,108,101,32,40,83,108,105,100,101,114,58,58,84,101,120,116,66,111,120,76,101,102,116,44,32,102,97,108,115,101,44,32,56,48, + 44,32,50,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,97,100,100,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,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115, + 32,40,56,48,44,32,50,49,48,44,32,51,48,48,44,32,50,50,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108, + 32,40,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,78,97,109,101,40,41,44,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103, + 101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,100,101,112,116,104,83,108,105,100, + 101,114,44,32,102,97,108,115,101,41,59,13,10,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,111,114,105,101,110,116,97,116,105,111,110,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,84,40, + 34,118,101,114,116,105,99,97,108,47,104,111,114,105,122,111,110,116,97,108,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,111,114,105,101,110, + 116,97,116,105,111,110,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,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84, + 111,70,105,116,84,101,120,116,32,40,50,50,41,59,13,10,32,32,32,32,32,32,32,32,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111, + 110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,88, + 40,41,44,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,66,111,116,116,111,109,40,41,32,43,32,50,48,41,59,13,10,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,99,117,115,116,111,109,105,115,101,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,84,40,34,99,117,115,116,111,109,105,115,101,46,46,46,34,41,41,41,59, + 13,10,32,32,32,32,32,32,32,32,99,117,115,116,111,109,105,115,101,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,99,117,115,116,111,109,105,115,101,66,117,116,116,111,110,45,62,99, + 104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,50,41,59,13,10,32,32,32,32,32,32,32,32,99,117,115,116,111, + 109,105,115,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,111,114,105,101,110,116,97,116, + 105,111,110,66,117,116,116,111,110,45,62,103,101,116,82,105,103,104,116,40,41,32,43,32,50,48,44,32,111,114,105,101,110,116,97,116,105,111,110,66, + 117,116,116,111,110,45,62,103,101,116,89,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,111,111,108,98,97,114,68,101, + 109,111,67,111,109,112,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,105,102,32,40,116,111,111,108,98,97,114,45,62,105,115,86,101,114,116,105,99,97,108,40,41,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,40,105,110, + 116,41,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,41, + 59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101, + 116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32,40,105,110,116,41,32,100,101,112,116,104,83,108, + 105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,108, + 105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83,108,105,100,101,114,42,32,115,108,105,100,101,114,41,13,10,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,114,101,115,105,122,101,100,40,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32, + 32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111,110,41,13, + 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101,116,86,101,114,116, + 105,99,97,108,32,40,33,32,116,111,111,108,98,97,114,45,62,105,115,86,101,114,116,105,99,97,108,40,41,41,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,114,101,115,105,122,101,100,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101, + 32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,99,117,115,116,111,109,105,115,101,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,104,111,119,67,117,115,116,111,109,105,115,97,116,105, + 111,110,68,105,97,108,111,103,32,40,102,97,99,116,111,114,121,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13, + 10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,111,111,108,98,97,114,42,32,116,111,111,108,98,97,114,59,13,10,32,32,32,32,83,108, + 105,100,101,114,42,32,100,101,112,116,104,83,108,105,100,101,114,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,111,114,105,101, + 110,116,97,116,105,111,110,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,99,117,115,116,111,109,105,115, + 101,66,117,116,116,111,110,59,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,99,108,97,115,115,32,68,101,109,111,84,111,111,108,98,97,114,73, + 116,101,109,70,97,99,116,111,114,121,32,32,32,58,32,112,117,98,108,105,99,32,84,111,111,108,98,97,114,73,116,101,109,70,97,99,116,111,114,121, + 13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,84,111,111,108,98,97, + 114,73,116,101,109,70,97,99,116,111,114,121,40,41,32,123,125,13,10,32,32,32,32,32,32,32,32,126,68,101,109,111,84,111,111,108,98,97,114,73, + 116,101,109,70,97,99,116,111,114,121,40,41,32,123,125,13,10,13,10,32,32,32,32,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,32,32,32,32,47,47,32, + 69,97,99,104,32,116,121,112,101,32,111,102,32,105,116,101,109,32,97,32,116,111,111,108,98,97,114,32,99,97,110,32,99,111,110,116,97,105,110,32, + 109,117,115,116,32,98,101,32,103,105,118,101,110,32,97,32,117,110,105,113,117,101,32,73,68,46,32,84,104,101,115,101,13,10,32,32,32,32,32,32, + 32,32,47,47,32,97,114,101,32,116,104,101,32,111,110,101,115,32,119,101,39,108,108,32,117,115,101,32,105,110,32,116,104,105,115,32,100,101,109,111, + 46,13,10,32,32,32,32,32,32,32,32,101,110,117,109,32,68,101,109,111,84,111,111,108,98,97,114,73,116,101,109,73,100,115,13,10,32,32,32,32, + 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,111,99,95,110,101,119,32,32,32,32,32,32,32,32,32,61,32,49,44,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,100,111,99,95,111,112,101,110,32,32,32,32,32,32,32,32,61,32,50,44,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,100,111,99,95,115,97,118,101,32,32,32,32,32,32,32,32,61,32,51,44,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,100,111,99,95,115,97,118,101,65,115,32,32,32,32,32,32,61,32,52,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95, + 99,111,112,121,32,32,32,32,32,32,32,61,32,53,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95,99,117,116,32,32,32, + 32,32,32,32,32,61,32,54,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95,112,97,115,116,101,32,32,32,32,32,32,61, + 32,55,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,76,111,103,111,66,117,116,116,111,110,32,32,61,32,56,44,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,99,117,115,116,111,109,67,111,109,98,111,66,111,120,32,32,61,32,57,13,10,32,32,32,32,32,32,32,32, + 125,59,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,103,101,116,65,108,108,84,111,111,108,98,97,114,73,116,101,109,73,100,115,32, + 40,65,114,114,97,121,32,60,105,110,116,62,38,32,105,100,115,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,47,47,32,84,104,105,115,32,114,101,116,117,114,110,115,32,116,104,101,32,99,111,109,112,108,101,116,101,32,108,105,115,116,32,111,102,32, + 97,108,108,32,105,116,101,109,32,73,68,115,32,116,104,97,116,32,97,114,101,32,97,108,108,111,119,101,100,32,116,111,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,47,47,32,103,111,32,105,110,32,111,117,114,32,116,111,111,108,98,97,114,46,32,65,110,121,32,105,116,101,109,115,32,121,111, + 117,32,109,105,103,104,116,32,119,97,110,116,32,116,111,32,97,100,100,32,109,117,115,116,32,98,101,32,108,105,115,116,101,100,32,104,101,114,101,46, + 32,84,104,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,111,114,100,101,114,32,105,110,32,119,104,105,99,104,32,116,104,101,121, + 32,97,114,101,32,108,105,115,116,101,100,32,119,105,108,108,32,98,101,32,117,115,101,100,32,98,121,32,116,104,101,32,116,111,111,108,98,97,114,32, + 99,117,115,116,111,109,105,115,97,116,105,111,110,32,112,97,110,101,108,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46, + 97,100,100,32,40,100,111,99,95,110,101,119,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99, + 95,111,112,101,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,65,115,41,59,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,111,112,121,41,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,117,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46, + 97,100,100,32,40,101,100,105,116,95,112,97,115,116,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40, + 106,117,99,101,76,111,103,111,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,99, + 117,115,116,111,109,67,111,109,98,111,66,111,120,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,121,111,117, + 39,114,101,32,103,111,105,110,103,32,116,111,32,117,115,101,32,115,101,112,97,114,97,116,111,114,115,44,32,116,104,101,110,32,116,104,101,121,32,109, + 117,115,116,32,97,108,115,111,32,98,101,32,97,100,100,101,100,32,101,120,112,108,105,99,105,116,108,121,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,47,47,32,116,111,32,116,104,101,32,108,105,115,116,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40, + 115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115, + 112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101, + 83,112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,103,101, + 116,68,101,102,97,117,108,116,73,116,101,109,83,101,116,32,40,65,114,114,97,121,32,60,105,110,116,62,38,32,105,100,115,41,13,10,32,32,32,32, + 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,105,115,32,114,101,116,117,114,110,115,32,97,110,32,111,114, + 100,101,114,101,100,32,108,105,115,116,32,111,102,32,116,104,101,32,115,101,116,32,111,102,32,105,116,101,109,115,32,116,104,97,116,32,109,97,107,101, + 32,117,112,32,97,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,111,111,108,98,97,114,39,115,32,100,101,102,97,117,108,116,32, + 115,101,116,46,32,78,111,116,32,97,108,108,32,105,116,101,109,115,32,110,101,101,100,32,116,111,32,98,101,32,111,110,32,116,104,105,115,32,108,105, + 115,116,44,32,97,110,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105,116,101,109,115,32,99,97,110,32,97,112,112,101,97,114, + 32,109,117,108,116,105,112,108,101,32,116,105,109,101,115,32,40,101,46,103,46,32,116,104,101,32,115,101,112,97,114,97,116,111,114,115,32,117,115,101, + 100,32,104,101,114,101,41,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,110,101,119,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,111,112,101,110,41,59,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,65,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97, + 100,100,32,40,115,112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112, + 97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116, + 95,99,111,112,121,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,117,116,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,112,97,115,116,101,41,59,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101,83,112,97,99,101,114,73,100,41,59,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,99,117,115,116,111,109,67,111,109,98,111,66,111,120,41,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101,83,112,97,99,101,114,73,100,41,59,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,106,117,99,101,76,111,103,111,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32, + 32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,42,32,99,114, + 101,97,116,101,73,116,101,109,32,40,99,111,110,115,116,32,105,110,116,32,105,116,101,109,73,100,41,13,10,32,32,32,32,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,115,119,105,116,99,104,32,40,105,116,101,109,73,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,110,101,119,58,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71, + 32,40,105,116,101,109,73,100,44,32,84,40,34,110,101,119,34,41,44,32,84,40,34,100,111,99,117,109,101,110,116,45,110,101,119,46,115,118,103,34, + 41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,111,112,101,110,58,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108, + 101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,111,112,101,110,34,41,44,32,84,40,34,100,111,99,117,109,101,110,116,45,111,112,101, + 110,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,115,97,118,101,58,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109, + 90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,115,97,118,101,34,41,44,32,84,40,34,100,111,99,117,109,101, + 110,116,45,115,97,118,101,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95, + 115,97,118,101,65,115,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117, + 116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,115,97,118,101,32,97,115,34,41, + 44,32,84,40,34,100,111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,99,111,112,121,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101, + 116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44, + 32,84,40,34,99,111,112,121,34,41,44,32,84,40,34,101,100,105,116,45,99,111,112,121,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,99,117,116,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73, + 100,44,32,84,40,34,99,117,116,34,41,44,32,84,40,34,101,100,105,116,45,99,117,116,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,112,97,115,116,101,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101, + 109,73,100,44,32,84,40,34,112,97,115,116,101,34,41,44,32,84,40,34,101,100,105,116,45,112,97,115,116,101,46,115,118,103,34,41,41,59,13,10, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,106,117,99,101,76,111,103,111,66,117,116,116,111,110,58,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,84,111,111,108,98,97,114,66,117,116,116,111,110,32,40,105,116, + 101,109,73,100,44,32,84,40,34,106,117,99,101,33,34,41,44,32,68,114,97,119,97,98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109, + 97,103,101,68,97,116,97,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116, + 97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115, + 101,32,99,117,115,116,111,109,67,111,109,98,111,66,111,120,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114, + 110,32,110,101,119,32,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,32,40,105,116,101,109,73,100,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,102,97,117,108,116,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98, + 114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117, + 114,110,32,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32, + 32,32,83,116,114,105,110,103,65,114,114,97,121,32,105,99,111,110,78,97,109,101,115,59,13,10,32,32,32,32,32,32,32,32,79,119,110,101,100,65, + 114,114,97,121,32,60,68,114,97,119,97,98,108,101,62,32,105,99,111,110,115,70,114,111,109,90,105,112,70,105,108,101,59,13,10,13,10,32,32,32, + 32,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,97,32,108,105,116,116,108,101,32,117,116,105,108,105,116,121,32,116,111,32,99,114,101,97, + 116,101,32,97,32,98,117,116,116,111,110,32,119,105,116,104,32,111,110,101,32,111,102,32,116,104,101,32,83,86,71,32,105,109,97,103,101,115,32,105, + 110,13,10,32,32,32,32,32,32,32,32,47,47,32,111,117,114,32,101,109,98,101,100,100,101,100,32,90,73,80,32,102,105,108,101,32,34,105,99,111, + 110,115,46,122,105,112,34,13,10,32,32,32,32,32,32,32,32,84,111,111,108,98,97,114,66,117,116,116,111,110,42,32,99,114,101,97,116,101,66,117, + 116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,99,111,110,115,116,32,105,110,116,32,105,116,101,109,73,100,44,32,99,111, + 110,115,116,32,83,116,114,105,110,103,38,32,116,101,120,116,44,32,99,111,110,115,116,32,83,116,114,105,110,103,38,32,102,105,108,101,110,97,109,101, + 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,99,111,110,115,70,114,111,109,90, + 105,112,70,105,108,101,46,115,105,122,101,40,41,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,119,101,39,118,101,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,110,101, + 32,115,111,44,32,108,111,97,100,32,97,108,108,32,116,104,101,32,105,109,97,103,101,115,32,102,114,111,109,32,116,104,101,32,122,105,112,32,102,105, + 108,101,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,77,101,109,111,114,121,73,110,112,117,116,83,116,114,101,97,109,32, + 105,99,111,110,115,70,105,108,101,83,116,114,101,97,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,44,32, + 66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,83,105,122,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,90,105,112,70,105,108,101,32,105,99,111,110,115,32,40,38,105,99,111,110,115,70,105,108,101,83,116,114, + 101,97,109,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116, + 32,105,32,61,32,48,59,32,105,32,60,32,105,99,111,110,115,46,103,101,116,78,117,109,69,110,116,114,105,101,115,40,41,59,32,43,43,105,41,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 73,110,112,117,116,83,116,114,101,97,109,42,32,115,118,103,70,105,108,101,83,116,114,101,97,109,32,61,32,105,99,111,110,115,46,99,114,101,97,116, + 101,83,116,114,101,97,109,70,111,114,69,110,116,114,121,32,40,105,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,105,102,32,40,115,118,103,70,105,108,101,83,116,114,101,97,109,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,123,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,105,99,111,110, + 78,97,109,101,115,46,97,100,100,32,40,105,99,111,110,115,46,103,101,116,69,110,116,114,121,40,105,41,45,62,102,105,108,101,110,97,109,101,41,59, + 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,105,99,111,110,115,70,114,111,109,90,105,112,70,105, + 108,101,46,97,100,100,32,40,68,114,97,119,97,98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109,97,103,101,68,97,116,97,83,116,114, + 101,97,109,32,40,42,115,118,103,70,105,108,101,83,116,114,101,97,109,41,41,59,13,10,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,100,101,108,101,116,101,32,115,118,103,70,105,108,101,83,116,114,101,97,109,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,42,32,105,109,97,103,101,32, + 61,32,105,99,111,110,115,70,114,111,109,90,105,112,70,105,108,101,32,91,105,99,111,110,78,97,109,101,115,46,105,110,100,101,120,79,102,32,40,102, + 105,108,101,110,97,109,101,41,93,45,62,99,114,101,97,116,101,67,111,112,121,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101, + 116,117,114,110,32,110,101,119,32,84,111,111,108,98,97,114,66,117,116,116,111,110,32,40,105,116,101,109,73,100,44,32,116,101,120,116,44,32,105,109, + 97,103,101,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,48,59,13,10,32,32,32,32,32, + 32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,68,101,109,111,110,115,116,114,97,116,101,115,32,104,111,119,32,116,111,32,112, + 117,116,32,97,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101,110,116,32,105,110,116,111,32,97,32,116,111,111,108,98,97,114,32,45,32,116, + 104,105,115,32,111,110,101,32,99,111,110,116,97,105,110,115,13,10,32,32,32,32,32,32,32,32,47,47,32,97,32,67,111,109,98,111,66,111,120,46, + 13,10,32,32,32,32,32,32,32,32,99,108,97,115,115,32,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,32,58,32, + 112,117,98,108,105,99,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,67,117,115,116,111,109,84,111,111,108,98, + 97,114,67,111,109,98,111,66,111,120,32,40,99,111,110,115,116,32,105,110,116,32,116,111,111,108,98,97,114,73,116,101,109,73,100,41,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,58,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,32,40,116,111, + 111,108,98,97,114,73,116,101,109,73,100,44,32,84,40,34,67,117,115,116,111,109,32,84,111,111,108,98,97,114,32,73,116,101,109,34,41,44,32,102, + 97,108,115,101,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,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,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120, + 32,40,84,40,34,100,101,109,111,32,116,111,111,108,98,97,114,32,99,111,109,98,111,32,98,111,120,34,41,41,41,59,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,49,59,32,105,32,60,32,50,48,59,32,43,43,105,41, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32, + 40,84,40,34,84,111,111,108,98,97,114,32,67,111,109,98,111,66,111,120,32,105,116,101,109,32,34,41,32,43,32,83,116,114,105,110,103,32,40,105, + 41,44,32,105,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,83, + 101,108,101,99,116,101,100,73,100,32,40,49,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120, + 45,62,115,101,116,69,100,105,116,97,98,108,101,84,101,120,116,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125, + 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,126,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,40,41, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, + 99,111,109,98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 98,111,111,108,32,103,101,116,84,111,111,108,98,97,114,73,116,101,109,83,105,122,101,115,32,40,105,110,116,32,116,111,111,108,98,97,114,68,101,112, + 116,104,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,32,32,32,32,32,32,32,32,32,32, + 32,32,32,98,111,111,108,32,105,115,84,111,111,108,98,97,114,86,101,114,116,105,99,97,108,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,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,38,32,112,114,101,102,101,114,114,101,100, + 83,105,122,101,44,32,105,110,116,38,32,109,105,110,83,105,122,101,44,32,105,110,116,38,32,109,97,120,83,105,122,101,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,115,84,111,111,108,98,97,114,86, + 101,114,116,105,99,97,108,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,102,97,108, + 115,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,114,101,102,101,114,114,101,100,83,105,122,101,32,61,32,50, + 53,48,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,109,105,110,83,105,122,101,32,61,32,56,48,59,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,109,97,120,83,105,122,101,32,61,32,51,48,48,59,13,10,32,32,32,32,32,32,32,32,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,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,118,111,105,100,32,112,97,105,110,116,66,117,116,116,111,110,65,114,101,97,32,40,71,114,97,112,104,105,99,115,38,44,32, + 105,110,116,44,32,105,110,116,44,32,98,111,111,108,44,32,98,111,111,108,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,116,101,110,116,65, + 114,101,97,67,104,97,110,103,101,100,32,40,99,111,110,115,116,32,82,101,99,116,97,110,103,108,101,38,32,99,111,110,116,101,110,116,65,114,101,97, + 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66, + 111,120,45,62,115,101,116,83,105,122,101,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,87,105,100,116,104,40,41,32,45,32,50,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,32,32,32,32,32,32,32,32,32,32,106,109,105, + 110,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,72,101,105,103,104,116,40,41,32,45,32,50,44,32,50,50,41,41,59,13,10,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,67,101,110,116,114,101,80,111,115,105, + 116,105,111,110,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,67,101,110,116,114,101,88,40,41,44,32,99,111,110,116,101,110,116,65, + 114,101,97,46,103,101,116,67,101,110,116,114,101,89,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32, + 32,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,98,111,66,111,120,42,32,99,111,109, + 98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,125,59,13,10,32,32,32,32,125,59,13,10,13,10,32,32,32,32,68,101,109,111,84,111, + 111,108,98,97,114,73,116,101,109,70,97,99,116,111,114,121,32,102,97,99,116,111,114,121,59,13,10,125,59,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,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,115,111,109,101,32,100,114,97,119,97,98,108,101,115,32,116, - 111,32,117,115,101,32,102,111,114,32,111,117,114,32,100,114,97,119,97,98,108,101,32,98,117,116,116,111,110,115,46,46,46,13,10,32,32,32,32,32, - 32,32,32,68,114,97,119,97,98,108,101,80,97,116,104,32,110,111,114,109,97,108,44,32,111,118,101,114,59,13,10,13,10,32,32,32,32,32,32,32, - 32,80,97,116,104,32,112,59,13,10,32,32,32,32,32,32,32,32,112,46,97,100,100,83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44, - 32,53,44,32,50,48,46,48,102,44,32,53,48,46,48,102,44,32,48,46,50,102,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108, - 46,115,101,116,80,97,116,104,32,40,112,41,59,13,10,32,32,32,32,32,32,32,32,110,111,114,109,97,108,46,115,101,116,83,111,108,105,100,70,105, - 108,108,32,40,67,111,108,111,117,114,115,58,58,114,101,100,41,59,13,10,13,10,32,32,32,32,32,32,32,32,112,46,99,108,101,97,114,40,41,59, - 13,10,32,32,32,32,32,32,32,32,112,46,97,100,100,83,116,97,114,32,40,48,46,48,102,44,32,48,46,48,102,44,32,55,44,32,51,48,46,48, - 102,44,32,53,48,46,48,102,44,32,48,46,48,102,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,80,97,116,104,32,40, - 112,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,83,111,108,105,100,70,105,108,108,32,40,67,111,108,111,117,114,115,58, - 58,112,105,110,107,41,59,13,10,32,32,32,32,32,32,32,32,111,118,101,114,46,115,101,116,79,117,116,108,105,110,101,32,40,53,46,48,102,44,32, - 67,111,108,111,117,114,115,58,58,98,108,97,99,107,41,59,13,10,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,73,109,97,103, - 101,32,100,111,119,110,59,13,10,32,32,32,32,32,32,32,32,100,111,119,110,46,115,101,116,73,109,97,103,101,32,40,73,109,97,103,101,67,97,99, - 104,101,58,58,103,101,116,70,114,111,109,77,101,109,111,114,121,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44, - 32,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,44,32,116,114,117,101,41,59,13,10,32,32,32,32, - 32,32,32,32,100,111,119,110,46,115,101,116,79,118,101,114,108,97,121,67,111,108,111,117,114,32,40,67,111,108,111,117,114,115,58,58,98,108,97,99, - 107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,51,102,41,41,59,13,10,13,10,32,32,32,32,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,13,10,99,108,97,115,115, + 32,68,101,109,111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,32,58,32,112,117,98,108,105,99,32,84,97,98,98,101,100,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,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,68,101,109, + 111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97, + 103,101,114,42,32,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,32,32,32,32,32,32,32,32,58,32,84,97,98,98,101,100,67,111, + 109,112,111,110,101,110,116,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,13,10,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,115,108,105,100,101,114,115,34,41,44,32,32,32,32,32,32, + 32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,99,114,101,97,116,101,83,108,105,100,101,114,115,80, + 97,103,101,40,41,44,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,116, + 111,111,108,98,97,114,115,34,41,44,32,32,32,32,32,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44, + 32,110,101,119,32,84,111,111,108,98,97,114,68,101,109,111,67,111,109,112,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,44,32,32, + 32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,98,117,116,116,111,110,115,34,41,44,32, + 32,32,32,32,32,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,110,101,119,32,66,117,116,116,111, + 110,115,80,97,103,101,32,40,116,104,105,115,41,44,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32, + 40,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,115,34,41,44,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111, + 117,114,40,41,44,32,99,114,101,97,116,101,82,97,100,105,111,66,117,116,116,111,110,80,97,103,101,40,41,44,32,32,116,114,117,101,41,59,13,10, + 32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,109,105,115,99,32,119,105,100,103,101,116,115,34,41,44,32,32,103,101,116,82, + 97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,99,114,101,97,116,101,77,105,115,99,80,97,103,101,40,41,44,32,32, + 32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,97,98,98,101,100,67, + 111,109,112,111,110,101,110,116,40,41,13,10,32,32,32,32,123,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,66,117,98,98,108,101,77,101,115,115,97,103,101,67,111,109,112,111,110,101,110,116,42,32,98,109,99,32,61,32,110,101,119,32,66,117, + 98,98,108,101,77,101,115,115,97,103,101,67,111,109,112,111,110,101,110,116,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,68, + 101,115,107,116,111,112,58,58,99,97,110,85,115,101,83,101,109,105,84,114,97,110,115,112,97,114,101,110,116,87,105,110,100,111,119,115,40,41,41,13, + 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,109,99,45,62,115,101,116,65,108,119,97,121,115,79,110, + 84,111,112,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,109,99,45,62,97,100,100,84,111,68,101,115,107,116, + 111,112,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,98,109,99,41, + 59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,98,109,99,45,62,115,104,111,119,65,116,32,40,98,117,116, + 116,111,110,44,32,84,40,34,84,104,105,115,32,105,115,32,97,32,100,101,109,111,32,111,102,32,116,104,101,32,66,117,98,98,108,101,77,101,115,115, + 97,103,101,67,111,109,112,111,110,101,110,116,44,32,119,104,105,99,104,32,108,101,116,115,32,121,111,117,32,112,111,112,32,117,112,32,97,32,109,101, + 115,115,97,103,101,32,112,111,105,110,116,105,110,103,32,97,116,32,97,32,99,111,109,112,111,110,101,110,116,32,111,114,32,115,111,109,101,119,104,101, + 114,101,32,111,110,32,116,104,101,32,115,99,114,101,101,110,46,92,110,92,110,84,104,101,32,109,101,115,115,97,103,101,32,98,117,98,98,108,101,115, + 32,119,105,108,108,32,100,105,115,97,112,112,101,97,114,32,97,102,116,101,114,32,97,32,116,105,109,101,111,117,116,32,112,101,114,105,111,100,44,32, + 111,114,32,119,104,101,110,32,116,104,101,32,109,111,117,115,101,32,105,115,32,99,108,105,99,107,101,100,46,34,41,44,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,50,48,48,48,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,125, + 13,10,13,10,32,32,32,32,115,116,97,116,105,99,32,99,111,110,115,116,32,67,111,108,111,117,114,32,103,101,116,82,97,110,100,111,109,66,114,105, + 103,104,116,67,111,108,111,117,114,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,67,111,108,111,117, + 114,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41, + 44,32,48,46,49,102,44,32,48,46,57,55,102,44,32,49,46,48,102,41,59,13,10,32,32,32,32,125,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,13,10,32,32,32,32,32,32, - 32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45,97,98,111,118,101,45,116,101,120,116,32,98,117,116,116,111,110,32,102, - 114,111,109,32,116,104,101,115,101,32,100,114,97,119,97,98,108,101,115,46,46,13,10,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,66, - 117,116,116,111,110,42,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116,111, - 110,32,49,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,65,98,111,118,101,84,101,120,116,76,97,98, - 101,108,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111, - 118,101,114,44,32,38,100,111,119,110,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,51,48,44,32, - 56,48,44,32,56,48,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105, - 115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,119,105,116,104,32,97,32,108,97,98,101,108,34,41,41,59,13,10, - 13,10,32,32,32,32,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,13,10, + 99,108,97,115,115,32,68,101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100,32,32,58,32,112,117,98,108,105,99,32,84,104,114, + 101,97,100,87,105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68, + 101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100,40,41,13,10,32,32,32,32,32,32,32,32,58,32,84,104,114,101,97,100,87, + 105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,32,40,84,40,34,98,117,115,121,32,100,111,105,110,103,32,115,111,109,101,32,105,109, + 112,111,114,116,97,110,116,32,116,104,105,110,103,115,46,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,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,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,115,101,116,83,116,97,116,117,115,77,101,115,115,97,103,101,32,40,84,40,34,71,101,116,116,105,110,103,32,114,101,97,100,121,46,46,46, + 34,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100, + 40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,117,110,40,41,13,10,32,32,32,32, + 123,13,10,32,32,32,32,32,32,32,32,115,101,116,80,114,111,103,114,101,115,115,32,40,45,49,46,48,41,59,32,47,47,32,115,101,116,116,105,110, + 103,32,97,32,118,97,108,117,101,32,98,101,121,111,110,100,32,116,104,101,32,114,97,110,103,101,32,48,32,45,62,32,49,32,119,105,108,108,32,115, + 104,111,119,32,97,32,115,112,105,110,110,105,110,103,32,98,97,114,46,46,13,10,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117,115,77, + 101,115,115,97,103,101,32,40,84,40,34,80,114,101,112,97,114,105,110,103,32,116,111,32,100,111,32,115,111,109,101,32,115,116,117,102,102,46,46,46, + 34,41,41,59,13,10,32,32,32,32,32,32,32,32,119,97,105,116,32,40,50,48,48,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111, + 110,115,116,32,105,110,116,32,116,104,105,110,103,115,84,111,68,111,32,61,32,49,48,59,13,10,13,10,32,32,32,32,32,32,32,32,102,111,114,32, + 40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,116,104,105,110,103,115,84,111,68,111,59,32,43,43,105,41,13,10,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,109,117,115,116,32,99,104,101,99,107,32,116,104,105,115,32,97,115,32,111, + 102,116,101,110,32,97,115,32,112,111,115,115,105,98,108,101,44,32,98,101,99,97,117,115,101,32,116,104,105,115,32,105,115,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,47,47,32,104,111,119,32,119,101,32,107,110,111,119,32,105,102,32,116,104,101,32,117,115,101,114,39,115,32,112,114,101,115, + 115,101,100,32,39,99,97,110,99,101,108,39,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,104,114,101,97,100,83,104,111,117, + 108,100,69,120,105,116,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,119,105,108,108,32,117,112,100,97,116,101,32,116,104,101,32,112,114,111,103,114,101,115, + 115,32,98,97,114,32,111,110,32,116,104,101,32,100,105,97,108,111,103,32,98,111,120,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,101,116, + 80,114,111,103,114,101,115,115,32,40,105,32,47,32,40,100,111,117,98,108,101,41,32,116,104,105,110,103,115,84,111,68,111,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117,115,77,101,115,115,97,103,101,32,40,83,116,114,105,110,103,32,40,116,104,105, + 110,103,115,84,111,68,111,32,45,32,105,41,32,43,32,84,40,34,32,116,104,105,110,103,115,32,108,101,102,116,32,116,111,32,100,111,46,46,46,34, + 41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,97,105,116,32,40,53,48,48,41,59,13,10,32,32,32,32,32,32,32,32, + 125,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,80,114,111,103,114,101,115,115,32,40,45,49,46,48,41,59,32,47,47,32,115,101,116,116, + 105,110,103,32,97,32,118,97,108,117,101,32,98,101,121,111,110,100,32,116,104,101,32,114,97,110,103,101,32,48,32,45,62,32,49,32,119,105,108,108, + 32,115,104,111,119,32,97,32,115,112,105,110,110,105,110,103,32,98,97,114,46,46,13,10,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117, + 115,77,101,115,115,97,103,101,32,40,84,40,34,70,105,110,105,115,104,105,110,103,32,111,102,102,32,116,104,101,32,108,97,115,116,32,102,101,119,32, + 98,105,116,115,32,97,110,100,32,112,105,101,99,101,115,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,119,97,105,116,32,40,51,48,48,48, + 41,59,13,10,32,32,32,32,125,13,10,125,59,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,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45,111, - 110,108,121,32,98,117,116,116,111,110,32,102,114,111,109,32,116,104,101,115,101,32,100,114,97,119,97,98,108,101,115,46,46,13,10,32,32,32,32,32, - 32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116,111,110,32,50,34, - 41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,70,105,116,116,101,100,41,59,13,10,32,32,32,32,32,32, - 32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97,108,44,32,38,111,118,101,114,44,32,38,100,111,119,110,41,59, - 13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,67,108,105,99,107,105,110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116, - 114,117,101,41,59,13,10,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,100,98,41,59, - 13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,57,48,44,32,51,48,44,32,56,48,44,32,56,48,41, - 59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105,115,32,105,115,32,97,110, - 32,105,109,97,103,101,45,111,110,108,121,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,34,41,41,59,13,10,32,32,32,32,32,32,32,32, - 100,98,45,62,97,100,100,66,117,116,116,111,110,76,105,115,116,101,110,101,114,32,40,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,59,13, - 10,13,10,32,32,32,32,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,13,10,47,42,42,32,65,32,68,105,97,108,111,103,87,105,110,100,111,119,32,99,111, + 110,116,97,105,110,105,110,103,32,97,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,32,99,111,109,112,111,110,101,110,116,32,42,47,13,10, + 99,108,97,115,115,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,32,32,58,32,112,117,98,108, + 105,99,32,68,105,97,108,111,103,87,105,110,100,111,119,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,67,111,108,111,117,114,83, + 101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,40,41,13,10,32,32,32,32,32,32,32,32,58,32,68,105,97,108,111,103,87, + 105,110,100,111,119,32,40,84,40,34,67,111,108,111,117,114,32,115,101,108,101,99,116,111,114,32,100,101,109,111,34,41,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,67,111,108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,121,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,116,114,117,101,41,13,10,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,115,101,116,67,111,110,116,101,110,116,67,111,109,112,111,110,101,110,116,32,40,110,101,119,32,67,111,108,111,117,114,83,101,108, + 101,99,116,111,114,40,41,41,59,13,10,32,32,32,32,32,32,32,32,99,101,110,116,114,101,87,105,116,104,83,105,122,101,32,40,52,48,48,44,32, + 52,48,48,41,59,13,10,32,32,32,32,32,32,32,32,115,101,116,82,101,115,105,122,97,98,108,101,32,40,116,114,117,101,44,32,116,114,117,101,41, + 59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110, + 100,111,119,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,108,111,115,101,66,117,116, + 116,111,110,80,114,101,115,115,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,32,101,120,112,101,99, + 116,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,32,116,111,32,98,101,32,114,117,110,32,119,105,116,104,105,110,32,97,32,109,111,100,97, + 108,32,108,111,111,112,44,32,115,111,32,119,104,101,110,32,116,104,101,32,99,108,111,115,101,13,10,32,32,32,32,32,32,32,32,47,47,32,98,117, + 116,116,111,110,32,105,115,32,99,108,105,99,107,101,100,44,32,119,101,32,99,97,110,32,109,97,107,101,32,105,116,32,105,110,118,105,115,105,98,108, + 101,32,116,111,32,99,97,117,115,101,32,116,104,101,32,108,111,111,112,32,116,111,32,101,120,105,116,32,97,110,100,32,116,104,101,13,10,32,32,32, + 32,32,32,32,32,47,47,32,99,97,108,108,105,110,103,32,99,111,100,101,32,119,105,108,108,32,100,101,108,101,116,101,32,116,104,105,115,32,111,98, + 106,101,99,116,46,13,10,32,32,32,32,32,32,32,32,115,101,116,86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32, + 125,13,10,125,59,13,10,13,10,35,105,102,32,74,85,67,69,95,77,65,67,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,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,110,32,105,109,97,103,101,45, - 111,110,45,98,117,116,116,111,110,45,115,104,97,112,101,32,98,117,116,116,111,110,32,102,114,111,109,32,116,104,101,32,115,97,109,101,32,100,114,97, - 119,97,98,108,101,115,46,46,13,10,32,32,32,32,32,32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111, - 110,32,40,84,40,34,66,117,116,116,111,110,32,51,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,79, - 110,66,117,116,116,111,110,66,97,99,107,103,114,111,117,110,100,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103, - 101,115,32,40,38,110,111,114,109,97,108,44,32,48,44,32,48,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50, - 48,48,44,32,51,48,44,32,49,49,48,44,32,50,53,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105, - 112,32,40,84,40,34,116,104,105,115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,111,110,32,97,32,115,116,97,110, - 100,97,114,100,32,98,117,116,116,111,110,32,98,97,99,107,103,114,111,117,110,100,34,41,41,59,13,10,13,10,32,32,32,32,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,13,10,47,42,42,32,84,104,105,115,32,112,111,112,115, + 32,111,112,101,110,32,97,32,100,105,97,108,111,103,32,98,111,120,32,97,110,100,32,119,97,105,116,115,32,102,111,114,32,121,111,117,32,116,111,32, + 112,114,101,115,115,32,107,101,121,115,32,111,110,32,121,111,117,114,32,65,112,112,108,101,32,82,101,109,111,116,101,44,13,10,32,32,32,32,119,104, + 105,99,104,32,105,116,32,100,101,115,99,114,105,98,101,115,32,105,110,32,116,104,101,32,98,111,120,46,13,10,42,47,13,10,99,108,97,115,115,32, + 65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,32,32,58,32,112,117,98,108,105,99,32,65,108,101,114,116,87,105,110, + 100,111,119,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,32,32,32,32,32,32,112,117,98, + 108,105,99,32,65,112,112,108,101,82,101,109,111,116,101,68,101,118,105,99,101,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,65, + 112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,40,41,13,10,32,32,32,32,32,32,32,32,58,32,65,108,101,114,116,87, + 105,110,100,111,119,32,40,34,65,112,112,108,101,32,82,101,109,111,116,101,32,67,111,110,116,114,111,108,32,84,101,115,116,33,34,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,34,73,102,32,121,111,117,39,118,101,32,103,111,116,32,97,110,32,65, + 112,112,108,101,32,82,101,109,111,116,101,44,32,112,114,101,115,115,32,115,111,109,101,32,98,117,116,116,111,110,115,32,110,111,119,46,46,46,34,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,65,108,101,114,116,87,105,110,100,111,119,58,58,78,111, + 73,99,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,97,100,100,66,117,116,116,111,110,32,40,84,40,34,100,111,110,101, + 34,41,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,40,84,111,32,111,112,101,110,32,116,104,101,32,100,101,118,105,99, + 101,32,105,110,32,110,111,110,45,101,120,99,108,117,115,105,118,101,32,109,111,100,101,44,32,112,97,115,115,32,39,102,97,108,115,101,39,32,105,110, + 32,104,101,114,101,41,46,46,13,10,32,32,32,32,32,32,32,32,105,102,32,40,33,32,115,116,97,114,116,32,40,116,114,117,101,41,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,115,101,116,77,101,115,115,97,103,101,32,40,34,67,111,117,108,100,110,39,116,32,111,112,101,110,32,116,104, + 101,32,114,101,109,111,116,101,32,99,111,110,116,114,111,108,32,100,101,118,105,99,101,33,34,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32, + 32,32,126,65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,115,116,111,112,40,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,80,114,101,115, + 115,101,100,32,40,99,111,110,115,116,32,66,117,116,116,111,110,84,121,112,101,32,98,117,116,116,111,110,73,100,44,32,99,111,110,115,116,32,98,111, + 111,108,32,105,115,68,111,119,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,83,116,114,105,110,103,32,100,101,115,99,59,13, + 10,13,10,32,32,32,32,32,32,32,32,115,119,105,116,99,104,32,40,98,117,116,116,111,110,73,100,41,13,10,32,32,32,32,32,32,32,32,123,13, + 10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,101,110,117,66,117,116,116,111,110,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, + 101,115,99,32,61,32,34,109,101,110,117,32,98,117,116,116,111,110,32,40,115,104,111,114,116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,112,108,97,121,66,117,116,116,111,110,58,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,112,108,97,121,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,112,108,117,115,66,117,116,116,111,110,58,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,112,108,117,115,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,105,110,117,115,66,117,116,116,111,110,58,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,109,105,110,117,115,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,114,105,103,104,116,66,117,116,116,111,110,58, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,114,105,103,104,116,32,98,117,116,116,111,110,32,40,115,104,111,114, + 116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,108, + 101,102,116,66,117,116,116,111,110,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,108,101,102,116,32,98,117,116, + 116,111,110,32,40,115,104,111,114,116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32, + 32,32,32,99,97,115,101,32,114,105,103,104,116,66,117,116,116,111,110,95,76,111,110,103,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, + 101,115,99,32,61,32,34,114,105,103,104,116,32,98,117,116,116,111,110,32,40,108,111,110,103,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,108,101,102,116,66,117,116,116,111,110,95,76,111,110,103,58,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,108,101,102,116,32,98,117,116,116,111,110,32,40,108,111,110,103,41,34, + 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,101,110,117, + 66,117,116,116,111,110,95,76,111,110,103,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,109,101,110,117,32,98, + 117,116,116,111,110,32,40,108,111,110,103,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32, + 32,32,32,32,99,97,115,101,32,112,108,97,121,66,117,116,116,111,110,83,108,101,101,112,77,111,100,101,58,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,100,101,115,99,32,61,32,34,112,108,97,121,32,40,115,108,101,101,112,32,109,111,100,101,41,34,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,115,119,105,116,99,104,101,100,58,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,114,101,109,111,116,101,32,115,119,105,116,99,104,101,100,34,59,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40, + 105,115,68,111,119,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,34,32,45,45,32,91,100,111,119,110,93, + 34,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,34,32, + 45,45,32,91,117,112,93,34,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,77,101,115,115,97,103,101,32,40,100,101,115,99,41,59,13, + 10,32,32,32,32,125,13,10,125,59,13,10,13,10,35,101,110,100,105,102,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,61,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10, - 32,32,32,32,32,32,32,32,100,98,32,61,32,110,101,119,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,40,84,40,34,66,117,116,116, - 111,110,32,52,34,41,44,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,58,58,73,109,97,103,101,79,110,66,117,116,116,111,110,66,97,99, - 107,103,114,111,117,110,100,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,73,109,97,103,101,115,32,40,38,110,111,114,109,97, - 108,44,32,38,111,118,101,114,44,32,38,100,111,119,110,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,67,108,105,99,107,105, - 110,103,84,111,103,103,108,101,115,83,116,97,116,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66, - 97,99,107,103,114,111,117,110,100,67,111,108,111,117,114,115,32,40,67,111,108,111,117,114,115,58,58,119,104,105,116,101,44,32,67,111,108,111,117,114, - 115,58,58,121,101,108,108,111,119,41,59,13,10,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,100,98,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,48,44,32,55,48,44,32, - 53,48,44,32,53,48,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,104,105, - 115,32,105,115,32,97,32,68,114,97,119,97,98,108,101,66,117,116,116,111,110,32,111,110,32,97,32,115,116,97,110,100,97,114,100,32,98,117,116,116, - 111,110,32,98,97,99,107,103,114,111,117,110,100,34,41,41,59,13,10,32,32,32,32,32,32,32,32,100,98,45,62,97,100,100,66,117,116,116,111,110, - 76,105,115,116,101,110,101,114,32,40,98,117,116,116,111,110,76,105,115,116,101,110,101,114,41,59,13,10,13,10,32,32,32,32,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,13,10,99,111,110,115,116,32,105,110,116,32,110,117,109,71, + 114,111,117,112,115,32,61,32,52,59,13,10,13,10,99,108,97,115,115,32,87,105,100,103,101,116,115,68,101,109,111,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,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,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,109,101,110, + 117,66,117,116,116,111,110,59,13,10,32,32,32,32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,101,110,97,98,108,101,66,117,116,116,111,110, + 59,13,10,13,10,32,32,32,32,68,101,109,111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,42,32,116,97,98,115,59,13,10,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,61,61,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,32,32,32,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,42,32,104,121,112,101,114,108,105,110,107,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,61,32,110,101,119,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,32,40,84,40,34,116,104,105,115,32,105, - 115,32,97,32,72,121,112,101,114,108,105,110,107,66,117,116,116,111,110,34,41,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,32,32,32,32,32,32,32,32,32,32,32,85,82,76,32,40,84,40,34,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,47,106,117,99,101,34,41,41,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,104,121,112,101,114,108,105,110,107,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,49,51,48,44,32,50,48,48,44,32, - 50,52,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,104,121,112,101,114,108,105, - 110,107,41,59,13,10,13,10,32,32,32,32,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,13,10,32,32,32,32,87,105,100,103,101,116,115,68,101,109,111,32,40,65,112,112,108,105,99,97,116,105, + 111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99,111,109,109,97,110,100,77,97,110,97,103,101,114,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,84,40,34,87,105,100,103,101,116,115,34,41,41,59,13,10,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,116,97,98,115,32,61,32,110,101,119,32,68,101,109,111,84, + 97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,41,59,13,10,13,10,32,32,32, + 32,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,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101,66,117,116,116,111,110,42,32,105, - 109,97,103,101,66,117,116,116,111,110,32,61,32,110,101,119,32,73,109,97,103,101,66,117,116,116,111,110,32,40,84,40,34,105,109,97,103,101,98,117, - 116,116,111,110,34,41,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,105,109,97, - 103,101,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101,42,32,106,117,99,101,73,109,97,103,101,32,61, - 32,73,109,97,103,101,67,97,99,104,101,58,58,103,101,116,70,114,111,109,77,101,109,111,114,121,32,40,66,105,110,97,114,121,68,97,116,97,58,58, - 106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,59,13,10,32,32, - 32,32,32,32,32,32,73,109,97,103,101,67,97,99,104,101,58,58,105,110,99,82,101,102,101,114,101,110,99,101,67,111,117,110,116,32,40,106,117,99, - 101,73,109,97,103,101,41,59,13,10,32,32,32,32,32,32,32,32,73,109,97,103,101,67,97,99,104,101,58,58,105,110,99,82,101,102,101,114,101,110, - 99,101,67,111,117,110,116,32,40,106,117,99,101,73,109,97,103,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,66,117,116, - 116,111,110,45,62,115,101,116,73,109,97,103,101,115,32,40,116,114,117,101,44,32,116,114,117,101,44,32,116,114,117,101,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,48,46, - 55,102,44,32,67,111,108,111,117,114,115,58,58,116,114,97,110,115,112,97,114,101,110,116,66,108,97,99,107,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,49,46,48,102,44, - 32,67,111,108,111,117,114,115,58,58,116,114,97,110,115,112,97,114,101,110,116,66,108,97,99,107,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,32,32,32,32,32,32,32,106,117,99,101,73,109,97,103,101,44,32,49,46,48,102,44,32,67,111, - 108,111,117,114,115,58,58,112,105,110,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,56,102,41,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,32,32,32,32,32,32,32,48,46,53,102,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,105,109,97,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,49,48,44,32,49,54, - 48,41,59,13,10,32,32,32,32,32,32,32,32,105,109,97,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,111,108,116,105,112,32,40,84,40, - 34,105,109,97,103,101,32,98,117,116,116,111,110,32,45,32,115,104,111,119,105,110,103,32,97,108,112,104,97,45,99,104,97,110,110,101,108,32,104,105, - 116,45,116,101,115,116,105,110,103,32,97,110,100,32,99,111,108,111,117,114,32,111,118,101,114,108,97,121,32,119,104,101,110,32,99,108,105,99,107,101, - 100,34,41,41,59,13,10,13,10,32,32,32,32,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,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,84,40,34,99,108,105,99,107,32,102,111,114,32,97,32,112,111,112,117,112,32,109,101,110,117,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,99,108,105,99, + 107,32,102,111,114,32,97,32,100,101,109,111,32,111,102,32,116,104,101,32,100,105,102,102,101,114,101,110,116,32,116,121,112,101,115,32,111,102,32,105, + 116,101,109,32,121,111,117,32,99,97,110,32,112,117,116,32,105,110,116,111,32,97,32,112,111,112,117,112,32,109,101,110,117,46,46,46,34,41,41,59, + 13,10,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,109,101,110,117,66,117,116,116,111, + 110,41,59,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,109,101,110,117,66,117,116,116,111,110, + 45,62,115,101,116,84,114,105,103,103,101,114,101,100,79,110,77,111,117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,32,47,47,32,98,101,99, + 97,117,115,101,32,116,104,105,115,32,98,117,116,116,111,110,32,112,111,112,115,32,117,112,32,97,32,109,101,110,117,44,32,116,104,105,115,32,108,101, + 116,115,32,117,115,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,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,32,32,47,47,32,104,111,108,100,32,100,111,119,110,32,116,104,101,32,98,117,116,116, + 111,110,32,97,110,100,32,100,114,97,103,32,115,116,114,97,105,103,104,116,32,111,110,116,111,32,116,104,101,32,109,101,110,117,13,10,13,10,32,32, + 32,32,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,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,32,32,32,32,67,111,108,111,117,114,67,104,97,110,103,101,66, - 117,116,116,111,110,42,32,99,111,108,111,117,114,67,104,97,110,103,101,66,117,116,116,111,110,32,61,32,110,101,119,32,67,111,108,111,117,114,67,104, - 97,110,103,101,66,117,116,116,111,110,40,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,99,111,108,111,117,114,67,104,97,110,103,101,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,99,111,108,111,117,114,67,104, - 97,110,103,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,51,53,48,44,32,51,48,41, - 59,13,10,13,10,32,32,32,32,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,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108, + 101,66,117,116,116,111,110,32,40,84,40,34,101,110,97,98,108,101,47,100,105,115,97,98,108,101,32,99,111,109,112,111,110,101,110,116,115,34,41,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,101,110,97,98,108,101,66,117,116,116, + 111,110,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,50, + 51,48,44,32,49,48,44,32,49,56,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45, + 62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,111,103,103,108,101,32,98,117,116,116,111,110,34,41,41,59,13,10,32,32,32,32,32, + 32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102, + 97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,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,125,13,10,13,10,32,32,32,32,126,87,105,100,103,101,116,115,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,116,97,98,115,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,52,48,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,48,41,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,61,61,61,61,61,61,61,61,61,61,61,13,10,32,32,32,32,32,32,32,32,97,110,105,109,97,116,101,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,84,40,34,99,108,105,99,107,32,116,111,32,97,110,105,109,97,116,101,46,46,46,34,41,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,97,110,105,109,97,116,101,66,117,116, - 116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,97,110,105,109,97,116,101,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116, - 104,84,111,70,105,116,84,101,120,116,32,40,50,52,41,59,13,10,32,32,32,32,32,32,32,32,97,110,105,109,97,116,101,66,117,116,116,111,110,45, - 62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,51,53,48,44,32,55,48,41,59,13,10,32,32,32,32,32,32,32,32, - 97,110,105,109,97,116,101,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,125,13,10,13,10,32,32,32,32,126,66,117,116,116,111,110,115,80,97,103,101,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,98,117,116,116,111,110,67,108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,41,13,10,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,103,101,116,78,117,109,67,104,105,108,100,67,111,109,112,111,110,101,110,116,115, - 40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105, - 102,32,40,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,105,41,32,33,61,32,97,110,105,109,97,116,101,66,117,116,116,111, - 110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,110,105,109,97, - 116,111,114,46,97,110,105,109,97,116,101,67,111,109,112,111,110,101,110,116,32,40,103,101,116,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32, - 40,105,41,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,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,82,101,99,116,97,110,103,108,101,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110, - 100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,87,105,100,116,104,40,41,32,47,32,50,41,44,13,10,32,32,32,32,32,32,32, + 61,61,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,117,116,116, + 111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,101,110,97,98,108,101, + 66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,98,111, + 111,108,32,101,110,97,98,108,101,100,32,61,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97,116, + 101,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,101,110,117,66,117,116,116,111,110,45,62,115,101,116,69,110,97,98,108, + 101,100,32,40,101,110,97,98,108,101,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,69,110,97,98, + 108,101,100,32,40,101,110,97,98,108,101,100,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32, + 105,102,32,40,98,117,116,116,111,110,32,61,61,32,109,101,110,117,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100, + 100,73,116,101,109,32,40,49,44,32,84,40,34,78,111,114,109,97,108,32,105,116,101,109,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,109,46,97,100,100,73,116,101,109,32,40,50,44,32,84,40,34,68,105,115,97,98,108,101,100,32,105,116,101,109,34,41,44,32,102,97,108,115, + 101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,51,44,32,84,40,34,84,105,99,107,101,100, + 32,105,116,101,109,34,41,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100, + 67,111,108,111,117,114,101,100,73,116,101,109,32,40,52,44,32,84,40,34,67,111,108,111,117,114,101,100,32,105,116,101,109,34,41,44,32,67,111,108, + 111,117,114,115,58,58,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111, + 114,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,67,117,115,116,111,109,73,116,101,109,32,40,53,44,32,110,101, + 119,32,67,117,115,116,111,109,77,101,110,117,67,111,109,112,111,110,101,110,116,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77, + 101,110,117,32,116,97,98,115,77,101,110,117,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73, + 116,101,109,32,40,49,48,48,49,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32,97,116,32,116,104,101,32,116,111,112,34,41,44,32,116,114, + 117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116, + 111,110,66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117, + 46,97,100,100,73,116,101,109,32,40,49,48,48,50,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32,97,116,32,116,104,101,32,98,111,116,116, + 111,109,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97, + 98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,66,111,116,116,111,109,41,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,48,51,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32, + 97,116,32,116,104,101,32,108,101,102,116,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111, + 110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,76,101,102,116,41,59,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,48,52,44,32,84,40,34,83,104,111, + 119,32,116,97,98,115,32,97,116,32,116,104,101,32,114,105,103,104,116,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114, + 105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,82,105, + 103,104,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,84,97,98,32, + 112,111,115,105,116,105,111,110,34,41,44,32,116,97,98,115,77,101,110,117,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46, + 97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117, + 32,100,105,97,108,111,103,77,101,110,117,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100, + 73,116,101,109,32,40,49,48,48,44,32,84,40,34,83,104,111,119,32,97,32,112,108,97,105,110,32,97,108,101,114,116,45,119,105,110,100,111,119,46, + 46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40, + 49,48,49,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32,119,105,116,104,32,97,32,39,119,97,114, + 110,105,110,103,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110, + 117,46,97,100,100,73,116,101,109,32,40,49,48,50,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32, + 119,105,116,104,32,97,110,32,39,105,110,102,111,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,51,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114, + 116,45,119,105,110,100,111,119,32,119,105,116,104,32,97,32,39,113,117,101,115,116,105,111,110,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,49,48,44, + 32,84,40,34,83,104,111,119,32,97,110,32,111,107,47,99,97,110,99,101,108,32,97,108,101,114,116,45,119,105,110,100,111,119,46,46,46,34,41,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114, + 40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49, + 49,49,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32,119,105,116,104,32,115,111,109,101,32,101,120, + 116,114,97,32,99,111,109,112,111,110,101,110,116,115,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97, + 108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, + 105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,49,50,44,32,84,40,34,83,104,111,119,32,97,32,84,104,114,101,97,100, + 87,105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,32,100,101,109,111,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,109,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,65,108,101,114,116,87,105,110,100,111,119,32,100,101,109,111,110, + 115,116,114,97,116,105,111,110,115,34,41,44,32,100,105,97,108,111,103,77,101,110,117,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73, + 116,101,109,32,40,49,50,48,44,32,84,40,34,83,104,111,119,32,97,32,99,111,108,111,117,114,32,115,101,108,101,99,116,111,114,32,100,101,109,111, + 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10, + 13,10,35,105,102,32,74,85,67,69,95,77,65,67,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49, + 52,48,44,32,84,40,34,82,117,110,32,116,104,101,32,65,112,112,108,101,32,82,101,109,111,116,101,32,67,111,110,116,114,111,108,32,116,101,115,116, + 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10, + 35,101,110,100,105,102,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,110,97,116,105,118,101,70,105, + 108,101,67,104,111,111,115,101,114,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115, + 101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,49,44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114, + 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46, + 97,100,100,73,116,101,109,32,40,49,50,52,44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,32,119,105,116, + 104,32,97,110,32,105,109,97,103,101,32,102,105,108,101,32,112,114,101,118,105,101,119,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,50,44,32,84,40,34, + 39,83,97,118,101,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,51,44,32,84,40,34,39,67,104,111, + 111,115,101,32,100,105,114,101,99,116,111,114,121,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,59,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,51,49, + 44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,51,52,44,32,84,40,34,39, + 76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,32,119,105,116,104,32,97,110,32,105,109,97,103,101,32,102,105,108,101,32,112,114, + 101,118,105,101,119,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101, + 114,115,46,97,100,100,73,116,101,109,32,40,49,51,50,44,32,84,40,34,39,83,97,118,101,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46, + 46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100, + 73,116,101,109,32,40,49,51,51,44,32,84,40,34,39,67,104,111,111,115,101,32,100,105,114,101,99,116,111,114,121,39,32,102,105,108,101,32,98,114, + 111,119,115,101,114,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,102,105, + 108,101,67,104,111,111,115,101,114,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,115,46,97,100, + 100,83,117,98,77,101,110,117,32,40,84,40,34,79,112,101,114,97,116,105,110,103,32,115,121,115,116,101,109,32,100,105,97,108,111,103,115,34,41,44, + 32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,67, + 104,111,111,115,101,114,115,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,74,117,99,101,32,100,105,97,108,111,103,115,34,41,44,32,106, + 117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,117, + 98,77,101,110,117,32,40,84,40,34,70,105,108,101,32,99,104,111,111,115,101,114,32,100,105,97,108,111,103,115,34,41,44,32,102,105,108,101,67,104, + 111,111,115,101,114,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,114,101,115,117,108,116,32,61,32,109,46,115, + 104,111,119,65,116,32,40,109,101,110,117,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114, + 101,115,117,108,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,47,47,32,117,115,101,114,32,99,104,111,115,101,32,115,111,109,101,116,104,105,110,103,32,102,114,111,109,32,116,104,101,32,109,101,110, + 117,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,62,61,32,49,48,48, + 32,38,38,32,114,101,115,117,108,116,32,60,32,49,48,53,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,65,108,101,114,116,73,99,111,110, + 84,121,112,101,32,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58,78,111,73,99,111,110,59,13,10,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,49,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58, + 87,97,114,110,105,110,103,73,99,111,110,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105, + 102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,50,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,59,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,51,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111, + 119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,105,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,84,40,34,84,104,105,115,32,105,115,32,97,110,32,65,108,101,114,116,87,105,110,100,111,119,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,84,40,34,65,110,100,32,116,104,105,115,32,105,115,32,116,104,101,32,65,108,101,114,116,87,105,110,100,111,119,39,115,32,109,101,115, + 115,97,103,101,46,32,66,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104, + 32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,84,40,34,111,107,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,48,41,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,111,111,108,32, + 117,115,101,114,80,105,99,107,101,100,79,107,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,61,32, + 65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,79,107,67,97,110,99,101,108,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111, + 119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,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,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,32,32,32,32,32,32,84,40,34,84,104,105, + 115,32,105,115,32,97,110,32,111,107,47,99,97,110,99,101,108,32,65,108,101,114,116,87,105,110,100,111,119,34,41,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,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,32,32,32,32,32,32,84,40,34,65,110,100,32,116,104,105,115,32,105,115,32,116,104,101,32,65,108,101,114,116,87,105,110,100,111,119, + 39,115,32,109,101,115,115,97,103,101,46,32,66,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97, + 104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,46,34,41,41, + 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108, + 115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,49,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,32,119,32,40,84,40,34, + 65,108,101,114,116,87,105,110,100,111,119,32,100,101,109,111,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,84,40,34,84,104,105,115,32,65,108,101,114,116,87,105,110,100,111,119,32,104,97, + 115,32,97,32,99,111,117,112,108,101,32,111,102,32,101,120,116,114,97,32,99,111,109,112,111,110,101,110,116,115,32,97,100,100,101,100,32,116,111,32, + 115,104,111,119,32,104,111,119,32,116,111,32,97,100,100,32,100,114,111,112,45,100,111,119,110,32,108,105,115,116,115,32,97,110,100,32,116,101,120,116, + 32,101,110,116,114,121,32,98,111,120,101,115,46,34,41,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,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,119,46,97,100,100,84,101,120,116,69,100,105,116,111,114,32, + 40,84,40,34,116,101,120,116,34,41,44,32,84,40,34,101,110,116,101,114,32,115,111,109,101,32,116,101,120,116,32,104,101,114,101,34,41,44,32,84, + 40,34,116,101,120,116,32,102,105,101,108,100,58,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,83,116,114,105,110,103,65,114,114,97,121,32,111,112,116,105,111,110,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,49,34,41,41,59,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,50,34,41,41, + 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111, + 112,116,105,111,110,32,51,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115, + 46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,52,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,119,46,97,100,100,67,111,109,98,111,66,111,120,32,40,84,40,34,111,112,116,105,111,110,34,41,44,32,111,112,116,105,111,110,115,44,32, + 84,40,34,115,111,109,101,32,111,112,116,105,111,110,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,119,46,97,100,100,66,117,116,116,111,110,32,40,84,40,34,111,107,34,41,44,32,49,44,32,75,101,121,80,114,101,115,115,32,40,75,101, + 121,80,114,101,115,115,58,58,114,101,116,117,114,110,75,101,121,44,32,48,44,32,48,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,119,46,97,100,100,66,117,116,116,111,110,32,40,84,40,34,99,97,110,99,101,108,34,41,44,32,48,44,32,75,101,121, + 80,114,101,115,115,32,40,75,101,121,80,114,101,115,115,58,58,101,115,99,97,112,101,75,101,121,44,32,48,44,32,48,41,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,119,46,114,117,110,77,111,100,97,108,76,111,111,112,40,41,32, + 33,61,32,48,41,32,47,47,32,105,115,32,116,104,101,121,32,112,105,99,107,101,100,32,39,111,107,39,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,123,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,47,47,32, + 116,104,105,115,32,105,115,32,116,104,101,32,105,116,101,109,32,116,104,101,121,32,99,104,111,115,101,32,105,110,32,116,104,101,32,100,114,111,112,45, + 100,111,119,110,32,108,105,115,116,46,46,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,99,111,110, + 115,116,32,105,110,116,32,111,112,116,105,111,110,73,110,100,101,120,67,104,111,115,101,110,32,61,32,119,46,103,101,116,67,111,109,98,111,66,111,120, + 67,111,109,112,111,110,101,110,116,32,40,84,40,34,111,112,116,105,111,110,34,41,41,45,62,103,101,116,83,101,108,101,99,116,101,100,73,116,101,109, + 73,110,100,101,120,40,41,59,13,10,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,47,47,32,116, + 104,105,115,32,105,115,32,116,104,101,32,116,101,120,116,32,116,104,101,121,32,101,110,116,101,114,101,100,46,46,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,83,116,114,105,110,103,32,116,101,120,116,32,61,32,119,46,103,101,116,84,101,120,116,69, + 100,105,116,111,114,67,111,110,116,101,110,116,115,32,40,84,40,34,116,101,120,116,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,50,41,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,66,97,99,107, + 103,114,111,117,110,100,84,104,114,101,97,100,32,100,101,109,111,84,104,114,101,97,100,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,105,102,32,40,100,101,109,111,84,104,114,101,97,100,46,114,117,110,84,104,114,101,97,100,40,41,41,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,47,47,32,116,104,114,101,97,100,32,102,105,110,105,115,104,101,100,32,110,111,114,109,97,108,108,121,46,46,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,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115, + 97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,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,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116, - 32,40,103,101,116,72,101,105,103,104,116,40,41,32,47,32,50,41,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,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,32,32,32,32,54,48,32,43,32, - 82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,87,105, - 100,116,104,40,41,32,47,32,51,41,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,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,32,32,32,32,49,54,32,43,32,82,97,110,100,111,109,58,58, - 103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,73,110,116,32,40,103,101,116,72,101,105,103,104,116,40,41,32,47, - 32,54,41,41,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,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,53,48,48,32,43,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40, - 41,46,110,101,120,116,73,110,116,32,40,50,48,48,48,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82, - 97,110,100,111,109,40,41,46,110,101,120,116,68,111,117,98,108,101,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,82,97,110,100,111,109,58,58,103,101,116,83,121,115, - 116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,68,111,117,98,108,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,101,120, - 116,66,117,116,116,111,110,42,32,97,110,105,109,97,116,101,66,117,116,116,111,110,59,13,10,32,32,32,32,67,111,109,112,111,110,101,110,116,65,110, - 105,109,97,116,111,114,32,97,110,105,109,97,116,111,114,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,115,116,97,116,105,99,32,67,111,109,112,111, - 110,101,110,116,42,32,99,114,101,97,116,101,77,105,115,99,80,97,103,101,40,41,13,10,123,13,10,32,32,32,32,68,101,109,111,80,97,103,101,67, - 111,109,112,42,32,112,97,103,101,32,61,32,110,101,119,32,68,101,109,111,80,97,103,101,67,111,109,112,40,41,59,13,10,13,10,32,32,32,32,84, - 101,120,116,69,100,105,116,111,114,42,32,116,101,120,116,69,100,105,116,111,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,40,41, - 59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,116,101,120,116,69,100,105,116, - 111,114,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,50,53,44, - 32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,84,101,120,116,32,40,84,40,34, - 115,105,110,103,108,101,45,108,105,110,101,32,116,101,120,116,32,98,111,120,34,41,41,59,13,10,13,10,32,32,32,32,116,101,120,116,69,100,105,116, - 111,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,112,97,115,115,119,111,114,100,34,41,44,32,40,116,99,104, - 97,114,41,32,48,120,50,48,50,50,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108, - 101,32,40,116,101,120,116,69,100,105,116,111,114,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115,101,116,66,111,117,110, - 100,115,32,40,49,48,44,32,53,53,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,116,101,120,116,69,100,105,116,111,114,45,62,115, - 101,116,84,101,120,116,32,40,84,40,34,112,97,115,115,119,111,114,100,34,41,41,59,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,67,111,109, - 98,111,66,111,120,42,32,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120,32,40,84,40,34,99,111,109,98,111, - 34,41,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,99,111,109,98,111, - 66,111,120,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,48,44,32,50,53,44, - 32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,69,100,105,116,97,98,108,101,84,101,120, - 116,32,40,116,114,117,101,41,59,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,74,117,115,116,105,102,105,99,97,116,105,111, - 110,84,121,112,101,32,40,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,41,59,13,10,13,10,32,32,32,32,105, - 110,116,32,105,59,13,10,32,32,32,32,102,111,114,32,40,105,32,61,32,49,59,32,105,32,60,32,49,48,48,59,32,43,43,105,41,13,10,32,32, - 32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32,40,84,40,34,99,111,109,98,111,32,98,111,120,32,105,116, - 101,109,32,34,41,32,43,32,83,116,114,105,110,103,32,40,105,41,44,32,105,41,59,13,10,13,10,32,32,32,32,99,111,109,98,111,66,111,120,45, - 62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,49,41,59,13,10,13,10,32,32,32,32,68,114,97,103,79,110,116,111,68,101,115,107,116, - 111,112,68,101,109,111,67,111,109,112,42,32,100,32,61,32,110,101,119,32,68,114,97,103,79,110,116,111,68,101,115,107,116,111,112,68,101,109,111,67, - 111,109,112,32,40,112,97,103,101,41,59,13,10,32,32,32,32,112,97,103,101,45,62,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101, - 32,40,100,41,59,13,10,32,32,32,32,100,45,62,115,101,116,66,111,117,110,100,115,32,40,50,48,44,32,49,48,48,44,32,50,48,48,44,32,56, - 48,41,59,13,10,13,10,32,32,32,32,114,101,116,117,114,110,32,112,97,103,101,59,13,10,125,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,84,111, - 111,108,98,97,114,68,101,109,111,67,111,109,112,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,32,112,117,98,108,105,99,32,83,108,105,100,101,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,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,84,111,111,108,98,97,114,68, - 101,109,111,67,111,109,112,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99,111,109,109, - 97,110,100,77,97,110,97,103,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,67,114,101,97,116,101,32,97,110, - 100,32,97,100,100,32,116,104,101,32,116,111,111,108,98,97,114,46,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,116,111,111,108,98,97,114,32,61,32,110,101,119,32,84,111,111,108,98,97,114,40,41,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,47,47,32,65,110,100,32,117,115,101,32,111,117,114,32,105,116,101,109,32,102,97,99,116,111,114,121,32,116,111,32,97,100,100, - 32,97,32,115,101,116,32,111,102,32,100,101,102,97,117,108,116,32,105,99,111,110,115,32,116,111,32,105,116,46,46,46,13,10,32,32,32,32,32,32, - 32,32,116,111,111,108,98,97,114,45,62,97,100,100,68,101,102,97,117,108,116,73,116,101,109,115,32,40,102,97,99,116,111,114,121,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,47,47,32,78,111,119,32,119,101,39,108,108,32,106,117,115,116,32,99,114,101,97,116,101,32,116,104,101,32,111,116, - 104,101,114,32,115,108,105,100,101,114,115,32,97,110,100,32,98,117,116,116,111,110,115,32,111,110,32,116,104,101,32,100,101,109,111,32,112,97,103,101, - 44,32,119,104,105,99,104,32,97,100,106,117,115,116,13,10,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,116,111,111,108,98,97,114,39,115, - 32,112,114,111,112,101,114,116,105,101,115,46,46,46,13,10,32,32,32,32,32,32,32,32,76,97,98,101,108,42,32,105,110,102,111,32,61,32,110,101, - 119,32,76,97,98,101,108,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,65,115, - 32,119,101,108,108,32,97,115,32,115,104,111,119,105,110,103,32,111,102,102,32,116,111,111,108,98,97,114,115,44,32,116,104,105,115,32,100,101,109,111, - 32,105,108,108,117,115,116,114,97,116,101,115,32,104,111,119,32,116,111,32,115,116,111,114,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,34,97,32,115,101,116,32,111,102,32,83,86,71,32,102,105,108,101,115,32,105,110,32,97,32,90,105,112,32,102,105,108,101,44,32,101,109,98,101, - 100,32,116,104,97,116,32,105,110,32,121,111,117,114,32,97,112,112,108,105,99,97,116,105,111,110,44,32,97,110,100,32,114,101,97,100,32,34,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,34,116,104,101,109,32,98,97,99,107,32,105,110,32,97,116,32,114,117,110,116,105,109,101,46,92,110,92, - 110,84,104,101,32,105,99,111,110,32,105,109,97,103,101,115,32,104,101,114,101,32,97,114,101,32,116,97,107,101,110,32,102,114,111,109,32,116,104,101, - 32,111,112,101,110,45,115,111,117,114,99,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,84,97,110,103,111,32,105,99,111,110,32, - 112,114,111,106,101,99,116,46,34,41,59,13,10,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,105,110,102,111,41,59,13,10,32,32,32,32,32,32,32,32,105,110,102,111,45,62,115,101,116,74,117,115,116,105,102,105,99,97,116,105,111,110, - 84,121,112,101,32,40,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,116,111,112,76,101,102,116,41,59,13,10,32,32,32,32,32,32,32,32, - 105,110,102,111,45,62,115,101,116,66,111,117,110,100,115,32,40,56,48,44,32,56,48,44,32,52,53,48,44,32,49,48,48,41,59,13,10,32,32,32, - 32,32,32,32,32,105,110,102,111,45,62,115,101,116,73,110,116,101,114,99,101,112,116,115,77,111,117,115,101,67,108,105,99,107,115,32,40,102,97,108, - 115,101,44,32,102,97,108,115,101,41,59,13,10,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,100,101,112,116,104,83,108,105,100,101,114,32,61,32,110,101,119,32,83,108,105,100,101,114,32,40,84,40,34,116,111,111,108,98,97,114,32,100, - 101,112,116,104,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,82,97,110,103, - 101,32,40,49,48,46,48,44,32,50,48,48,46,48,44,32,49,46,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100, - 101,114,45,62,115,101,116,86,97,108,117,101,32,40,53,48,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104, - 83,108,105,100,101,114,45,62,115,101,116,83,108,105,100,101,114,83,116,121,108,101,32,40,83,108,105,100,101,114,58,58,76,105,110,101,97,114,72,111, - 114,105,122,111,110,116,97,108,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,84,101,120,116, - 66,111,120,83,116,121,108,101,32,40,83,108,105,100,101,114,58,58,84,101,120,116,66,111,120,76,101,102,116,44,32,102,97,108,115,101,44,32,56,48, - 44,32,50,48,41,59,13,10,32,32,32,32,32,32,32,32,100,101,112,116,104,83,108,105,100,101,114,45,62,97,100,100,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,100,101,112,116,104,83,108,105,100,101,114,45,62,115,101,116,66,111,117,110,100,115, - 32,40,56,48,44,32,50,49,48,44,32,51,48,48,44,32,50,50,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108, - 32,40,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,78,97,109,101,40,41,44,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103, - 101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,100,101,112,116,104,83,108,105,100, - 101,114,44,32,102,97,108,115,101,41,59,13,10,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,111,114,105,101,110,116,97,116,105,111,110,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,84,40, - 34,118,101,114,116,105,99,97,108,47,104,111,114,105,122,111,110,116,97,108,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,111,114,105,101,110, - 116,97,116,105,111,110,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,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84, - 111,70,105,116,84,101,120,116,32,40,50,50,41,59,13,10,32,32,32,32,32,32,32,32,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111, - 110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,88, - 40,41,44,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,66,111,116,116,111,109,40,41,32,43,32,50,48,41,59,13,10,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,99,117,115,116,111,109,105,115,101,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,84,40,34,99,117,115,116,111,109,105,115,101,46,46,46,34,41,41,41,59, - 13,10,32,32,32,32,32,32,32,32,99,117,115,116,111,109,105,115,101,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,99,117,115,116,111,109,105,115,101,66,117,116,116,111,110,45,62,99, - 104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,32,40,50,50,41,59,13,10,32,32,32,32,32,32,32,32,99,117,115,116,111, - 109,105,115,101,66,117,116,116,111,110,45,62,115,101,116,84,111,112,76,101,102,116,80,111,115,105,116,105,111,110,32,40,111,114,105,101,110,116,97,116, - 105,111,110,66,117,116,116,111,110,45,62,103,101,116,82,105,103,104,116,40,41,32,43,32,50,48,44,32,111,114,105,101,110,116,97,116,105,111,110,66, - 117,116,116,111,110,45,62,103,101,116,89,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,84,111,111,108,98,97,114,68,101, - 109,111,67,111,109,112,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,105,102,32,40,116,111,111,108,98,97,114,45,62,105,115,86,101,114,116,105,99,97,108,40,41,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101,116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,40,105,110, - 116,41,32,100,101,112,116,104,83,108,105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,44,32,103,101,116,72,101,105,103,104,116,40,41,41, - 59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101, - 116,66,111,117,110,100,115,32,40,48,44,32,48,44,32,103,101,116,87,105,100,116,104,40,41,44,32,40,105,110,116,41,32,100,101,112,116,104,83,108, - 105,100,101,114,45,62,103,101,116,86,97,108,117,101,40,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115,108, - 105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83,108,105,100,101,114,42,32,115,108,105,100,101,114,41,13,10,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,114,101,115,105,122,101,100,40,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32, - 32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,111,114,105,101,110,116,97,116,105,111,110,66,117,116,116,111,110,41,13, - 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,101,116,86,101,114,116, - 105,99,97,108,32,40,33,32,116,111,111,108,98,97,114,45,62,105,115,86,101,114,116,105,99,97,108,40,41,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,114,101,115,105,122,101,100,40,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101, - 32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,99,117,115,116,111,109,105,115,101,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32, - 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,111,111,108,98,97,114,45,62,115,104,111,119,67,117,115,116,111,109,105,115,97,116,105, - 111,110,68,105,97,108,111,103,32,40,102,97,99,116,111,114,121,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13, - 10,112,114,105,118,97,116,101,58,13,10,32,32,32,32,84,111,111,108,98,97,114,42,32,116,111,111,108,98,97,114,59,13,10,32,32,32,32,83,108, - 105,100,101,114,42,32,100,101,112,116,104,83,108,105,100,101,114,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,111,114,105,101, - 110,116,97,116,105,111,110,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,99,117,115,116,111,109,105,115, - 101,66,117,116,116,111,110,59,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, + 32,32,32,32,32,32,32,32,84,40,34,80,114,111,103,114,101,115,115,32,119,105,110,100,111,119,34,41,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,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,32,32,32,84,40,34,84,104,114,101,97,100,32,102,105,110,105,115,104,101,100,32,111,107,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,47,47,32,117,115,101,114,32,112,114,101,115,115,101,100,32,116,104,101,32,99,97,110,99,101,108,32,98,117,116,116,111, + 110,46,46,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,65,108,101,114,116,87,105,110,100,111,119, + 58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99, + 111,110,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,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,32,32,32,84,40,34,80,114,111,103,114,101,115,115,32,119,105,110,100,111,119,34,41,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,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,32,32,32,84,40,34,89,111,117,32,112,114,101,115,115,101,100,32,99,97,110,99,101,108,33,34,41,41,59, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61, + 32,49,50,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,32,99,111,108,111,117,114,68, + 105,97,108,111,103,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,119,105, + 108,108,32,114,117,110,32,97,110,32,101,118,101,110,116,32,108,111,111,112,32,117,110,116,105,108,32,116,104,101,32,100,105,97,108,111,103,39,115,32, + 99,108,111,115,101,66,117,116,116,111,110,80,114,101,115,115,101,100,40,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,47,47,32,109,101,116,104,111,100,32,99,97,117,115,101,115,32,116,104,101,32,108,111,111,112,32,116,111,32,101,120,105,116,46,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,108,111,117,114,68,105,97,108,111,103,46,114,117,110,77,111,100,97,108,76, + 111,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,52,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,123,13,10,35,105,102,32,74,85,67,69,95,77,65,67,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,32,116,101,115,116,59,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,116,101,115,116,46,114,117,110,77,111,100,97,108,76,111,111,112,40,41,59,13,10,35,101,110,100,105,102,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32, + 105,102,32,40,114,101,115,117,108,116,32,62,61,32,49,50,49,32,38,38,32,114,101,115,117,108,116,32,60,32,49,51,57,41,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116, + 32,98,111,111,108,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,32,61,32,114,101,115,117,108,116,32,60,32,49,51,48,59,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,62,32,49,51,48,41,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,114,101,115,117,108,116,32,45,61,32,49,48,59,13,10,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,49,41,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,70,105,108,101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,102,105,108,101,32, + 116,111,32,111,112,101,110,46,46,46,34,41,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, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105, + 114,101,99,116,111,114,121,40,41,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,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,42,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13, + 10,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,105,102,32,40,102,99,46,98,114,111,119,115,101, + 70,111,114,70,105,108,101,84,111,79,112,101,110,40,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104, + 111,115,101,110,70,105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97, + 103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,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,32,32,32,32,32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,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,32,32,32,32,32,32,32,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103, + 101,116,70,117,108,108,80,97,116,104,78,97,109,101,40,41,41,59,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,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,52,41,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,73,109,97,103,101,80,114,101,118,105,101,119,67,111,109,112,111,110,101,110,116,32,105,109,97,103,101,80,114,101,118,105,101,119,59,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,105,109,97,103,101,80,114,101,118,105,101,119,46,115,101,116,83, + 105,122,101,32,40,50,48,48,44,32,50,48,48,41,59,13,10,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,70,105,108,101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,110,32,105,109,97,103,101,32,116,111, + 32,111,112,101,110,46,46,46,34,41,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,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101, + 99,116,111,114,121,40,41,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,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,84,40,34,42,46,106,112,103,59,42,46,106,112,101,103,59,42,46,112,110,103,59,42,46,103,105,102,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,70,105,108,101,84,111,79,112,101,110,32,40,38,105,109,97, + 103,101,80,114,101,118,105,101,119,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,70, + 105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120, + 32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,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,32,32,32,32, + 32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,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,32,32,32,32, + 32,32,32,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103,101,116,70,117,108, + 108,80,97,116,104,78,97,109,101,40,41,41,59,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,125, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,50,41,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,123,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,70,105,108, + 101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,102,105,108,101,32,116,111,32,115,97,118,101,46,46,46, + 34,41,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,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101,99,116,111,114,121,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,84,40,34,42,34,41,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,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,70,105,108,101,84,111,83, + 97,118,101,32,40,116,114,117,101,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,70, + 105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120, + 32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,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,32,32,32,32, + 32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,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,32,32,32,32, + 32,32,32,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103,101,116,70,117,108, + 108,80,97,116,104,78,97,109,101,40,41,41,59,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,125, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,51,41,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,123,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,70,105,108, + 101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,100,105,114,101,99,116,111,114,121,46,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101,99,116,111,114,121,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84, + 40,34,42,34,41,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,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,68,105,114,101,99,116,111,114,121,40, + 41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,68,105,114,101,99,116,111,114,121,32, + 61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108, + 101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,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,32,32,32,32,32,32,32,84, + 40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,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,32,32,32,32,32,32,32,84, + 40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,68,105,114,101,99,116,111,114,121,46,103,101,116,70,117, + 108,108,80,97,116,104,78,97,109,101,40,41,41,59,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, + 125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32, + 49,48,48,49,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110, + 66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,50,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97, + 98,115,45,62,115,101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98, + 115,65,116,66,111,116,116,111,109,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,51,41,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115, + 101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,76,101, + 102,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,52,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,79,114,105,101,110, + 116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,82,105,103,104,116,41,59,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32, + 32,32,125,13,10,32,32,32,32,125,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,13,10,32,32,32,32,99,108,97,115,115,32,68,101,109,111,84,111,111,108,98,97,114,73, - 116,101,109,70,97,99,116,111,114,121,32,32,32,58,32,112,117,98,108,105,99,32,84,111,111,108,98,97,114,73,116,101,109,70,97,99,116,111,114,121, - 13,10,32,32,32,32,123,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,84,111,111,108,98,97, - 114,73,116,101,109,70,97,99,116,111,114,121,40,41,32,123,125,13,10,32,32,32,32,32,32,32,32,126,68,101,109,111,84,111,111,108,98,97,114,73, - 116,101,109,70,97,99,116,111,114,121,40,41,32,123,125,13,10,13,10,32,32,32,32,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,87, + 105,100,103,101,116,115,68,101,109,111,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99, + 111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,105,100,103,101,116, + 115,68,101,109,111,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::widgetsdemo_cpp = (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, - 61,61,61,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,32,32,32,32,47,47,32, - 69,97,99,104,32,116,121,112,101,32,111,102,32,105,116,101,109,32,97,32,116,111,111,108,98,97,114,32,99,97,110,32,99,111,110,116,97,105,110,32, - 109,117,115,116,32,98,101,32,103,105,118,101,110,32,97,32,117,110,105,113,117,101,32,73,68,46,32,84,104,101,115,101,13,10,32,32,32,32,32,32, - 32,32,47,47,32,97,114,101,32,116,104,101,32,111,110,101,115,32,119,101,39,108,108,32,117,115,101,32,105,110,32,116,104,105,115,32,100,101,109,111, - 46,13,10,32,32,32,32,32,32,32,32,101,110,117,109,32,68,101,109,111,84,111,111,108,98,97,114,73,116,101,109,73,100,115,13,10,32,32,32,32, - 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,111,99,95,110,101,119,32,32,32,32,32,32,32,32,32,61,32,49,44,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,100,111,99,95,111,112,101,110,32,32,32,32,32,32,32,32,61,32,50,44,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,100,111,99,95,115,97,118,101,32,32,32,32,32,32,32,32,61,32,51,44,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,100,111,99,95,115,97,118,101,65,115,32,32,32,32,32,32,61,32,52,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95, - 99,111,112,121,32,32,32,32,32,32,32,61,32,53,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95,99,117,116,32,32,32, - 32,32,32,32,32,61,32,54,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,100,105,116,95,112,97,115,116,101,32,32,32,32,32,32,61, - 32,55,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,76,111,103,111,66,117,116,116,111,110,32,32,61,32,56,44,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,99,117,115,116,111,109,67,111,109,98,111,66,111,120,32,32,61,32,57,13,10,32,32,32,32,32,32,32,32, - 125,59,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,103,101,116,65,108,108,84,111,111,108,98,97,114,73,116,101,109,73,100,115,32, - 40,65,114,114,97,121,32,60,105,110,116,62,38,32,105,100,115,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,47,47,32,84,104,105,115,32,114,101,116,117,114,110,115,32,116,104,101,32,99,111,109,112,108,101,116,101,32,108,105,115,116,32,111,102,32, - 97,108,108,32,105,116,101,109,32,73,68,115,32,116,104,97,116,32,97,114,101,32,97,108,108,111,119,101,100,32,116,111,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,47,47,32,103,111,32,105,110,32,111,117,114,32,116,111,111,108,98,97,114,46,32,65,110,121,32,105,116,101,109,115,32,121,111, - 117,32,109,105,103,104,116,32,119,97,110,116,32,116,111,32,97,100,100,32,109,117,115,116,32,98,101,32,108,105,115,116,101,100,32,104,101,114,101,46, - 32,84,104,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,111,114,100,101,114,32,105,110,32,119,104,105,99,104,32,116,104,101,121, - 32,97,114,101,32,108,105,115,116,101,100,32,119,105,108,108,32,98,101,32,117,115,101,100,32,98,121,32,116,104,101,32,116,111,111,108,98,97,114,32, - 99,117,115,116,111,109,105,115,97,116,105,111,110,32,112,97,110,101,108,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46, - 97,100,100,32,40,100,111,99,95,110,101,119,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99, - 95,111,112,101,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,65,115,41,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,111,112,121,41,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,117,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46, - 97,100,100,32,40,101,100,105,116,95,112,97,115,116,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40, - 106,117,99,101,76,111,103,111,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,99, - 117,115,116,111,109,67,111,109,98,111,66,111,120,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,121,111,117, - 39,114,101,32,103,111,105,110,103,32,116,111,32,117,115,101,32,115,101,112,97,114,97,116,111,114,115,44,32,116,104,101,110,32,116,104,101,121,32,109, - 117,115,116,32,97,108,115,111,32,98,101,32,97,100,100,101,100,32,101,120,112,108,105,99,105,116,108,121,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,47,47,32,116,111,32,116,104,101,32,108,105,115,116,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40, - 115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115, - 112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101, - 83,112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,103,101, - 116,68,101,102,97,117,108,116,73,116,101,109,83,101,116,32,40,65,114,114,97,121,32,60,105,110,116,62,38,32,105,100,115,41,13,10,32,32,32,32, - 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,105,115,32,114,101,116,117,114,110,115,32,97,110,32,111,114, - 100,101,114,101,100,32,108,105,115,116,32,111,102,32,116,104,101,32,115,101,116,32,111,102,32,105,116,101,109,115,32,116,104,97,116,32,109,97,107,101, - 32,117,112,32,97,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,111,111,108,98,97,114,39,115,32,100,101,102,97,117,108,116,32, - 115,101,116,46,32,78,111,116,32,97,108,108,32,105,116,101,109,115,32,110,101,101,100,32,116,111,32,98,101,32,111,110,32,116,104,105,115,32,108,105, - 115,116,44,32,97,110,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,105,116,101,109,115,32,99,97,110,32,97,112,112,101,97,114, - 32,109,117,108,116,105,112,108,101,32,116,105,109,101,115,32,40,101,46,103,46,32,116,104,101,32,115,101,112,97,114,97,116,111,114,115,32,117,115,101, - 100,32,104,101,114,101,41,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,110,101,119,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,111,112,101,110,41,59,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 105,100,115,46,97,100,100,32,40,100,111,99,95,115,97,118,101,65,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97, - 100,100,32,40,115,112,97,99,101,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112, - 97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116, - 95,99,111,112,121,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,99,117,116,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,101,100,105,116,95,112,97,115,116,101,41,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101,83,112,97,99,101,114,73,100,41,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,99,117,115,116,111,109,67,111,109,98,111,66,111,120,41,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,102,108,101,120,105,98,108,101,83,112,97,99,101,114,73,100,41,59,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,115,101,112,97,114,97,116,111,114,66,97,114,73,100,41,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,105,100,115,46,97,100,100,32,40,106,117,99,101,76,111,103,111,66,117,116,116,111,110,41,59,13,10,32,32,32,32,32, - 32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,42,32,99,114, - 101,97,116,101,73,116,101,109,32,40,99,111,110,115,116,32,105,110,116,32,105,116,101,109,73,100,41,13,10,32,32,32,32,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,115,119,105,116,99,104,32,40,105,116,101,109,73,100,41,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,110,101,119,58,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71, - 32,40,105,116,101,109,73,100,44,32,84,40,34,110,101,119,34,41,44,32,84,40,34,100,111,99,117,109,101,110,116,45,110,101,119,46,115,118,103,34, - 41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,111,112,101,110,58,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108, - 101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,111,112,101,110,34,41,44,32,84,40,34,100,111,99,117,109,101,110,116,45,111,112,101, - 110,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95,115,97,118,101,58,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109, - 90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,115,97,118,101,34,41,44,32,84,40,34,100,111,99,117,109,101, - 110,116,45,115,97,118,101,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,100,111,99,95, - 115,97,118,101,65,115,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117, - 116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44,32,84,40,34,115,97,118,101,32,97,115,34,41, - 44,32,84,40,34,100,111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,99,111,112,121,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101, - 116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73,100,44, - 32,84,40,34,99,111,112,121,34,41,44,32,84,40,34,101,100,105,116,45,99,111,112,121,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,99,117,116,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101,109,73, - 100,44,32,84,40,34,99,117,116,34,41,44,32,84,40,34,101,100,105,116,45,99,117,116,46,115,118,103,34,41,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,99,97,115,101,32,101,100,105,116,95,112,97,115,116,101,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,114,101,116,117,114,110,32,99,114,101,97,116,101,66,117,116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,105,116,101, - 109,73,100,44,32,84,40,34,112,97,115,116,101,34,41,44,32,84,40,34,101,100,105,116,45,112,97,115,116,101,46,115,118,103,34,41,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115,101,32,106,117,99,101,76,111,103,111,66,117,116,116,111,110,58,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,84,111,111,108,98,97,114,66,117,116,116,111,110,32,40,105,116, - 101,109,73,100,44,32,84,40,34,106,117,99,101,33,34,41,44,32,68,114,97,119,97,98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109, - 97,103,101,68,97,116,97,32,40,66,105,110,97,114,121,68,97,116,97,58,58,106,117,99,101,95,112,110,103,44,32,66,105,110,97,114,121,68,97,116, - 97,58,58,106,117,99,101,95,112,110,103,83,105,122,101,41,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,115, - 101,32,99,117,115,116,111,109,67,111,109,98,111,66,111,120,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114, - 110,32,110,101,119,32,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,32,40,105,116,101,109,73,100,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,102,97,117,108,116,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98, - 114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117, - 114,110,32,48,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32, - 32,32,83,116,114,105,110,103,65,114,114,97,121,32,105,99,111,110,78,97,109,101,115,59,13,10,32,32,32,32,32,32,32,32,79,119,110,101,100,65, - 114,114,97,121,32,60,68,114,97,119,97,98,108,101,62,32,105,99,111,110,115,70,114,111,109,90,105,112,70,105,108,101,59,13,10,13,10,32,32,32, - 32,32,32,32,32,47,47,32,84,104,105,115,32,105,115,32,97,32,108,105,116,116,108,101,32,117,116,105,108,105,116,121,32,116,111,32,99,114,101,97, - 116,101,32,97,32,98,117,116,116,111,110,32,119,105,116,104,32,111,110,101,32,111,102,32,116,104,101,32,83,86,71,32,105,109,97,103,101,115,32,105, - 110,13,10,32,32,32,32,32,32,32,32,47,47,32,111,117,114,32,101,109,98,101,100,100,101,100,32,90,73,80,32,102,105,108,101,32,34,105,99,111, - 110,115,46,122,105,112,34,13,10,32,32,32,32,32,32,32,32,84,111,111,108,98,97,114,66,117,116,116,111,110,42,32,99,114,101,97,116,101,66,117, - 116,116,111,110,70,114,111,109,90,105,112,70,105,108,101,83,86,71,32,40,99,111,110,115,116,32,105,110,116,32,105,116,101,109,73,100,44,32,99,111, - 110,115,116,32,83,116,114,105,110,103,38,32,116,101,120,116,44,32,99,111,110,115,116,32,83,116,114,105,110,103,38,32,102,105,108,101,110,97,109,101, - 41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,99,111,110,115,70,114,111,109,90, - 105,112,70,105,108,101,46,115,105,122,101,40,41,32,61,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,73,102,32,119,101,39,118,101,32,110,111,116,32,97,108,114,101,97,100,121,32,100,111,110,101, - 32,115,111,44,32,108,111,97,100,32,97,108,108,32,116,104,101,32,105,109,97,103,101,115,32,102,114,111,109,32,116,104,101,32,122,105,112,32,102,105, - 108,101,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,77,101,109,111,114,121,73,110,112,117,116,83,116,114,101,97,109,32, - 105,99,111,110,115,70,105,108,101,83,116,114,101,97,109,32,40,66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,44,32, - 66,105,110,97,114,121,68,97,116,97,58,58,105,99,111,110,115,95,122,105,112,83,105,122,101,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,90,105,112,70,105,108,101,32,105,99,111,110,115,32,40,38,105,99,111,110,115,70,105,108,101,83,116,114, - 101,97,109,44,32,102,97,108,115,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116, - 32,105,32,61,32,48,59,32,105,32,60,32,105,99,111,110,115,46,103,101,116,78,117,109,69,110,116,114,105,101,115,40,41,59,32,43,43,105,41,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 73,110,112,117,116,83,116,114,101,97,109,42,32,115,118,103,70,105,108,101,83,116,114,101,97,109,32,61,32,105,99,111,110,115,46,99,114,101,97,116, - 101,83,116,114,101,97,109,70,111,114,69,110,116,114,121,32,40,105,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,105,102,32,40,115,118,103,70,105,108,101,83,116,114,101,97,109,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,123,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,105,99,111,110, - 78,97,109,101,115,46,97,100,100,32,40,105,99,111,110,115,46,103,101,116,69,110,116,114,121,40,105,41,45,62,102,105,108,101,110,97,109,101,41,59, - 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,105,99,111,110,115,70,114,111,109,90,105,112,70,105, - 108,101,46,97,100,100,32,40,68,114,97,119,97,98,108,101,58,58,99,114,101,97,116,101,70,114,111,109,73,109,97,103,101,68,97,116,97,83,116,114, - 101,97,109,32,40,42,115,118,103,70,105,108,101,83,116,114,101,97,109,41,41,59,13,10,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,100,101,108,101,116,101,32,115,118,103,70,105,108,101,83,116,114,101,97,109,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,114,97,119,97,98,108,101,42,32,105,109,97,103,101,32, - 61,32,105,99,111,110,115,70,114,111,109,90,105,112,70,105,108,101,32,91,105,99,111,110,78,97,109,101,115,46,105,110,100,101,120,79,102,32,40,102, - 105,108,101,110,97,109,101,41,93,45,62,99,114,101,97,116,101,67,111,112,121,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101, - 116,117,114,110,32,110,101,119,32,84,111,111,108,98,97,114,66,117,116,116,111,110,32,40,105,116,101,109,73,100,44,32,116,101,120,116,44,32,105,109, - 97,103,101,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,48,59,13,10,32,32,32,32,32, - 32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,68,101,109,111,110,115,116,114,97,116,101,115,32,104,111,119,32,116,111,32,112, - 117,116,32,97,32,99,117,115,116,111,109,32,99,111,109,112,111,110,101,110,116,32,105,110,116,111,32,97,32,116,111,111,108,98,97,114,32,45,32,116, - 104,105,115,32,111,110,101,32,99,111,110,116,97,105,110,115,13,10,32,32,32,32,32,32,32,32,47,47,32,97,32,67,111,109,98,111,66,111,120,46, - 13,10,32,32,32,32,32,32,32,32,99,108,97,115,115,32,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,32,58,32, - 112,117,98,108,105,99,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,13,10,32,32,32,32,32,32,32,32,123,13,10, - 32,32,32,32,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,67,117,115,116,111,109,84,111,111,108,98, - 97,114,67,111,109,98,111,66,111,120,32,40,99,111,110,115,116,32,105,110,116,32,116,111,111,108,98,97,114,73,116,101,109,73,100,41,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,58,32,84,111,111,108,98,97,114,73,116,101,109,67,111,109,112,111,110,101,110,116,32,40,116,111, - 111,108,98,97,114,73,116,101,109,73,100,44,32,84,40,34,67,117,115,116,111,109,32,84,111,111,108,98,97,114,32,73,116,101,109,34,41,44,32,102, - 97,108,115,101,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,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,99,111,109,98,111,66,111,120,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120, - 32,40,84,40,34,100,101,109,111,32,116,111,111,108,98,97,114,32,99,111,109,98,111,32,98,111,120,34,41,41,41,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,49,59,32,105,32,60,32,50,48,59,32,43,43,105,41, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,97,100,100,73,116,101,109,32, - 40,84,40,34,84,111,111,108,98,97,114,32,67,111,109,98,111,66,111,120,32,105,116,101,109,32,34,41,32,43,32,83,116,114,105,110,103,32,40,105, - 41,44,32,105,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,83, - 101,108,101,99,116,101,100,73,100,32,40,49,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120, - 45,62,115,101,116,69,100,105,116,97,98,108,101,84,101,120,116,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125, - 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,126,67,117,115,116,111,109,84,111,111,108,98,97,114,67,111,109,98,111,66,111,120,40,41, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32, - 99,111,109,98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 98,111,111,108,32,103,101,116,84,111,111,108,98,97,114,73,116,101,109,83,105,122,101,115,32,40,105,110,116,32,116,111,111,108,98,97,114,68,101,112, - 116,104,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,32,32,32,32,32,32,32,32,32,32, - 32,32,32,98,111,111,108,32,105,115,84,111,111,108,98,97,114,86,101,114,116,105,99,97,108,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,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,38,32,112,114,101,102,101,114,114,101,100, - 83,105,122,101,44,32,105,110,116,38,32,109,105,110,83,105,122,101,44,32,105,110,116,38,32,109,97,120,83,105,122,101,41,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,105,115,84,111,111,108,98,97,114,86, - 101,114,116,105,99,97,108,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,102,97,108, - 115,101,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,112,114,101,102,101,114,114,101,100,83,105,122,101,32,61,32,50, - 53,48,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,109,105,110,83,105,122,101,32,61,32,56,48,59,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,109,97,120,83,105,122,101,32,61,32,51,48,48,59,13,10,32,32,32,32,32,32,32,32,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,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,118,111,105,100,32,112,97,105,110,116,66,117,116,116,111,110,65,114,101,97,32,40,71,114,97,112,104,105,99,115,38,44,32, - 105,110,116,44,32,105,110,116,44,32,98,111,111,108,44,32,98,111,111,108,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,116,101,110,116,65, - 114,101,97,67,104,97,110,103,101,100,32,40,99,111,110,115,116,32,82,101,99,116,97,110,103,108,101,38,32,99,111,110,116,101,110,116,65,114,101,97, - 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66, - 111,120,45,62,115,101,116,83,105,122,101,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,87,105,100,116,104,40,41,32,45,32,50,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,32,32,32,32,32,32,32,32,32,32,106,109,105, - 110,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,72,101,105,103,104,116,40,41,32,45,32,50,44,32,50,50,41,41,59,13,10,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111,120,45,62,115,101,116,67,101,110,116,114,101,80,111,115,105, - 116,105,111,110,32,40,99,111,110,116,101,110,116,65,114,101,97,46,103,101,116,67,101,110,116,114,101,88,40,41,44,32,99,111,110,116,101,110,116,65, - 114,101,97,46,103,101,116,67,101,110,116,114,101,89,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32, - 32,32,32,32,32,112,114,105,118,97,116,101,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,67,111,109,98,111,66,111,120,42,32,99,111,109, - 98,111,66,111,120,59,13,10,32,32,32,32,32,32,32,32,125,59,13,10,32,32,32,32,125,59,13,10,13,10,32,32,32,32,68,101,109,111,84,111, - 111,108,98,97,114,73,116,101,109,70,97,99,116,111,114,121,32,102,97,99,116,111,114,121,59,13,10,125,59,13,10,13,10,47,47,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, + 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,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,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,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,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,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,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,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,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,32,32,32,32,32,32,112,117,98,108,105,99,32,67,111,109,98,111,66,111,120,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,61,61,61,61,61,61,61,61,61,61,61,61,61,13,10,99,108,97,115,115, - 32,68,101,109,111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,32,58,32,112,117,98,108,105,99,32,84,97,98,98,101,100,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,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,68,101,109, - 111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97, - 103,101,114,42,32,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,32,32,32,32,32,32,32,32,58,32,84,97,98,98,101,100,67,111, - 109,112,111,110,101,110,116,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,13,10,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,115,108,105,100,101,114,115,34,41,44,32,32,32,32,32,32, - 32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,99,114,101,97,116,101,83,108,105,100,101,114,115,80, - 97,103,101,40,41,44,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,116, - 111,111,108,98,97,114,115,34,41,44,32,32,32,32,32,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44, - 32,110,101,119,32,84,111,111,108,98,97,114,68,101,109,111,67,111,109,112,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,44,32,32, - 32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,98,117,116,116,111,110,115,34,41,44,32, - 32,32,32,32,32,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,110,101,119,32,66,117,116,116,111, - 110,115,80,97,103,101,32,40,116,104,105,115,41,44,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,97,100,100,84,97,98,32, - 40,84,40,34,114,97,100,105,111,32,98,117,116,116,111,110,115,34,41,44,32,103,101,116,82,97,110,100,111,109,66,114,105,103,104,116,67,111,108,111, - 117,114,40,41,44,32,99,114,101,97,116,101,82,97,100,105,111,66,117,116,116,111,110,80,97,103,101,40,41,44,32,32,116,114,117,101,41,59,13,10, - 32,32,32,32,32,32,32,32,97,100,100,84,97,98,32,40,84,40,34,109,105,115,99,32,119,105,100,103,101,116,115,34,41,44,32,32,103,101,116,82, - 97,110,100,111,109,66,114,105,103,104,116,67,111,108,111,117,114,40,41,44,32,99,114,101,97,116,101,77,105,115,99,80,97,103,101,40,41,44,32,32, - 32,32,32,32,32,32,32,116,114,117,101,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,84,97,98,98,101,100,67, - 111,109,112,111,110,101,110,116,40,41,13,10,32,32,32,32,123,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32, - 32,32,32,32,66,117,98,98,108,101,77,101,115,115,97,103,101,67,111,109,112,111,110,101,110,116,42,32,98,109,99,32,61,32,110,101,119,32,66,117, - 98,98,108,101,77,101,115,115,97,103,101,67,111,109,112,111,110,101,110,116,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,68, - 101,115,107,116,111,112,58,58,99,97,110,85,115,101,83,101,109,105,84,114,97,110,115,112,97,114,101,110,116,87,105,110,100,111,119,115,40,41,41,13, - 10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,109,99,45,62,115,101,116,65,108,119,97,121,115,79,110, - 84,111,112,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,109,99,45,62,97,100,100,84,111,68,101,115,107,116, - 111,112,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,98,109,99,41, - 59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,98,109,99,45,62,115,104,111,119,65,116,32,40,98,117,116, - 116,111,110,44,32,84,40,34,84,104,105,115,32,105,115,32,97,32,100,101,109,111,32,111,102,32,116,104,101,32,66,117,98,98,108,101,77,101,115,115, - 97,103,101,67,111,109,112,111,110,101,110,116,44,32,119,104,105,99,104,32,108,101,116,115,32,121,111,117,32,112,111,112,32,117,112,32,97,32,109,101, - 115,115,97,103,101,32,112,111,105,110,116,105,110,103,32,97,116,32,97,32,99,111,109,112,111,110,101,110,116,32,111,114,32,115,111,109,101,119,104,101, - 114,101,32,111,110,32,116,104,101,32,115,99,114,101,101,110,46,92,110,92,110,84,104,101,32,109,101,115,115,97,103,101,32,98,117,98,98,108,101,115, - 32,119,105,108,108,32,100,105,115,97,112,112,101,97,114,32,97,102,116,101,114,32,97,32,116,105,109,101,111,117,116,32,112,101,114,105,111,100,44,32, - 111,114,32,119,104,101,110,32,116,104,101,32,109,111,117,115,101,32,105,115,32,99,108,105,99,107,101,100,46,34,41,44,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,50,48,48,48,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,125, - 13,10,13,10,32,32,32,32,115,116,97,116,105,99,32,99,111,110,115,116,32,67,111,108,111,117,114,32,103,101,116,82,97,110,100,111,109,66,114,105, - 103,104,116,67,111,108,111,117,114,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,67,111,108,111,117, - 114,32,40,82,97,110,100,111,109,58,58,103,101,116,83,121,115,116,101,109,82,97,110,100,111,109,40,41,46,110,101,120,116,70,108,111,97,116,40,41, - 44,32,48,46,49,102,44,32,48,46,57,55,102,44,32,49,46,48,102,41,59,13,10,32,32,32,32,125,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,13,10,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111, + 109,109,115,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,114,118,101,114,32,61,32,110,101,119,32,68, + 101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,40,42,116,104,105,115,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,78,97,109,101,32,40,84,40,34,73,110,116,101,114,112,114,111,99,101,115,115,32,67,111,109, + 109,117,110,105,99,97,116,105,111,110,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,114,101,97,116,101,32,97,108,108,32, + 111,117,114,32,85,73,32,98,105,116,115,32,97,110,100,32,112,105,101,99,101,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,109,111,100,101,83,101,108,101,99,116,111,114,32,61,32,110,101,119,32,67,111,109,98,111,66,111,120, + 32,40,84,40,34,109,111,100,101,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115, + 101,116,66,111,117,110,100,115,32,40,49,48,48,44,32,50,53,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,40,110, + 101,119,32,76,97,98,101,108,32,40,109,111,100,101,83,101,108,101,99,116,111,114,45,62,103,101,116,78,97,109,101,40,41,44,32,109,111,100,101,83, + 101,108,101,99,116,111,114,45,62,103,101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32, + 40,109,111,100,101,83,101,108,101,99,116,111,114,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108, + 101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,40,68,105,115,99,111,110,110,101,99,116,101,100,41,34,41,44,32,56,41,59, + 13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13, + 10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,78,97,109,101,100, + 32,112,105,112,101,32,40,108,105,115,116,101,110,105,110,103,41,34,41,44,32,49,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101, + 108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,78,97,109,101,100,32,112,105,112,101,32,40,99,111,110,110,101,99,116,32, + 116,111,32,101,120,105,115,116,105,110,103,32,112,105,112,101,41,34,41,44,32,53,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101, + 108,101,99,116,111,114,45,62,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108, + 101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34,83,111,99,107,101,116,32,40,108,105,115,116,101,110,105,110,103,41,34,41,44, + 32,50,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,97,100,100,73,116,101,109,32,40,84,40,34, + 83,111,99,107,101,116,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103,32,115,111,99,107,101,116,41,34,41,44,32,54, + 41,59,13,10,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73, + 100,32,40,56,41,59,13,10,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,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,97,100,100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40, + 112,105,112,101,78,97,109,101,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,112,105,112,101,32,110,97,109,101,58, + 34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,48,44, + 32,54,48,44,32,49,51,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,77,117,108, + 116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,112,105,112,101,78,97,109,101,45,62,115,101,116,84,101, + 120,116,32,40,84,40,34,106,117,99,101,32,100,101,109,111,32,112,105,112,101,34,41,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32, + 76,97,98,101,108,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,78,97,109,101,40,41,44,32,112,105,112,101,78,97,109,101,45,62,103,101, + 116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,112,105,112,101,78,97,109,101,44,32, + 116,114,117,101,41,59,13,10,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,115,111,99, + 107,101,116,78,117,109,98,101,114,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,115,111,99,107,101,116,32,112,111, + 114,116,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,66,111,117,110,100, + 115,32,40,51,53,48,44,32,54,48,44,32,56,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,78,117,109,98, + 101,114,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101, + 116,78,117,109,98,101,114,45,62,115,101,116,84,101,120,116,32,40,84,40,34,49,50,51,52,53,34,41,41,59,13,10,32,32,32,32,32,32,32,32, + 115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,73,110,112,117,116,82,101,115,116,114,105,99,116,105,111,110,115,32,40,53,44,32,84, + 40,34,48,49,50,51,52,53,54,55,56,57,34,41,41,59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,115,111, + 99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,78,97,109,101,40,41,44,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116, + 78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67,111,109,112,111,110,101,110,116,32,40,115,111,99,107,101,116,78,117,109,98,101, + 114,44,32,116,114,117,101,41,59,13,10,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, + 115,111,99,107,101,116,72,111,115,116,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,115,111,99,107,101,116,32,104, + 111,115,116,58,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72,111,115,116,45,62,115,101,116,66,111,117,110,100,115, + 32,40,53,51,48,44,32,54,48,44,32,49,51,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72,111,115,116, + 45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,111,99,107,101,116,72, + 111,115,116,45,62,115,101,116,84,101,120,116,32,40,84,40,34,108,111,99,97,108,104,111,115,116,34,41,41,59,13,10,32,32,32,32,32,32,32,32, + 115,111,99,107,101,116,78,117,109,98,101,114,45,62,115,101,116,73,110,112,117,116,82,101,115,116,114,105,99,116,105,111,110,115,32,40,53,49,50,41, + 59,13,10,32,32,32,32,32,32,32,32,40,110,101,119,32,76,97,98,101,108,32,40,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,78,97, + 109,101,40,41,44,32,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,78,97,109,101,40,41,41,41,45,62,97,116,116,97,99,104,84,111,67, + 111,109,112,111,110,101,110,116,32,40,115,111,99,107,101,116,72,111,115,116,44,32,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,115,101,110,100,84,101,120,116,32,61,32,110,101,119,32,84,101,120,116,69,100, + 105,116,111,114,32,40,84,40,34,115,101,110,100,116,101,120,116,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116, + 45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32, + 32,115,101,110,100,84,101,120,116,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32, + 32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,82,101,97,100,79,110,108,121,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32, + 32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,84,101,120,116,32,40,84,40,34,116,101,115,116,105,110,103,32,49,50,51,52,34,41,41,59, + 13,10,13,10,32,32,32,32,32,32,32,32,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,115,101,110,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,84,40,34,115,101,110,100,34,41,44,32,84,40,34,70,105,114,101,115,32, + 111,102,102,32,116,104,101,32,109,101,115,115,97,103,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110, + 45,62,115,101,116,66,111,117,110,100,115,32,40,50,52,48,44,32,49,50,48,44,32,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32, + 32,32,115,101,110,100,66,117,116,116,111,110,45,62,99,104,97,110,103,101,87,105,100,116,104,84,111,70,105,116,84,101,120,116,40,41,59,13,10,32, + 32,32,32,32,32,32,32,115,101,110,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,97,100,100,67,104,105,108,100,67,111,109,112,111,110,101,110,116,32,40,105,110,99,111,109, + 105,110,103,77,101,115,115,97,103,101,115,32,61,32,110,101,119,32,84,101,120,116,69,100,105,116,111,114,32,40,84,40,34,109,101,115,115,97,103,101, + 115,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,82,101,97, + 100,79,110,108,121,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45, + 62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77, + 101,115,115,97,103,101,115,45,62,115,101,116,66,111,117,110,100,115,32,40,51,48,44,32,49,53,48,44,32,53,48,48,44,32,50,53,48,41,59,13, + 10,13,10,32,32,32,32,32,32,32,32,47,47,32,99,97,108,108,32,116,104,105,115,32,116,111,32,115,101,116,32,117,112,32,101,118,101,114,121,116, + 104,105,110,103,39,115,32,115,116,97,116,101,32,99,111,114,114,101,99,116,108,121,46,13,10,32,32,32,32,32,32,32,32,99,111,109,98,111,66,111, + 120,67,104,97,110,103,101,100,32,40,48,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,73,110,116,101,114,112,114,111,99,101,115, + 115,67,111,109,109,115,68,101,109,111,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,32, + 32,32,32,32,32,32,32,100,101,108,101,116,101,32,115,101,114,118,101,114,59,13,10,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,98,117,116,116,111,110,67, + 108,105,99,107,101,100,32,40,66,117,116,116,111,110,42,32,98,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32, + 105,102,32,40,98,117,116,116,111,110,32,61,61,32,115,101,110,100,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,47,47,32,84,104,101,32,115,101,110,100,32,98,117,116,116,111,110,32,104,97,115,32,98,101,101,110,32,112,114, + 101,115,115,101,100,44,32,115,111,32,119,114,105,116,101,32,111,117,116,32,116,104,101,32,99,111,110,116,101,110,116,115,32,111,102,32,116,104,101,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,101,120,116,32,98,111,120,32,116,111,32,116,104,101,32,115,111,99,107,101,116,32,111, + 114,32,112,105,112,101,44,32,100,101,112,101,110,100,105,110,103,32,111,110,32,119,104,105,99,104,32,105,115,32,97,99,116,105,118,101,46,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,83,116,114,105,110,103,32,116,101,120,116,32,40,115,101,110,100,84,101,120,116,45,62, + 103,101,116,84,101,120,116,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,77,101,109,111,114,121,66,108,111,99,107,32,109,101,115, + 115,97,103,101,68,97,116,97,32,40,40,99,111,110,115,116,32,99,104,97,114,42,41,32,116,101,120,116,44,32,116,101,120,116,46,108,101,110,103,116, + 104,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,114,32,40,105,110,116,32,105,32,61,32,97,99,116,105,118,101, + 67,111,110,110,101,99,116,105,111,110,115,46,115,105,122,101,40,41,59,32,45,45,105,32,62,61,32,48,59,41,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,33,32,97,99,116,105,118,101,67,111,110,110,101, + 99,116,105,111,110,115,91,105,93,45,62,115,101,110,100,77,101,115,115,97,103,101,32,40,109,101,115,115,97,103,101,68,97,116,97,41,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47, + 32,116,104,101,32,119,114,105,116,101,32,102,97,105,108,101,100,44,32,115,111,32,105,110,100,105,99,97,116,101,32,116,104,97,116,32,116,104,101,32, + 99,111,110,110,101,99,116,105,111,110,32,104,97,115,32,98,114,111,107,101,110,46,46,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,115,101,110,100,32,109,101,115,115,97,103,101,32,102,97,105,108, + 101,100,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32, + 125,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,111,109,98,111,66,111,120, + 67,104,97,110,103,101,100,32,40,67,111,109,98,111,66,111,120,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,84, + 104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,117,115,101,114,32,112,105,99,107,115,32,97,32,100,105,102,102, + 101,114,101,110,116,32,109,111,100,101,32,102,114,111,109,32,116,104,101,32,100,114,111,112,45,100,111,119,110,32,108,105,115,116,46,46,13,10,32,32, + 32,32,32,32,32,32,99,111,110,115,116,32,105,110,116,32,109,111,100,101,73,100,32,61,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,103, + 101,116,83,101,108,101,99,116,101,100,73,100,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,105,102,32,40,109,111,100,101,73,100,32,60,32,56,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,111,112,101,110,32,40,40,109,111,100,101,73,100,32,38,32,50,41,32,33,61,32,48,44,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,40,109,111,100,101,73,100,32,38,32,52,41,32,33,61,32,48,41,59,13,10,32,32,32,32,32,32,32,32, + 125,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,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,68,101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100,32,32,58,32,112,117,98,108,105,99,32,84,104,114, - 101,97,100,87,105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,68, - 101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100,40,41,13,10,32,32,32,32,32,32,32,32,58,32,84,104,114,101,97,100,87, - 105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,32,40,84,40,34,98,117,115,121,32,100,111,105,110,103,32,115,111,109,101,32,105,109, - 112,111,114,116,97,110,116,32,116,104,105,110,103,115,46,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,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,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,115,101,116,83,116,97,116,117,115,77,101,115,115,97,103,101,32,40,84,40,34,71,101,116,116,105,110,103,32,114,101,97,100,121,46,46,46, - 34,41,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,68,101,109,111,66,97,99,107,103,114,111,117,110,100,84,104,114,101,97,100, - 40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,114,117,110,40,41,13,10,32,32,32,32, - 123,13,10,32,32,32,32,32,32,32,32,115,101,116,80,114,111,103,114,101,115,115,32,40,45,49,46,48,41,59,32,47,47,32,115,101,116,116,105,110, - 103,32,97,32,118,97,108,117,101,32,98,101,121,111,110,100,32,116,104,101,32,114,97,110,103,101,32,48,32,45,62,32,49,32,119,105,108,108,32,115, - 104,111,119,32,97,32,115,112,105,110,110,105,110,103,32,98,97,114,46,46,13,10,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117,115,77, - 101,115,115,97,103,101,32,40,84,40,34,80,114,101,112,97,114,105,110,103,32,116,111,32,100,111,32,115,111,109,101,32,115,116,117,102,102,46,46,46, - 34,41,41,59,13,10,32,32,32,32,32,32,32,32,119,97,105,116,32,40,50,48,48,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,99,111, - 110,115,116,32,105,110,116,32,116,104,105,110,103,115,84,111,68,111,32,61,32,49,48,59,13,10,13,10,32,32,32,32,32,32,32,32,102,111,114,32, - 40,105,110,116,32,105,32,61,32,48,59,32,105,32,60,32,116,104,105,110,103,115,84,111,68,111,59,32,43,43,105,41,13,10,32,32,32,32,32,32, - 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,109,117,115,116,32,99,104,101,99,107,32,116,104,105,115,32,97,115,32,111, - 102,116,101,110,32,97,115,32,112,111,115,115,105,98,108,101,44,32,98,101,99,97,117,115,101,32,116,104,105,115,32,105,115,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,47,47,32,104,111,119,32,119,101,32,107,110,111,119,32,105,102,32,116,104,101,32,117,115,101,114,39,115,32,112,114,101,115, - 115,101,100,32,39,99,97,110,99,101,108,39,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,116,104,114,101,97,100,83,104,111,117, - 108,100,69,120,105,116,40,41,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,119,105,108,108,32,117,112,100,97,116,101,32,116,104,101,32,112,114,111,103,114,101,115, - 115,32,98,97,114,32,111,110,32,116,104,101,32,100,105,97,108,111,103,32,98,111,120,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,101,116, - 80,114,111,103,114,101,115,115,32,40,105,32,47,32,40,100,111,117,98,108,101,41,32,116,104,105,110,103,115,84,111,68,111,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117,115,77,101,115,115,97,103,101,32,40,83,116,114,105,110,103,32,40,116,104,105, - 110,103,115,84,111,68,111,32,45,32,105,41,32,43,32,84,40,34,32,116,104,105,110,103,115,32,108,101,102,116,32,116,111,32,100,111,46,46,46,34, - 41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,119,97,105,116,32,40,53,48,48,41,59,13,10,32,32,32,32,32,32,32,32, - 125,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,80,114,111,103,114,101,115,115,32,40,45,49,46,48,41,59,32,47,47,32,115,101,116,116, - 105,110,103,32,97,32,118,97,108,117,101,32,98,101,121,111,110,100,32,116,104,101,32,114,97,110,103,101,32,48,32,45,62,32,49,32,119,105,108,108, - 32,115,104,111,119,32,97,32,115,112,105,110,110,105,110,103,32,98,97,114,46,46,13,10,32,32,32,32,32,32,32,32,115,101,116,83,116,97,116,117, - 115,77,101,115,115,97,103,101,32,40,84,40,34,70,105,110,105,115,104,105,110,103,32,111,102,102,32,116,104,101,32,108,97,115,116,32,102,101,119,32, - 98,105,116,115,32,97,110,100,32,112,105,101,99,101,115,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32,119,97,105,116,32,40,51,48,48,48, - 41,59,13,10,32,32,32,32,125,13,10,125,59,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,13,10,32,32,32,32,47,47,32,74,117,115,116,32,99,108,111,115,101,115,32,97,110,121, + 32,99,111,110,110,101,99,116,105,111,110,115,32,116,104,97,116,32,97,114,101,32,99,117,114,114,101,110,116,108,121,32,111,112,101,110,46,13,10,32, + 32,32,32,118,111,105,100,32,99,108,111,115,101,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,115,101,114,118,101,114,45,62, + 115,116,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,99,108,101,97,114, + 40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,82,101,115,101,116,32,116,104,101,32,85,73,32,115,116,117,102,102,32,116,111,32, + 97,32,100,105,115,97,98,108,101,100,32,115,116,97,116,101,46,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116,45,62,115,101,116, + 86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110,45,62,115,101, + 116,86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97, + 103,101,115,45,62,115,101,116,84,101,120,116,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,102,97,108,115,101,41,59,13,10,32,32, + 32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101, + 41,59,13,10,13,10,32,32,32,32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,34,84,111,32,100,101,109,111,110,115,116,114,97,116,101,32,110,97,109,101,100,32,112,105,112,101,115,44,32,121,111,117,39,108,108,32,110, + 101,101,100,32,116,111,32,114,117,110,32,116,119,111,32,105,110,115,116,97,110,99,101,115,32,111,102,32,116,104,101,32,74,117,99,101,68,101,109,111, + 32,97,112,112,108,105,99,97,116,105,111,110,32,111,110,32,116,104,105,115,32,109,97,99,104,105,110,101,46,32,79,110,32,34,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,34,111,110,101,32,111,102,32,116,104,101,109,44,32,115,101,108,101,99,116,32,92,34,110,97,109,101,100,32,112,105,112, + 101,32,40,108,105,115,116,101,110,105,110,103,41,92,34,44,32,97,110,100,32,116,104,101,110,32,111,110,32,116,104,101,32,111,116,104,101,114,44,32, + 115,101,108,101,99,116,32,92,34,110,97,109,101,100,32,112,105,112,101,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103, + 32,112,105,112,101,41,92,34,46,32,84,104,101,110,32,109,101,115,115,97,103,101,115,32,116,104,97,116,32,121,111,117,32,34,13,10,32,32,32,32, + 32,32,32,32,32,32,32,32,34,115,101,110,100,32,102,114,111,109,32,116,104,101,32,39,115,101,110,100,101,114,39,32,97,112,112,32,115,104,111,117, + 108,100,32,97,112,112,101,97,114,32,111,110,32,116,104,101,32,108,105,115,116,101,110,101,114,32,97,112,112,46,32,84,104,101,32,92,34,112,105,112, + 101,32,110,97,109,101,92,34,32,102,105,101,108,100,32,108,101,116,115,32,121,111,117,32,99,104,111,111,115,101,32,97,32,110,97,109,101,32,102,111, + 114,32,116,104,101,32,112,105,112,101,92,110,92,110,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,84,111,32,100,101,109,111,110,115,116, + 114,97,116,101,32,115,111,99,107,101,116,115,44,32,121,111,117,32,99,97,110,32,101,105,116,104,101,114,32,114,117,110,32,116,119,111,32,105,110,115, + 116,97,110,99,101,115,32,111,102,32,116,104,101,32,97,112,112,32,111,110,32,116,104,101,32,115,97,109,101,32,109,97,99,104,105,110,101,44,32,111, + 114,32,111,110,32,100,105,102,102,101,114,101,110,116,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,109,97,99,104,105,110,101,115,32, + 111,110,32,121,111,117,114,32,110,101,116,119,111,114,107,46,32,73,110,32,101,97,99,104,32,111,110,101,32,101,110,116,101,114,32,97,32,115,111,99, + 107,101,116,32,110,117,109,98,101,114,44,32,116,104,101,110,32,111,110,32,111,110,101,32,111,102,32,116,104,101,32,97,112,112,115,44,32,115,101,108, + 101,99,116,32,116,104,101,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,92,34,83,111,99,107,101,116,32,40,108,105,115,116,101,110, + 105,110,103,41,92,34,32,109,111,100,101,46,32,79,110,32,116,104,101,32,111,116,104,101,114,44,32,101,110,116,101,114,32,116,104,101,32,104,111,115, + 116,32,97,100,100,114,101,115,115,32,111,102,32,116,104,101,32,108,105,115,116,101,110,105,110,103,32,97,112,112,44,32,97,110,100,32,115,101,108,101, + 99,116,32,92,34,83,111,99,107,101,116,32,40,99,111,110,110,101,99,116,32,116,111,32,101,120,105,115,116,105,110,103,32,115,111,99,107,101,116,41, + 92,34,46,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,77,101,115,115,97,103,101,115,32,115,104,111,117,108,100,32,116,104,101,110, + 32,98,101,32,98,101,32,115,101,110,116,32,98,101,116,119,101,101,110,32,116,104,101,32,97,112,112,115,32,105,110,32,116,104,101,32,115,97,109,101, + 32,119,97,121,32,97,115,32,116,104,114,111,117,103,104,32,116,104,101,32,110,97,109,101,100,32,112,105,112,101,115,46,34,41,59,13,10,32,32,32, + 32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,111,112,101,110,32,40,98,111,111,108,32,97,115,83,111,99,107,101,116,44,32,98,111,111,108, + 32,97,115,83,101,110,100,101,114,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,99,108,111,115,101,40,41,59,13,10,13,10,32, + 32,32,32,32,32,32,32,47,47,32,77,97,107,101,32,116,104,101,32,97,112,112,114,111,112,114,105,97,116,101,32,98,105,116,115,32,111,102,32,85, + 73,32,118,105,115,105,98,108,101,46,46,13,10,32,32,32,32,32,32,32,32,115,101,110,100,84,101,120,116,45,62,115,101,116,86,105,115,105,98,108, + 101,32,40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,115,101,110,100,66,117,116,116,111,110,45,62,115,101,116,86,105,115,105,98,108, + 101,32,40,116,114,117,101,41,59,13,10,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115, + 101,116,84,101,120,116,32,40,83,116,114,105,110,103,58,58,101,109,112,116,121,44,32,102,97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32, + 105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,86,105,115,105,98,108,101,32,40,116,114,117,101,41,59,13,10,13,10, + 32,32,32,32,32,32,32,32,47,47,32,97,110,100,32,116,114,121,32,116,111,32,111,112,101,110,32,116,104,101,32,115,111,99,107,101,116,32,111,114, + 32,112,105,112,101,46,46,46,13,10,32,32,32,32,32,32,32,32,98,111,111,108,32,111,112,101,110,101,100,79,107,32,61,32,102,97,108,115,101,59, + 13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,97,115,83,101,110,100,101,114,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,47,47,32,105,102,32,119,101,39,114,101,32,99,111,110,110,101,99,116,105,110,103,32,116,111,32,97,110,32,101, + 120,105,115,116,105,110,103,32,115,101,114,118,101,114,44,32,119,101,32,99,97,110,32,106,117,115,116,32,99,114,101,97,116,101,32,97,32,99,111,110, + 110,101,99,116,105,111,110,32,111,98,106,101,99,116,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,100,105,114,101,99,116,108,121,46, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110, + 42,32,110,101,119,67,111,110,110,101,99,116,105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111, + 110,110,101,99,116,105,111,110,32,40,42,116,104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,97,115,83, + 111,99,107,101,116,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111, + 112,101,110,101,100,79,107,32,61,32,110,101,119,67,111,110,110,101,99,116,105,111,110,45,62,99,111,110,110,101,99,116,84,111,83,111,99,107,101,116, + 32,40,115,111,99,107,101,116,72,111,115,116,45,62,103,101,116,84,101,120,116,40,41,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,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,32,32,32,32, + 32,32,32,32,32,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,84,101,120,116,40,41,46,103,101,116,73,110,116,86,97,108,117,101, + 40,41,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,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,32,32,32,32,32,32,32,32,32,49,48,48,48,41,59,13,10,32,32,32,32,32,32,32,32, + 32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,110,101,119,67,111,110,110,101,99,116,105,111,110, + 45,62,99,111,110,110,101,99,116,84,111,80,105,112,101,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,84,101,120,116,40,41,41,59,13,10, + 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79, + 107,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100, + 100,32,40,110,101,119,67,111,110,110,101,99,116,105,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32, + 32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,47,47,32,105,102,32,119,101,39,114,101,32,115,116,97,114,116,105,110,103,32,117,112,32,97,32,115,101,114,118,101,114,44,32,119, + 101,32,110,101,101,100,32,116,111,32,116,101,108,108,32,116,104,101,32,115,101,114,118,101,114,32,116,111,32,115,116,97,114,116,32,119,97,105,116,105, + 110,103,32,102,111,114,13,10,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,99,108,105,101,110,116,115,32,116,111,32,99,111,110,110,101,99, + 116,46,32,73,116,39,108,108,32,116,104,101,110,32,99,114,101,97,116,101,32,99,111,110,110,101,99,116,105,111,110,32,111,98,106,101,99,116,115,32, + 102,111,114,32,117,115,32,119,104,101,110,32,99,108,105,101,110,116,115,32,97,114,114,105,118,101,46,13,10,32,32,32,32,32,32,32,32,32,32,32, + 32,105,102,32,40,97,115,83,111,99,107,101,116,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,115,101,114,118,101,114,45,62,98,101,103,105,110,87,97,105,116,105,110,103,70,111, + 114,83,111,99,107,101,116,32,40,115,111,99,107,101,116,78,117,109,98,101,114,45,62,103,101,116,84,101,120,116,40,41,46,103,101,116,73,110,116,86, + 97,108,117,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79,107, + 41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40, + 34,87,97,105,116,105,110,103,32,102,111,114,32,97,110,111,116,104,101,114,32,97,112,112,32,116,111,32,99,111,110,110,101,99,116,32,116,111,32,116, + 104,105,115,32,115,111,99,107,101,116,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32, + 32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,42,32,110,101,119,67,111,110,110,101,99,116, + 105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,40,42,116, + 104,105,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,101,110,101,100,79,107,32,61,32,110,101,119,67, + 111,110,110,101,99,116,105,111,110,45,62,99,114,101,97,116,101,80,105,112,101,32,40,112,105,112,101,78,97,109,101,45,62,103,101,116,84,101,120,116, + 40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,111,112,101,110,101,100,79,107,41,13,10,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,112, + 112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,87,97,105,116,105,110,103,32,102,111,114,32,97,110,111,116,104,101,114,32,97,112,112,32, + 116,111,32,99,111,110,110,101,99,116,32,116,111,32,116,104,105,115,32,112,105,112,101,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100,100,32,40,110,101,119,67,111,110, + 110,101,99,116,105,111,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,32,100,101,108,101,116,101,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,125,13,10,13, + 10,32,32,32,32,32,32,32,32,105,102,32,40,33,32,111,112,101,110,101,100,79,107,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32, + 32,32,32,32,32,32,32,32,32,109,111,100,101,83,101,108,101,99,116,111,114,45,62,115,101,116,83,101,108,101,99,116,101,100,73,100,32,40,56,41, + 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103, + 101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,73,110,116, + 101,114,112,114,111,99,101,115,115,32,67,111,109,109,115,32,68,101,109,111,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,70,97,105,108,101,100,32,116,111,32,111, + 112,101,110,32,116,104,101,32,115,111,99,107,101,116,32,111,114,32,112,105,112,101,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,125, + 13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,99,111,110,115,116, + 32,83,116,114,105,110,103,38,32,109,101,115,115,97,103,101,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,110,99,111,109,105, + 110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,67,97,114,101,116,80,111,115,105,116,105,111,110,32,40,73,78,84,95,77,65,88,41,59,13, + 10,32,32,32,32,32,32,32,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,45,62,105,110,115,101,114,116,84,101,120,116,65,116,67, + 117,114,115,111,114,32,40,109,101,115,115,97,103,101,32,43,32,84,40,34,92,110,34,41,41,59,13,10,32,32,32,32,32,32,32,32,105,110,99,111, + 109,105,110,103,77,101,115,115,97,103,101,115,45,62,115,101,116,67,97,114,101,116,80,111,115,105,116,105,111,110,32,40,73,78,84,95,77,65,88,41, + 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,61,13,10,47,42,42,32,65,32,68,105,97,108,111,103,87,105,110,100,111,119,32,99,111, - 110,116,97,105,110,105,110,103,32,97,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,32,99,111,109,112,111,110,101,110,116,32,42,47,13,10, - 99,108,97,115,115,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,32,32,58,32,112,117,98,108, - 105,99,32,68,105,97,108,111,103,87,105,110,100,111,119,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,67,111,108,111,117,114,83, - 101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,40,41,13,10,32,32,32,32,32,32,32,32,58,32,68,105,97,108,111,103,87, - 105,110,100,111,119,32,40,84,40,34,67,111,108,111,117,114,32,115,101,108,101,99,116,111,114,32,100,101,109,111,34,41,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,67,111,108,111,117,114,115,58,58,108,105,103,104,116,103,114,101,121,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,116,114,117,101,41,13,10,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,115,101,116,67,111,110,116,101,110,116,67,111,109,112,111,110,101,110,116,32,40,110,101,119,32,67,111,108,111,117,114,83,101,108, - 101,99,116,111,114,40,41,41,59,13,10,32,32,32,32,32,32,32,32,99,101,110,116,114,101,87,105,116,104,83,105,122,101,32,40,52,48,48,44,32, - 52,48,48,41,59,13,10,32,32,32,32,32,32,32,32,115,101,116,82,101,115,105,122,97,98,108,101,32,40,116,114,117,101,44,32,116,114,117,101,41, - 59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,126,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110, - 100,111,119,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,99,108,111,115,101,66,117,116, - 116,111,110,80,114,101,115,115,101,100,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,47,47,32,119,101,32,101,120,112,101,99, - 116,32,116,104,105,115,32,99,111,109,112,111,110,101,110,116,32,116,111,32,98,101,32,114,117,110,32,119,105,116,104,105,110,32,97,32,109,111,100,97, - 108,32,108,111,111,112,44,32,115,111,32,119,104,101,110,32,116,104,101,32,99,108,111,115,101,13,10,32,32,32,32,32,32,32,32,47,47,32,98,117, - 116,116,111,110,32,105,115,32,99,108,105,99,107,101,100,44,32,119,101,32,99,97,110,32,109,97,107,101,32,105,116,32,105,110,118,105,115,105,98,108, - 101,32,116,111,32,99,97,117,115,101,32,116,104,101,32,108,111,111,112,32,116,111,32,101,120,105,116,32,97,110,100,32,116,104,101,13,10,32,32,32, - 32,32,32,32,32,47,47,32,99,97,108,108,105,110,103,32,99,111,100,101,32,119,105,108,108,32,100,101,108,101,116,101,32,116,104,105,115,32,111,98, - 106,101,99,116,46,13,10,32,32,32,32,32,32,32,32,115,101,116,86,105,115,105,98,108,101,32,40,102,97,108,115,101,41,59,13,10,32,32,32,32, - 125,13,10,125,59,13,10,13,10,35,105,102,32,74,85,67,69,95,77,65,67,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,13,10,32,32,32,32,99,108,97,115,115,32,68,101,109,111,73,110,116,101,114,112,114,111, + 99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,32,58,32,112,117,98,108,105,99,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110, + 110,101,99,116,105,111,110,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109, + 115,68,101,109,111,38,32,111,119,110,101,114,59,13,10,32,32,32,32,32,32,32,32,105,110,116,32,111,117,114,78,117,109,98,101,114,59,13,10,13, + 10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111, + 110,110,101,99,116,105,111,110,32,40,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,38,32,111,119,110,101,114,95,41, + 13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,32,40, + 116,114,117,101,41,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,32,40,111,119,110,101,114,95,41,13,10,32,32, + 32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,115,116,97,116,105,99,32,105,110,116,32,116,111,116,97,108,67,111,110, + 110,101,99,116,105,111,110,115,32,61,32,48,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,117,114,78,117,109,98,101,114,32,61,32,43, + 43,116,111,116,97,108,67,111,110,110,101,99,116,105,111,110,115,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32, + 32,126,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,40,41,13,10,32,32,32,32,32,32,32,32, + 123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,110,101,99,116,105,111,110,77, + 97,100,101,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101, + 110,100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110,110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111, + 117,114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45,32,99,111,110,110,101,99,116,105,111,110,32,115,116,97,114,116,101,100,34,41,41,59, + 13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,99,111,110,110,101,99,116,105,111,110,76,111, + 115,116,40,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101,110, + 100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110,110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111,117, + 114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45,32,99,111,110,110,101,99,116,105,111,110,32,108,111,115,116,34,41,41,59,13,10,32,32, + 32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,118,111,105,100,32,109,101,115,115,97,103,101,82,101,99,101,105,118,101,100,32, + 40,99,111,110,115,116,32,77,101,109,111,114,121,66,108,111,99,107,38,32,109,101,115,115,97,103,101,41,13,10,32,32,32,32,32,32,32,32,123,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114,46,97,112,112,101,110,100,77,101,115,115,97,103,101,32,40,84,40,34,67,111,110, + 110,101,99,116,105,111,110,32,35,34,41,32,43,32,83,116,114,105,110,103,32,40,111,117,114,78,117,109,98,101,114,41,32,43,32,84,40,34,32,45, + 32,109,101,115,115,97,103,101,32,114,101,99,101,105,118,101,100,58,32,34,41,32,43,32,109,101,115,115,97,103,101,46,116,111,83,116,114,105,110,103, + 40,41,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,59,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,13,10,47,42,42,32,84,104,105,115,32,112,111,112,115, - 32,111,112,101,110,32,97,32,100,105,97,108,111,103,32,98,111,120,32,97,110,100,32,119,97,105,116,115,32,102,111,114,32,121,111,117,32,116,111,32, - 112,114,101,115,115,32,107,101,121,115,32,111,110,32,121,111,117,114,32,65,112,112,108,101,32,82,101,109,111,116,101,44,13,10,32,32,32,32,119,104, - 105,99,104,32,105,116,32,100,101,115,99,114,105,98,101,115,32,105,110,32,116,104,101,32,98,111,120,46,13,10,42,47,13,10,99,108,97,115,115,32, - 65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,32,32,58,32,112,117,98,108,105,99,32,65,108,101,114,116,87,105,110, - 100,111,119,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,32,32,32,32,32,32,112,117,98, - 108,105,99,32,65,112,112,108,101,82,101,109,111,116,101,68,101,118,105,99,101,13,10,123,13,10,112,117,98,108,105,99,58,13,10,32,32,32,32,65, - 112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,40,41,13,10,32,32,32,32,32,32,32,32,58,32,65,108,101,114,116,87, - 105,110,100,111,119,32,40,34,65,112,112,108,101,32,82,101,109,111,116,101,32,67,111,110,116,114,111,108,32,84,101,115,116,33,34,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,34,73,102,32,121,111,117,39,118,101,32,103,111,116,32,97,110,32,65, - 112,112,108,101,32,82,101,109,111,116,101,44,32,112,114,101,115,115,32,115,111,109,101,32,98,117,116,116,111,110,115,32,110,111,119,46,46,46,34,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,65,108,101,114,116,87,105,110,100,111,119,58,58,78,111, - 73,99,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,97,100,100,66,117,116,116,111,110,32,40,84,40,34,100,111,110,101, - 34,41,44,32,48,41,59,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,40,84,111,32,111,112,101,110,32,116,104,101,32,100,101,118,105,99, - 101,32,105,110,32,110,111,110,45,101,120,99,108,117,115,105,118,101,32,109,111,100,101,44,32,112,97,115,115,32,39,102,97,108,115,101,39,32,105,110, - 32,104,101,114,101,41,46,46,13,10,32,32,32,32,32,32,32,32,105,102,32,40,33,32,115,116,97,114,116,32,40,116,114,117,101,41,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,115,101,116,77,101,115,115,97,103,101,32,40,34,67,111,117,108,100,110,39,116,32,111,112,101,110,32,116,104, - 101,32,114,101,109,111,116,101,32,99,111,110,116,114,111,108,32,100,101,118,105,99,101,33,34,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32, - 32,32,126,65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32, - 32,32,32,115,116,111,112,40,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,80,114,101,115, - 115,101,100,32,40,99,111,110,115,116,32,66,117,116,116,111,110,84,121,112,101,32,98,117,116,116,111,110,73,100,44,32,99,111,110,115,116,32,98,111, - 111,108,32,105,115,68,111,119,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,83,116,114,105,110,103,32,100,101,115,99,59,13, - 10,13,10,32,32,32,32,32,32,32,32,115,119,105,116,99,104,32,40,98,117,116,116,111,110,73,100,41,13,10,32,32,32,32,32,32,32,32,123,13, - 10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,101,110,117,66,117,116,116,111,110,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, - 101,115,99,32,61,32,34,109,101,110,117,32,98,117,116,116,111,110,32,40,115,104,111,114,116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,112,108,97,121,66,117,116,116,111,110,58,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,112,108,97,121,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,112,108,117,115,66,117,116,116,111,110,58,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,112,108,117,115,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,105,110,117,115,66,117,116,116,111,110,58,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,109,105,110,117,115,32,98,117,116,116,111,110,34,59,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,114,105,103,104,116,66,117,116,116,111,110,58, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,114,105,103,104,116,32,98,117,116,116,111,110,32,40,115,104,111,114, - 116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,108, - 101,102,116,66,117,116,116,111,110,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,108,101,102,116,32,98,117,116, - 116,111,110,32,40,115,104,111,114,116,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32, - 32,32,32,99,97,115,101,32,114,105,103,104,116,66,117,116,116,111,110,95,76,111,110,103,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, - 101,115,99,32,61,32,34,114,105,103,104,116,32,98,117,116,116,111,110,32,40,108,111,110,103,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,108,101,102,116,66,117,116,116,111,110,95,76,111,110,103,58,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,108,101,102,116,32,98,117,116,116,111,110,32,40,108,111,110,103,41,34, - 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,109,101,110,117, - 66,117,116,116,111,110,95,76,111,110,103,58,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,109,101,110,117,32,98, - 117,116,116,111,110,32,40,108,111,110,103,41,34,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32, - 32,32,32,32,99,97,115,101,32,112,108,97,121,66,117,116,116,111,110,83,108,101,101,112,77,111,100,101,58,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,100,101,115,99,32,61,32,34,112,108,97,121,32,40,115,108,101,101,112,32,109,111,100,101,41,34,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,99,97,115,101,32,115,119,105,116,99,104,101,100,58,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,100,101,115,99,32,61,32,34,114,101,109,111,116,101,32,115,119,105,116,99,104,101,100,34,59,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,98,114,101,97,107,59,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,105,102,32,40, - 105,115,68,111,119,110,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,34,32,45,45,32,91,100,111,119,110,93, - 34,59,13,10,32,32,32,32,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,101,115,99,32,60,60,32,34,32, - 45,45,32,91,117,112,93,34,59,13,10,13,10,32,32,32,32,32,32,32,32,115,101,116,77,101,115,115,97,103,101,32,40,100,101,115,99,41,59,13, - 10,32,32,32,32,125,13,10,125,59,13,10,13,10,35,101,110,100,105,102,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,13,10,32,32,32,32,99,108,97, + 115,115,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,32,32,58,32, + 112,117,98,108,105,99,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,13,10,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,38,32,111,119,110,101,114, + 59,13,10,13,10,32,32,32,32,112,117,98,108,105,99,58,13,10,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101, + 115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,32,40,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109, + 111,38,32,111,119,110,101,114,95,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,58,32,111,119,110,101,114,32,40,111,119,110,101,114,95,41, + 13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,126,68,101,109,111,73, + 110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101,114,40,41,13,10,32,32,32,32,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101, + 99,116,105,111,110,42,32,99,114,101,97,116,101,67,111,110,110,101,99,116,105,111,110,79,98,106,101,99,116,40,41,13,10,32,32,32,32,32,32,32, + 32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105, + 111,110,42,32,110,101,119,67,111,110,110,101,99,116,105,111,110,32,61,32,110,101,119,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115, + 67,111,110,110,101,99,116,105,111,110,32,40,111,119,110,101,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,111,119,110,101,114, + 46,97,99,116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,46,97,100,100,32,40,110,101,119,67,111,110,110,101,99,116,105,111,110,41,59,13, + 10,32,32,32,32,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,110,101,119,67,111,110,110,101,99,116,105,111,110,59,13,10,32,32,32,32, + 32,32,32,32,125,13,10,32,32,32,32,125,59,13,10,13,10,32,32,32,32,79,119,110,101,100,65,114,114,97,121,32,60,68,101,109,111,73,110,116, + 101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,44,32,67,114,105,116,105,99,97,108,83,101,99,116,105,111,110,62,32,97,99, + 116,105,118,101,67,111,110,110,101,99,116,105,111,110,115,59,13,10,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,13,10,99,111,110,115,116,32,105,110,116,32,110,117,109,71, - 114,111,117,112,115,32,61,32,52,59,13,10,13,10,99,108,97,115,115,32,87,105,100,103,101,116,115,68,101,109,111,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,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,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,109,101,110, - 117,66,117,116,116,111,110,59,13,10,32,32,32,32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,101,110,97,98,108,101,66,117,116,116,111,110, - 59,13,10,13,10,32,32,32,32,68,101,109,111,84,97,98,98,101,100,67,111,109,112,111,110,101,110,116,42,32,116,97,98,115,59,13,10,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,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,67,111, + 109,98,111,66,111,120,42,32,109,111,100,101,83,101,108,101,99,116,111,114,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115, + 101,110,100,84,101,120,116,59,13,10,32,32,32,32,84,101,120,116,66,117,116,116,111,110,42,32,115,101,110,100,66,117,116,116,111,110,59,13,10,32, + 32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,105,110,99,111,109,105,110,103,77,101,115,115,97,103,101,115,59,13,10,13,10,32,32,32,32, + 84,101,120,116,69,100,105,116,111,114,42,32,112,105,112,101,78,97,109,101,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115, + 111,99,107,101,116,78,117,109,98,101,114,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,115,111,99,107,101,116,72,111,115,116, + 59,13,10,13,10,32,32,32,32,68,101,109,111,73,110,116,101,114,112,114,111,99,101,115,115,67,111,110,110,101,99,116,105,111,110,83,101,114,118,101, + 114,42,32,115,101,114,118,101,114,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,73, + 110,116,101,114,112,114,111,99,101,115,115,67,111,109,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,73,110,116,101,114,112,114,111,99,101,115,115,67,111,109,109,115,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::interprocesscommsdemo_cpp = (const char*) temp15; + +static const unsigned char temp16[] = {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, + 101,119,46,115,118,103,237,28,93,115,219,54,242,61,191,66,167,188,212,83,139,196,55,64,37,118,39,77,38,157,222,244,122,51,77,59,247,216,161,40, + 72,102,77,145,58,146,178,236,252,250,91,144,20,9,82,144,45,217,106,210,155,169,213,142,169,197,114,23,216,47,236,46,16,191,253,238,126,149,140,238, + 116,94,196,89,122,53,198,30,26,143,116,26,101,243,56,93,94,141,127,251,245,227,68,141,71,69,25,166,243,48,201,82,125,53,78,179,241,119,215,175, + 222,254,99,50,25,189,207,117,88,234,249,104,27,151,55,163,31,211,219,34,10,215,122,244,205,77,89,174,167,190,191,221,110,189,184,1,122,89,190,244, + 47,70,147,9,188,89,220,45,95,141,70,35,96,155,22,211,121,116,53,110,240,215,155,60,169,240,230,145,175,19,189,210,105,89,248,216,195,254,184,67, + 143,58,244,173,158,121,185,46,178,77,30,213,228,163,200,198,204,231,139,14,21,102,178,165,21,18,14,130,192,71,196,39,100,2,24,147,226,33,45,195, + 251,73,90,188,182,94,133,9,186,94,37,8,33,31,198,58,204,227,176,166,247,9,136,225,224,100,170,81,155,59,136,126,13,255,183,47,236,0,94,189, + 214,5,188,169,189,84,151,254,135,95,63,180,131,19,228,205,203,185,69,102,39,249,30,223,158,58,210,112,165,139,117,24,233,194,223,193,171,247,183,241, + 188,188,185,26,51,133,60,84,253,172,239,43,248,141,142,151,55,165,99,224,46,214,219,239,179,251,171,49,26,161,17,83,240,95,5,142,231,87,99,16, + 4,97,65,245,117,55,211,105,107,107,200,163,164,198,108,216,219,67,140,126,59,215,119,58,233,191,59,207,162,89,88,192,162,252,155,108,165,253,63,226, + 213,42,140,252,34,143,252,232,174,240,193,74,151,217,36,142,178,116,82,222,128,1,249,64,53,9,103,137,246,195,168,4,186,197,30,49,35,131,171,49, + 60,108,140,185,77,82,189,245,118,186,107,39,165,239,215,89,94,78,22,113,162,107,244,30,239,229,226,222,79,51,152,104,226,175,231,32,202,50,223,164, + 183,62,80,44,252,239,127,252,97,21,175,244,164,212,247,165,183,78,221,100,239,231,107,80,53,97,141,76,157,56,15,3,156,107,64,122,59,215,139,194, + 32,215,130,54,223,104,53,0,67,121,56,143,195,228,7,243,11,86,85,35,89,84,163,44,73,116,4,154,12,147,109,248,80,11,197,252,84,150,56,189, + 201,53,120,206,107,120,214,97,190,163,193,145,64,45,158,225,215,103,193,17,197,237,240,178,1,254,150,198,37,184,200,166,208,249,39,99,102,255,78,127, + 43,244,30,214,175,121,152,22,96,211,171,171,241,42,44,243,248,254,155,9,241,164,100,84,5,151,8,62,216,11,68,32,145,184,196,24,224,130,208,203, + 137,146,196,83,138,179,139,150,88,4,198,39,16,247,36,102,36,232,160,15,198,88,133,39,152,84,29,116,225,196,93,56,113,115,8,136,88,122,128,169, + 196,120,228,55,226,237,139,230,104,241,26,177,57,164,122,221,140,191,45,202,108,189,195,5,43,45,31,18,176,53,3,156,0,197,44,159,206,146,48,186, + 125,83,1,50,144,103,92,62,76,241,155,113,247,70,182,88,20,26,216,34,11,86,249,32,188,1,156,72,187,128,231,241,66,46,94,216,205,139,117,194, + 242,251,75,254,122,22,106,41,251,165,22,234,54,208,9,86,1,246,4,253,235,90,168,195,0,33,86,159,221,40,220,6,200,209,97,3,180,176,132,139, + 160,199,199,167,123,198,23,51,119,78,158,50,247,103,70,140,71,205,189,217,101,15,41,150,200,47,96,238,196,195,50,112,153,251,61,190,26,83,4,80, + 46,113,167,187,7,3,21,67,19,190,39,78,92,98,156,32,240,140,225,200,63,33,246,50,206,200,241,166,255,186,78,120,158,25,125,129,23,59,197,28, + 157,220,142,54,72,224,38,190,124,252,173,228,121,56,254,194,176,234,5,67,194,60,138,132,12,120,63,24,18,15,73,25,168,94,44,220,71,93,184,80, + 77,40,228,158,34,152,99,118,132,85,227,38,137,189,68,142,7,162,88,128,193,198,133,71,49,130,160,164,39,240,141,2,2,216,188,186,56,210,179,78, + 14,199,152,11,113,138,81,46,170,159,129,81,54,139,112,71,230,221,160,195,108,12,243,211,172,116,161,204,231,4,246,248,9,246,207,52,219,227,226,155, + 177,25,193,60,14,134,212,183,46,228,129,82,177,109,70,220,35,92,246,236,114,248,98,228,120,209,172,36,140,151,249,156,142,159,216,230,48,231,146,62, + 186,163,189,254,136,204,199,25,95,158,220,69,13,249,199,55,204,215,65,104,62,207,82,93,167,162,190,54,206,164,34,140,141,168,21,59,70,71,162,167, + 163,189,55,31,85,18,57,66,73,66,252,169,74,18,234,107,41,233,216,128,68,68,112,66,56,10,169,249,156,41,28,17,137,78,10,70,44,50,159,51, + 5,35,34,241,51,83,186,125,17,242,83,68,184,8,205,231,92,34,20,167,137,112,86,253,156,75,132,226,108,34,196,132,227,175,183,45,2,115,122,218, + 182,184,88,112,50,76,222,32,10,97,72,30,144,114,243,231,143,79,64,158,58,1,186,151,61,62,123,95,38,38,157,250,226,233,100,173,243,195,249,36, + 145,234,196,250,198,236,6,156,123,131,133,86,27,7,225,94,31,186,112,226,46,156,184,38,237,132,4,85,242,94,220,117,75,4,112,169,244,36,40,20, + 211,30,89,10,64,129,137,226,189,41,40,200,102,25,195,65,127,186,251,184,145,19,247,112,234,139,160,134,83,68,82,71,234,11,166,64,137,20,242,146, + 122,148,83,206,13,142,96,130,49,121,113,162,188,247,117,6,41,158,181,101,63,162,124,179,237,60,105,68,79,139,90,9,79,34,197,120,95,131,148,123, + 146,10,200,238,123,162,166,20,100,34,122,41,158,19,55,114,226,58,68,109,90,207,186,146,52,98,1,53,114,101,24,83,114,30,41,170,163,164,200,207, + 34,69,170,60,204,149,24,84,95,210,35,2,138,120,33,7,6,139,25,237,229,77,145,19,55,114,226,254,21,13,86,28,37,234,186,112,123,169,176,79, + 139,151,77,22,251,72,136,36,138,158,173,7,4,37,49,9,36,162,238,106,185,30,98,158,192,148,147,0,84,17,64,97,142,212,197,163,169,120,116,108, + 182,239,44,11,218,18,224,252,66,165,143,11,149,255,213,133,122,76,149,235,170,134,219,202,183,22,233,91,223,28,42,85,79,237,145,153,57,0,155,155, + 243,190,238,228,201,156,199,53,36,214,225,82,87,57,8,72,178,78,194,154,129,89,150,207,117,190,27,18,213,79,111,168,73,83,234,51,193,0,34,165, + 220,141,183,250,51,196,45,52,228,26,47,110,194,121,182,133,213,14,7,63,103,217,170,235,150,117,54,97,162,57,134,253,84,178,54,190,117,131,192,103, + 34,60,198,20,98,74,238,141,110,242,220,28,25,38,225,131,134,69,85,191,118,115,46,110,178,237,50,55,194,89,132,73,43,157,246,85,51,52,153,205, + 204,137,105,153,111,246,134,219,211,200,77,109,86,205,41,171,133,177,141,83,88,230,164,57,168,85,146,28,64,216,157,216,138,118,39,24,98,192,20,176, + 16,7,6,141,219,241,61,153,153,197,217,178,174,151,216,152,204,74,151,225,60,44,195,206,60,118,16,214,30,78,206,23,211,95,62,124,108,211,217,40, + 154,254,39,203,111,187,204,211,32,132,179,108,3,19,111,147,126,115,222,25,77,141,243,132,229,117,188,2,246,230,140,253,219,251,85,2,86,218,14,244, + 144,203,135,181,238,136,214,100,119,247,5,156,119,14,230,209,42,54,47,249,159,202,56,73,126,52,76,172,180,187,33,26,151,137,190,254,89,111,71,31, + 26,45,85,252,107,112,15,51,50,119,35,178,252,218,154,130,89,234,187,101,155,53,239,211,253,103,120,187,153,141,62,149,26,54,151,220,69,216,56,229, + 62,145,10,115,143,159,33,91,175,246,186,89,108,125,98,237,173,54,69,28,221,132,73,226,69,159,171,87,27,172,87,246,60,147,56,210,105,241,180,0, + 43,182,241,29,184,253,106,149,165,69,37,203,230,221,194,159,61,76,138,208,39,30,242,237,250,197,111,52,110,91,192,79,67,118,150,17,156,200,169,191, + 142,181,206,65,171,197,147,235,112,221,38,249,69,175,243,108,190,169,174,14,244,45,225,133,132,63,196,5,196,255,217,198,73,56,215,255,221,196,240,198, + 179,40,255,156,149,32,146,243,210,124,87,30,158,236,139,164,160,243,248,174,82,169,177,134,226,188,147,254,116,19,230,250,93,18,223,234,161,233,53,166, + 214,246,199,186,112,244,214,223,5,171,234,219,114,16,248,146,112,166,147,171,241,167,42,238,141,187,8,215,11,253,86,144,207,54,235,85,54,215,13,194, + 46,252,45,95,245,11,247,121,92,172,1,97,26,167,38,165,236,101,30,75,142,72,151,224,149,142,115,57,44,56,230,68,79,72,115,52,199,20,236,100, + 212,124,103,20,50,9,41,46,25,241,132,226,52,184,232,250,39,57,100,65,157,76,205,38,135,57,228,204,144,97,219,77,227,251,10,206,3,72,8,136, + 221,171,110,111,1,73,5,9,183,196,118,15,179,217,144,48,165,129,57,7,231,131,118,130,97,204,176,171,243,221,117,41,24,34,72,96,197,223,216,7, + 179,11,136,199,83,136,212,223,188,222,63,229,188,168,70,173,51,185,234,107,190,73,244,52,205,210,207,144,90,188,1,103,203,110,171,175,186,121,174,183, + 78,64,110,190,26,178,160,181,41,232,44,157,219,192,63,178,56,157,130,133,235,252,205,42,204,111,117,94,83,169,159,39,69,25,230,101,15,178,138,231, + 189,239,58,157,247,248,86,164,146,24,126,77,217,14,54,15,97,43,205,115,176,1,27,211,64,235,254,204,20,237,96,221,34,239,226,34,158,197,137,249, + 82,61,38,250,77,223,144,222,100,119,58,95,36,217,118,55,110,187,193,58,44,111,44,29,180,201,29,88,171,217,0,33,231,136,224,103,160,61,243,18, + 71,220,214,55,64,255,53,154,16,12,218,198,74,154,35,97,99,72,10,81,53,122,127,0,110,65,161,108,243,4,135,178,216,13,4,10,18,10,120,198, + 120,192,0,172,60,206,145,18,35,211,128,145,10,51,113,73,32,167,133,220,76,242,29,140,170,75,165,60,115,16,73,57,188,222,65,39,224,13,92,18, + 138,200,104,2,197,187,224,156,81,107,86,226,192,92,63,143,94,96,169,251,215,79,254,182,212,23,91,234,11,117,64,241,223,58,56,82,7,67,39,111, + 183,130,129,147,59,225,22,212,114,114,23,208,80,144,8,54,50,34,184,229,228,19,28,32,40,124,57,225,150,151,91,64,219,205,45,176,237,231,88,50, + 40,102,49,151,61,63,119,78,183,231,231,93,168,235,109,109,7,131,100,215,25,95,214,57,196,178,151,60,236,242,131,189,50,170,201,38,190,15,93,245, + 225,32,117,120,245,72,194,176,171,170,172,77,61,55,133,155,135,25,200,69,117,221,181,170,115,92,117,198,172,86,149,185,105,230,9,68,57,39,221,106, + 219,45,30,121,1,65,44,232,154,46,205,6,79,153,167,234,126,247,171,193,246,142,33,213,232,154,12,205,140,251,151,90,14,185,103,213,215,28,250,103, + 123,106,113,208,79,15,80,18,23,3,231,109,41,29,229,196,61,168,237,134,67,50,182,227,13,199,246,87,241,178,168,240,136,27,207,146,12,34,223,193, + 72,218,55,15,115,83,187,49,15,235,154,67,254,224,4,155,155,54,30,87,52,24,152,13,120,176,16,136,211,125,179,161,202,3,100,170,246,205,198,92, + 36,227,74,73,135,217,8,235,246,230,97,179,169,196,112,30,11,17,234,111,11,177,45,100,217,171,60,136,57,126,119,84,30,213,99,18,150,230,100,163, + 238,178,95,78,168,39,3,21,80,83,118,88,85,198,178,139,157,229,51,27,159,129,144,72,97,120,32,140,5,210,58,58,105,77,164,50,138,221,121,239, + 169,118,241,186,175,11,151,14,7,251,194,18,51,134,236,6,131,187,229,124,124,107,120,216,221,70,253,145,182,111,139,130,160,55,178,107,126,15,230,216, + 239,169,15,70,14,18,115,156,123,48,235,110,164,227,204,185,119,62,204,24,27,247,135,142,185,41,115,232,182,204,211,220,196,211,220,152,52,159,3,220, + 112,191,209,224,188,32,227,200,61,187,204,0,230,160,122,180,171,12,137,80,143,17,85,157,72,97,168,189,37,60,65,114,98,67,185,135,24,5,40,193, + 158,218,193,204,93,88,2,48,40,63,20,231,125,24,84,48,210,83,10,15,48,133,71,20,233,40,14,97,29,111,27,10,238,16,8,131,105,40,214,48, + 20,120,224,85,125,222,45,236,189,61,203,22,106,175,198,80,28,194,118,188,123,9,149,165,161,54,177,238,171,224,92,94,212,156,103,32,114,154,23,73, + 167,23,185,137,157,230,69,28,29,239,69,156,124,73,47,226,236,235,123,17,23,143,121,145,104,140,169,239,69,162,113,34,219,139,170,11,229,21,172,179, + 228,14,102,123,145,133,217,250,70,71,209,130,89,188,45,104,227,68,182,23,241,198,53,108,222,29,204,246,162,14,106,173,166,113,34,228,92,247,41,94, + 212,148,29,14,137,183,242,230,92,162,97,89,23,120,65,0,133,14,10,46,9,60,66,89,68,4,76,186,131,82,83,98,115,78,17,192,4,145,80,78, + 96,3,147,18,68,194,1,6,69,22,60,217,176,247,35,229,73,130,20,83,212,130,170,230,108,158,52,20,41,194,22,204,230,221,131,178,64,129,167,85, + 20,49,146,10,25,24,166,152,7,210,226,221,193,222,91,179,180,49,173,53,178,32,192,132,56,215,237,234,246,28,170,85,204,209,250,197,113,189,3,103, + 90,113,176,195,97,107,75,30,214,22,134,250,87,72,44,251,218,2,40,196,37,170,108,109,129,89,18,5,97,204,214,86,7,179,181,213,65,59,29,116, + 20,123,176,150,119,15,138,48,5,6,150,182,192,77,234,28,209,230,221,194,108,109,217,152,214,106,128,34,228,125,206,117,159,168,45,126,14,109,181,78, + 214,83,154,187,51,208,43,113,106,141,10,217,133,248,74,159,176,135,114,100,250,21,151,28,12,147,17,41,196,232,39,11,202,32,40,32,164,172,203,80, + 246,66,247,107,33,112,55,190,151,244,234,59,13,19,155,31,72,122,235,210,7,234,124,5,193,139,226,189,22,215,108,83,150,7,58,92,71,148,62,214, + 229,67,44,57,163,138,91,55,9,159,41,67,54,144,33,105,238,78,130,12,17,65,28,115,102,100,216,66,205,57,8,85,196,234,110,156,65,134,237,5, + 211,99,202,199,115,137,144,32,48,125,69,113,123,59,99,233,60,165,58,208,60,106,27,81,236,64,35,42,213,219,99,250,76,78,173,25,141,93,141,195, + 60,122,94,231,135,200,103,244,125,28,253,89,200,229,204,59,228,40,13,252,95,214,239,251,30,65,56,182,250,109,59,133,184,239,186,118,195,206,139,172, + 237,176,105,16,117,87,90,247,135,31,92,195,149,55,138,160,1,143,90,242,163,119,163,22,217,122,130,103,248,140,24,130,61,160,174,61,142,123,193,197, + 225,243,35,103,164,224,207,138,146,128,56,59,13,205,144,249,87,94,12,41,101,254,225,46,100,136,28,11,235,146,213,145,127,6,224,30,140,39,76,127, + 7,77,251,230,239,15,20,126,26,110,202,56,217,20,126,1,85,75,64,125,200,172,163,219,223,193,203,38,144,81,238,254,24,192,232,224,31,4,160,20, + 210,73,2,123,239,65,188,135,1,158,21,22,222,154,203,49,215,175,254,7,80,75,3,4,20,0,0,0,8,0,96,128,249,52,242,213,5,70,140,20, + 0,0,25,120,0,0,17,0,0,0,100,111,99,117,109,101,110,116,45,111,112,101,110,46,115,118,103,237,93,109,115,219,56,146,254,158,95,161,83,190, + 236,212,74,20,222,95,156,56,91,83,158,154,171,185,202,237,86,237,204,212,125,188,162,37,218,214,70,150,116,164,20,219,243,235,239,105,232,133,160,8, + 217,146,237,100,61,113,172,157,138,244,16,4,192,70,119,227,105,160,193,125,255,183,219,235,73,231,115,81,86,227,217,244,180,203,51,214,237,20,211,225, + 108,52,158,94,158,118,127,255,237,231,190,235,118,170,69,62,29,229,147,217,180,56,237,78,103,221,191,125,120,243,254,63,250,253,206,89,89,228,139,98, + 212,185,25,47,174,58,191,76,63,85,195,124,94,116,254,114,181,88,204,79,6,131,155,155,155,108,188,6,179,89,121,57,248,161,211,239,227,206,234,243, + 229,155,78,167,131,102,167,213,201,104,120,218,93,151,159,47,203,73,40,55,26,14,138,73,113,93,76,23,213,128,103,124,208,173,139,15,235,226,55,197, + 121,86,22,213,108,89,14,87,213,15,135,113,201,114,116,81,23,69,79,110,100,40,196,189,247,3,38,6,66,244,81,162,95,221,77,23,249,109,127,90, + 189,141,110,69,7,83,183,10,198,216,0,215,234,146,135,149,58,185,157,64,12,123,59,19,174,198,173,67,244,115,252,183,189,97,3,100,171,103,189,192, + 157,69,54,45,22,131,159,126,251,105,123,177,207,178,209,98,20,85,179,145,124,163,221,198,112,76,243,235,162,154,231,195,162,26,108,240,112,255,205,120, + 180,184,58,237,42,151,177,240,55,191,13,240,85,49,190,188,90,180,241,241,232,180,139,231,245,54,252,218,244,231,100,171,81,44,147,98,85,112,221,72, + 124,73,201,191,142,138,207,197,164,121,239,104,54,60,207,43,116,125,112,53,187,46,6,255,26,95,95,231,195,65,85,14,7,195,207,213,0,186,120,57, + 235,143,135,179,105,127,113,5,53,25,160,214,73,126,62,41,6,249,112,129,122,171,86,101,244,164,167,93,124,89,146,82,245,103,243,98,154,109,134,104, + 219,171,226,118,62,43,23,253,139,241,164,88,149,111,52,126,59,190,30,231,211,255,205,203,197,128,90,174,32,189,229,98,60,89,86,131,106,58,187,25, + 45,167,144,226,229,20,55,244,47,170,254,104,92,22,195,197,172,188,235,231,195,97,49,95,100,243,105,186,177,219,209,28,227,236,217,90,162,201,50,119, + 59,101,62,160,208,251,81,113,81,81,225,149,248,233,151,12,23,112,169,204,71,227,124,242,159,244,15,30,118,85,40,170,117,56,155,76,208,185,211,110, + 62,185,201,239,86,178,162,191,160,134,39,87,101,1,179,121,139,239,69,94,110,234,208,204,176,109,57,106,175,217,132,102,146,111,47,95,174,193,223,167, + 227,5,236,99,89,21,229,175,164,99,255,152,254,94,21,173,82,191,149,249,180,130,66,95,159,118,175,243,69,57,190,253,75,95,100,214,42,233,124,143, + 225,195,51,111,188,101,166,199,57,112,35,100,175,239,172,200,156,211,234,135,109,101,195,219,211,174,97,58,179,92,9,95,163,119,164,170,38,51,202,186, + 26,189,72,150,189,72,150,45,225,13,185,205,80,210,153,110,103,176,22,111,83,52,7,139,151,196,150,144,234,135,245,245,247,213,98,54,223,148,133,242, + 46,238,38,208,64,2,251,168,113,86,158,156,79,242,225,167,119,1,152,65,158,227,197,221,9,127,215,173,239,152,93,92,84,5,154,101,17,22,44,19, + 119,160,37,177,125,128,199,181,197,82,109,241,116,91,170,22,214,160,249,200,255,62,13,141,6,251,169,26,154,86,208,62,119,158,103,70,190,92,13,77, + 40,160,114,79,82,192,164,82,164,21,80,179,253,10,24,149,50,169,10,51,221,61,222,50,190,154,186,107,241,144,186,63,210,99,220,171,238,24,185,251, + 6,86,216,175,160,238,34,227,214,167,212,253,150,159,118,37,3,170,45,175,199,238,142,80,179,171,194,183,34,89,86,144,17,248,140,20,199,30,175,217, + 194,248,125,138,189,25,56,97,89,82,215,88,52,19,239,83,152,183,185,164,207,142,206,109,110,189,71,247,234,198,121,74,191,14,107,92,13,233,243,96, + 227,95,205,247,146,176,247,187,94,39,164,122,54,93,100,80,63,39,172,236,109,198,169,254,2,9,40,99,156,233,41,149,73,163,52,252,48,60,35,99, + 150,219,166,31,118,153,19,74,113,207,26,126,88,102,86,27,46,156,110,248,225,118,217,139,100,89,248,97,105,129,114,203,229,35,180,85,63,172,173,230, + 9,218,122,145,211,231,120,109,77,41,190,163,207,33,52,164,225,180,55,143,1,101,112,7,88,135,73,90,199,253,15,57,28,209,103,239,52,240,213,92, + 51,13,230,254,161,134,0,76,195,77,10,157,57,219,244,145,156,101,70,232,134,131,68,41,209,116,142,146,53,238,123,170,97,241,150,61,69,134,133,65, + 115,112,249,91,164,111,225,239,153,246,48,172,231,103,197,92,58,37,14,103,37,111,215,90,252,56,98,76,141,169,163,12,32,213,220,193,100,129,154,51, + 143,84,201,150,160,188,53,230,8,57,25,238,213,240,252,145,114,66,91,247,216,109,162,53,43,252,197,240,226,128,214,82,98,242,214,178,231,146,18,63, + 134,226,190,189,8,127,59,163,155,113,169,152,96,102,143,159,107,187,224,237,112,43,127,148,208,210,173,51,205,181,50,210,167,197,119,95,243,250,217,164, + 40,165,126,162,20,163,249,230,56,33,74,105,158,67,136,251,27,191,79,132,82,218,103,83,68,34,189,71,76,180,140,62,143,117,107,214,223,19,110,61, + 101,90,79,122,53,235,249,179,73,9,2,127,234,88,91,134,185,201,89,119,180,185,222,199,77,190,180,166,113,233,191,62,87,33,179,190,103,44,244,51, + 240,11,90,154,45,64,47,148,224,90,218,30,141,142,84,102,39,86,228,62,227,220,224,127,13,30,36,92,230,149,97,170,214,57,162,66,40,171,16,113, + 136,58,168,32,58,164,17,152,114,192,15,179,239,39,136,139,223,27,116,243,104,241,226,233,116,76,75,45,188,79,208,49,144,67,205,165,244,61,153,41, + 205,21,119,61,145,41,229,112,105,71,166,42,115,222,75,235,155,50,69,72,164,189,81,178,73,47,17,227,99,146,81,166,33,83,197,51,39,141,243,250, + 139,202,84,218,123,101,234,158,81,166,202,64,67,34,30,107,50,207,224,41,93,209,23,36,86,60,172,73,72,188,41,86,16,113,163,225,240,84,67,172, + 220,101,86,104,103,154,98,117,153,224,66,8,197,154,170,42,136,222,59,29,249,204,231,143,201,121,188,196,210,14,202,185,126,190,229,80,120,53,168,190, + 212,177,228,56,147,156,233,94,112,120,154,139,40,116,112,8,206,189,210,36,243,102,88,46,12,238,50,214,214,234,16,194,114,151,113,175,121,36,238,139, + 100,217,139,100,89,10,203,5,34,39,208,87,255,37,149,56,80,241,251,38,53,110,196,215,9,213,152,16,28,46,1,58,198,52,228,220,235,243,76,10, + 201,132,105,106,177,160,165,59,18,203,206,226,92,134,121,211,123,191,235,28,152,209,50,218,226,9,241,39,181,192,148,255,162,114,93,197,130,247,199,138, + 110,247,193,196,206,138,163,109,69,211,152,66,108,51,154,38,103,121,112,52,189,122,224,247,3,218,116,11,223,182,59,141,180,109,56,250,60,46,110,222, + 108,59,76,219,152,235,122,231,249,101,17,168,3,158,115,197,29,214,23,206,103,229,168,40,55,151,76,248,107,92,90,179,139,213,230,252,155,166,88,169, + 214,237,117,150,190,94,93,229,163,217,13,164,179,123,241,143,217,236,186,38,117,245,80,221,6,107,18,6,2,182,173,139,119,65,168,210,57,201,218,119, + 46,203,146,118,88,39,249,93,129,135,9,255,108,156,98,117,53,187,185,44,73,40,23,249,100,43,149,237,173,116,169,127,126,62,67,219,139,114,217,186, + 188,221,188,93,174,6,101,189,249,28,149,184,25,79,241,148,253,245,238,53,175,215,192,119,75,108,54,178,241,0,123,74,160,15,202,155,61,23,105,28, + 182,254,115,123,145,158,46,150,245,234,25,215,186,114,93,44,242,81,190,200,107,189,216,32,106,187,107,59,186,56,249,231,79,63,111,233,231,112,120,242, + 63,179,242,83,205,20,169,64,126,62,91,162,227,91,138,76,27,193,195,19,114,15,249,226,195,248,26,205,83,230,193,95,111,175,39,80,207,237,133,70, + 225,197,221,188,168,43,93,85,187,201,162,72,102,98,140,134,215,99,186,105,240,235,98,60,153,252,66,141,68,52,121,93,233,120,49,41,62,252,60,155, + 64,89,59,191,12,103,211,206,143,97,223,59,244,98,117,177,81,30,79,94,124,16,152,27,250,140,247,37,15,197,2,214,40,53,164,236,146,89,249,33, + 234,46,137,229,199,203,45,39,110,247,225,191,242,79,203,243,206,175,139,2,142,162,76,53,79,150,219,174,36,148,108,181,71,173,77,198,195,98,90,61, + 44,178,112,243,248,51,44,252,250,122,54,173,130,244,214,247,86,131,243,187,126,149,15,224,50,7,45,209,173,170,249,176,174,101,149,108,144,93,47,171, + 241,240,42,159,76,178,225,31,161,107,235,82,77,33,22,213,176,28,207,41,227,225,195,143,67,106,155,210,116,22,69,167,223,185,185,42,166,29,74,100, + 168,58,121,89,116,206,33,141,203,206,168,204,47,47,139,81,103,49,203,86,2,143,238,111,84,60,95,158,79,198,213,85,113,156,228,255,62,251,92,76, + 38,189,206,47,211,97,118,164,224,91,13,134,146,164,254,177,57,124,220,29,137,200,34,142,28,132,230,16,207,139,18,42,94,61,56,196,169,132,163,127, + 22,243,114,54,90,134,188,147,230,216,62,177,226,159,198,21,166,251,243,101,178,226,178,248,191,229,24,119,60,170,230,191,207,22,16,201,243,214,249,227, + 98,127,103,159,36,133,162,28,127,14,67,74,218,80,61,111,167,127,189,130,113,252,56,25,127,138,133,17,84,111,173,106,155,112,60,242,205,239,7,27, + 207,29,126,93,214,30,61,204,117,173,9,113,146,159,23,147,211,238,202,53,182,167,188,217,114,126,61,27,21,235,187,55,211,197,101,186,146,127,204,139, + 105,119,167,65,249,96,157,235,135,152,231,139,171,141,148,106,194,130,114,228,219,49,159,14,195,95,133,63,252,179,101,66,235,101,143,230,226,55,28,203, + 228,4,51,196,95,222,182,162,138,31,194,197,104,13,41,252,44,151,147,2,109,77,255,0,149,121,7,181,158,125,42,78,222,234,156,62,235,159,171,89, + 27,229,215,63,137,231,225,113,78,240,48,211,81,12,254,107,54,158,174,209,235,188,252,84,148,84,111,177,254,222,135,255,43,23,13,228,122,60,106,252, + 46,166,235,223,235,58,161,153,69,57,25,227,159,19,181,193,70,57,38,243,176,102,115,194,54,88,253,68,159,199,213,248,124,60,161,31,225,235,164,120, + 55,26,87,115,8,251,100,60,165,46,190,131,35,44,47,38,179,155,205,245,6,131,165,113,16,50,34,155,192,254,187,163,64,82,25,19,78,247,192,187, + 16,224,35,164,234,156,17,106,56,194,82,160,62,99,150,43,219,209,25,231,86,33,238,39,72,121,238,133,2,166,37,88,191,116,17,246,177,3,54,111, + 140,149,202,68,232,89,7,204,141,57,206,121,140,2,83,90,50,235,234,102,8,226,92,216,168,59,168,81,81,82,10,98,129,30,167,5,10,110,133,163, + 26,209,75,124,83,154,80,78,55,41,194,4,46,27,219,163,205,44,132,216,162,35,101,230,152,84,222,213,208,199,142,0,161,117,12,223,107,240,172,35, + 88,166,156,215,210,212,32,24,187,179,12,145,9,65,120,86,97,28,97,8,1,17,239,244,64,231,37,83,78,121,212,136,72,92,91,37,184,71,116,175, + 132,50,204,145,32,129,42,4,43,232,143,206,60,183,82,50,71,24,40,34,67,200,175,17,251,59,7,174,219,225,54,68,139,144,89,141,161,151,136,161, + 132,226,206,69,40,234,204,208,53,163,188,136,239,135,88,140,113,214,244,40,66,245,161,155,232,15,186,166,9,210,194,163,195,168,49,53,220,127,116,234, + 80,170,97,172,43,19,140,182,35,184,52,248,200,119,9,171,220,108,188,28,108,133,219,253,172,216,10,215,241,164,52,47,198,28,243,178,132,125,197,37, + 191,152,145,6,123,148,153,148,206,48,168,17,84,2,193,175,114,118,101,0,202,57,101,120,141,182,108,27,193,62,175,151,129,210,158,246,165,13,180,80, + 175,118,160,53,6,26,214,39,96,137,241,64,3,166,77,20,91,163,169,129,142,146,50,142,26,232,116,217,68,3,210,239,237,173,78,246,86,239,246,246, + 187,82,125,29,165,218,14,244,229,142,228,155,55,54,6,249,82,51,81,47,111,45,18,153,119,28,115,131,22,97,125,122,149,124,199,164,83,156,126,43, + 129,9,90,211,148,111,50,47,165,21,63,212,251,102,148,123,94,19,226,187,211,110,159,107,154,73,141,139,115,114,110,3,174,61,102,60,33,35,124,155, + 230,111,93,38,181,229,46,186,182,89,91,145,32,10,38,222,61,90,47,50,163,97,133,233,181,157,169,83,235,223,106,43,221,233,119,113,238,101,205,40, + 219,137,140,135,83,202,120,128,143,226,147,65,111,190,25,21,220,241,54,251,233,254,206,232,209,77,154,233,120,188,131,211,233,11,162,90,156,88,205,74, + 145,192,227,136,0,165,241,8,149,194,130,220,48,197,211,32,106,176,38,179,74,105,175,0,131,184,105,16,170,14,23,58,179,14,60,179,39,2,19,100, + 86,111,48,168,187,3,147,211,74,200,192,234,182,104,95,73,208,44,90,232,238,244,65,52,141,214,74,70,189,50,123,250,10,202,245,120,77,109,103,152, + 127,215,212,39,107,234,19,199,64,242,239,99,112,36,11,218,24,249,118,42,216,49,242,36,30,161,145,145,167,64,170,193,50,204,100,130,162,216,173,145, + 247,185,103,8,130,136,201,212,86,30,129,177,153,71,112,108,231,8,131,53,162,76,109,27,118,158,236,110,195,206,107,87,215,152,218,246,58,201,58,43, + 227,242,200,165,148,97,88,75,105,19,59,33,29,107,242,58,68,139,150,91,205,29,197,131,136,52,141,165,88,221,100,130,246,81,109,64,65,205,24,227, + 192,24,138,34,110,37,204,75,237,32,76,77,115,187,84,171,114,78,10,165,36,88,97,10,61,35,6,105,181,166,60,233,186,78,157,33,228,183,214,135, + 146,154,118,16,77,88,103,48,24,128,128,1,177,206,135,72,24,131,231,48,2,8,102,93,112,220,33,96,207,152,198,176,114,66,181,84,8,251,25,48, + 161,164,210,1,147,10,33,49,231,192,180,150,22,209,112,132,125,164,152,91,50,169,37,7,42,224,184,133,38,173,1,234,64,100,185,14,168,32,46,28, + 34,118,37,188,161,157,123,68,240,22,178,33,140,59,9,86,12,204,90,97,164,229,171,120,191,133,98,2,64,60,110,153,234,249,112,92,65,106,214,9, + 201,36,136,205,21,173,43,40,203,172,18,171,30,161,114,208,165,158,13,61,134,7,90,245,200,160,81,71,40,195,45,120,188,176,94,96,33,49,5,12, + 100,221,75,131,185,138,210,10,72,96,17,6,142,142,126,112,8,89,71,232,25,80,4,147,10,126,43,66,37,85,169,140,167,146,36,37,60,59,133,163, + 12,223,52,97,6,156,76,57,170,19,146,113,232,136,17,209,184,125,76,234,82,100,0,15,172,232,181,242,47,118,29,234,54,193,233,24,199,138,46,73, + 197,185,222,117,176,231,203,197,98,143,127,77,120,200,109,211,9,159,184,123,173,221,223,167,57,236,123,60,236,249,100,134,73,105,127,68,240,184,208,79, + 237,172,16,10,168,0,220,154,36,85,217,70,126,116,194,193,57,90,215,106,133,169,95,63,240,99,153,15,127,78,188,202,192,239,113,195,204,91,195,108, + 181,149,52,204,97,141,117,19,225,195,81,120,35,184,170,209,23,16,225,243,215,57,208,219,8,63,125,80,219,170,204,133,213,211,238,190,114,183,7,150, + 59,254,36,250,178,42,188,76,28,67,223,158,63,167,191,246,66,3,6,84,42,133,89,172,145,194,165,180,8,41,69,171,75,125,204,144,12,44,130,242, + 13,141,228,158,71,57,156,97,49,3,92,129,239,42,229,74,231,214,137,178,13,157,99,153,118,68,110,156,59,88,249,146,83,65,195,9,119,143,9,128, + 43,250,36,120,33,158,67,236,178,99,197,17,104,106,171,36,184,3,104,166,116,134,120,15,161,180,79,225,123,152,126,17,165,64,82,132,97,84,189,20, + 192,104,83,198,49,67,152,52,224,178,44,96,2,204,132,17,151,2,43,163,196,170,128,10,230,16,234,16,151,66,85,187,40,48,48,33,207,13,48,112, + 8,144,58,190,239,110,159,145,79,81,10,168,50,138,41,3,238,64,71,8,208,62,98,231,204,91,207,113,153,48,239,188,16,150,158,135,58,164,60,177, + 145,4,186,126,242,192,154,64,165,133,119,50,41,141,84,40,29,241,129,71,177,232,148,191,140,150,170,214,11,245,28,143,230,53,60,163,110,248,75,144, + 41,40,112,141,190,128,137,209,191,206,21,209,239,123,28,255,246,61,14,142,72,205,210,158,175,108,236,26,32,236,19,34,66,147,6,23,57,245,47,178, + 199,193,119,246,56,48,45,26,204,13,20,161,242,198,214,155,71,192,15,94,36,95,16,3,122,93,59,164,47,204,162,95,151,240,119,211,69,36,73,217, + 246,48,227,199,54,226,152,112,42,66,147,155,138,250,11,91,116,116,164,99,221,91,101,132,215,26,253,106,110,166,27,41,184,49,53,250,221,162,95,169, + 69,191,38,153,239,152,134,208,218,88,58,197,165,155,121,38,134,89,47,107,52,185,68,244,200,60,147,195,13,89,238,246,150,33,140,225,30,189,149,141, + 222,130,129,115,198,107,244,5,24,242,235,226,123,47,197,144,95,165,240,119,2,82,167,133,163,247,37,137,38,125,229,220,41,81,131,73,42,108,15,54, + 232,111,121,17,106,179,250,116,196,226,19,119,90,30,191,248,228,31,181,246,244,5,214,156,208,125,253,101,214,156,182,75,78,209,138,83,114,193,233,192, + 245,166,111,99,185,233,59,189,252,250,142,81,100,158,54,148,185,236,113,185,179,82,199,44,20,149,223,187,10,113,184,103,124,228,186,162,222,117,227,38, + 156,174,247,61,238,155,189,85,86,112,93,163,47,128,234,188,210,125,152,151,97,209,175,152,234,136,76,11,37,40,27,100,99,12,235,124,14,71,111,109, + 148,53,154,12,94,30,105,209,187,3,45,189,0,87,80,58,53,208,169,140,6,58,50,222,206,105,120,82,154,88,50,139,225,207,53,222,123,114,24,154, + 46,81,81,238,80,143,131,202,138,144,210,18,78,7,217,144,137,18,114,140,44,165,180,108,191,134,98,155,210,141,31,103,205,159,168,55,254,30,181,17, + 205,242,181,230,56,245,80,214,61,72,214,65,202,195,15,212,25,122,105,223,225,121,133,137,196,68,122,7,230,15,143,81,162,63,87,170,225,33,74,164, + 100,24,96,145,41,175,20,147,148,146,6,200,217,48,163,74,75,171,147,97,65,193,211,187,107,40,90,98,66,56,235,233,64,26,72,165,34,157,227,116, + 175,9,57,89,41,52,188,80,177,39,69,38,233,29,133,174,245,27,13,134,217,91,88,79,217,198,180,2,19,78,174,25,3,63,210,193,55,202,73,204, + 232,96,151,166,99,116,173,14,39,148,18,227,251,160,78,30,232,208,146,58,25,70,231,224,217,42,231,244,249,174,110,164,110,92,103,138,134,207,32,88, + 18,10,74,69,126,203,215,63,19,67,105,31,55,49,253,73,227,240,125,30,180,10,110,52,145,187,170,24,111,138,88,103,22,225,153,209,42,156,30,53, + 218,123,27,242,76,157,19,140,217,128,66,166,48,77,202,93,117,206,33,120,15,103,79,241,13,46,222,96,2,247,130,131,45,212,24,13,81,102,153,53, + 54,2,207,8,196,189,154,210,29,183,168,98,25,252,3,66,71,194,224,10,16,26,2,82,92,59,181,106,89,40,29,114,105,129,194,61,8,181,154,158, + 164,100,50,4,155,12,205,32,216,164,83,152,20,37,7,76,50,68,152,161,156,208,156,51,187,114,81,86,27,171,209,52,38,43,169,141,178,29,101,137, + 100,82,39,57,69,186,74,32,208,77,97,103,132,210,105,88,230,9,181,134,210,59,9,99,156,73,180,67,39,86,53,23,30,152,201,108,244,243,35,57, + 35,10,191,181,139,208,51,66,33,77,220,27,161,28,140,87,224,153,36,117,208,104,60,128,130,104,61,151,82,123,65,135,216,156,116,146,219,85,90,176, + 197,61,82,71,195,245,49,57,136,237,164,209,99,39,206,240,226,163,35,142,132,75,101,116,174,154,158,107,127,86,225,183,75,187,158,18,203,194,129,249, + 150,15,132,198,18,33,119,177,23,212,116,16,92,137,26,60,106,180,191,79,73,79,29,207,205,128,201,221,148,38,46,233,141,179,202,154,158,160,119,207, + 58,19,142,81,112,16,24,3,47,226,105,79,8,54,47,65,101,120,248,63,156,224,68,79,60,37,115,56,23,60,129,226,136,113,66,90,7,29,154,96, + 171,163,82,152,95,148,183,156,136,144,87,58,220,77,219,174,202,48,248,7,182,126,133,96,71,36,176,64,179,90,168,34,226,228,66,219,32,79,96,107, + 140,119,20,122,6,215,163,37,245,156,129,47,169,144,164,156,120,158,182,111,217,159,130,222,226,222,137,20,244,226,115,1,179,216,68,221,169,160,109,115, + 211,252,246,8,189,219,29,251,214,11,60,95,38,217,219,187,46,244,237,154,216,174,199,227,74,130,125,208,177,14,120,183,53,165,0,21,192,36,184,193, + 18,158,211,61,50,215,105,239,145,138,196,88,62,172,188,73,35,208,187,241,227,126,125,190,239,212,90,98,156,94,232,169,138,61,43,80,239,162,61,28, + 33,44,125,118,2,76,48,79,16,79,39,41,200,51,8,253,24,37,219,194,255,33,54,4,199,139,208,179,36,74,218,17,156,20,29,166,7,59,36,2, + 104,51,184,91,41,233,128,20,190,10,199,108,120,1,8,248,44,189,158,214,70,40,180,76,115,6,218,24,56,151,133,11,20,1,3,223,148,44,194,194, + 70,14,244,205,59,31,161,240,169,136,86,200,75,211,11,255,21,109,120,37,159,39,17,130,202,232,133,184,199,174,138,28,74,44,220,238,68,165,64,222, + 93,96,187,98,107,102,46,28,215,210,126,131,125,109,86,177,119,89,246,219,245,125,47,96,170,81,238,245,136,123,151,172,25,225,153,112,180,102,185,177, + 1,68,94,150,222,152,186,193,82,182,244,69,147,240,80,255,142,91,36,107,20,204,88,216,165,217,246,51,172,122,57,181,129,190,155,234,203,53,213,100, + 30,195,211,78,183,127,187,82,110,104,190,9,235,183,208,245,176,61,1,102,72,153,179,106,181,6,204,185,55,156,108,152,212,159,102,44,154,96,97,43, + 61,177,57,178,65,43,192,34,172,32,199,16,95,65,100,251,42,64,103,29,190,222,211,64,176,67,117,152,204,88,7,110,161,105,145,70,88,78,161,80, + 220,147,228,42,114,244,206,238,135,2,139,117,98,67,235,85,129,173,215,255,189,217,182,17,126,183,94,1,188,126,183,32,58,128,209,90,189,188,241,61, + 189,68,246,195,155,255,7,80,75,3,4,20,0,2,0,8,0,96,125,250,52,34,86,64,46,27,23,0,0,165,116,0,0,17,0,0,0,100,111,99, + 117,109,101,110,116,45,115,97,118,101,46,115,118,103,236,92,89,115,227,200,145,126,159,95,193,229,188,76,135,69,176,238,67,125,56,198,61,97,135,55, + 218,187,17,158,153,216,103,136,132,36,186,41,82,6,169,150,186,127,253,126,89,0,137,2,88,36,33,81,125,120,162,41,143,155,76,20,234,200,252,42, + 175,74,224,213,159,31,110,230,131,15,69,185,154,45,23,175,135,60,99,195,65,177,152,44,167,179,197,213,235,225,239,191,253,117,228,134,131,213,58,95, + 76,243,249,114,81,188,30,46,150,195,63,191,249,225,213,127,141,70,131,183,101,145,175,139,233,224,126,182,190,30,252,125,241,126,53,201,111,139,193,79, + 215,235,245,237,249,120,124,127,127,159,205,106,98,182,44,175,198,47,6,163,17,238,92,125,184,250,97,48,24,96,216,197,234,124,58,121,61,172,219,223, + 222,149,243,208,110,58,25,23,243,226,166,88,172,87,99,158,241,241,176,105,62,105,154,223,23,23,89,89,172,150,119,229,164,234,126,50,137,91,150,211, + 203,166,41,102,114,47,67,35,238,189,31,51,49,22,98,132,22,163,213,199,197,58,127,24,45,86,63,70,183,98,130,169,91,5,99,108,140,107,77,203, + 126,173,206,31,230,96,195,222,201,132,171,241,232,96,253,45,254,219,222,176,33,100,213,90,47,113,103,145,45,138,245,248,151,223,126,217,94,28,177,108, + 186,158,70,221,108,56,223,26,183,37,142,69,126,83,172,110,243,73,177,26,111,232,225,254,77,151,231,211,229,132,218,188,30,226,203,29,137,99,180,202, + 63,20,217,102,113,113,187,139,124,133,118,227,235,229,77,49,254,215,236,230,38,159,140,87,229,100,60,249,176,26,3,58,87,203,209,108,178,92,140,214, + 215,144,234,24,35,205,243,139,121,49,206,39,107,96,110,21,58,219,204,224,124,139,68,150,41,249,167,105,241,161,152,183,71,139,26,72,81,221,59,125, + 61,196,164,132,231,50,252,190,46,102,87,215,235,215,67,229,216,237,67,160,220,207,166,235,235,152,240,97,86,220,255,101,249,128,78,6,108,160,28,254, + 23,200,111,240,127,175,166,197,229,138,126,84,29,211,47,57,124,19,8,175,202,124,58,203,231,127,163,127,192,142,170,81,52,247,201,114,62,47,38,24, + 57,159,223,231,31,171,133,209,39,136,248,252,186,44,0,201,31,241,189,200,203,77,31,154,25,182,109,71,227,181,135,208,76,242,237,229,171,154,248,251, + 98,182,6,246,238,86,69,249,43,201,239,127,23,191,175,138,157,86,191,149,249,98,5,176,220,188,30,222,228,235,114,246,240,211,72,100,214,42,233,252, + 25,195,31,207,188,241,150,153,51,206,65,55,66,158,141,156,21,153,115,90,189,216,118,54,1,139,12,211,153,229,74,248,134,250,145,120,105,50,163,172, + 107,168,151,201,182,151,201,182,37,52,13,183,25,90,58,51,28,140,107,246,182,89,211,155,189,196,182,4,87,223,212,215,95,173,214,203,219,77,91,0, + 105,253,113,14,172,18,113,132,30,151,229,249,197,60,159,188,127,25,8,75,240,115,182,254,120,206,95,14,155,59,150,151,151,171,2,195,178,136,22,48, + 135,59,48,146,216,46,224,105,99,177,212,88,60,61,150,106,152,53,110,47,249,235,33,52,18,246,169,8,77,3,116,196,157,231,153,145,223,46,66,19, + 0,132,70,121,118,80,164,1,168,217,126,0,70,173,76,170,195,76,15,31,191,51,190,24,220,181,56,6,247,39,106,140,131,112,175,109,193,62,193,10, + 251,5,224,46,50,110,125,10,238,15,252,245,80,50,80,181,229,141,236,62,18,213,116,33,252,32,146,109,5,109,2,159,17,112,236,103,208,189,198,11, + 221,31,250,63,10,166,114,103,159,168,125,49,150,125,12,28,147,163,245,6,36,70,243,159,9,144,41,54,50,254,8,54,74,101,116,174,158,204,70,38, + 31,197,198,212,104,143,96,35,211,95,140,141,202,251,199,176,241,50,124,158,200,70,140,245,56,54,166,70,235,205,70,140,166,191,188,55,16,248,185,223, + 27,192,101,219,50,205,66,102,74,89,102,109,203,52,155,76,105,107,172,210,45,211,188,219,246,50,217,150,76,179,207,224,120,233,62,78,47,207,36,71, + 183,28,122,53,99,204,72,46,138,145,8,63,132,240,70,209,15,52,145,70,8,126,166,76,134,127,152,59,27,169,204,51,239,156,125,209,83,217,63,218, + 67,16,220,53,235,220,43,145,35,102,29,157,248,35,224,236,15,242,163,78,132,224,158,31,1,103,127,144,127,113,195,222,102,248,142,60,184,133,115,253, + 92,134,157,101,158,43,206,21,144,165,184,176,158,23,35,78,134,61,254,181,109,51,146,153,51,206,120,160,14,14,1,131,122,20,29,123,47,51,166,189, + 103,166,101,239,133,205,164,71,7,182,101,239,17,203,25,161,164,180,45,123,15,170,118,210,26,255,25,236,189,51,136,128,250,235,60,22,62,79,212,176, + 24,75,61,74,195,166,70,235,173,97,49,154,249,242,26,54,240,115,191,134,197,101,215,214,176,42,131,104,185,48,45,13,43,161,54,5,34,123,219,214, + 176,59,109,47,147,109,73,195,106,120,147,202,74,219,3,238,164,88,233,115,54,178,153,227,70,25,91,140,100,208,177,92,10,197,124,248,133,88,67,26, + 75,105,6,157,57,111,189,129,30,166,29,98,50,103,37,51,159,79,209,106,173,143,234,81,173,237,231,215,163,137,46,10,67,127,157,46,106,110,166,67, + 64,248,237,213,103,152,90,134,225,61,212,184,54,50,217,179,213,59,61,247,93,117,51,229,71,173,158,211,223,163,86,239,20,199,174,140,84,117,107,93, + 186,207,234,117,202,100,110,135,125,150,197,63,206,168,237,58,173,194,170,19,157,86,150,9,173,16,66,120,151,230,227,126,16,97,112,115,178,23,123,80, + 138,252,240,232,238,249,216,24,225,228,169,46,22,58,49,143,87,13,123,172,220,81,116,98,52,247,120,23,107,143,149,123,54,54,234,231,96,163,54,95, + 206,83,197,104,238,43,123,170,9,54,42,117,156,75,202,244,220,174,41,117,170,232,239,241,154,57,26,221,61,93,53,78,37,253,125,126,213,40,205,51, + 128,81,186,199,131,177,8,159,167,128,81,177,199,131,49,53,218,115,178,81,184,30,92,98,79,7,227,69,248,156,2,70,41,158,14,70,127,73,127,159, + 29,140,220,29,223,210,220,157,176,165,157,164,191,19,184,200,221,9,91,58,37,67,118,34,23,19,81,196,154,190,206,243,117,129,184,217,122,184,45,242, + 76,226,139,231,142,189,104,133,177,82,103,194,113,161,89,43,228,69,80,99,28,249,174,237,116,248,110,91,80,109,72,27,197,11,239,23,234,167,118,16, + 243,189,18,102,132,145,163,10,235,72,84,211,111,146,196,34,197,50,175,164,151,186,125,10,96,50,238,16,100,217,118,6,193,101,202,113,110,77,135,69, + 134,41,35,152,62,184,120,169,122,45,158,212,76,239,160,248,8,52,234,24,83,103,60,72,240,197,243,49,77,2,110,26,129,245,78,42,69,8,238,132, + 108,227,202,102,224,13,216,214,98,26,181,181,86,113,113,144,105,74,244,99,90,31,19,119,50,211,210,153,139,83,51,95,28,187,206,96,161,8,247,173, + 227,33,169,133,111,156,89,71,105,86,16,180,22,148,231,146,90,73,229,208,10,62,7,87,209,62,47,129,75,96,88,130,197,237,60,176,200,188,118,154, + 123,214,202,104,112,157,105,203,85,148,152,156,36,219,78,146,109,19,9,236,150,198,56,36,36,245,69,183,53,118,165,96,38,2,6,33,84,169,140,121, + 195,59,154,79,101,74,74,46,13,235,34,84,90,39,181,61,136,80,211,115,241,125,34,130,111,22,161,245,136,44,241,197,104,206,100,0,168,115,26,252, + 14,153,90,159,41,173,141,151,109,144,202,76,107,216,42,213,6,169,13,18,209,59,7,27,2,161,184,234,128,116,167,237,36,217,54,5,82,219,83,78, + 230,75,130,84,24,108,107,11,67,211,54,207,18,230,217,65,1,180,64,202,233,88,198,185,216,78,241,84,219,100,114,164,167,26,181,234,171,217,158,147, + 14,42,180,62,100,123,113,89,118,143,7,148,132,25,239,148,3,80,61,129,178,182,109,211,4,207,172,178,62,226,76,56,30,0,213,193,59,240,207,148, + 131,61,97,241,225,216,251,224,169,184,109,171,53,5,211,205,141,242,109,116,105,58,82,81,81,4,65,139,119,153,243,90,10,215,174,133,224,6,44,145, + 170,119,157,221,103,93,188,208,7,23,47,119,189,142,182,212,185,139,41,180,232,246,65,16,228,207,225,144,62,114,177,175,198,84,5,25,190,109,203,48, + 169,50,116,74,101,148,63,180,151,125,63,91,76,151,247,35,232,55,190,149,100,247,34,212,92,163,224,186,23,55,213,155,141,164,187,45,234,106,78,239, + 125,183,193,182,80,245,174,90,77,93,237,25,181,184,42,103,211,209,197,5,149,126,174,203,187,141,254,90,93,47,239,233,202,235,225,101,62,223,106,181, + 70,148,119,101,73,189,206,243,143,5,84,127,248,71,236,52,250,24,54,146,243,92,109,115,120,205,197,135,224,110,67,229,41,175,187,23,63,45,151,55, + 77,62,96,75,190,205,175,138,213,117,142,21,227,222,212,197,58,36,11,193,100,125,253,98,89,78,139,50,186,32,160,5,53,243,174,117,61,132,119,64, + 159,9,159,250,18,245,184,185,80,101,194,134,77,21,44,213,247,118,167,64,76,139,231,24,179,238,114,54,159,163,159,170,78,100,195,228,117,185,124,143, + 8,179,46,194,217,96,235,166,88,231,211,124,157,55,131,109,40,106,91,118,59,189,60,255,231,47,127,221,198,186,147,201,249,255,45,203,247,77,236,74, + 13,242,139,229,29,96,179,141,199,169,146,119,114,78,170,60,95,191,153,221,96,162,84,150,253,167,135,155,57,224,188,189,208,106,188,254,120,91,52,157, + 86,221,110,74,204,147,101,234,211,201,205,140,110,26,255,186,198,130,255,78,131,68,49,121,221,233,108,61,47,222,252,154,127,40,194,184,213,207,86,139, + 9,149,209,47,203,55,209,208,180,196,159,175,182,177,244,110,127,255,157,191,191,187,24,252,186,46,160,33,202,84,199,180,107,119,59,9,45,119,198,163, + 110,87,119,23,255,130,186,106,117,64,235,255,75,126,213,153,3,81,231,179,55,215,211,233,171,113,253,61,221,32,47,167,131,105,57,163,133,31,106,183, + 202,143,181,152,45,143,244,128,213,36,187,168,104,173,37,4,14,236,44,150,248,61,159,77,138,197,234,56,0,2,251,176,170,201,242,230,102,185,88,5, + 44,212,247,174,198,23,31,71,171,124,44,50,54,222,1,194,108,10,81,204,46,103,69,217,189,82,13,240,166,238,191,170,159,207,110,238,86,179,201,117, + 62,159,103,147,79,213,164,171,86,63,68,210,165,93,16,239,138,119,221,37,68,27,227,145,179,111,243,230,182,40,129,244,213,81,222,164,30,202,248,103, + 113,91,46,167,119,161,216,191,205,148,19,59,254,101,6,149,50,187,184,75,118,92,22,255,190,155,225,142,39,245,252,63,203,53,88,242,188,125,254,188, + 222,63,217,147,184,80,96,139,5,145,18,26,86,207,59,233,95,177,137,139,159,231,179,247,49,51,2,244,106,168,109,50,128,145,138,126,53,222,40,240, + 240,235,170,99,54,230,249,69,1,219,112,59,123,136,236,75,218,164,94,149,203,187,219,155,229,180,168,27,108,236,193,213,15,237,156,229,116,182,186,69, + 131,243,217,130,28,166,150,7,117,165,153,104,188,192,117,162,4,151,106,112,152,166,50,176,186,10,87,120,193,66,141,152,210,153,34,143,241,76,193,63, + 214,66,184,23,77,178,183,132,250,104,56,10,83,59,226,26,225,163,55,46,174,168,126,8,116,237,225,148,137,248,204,125,251,132,138,117,85,200,20,93, + 171,189,27,46,165,167,154,119,221,57,36,165,129,21,183,114,55,115,219,100,104,21,19,204,112,167,95,198,69,216,100,146,207,97,187,126,250,113,183,162, + 249,69,184,26,157,106,132,159,229,221,188,56,95,44,23,159,224,81,188,172,172,55,253,44,234,239,149,31,118,206,55,63,169,91,136,237,28,66,91,76, + 99,226,191,150,179,197,57,240,93,148,47,111,242,242,125,81,86,189,84,223,71,171,117,94,174,91,148,155,217,180,245,187,88,76,91,227,134,174,230,51, + 252,115,174,54,180,105,14,55,164,44,1,130,184,37,81,171,156,247,57,219,208,154,69,126,152,173,102,23,179,57,253,8,95,231,197,203,54,146,94,46, + 63,20,229,229,124,121,191,185,30,111,130,219,124,125,29,201,96,235,23,3,174,228,18,192,251,156,224,211,145,30,221,164,89,235,112,18,212,127,12,70, + 130,67,218,220,89,170,18,35,32,57,38,221,224,237,30,122,68,149,194,102,70,51,197,211,68,244,96,41,190,81,218,43,144,93,166,53,115,102,128,40, + 150,210,115,202,156,9,1,184,32,226,214,27,154,116,103,206,101,74,43,33,53,110,111,168,35,37,51,109,133,100,98,48,66,200,105,180,86,50,154,149, + 217,51,215,79,131,19,144,186,251,168,201,119,164,158,140,212,19,101,32,249,119,25,244,148,65,119,147,111,77,65,103,147,39,233,17,53,218,228,41,34, + 245,96,153,200,184,48,58,218,228,35,238,153,66,19,161,163,93,30,17,227,109,30,145,227,125,206,17,60,102,130,107,219,218,231,201,233,182,246,121,163, + 234,90,166,109,175,146,108,78,18,107,79,189,133,217,61,183,173,38,155,79,203,226,211,157,138,251,38,83,30,120,207,233,96,66,27,127,198,101,198,160, + 162,4,49,158,99,242,134,181,136,60,20,78,41,197,137,38,173,117,44,208,24,3,77,16,205,75,40,67,94,221,28,168,60,162,130,115,18,131,112,136, + 129,103,76,42,15,198,164,104,111,247,180,12,83,172,104,150,25,229,109,76,19,84,91,201,93,117,247,46,181,161,41,56,53,198,112,109,146,180,248,110, + 18,181,194,194,61,104,94,73,101,237,89,56,83,224,92,187,129,2,137,18,209,122,75,51,131,119,3,186,133,150,29,17,223,14,240,29,158,146,240,50, + 162,2,57,204,59,238,105,16,105,133,183,49,73,100,66,89,197,66,135,27,34,150,162,61,61,15,69,29,238,18,9,137,64,59,220,49,112,199,9,203, + 184,14,205,194,100,36,137,55,48,241,221,64,186,141,168,85,144,170,36,105,129,200,25,231,216,32,156,224,13,128,235,129,196,6,194,234,93,160,49,15, + 79,79,18,141,119,32,241,46,5,158,8,238,181,66,13,26,51,168,147,189,218,177,248,80,0,194,27,109,119,254,35,32,128,191,182,130,20,253,20,100, + 139,218,95,197,109,103,213,108,185,30,59,109,239,46,139,142,33,194,46,3,178,172,212,53,46,185,224,142,11,146,48,0,14,89,194,91,128,152,148,240, + 16,40,81,121,120,92,205,5,121,42,248,220,21,85,103,156,195,206,7,33,51,47,189,142,137,21,110,188,176,21,68,106,34,225,11,59,200,16,12,97, + 159,132,21,53,12,5,161,24,226,230,78,17,232,182,52,154,146,167,19,72,174,34,42,109,12,76,210,27,99,35,106,179,164,176,89,48,79,27,211,194, + 182,130,115,69,184,75,44,126,15,76,18,110,56,29,169,191,232,13,157,132,97,205,96,198,161,163,188,185,125,232,66,8,81,231,122,143,137,61,1,23, + 181,254,93,237,224,66,66,110,93,92,80,49,170,131,6,13,218,206,43,166,192,110,168,46,168,28,239,2,195,32,184,160,134,160,143,148,113,128,10,157, + 106,8,97,56,100,165,93,221,108,75,123,155,164,146,132,136,104,143,208,130,194,178,0,37,105,14,80,49,51,205,9,80,74,50,38,195,116,148,192,151, + 74,99,33,18,51,174,210,48,152,184,172,53,140,199,122,68,80,49,214,217,176,28,82,49,92,105,237,130,138,1,138,188,171,84,12,70,173,52,12,131, + 102,9,26,70,27,33,42,173,67,55,243,90,197,80,151,50,162,86,6,10,106,178,69,37,11,133,184,176,210,70,210,81,130,55,216,34,76,211,86,166, + 136,214,91,27,168,14,49,37,135,20,237,16,108,119,207,203,79,130,237,51,161,53,142,199,171,71,26,4,21,16,69,39,101,84,217,226,180,245,145,103, + 176,9,195,53,196,21,29,155,108,34,112,58,115,111,159,199,212,193,183,234,114,167,89,122,187,34,119,255,102,103,254,20,174,9,194,172,199,231,81,214, + 226,143,18,210,244,82,77,41,159,80,181,181,82,141,7,101,41,193,227,12,55,100,3,18,196,134,36,233,43,227,48,74,41,218,219,1,226,95,236,180, + 240,36,33,233,99,175,4,246,171,193,126,87,10,138,106,219,161,168,235,220,68,60,112,130,120,112,46,91,210,238,102,109,98,59,7,141,4,215,69,30, + 64,162,18,223,194,254,237,235,133,236,138,85,68,7,198,65,172,164,219,61,56,3,133,70,207,180,64,121,187,74,227,59,237,141,163,52,8,156,70,105, + 140,32,26,20,40,215,158,172,0,156,62,45,130,191,64,158,169,10,22,136,109,253,209,4,85,103,82,107,9,131,187,165,217,45,205,182,239,70,231,6, + 191,92,68,69,135,206,106,15,245,140,249,88,43,148,231,193,131,160,7,4,137,36,224,77,59,17,156,18,105,36,195,216,116,51,183,210,114,69,29,122, + 203,188,9,52,120,176,180,196,214,208,53,237,109,123,146,129,106,219,139,169,91,166,104,129,105,136,37,25,249,220,160,42,109,184,13,126,184,48,78,243, + 96,38,53,220,31,21,152,43,12,96,15,142,195,163,115,149,43,151,144,195,30,195,178,41,189,255,182,112,216,64,140,119,32,6,211,234,169,230,244,140, + 215,85,166,149,185,245,96,76,69,84,14,65,115,176,213,150,46,19,201,32,78,134,9,142,73,232,161,186,177,166,24,112,81,26,166,201,27,64,200,132, + 0,155,108,16,61,134,7,19,79,62,37,218,32,104,55,245,125,2,200,208,16,5,17,225,202,154,144,196,203,232,169,31,110,137,134,189,47,149,32,26, + 77,202,86,83,166,27,131,107,141,0,144,136,92,195,129,48,68,67,204,108,88,120,32,15,177,61,41,150,221,85,126,26,252,35,184,52,162,181,114,73, + 79,162,26,56,191,213,189,204,25,120,57,6,139,18,222,185,106,12,105,16,254,73,172,24,155,164,53,23,170,76,229,22,142,85,152,48,150,44,5,209, + 224,229,91,89,45,12,158,142,39,82,88,123,61,156,64,252,6,92,17,119,188,148,74,17,173,97,33,54,178,105,40,27,54,71,132,90,20,180,18,75, + 94,89,36,177,238,234,194,138,125,117,167,144,153,229,117,103,30,236,130,59,230,207,132,165,218,81,104,226,1,57,177,92,58,103,9,239,213,250,132,170, + 186,105,40,111,201,30,48,3,227,109,182,68,14,187,65,24,99,140,135,238,160,22,176,167,92,141,10,26,149,238,195,111,229,16,100,59,162,192,0,112, + 112,202,101,134,60,151,51,140,195,169,212,187,69,145,196,235,112,99,32,49,121,38,240,21,27,18,187,51,60,221,137,224,51,104,67,90,19,28,203,102, + 178,21,137,150,41,50,207,45,229,137,55,52,44,28,58,75,121,191,237,204,213,180,214,152,17,137,75,56,202,38,48,17,174,189,242,97,250,240,96,17, + 51,237,48,246,144,41,3,94,201,148,217,222,46,150,61,201,176,125,247,172,214,169,82,56,135,152,205,97,23,211,249,24,108,11,195,222,141,138,119,131, + 114,196,46,181,48,175,216,181,2,142,53,252,33,173,6,63,15,72,163,49,42,108,196,55,70,207,8,155,1,27,64,67,14,96,162,28,54,185,4,246, + 123,53,79,117,255,105,184,227,59,148,31,195,99,14,225,214,196,85,42,7,222,12,177,123,57,148,103,110,122,79,92,14,193,4,34,68,163,59,101,242, + 149,185,16,143,11,16,146,214,143,133,215,94,8,203,204,119,212,30,73,175,111,229,66,190,226,235,97,94,78,142,248,149,77,187,239,98,250,114,98,138, + 246,135,233,187,167,250,238,200,35,251,57,169,12,190,190,178,74,106,88,120,218,30,110,137,62,163,147,23,41,125,92,108,220,66,243,83,211,206,73,99, + 105,216,139,157,124,98,248,8,245,133,18,210,221,227,26,163,132,230,85,186,94,49,43,100,229,184,34,16,114,66,70,84,74,145,41,143,248,137,104,78, + 48,230,130,219,173,224,215,169,112,4,32,181,220,228,210,2,209,53,68,112,154,50,122,42,196,45,30,174,11,57,159,9,218,219,61,45,17,212,72,200, + 151,18,103,218,131,83,54,166,9,184,93,78,235,224,13,37,168,13,13,129,188,87,206,104,158,164,197,119,83,166,155,1,18,148,19,229,8,35,185,84, + 33,43,109,169,67,88,99,101,157,226,17,41,156,214,96,214,112,240,27,98,136,234,208,157,163,52,249,134,72,129,158,129,39,28,72,130,146,216,50,166, + 241,12,222,56,171,50,231,91,42,133,127,138,222,227,81,7,138,93,42,104,134,158,252,17,245,113,22,98,219,112,80,100,169,194,159,104,28,238,32,243, + 148,79,181,244,184,5,156,201,32,26,44,66,170,202,97,183,204,122,27,164,29,174,7,151,93,82,170,63,72,91,35,76,113,138,98,3,112,138,89,30, + 161,226,93,18,65,145,123,217,40,35,45,134,253,15,26,159,176,19,41,246,61,112,6,180,125,232,60,177,247,148,219,141,106,87,255,190,203,203,162,95, + 92,11,196,11,196,145,46,170,73,170,50,36,12,209,20,133,84,154,222,166,65,66,37,2,164,12,48,240,78,253,125,197,36,39,142,133,200,174,147,92, + 147,174,26,195,112,120,250,117,210,60,140,97,36,157,185,13,255,147,152,247,199,144,122,136,161,91,18,49,73,137,68,50,53,71,165,238,58,99,168,238, + 24,234,187,212,191,174,212,69,87,34,226,136,212,61,59,38,117,47,58,99,176,238,24,236,143,37,245,104,233,93,53,231,235,165,195,49,49,100,113,3, + 129,150,30,29,29,237,228,50,152,167,87,16,59,245,242,9,69,3,219,151,189,124,6,62,240,131,160,239,63,255,35,162,252,188,75,104,203,199,214,242, + 49,210,41,81,249,26,149,124,92,235,225,184,72,194,71,149,158,239,42,61,221,29,67,39,199,248,207,98,227,31,14,9,178,43,37,121,24,9,146,29, + 83,132,146,117,21,33,239,142,193,255,168,72,216,50,65,91,177,115,172,106,3,23,36,37,208,223,213,191,233,184,50,36,135,223,209,73,103,56,6,136, + 72,14,177,110,221,170,185,101,211,197,161,172,176,146,62,124,94,126,195,231,72,253,243,78,140,222,45,65,72,232,155,229,166,135,129,79,201,114,211,155, + 22,36,194,76,239,122,66,228,155,75,73,109,76,183,245,207,145,155,18,90,233,116,110,74,236,73,74,113,223,46,30,105,167,164,20,1,57,157,143,50, + 225,173,53,59,222,4,29,131,212,125,82,102,41,116,48,168,218,110,146,74,156,85,71,129,135,91,117,250,250,116,224,33,24,170,251,177,14,161,242,238, + 43,17,112,201,48,171,168,0,24,222,28,216,236,206,40,165,128,246,219,188,84,93,180,187,243,160,207,206,211,59,157,199,125,118,30,120,173,159,12,154, + 46,239,23,195,195,231,17,219,121,115,201,184,167,89,114,204,223,250,240,186,6,155,121,238,180,82,248,97,195,219,71,180,55,140,211,107,118,61,212,44, + 24,167,37,20,180,142,223,170,191,137,138,149,227,206,200,193,246,133,168,196,219,205,123,80,161,163,164,55,206,203,45,135,233,12,80,72,231,130,166,234, + 115,67,106,132,61,71,23,219,123,247,0,107,231,237,172,45,80,238,190,209,181,141,229,157,215,192,110,240,239,76,244,6,144,29,229,68,239,43,182,70, + 237,87,78,187,175,170,61,169,182,228,17,154,248,185,53,18,103,223,250,97,198,211,42,207,232,5,10,93,153,100,108,255,19,28,201,46,232,17,144,174, + 25,9,31,39,190,162,200,62,215,185,198,197,124,57,121,191,95,96,155,194,103,38,149,102,225,92,192,73,77,103,1,84,224,202,45,34,70,11,53,164, + 51,233,52,213,50,12,4,29,228,115,74,118,142,232,240,136,115,202,181,210,67,27,78,40,30,74,17,172,115,216,250,85,28,65,207,31,202,22,17,155, + 87,99,23,106,65,39,240,214,42,99,67,253,40,189,225,91,43,17,119,240,54,73,21,100,61,140,211,254,8,45,84,164,105,39,61,85,179,101,84,191, + 45,168,102,158,146,232,66,82,186,29,225,62,195,162,77,114,241,137,84,43,143,223,199,113,160,198,235,209,69,97,187,86,156,71,190,118,237,147,26,3, + 141,200,228,25,148,54,83,156,85,21,178,84,71,105,254,191,188,43,200,109,24,134,97,247,189,162,15,8,2,203,150,37,11,24,118,217,181,255,127,207, + 72,37,1,50,204,205,10,236,182,94,5,180,9,194,152,162,100,42,230,108,91,225,198,2,210,154,17,137,180,161,216,82,87,23,71,30,1,58,190,58, + 0,219,204,49,221,163,197,222,218,42,62,194,237,20,253,156,70,19,178,38,61,237,29,233,133,137,105,236,206,76,206,150,236,248,246,151,147,32,160,25, + 222,232,43,190,10,1,66,100,70,213,112,238,38,161,20,192,107,215,119,163,18,103,133,80,166,2,183,42,125,250,124,46,101,183,75,71,54,157,178,206, + 117,59,227,119,126,97,138,121,192,47,77,255,99,74,120,64,48,207,21,224,26,218,4,218,231,201,156,204,3,58,254,50,191,119,32,225,175,152,155,143, + 22,183,131,115,123,154,205,32,178,76,246,174,42,253,110,30,116,169,121,119,144,37,151,159,231,232,19,228,179,248,10,122,47,53,23,254,128,180,171,177, + 96,113,42,207,24,208,27,61,114,160,213,161,75,14,234,133,228,220,140,180,156,118,137,92,248,101,148,226,126,84,207,170,27,29,136,241,115,123,27,87, + 235,104,149,99,46,40,154,77,233,101,131,134,4,123,21,252,94,129,26,46,106,183,78,87,114,53,203,61,53,171,188,229,116,136,13,218,13,41,146,101, + 173,134,171,139,241,222,161,63,91,158,84,49,138,65,250,13,146,99,29,59,199,8,213,96,221,120,240,199,3,153,237,180,197,233,172,146,75,139,239,169, + 172,120,231,55,91,62,222,190,0,80,75,3,4,20,0,2,0,8,0,118,128,249,52,254,120,218,95,213,23,0,0,110,124,0,0,20,0,0,0,100, + 111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,236,93,91,115,26,73,150,126,239,95,193,210,47,237,24,81,228,253,34,91,158, + 232,117,199,108,204,134,103,55,98,186,59,246,185,4,37,137,54,2,13,32,75,246,175,223,239,100,21,69,86,145,64,33,100,217,211,97,20,29,134,83, + 121,61,231,203,115,203,204,234,55,127,125,188,157,246,62,22,139,229,100,62,187,232,243,140,245,123,197,108,52,31,79,102,215,23,253,223,127,251,219,192, + 245,123,203,85,62,27,231,211,249,172,184,232,207,230,253,191,190,253,225,205,127,12,6,189,119,139,34,95,21,227,222,195,100,117,211,251,251,236,195,114, + 148,223,21,189,159,110,86,171,187,243,225,240,225,225,33,155,84,196,108,190,184,30,190,234,13,6,168,185,252,120,253,67,175,215,67,183,179,229,249,120, + 116,209,175,202,223,221,47,166,161,220,120,52,44,166,197,109,49,91,45,135,60,227,195,254,166,248,104,83,252,161,184,204,22,197,114,126,191,24,149,205, + 143,70,113,201,197,248,106,83,20,35,121,144,161,16,247,222,15,153,24,10,49,64,137,193,242,211,108,149,63,14,102,203,31,163,170,24,96,170,170,96, + 140,13,241,108,83,178,91,169,243,199,41,216,176,115,48,225,105,220,59,88,127,135,255,234,10,107,66,86,206,245,10,53,139,108,86,172,134,191,252,246, + 75,253,112,192,178,241,106,28,53,179,230,124,163,223,134,56,102,249,109,177,188,203,71,197,114,184,166,135,250,235,38,207,199,243,17,149,185,232,227,203, + 61,137,99,176,204,63,22,131,124,153,173,231,23,23,189,204,151,40,58,188,153,223,22,195,63,38,183,183,249,104,184,92,140,134,163,143,203,33,208,115, + 61,31,76,70,243,217,96,117,3,193,14,209,217,52,191,156,22,195,124,180,2,236,150,161,177,245,32,206,107,48,178,76,201,191,140,139,143,197,180,217, + 91,84,64,138,178,238,248,162,143,65,9,207,101,248,125,83,76,174,111,86,23,125,229,238,30,3,225,97,50,94,221,84,191,223,130,240,102,92,92,45, + 233,65,89,151,126,201,240,0,143,22,249,120,146,79,255,139,254,193,164,203,66,209,240,70,243,233,180,24,161,241,124,250,144,127,42,199,78,159,32,200, + 243,155,69,1,224,253,136,239,69,190,88,183,161,153,97,117,57,234,175,217,133,102,146,215,143,175,43,226,239,179,201,10,8,187,95,22,139,95,73,74, + 255,59,251,125,89,108,149,250,109,145,207,150,128,196,237,69,255,54,95,45,38,143,63,13,68,102,173,146,206,159,49,252,241,204,27,111,153,57,227,28, + 116,35,228,217,192,89,145,57,167,213,171,186,177,209,227,69,223,48,157,89,174,132,223,80,63,17,191,76,102,148,117,27,234,85,178,236,85,178,236,2, + 250,132,219,12,37,157,233,247,134,21,123,155,172,233,204,94,98,91,130,171,111,171,231,111,150,171,249,221,186,44,176,178,250,52,5,28,137,56,64,139, + 243,197,249,229,52,31,125,120,29,8,115,240,115,178,250,116,206,95,247,55,53,230,87,87,203,2,221,178,136,22,96,133,26,232,73,212,19,120,90,95, + 44,213,23,79,247,165,54,204,26,54,167,252,245,16,26,9,251,84,132,166,1,58,224,206,243,204,200,111,23,161,9,0,42,215,127,118,80,164,1,168, + 217,110,0,70,165,76,170,193,76,247,143,95,25,47,6,119,45,14,193,253,137,26,99,47,220,33,185,125,130,21,246,5,224,46,50,110,125,10,238,143, + 252,162,47,25,168,218,242,141,236,62,17,213,180,33,252,40,146,101,5,45,2,159,17,112,236,241,200,54,222,232,238,200,254,113,28,62,79,84,174,232, + 203,30,131,182,31,175,198,244,215,161,55,158,238,205,127,33,188,165,216,40,142,97,163,96,42,119,246,201,108,20,199,177,49,213,27,235,206,70,241,146, + 108,100,252,8,54,74,101,116,174,158,204,70,38,143,98,99,170,183,35,216,200,244,139,177,81,121,127,12,27,175,194,231,137,108,68,95,199,177,49,213, + 91,103,54,162,55,253,242,62,83,224,231,110,159,9,143,109,195,129,17,50,83,202,50,107,27,14,140,201,148,182,198,42,221,112,96,182,203,94,37,203, + 146,3,227,51,184,167,186,75,104,192,51,201,209,44,135,245,201,24,51,146,139,98,32,194,15,33,188,81,244,3,69,164,17,130,159,41,147,225,31,230, + 206,6,42,243,204,59,103,95,117,52,137,71,91,27,193,221,102,158,59,37,114,192,249,65,35,254,0,56,187,131,252,160,171,37,184,231,7,192,217,29, + 228,47,238,254,52,25,190,37,15,110,17,130,60,151,251,195,50,207,21,231,10,200,82,92,88,207,139,1,39,247,39,254,85,151,25,200,204,25,103,60, + 80,7,183,137,65,61,138,150,87,36,51,166,189,103,166,225,21,9,155,73,143,6,108,195,43,66,196,107,132,146,210,54,188,34,80,181,147,54,246,2, + 158,77,195,58,131,56,177,187,206,99,225,243,68,13,139,190,212,81,26,54,213,91,103,13,139,222,204,203,107,216,192,207,221,26,22,143,93,83,195,170, + 12,162,229,194,52,52,172,132,218,20,156,71,46,253,85,178,236,85,178,44,105,88,13,159,91,89,105,59,192,157,20,43,125,206,6,54,115,220,40,99, + 139,129,12,58,150,75,161,152,15,191,16,145,73,99,41,25,163,51,231,173,55,208,195,180,66,76,230,172,100,230,203,41,90,173,245,65,61,170,181,253, + 242,122,52,209,68,97,232,175,213,68,197,205,116,160,140,232,166,252,244,83,211,48,188,131,26,215,70,38,91,182,122,171,229,174,179,222,12,249,168,217, + 115,250,59,106,246,78,113,172,202,72,85,55,230,165,187,204,94,167,76,102,221,237,179,76,254,56,163,182,237,180,10,171,78,116,90,89,38,180,66,8, + 225,93,154,143,187,65,132,206,205,201,94,236,94,41,242,253,189,187,231,99,99,132,147,167,186,88,104,196,28,175,26,118,88,185,131,232,68,111,238,120, + 23,107,135,149,123,54,54,234,231,96,163,54,47,231,169,162,55,247,149,61,213,4,27,149,58,204,37,101,58,46,215,148,58,85,244,119,188,102,142,122, + 119,79,87,141,99,73,127,95,94,53,74,243,12,96,148,238,120,48,22,225,243,20,48,42,118,60,24,83,189,61,39,27,133,235,192,37,246,116,48,94, + 134,207,41,96,148,226,233,96,244,87,244,247,197,193,200,221,225,37,205,221,9,75,218,73,250,59,129,139,220,157,176,164,83,50,100,39,114,49,17,69, + 172,232,235,52,95,21,136,155,173,135,219,34,207,36,190,120,238,216,171,70,24,43,117,38,28,23,154,53,66,94,4,53,198,145,239,218,220,52,216,46, + 11,170,13,105,163,120,226,221,66,253,212,10,98,190,83,194,140,48,114,80,97,29,136,106,186,13,146,88,164,88,230,149,244,82,55,247,74,76,198,29, + 130,44,219,204,32,184,76,57,206,173,105,177,200,48,101,4,211,123,39,47,85,167,201,147,154,233,28,20,31,128,70,21,99,234,140,7,9,190,122,62, + 166,73,192,77,35,176,222,74,165,8,193,157,144,77,92,217,12,188,1,219,26,76,163,178,214,42,46,246,50,77,137,110,76,235,98,226,78,102,90,58, + 115,113,106,230,139,99,213,25,76,20,225,190,117,60,36,181,240,141,51,235,40,205,10,130,214,130,242,92,82,43,169,28,74,193,231,224,42,90,231,11, + 224,18,24,150,96,113,51,15,44,50,175,157,230,158,53,50,26,92,103,218,114,21,37,38,71,201,178,163,100,217,68,2,187,161,49,246,9,73,189,232, + 178,198,170,20,204,68,192,32,132,42,149,49,111,120,75,243,169,76,73,201,165,97,109,132,74,235,164,182,123,17,106,58,78,190,75,68,240,205,34,180, + 234,145,37,190,24,205,153,12,0,117,78,131,223,33,83,235,51,165,181,241,178,9,82,153,105,13,91,165,154,32,181,65,34,122,107,99,67,32,20,87, + 45,144,110,149,29,37,203,166,64,106,59,202,201,188,36,72,133,193,178,182,48,52,77,243,44,97,158,29,20,64,3,164,156,182,101,156,139,237,20,79, + 149,77,38,71,58,170,81,171,190,154,237,57,105,163,66,235,125,182,23,143,101,123,123,64,73,152,241,214,161,9,58,117,161,172,109,218,52,193,51,171, + 172,143,56,19,182,7,64,117,240,14,252,51,229,96,79,152,124,216,246,222,187,43,110,155,106,77,193,116,115,163,124,19,93,154,182,84,84,20,65,208, + 228,93,230,188,150,194,53,79,140,112,3,150,72,213,249,52,226,23,157,188,208,123,39,47,183,189,142,166,212,185,139,41,52,233,230,70,16,228,207,225, + 144,126,27,147,53,251,39,107,155,147,133,183,202,12,87,198,180,97,142,217,72,213,60,27,148,40,91,122,193,74,90,229,197,81,147,127,51,164,131,178, + 225,91,125,24,151,142,8,143,63,78,138,135,31,154,108,120,152,204,198,243,135,1,148,59,175,117,88,251,33,116,188,170,119,120,218,15,215,103,120,55, + 48,111,151,168,14,245,122,239,219,5,234,19,203,247,229,108,170,83,192,81,137,235,197,100,60,184,188,156,63,146,114,187,95,43,239,229,205,252,129,158, + 92,244,175,242,105,173,210,55,162,189,95,44,168,213,105,254,169,128,221,11,255,108,13,159,236,25,39,237,232,253,214,188,201,170,129,245,177,211,92,63, + 251,60,159,223,146,187,230,132,131,190,222,122,124,151,95,23,203,155,28,243,70,161,212,195,42,42,13,241,116,245,252,114,190,24,23,139,232,129,128,33, + 208,172,30,87,249,60,68,184,192,164,9,159,234,17,181,184,126,80,38,3,251,155,227,210,116,214,187,61,4,98,93,60,198,152,129,87,147,233,20,237, + 148,71,101,214,172,94,45,230,31,16,100,87,231,144,214,8,187,45,86,249,56,95,229,155,206,214,20,85,159,207,30,95,157,255,243,151,191,213,225,254, + 104,116,254,127,243,197,135,77,248,78,5,242,203,249,61,192,83,167,36,232,200,247,232,156,172,89,190,122,59,185,197,64,233,148,254,95,30,111,167,0, + 117,253,160,81,120,245,233,174,216,52,90,54,187,190,113,144,188,181,48,30,221,78,168,210,240,215,21,38,252,119,234,36,74,75,84,141,78,86,211,226, + 237,175,249,199,162,247,243,50,116,93,82,26,133,70,116,177,98,190,120,27,245,78,179,252,249,186,206,40,108,55,249,223,249,135,251,203,222,175,171,2, + 170,99,145,106,152,150,239,118,35,161,228,86,127,212,236,242,254,242,15,232,177,70,3,196,130,255,204,175,91,99,32,234,116,242,246,102,60,126,51,172, + 190,167,11,228,139,113,111,188,152,124,44,246,151,163,107,6,189,124,185,191,208,100,126,160,17,76,40,217,79,73,107,204,34,48,97,107,190,196,242,233, + 100,84,204,150,135,97,16,56,136,137,141,230,183,183,243,217,50,32,162,170,187,28,94,126,26,44,243,161,200,216,112,11,14,147,49,164,49,185,154,20, + 139,246,147,178,131,183,85,251,229,141,138,236,246,126,57,25,221,228,211,105,54,250,92,14,186,44,245,67,36,96,90,11,241,218,120,223,158,66,180,60, + 142,28,125,147,55,119,197,2,120,95,30,228,77,234,166,206,63,139,187,197,124,124,31,174,127,52,153,114,98,195,191,76,160,88,38,151,247,201,134,23, + 197,191,238,39,168,241,164,150,255,103,190,2,75,158,183,205,159,87,187,7,123,18,23,10,172,178,32,82,66,195,242,121,7,253,43,214,113,241,243,116, + 242,33,102,70,128,94,5,181,117,42,52,82,212,111,134,107,53,30,126,93,183,140,199,52,191,44,96,33,238,38,143,145,149,73,155,215,235,197,252,254, + 238,118,62,46,170,2,107,171,112,253,67,51,121,59,158,44,239,80,224,124,50,35,103,170,225,93,93,107,38,54,142,207,42,113,98,155,14,35,49,77, + 231,225,170,67,219,194,11,22,14,203,41,157,41,114,157,207,20,2,5,45,132,123,181,201,122,47,160,62,54,28,133,193,29,112,141,56,218,27,23,31, + 192,127,12,116,237,225,157,138,248,240,65,125,103,201,186,50,118,140,158,85,158,14,151,210,211,21,9,221,218,45,166,142,21,183,114,59,133,189,73,85, + 43,38,224,7,58,253,58,62,179,79,134,249,28,22,236,167,31,183,15,192,191,10,79,163,237,157,240,115,113,63,45,206,103,243,217,103,248,21,175,75, + 27,78,63,139,234,123,233,147,157,243,245,79,106,22,98,59,135,208,102,227,152,248,199,124,50,59,7,190,139,197,235,219,124,241,161,88,148,173,148,223, + 7,203,85,190,88,53,40,183,147,113,227,119,49,27,55,250,13,77,77,39,248,231,92,173,105,227,28,206,200,98,1,16,196,37,137,90,38,255,207,217, + 154,182,153,228,199,201,114,114,57,153,210,143,240,117,90,188,110,34,233,245,252,99,177,184,154,206,31,214,207,227,69,112,151,175,110,34,25,212,62,50, + 224,74,142,1,60,209,17,62,45,233,81,37,205,26,187,180,160,254,163,55,16,28,210,230,206,210,113,57,2,146,99,210,245,222,237,160,71,84,41,108, + 102,52,83,60,77,68,11,150,2,61,165,189,2,217,101,90,51,103,122,8,231,41,79,169,204,153,16,128,139,99,86,175,105,210,157,57,151,41,173,132, + 212,168,190,161,14,148,204,180,21,146,137,222,0,177,183,209,90,201,104,84,102,199,88,63,247,78,64,234,246,205,164,239,72,61,25,169,39,202,64,242, + 239,50,232,40,131,246,34,175,77,65,107,145,39,233,17,53,90,228,41,34,181,96,153,64,24,106,116,180,200,7,220,51,133,34,66,71,171,60,34,198, + 203,60,34,199,235,156,35,132,204,4,215,182,177,206,147,195,109,172,243,141,170,107,152,182,157,74,114,179,165,90,121,234,13,204,238,168,182,28,173,63, + 13,139,79,53,21,247,155,28,72,224,61,167,29,26,109,252,25,151,25,131,138,18,196,120,142,193,27,214,32,242,112,130,76,41,78,52,105,173,99,129, + 198,24,104,130,104,94,66,25,242,178,114,160,242,136,10,206,73,116,194,33,6,158,49,169,60,24,147,162,189,219,81,50,12,177,164,89,102,148,183,49, + 77,208,33,83,238,202,218,219,212,13,77,193,169,49,134,107,147,164,197,181,73,212,10,19,247,160,121,37,149,181,103,97,115,133,115,237,122,10,36,202, + 200,235,154,102,122,239,123,84,133,166,29,17,223,245,240,29,158,146,240,50,162,2,57,204,59,238,169,19,105,133,183,49,73,100,66,89,197,66,131,107, + 34,166,162,61,93,159,163,6,183,137,132,68,160,29,238,24,184,227,132,101,92,135,98,97,48,146,196,27,152,248,190,39,221,90,212,42,72,85,146,180, + 64,228,140,115,44,16,78,240,6,192,117,79,98,1,97,246,46,208,152,135,167,39,137,198,91,144,120,159,2,79,4,247,74,161,6,141,25,212,201,78, + 237,88,124,44,0,225,181,182,59,255,17,16,192,95,83,65,138,110,10,178,65,237,174,226,234,81,109,150,92,135,149,182,115,149,69,251,49,97,149,1, + 89,86,234,10,151,92,112,199,5,73,24,0,135,44,225,45,80,218,82,120,8,148,168,60,220,110,116,65,158,10,62,119,73,213,25,231,176,243,65,200, + 204,75,175,99,98,137,27,47,108,9,145,138,72,248,194,10,50,4,67,216,39,97,69,5,67,65,40,134,184,185,83,4,186,154,70,67,242,180,21,203, + 85,68,165,133,129,65,122,99,108,68,221,76,41,44,22,140,211,198,180,176,172,224,92,17,238,18,147,223,1,147,132,27,78,103,11,94,117,134,78,194, + 176,102,48,227,208,81,222,220,61,182,33,132,168,115,181,195,196,158,128,139,74,255,46,183,112,33,33,183,54,46,232,84,174,131,6,13,218,206,43,166, + 192,110,168,46,168,28,239,2,195,32,184,160,134,160,143,148,113,128,10,109,239,8,97,56,100,165,93,85,172,166,189,75,82,73,66,68,180,7,104,65, + 97,89,128,146,52,7,168,24,153,230,4,40,37,25,147,97,56,74,224,75,169,177,16,137,25,87,106,24,12,92,86,26,198,99,62,34,168,24,235,108, + 152,14,169,24,174,180,118,65,197,0,69,222,149,42,6,189,150,26,134,65,179,4,13,163,141,16,165,214,161,202,188,82,49,212,164,140,168,165,129,130, + 154,108,80,201,66,33,46,44,181,145,116,148,230,13,182,8,195,180,165,41,162,249,86,6,170,69,76,201,33,69,219,7,219,237,131,3,39,193,246,153, + 208,26,199,227,229,221,14,65,39,169,162,45,67,58,226,227,180,245,145,103,176,14,195,53,196,21,237,31,173,35,112,58,124,208,220,171,169,130,111,213, + 230,206,102,234,205,163,201,187,23,59,243,167,112,77,16,102,61,62,71,89,139,63,75,72,211,73,53,165,124,66,213,212,74,21,30,148,165,4,143,51, + 220,144,13,72,16,55,36,73,95,25,135,81,74,209,222,245,16,255,98,165,133,43,149,164,143,189,18,88,175,6,235,93,41,40,170,186,65,81,29,248, + 19,113,199,9,226,222,177,212,164,237,197,186,137,237,28,52,18,92,23,185,7,137,74,124,11,235,183,171,23,178,45,86,17,237,156,7,177,146,110,247, + 224,12,20,26,93,238,129,242,118,165,198,119,218,27,71,105,16,56,141,210,24,65,52,40,80,174,61,89,1,56,125,90,4,127,129,60,83,21,44,16, + 171,253,209,4,85,103,82,107,9,131,91,211,108,77,179,205,218,104,220,224,151,139,168,104,208,89,237,161,158,49,30,107,133,242,60,120,16,116,83,146, + 72,2,222,180,19,193,41,145,70,50,244,77,149,185,149,150,43,106,208,91,230,77,160,193,131,165,41,54,186,174,104,239,154,131,12,84,219,156,76,85, + 50,69,11,76,67,44,201,200,231,6,85,105,195,109,240,195,133,113,154,7,51,169,225,254,168,192,92,97,0,123,112,28,30,157,43,93,185,132,28,118, + 24,150,245,29,132,111,11,135,27,136,241,22,196,96,90,61,29,190,61,227,213,113,219,210,220,122,48,166,36,42,135,160,57,216,106,75,143,137,100,16, + 39,195,4,199,36,180,80,86,172,40,6,92,148,134,105,242,6,16,50,33,192,38,27,68,247,17,97,226,201,167,68,25,4,237,166,170,39,128,12,13, + 81,16,17,174,172,9,73,188,140,174,63,113,75,52,172,125,169,4,209,104,80,182,28,50,85,12,174,53,2,64,34,114,13,7,194,16,13,49,179,97, + 225,102,34,98,123,82,44,219,179,252,220,251,71,112,105,68,99,230,146,174,228,26,56,191,101,93,230,12,188,28,131,73,9,239,92,217,135,52,8,255, + 36,102,140,69,210,24,11,29,209,229,22,142,85,24,48,166,44,5,209,224,229,91,89,78,12,158,142,39,82,152,123,213,157,64,252,6,92,17,119,188, + 148,74,17,109,195,66,44,100,179,161,172,217,28,17,42,81,208,76,44,121,101,145,196,218,179,11,51,246,101,77,33,51,203,171,198,60,216,5,119,204, + 159,9,75,135,104,161,137,123,228,196,114,233,156,37,188,151,243,19,170,108,102,67,121,71,246,128,25,24,111,83,19,57,236,6,97,140,49,30,154,131, + 90,192,154,114,21,42,168,87,170,135,223,202,33,200,118,68,129,1,224,224,148,203,12,121,46,103,232,135,211,153,247,6,69,18,175,67,197,64,98,242, + 76,224,43,22,36,86,103,184,230,138,224,51,104,67,154,19,28,203,205,96,75,18,77,83,100,158,91,202,19,175,105,152,184,167,195,36,190,110,204,85, + 180,70,159,17,137,75,56,202,38,48,17,174,189,242,97,248,240,96,17,51,109,49,118,159,41,3,94,201,148,217,206,46,150,61,201,176,125,247,172,86, + 169,51,129,14,49,155,195,42,166,253,49,216,22,134,181,27,157,98,14,202,17,171,212,194,188,98,213,10,56,214,240,135,180,234,253,220,35,141,198,232, + 132,39,190,49,186,44,109,122,172,7,13,217,131,137,114,88,228,18,216,239,84,60,213,252,231,254,150,239,176,248,20,238,123,132,170,137,167,116,46,122, + 221,197,246,227,112,78,117,221,122,226,113,8,38,16,33,26,221,186,47,80,154,11,113,92,128,144,180,126,44,188,255,67,88,102,190,163,246,64,122,189, + 150,11,249,138,23,253,124,49,58,224,87,110,202,125,23,211,203,137,41,90,31,166,235,154,234,186,34,15,172,231,164,50,248,250,202,42,169,97,225,105, + 123,184,37,250,140,118,94,164,244,241,169,235,6,154,159,154,118,78,26,75,195,94,109,229,19,195,71,168,23,74,72,183,183,107,140,18,154,151,233,122, + 197,172,144,165,227,138,64,200,9,25,81,41,69,166,60,226,39,162,57,193,152,11,110,183,130,95,167,194,22,128,212,114,157,75,11,68,183,33,130,211, + 148,209,83,33,110,241,112,93,200,249,76,208,222,237,40,137,160,70,66,190,148,56,211,30,156,178,49,77,192,237,114,90,7,111,40,65,221,208,16,200, + 123,229,140,230,73,90,92,155,50,221,12,144,160,156,40,71,24,201,165,10,89,105,75,13,194,26,43,235,20,143,72,97,183,6,163,134,131,191,33,134, + 168,14,205,57,74,147,175,137,20,232,25,120,194,129,36,40,137,45,99,26,207,224,141,179,50,115,94,83,41,252,83,244,66,147,42,80,108,83,65,51, + 116,5,74,84,219,89,136,109,195,70,145,165,171,14,68,227,112,7,153,167,124,170,165,123,39,112,38,131,104,48,9,169,74,135,221,50,235,109,144,118, + 120,30,92,118,73,169,254,32,109,141,48,197,41,138,13,192,41,102,121,132,138,247,73,4,69,238,229,70,25,105,209,239,190,209,248,132,149,72,177,239, + 158,61,160,250,246,125,98,237,209,43,140,219,171,111,249,175,251,124,81,116,139,107,129,120,129,56,210,69,103,146,202,12,9,67,52,69,33,149,166,215, + 138,144,80,137,0,41,3,12,188,117,17,161,100,146,19,135,66,100,215,74,174,73,87,246,97,56,60,253,42,105,30,250,48,146,246,220,250,255,78,204, + 251,115,72,61,196,208,13,137,152,164,68,34,153,154,131,82,119,173,62,84,187,15,245,93,234,95,87,234,162,45,17,113,64,234,158,29,146,122,116,149, + 164,236,131,181,251,96,127,46,169,71,83,111,171,57,95,77,29,142,137,33,139,27,8,52,245,104,235,104,43,151,193,60,189,177,218,169,215,79,99,69, + 253,226,155,47,192,10,190,23,247,255,38,83,104,138,200,86,34,50,210,41,81,186,27,165,136,92,227,162,96,36,228,131,122,207,183,245,158,110,247,161, + 147,125,124,71,194,87,69,130,108,75,73,238,71,130,100,135,116,161,100,109,93,200,219,125,240,63,43,18,106,38,104,43,182,118,86,109,224,130,164,28, + 250,251,234,55,237,88,134,252,240,123,218,236,12,59,1,17,201,33,220,173,74,109,170,172,155,216,151,24,86,210,135,207,235,111,120,43,169,123,234,137, + 209,123,54,8,9,93,19,221,116,49,250,148,68,55,189,117,66,34,210,244,174,35,68,190,185,172,212,218,122,91,255,28,233,41,161,149,78,167,167,196, + 142,188,20,247,205,243,35,205,172,148,34,32,167,83,82,38,188,193,103,203,161,160,157,144,170,77,74,46,133,6,122,101,217,117,94,137,179,114,55,112, + 127,169,86,91,159,247,220,131,161,163,63,214,33,90,222,126,61,4,30,25,102,21,157,1,134,67,7,54,187,51,202,42,160,124,157,154,170,206,237,110, + 221,245,217,186,192,211,186,241,179,117,243,181,186,28,52,158,63,204,250,251,183,36,234,113,115,201,184,167,81,114,140,223,250,240,234,10,155,121,238,180, + 82,248,97,195,155,88,180,55,140,211,43,135,61,212,44,24,167,37,20,180,142,255,63,12,235,192,88,57,238,140,236,213,47,135,37,222,174,223,9,11, + 29,37,189,113,94,214,28,166,109,64,33,157,11,154,170,75,133,84,15,59,118,47,234,186,59,128,181,245,166,218,6,40,183,223,110,219,196,242,214,43, + 113,215,248,119,38,122,27,202,150,114,162,119,55,91,163,118,43,167,237,215,246,158,116,188,228,8,77,252,220,26,137,179,111,125,63,227,105,135,207,232, + 101,18,109,153,100,108,247,37,142,100,19,116,11,164,109,70,194,199,137,175,40,178,47,181,181,113,57,157,143,62,236,22,216,250,236,51,147,74,179,176, + 53,224,164,166,237,0,58,227,202,45,130,70,11,53,164,51,233,52,29,103,232,9,218,203,231,148,239,28,208,254,17,231,148,110,165,123,27,78,40,30, + 78,35,88,231,176,244,203,56,130,174,32,202,6,17,139,87,99,21,106,65,155,240,214,42,99,195,17,82,122,219,185,86,34,110,224,93,146,42,200,122, + 24,167,253,1,90,56,148,166,157,244,116,160,45,163,35,220,130,142,205,83,30,93,200,255,111,239,90,114,27,6,161,224,190,167,136,212,173,101,241,248, + 188,7,82,213,77,183,61,70,239,127,134,206,96,91,197,53,118,18,119,151,70,89,5,41,177,147,129,121,3,204,96,174,184,99,198,239,240,163,181,251, + 227,59,171,173,210,158,77,114,96,243,186,219,23,182,173,226,210,104,237,89,147,170,130,17,93,24,64,218,46,138,155,76,178,180,82,42,227,109,142,123, + 11,40,107,74,36,170,19,69,7,63,154,24,234,8,208,177,209,0,216,228,143,73,86,66,153,87,183,156,229,98,218,180,126,116,91,43,100,65,82,117, + 120,84,59,76,233,182,125,178,146,115,85,54,175,190,178,211,8,104,178,5,90,139,143,154,0,33,42,99,140,197,184,161,132,169,0,186,93,154,189,74, + 140,11,97,154,10,220,188,164,238,255,115,40,187,77,18,170,105,151,117,142,247,163,174,243,11,75,204,14,191,132,248,136,37,97,135,96,110,155,128,199, + 18,131,64,251,220,88,147,249,176,146,191,68,248,22,36,236,63,214,230,101,149,219,192,185,169,250,205,32,178,84,230,133,85,90,222,172,208,168,102,201, + 64,150,28,126,86,211,79,144,207,98,35,232,221,249,58,240,51,164,157,47,3,6,103,228,243,22,226,133,54,57,208,106,142,67,205,234,21,169,209,25, + 9,53,240,82,234,192,119,217,57,179,101,246,28,227,68,7,162,60,122,112,226,234,152,131,103,210,5,147,102,141,180,179,65,67,130,189,28,62,31,129, + 26,46,170,151,68,99,178,87,173,219,106,234,121,203,213,36,150,233,56,164,72,150,209,43,174,46,202,123,135,254,12,245,169,29,217,41,164,95,38,57, + 250,60,115,140,80,13,250,137,7,55,127,72,111,179,173,52,207,109,57,116,249,118,125,253,167,245,142,201,61,122,231,213,190,248,218,233,244,250,136,1, + 214,43,250,102,137,62,104,73,242,59,37,129,57,38,123,104,115,44,228,146,170,168,135,131,102,239,87,25,12,238,19,135,212,30,68,205,185,138,27,125, + 201,33,255,104,131,201,207,161,30,92,213,228,53,38,27,199,210,122,75,31,129,124,41,186,91,166,22,164,159,113,230,147,189,33,108,50,51,219,112,141, + 173,34,56,43,216,195,10,89,119,126,212,183,111,158,64,158,0,210,54,64,110,112,44,45,142,141,195,145,64,250,118,29,232,141,167,109,189,191,124,3, + 80,75,3,4,20,0,2,0,8,0,106,128,249,52,126,63,165,149,12,18,0,0,232,90,0,0,18,0,0,0,100,111,99,117,109,101,110,116,45,112, + 114,105,110,116,46,115,118,103,237,92,91,115,218,216,150,126,239,95,193,144,151,78,29,35,246,253,226,196,57,213,147,212,153,58,83,153,75,157,238,174, + 121,22,66,216,116,48,120,4,216,78,126,253,124,107,75,136,45,16,32,108,39,233,153,9,116,151,165,181,239,107,127,235,182,247,34,111,255,250,120,59, + 235,221,231,197,114,186,152,95,245,121,194,250,189,124,158,45,198,211,249,245,85,255,247,223,254,54,112,253,222,114,149,206,199,233,108,49,207,175,250,243, + 69,255,175,239,126,122,251,79,131,65,239,125,145,167,171,124,220,123,152,174,110,122,127,159,127,90,102,233,93,222,251,249,102,181,186,187,28,14,31,30, + 30,146,105,69,76,22,197,245,240,117,111,48,64,203,229,253,245,79,189,94,15,195,206,151,151,227,236,170,95,213,191,91,23,179,80,111,156,13,243,89, + 126,155,207,87,203,33,79,248,176,191,173,158,109,171,63,228,163,164,200,151,139,117,145,149,221,103,89,92,179,24,79,182,85,49,147,7,25,42,113,239, + 253,144,137,161,16,3,212,24,44,63,207,87,233,227,96,190,124,21,53,197,4,219,154,10,198,216,16,101,219,154,221,106,93,62,206,192,134,131,147,9, + 165,241,232,96,253,29,254,175,27,108,8,73,185,214,9,90,230,201,60,95,13,63,252,246,161,46,28,176,100,188,26,71,221,108,56,223,24,183,177,29, + 243,244,54,95,222,165,89,190,28,110,232,161,253,166,203,203,241,34,163,58,87,125,60,172,105,59,6,119,197,116,190,74,54,171,139,43,142,210,37,42, + 14,111,22,183,249,240,143,233,237,109,154,13,151,69,54,204,238,151,67,96,231,122,49,152,102,139,249,96,117,131,109,29,98,168,89,58,154,229,195,52, + 91,1,116,203,208,217,102,10,151,53,20,89,162,228,95,198,249,125,62,107,142,22,85,144,162,108,59,190,234,99,82,194,123,21,222,111,242,233,245,205, + 234,170,175,220,221,99,32,60,76,199,171,155,234,253,29,8,111,199,249,100,73,5,101,91,122,147,161,0,69,69,58,158,166,179,127,161,63,88,114,89, + 41,154,94,182,152,205,242,12,157,167,179,135,244,115,57,119,250,132,109,188,188,41,114,192,238,21,158,243,180,216,244,161,153,97,117,61,26,175,57,132, + 102,146,215,197,215,21,241,247,249,116,5,124,173,151,121,241,43,237,209,127,204,127,95,230,123,181,126,43,210,249,18,128,184,189,234,223,166,171,98,250, + 248,243,64,36,214,42,233,252,5,195,151,39,222,120,203,204,5,231,160,27,33,47,6,206,138,196,57,173,94,215,157,101,143,87,125,195,116,98,185,18, + 126,75,253,76,252,50,137,81,214,109,169,147,214,186,147,214,186,5,180,9,183,9,106,58,211,239,13,43,246,54,89,211,153,189,196,182,22,174,190,171, + 202,223,46,87,139,187,77,93,96,101,245,121,6,56,18,113,128,30,23,197,229,104,150,102,159,222,4,194,2,252,156,174,62,95,242,55,253,109,139,197, + 100,178,204,49,44,139,104,1,86,104,129,145,68,189,128,167,141,197,218,198,226,237,99,169,45,179,134,205,37,127,63,132,70,155,253,92,132,182,3,116, + 192,157,231,137,145,127,94,132,182,0,80,185,254,139,131,162,29,128,154,29,6,96,84,203,180,117,152,232,254,249,146,241,205,224,174,197,41,184,63,81, + 99,28,133,59,118,238,216,198,10,251,13,224,46,18,110,125,27,220,31,249,85,95,50,80,181,229,219,189,251,76,84,179,11,225,71,209,90,87,144,16, + 248,132,128,99,191,130,238,181,134,139,238,208,127,197,194,231,137,218,23,99,169,115,224,216,58,90,103,64,98,52,243,237,245,111,224,231,97,253,139,98, + 215,80,134,66,37,229,42,155,202,144,39,206,234,152,58,105,173,59,105,173,75,202,208,39,92,52,136,135,113,205,171,94,47,88,203,131,12,159,45,69, + 216,196,115,99,236,235,142,98,117,182,46,86,112,110,206,0,228,36,124,118,32,130,181,75,203,185,84,173,200,172,150,210,134,80,12,174,78,171,103,212, + 114,173,29,115,38,149,114,194,245,207,158,242,102,15,216,89,250,186,125,245,93,5,4,203,48,79,212,216,45,187,166,120,255,36,219,148,236,184,31,45, + 75,29,103,248,166,231,115,45,26,93,183,49,166,219,232,163,116,228,71,246,228,232,207,230,162,148,167,185,40,245,211,185,216,170,81,147,74,90,186,177, + 81,218,19,248,234,174,200,95,138,109,198,187,211,108,107,176,230,76,182,5,49,27,191,136,200,142,232,227,15,118,213,234,245,29,83,88,204,116,217,52, + 38,158,142,253,86,155,255,242,216,55,238,244,38,26,255,140,77,52,225,243,12,13,98,188,248,243,65,223,69,225,222,33,191,229,228,194,156,56,225,194, + 181,201,132,157,152,137,238,30,110,68,163,169,243,217,216,54,218,75,178,209,116,0,159,101,231,115,201,229,110,236,236,115,130,178,87,217,40,243,25,63, + 75,99,8,171,157,17,204,246,91,151,209,69,99,24,251,12,141,209,186,232,23,215,24,66,251,83,123,38,204,51,244,69,206,232,251,213,252,180,19,91, + 168,152,134,194,49,190,109,11,157,51,231,33,40,56,79,231,217,156,224,201,90,215,62,124,7,39,89,24,254,116,0,41,79,223,175,13,32,174,205,225, + 88,99,179,14,170,164,158,233,57,236,197,39,221,141,14,13,111,158,206,200,137,163,239,83,25,217,30,30,35,188,20,136,176,132,101,220,52,34,81,97, + 18,47,180,246,170,17,181,82,36,234,181,242,205,8,119,191,110,214,90,183,219,161,205,126,160,205,149,148,93,226,245,224,59,158,52,160,39,162,88,58, + 164,177,34,97,70,201,136,37,116,160,227,17,45,11,199,165,104,28,254,104,155,128,125,70,179,198,65,145,79,28,38,195,34,91,124,252,44,74,48,103, + 218,99,118,195,172,244,120,48,220,89,238,46,232,84,74,226,191,215,79,224,234,142,196,40,101,59,113,213,70,220,127,14,87,181,74,184,52,92,54,143, + 201,56,157,75,56,17,141,65,92,53,42,49,90,196,42,159,184,186,95,247,24,87,37,118,64,169,86,174,42,193,161,142,163,147,144,234,225,37,184,170, + 121,55,172,118,113,246,58,112,213,136,68,56,1,27,191,131,85,203,52,84,190,106,112,213,178,196,10,229,173,217,193,170,5,212,181,20,127,106,174,118, + 212,0,238,101,52,0,247,64,154,85,70,54,184,42,192,63,110,93,164,168,137,171,66,39,92,49,17,207,144,151,117,45,52,171,239,116,106,199,189,179, + 166,60,141,102,137,211,82,27,125,49,96,232,87,146,98,0,35,37,112,245,34,66,31,221,70,28,97,100,105,78,95,130,147,224,142,128,10,225,188,201, + 73,149,88,231,109,228,213,134,131,244,196,88,167,149,182,77,78,234,132,105,99,57,239,192,73,150,120,165,188,220,156,235,51,58,166,182,23,38,1,100, + 181,181,249,64,92,168,132,121,201,173,125,17,94,250,46,188,20,81,181,103,233,79,151,56,201,69,228,193,4,253,169,19,229,44,148,98,147,147,2,94, + 159,23,210,53,245,167,78,164,179,177,35,122,12,147,48,221,220,240,10,147,8,170,172,226,23,152,130,7,16,5,113,82,188,4,11,227,213,28,179,65, + 47,132,70,231,18,1,111,84,178,38,15,93,226,173,0,107,27,60,108,169,75,60,4,150,52,156,3,214,73,91,10,207,161,156,43,30,42,169,4,132, + 28,60,212,154,91,255,114,60,116,221,120,168,248,139,242,80,158,193,67,217,202,67,222,205,226,48,97,69,205,66,11,142,134,71,237,20,180,226,75,240, + 207,118,180,216,166,179,109,121,59,164,228,149,240,84,39,200,80,210,206,248,126,154,63,252,212,236,225,97,58,31,47,30,6,240,163,165,218,8,230,110, + 33,220,105,89,115,107,183,112,147,87,99,244,161,230,85,162,141,171,207,1,234,10,215,235,233,56,31,140,70,11,140,176,42,214,27,62,45,111,22,15, + 161,104,217,32,215,205,234,212,163,117,201,236,42,161,39,238,184,152,142,15,244,91,208,30,76,210,217,114,175,219,108,93,20,212,235,44,253,156,35,50, + 9,127,246,86,77,17,199,0,104,131,34,132,75,188,87,138,1,157,71,196,13,231,123,143,29,95,22,139,219,237,233,84,77,190,75,175,243,229,77,10, + 78,193,216,180,21,86,209,86,8,20,171,242,209,162,24,231,69,92,0,109,233,225,172,187,70,133,16,186,1,74,229,121,101,85,68,93,110,10,202,152, + 178,191,205,122,162,148,173,221,57,16,219,226,73,198,204,155,76,103,51,244,99,133,159,100,147,13,252,110,243,85,58,78,87,233,182,219,13,69,213,9, + 85,227,201,229,63,62,252,173,14,89,179,236,242,191,22,197,167,109,4,74,21,210,209,98,13,100,213,113,53,229,104,101,151,36,159,233,234,221,244,22, + 83,162,164,186,191,60,222,206,128,248,186,160,81,121,245,249,46,223,118,90,118,187,73,16,108,77,50,28,103,183,83,106,52,252,117,133,165,253,157,6, + 137,66,235,170,211,233,106,150,191,251,79,202,123,235,125,168,176,24,102,80,22,52,234,102,148,14,185,40,222,69,147,160,197,254,114,93,199,198,251,61, + 255,107,250,105,61,234,253,186,202,161,1,138,182,142,73,196,247,59,9,53,247,198,163,209,102,211,44,159,47,79,51,34,52,158,222,3,30,183,183,139, + 249,50,240,164,106,187,28,142,62,15,150,233,16,206,224,112,143,33,101,55,239,170,94,202,84,191,228,118,189,156,102,55,233,108,150,100,95,194,212,170, + 90,205,150,235,209,31,80,96,141,165,209,212,254,57,189,222,225,14,81,103,211,119,227,154,223,21,161,181,214,236,174,56,94,33,36,45,158,232,99,145, + 165,179,19,85,32,45,39,6,26,173,71,163,89,254,71,126,98,48,8,219,201,58,29,230,12,121,185,91,159,168,147,173,239,150,167,184,55,110,171,80, + 210,26,59,83,238,107,115,15,3,52,73,152,99,225,254,184,139,192,72,190,207,4,95,19,218,119,121,1,129,93,158,132,118,91,102,240,63,242,187,98, + 49,94,135,132,211,38,166,159,217,241,135,233,18,222,195,104,221,218,113,145,255,247,122,138,22,79,234,249,223,23,43,176,228,101,251,252,101,117,120,178, + 207,226,66,94,76,239,195,150,18,26,150,47,59,233,95,111,210,34,255,101,54,253,20,51,35,64,175,130,218,230,56,50,178,52,111,135,27,59,20,222, + 174,247,156,134,197,250,238,118,49,206,43,219,191,107,7,103,233,40,135,177,251,72,101,61,30,25,205,202,83,168,70,188,254,169,121,136,58,158,46,239, + 80,227,114,58,39,143,174,225,10,94,107,38,182,145,197,170,197,251,84,28,193,189,38,95,189,74,21,19,94,176,16,255,40,138,188,188,150,23,210,39, + 86,11,225,94,111,207,159,11,136,227,150,171,193,99,209,8,162,188,113,241,133,255,99,160,107,159,8,45,226,116,138,58,83,218,186,68,106,203,227,147, + 251,202,151,227,18,163,26,217,200,31,8,39,167,24,88,113,43,247,143,146,183,39,214,138,9,102,184,211,111,226,76,65,242,35,46,97,134,127,126,181, + 159,118,247,58,148,70,119,94,225,181,88,207,242,203,249,98,254,5,126,208,27,136,219,226,83,120,205,171,231,210,235,188,228,155,87,234,22,187,120,137, + 61,158,143,99,226,31,139,233,252,18,24,207,139,55,183,105,241,41,47,202,94,202,231,193,114,149,22,171,6,229,118,58,110,188,231,243,113,99,220,208, + 213,108,138,63,151,106,67,27,167,240,157,138,2,32,136,107,18,181,60,132,191,100,27,218,118,145,247,211,229,116,52,157,209,75,120,156,229,111,154,72, + 122,179,184,207,139,201,108,241,176,41,143,5,225,46,93,221,68,123,80,71,1,64,55,121,55,112,154,51,124,118,118,143,26,105,166,227,253,6,245,223, + 122,3,193,125,56,1,166,28,69,2,146,99,210,245,222,31,160,71,84,41,108,98,52,83,188,157,136,30,172,73,172,82,218,43,144,93,162,53,115,166, + 199,133,78,172,67,96,121,33,4,224,226,152,213,27,154,116,23,136,233,148,86,66,106,52,223,82,7,74,38,218,10,4,107,189,129,148,232,95,43,25, + 205,202,28,152,235,151,222,51,144,186,159,15,253,3,169,207,70,234,51,247,64,242,31,123,208,113,15,118,133,188,54,5,59,66,222,74,143,168,145,144, + 183,17,169,7,203,232,154,207,232,72,200,7,220,179,112,203,162,35,41,143,136,177,152,71,228,88,206,185,133,13,20,92,219,134,156,183,78,183,33,231, + 91,85,215,48,109,7,149,228,246,106,243,122,19,189,70,246,181,248,76,39,74,150,115,173,236,246,228,184,120,172,169,46,58,27,165,108,237,132,129,45, + 113,182,54,44,45,44,120,253,94,31,168,36,202,115,104,198,109,243,202,248,74,71,7,81,186,121,101,73,134,23,28,234,239,56,31,135,236,42,29,59, + 237,73,74,37,23,175,180,167,111,83,52,88,226,195,199,137,99,208,173,251,218,50,45,150,239,86,22,47,163,79,203,154,216,150,83,1,167,54,225,146, + 57,111,248,133,224,137,238,125,236,41,150,56,11,29,161,75,194,251,158,226,216,127,109,54,53,240,106,41,27,215,209,171,117,14,0,233,41,68,18,154, + 51,229,1,190,68,8,233,185,167,134,2,254,14,172,17,39,170,209,112,151,84,15,120,179,206,106,186,251,84,137,131,219,3,146,74,56,243,138,58,4, + 254,188,245,70,81,99,133,93,225,210,6,170,53,116,165,66,52,152,5,233,237,133,48,137,0,220,180,104,210,172,85,152,4,45,162,166,74,58,160,101, + 94,243,178,207,13,21,78,158,81,90,148,19,178,12,106,241,2,11,15,43,113,6,48,171,94,63,246,194,117,144,196,228,75,2,58,73,132,228,52,225, + 146,32,1,43,207,201,102,110,251,140,104,245,232,31,35,234,118,166,239,155,84,225,24,84,46,104,134,193,81,243,97,237,240,24,141,34,154,87,90,195, + 89,37,26,23,12,126,100,152,140,116,156,27,99,136,157,116,14,205,37,102,172,149,119,198,40,98,59,132,219,90,144,156,118,92,88,114,1,18,174,49, + 127,106,108,18,180,148,206,217,176,147,82,42,99,65,179,82,40,181,217,236,29,116,68,114,95,9,68,51,151,238,176,120,24,215,221,144,188,50,150,190, + 59,182,164,186,126,148,102,215,168,32,212,90,125,15,155,242,85,44,120,119,249,110,200,54,181,82,113,104,81,201,118,121,111,76,155,231,173,214,82,96, + 215,45,36,199,10,31,209,76,2,233,246,198,7,57,229,204,98,199,65,147,76,73,79,216,0,136,56,23,128,53,196,42,129,82,132,131,41,9,132,16, + 94,83,138,21,112,228,45,97,4,146,234,149,55,134,42,122,47,49,58,161,218,25,120,159,28,32,148,30,27,72,234,160,166,125,36,129,163,107,66,4, + 94,91,234,123,146,74,231,96,221,68,68,13,52,19,100,2,104,198,52,137,98,152,64,33,209,20,132,71,6,217,231,40,135,36,4,252,91,11,132,251, + 82,139,105,169,4,11,84,225,181,6,21,52,50,29,218,68,204,128,80,27,1,51,161,35,218,199,54,78,238,203,66,64,255,171,201,136,190,135,193,158, + 223,231,216,206,241,17,175,233,238,241,12,136,119,180,20,7,165,53,140,223,85,50,219,69,91,189,222,179,109,148,32,103,25,255,63,41,170,59,34,70, + 170,218,151,54,142,174,165,181,41,109,40,229,27,104,23,81,223,19,213,194,248,16,180,106,42,25,87,102,132,148,1,172,220,25,81,194,210,67,86,32, + 163,18,250,151,11,39,75,0,35,54,211,78,19,21,225,152,135,31,6,225,129,5,14,118,23,70,1,182,93,105,18,10,230,165,240,65,70,13,41,204, + 82,158,32,204,26,49,28,228,9,98,98,109,168,168,33,60,218,19,77,105,131,129,154,52,120,39,48,61,180,156,154,10,123,6,187,36,76,37,163,27, + 170,135,145,84,210,233,114,28,44,60,28,163,160,84,210,18,233,246,26,30,164,143,104,100,87,181,100,154,153,136,72,154,196,24,39,157,112,113,243,68, + 89,8,164,140,71,169,73,245,116,62,110,137,219,153,191,111,16,49,158,36,254,36,198,67,195,113,95,42,18,15,215,22,147,65,88,164,130,186,129,34, + 193,100,57,53,166,71,73,233,142,193,87,241,210,96,104,216,76,198,5,244,33,237,2,204,164,145,146,116,165,71,189,176,49,204,192,201,182,193,184,162, + 186,181,46,184,68,48,208,14,26,140,146,203,40,99,39,218,255,54,252,68,154,101,171,219,163,148,180,211,110,95,119,107,82,126,246,252,68,248,8,158, + 55,145,206,57,86,196,173,189,32,221,14,181,170,72,47,194,253,134,147,230,164,143,168,239,137,10,39,14,86,38,162,74,75,153,13,90,153,11,48,155, + 145,153,104,144,224,226,192,230,135,46,107,42,184,46,21,220,27,11,42,167,31,91,56,102,228,1,234,182,135,247,13,106,53,20,38,15,199,138,240,191, + 157,81,203,130,158,238,223,232,51,14,43,94,57,79,223,118,255,134,139,63,77,208,252,36,173,57,154,45,178,79,71,252,155,56,214,251,154,86,73,155, + 215,237,12,22,170,27,131,75,234,255,26,6,239,75,176,137,242,45,171,80,151,146,175,224,129,69,41,131,155,232,152,83,58,146,129,209,138,227,104,78, + 134,8,190,84,35,226,214,228,218,9,21,229,62,23,225,202,156,195,101,199,127,186,17,179,215,100,209,142,128,40,218,143,226,250,131,209,190,176,176,171, + 141,31,207,210,191,68,80,253,202,150,237,45,10,54,113,231,7,184,155,144,31,65,95,179,201,54,64,142,50,235,79,6,253,122,47,232,175,51,184,143, + 98,83,30,192,38,107,67,204,110,217,222,88,237,234,62,186,254,8,143,179,116,149,255,124,36,155,179,84,242,20,252,211,150,245,232,192,73,32,202,55, + 189,95,122,240,81,96,79,37,103,209,19,158,241,237,57,196,9,136,112,73,91,119,107,208,54,194,151,125,211,86,2,163,106,219,82,252,120,180,56,43, + 177,82,118,223,82,28,18,218,181,103,92,70,9,148,181,173,133,239,122,24,2,251,201,236,167,32,208,226,225,63,111,187,247,214,67,198,252,170,159,22, + 217,89,97,100,112,25,178,22,87,67,238,91,126,171,100,200,87,135,240,195,205,212,178,180,211,18,158,107,69,13,33,28,153,126,155,80,224,199,77,160, + 58,38,164,234,201,144,54,198,100,168,137,248,18,177,87,160,85,125,170,77,235,143,68,229,85,102,188,160,95,179,87,35,249,196,59,104,2,29,81,75, + 111,218,91,217,160,130,134,232,140,201,224,138,113,230,224,159,145,223,204,173,144,37,173,30,9,84,83,81,213,102,77,225,196,138,123,207,37,11,179,103, + 210,250,16,100,210,216,44,28,208,72,202,162,12,167,68,220,178,224,242,213,180,176,118,3,101,231,84,68,229,178,228,71,104,205,20,167,113,218,248,121, + 32,154,108,85,31,202,30,132,220,57,97,230,166,209,179,194,205,122,228,237,21,131,52,186,252,135,97,142,69,162,7,172,60,246,84,31,94,196,246,55, + 59,199,195,229,99,6,125,47,94,110,64,29,27,139,221,10,219,26,206,66,19,199,69,249,214,34,39,230,132,75,30,137,227,245,83,181,242,254,5,142, + 68,140,160,120,115,62,215,202,41,127,232,190,250,176,151,21,191,196,63,58,247,116,70,106,244,89,87,61,187,106,235,187,56,87,187,147,136,157,172,147, + 122,245,121,151,62,181,3,225,36,111,185,224,247,201,222,143,194,106,215,171,229,7,99,100,222,212,126,147,224,126,237,90,253,182,4,5,219,189,207,99, + 211,56,50,251,104,189,45,233,9,63,192,246,21,192,118,112,195,127,48,253,27,75,184,254,154,18,238,59,73,56,231,201,183,147,112,251,67,194,127,72, + 248,255,43,9,247,45,50,194,95,74,194,17,20,236,70,238,101,46,196,230,79,215,84,202,77,178,164,56,144,91,153,22,197,226,161,127,222,89,240,126, + 68,232,76,148,52,17,220,100,129,245,138,112,75,128,128,203,121,37,233,0,158,254,1,50,231,37,93,35,182,82,185,161,211,113,68,114,20,210,53,95, + 195,229,53,252,110,115,225,232,84,215,146,151,107,132,184,224,26,141,141,179,228,139,135,49,165,65,116,181,71,109,206,100,63,148,218,158,171,181,9,80, + 106,233,251,140,11,187,77,46,135,118,223,83,112,56,251,46,73,103,1,178,111,233,135,35,239,126,250,31,80,75,3,4,20,0,2,0,8,0,121,128, + 249,52,162,251,72,104,220,10,0,0,238,60,0,0,13,0,0,0,101,100,105,116,45,99,111,112,121,46,115,118,103,237,90,91,147,218,200,21,126,223, + 95,65,240,139,167,118,144,250,174,110,230,178,229,216,217,212,166,156,77,213,218,91,121,76,9,212,48,218,17,18,145,196,0,251,235,115,186,37,144,132, + 154,241,48,198,246,110,101,160,166,6,78,159,190,125,231,126,196,245,15,155,69,50,120,208,121,17,103,233,205,16,123,104,56,208,233,52,139,226,116,126, + 51,252,245,227,143,35,57,28,20,101,152,70,97,146,165,250,102,152,102,195,31,110,191,187,254,203,104,52,120,155,235,176,212,209,96,29,151,119,131,159, + 210,251,98,26,46,245,224,245,93,89,46,199,190,191,94,175,189,184,38,122,89,62,247,47,6,163,17,204,44,30,230,223,13,6,3,216,54,45,198,209, + 244,102,88,243,47,87,121,98,249,162,169,175,19,189,208,105,89,248,216,195,254,176,97,159,54,236,107,61,241,114,93,100,171,124,90,45,63,157,182,57, + 243,104,214,176,194,73,214,212,50,97,165,148,143,136,79,200,8,56,70,197,54,45,195,205,40,45,94,181,166,194,1,93,83,9,66,200,135,177,134,243, + 105,92,227,77,2,48,28,61,140,29,109,239,14,208,47,225,111,63,97,143,97,117,215,25,204,212,94,170,75,255,221,199,119,254,142,123,132,188,168,140, + 90,203,236,102,117,246,237,136,35,13,23,186,88,134,83,93,236,183,176,243,215,113,84,222,221,12,153,92,110,236,247,59,29,207,239,202,22,33,142,110, + 134,112,67,134,149,180,223,119,103,24,239,181,8,121,148,84,172,245,194,237,33,70,191,143,244,131,78,186,115,163,108,58,9,11,56,174,127,151,45,180, + 95,198,115,157,151,254,244,161,240,103,185,214,145,46,238,203,108,105,207,13,186,56,207,70,241,52,75,71,229,29,168,137,15,59,36,225,36,209,126,56, + 45,97,143,162,183,176,185,233,205,80,71,113,57,154,102,203,173,183,19,207,254,116,217,170,92,174,202,255,232,77,169,211,234,152,176,81,11,45,59,108, + 166,237,105,195,91,88,224,58,210,179,194,44,84,97,98,190,49,144,191,29,131,81,16,172,14,243,191,231,97,20,131,46,87,124,21,103,119,4,115,130, + 101,61,9,166,21,112,209,29,51,220,163,220,38,112,120,67,132,195,39,89,62,126,53,67,51,164,103,87,150,148,129,0,227,114,59,6,187,173,94,87, + 195,102,110,54,155,21,186,52,152,215,131,173,49,43,68,88,1,54,39,96,242,254,145,237,119,108,132,8,229,92,153,43,69,164,224,98,248,232,145,181, + 52,239,131,35,95,61,105,219,192,185,173,36,1,151,130,208,199,183,157,217,215,211,183,117,44,17,73,120,211,19,192,198,159,0,155,236,183,191,246,187, + 122,240,184,218,236,116,21,206,149,232,41,108,20,38,235,112,91,12,143,235,21,33,92,157,162,86,110,176,28,232,15,157,130,194,39,225,234,218,205,141, + 167,123,55,250,76,24,29,40,17,118,2,74,193,212,188,159,141,18,17,39,161,52,145,230,253,132,221,220,40,17,249,133,148,205,6,173,241,93,174,33, + 200,190,114,224,249,24,220,180,65,102,131,111,134,148,123,74,9,46,201,158,186,5,42,131,56,1,52,210,220,107,67,128,151,122,66,48,213,162,110,13, + 53,240,130,0,5,45,234,188,222,236,215,52,46,33,74,175,10,157,127,48,145,238,95,233,175,133,238,113,125,204,195,180,128,176,186,184,25,150,230,99, + 2,73,205,107,225,97,129,37,21,151,204,67,148,50,140,47,26,40,207,105,161,248,235,89,40,167,95,211,66,57,255,22,186,199,241,227,112,7,93,221, + 163,30,85,2,33,214,209,61,42,60,80,49,74,105,87,247,152,135,3,96,149,93,221,147,30,10,16,149,95,70,247,64,221,185,60,139,238,61,2,90, + 149,126,28,71,141,17,46,63,255,118,139,176,204,227,205,107,136,142,144,44,40,121,185,203,73,218,31,148,12,184,226,151,35,233,113,38,41,65,151,35, + 230,73,133,3,76,47,58,98,35,196,163,72,82,138,59,98,195,18,28,9,193,12,117,197,198,189,64,114,162,88,87,108,202,99,74,18,42,191,36,176, + 54,254,62,134,171,64,103,195,21,192,83,146,35,230,198,21,174,202,196,229,8,244,26,116,85,225,10,87,162,16,62,192,85,128,50,11,164,186,174,24, + 168,66,9,17,136,46,174,144,131,97,140,3,210,193,149,17,216,53,160,28,127,67,92,49,21,28,159,21,88,197,8,118,0,187,203,244,46,77,4,195, + 20,171,86,172,248,19,194,250,41,63,96,112,165,103,117,4,1,1,31,231,118,4,138,4,38,244,130,178,10,201,44,174,144,58,7,95,218,13,92,251, + 166,134,179,159,246,245,163,41,30,163,135,88,175,155,66,207,20,170,245,58,203,112,174,109,188,4,56,171,128,89,15,76,178,60,210,249,110,104,162,205, + 187,51,84,135,212,126,193,176,151,161,89,123,207,5,232,184,198,139,187,48,202,214,128,197,225,224,239,89,182,48,107,51,12,202,75,197,225,240,116,115, + 51,228,160,129,224,103,25,235,13,110,77,181,239,65,8,228,146,247,6,87,121,14,18,29,37,225,86,195,213,236,191,157,4,138,187,108,61,207,13,68, + 179,48,217,99,180,159,106,134,70,147,73,182,49,193,110,213,27,134,74,125,101,186,62,163,85,165,83,117,187,161,197,177,142,83,184,237,168,238,80,200, + 128,30,97,216,181,44,132,82,71,56,54,198,0,217,145,65,184,62,97,61,68,205,229,218,144,87,87,172,21,103,161,203,48,10,203,176,81,146,29,133, + 17,68,119,29,129,60,154,141,127,121,247,227,62,7,155,78,199,255,206,242,251,38,125,50,12,225,36,91,193,217,247,121,161,233,51,76,199,198,120,194, + 242,54,94,192,9,76,127,233,251,205,34,1,117,221,15,116,152,203,237,82,55,139,86,203,238,122,101,206,126,91,52,93,196,102,146,255,161,140,147,228, + 39,179,73,43,87,172,23,141,203,68,223,254,45,138,203,193,219,108,185,181,155,87,180,14,27,220,89,223,18,132,248,8,163,17,230,150,205,210,58,92, + 83,211,58,204,242,219,214,41,13,26,111,230,251,244,176,191,245,155,52,130,89,197,224,231,56,41,138,44,117,29,192,152,112,127,25,203,217,219,209,44, + 92,172,38,191,129,155,236,44,96,192,250,107,56,63,56,133,161,38,241,173,105,34,93,251,245,23,39,199,212,98,211,231,168,104,157,133,237,185,122,71, + 48,56,36,241,84,167,197,167,101,104,47,21,63,128,11,90,44,178,180,176,226,172,231,22,254,100,59,42,66,31,66,135,223,147,229,52,75,193,11,79, + 86,167,138,224,31,225,253,106,50,248,80,106,136,12,249,169,2,232,239,105,121,141,5,180,45,226,253,225,221,91,70,113,226,181,187,160,46,117,14,90, + 94,124,18,84,87,103,249,23,189,204,179,104,101,27,140,93,52,63,115,225,119,113,81,161,226,90,56,215,255,93,197,48,227,89,43,255,156,149,0,201, + 121,215,124,83,30,63,236,103,161,160,243,248,193,138,212,104,67,113,222,67,127,184,11,115,253,38,137,239,219,96,88,213,171,85,109,87,165,182,220,243, + 181,191,243,223,246,219,188,241,235,157,128,183,15,14,73,56,209,201,205,240,189,25,28,224,126,224,203,86,203,69,22,233,122,250,46,30,204,219,217,214, + 28,10,130,38,255,170,11,242,125,225,13,137,138,125,53,5,108,233,202,169,16,230,72,30,203,85,5,134,34,128,195,39,66,16,215,35,98,42,2,10, + 21,173,50,95,46,154,70,68,14,254,168,65,122,107,107,95,155,216,182,219,173,38,130,162,170,80,109,183,104,119,161,151,56,218,160,117,220,198,212,115, + 118,72,205,182,144,228,169,126,79,183,65,1,74,112,198,25,39,87,117,147,162,238,195,206,32,106,117,190,56,122,181,150,156,175,18,61,214,15,58,205, + 162,232,10,44,47,187,215,227,52,75,117,253,185,74,45,90,147,106,178,201,132,65,146,99,80,253,178,77,251,45,139,211,49,104,189,206,175,22,97,126, + 175,243,106,177,234,243,168,40,195,188,236,80,22,113,212,249,174,211,168,179,189,93,42,137,225,223,152,29,158,33,10,33,243,200,243,112,219,153,97,168, + 85,35,102,140,14,103,244,49,120,136,139,120,18,39,134,104,63,38,250,42,138,139,37,40,229,56,78,205,133,174,178,7,157,207,146,108,189,27,111,155, + 76,87,47,114,155,149,114,33,48,87,162,221,3,202,55,213,0,188,57,110,15,216,100,151,11,162,40,58,208,36,108,42,126,198,144,116,104,146,105,16, + 6,66,72,217,215,36,168,150,20,199,156,43,135,38,49,147,214,31,213,164,174,90,140,33,21,122,253,170,223,246,184,56,89,151,94,73,41,67,201,187, + 234,100,43,112,69,21,101,39,232,211,215,209,136,79,137,183,111,196,149,116,251,116,147,52,131,112,17,87,156,31,184,9,143,83,194,49,81,46,225,82, + 40,246,48,234,60,63,170,133,75,164,105,87,4,12,59,133,203,208,147,133,107,193,57,85,144,78,141,16,232,194,45,89,65,255,68,146,53,102,136,42, + 135,206,186,146,10,60,4,14,29,43,116,154,67,39,248,184,67,7,73,201,23,135,254,167,112,232,47,178,249,230,178,113,217,15,119,89,28,234,91,220, + 99,134,122,196,182,141,39,96,59,79,240,168,191,144,21,23,63,139,191,48,171,29,247,23,156,188,248,139,23,127,241,34,155,103,251,11,246,180,8,253, + 60,127,65,200,206,19,60,230,47,204,35,15,71,193,248,92,127,65,31,245,23,226,197,95,252,17,253,197,181,63,119,182,57,48,145,130,54,205,134,101, + 88,222,245,228,119,172,40,179,207,160,206,84,149,237,230,145,243,167,238,79,79,210,155,155,3,52,255,28,96,238,161,128,40,38,46,33,67,231,8,73, + 78,6,239,7,140,121,10,138,102,138,91,212,183,3,198,61,194,56,10,218,84,160,49,165,8,15,12,45,224,84,49,222,166,153,135,110,146,18,102,214, + 220,83,169,244,8,229,66,138,106,205,154,202,96,62,38,152,202,1,140,11,172,24,3,154,128,74,78,6,1,29,80,1,115,48,84,117,45,218,251,214, + 233,27,234,219,1,100,24,1,15,8,106,83,129,198,17,69,196,144,136,132,205,113,139,100,234,125,108,215,219,145,154,131,191,109,17,247,55,108,118,104, + 144,112,33,249,251,192,225,64,48,233,186,169,230,193,95,22,105,243,76,164,184,25,78,119,175,179,150,203,112,43,238,112,188,112,114,142,136,226,216,85, + 46,131,186,49,20,8,230,46,151,85,64,153,171,23,130,57,97,236,171,215,203,246,65,252,133,219,232,228,31,186,94,62,240,73,71,52,226,0,104,51, + 137,16,220,179,105,99,43,4,41,44,43,253,55,15,253,65,141,141,213,113,76,169,181,10,41,192,252,152,177,62,137,64,247,241,101,245,192,31,209,192, + 208,56,226,148,40,99,167,230,199,27,196,218,62,245,20,3,133,183,118,202,4,108,171,6,198,98,153,144,8,44,90,121,96,154,96,208,176,181,160,18, + 49,101,72,76,50,25,152,157,251,68,26,84,225,218,30,17,85,71,116,29,187,99,64,71,149,200,17,105,29,218,97,126,8,248,28,79,46,192,147,179, + 207,247,228,255,7,217,186,51,178,54,153,17,136,148,98,137,3,151,188,28,46,224,36,211,55,191,180,115,180,202,204,75,126,83,41,61,93,58,61,169, + 124,94,126,94,185,130,192,19,16,218,56,132,77,230,81,200,75,133,137,104,96,134,136,97,76,217,37,51,191,111,197,130,66,208,6,7,160,148,64,204, + 184,2,172,36,0,103,140,158,194,39,201,141,209,83,28,40,197,141,43,192,224,52,136,84,216,80,1,94,196,7,246,199,179,24,7,150,145,147,128,41, + 108,183,6,19,230,150,141,35,105,55,238,209,128,34,185,132,48,98,142,194,33,117,86,204,121,232,94,36,173,156,31,11,158,16,72,31,111,52,40,103, + 163,225,212,126,199,19,26,147,132,4,248,165,112,120,105,52,188,200,230,121,141,6,176,31,234,40,213,149,249,245,29,161,244,233,141,6,151,109,155,22, + 2,125,82,163,33,56,167,191,192,129,121,212,24,32,226,190,47,127,241,23,47,254,226,69,54,207,246,23,193,89,26,147,71,252,5,197,135,254,162,110, + 64,217,127,215,230,55,147,183,223,253,15,80,75,3,4,20,0,2,0,8,0,125,128,249,52,153,109,230,156,183,23,0,0,27,89,0,0,12,0,0, + 0,101,100,105,116,45,99,117,116,46,115,118,103,220,92,105,115,219,86,150,253,158,95,193,97,190,68,213,36,248,246,69,182,220,229,216,157,174,76,37, + 51,85,157,164,102,190,165,32,18,146,216,166,8,54,72,89,82,126,253,156,243,192,5,32,33,89,155,99,247,80,149,50,121,241,214,187,158,123,223,67, + 94,255,245,230,114,214,251,88,84,203,105,57,63,233,203,76,244,123,197,124,92,78,166,243,243,147,254,111,191,254,48,12,253,222,114,149,207,39,249,172, + 156,23,39,253,121,217,255,235,155,111,94,255,199,112,216,123,87,21,249,170,152,244,174,167,171,139,222,143,243,15,203,113,190,40,122,223,93,172,86,139, + 227,209,232,250,250,58,155,174,137,89,89,157,143,142,122,195,33,122,46,63,158,127,211,235,245,48,237,124,121,60,25,159,244,215,237,23,87,213,44,181, + 155,140,71,197,172,184,44,230,171,229,72,102,114,212,223,53,31,239,154,95,23,167,89,85,44,203,171,106,92,15,63,30,55,91,86,147,179,93,83,172, + 228,90,167,70,50,198,56,18,106,164,212,16,45,134,203,219,249,42,191,25,206,151,223,54,186,98,129,93,93,149,16,98,132,103,187,150,15,107,117,124, + 51,3,27,238,92,76,122,218,156,29,172,95,224,191,109,135,45,15,235,189,158,161,103,145,205,139,213,232,253,175,239,71,155,214,67,145,77,86,147,198, + 48,155,94,173,121,91,226,152,231,151,197,114,145,143,139,229,118,138,212,255,122,58,89,93,156,244,77,72,191,46,138,233,249,197,106,251,115,58,57,233, + 99,119,74,135,160,19,97,179,128,227,173,10,137,76,171,186,237,122,212,230,35,163,255,50,41,62,22,179,212,160,165,117,173,193,38,229,248,52,95,98, + 241,163,139,242,178,24,253,115,122,121,153,143,71,203,106,60,26,127,92,142,160,141,231,229,112,58,46,231,195,213,5,20,101,132,105,102,249,233,172,24, + 229,227,21,6,92,30,12,198,189,158,244,139,201,116,53,28,95,173,178,141,124,182,43,44,110,22,101,181,26,158,77,103,69,221,180,158,247,60,175,170, + 98,181,26,109,59,46,230,221,29,111,38,11,8,44,138,206,135,183,155,135,111,240,244,245,164,56,91,178,85,205,75,254,34,51,109,122,136,199,208,134, + 34,175,254,94,229,147,41,12,160,110,216,24,114,92,206,102,197,24,242,200,103,215,249,109,189,209,205,88,237,174,74,185,184,30,20,195,46,87,229,98, + 211,22,172,89,221,206,176,73,18,135,24,177,172,142,191,21,233,243,42,145,74,104,197,116,117,123,44,95,245,119,125,202,179,179,101,129,137,69,131,150, + 180,1,61,148,242,178,223,27,61,111,54,209,53,155,236,158,77,111,103,123,61,106,111,251,229,217,104,31,195,198,152,139,241,51,216,232,30,199,198,174, + 217,30,193,70,247,167,178,81,62,130,141,147,51,149,171,252,201,108,180,250,81,108,236,154,237,17,108,180,246,137,108,236,224,146,122,140,178,21,138,127, + 79,230,146,126,156,178,77,2,255,30,48,91,55,151,244,39,149,141,191,242,217,62,151,206,215,191,127,155,79,87,136,184,87,203,162,250,133,81,235,191, + 231,191,45,139,254,126,171,95,171,124,190,68,136,188,60,233,95,230,171,106,122,243,29,98,75,250,12,196,193,23,60,146,66,215,95,132,143,46,22,67, + 25,6,8,165,210,198,32,228,209,118,244,234,164,239,51,21,76,80,65,109,137,227,219,147,190,210,153,214,24,33,236,168,55,96,128,179,153,112,82,152, + 150,65,180,183,39,93,176,226,46,89,111,184,198,70,170,127,175,84,254,246,131,182,218,118,202,252,78,225,54,135,55,247,15,159,155,14,71,221,41,243, + 157,112,219,27,253,164,9,252,239,207,63,253,248,254,247,16,253,239,253,199,201,252,70,66,0,81,101,209,99,35,91,234,45,168,38,243,54,42,239,245, + 174,173,98,91,151,69,29,125,220,181,5,85,138,204,75,105,160,158,119,112,171,203,136,186,4,193,207,187,14,213,55,86,196,123,252,81,151,213,116,12, + 127,150,62,247,88,95,115,186,103,56,164,69,190,186,208,74,139,223,213,83,196,33,157,11,153,119,198,181,196,33,131,205,180,144,222,181,196,33,157,143, + 25,12,109,79,28,222,102,62,108,208,229,167,76,91,73,29,218,166,13,11,181,248,50,148,153,243,18,96,124,96,92,230,149,83,118,96,140,207,162,49, + 234,232,153,130,254,33,125,186,56,31,189,127,182,156,223,253,192,191,238,209,227,51,197,170,165,252,93,62,73,172,70,137,204,26,111,90,98,29,90,145, + 69,25,141,54,109,185,178,177,179,70,181,228,58,164,176,61,218,202,7,8,86,101,194,202,61,159,13,117,161,56,225,157,161,50,36,97,196,152,41,97, + 226,64,41,56,112,175,204,115,37,251,206,188,197,192,221,188,23,207,150,108,180,254,237,93,163,171,167,197,198,157,251,180,13,115,237,14,65,221,225,170, + 51,178,125,222,96,122,191,218,61,211,9,239,71,195,13,143,131,84,159,142,135,0,41,241,254,241,199,81,230,242,97,184,244,249,14,223,140,205,248,1, + 14,63,72,243,220,224,107,236,83,188,2,92,61,188,181,138,186,229,21,96,139,70,153,32,108,203,41,120,147,217,224,165,13,45,167,160,124,22,180,131, + 97,63,83,236,223,191,253,254,253,247,174,131,55,174,17,10,159,42,136,59,3,187,139,254,51,229,79,169,38,116,124,81,21,103,39,253,111,187,34,242, + 97,234,0,175,27,26,1,246,249,168,25,161,213,7,57,88,199,84,19,237,58,166,74,175,241,13,177,53,67,74,55,208,81,102,86,171,163,207,134,2, + 182,12,254,115,89,25,204,103,96,101,11,165,236,115,84,131,61,53,71,13,57,42,254,157,88,186,7,44,186,89,26,213,139,177,148,248,64,68,231,247, + 240,129,140,190,198,7,33,6,51,24,50,195,5,57,14,240,40,115,78,199,163,207,8,106,94,148,169,135,94,185,131,165,206,55,162,85,202,133,96,146, + 202,234,24,219,254,88,103,1,43,212,178,157,11,153,76,70,97,76,91,71,48,66,112,34,10,255,64,73,125,134,77,91,245,137,77,187,189,77,211,92, + 34,32,84,219,48,84,38,225,14,197,126,2,232,65,182,210,182,13,131,160,40,186,175,119,203,33,190,156,51,210,153,83,198,232,208,1,224,182,143,134, + 82,88,141,208,30,241,205,65,121,252,190,51,98,34,237,157,220,83,52,240,92,72,5,13,60,224,185,143,65,169,253,164,59,26,7,68,240,37,248,25, + 141,123,73,126,194,183,71,221,201,79,227,133,246,54,241,211,101,82,186,196,79,81,103,42,251,252,52,193,73,217,230,167,205,172,112,81,186,131,34,6, + 48,151,104,235,112,204,160,237,209,42,245,57,248,217,42,205,116,50,180,81,126,121,46,67,135,112,76,202,67,187,58,56,138,71,64,139,66,14,36,20, + 53,131,254,128,161,50,131,27,139,246,232,179,85,133,190,8,67,253,203,89,188,65,172,212,70,249,251,248,9,54,2,29,32,115,250,183,99,104,87,81, + 245,30,206,122,161,194,11,2,59,233,16,101,186,124,41,220,91,4,194,3,28,177,48,124,37,165,28,192,196,133,128,133,22,195,61,180,172,99,70,95, + 218,132,22,228,45,194,154,17,81,171,22,111,135,154,216,112,63,130,81,104,192,60,194,168,47,224,78,225,227,204,159,203,82,5,48,231,136,254,238,100, + 41,66,122,0,18,106,131,101,131,161,92,240,182,205,81,32,67,47,68,203,247,82,135,51,173,156,82,222,127,25,134,250,39,100,227,132,54,38,24,219, + 218,51,0,48,98,143,83,237,61,43,40,37,216,166,219,90,4,224,235,189,9,193,191,156,156,140,22,30,48,2,249,142,179,112,233,71,47,203,205,142, + 179,179,251,142,214,26,219,77,46,141,89,88,16,170,205,48,168,20,80,163,51,97,31,45,195,234,154,24,83,37,96,13,163,181,250,139,128,229,199,238, + 221,127,37,123,191,163,142,249,2,86,212,30,89,169,70,161,153,5,81,141,109,32,33,136,178,85,16,213,30,24,171,89,15,61,235,108,122,214,213,180, + 58,233,135,76,195,94,130,215,207,46,157,130,241,205,10,1,108,71,197,104,165,57,250,26,148,203,202,251,79,246,247,148,43,6,32,223,230,193,229,109, + 237,146,45,118,20,246,179,131,128,140,51,154,176,159,145,65,57,99,35,57,253,146,155,191,223,178,156,253,90,54,255,18,166,213,113,133,232,62,27,243, + 182,101,99,140,43,161,73,131,217,24,137,180,210,182,236,107,191,217,217,97,179,138,181,45,88,69,131,244,36,203,226,93,52,171,156,24,32,55,5,46, + 85,174,64,10,54,80,24,58,56,225,31,103,92,175,71,188,172,149,190,109,175,150,241,178,216,228,227,180,184,222,221,232,226,189,181,245,184,139,252,188, + 72,69,100,112,182,62,191,93,63,56,45,171,73,81,109,30,185,244,105,61,90,23,252,121,99,78,234,250,179,126,190,149,39,7,111,52,19,93,207,151, + 23,249,164,188,6,199,247,31,254,81,150,224,31,96,163,150,218,111,125,218,78,87,232,5,193,50,228,13,242,240,97,125,144,36,236,182,192,184,123,116, + 85,85,224,226,112,150,223,22,216,89,250,103,227,59,150,23,229,245,121,69,14,173,170,171,98,191,231,164,28,95,241,198,231,240,170,150,192,226,102,191, + 5,251,14,79,79,203,155,214,0,164,22,151,11,222,99,76,23,86,77,131,190,42,103,5,148,101,92,144,63,246,112,196,235,233,28,220,25,174,239,59, + 74,177,197,128,251,45,54,119,32,1,227,197,29,77,200,48,31,238,120,120,187,59,192,88,174,170,242,3,22,180,190,88,177,223,129,76,106,10,238,44, + 159,237,244,239,178,88,229,147,124,149,239,116,109,67,225,13,194,176,185,65,88,77,206,142,255,241,254,135,237,161,199,120,124,252,63,101,245,97,119,126, + 193,6,249,105,121,133,29,109,207,93,120,49,113,124,76,179,202,87,111,166,151,88,2,47,177,254,229,230,114,6,181,223,62,104,53,94,221,46,138,221, + 160,245,176,155,11,185,157,151,122,39,227,203,41,59,141,126,89,77,103,179,31,57,73,227,112,102,61,232,116,53,43,222,252,109,50,93,245,222,93,173, + 210,220,53,169,213,106,204,139,199,101,245,166,49,61,183,249,246,124,123,242,114,56,230,223,235,187,156,189,159,138,222,47,152,185,107,104,218,248,225,48, + 169,229,193,140,28,120,121,117,250,79,184,212,214,0,228,194,247,249,249,222,42,72,157,77,223,240,30,233,235,209,250,71,103,139,241,213,167,26,204,166, + 139,211,50,175,38,93,205,106,90,107,250,180,250,131,133,146,91,179,233,184,152,47,63,45,194,180,245,233,71,120,178,203,203,114,190,76,210,92,247,93, + 142,78,111,135,243,241,112,153,143,224,45,70,7,210,28,151,115,120,232,211,171,199,202,234,63,243,15,87,167,189,95,86,5,194,81,245,88,73,29,206, + 153,218,210,6,154,54,241,211,254,246,27,102,241,248,157,183,89,187,40,42,168,250,242,147,172,237,186,195,254,143,98,81,149,147,171,116,145,185,205,208, + 103,14,252,126,186,172,25,211,53,112,85,252,235,106,138,30,79,26,249,191,202,21,184,242,178,99,190,93,221,189,88,48,232,98,122,250,84,62,188,131, + 52,17,124,1,100,154,240,233,69,56,92,84,211,143,73,99,168,108,203,151,101,200,47,23,121,85,188,157,77,63,52,215,156,52,123,173,201,219,27,0, + 59,255,255,122,180,137,16,233,215,249,46,114,180,66,243,54,252,204,242,211,98,118,210,255,137,15,123,242,48,2,151,87,139,203,114,82,172,187,111,2, + 14,143,0,191,105,159,159,159,193,193,31,195,245,127,247,109,71,173,248,232,85,29,5,143,191,69,212,202,131,93,255,172,3,241,177,220,252,100,79,204, + 123,140,89,231,147,38,241,159,229,116,222,166,66,98,69,53,155,226,159,99,179,161,77,114,4,209,170,202,111,143,231,229,188,216,80,183,55,41,182,208, + 15,204,248,185,135,148,79,122,163,165,28,16,135,154,24,163,239,189,35,85,7,128,198,68,141,188,89,98,73,179,81,90,15,146,199,102,156,140,36,241, + 132,35,26,208,2,178,98,161,216,215,102,134,215,134,226,192,0,71,69,43,180,239,105,228,6,46,122,207,202,21,70,85,0,87,61,164,149,90,73,109, + 205,32,176,131,212,42,176,183,206,76,180,22,189,165,201,48,180,85,61,21,177,6,47,148,28,40,137,228,208,88,103,123,64,210,1,75,181,113,160,124, + 230,129,116,185,234,84,221,49,66,106,18,131,87,210,163,179,201,64,241,90,145,134,209,100,208,61,96,56,103,60,210,146,68,115,49,58,118,86,188,54, + 132,108,52,129,100,96,34,223,83,124,107,67,11,151,198,243,222,26,76,12,112,30,21,25,70,154,210,128,130,236,171,179,232,131,70,95,60,118,193,96, + 28,174,90,0,99,178,102,15,40,43,141,193,196,93,204,254,163,215,223,191,174,198,3,221,70,253,237,17,90,198,122,199,209,43,62,109,220,156,89,235, + 92,83,25,214,10,151,41,251,133,116,78,193,0,148,134,134,40,91,171,155,176,30,34,6,193,90,111,172,138,84,132,160,163,18,97,0,169,42,17,141, + 34,201,9,229,163,6,201,48,69,34,235,35,122,216,168,195,128,39,159,16,135,143,212,3,99,132,15,134,226,136,66,104,12,7,213,225,113,149,71,14, + 100,179,117,87,38,1,84,91,146,130,15,178,22,57,212,75,24,63,80,142,7,92,42,202,212,206,209,10,72,179,206,71,167,107,125,65,186,107,162,34, + 213,59,27,76,173,88,176,155,144,104,81,6,52,166,2,122,227,188,75,180,245,196,33,179,216,175,5,9,26,198,66,161,233,33,233,144,81,57,157,244, + 94,98,81,65,209,146,162,209,194,132,1,212,84,105,137,134,100,22,76,40,88,43,35,168,48,204,40,48,49,104,26,186,13,77,197,188,96,129,18,50, + 245,142,202,8,210,28,0,124,109,216,96,141,3,104,246,96,33,166,5,191,20,185,31,21,148,219,128,251,145,85,48,37,107,7,0,101,162,136,164,229, + 178,127,74,52,41,131,76,98,67,130,140,60,178,166,54,133,121,135,58,55,46,112,46,202,217,237,121,57,127,176,223,132,179,185,75,165,119,175,129,52, + 180,154,21,62,152,155,112,225,79,214,237,180,223,122,115,198,202,70,93,114,129,105,152,218,241,68,88,24,99,52,117,85,11,228,229,80,153,8,209,197, + 104,224,18,52,88,110,188,163,235,128,202,195,29,74,234,130,103,197,160,199,195,126,56,49,163,216,204,121,40,128,74,205,60,207,146,7,60,186,114,188, + 211,208,235,154,98,187,142,213,203,29,226,62,197,57,165,243,231,199,120,167,122,37,82,125,9,31,149,44,147,151,167,105,201,60,60,129,241,200,152,33, + 124,68,145,226,134,177,48,153,144,104,17,110,23,182,12,135,143,120,7,95,3,175,99,130,84,62,209,162,86,48,126,246,14,16,106,136,38,14,180,64, + 252,129,9,251,158,164,9,123,132,134,129,134,51,134,36,16,78,36,175,165,74,204,156,234,16,50,121,12,210,60,98,175,36,17,243,58,35,73,131,123, + 82,176,111,248,69,29,165,241,134,115,232,117,215,168,55,107,230,161,42,252,30,102,240,81,166,152,40,120,104,30,156,227,74,116,12,52,120,56,57,15, + 119,197,13,135,44,72,108,61,214,46,146,119,142,67,32,85,43,97,17,42,225,248,172,85,28,145,209,83,58,227,18,45,241,202,239,252,178,98,165,41, + 197,73,7,71,110,141,73,115,240,72,176,118,143,1,234,140,150,135,124,222,247,32,181,69,241,50,136,123,170,218,121,243,21,34,47,24,40,140,86,196, + 216,66,94,160,122,248,118,200,102,135,188,36,57,46,240,173,1,189,104,222,198,227,121,19,122,193,15,120,1,15,210,132,94,1,62,66,198,208,130,94, + 145,213,87,40,143,111,65,47,122,22,229,28,90,110,161,23,116,76,67,43,92,19,121,193,46,17,216,116,27,121,97,17,210,71,235,154,200,139,171,230, + 90,90,192,11,254,46,88,221,2,94,152,12,42,141,105,119,192,203,193,188,116,8,177,1,188,216,3,14,80,248,22,240,226,225,60,120,215,4,94,50, + 141,194,192,188,3,94,93,188,238,214,51,190,68,242,100,236,101,191,126,236,69,253,162,122,249,13,246,162,34,1,222,192,129,89,30,254,0,222,104,234, + 145,242,112,189,142,58,67,163,55,150,52,33,232,181,6,59,35,79,225,73,163,215,32,213,238,133,134,163,163,243,243,22,105,1,193,141,244,112,111,129, + 98,2,110,0,181,70,80,181,131,96,184,131,115,215,201,25,40,1,60,78,85,112,80,0,246,5,102,129,246,192,69,42,2,21,11,191,65,218,214,187, + 0,195,1,151,83,9,241,13,33,80,164,134,8,84,240,112,164,9,76,44,211,128,128,102,136,197,3,149,142,182,146,174,210,251,9,171,176,104,232,42, + 48,63,253,38,156,143,1,234,138,12,165,138,23,138,21,205,65,4,15,55,14,78,185,245,162,73,131,190,193,58,1,84,5,32,147,72,186,133,241,8, + 35,137,238,149,148,180,155,54,151,59,65,145,211,246,14,61,219,212,216,89,50,60,233,231,213,184,191,167,130,59,253,106,191,85,124,15,136,210,135,32, + 42,253,172,174,102,73,61,255,40,170,242,229,180,245,50,175,62,20,85,61,80,253,125,184,92,229,213,170,69,185,156,78,90,191,139,249,164,53,245,195, + 117,157,212,250,78,251,177,56,208,255,87,31,167,203,233,233,116,198,31,233,235,172,120,53,153,46,23,200,228,143,167,115,46,252,85,249,177,168,206,102, + 229,245,230,121,23,132,109,92,35,221,10,40,29,253,192,167,65,121,149,233,120,124,219,117,9,117,251,184,186,97,121,30,249,179,197,159,238,120,126,219, + 249,188,134,39,155,91,172,189,237,4,189,183,189,93,235,214,215,30,192,66,175,183,189,36,59,120,120,151,142,89,254,184,7,78,98,4,24,126,39,156, + 108,28,85,33,137,0,208,229,197,101,111,144,188,28,61,215,10,120,201,2,6,8,136,113,167,57,28,30,223,221,99,13,197,199,98,94,78,38,247,88, + 195,190,41,156,94,173,86,7,150,144,212,247,255,157,37,32,241,243,119,24,194,222,225,102,203,12,246,78,57,91,54,176,127,222,217,50,0,102,230,182, + 173,251,70,211,167,214,35,66,131,215,221,123,169,229,70,115,125,70,24,124,127,155,214,56,247,169,53,189,159,19,136,124,93,199,172,65,2,122,199,193, + 16,51,198,168,163,25,32,13,224,133,52,121,135,94,111,24,137,20,81,135,254,67,49,44,83,177,59,179,224,237,171,202,247,6,126,32,41,230,39,154, + 160,95,1,255,105,83,7,67,128,76,152,97,202,54,36,96,149,78,48,61,58,133,96,168,29,171,108,193,74,50,16,233,137,214,129,60,85,8,219,129, + 208,77,2,50,32,239,244,192,155,188,178,11,223,209,3,230,210,30,230,13,18,114,27,32,7,68,82,176,134,52,64,55,67,1,0,143,166,74,31,75, + 51,200,61,248,126,106,38,173,96,116,102,97,78,2,238,169,129,142,201,170,181,234,1,49,216,104,0,67,7,44,84,0,21,36,156,28,137,50,48,164, + 77,217,20,122,33,11,145,188,26,139,12,44,229,48,22,248,214,152,206,109,255,209,251,153,75,15,6,32,32,48,123,66,154,44,82,109,133,35,32,232, + 155,148,65,41,103,107,220,163,211,75,44,104,7,120,97,1,83,98,42,37,41,230,79,188,57,164,165,224,138,0,139,164,19,200,135,184,118,44,23,88, + 27,52,128,24,38,225,3,163,18,186,82,6,128,60,70,169,88,235,210,228,11,176,13,39,70,26,164,156,54,129,212,8,80,18,36,193,6,145,106,176, + 236,140,93,27,48,3,203,54,54,4,46,59,98,99,220,108,157,30,26,165,165,78,2,3,246,85,235,36,18,216,135,203,70,116,242,34,118,110,25,200, + 228,73,57,21,239,62,62,4,236,222,165,140,233,106,85,146,29,52,78,37,44,15,204,100,8,33,83,126,28,129,208,36,185,2,64,39,140,172,115,97, + 175,133,3,243,161,136,22,220,79,187,0,50,213,228,31,228,141,141,177,18,205,253,82,95,52,104,200,153,68,162,1,173,33,17,176,20,8,48,42,244, + 2,147,88,86,255,60,141,192,242,253,22,224,64,48,38,93,138,12,2,110,1,118,1,88,71,4,39,128,33,21,242,79,104,34,152,134,212,56,82,72, + 72,79,140,224,186,1,29,5,51,31,104,113,128,242,74,75,9,35,233,71,214,69,125,135,230,178,88,195,173,112,171,154,52,12,107,141,170,247,44,165, + 80,186,238,141,88,11,176,188,126,43,67,199,181,42,32,203,75,122,137,204,78,91,210,176,81,230,255,181,249,33,1,215,158,10,98,188,135,77,178,66, + 131,220,156,230,7,191,6,47,4,238,240,85,6,66,115,199,173,32,207,210,206,212,229,8,104,104,12,224,35,108,59,221,17,97,177,192,70,11,200,158, + 76,13,214,18,124,42,91,64,171,107,15,33,157,21,65,214,26,167,61,235,21,44,43,8,85,39,139,208,47,94,79,77,166,6,27,103,37,228,64,206, + 201,246,120,108,128,44,55,85,61,16,182,125,74,124,169,186,44,213,215,133,10,128,246,84,206,128,55,48,193,39,227,67,34,24,44,103,142,138,169,9, + 4,8,19,116,201,141,145,8,195,213,154,18,196,6,44,121,230,120,171,83,232,218,84,96,163,72,114,177,68,184,182,40,18,123,172,128,251,112,53,170, + 247,158,26,71,62,70,161,60,210,102,94,44,54,73,161,12,171,157,164,66,245,44,228,106,117,162,241,250,136,119,73,245,36,156,27,114,217,154,106,20, + 180,2,30,79,8,190,71,66,113,65,30,176,52,172,70,194,251,168,52,9,44,211,37,39,232,216,80,197,122,145,206,24,56,24,42,148,132,27,137,201, + 189,68,130,165,216,99,118,171,225,117,3,37,19,120,54,83,59,13,216,134,118,137,61,90,90,45,66,90,55,55,147,234,61,224,34,229,146,220,43,148, + 33,177,27,219,87,174,118,117,76,251,180,76,212,0,201,166,150,248,102,85,221,18,156,215,170,75,88,221,53,222,198,255,8,169,229,74,234,146,63,194, + 130,198,174,77,59,250,248,140,47,179,89,221,140,62,169,92,20,91,209,71,65,128,86,7,213,10,62,232,226,60,223,248,219,5,31,154,47,198,16,205, + 224,3,157,15,209,240,232,169,25,124,146,168,144,219,185,70,240,193,55,77,215,43,27,193,7,19,98,16,79,142,52,130,15,44,6,126,93,55,99,79, + 138,14,65,105,221,136,61,93,155,166,254,211,144,96,91,177,21,122,120,184,161,180,65,158,187,13,61,96,128,227,251,120,161,17,123,48,181,131,22,82, + 108,141,216,67,195,150,78,26,217,136,61,160,25,143,47,161,17,123,240,84,152,218,91,53,130,15,217,38,32,248,70,236,209,233,85,76,190,159,185,139, + 61,44,61,122,77,193,52,66,15,57,0,188,131,89,182,177,7,36,111,235,144,187,141,61,29,91,110,104,209,65,180,57,188,210,250,100,240,179,213,80, + 24,190,127,234,41,4,175,122,222,181,130,206,230,206,30,29,156,74,120,158,213,132,248,69,79,37,132,236,56,149,128,151,33,190,109,157,74,80,37,68, + 251,80,130,119,54,189,140,205,67,9,218,9,113,93,243,80,2,209,4,89,166,108,29,74,28,206,112,255,161,196,211,222,212,123,90,117,24,222,225,225, + 101,187,47,38,198,58,235,119,245,97,92,42,159,214,245,125,150,199,16,125,1,39,21,207,23,156,102,45,159,199,71,112,28,174,166,33,74,203,84,101, + 149,53,50,54,187,158,24,43,29,82,4,94,163,139,28,223,3,62,200,228,255,211,129,162,164,143,102,152,0,167,233,112,25,51,125,125,132,9,215,22, + 117,178,113,164,15,78,37,47,45,36,223,32,166,175,132,79,213,66,39,207,93,31,102,212,243,215,30,195,50,218,164,168,5,132,194,40,202,115,18,132, + 188,20,139,60,235,117,138,51,164,243,128,228,99,55,199,166,136,88,74,90,174,216,67,201,88,244,171,55,168,210,1,5,58,254,95,41,231,146,20,49, + 12,3,209,253,156,133,42,172,248,39,87,81,92,135,251,223,128,215,173,192,134,97,3,219,204,76,18,75,178,251,117,228,9,114,175,59,190,71,250,213, + 62,169,39,140,44,118,213,178,184,178,123,172,112,82,79,7,51,39,35,236,63,227,251,107,47,98,181,191,114,243,149,255,224,102,73,67,226,154,182,17, + 107,0,50,189,34,74,81,238,102,240,90,27,48,29,138,40,99,139,10,41,200,178,71,214,150,4,147,37,231,73,248,101,238,18,225,211,82,127,202,23, + 81,1,40,80,132,122,64,106,241,152,167,142,154,213,97,53,35,185,145,47,254,63,17,82,105,23,167,151,94,64,61,54,219,72,75,132,111,18,2,79, + 11,15,158,216,253,100,148,133,121,211,172,49,92,58,119,222,221,104,22,135,105,160,66,171,212,197,208,182,16,190,55,12,202,172,41,162,118,4,71,196, + 196,96,134,74,59,181,30,149,232,1,8,133,222,12,6,169,149,94,79,128,89,61,234,46,167,100,5,79,148,57,172,100,40,53,233,215,111,1,102,180, + 145,171,112,110,125,94,223,156,106,148,111,13,90,177,69,28,185,6,238,62,135,113,147,138,27,181,73,5,247,169,86,90,87,89,35,188,240,129,132,57, + 85,24,54,138,34,143,58,6,120,79,137,163,2,62,113,208,213,192,199,40,28,25,157,144,83,208,246,4,185,17,88,60,134,142,121,83,194,112,204,200, + 129,152,79,34,235,167,111,181,65,6,82,178,75,26,167,183,176,184,2,215,163,56,131,180,174,243,180,80,110,244,80,31,241,120,134,195,74,235,156,218, + 127,65,208,154,74,64,132,24,231,234,222,62,160,57,108,43,204,189,241,43,229,166,29,86,133,171,166,174,82,82,52,164,191,165,234,150,68,80,16,89, + 101,140,68,41,150,46,42,140,132,168,65,125,30,187,212,33,194,137,74,34,96,155,179,108,200,216,212,15,121,208,6,8,97,182,155,131,83,95,154,55, + 195,233,94,88,131,122,253,180,233,229,6,91,185,222,49,228,14,186,214,8,232,184,171,38,240,60,33,246,40,255,51,183,142,225,28,102,61,126,80,143, + 43,246,54,10,113,234,229,45,39,68,132,50,242,101,186,122,110,14,228,134,96,66,245,29,10,67,222,51,110,83,245,246,250,106,154,44,207,174,196,90, + 185,122,144,73,240,201,171,223,226,122,10,130,194,238,244,123,73,108,171,144,114,113,198,240,108,197,170,180,225,192,226,191,250,210,37,200,232,42,54,134, + 44,47,215,109,119,235,214,238,247,210,34,207,121,52,5,153,241,203,196,191,48,199,208,241,179,52,63,167,246,239,215,196,188,189,126,188,63,222,180,247, + 249,253,241,9,80,75,3,4,20,0,2,0,8,0,136,128,249,52,38,221,82,145,115,17,0,0,142,92,0,0,14,0,0,0,101,100,105,116,45,112, + 97,115,116,101,46,115,118,103,237,91,89,115,219,72,146,126,247,175,224,208,47,173,24,18,172,251,160,45,77,244,184,183,55,102,194,211,187,209,71,236, + 51,4,66,18,218,36,161,5,160,171,127,253,102,22,174,194,65,153,148,104,89,59,109,202,14,17,137,172,43,243,203,163,178,74,239,255,118,191,89,79, + 110,227,44,79,210,237,233,148,6,100,58,137,183,81,186,74,182,151,167,211,223,126,253,113,110,166,147,188,8,183,171,112,157,110,227,211,233,54,157,254, + 237,236,205,251,191,204,231,147,15,89,28,22,241,106,114,151,20,87,147,127,108,63,229,81,120,29,79,190,187,42,138,235,229,98,113,119,119,23,36,21, + 49,72,179,203,197,201,100,62,135,150,249,237,229,155,201,100,2,195,110,243,229,42,58,157,86,252,215,55,217,218,241,173,162,69,188,142,55,241,182,200, + 23,52,160,139,105,203,30,181,236,119,241,121,144,197,121,122,147,69,101,247,81,228,115,102,171,139,150,21,102,114,199,29,19,181,214,46,8,91,48,54, + 7,142,121,254,176,45,194,251,249,54,127,235,53,133,9,142,53,101,132,144,5,188,107,57,247,227,90,222,175,65,12,59,39,227,222,250,163,131,232,175, + 225,127,211,160,38,4,229,90,47,160,101,28,108,227,98,241,195,175,63,52,47,231,36,88,21,43,175,155,90,242,157,113,59,234,216,134,155,56,191,14, + 163,56,95,212,116,215,254,46,89,21,87,167,83,97,174,239,221,243,85,156,92,94,21,30,33,89,157,78,97,133,148,113,69,28,161,158,196,178,129,17, + 9,56,43,121,171,158,253,87,130,255,117,21,223,198,235,110,219,85,26,157,135,57,204,119,113,149,110,226,197,239,201,102,19,70,139,60,139,22,209,109, + 190,0,0,94,166,243,36,74,183,243,226,10,176,177,128,94,215,225,249,58,94,132,81,1,253,230,131,206,112,121,167,211,120,149,20,243,235,48,47,226, + 0,149,114,6,92,239,87,241,69,142,220,229,74,240,9,151,194,220,75,120,157,133,171,36,92,255,39,254,2,8,150,140,222,66,162,116,189,142,35,144, + 71,184,190,11,31,202,113,241,227,244,184,188,202,98,192,221,91,248,30,135,89,221,135,36,149,160,234,49,187,67,72,194,105,243,250,178,34,254,182,77, + 10,0,216,77,30,103,191,160,146,254,107,251,91,30,15,184,126,205,194,109,14,136,216,156,78,55,97,145,37,247,223,205,89,160,181,224,198,206,8,252, + 208,192,42,171,137,154,81,10,116,197,248,108,110,52,11,140,145,226,164,233,44,186,63,157,42,34,3,77,5,179,45,245,1,85,174,2,37,180,105,169, + 23,163,188,23,163,188,25,184,19,170,3,224,52,106,58,89,84,226,237,138,102,111,241,162,216,70,164,122,86,189,127,159,23,233,117,205,11,64,40,30, + 214,160,125,36,206,161,199,52,91,158,175,195,232,211,59,71,72,65,158,73,241,176,164,239,166,109,139,244,226,34,143,97,88,226,209,28,208,161,5,140, + 196,154,5,60,109,44,50,54,22,29,31,75,180,194,90,116,151,252,245,16,234,41,251,185,8,29,7,232,156,26,75,3,197,95,47,66,71,0,40,204, + 244,232,160,24,7,160,36,187,1,232,113,169,177,14,3,57,61,220,50,94,12,238,146,125,14,238,79,244,24,143,194,29,52,247,152,98,153,126,1,184, + 179,128,106,59,6,247,123,122,58,229,4,168,82,211,86,119,15,72,85,125,8,223,179,81,94,134,70,96,3,4,142,254,2,190,151,49,105,247,135,254, + 219,11,247,121,162,247,101,76,209,67,224,56,58,218,222,128,132,209,248,23,2,228,168,24,233,203,137,81,242,151,20,163,148,47,40,70,254,130,104,20, + 47,138,70,241,84,52,142,72,137,137,3,164,164,35,252,121,178,148,152,58,72,74,231,6,127,246,24,109,92,74,204,188,32,216,168,58,64,140,196,125, + 158,44,70,106,14,18,227,216,104,7,128,141,145,99,129,141,74,198,15,65,155,213,86,155,176,39,166,128,84,235,25,205,106,170,151,35,11,193,193,213, + 231,243,37,96,19,108,60,97,26,246,61,50,231,136,69,236,220,238,156,243,33,122,211,43,189,82,23,7,44,159,126,102,249,230,136,138,164,230,16,231, + 74,46,72,124,113,60,69,178,61,18,95,112,54,118,92,143,214,66,102,223,201,138,71,166,28,27,252,217,63,3,246,134,213,163,195,26,166,165,129,205, + 246,244,41,97,232,16,216,172,12,252,240,227,193,134,177,163,193,70,8,115,136,253,71,202,128,212,142,5,27,24,252,176,240,99,172,34,244,104,246,7, + 195,191,92,60,162,92,139,67,2,146,18,74,72,251,196,128,132,131,29,22,145,198,134,219,59,34,193,112,146,188,124,53,164,20,233,238,114,8,78,139, + 117,138,19,76,224,182,76,51,214,45,78,200,128,105,38,141,238,20,39,134,188,23,163,188,25,176,2,204,40,165,154,239,177,207,172,17,57,35,35,95, + 40,37,82,235,153,8,172,209,156,147,120,78,225,129,4,76,41,97,78,246,220,234,62,119,23,249,152,192,157,183,120,212,155,88,210,217,30,171,128,18, + 77,181,16,157,237,49,37,129,144,148,249,188,184,61,230,110,119,44,120,103,123,204,117,96,180,53,94,221,235,235,45,223,197,216,71,99,48,19,157,229, + 51,22,112,98,184,87,55,118,203,55,1,4,60,42,122,203,151,129,54,146,89,209,93,190,13,132,53,152,40,28,171,208,1,0,132,80,107,205,40,0, + 1,119,210,202,217,156,6,82,9,193,237,76,7,2,161,200,226,57,59,249,194,178,229,226,113,217,138,46,180,152,12,4,17,82,179,110,229,37,48,212, + 16,234,73,17,101,139,188,74,48,74,59,178,181,1,103,156,75,98,143,41,91,201,20,103,35,178,109,236,30,100,171,141,21,90,52,239,190,168,96,221, + 62,232,209,221,38,235,22,180,20,72,144,245,202,89,54,160,82,121,196,251,18,153,196,167,161,68,5,235,210,190,154,169,50,223,18,71,43,17,93,48, + 129,241,89,171,164,233,130,73,160,159,50,32,193,190,159,2,127,108,25,237,251,41,173,137,102,244,53,44,158,219,71,23,47,100,223,146,148,97,198,43, + 195,59,47,133,117,79,70,164,237,91,146,130,165,123,137,60,46,126,14,49,138,128,235,34,86,189,134,229,75,250,120,49,79,119,117,207,3,14,121,37, + 17,189,18,110,0,235,228,156,119,117,47,64,40,196,47,75,59,221,155,128,104,194,205,171,208,189,124,92,247,170,167,123,5,83,87,196,118,129,15,84, + 101,149,210,170,87,191,6,215,0,105,14,27,216,60,209,92,210,87,17,160,249,227,102,111,248,209,124,61,108,91,185,209,130,143,198,81,73,33,10,169, + 25,36,58,134,16,3,78,31,72,134,41,65,78,158,21,195,122,188,120,122,0,241,153,18,175,242,254,117,196,170,143,25,66,9,238,112,71,197,106,12, + 183,204,160,52,21,211,150,161,236,141,192,205,199,201,23,75,13,74,185,190,95,224,253,3,247,173,185,188,128,55,23,86,183,73,124,215,94,82,192,155, + 17,85,63,215,225,101,236,246,86,32,206,178,132,80,189,56,79,179,85,156,213,175,148,251,116,94,85,219,47,220,59,83,204,7,105,147,116,54,74,196, + 206,61,54,50,246,62,191,10,87,233,29,44,176,255,242,143,52,221,180,251,184,22,24,247,101,240,151,82,75,49,120,9,227,80,17,16,161,12,151,131, + 151,55,89,6,186,156,175,195,135,24,214,228,126,213,221,231,87,233,221,101,134,178,185,8,215,141,112,154,166,248,106,126,126,158,194,216,69,118,51,120, + 189,74,163,27,188,96,52,191,41,209,84,221,108,241,56,238,146,45,172,114,94,93,134,49,154,237,96,168,111,199,152,225,218,42,14,92,190,145,59,94, + 194,242,245,64,202,184,54,95,210,229,10,43,192,108,226,34,92,133,69,216,130,163,166,224,45,22,217,220,98,89,93,44,127,254,225,199,102,163,30,69, + 203,255,73,179,79,237,30,27,25,194,243,244,6,230,222,84,15,240,114,76,180,68,179,9,139,179,100,3,83,192,171,76,127,189,223,172,1,167,205,139, + 14,115,241,112,29,183,157,150,221,214,215,178,70,175,118,173,162,77,130,141,22,191,20,201,122,253,15,28,196,43,40,84,157,38,197,58,62,251,143,85, + 82,76,254,27,239,238,184,209,75,98,135,15,86,29,159,49,176,235,57,37,240,207,177,57,90,135,43,194,107,106,105,118,230,77,19,197,241,253,101,83, + 67,24,142,253,253,118,5,173,242,201,79,201,58,207,211,237,216,4,208,120,135,221,56,206,193,136,216,113,126,115,254,59,56,200,78,7,40,173,191,135, + 151,189,89,32,117,157,156,225,221,165,247,139,234,97,148,227,186,20,206,144,165,164,117,122,118,19,27,204,1,5,177,78,162,120,155,127,94,139,110,85, + 201,45,120,159,205,38,221,230,78,161,85,219,124,113,254,48,207,195,5,132,236,197,64,155,81,186,5,15,124,126,115,168,14,254,25,126,186,57,159,252, + 82,196,16,20,178,67,53,48,28,211,241,162,13,248,54,241,177,191,118,207,44,14,92,118,87,168,215,113,6,56,207,63,43,212,177,107,140,63,199,215, + 89,186,186,113,23,219,186,210,124,102,199,63,36,121,41,149,177,142,179,248,127,111,18,104,241,164,158,127,74,11,16,201,113,251,252,190,216,61,217,103, + 73,33,206,146,91,167,82,68,67,126,220,73,255,114,21,102,241,247,235,228,147,47,12,7,189,10,106,117,45,211,115,208,239,23,181,11,119,79,151,173, + 107,239,132,188,38,62,172,195,243,120,125,58,253,136,47,39,116,24,250,210,155,235,77,186,138,171,230,117,68,184,124,211,173,210,174,146,252,26,24,150, + 201,22,179,174,78,26,118,41,137,183,123,47,70,238,180,112,38,97,179,22,207,89,117,173,69,24,9,41,43,62,11,1,169,41,100,81,51,193,97,207, + 78,184,61,105,139,211,25,248,158,86,170,16,251,230,84,18,220,17,24,255,138,210,189,163,75,27,192,24,254,25,74,115,17,85,155,128,75,237,149,204, + 154,75,171,176,175,178,120,137,76,246,138,201,56,176,240,235,168,141,20,154,154,52,100,118,12,242,93,35,223,249,183,154,46,32,70,45,33,122,125,247, + 118,120,69,232,196,189,245,138,232,238,49,187,89,199,203,109,186,253,3,18,174,119,96,110,233,39,247,24,87,223,203,140,2,152,171,71,236,22,212,182, + 4,165,109,87,62,241,247,52,217,46,1,227,113,246,110,19,102,159,226,172,236,165,252,62,207,139,48,43,58,148,77,178,234,60,199,219,85,103,92,215, + 213,58,129,95,75,81,211,86,33,164,24,89,6,32,240,57,145,90,86,229,151,164,166,181,139,188,77,242,228,60,89,227,131,251,186,142,223,117,145,244, + 46,189,141,179,139,117,122,87,191,247,13,225,58,44,174,60,29,52,41,47,192,21,147,2,72,197,34,248,244,180,135,141,36,145,190,190,129,250,175,201, + 156,81,208,54,53,26,239,83,33,144,12,236,149,39,31,118,208,61,42,103,58,80,146,8,58,78,132,30,180,10,180,16,210,10,32,155,64,74,98,212, + 132,50,172,164,82,161,102,140,1,92,12,209,178,166,113,51,51,38,16,82,48,46,161,121,75,157,131,21,192,126,129,19,54,153,99,125,71,74,193,189, + 89,169,29,115,253,99,242,12,164,14,239,110,126,67,234,179,145,250,76,29,112,250,77,7,123,234,160,111,228,77,40,232,25,249,40,221,163,122,70,62, + 70,196,30,52,97,1,101,74,122,70,62,167,150,8,96,97,210,179,114,143,232,155,185,71,246,237,156,106,60,204,163,82,119,236,124,116,186,29,59,111, + 93,93,39,180,237,116,146,237,185,232,101,189,233,243,226,107,15,177,237,105,246,174,144,230,14,217,250,40,13,136,135,211,248,54,134,57,212,184,91,190, + 213,84,68,84,117,161,74,2,235,62,90,245,49,11,153,92,177,3,178,35,160,107,166,187,55,248,250,45,154,53,116,79,114,65,68,184,81,110,37,92, + 165,14,120,236,192,165,242,10,121,77,190,1,82,0,157,115,175,186,11,68,172,238,112,63,165,192,67,220,250,230,80,123,136,123,143,119,5,184,209,150, + 235,118,34,217,67,67,245,111,251,63,166,190,221,106,195,195,193,71,156,75,95,105,198,152,16,220,86,215,191,84,178,99,226,121,74,123,134,167,24,81, + 146,160,124,160,36,128,151,68,75,26,40,9,15,90,180,82,198,248,74,2,163,230,140,67,132,245,149,164,2,201,176,19,221,81,18,9,164,2,199,96, + 188,212,49,123,232,144,247,82,83,215,202,222,202,8,127,6,54,229,241,140,42,105,36,2,244,209,253,213,173,106,112,1,166,81,28,215,222,141,171,58, + 49,103,65,143,189,177,174,65,71,247,238,36,187,71,124,24,187,242,83,42,206,26,176,36,233,29,168,148,138,107,200,7,216,151,147,194,190,166,52,98, + 140,120,12,114,50,174,57,97,94,145,109,73,230,221,156,168,84,196,192,1,82,65,133,30,218,22,22,104,137,86,194,87,145,13,36,133,0,64,59,14, + 80,131,87,84,210,120,250,119,42,234,106,230,41,150,52,162,152,207,155,81,123,171,236,117,7,168,221,166,36,173,30,232,137,235,128,128,132,165,28,234, + 9,52,104,153,53,157,64,37,3,193,45,23,254,129,122,73,36,90,107,217,51,37,216,90,107,107,188,83,200,210,148,26,242,168,230,186,209,108,44,242, + 233,110,144,20,154,49,237,57,229,123,119,6,160,45,21,158,251,174,23,165,7,174,196,4,86,104,174,213,64,92,144,176,181,237,7,25,59,37,218,74, + 33,101,229,154,125,240,236,19,55,187,186,235,218,54,101,95,207,182,143,161,18,62,200,91,74,149,184,59,39,108,168,146,1,96,247,80,141,87,226,57, + 60,53,197,75,58,39,135,219,127,21,126,199,117,246,250,204,127,167,42,241,207,169,177,112,192,251,246,58,32,59,189,131,25,40,237,157,188,163,50,241, + 166,13,229,108,152,221,242,234,0,121,224,103,108,160,44,234,146,143,41,147,78,15,78,84,241,144,124,255,60,117,119,10,244,234,140,237,16,9,232,255, + 239,18,24,203,246,196,136,31,32,150,91,59,116,29,42,160,198,139,58,165,155,177,146,67,230,209,117,72,224,162,100,207,113,193,186,187,238,236,193,167, + 54,170,241,11,55,195,178,141,49,10,12,70,189,235,254,193,204,110,141,49,118,200,150,120,183,206,14,218,90,253,187,148,112,92,1,7,179,18,106,56, + 81,51,174,2,38,39,31,39,213,13,191,89,117,171,15,41,184,207,170,40,142,183,226,242,219,121,181,146,186,82,194,24,109,33,246,249,58,201,35,200, + 160,123,3,130,31,86,35,49,10,182,219,226,27,38,122,152,128,104,40,45,49,204,105,28,100,164,196,228,195,132,211,192,224,201,19,71,42,68,54,73, + 149,67,1,24,45,177,51,188,8,73,53,211,6,105,18,189,11,155,97,73,221,26,35,177,26,7,239,177,2,224,224,66,97,207,47,217,4,54,46,210, + 8,171,233,140,203,64,41,45,132,194,161,133,86,140,114,164,97,228,147,10,27,143,80,241,90,154,166,18,39,73,161,31,55,201,177,137,143,3,147,28, + 7,152,16,227,169,50,212,80,125,172,29,170,232,239,80,235,29,145,125,5,213,31,135,14,72,86,132,50,120,186,82,253,254,80,146,96,107,41,144,166, + 137,65,253,32,77,19,216,177,34,205,226,86,95,249,77,155,102,90,26,124,36,76,235,146,129,27,10,200,194,70,144,225,72,93,210,170,54,31,155,39, + 17,240,102,232,234,217,80,193,152,173,38,35,40,144,4,33,0,64,218,142,139,36,244,105,101,59,13,64,84,142,6,187,27,46,75,54,220,212,33,13, + 226,16,108,214,58,77,113,28,152,129,116,225,175,38,124,112,4,90,183,194,137,2,70,45,166,212,142,32,181,148,212,209,122,109,12,222,155,53,72,18, + 76,105,202,145,134,7,88,210,117,36,193,150,20,115,52,215,172,150,52,88,10,5,191,203,38,46,255,183,22,16,14,52,97,24,103,216,23,152,145,6, + 170,163,149,147,196,107,221,101,67,129,252,40,22,35,185,228,194,120,76,150,9,32,248,205,172,27,240,99,67,129,12,181,233,167,122,22,48,67,34,75, + 10,174,18,105,154,48,42,180,207,213,204,187,92,38,144,192,252,36,103,78,38,229,50,145,102,40,113,168,145,213,82,45,88,86,51,160,6,68,25,36, + 113,41,153,41,91,130,241,187,150,220,72,74,136,147,2,182,106,244,11,143,68,32,131,160,176,153,118,207,176,95,226,142,194,97,35,94,206,92,186,81, + 172,167,22,24,129,50,129,36,197,240,144,208,209,64,206,6,91,194,80,144,115,187,193,148,107,39,219,89,42,0,160,180,72,19,176,153,45,133,169,52, + 199,174,36,56,68,89,206,177,90,156,108,102,9,18,195,179,6,32,105,232,187,92,28,180,82,194,209,12,186,212,26,6,240,108,155,121,86,80,129,125, + 0,94,156,44,231,89,65,10,143,44,173,129,116,182,134,157,13,154,225,42,100,34,5,61,174,109,209,91,50,213,232,46,159,32,206,87,89,64,221,5, + 62,27,194,84,69,128,71,88,44,248,97,175,71,164,117,91,128,92,8,64,182,157,23,208,24,53,210,233,167,158,63,210,252,53,226,179,2,164,50,79, + 14,72,179,218,42,230,201,11,104,149,18,101,51,32,103,74,121,114,71,138,162,70,80,79,59,72,211,190,10,129,0,254,130,83,225,233,25,105,88,94, + 81,30,30,144,86,105,81,52,51,133,125,53,248,28,15,91,72,179,78,63,37,254,224,217,135,39,62,82,102,28,208,106,4,35,13,76,67,48,15,233, + 72,171,86,215,78,19,88,180,107,89,91,13,210,164,6,127,229,89,23,210,74,197,85,38,232,8,2,2,140,103,167,30,83,101,205,30,165,214,191,123, + 174,61,194,7,159,82,121,13,164,104,78,136,245,124,75,203,101,218,121,131,197,106,214,120,41,199,196,141,161,206,11,214,222,172,132,65,235,241,90,168, + 180,94,177,133,84,235,61,43,212,9,79,41,21,50,91,47,220,128,183,226,170,193,221,248,118,60,104,228,157,110,28,69,212,109,202,152,128,52,64,177, + 17,94,236,240,91,86,58,118,36,46,173,31,137,144,86,142,88,135,43,143,210,76,193,25,98,80,247,1,200,53,194,11,136,174,95,6,48,105,194,102, + 51,120,219,136,89,105,148,23,122,203,201,128,95,241,66,180,215,172,150,118,185,52,161,221,120,16,155,117,181,92,194,33,31,118,52,216,206,85,115,104, + 154,185,168,220,207,7,112,178,202,107,81,6,92,208,178,215,243,32,149,232,37,107,101,57,131,179,29,185,216,231,238,167,180,249,158,87,54,47,51,92, + 20,157,149,212,226,223,89,194,200,164,66,140,209,88,161,69,34,120,2,134,86,164,2,240,206,218,64,230,105,48,163,36,152,244,106,48,79,64,173,112, + 91,31,34,97,143,139,173,33,76,128,80,5,69,170,4,229,90,133,25,46,23,96,170,28,105,218,66,16,147,56,180,194,191,247,116,153,176,5,187,183, + 85,114,61,160,34,13,178,99,174,103,144,82,91,202,136,25,155,183,39,178,97,114,10,178,135,228,212,140,109,159,158,159,170,74,189,35,85,53,236,79, + 180,115,218,167,232,68,208,225,10,87,222,30,209,196,161,197,238,61,110,160,252,9,118,170,173,127,240,142,238,235,195,50,58,40,109,117,235,173,157,114, + 22,221,113,122,140,175,236,142,102,195,110,235,161,201,216,12,249,244,27,50,190,89,226,191,191,37,202,97,173,249,16,75,100,124,167,37,50,125,176,37, + 210,177,25,234,111,150,248,205,18,255,4,150,104,7,150,200,15,177,68,78,155,63,129,188,60,123,243,30,255,208,236,236,205,255,1,80,75,3,4,20, + 0,2,0,8,0,130,128,249,52,145,40,234,161,189,30,0,0,76,213,0,0,15,0,0,0,101,100,105,116,45,100,101,108,101,116,101,46,115,118,103, + 236,93,219,114,35,55,146,125,159,175,224,178,95,220,49,98,17,72,220,213,151,9,239,56,102,195,27,218,217,136,177,29,251,184,193,75,73,162,155,34, + 181,36,213,106,249,235,247,36,138,151,42,22,68,145,20,69,117,88,148,236,104,49,11,133,203,65,34,243,36,42,81,252,248,183,111,55,195,198,215,124, + 50,29,140,71,159,154,50,19,205,70,62,234,141,251,131,209,213,167,230,111,191,254,163,229,155,141,233,172,51,234,119,134,227,81,254,169,57,26,55,255, + 246,249,47,31,255,173,213,106,252,125,146,119,102,121,191,113,63,152,93,55,126,30,125,153,246,58,183,121,227,135,235,217,236,246,188,221,190,191,191,207, + 6,115,97,54,158,92,181,223,55,90,45,220,57,253,122,245,151,70,163,129,102,71,211,243,126,239,83,115,94,254,246,110,50,140,229,250,189,118,62,204, + 111,242,209,108,218,150,153,108,55,87,197,123,171,226,247,121,55,155,228,211,241,221,164,87,84,223,235,149,75,78,250,151,171,162,232,201,189,138,133,100, + 8,161,45,168,77,212,66,137,214,244,97,52,235,124,107,141,166,239,74,183,162,131,169,91,73,8,209,198,181,85,201,237,74,157,127,27,2,134,71,59, + 19,175,150,91,7,244,183,248,127,121,195,66,144,21,99,189,196,157,121,54,202,103,237,159,126,253,105,121,177,37,178,254,172,95,170,102,129,124,165,221, + 202,116,140,58,55,249,244,182,211,203,167,237,133,60,222,127,63,232,207,174,63,53,181,191,253,22,63,95,231,131,171,235,89,73,48,232,127,106,98,132, + 198,197,79,139,30,156,47,117,72,100,138,138,130,243,106,203,151,180,254,107,63,255,154,15,171,247,246,199,189,110,103,138,206,182,175,199,55,121,251,247, + 193,205,77,167,215,158,78,122,237,222,215,105,27,218,119,53,110,13,122,227,81,107,118,13,197,104,163,214,97,167,59,204,219,157,222,12,245,78,107,149, + 241,216,62,53,243,254,96,214,234,67,151,102,121,198,83,242,25,197,62,246,243,203,41,23,47,198,193,159,84,188,128,75,152,137,188,51,249,143,73,167, + 63,128,242,21,133,138,98,213,43,138,180,156,223,131,187,166,179,241,237,162,44,122,49,123,24,162,105,22,182,122,227,225,120,114,126,127,61,152,229,31, + 162,96,12,184,7,179,135,115,249,161,185,186,99,124,121,57,205,129,175,40,201,34,196,184,3,45,169,102,163,253,156,182,68,170,45,153,110,203,44,219, + 250,216,174,14,121,103,132,40,108,143,208,59,19,124,183,215,221,27,35,37,31,199,168,52,186,144,170,48,115,198,242,127,190,185,177,135,116,105,122,193, + 214,122,184,195,212,188,35,161,114,107,182,24,100,122,114,148,218,115,114,22,139,16,221,24,230,61,212,223,25,222,119,30,166,205,13,179,39,157,217,126, + 246,186,195,78,239,203,190,115,39,157,219,5,196,68,91,219,235,183,116,225,136,16,154,112,44,8,173,60,30,132,86,29,204,68,200,93,140,232,187,142, + 134,99,21,123,99,180,155,25,125,119,121,217,211,61,189,239,90,149,7,52,164,66,248,35,185,26,33,197,78,24,245,21,255,238,139,145,144,116,40,140, + 40,184,35,97,68,193,239,136,145,225,223,61,49,66,107,116,52,131,69,193,234,227,24,44,180,100,143,101,176,208,150,127,10,66,254,212,25,238,12,97, + 228,237,231,215,147,28,113,198,187,106,197,70,88,81,129,186,218,132,117,114,69,69,174,230,194,223,70,131,25,2,138,187,105,62,249,133,73,249,127,143, + 126,155,230,181,82,191,78,58,163,41,34,128,155,79,205,155,206,108,50,248,246,67,139,50,231,180,242,225,76,224,87,102,193,6,39,236,153,148,144,91, + 82,103,45,239,40,243,222,232,247,203,202,122,223,62,53,173,48,153,147,154,86,29,233,61,48,197,183,153,213,206,175,164,151,201,178,151,201,178,19,204, + 129,116,25,74,250,213,4,31,78,67,35,170,71,209,80,180,68,199,210,80,180,165,191,71,13,117,7,211,208,180,130,182,164,15,50,179,234,251,213,208, + 132,2,106,223,60,184,82,164,21,208,136,167,67,26,148,178,201,144,198,52,119,95,25,71,83,119,243,82,62,109,163,186,107,191,193,178,64,221,205,17, + 212,157,50,68,32,41,117,255,38,63,53,149,128,212,148,59,242,192,82,187,174,194,223,40,89,150,120,17,132,140,21,199,237,174,217,202,63,74,197,151, + 132,205,211,19,202,155,164,209,252,179,189,174,173,26,83,79,232,211,118,91,31,153,215,218,90,65,244,225,96,124,220,238,96,2,146,227,23,153,20,74, + 4,114,62,105,13,50,81,252,164,56,179,13,59,6,49,169,214,231,245,39,23,236,166,198,221,193,248,186,20,118,135,237,133,119,93,211,19,70,174,41, + 209,166,97,108,194,16,109,239,68,62,223,121,227,115,117,185,67,235,114,115,235,238,96,40,98,66,158,88,70,210,169,45,225,73,12,220,74,219,19,254, + 209,129,63,185,134,165,211,91,162,147,104,92,7,3,172,158,108,252,185,16,218,39,205,158,180,180,63,132,198,153,96,204,51,32,180,106,127,8,93,207, + 229,46,188,56,132,198,61,9,161,241,251,67,216,237,116,251,93,251,12,8,77,216,31,194,75,121,105,242,222,139,67,88,218,152,126,148,228,60,57,76, + 177,187,119,158,143,99,103,239,44,141,220,217,59,39,27,59,32,134,222,238,242,188,161,23,248,119,207,232,80,122,183,219,38,144,243,174,227,186,123,110, + 2,161,53,185,31,74,219,17,217,200,28,67,166,17,66,9,85,97,153,46,51,20,164,44,237,85,48,35,37,151,41,103,45,201,10,123,101,161,242,86, + 248,45,8,178,202,96,221,133,180,145,32,139,76,105,173,120,159,130,178,224,72,120,119,214,66,1,225,165,246,121,139,222,55,55,153,30,218,134,251,111, + 181,188,158,187,91,177,109,251,245,109,55,97,252,193,66,15,133,25,19,90,202,37,178,158,97,6,158,66,185,32,61,162,17,163,53,25,247,254,137,185, + 123,100,158,211,58,81,209,159,23,196,49,110,80,110,220,4,22,149,97,97,0,213,88,74,234,202,80,112,221,82,53,130,146,62,115,70,136,3,6,131, + 139,169,112,1,63,252,161,37,51,25,130,119,230,253,10,171,195,111,239,196,29,241,199,183,119,40,120,93,217,107,65,224,232,130,37,77,149,189,22,5, + 125,242,158,74,176,95,38,203,94,38,203,78,0,113,102,12,33,26,166,173,116,87,106,142,195,207,108,22,72,123,111,177,250,207,90,22,170,203,200,241, + 7,4,214,136,230,36,164,210,101,158,60,155,10,43,1,173,13,225,253,150,51,246,170,152,31,114,161,239,0,150,205,164,39,173,82,96,29,101,238,95, + 19,243,64,175,131,185,206,148,34,99,34,230,254,173,97,110,95,7,115,202,172,99,35,203,152,11,37,141,121,51,152,171,114,36,115,84,204,225,217,188, + 225,237,77,43,178,16,192,218,222,18,230,250,117,48,7,80,94,89,42,236,185,145,142,94,11,243,195,115,188,152,237,176,41,25,34,28,238,177,20,20, + 214,107,163,212,124,159,158,132,50,30,49,9,162,16,25,68,140,71,36,41,25,100,149,44,19,188,169,145,74,85,131,162,150,193,244,8,41,75,207,99, + 230,20,19,116,82,121,87,101,153,42,83,152,182,242,131,233,227,107,175,20,238,85,180,215,71,199,56,215,222,183,229,25,21,226,166,87,193,220,190,105, + 204,205,171,96,174,223,52,230,225,85,48,167,183,140,57,169,87,193,92,188,105,204,95,197,135,202,204,90,206,48,120,147,144,171,87,113,161,234,77,67, + 254,42,30,212,124,55,144,191,64,152,195,169,239,27,51,227,93,37,232,208,98,125,43,91,101,158,200,149,162,33,14,55,170,197,56,210,176,153,119,206, + 107,218,117,119,244,37,134,108,194,198,33,91,83,141,179,212,250,144,169,26,90,169,181,177,218,204,122,103,190,135,129,150,122,145,26,168,175,62,57,163, + 234,48,215,158,183,172,61,160,80,148,209,247,48,70,162,141,147,73,106,87,2,24,145,208,197,163,117,91,157,119,147,121,229,96,133,170,184,212,203,82, + 4,239,69,71,189,121,213,210,218,170,37,56,106,231,130,172,14,39,112,70,160,17,213,149,75,76,93,149,41,113,184,184,124,81,129,86,193,217,157,102, + 252,99,155,207,52,198,191,150,39,34,249,56,100,255,235,32,191,47,42,154,94,143,239,187,227,73,63,135,193,155,77,238,22,211,192,99,226,83,152,243, + 143,183,157,171,60,62,193,6,18,69,42,217,252,66,113,235,226,146,181,182,34,159,63,225,230,12,15,169,138,159,69,253,11,240,185,230,82,49,145,186, + 62,189,238,244,199,247,128,102,253,226,31,227,241,205,234,81,249,106,66,97,231,181,206,76,240,102,153,45,185,186,200,230,62,100,66,43,45,106,21,246, + 238,38,19,96,218,26,118,30,24,144,248,207,162,122,70,234,106,194,192,92,118,134,75,100,150,183,242,165,86,183,59,254,86,197,113,113,185,63,238,221, + 241,49,230,214,93,49,95,243,243,179,165,18,247,131,17,70,217,154,31,185,245,142,30,41,176,56,131,187,122,30,187,94,226,27,107,81,120,236,234,3, + 47,36,187,126,145,71,87,198,186,60,70,30,90,126,115,203,7,132,227,73,112,189,126,243,184,251,59,22,80,107,52,238,231,211,244,240,231,37,110,199, + 131,17,143,62,137,224,188,76,129,97,26,227,59,116,100,99,1,158,132,69,35,155,250,209,153,93,47,187,49,95,43,55,249,172,211,239,204,58,171,5, + 176,144,44,14,195,124,156,244,47,207,255,245,211,63,150,233,30,189,222,249,255,140,39,95,86,153,26,92,160,211,29,223,97,122,150,41,40,124,206,184, + 119,206,220,167,51,251,60,184,1,198,124,38,252,175,223,110,134,88,158,203,11,149,194,179,135,219,124,85,105,81,237,226,124,123,242,140,124,191,119,51, + 224,155,218,191,204,6,195,225,207,220,72,41,45,101,94,233,96,54,204,63,255,20,143,64,199,150,11,65,165,12,70,155,127,142,23,227,95,149,107,61, + 62,225,63,158,124,46,117,140,1,248,241,106,153,124,82,111,237,63,59,95,238,186,141,95,102,57,204,227,36,213,40,219,168,122,37,177,100,173,61,174, + 118,122,23,39,176,82,1,163,243,239,157,171,181,62,176,116,56,248,204,231,190,63,182,231,31,146,37,250,115,68,54,149,153,194,11,244,251,60,132,122, + 169,66,86,233,64,236,127,173,171,220,255,219,187,238,112,48,189,206,119,131,241,159,227,175,249,112,120,214,248,121,212,203,118,68,49,209,32,55,55,28, + 244,242,209,244,105,37,139,147,48,248,10,227,127,115,51,30,77,163,190,205,239,157,182,187,15,173,105,167,77,153,104,215,148,173,55,30,129,229,119,239, + 118,85,152,93,117,164,222,76,44,203,171,178,188,74,47,214,135,91,90,168,59,142,180,138,227,109,62,193,202,155,62,137,99,234,13,21,255,202,111,39, + 227,254,93,124,109,65,21,192,103,86,252,211,96,90,160,146,170,120,146,255,223,221,0,119,236,85,243,63,199,51,64,114,216,58,127,156,61,222,217,103, + 161,144,79,6,95,227,148,178,54,76,15,219,233,95,174,59,147,252,199,225,224,75,25,140,168,122,115,85,91,36,233,149,92,198,199,246,194,161,196,79, + 87,43,71,83,225,25,75,95,53,236,116,243,225,167,230,5,95,108,200,186,171,27,223,221,222,192,227,206,111,95,248,168,171,191,84,179,15,251,131,233, + 45,10,156,15,70,204,81,151,244,113,150,56,172,66,150,148,87,28,122,47,206,171,32,80,230,212,187,51,176,41,21,140,12,103,26,82,143,192,189,154, + 140,119,101,157,40,229,254,78,96,246,106,89,144,171,83,7,224,93,194,74,111,62,148,143,16,93,194,111,157,195,163,253,240,174,126,30,231,125,188,90, + 202,151,140,31,39,119,195,252,124,52,30,253,1,158,249,1,10,63,254,18,63,230,243,191,11,34,117,46,23,31,185,90,0,119,14,216,70,253,178,240, + 119,208,133,115,104,89,62,249,112,211,153,124,201,39,69,45,197,223,173,233,172,51,153,85,36,55,131,126,229,115,62,234,87,218,141,85,13,7,248,231, + 92,47,100,253,14,120,213,100,130,105,40,151,100,105,145,239,121,46,22,178,213,32,191,14,166,131,238,96,200,31,226,159,195,252,67,117,46,63,192,43, + 76,46,135,227,251,197,245,181,148,81,158,6,76,76,57,233,121,78,46,249,161,37,159,183,43,31,14,91,190,218,197,249,76,25,39,203,137,218,160,91, + 45,105,76,64,196,73,229,52,244,135,40,23,153,13,214,155,242,66,96,126,181,191,6,212,15,32,158,52,96,103,13,128,2,252,87,163,69,8,50,129, + 180,227,83,103,60,81,94,40,223,248,251,35,242,146,84,113,74,164,17,90,166,133,168,193,89,222,158,51,65,67,236,51,99,132,183,13,73,38,115,108, + 30,206,136,48,203,94,56,179,144,41,127,230,125,166,141,38,101,112,251,74,218,210,42,51,142,148,160,70,75,41,212,111,180,42,245,202,62,210,215,63, + 26,107,218,206,42,7,85,169,164,158,47,99,94,152,73,166,199,160,252,61,252,108,208,212,199,238,72,182,165,106,112,47,23,201,26,220,73,121,73,90, + 130,59,37,228,26,156,224,44,4,107,74,112,183,100,16,26,69,200,148,240,46,9,203,128,151,196,101,196,165,211,38,35,105,92,5,241,100,119,43,136, + 63,123,73,135,211,146,222,114,73,175,18,254,231,17,70,69,103,107,19,161,188,53,193,5,189,149,119,229,45,200,245,137,200,196,46,83,193,51,31,127, + 106,115,2,74,55,251,147,91,217,184,232,117,230,176,254,100,227,162,129,117,69,139,63,41,83,142,215,42,36,248,104,56,191,124,249,105,113,71,105,69, + 45,172,138,226,115,122,203,25,79,76,116,156,201,197,81,168,71,87,80,254,53,135,5,91,172,136,243,119,198,24,103,212,19,139,104,195,132,237,12,249, + 170,83,43,205,52,235,184,65,107,188,48,103,210,114,106,148,32,182,148,42,11,198,122,173,21,75,181,213,198,105,128,231,200,57,10,254,12,168,10,97, + 12,160,99,153,39,133,114,44,147,138,172,194,221,38,243,1,222,3,254,131,183,255,172,10,86,54,92,70,30,82,7,238,106,50,13,73,240,13,159,121, + 29,32,157,203,240,99,113,183,207,130,48,214,122,98,41,231,254,147,107,40,207,59,151,65,233,249,221,48,250,44,115,40,167,231,50,141,30,225,110,48, + 99,229,141,210,50,74,61,121,24,82,238,27,225,102,148,84,153,135,175,116,196,50,18,68,214,197,158,123,227,28,183,205,82,105,37,247,28,82,195,184, + 176,58,5,111,165,44,16,82,133,0,63,232,96,5,50,24,104,107,3,233,146,84,58,222,68,246,214,150,100,9,188,19,10,40,93,233,68,215,99,238, + 176,236,17,151,1,201,228,127,123,213,189,207,234,181,135,249,181,77,202,189,210,21,82,112,229,24,193,86,86,140,15,206,60,199,157,136,239,197,116,237, + 101,164,186,195,113,239,203,218,210,82,112,252,46,24,125,6,90,224,192,26,108,128,217,193,74,16,46,0,88,150,90,31,200,106,86,31,172,20,9,237, + 113,176,72,25,214,145,9,212,64,116,224,189,145,208,91,226,228,37,167,37,69,227,38,53,104,24,203,164,71,136,96,10,147,87,107,41,165,85,62,168, + 39,181,234,249,42,117,85,9,74,149,12,171,216,167,166,97,18,102,1,131,245,133,86,173,20,172,4,250,92,97,22,239,184,40,219,206,76,61,195,38, + 166,130,240,248,231,176,51,203,127,128,113,82,220,53,142,187,75,127,191,111,238,194,89,167,61,254,47,65,91,21,9,185,78,91,41,100,210,42,141,169, + 141,76,91,11,199,138,145,146,194,214,16,184,133,83,103,164,160,24,70,27,46,102,164,139,186,98,227,49,51,19,111,102,27,169,61,108,23,174,43,43, + 172,241,92,146,216,78,249,51,232,28,73,33,173,75,202,46,184,25,239,181,66,51,144,162,15,248,171,48,116,53,41,100,18,28,54,192,185,10,216,90, + 15,155,207,178,192,169,10,142,123,100,80,183,98,6,173,36,226,21,184,142,192,93,23,104,138,226,221,176,191,8,88,230,67,132,79,72,202,46,146,96, + 108,34,196,178,110,184,146,42,246,168,203,222,172,116,111,128,99,237,22,163,109,210,247,90,152,22,178,32,73,75,235,121,50,157,129,131,102,5,73,73, + 165,100,165,210,66,179,210,112,124,37,93,67,98,13,88,11,5,96,245,210,65,41,42,238,54,2,134,18,138,204,11,66,192,138,26,46,41,64,176,93, + 84,110,197,129,173,78,202,46,184,29,109,16,156,185,51,132,192,104,70,89,246,236,41,41,238,135,91,215,100,89,225,65,22,131,176,92,14,33,26,236, + 25,247,200,58,33,66,188,155,152,156,240,10,84,208,93,75,129,203,193,192,99,21,196,17,90,65,32,46,41,217,69,18,139,147,186,191,142,186,159,144, + 126,209,45,50,25,115,40,165,141,154,190,240,125,9,33,191,68,15,158,132,247,182,96,10,162,235,147,76,239,5,22,115,180,4,11,215,135,123,201,120, + 237,163,37,208,133,235,243,240,25,206,35,54,96,47,132,200,33,36,36,188,234,60,89,88,17,207,235,221,41,68,9,209,176,212,132,124,188,141,36,175, + 78,21,121,12,59,61,25,59,37,84,52,1,11,159,39,225,83,209,145,64,209,6,20,62,15,5,227,137,122,55,31,27,251,183,148,236,34,5,66,114, + 215,13,38,214,52,183,179,207,135,51,234,174,70,98,100,146,196,36,164,68,117,18,35,147,36,70,36,72,140,76,144,24,153,34,49,104,38,144,55,8, + 244,32,117,32,198,49,76,76,73,33,171,145,24,46,87,39,49,232,112,141,196,160,100,141,176,164,100,23,73,48,78,86,253,100,213,255,132,86,93,153, + 148,53,72,73,149,173,89,3,20,75,88,3,94,175,235,214,0,55,243,86,188,11,108,156,97,125,65,198,18,162,11,222,50,18,206,89,89,236,1,6, + 56,13,54,237,41,41,110,175,7,52,54,25,208,184,68,64,99,19,1,141,77,217,130,20,20,143,89,247,240,108,235,126,210,246,151,213,246,164,239,75, + 73,85,221,247,169,164,239,83,9,223,167,18,126,78,37,125,31,154,113,193,4,175,89,10,98,65,202,113,157,9,169,74,248,62,149,244,125,42,225,251, + 84,194,207,169,164,239,83,114,107,125,127,250,25,226,161,217,76,253,73,162,82,201,25,77,72,25,246,245,25,85,201,25,165,196,140,34,70,116,202,153, + 184,165,34,148,42,192,95,23,93,196,70,44,66,209,56,115,154,223,101,103,11,139,88,147,242,204,214,230,83,39,231,211,36,230,83,39,230,83,39,231, + 83,157,184,204,137,203,188,9,235,78,46,25,217,36,164,228,235,145,141,75,70,54,54,17,217,128,141,88,237,180,98,226,18,124,144,88,205,41,89,220, + 12,117,164,133,37,150,42,225,81,83,177,95,92,147,226,254,122,100,227,147,145,77,72,68,54,62,17,217,248,100,100,227,182,183,238,71,143,85,101,61, + 86,77,178,211,148,148,234,236,148,146,236,148,18,236,148,31,212,240,169,145,104,159,193,52,141,215,73,217,5,215,105,131,148,209,230,147,23,94,134,162, + 63,235,66,74,176,83,74,178,83,74,176,83,74,48,81,74,178,83,50,39,235,126,178,238,111,195,186,39,153,94,74,74,117,166,71,73,166,71,9,166, + 135,146,245,125,43,149,220,183,130,37,17,204,229,216,142,243,91,31,133,156,219,151,117,41,37,184,30,37,185,30,37,184,30,37,120,29,37,185,30,169, + 237,173,123,56,182,117,167,218,227,84,126,169,143,4,236,190,186,165,156,144,74,208,102,10,156,67,185,218,83,142,231,203,57,207,175,178,167,140,136,72, + 232,160,108,105,79,153,119,124,37,68,33,62,73,42,102,47,37,187,224,102,66,8,80,148,248,224,20,241,23,217,98,115,184,38,229,13,99,235,172,180, + 229,157,101,19,55,135,157,175,110,45,115,174,141,81,186,188,179,172,57,81,39,40,83,222,89,78,200,46,146,88,156,204,251,201,188,255,25,31,47,97, + 189,74,144,39,197,9,50,134,4,153,248,108,54,33,141,182,205,96,53,196,4,27,254,122,49,201,50,240,111,254,102,28,240,41,226,92,222,120,183,143, + 150,213,74,94,165,252,13,115,150,183,246,21,74,22,139,153,243,212,156,74,202,226,99,9,199,15,143,34,165,247,86,107,53,247,24,107,66,62,157,204, + 182,128,248,9,21,90,115,222,242,3,17,99,60,188,0,119,71,64,18,204,252,25,11,115,202,248,148,73,133,32,164,225,146,158,15,73,23,227,131,151, + 160,148,232,34,9,196,35,166,189,114,242,224,180,13,249,61,234,122,50,172,73,73,101,61,172,145,201,176,70,38,194,26,148,172,209,150,148,236,130,155, + 73,80,153,148,84,38,2,27,153,12,108,100,34,176,145,137,32,70,38,3,27,185,253,182,59,29,61,80,165,90,160,202,111,13,145,22,198,136,151,167, + 118,96,11,166,0,176,38,5,44,129,183,78,13,91,47,18,194,7,201,50,105,3,204,68,180,94,82,233,48,191,155,135,13,88,57,155,140,172,8,161, + 160,9,224,32,158,141,141,23,90,249,148,40,194,23,44,170,113,103,113,143,24,54,114,174,97,53,41,79,147,19,82,197,86,124,208,194,71,179,233,249, + 237,50,220,29,21,4,57,42,76,177,226,62,74,158,79,15,219,103,53,151,36,37,96,87,207,138,99,21,154,147,103,18,178,139,36,20,39,38,115,220, + 227,16,235,89,159,94,53,247,118,0,137,195,42,252,62,181,247,91,207,79,242,132,196,27,142,110,79,169,165,207,78,45,93,157,13,33,249,242,20,40, + 181,2,132,208,167,21,176,231,10,56,37,155,62,59,217,116,185,0,132,160,227,114,34,42,191,113,233,148,48,248,204,132,193,189,140,15,127,65,201,201, + 248,28,97,159,39,73,125,132,59,97,191,47,245,57,37,164,62,59,33,117,69,125,142,158,98,44,149,58,37,21,30,58,169,112,79,43,164,204,201,10, + 29,251,220,148,172,236,63,157,210,12,15,148,102,184,239,22,196,201,15,191,26,7,82,242,132,253,190,137,201,167,52,214,103,166,177,150,236,241,177,83, + 27,100,34,113,237,148,138,248,236,84,196,61,173,208,198,55,38,157,172,208,139,122,0,121,226,159,123,71,193,167,84,215,103,166,186,150,236,177,58,182, + 7,168,28,253,58,165,43,30,40,93,113,95,43,116,226,161,175,228,1,248,11,155,79,216,239,155,21,116,74,135,125,110,58,236,234,113,148,183,199,126, + 0,22,252,41,165,241,176,41,141,251,62,131,23,39,19,116,228,77,80,104,191,56,37,57,30,62,201,113,79,39,28,232,180,2,94,139,0,5,123,194, + 126,95,2,116,74,162,125,102,18,109,201,30,235,29,249,207,198,183,102,71,117,143,170,176,173,106,223,95,67,173,94,249,61,202,118,254,230,210,234,59, + 95,13,88,135,182,94,74,54,186,160,160,197,78,168,129,63,81,154,180,158,75,81,166,1,183,100,164,6,1,131,78,4,229,45,65,18,140,13,26,36, + 72,11,80,36,231,5,51,40,40,158,2,169,5,45,229,119,191,42,67,40,201,223,98,143,214,249,155,64,192,232,156,214,130,51,147,2,88,156,112,174, + 36,155,231,42,4,169,100,73,170,112,187,33,184,68,150,65,105,13,116,140,223,176,76,152,116,29,101,198,107,17,223,166,204,250,6,141,136,237,192,43, + 145,182,81,166,2,124,84,236,15,137,32,3,191,117,89,88,232,155,225,111,38,17,10,62,84,22,239,98,150,96,94,70,241,120,136,35,137,248,46,102, + 43,36,136,59,35,1,143,22,40,190,139,25,220,79,145,42,201,226,19,6,84,73,69,150,218,92,138,149,96,53,127,131,95,196,209,40,131,182,83,136, + 167,94,233,93,250,18,200,180,198,198,159,23,121,161,242,163,239,125,39,181,195,118,242,59,18,186,227,221,107,168,125,85,199,227,214,58,41,226,47,141, + 53,214,199,55,103,219,76,192,110,57,65,44,115,82,6,135,137,33,161,172,83,129,69,1,51,204,111,92,151,78,113,226,33,230,17,246,53,68,45,201, + 80,153,231,136,15,102,206,123,169,64,232,51,97,160,76,252,134,109,132,131,70,73,15,155,197,54,217,4,88,39,230,95,132,168,128,21,20,186,136,240, + 2,81,34,116,7,90,109,141,181,176,223,153,55,66,4,142,13,65,253,37,214,140,107,192,30,6,86,95,23,141,27,226,143,248,210,110,222,102,116,32, + 125,234,255,219,59,183,221,56,138,32,12,191,202,42,185,33,146,89,250,124,144,200,5,226,54,47,97,133,0,145,0,9,115,16,240,244,124,127,117,175, + 119,188,51,14,227,36,128,192,78,46,226,148,187,102,122,186,78,127,85,247,76,13,71,216,72,179,14,166,255,53,166,50,184,241,254,93,52,198,25,96, + 92,114,43,243,116,250,206,185,168,73,81,65,52,157,96,134,155,249,56,114,45,22,34,105,113,120,136,164,169,167,174,251,12,110,44,175,144,25,137,234, + 42,6,111,150,64,158,205,211,104,147,38,246,97,48,100,185,177,65,177,47,64,155,89,178,64,133,123,68,86,22,32,89,90,52,91,75,53,100,173,127, + 170,69,153,18,70,199,144,138,227,208,151,198,201,163,202,176,232,24,186,203,38,59,108,54,216,167,217,21,114,218,20,39,209,108,67,194,155,95,147,78, + 126,135,73,189,254,155,140,106,241,13,105,173,105,202,27,189,22,78,95,220,255,16,200,148,247,117,185,24,212,255,91,75,5,156,110,150,118,131,48,124, + 45,227,235,229,61,128,132,194,164,234,235,229,175,136,61,46,55,181,30,145,255,71,113,189,33,28,141,205,184,107,139,61,153,60,39,116,243,20,165,181, + 140,66,67,4,47,181,234,33,233,220,49,58,171,144,18,177,41,47,90,208,221,201,146,100,20,138,123,109,244,108,184,152,210,134,98,194,84,118,124,60, + 127,167,118,37,2,113,204,110,163,165,202,243,55,250,243,250,73,187,222,75,187,154,206,3,224,92,154,116,166,232,88,116,52,157,1,121,7,82,111,211, + 25,80,136,157,138,87,30,140,239,235,166,73,181,0,36,162,233,28,168,216,219,200,134,122,4,97,32,220,61,42,135,210,228,163,211,209,253,52,78,232, + 161,111,41,216,72,194,2,42,41,124,209,149,134,199,108,196,136,74,22,145,74,233,174,143,129,76,163,54,57,76,151,67,45,214,204,162,225,49,123,152, + 135,254,92,17,46,242,71,185,216,58,173,96,245,68,219,234,217,118,245,118,216,167,159,214,162,33,185,240,164,159,31,87,63,55,69,44,109,240,68,27, + 3,196,192,220,90,194,8,170,4,218,50,212,19,104,77,208,177,70,36,4,213,1,188,5,146,147,193,228,18,249,57,200,167,245,226,155,57,79,124,30, + 161,62,122,171,95,118,213,123,164,96,168,34,142,118,210,116,250,126,91,235,54,245,171,184,247,119,127,167,241,26,251,242,217,185,99,175,173,243,70,176, + 6,201,254,194,53,63,5,247,19,130,253,226,51,239,103,222,155,183,223,188,253,225,250,59,139,41,2,37,173,102,252,251,76,48,34,202,11,236,18,28, + 1,4,102,235,20,67,238,89,68,41,65,64,18,52,194,79,121,16,242,0,155,164,193,173,118,35,37,53,211,48,180,73,34,211,149,88,145,135,19,60, + 12,110,54,187,226,96,179,119,202,66,96,213,234,81,209,38,17,102,132,164,124,44,217,54,10,88,124,229,66,130,154,213,170,132,193,248,7,204,172,8, + 46,22,165,32,136,151,9,11,101,54,175,80,101,56,177,87,252,79,36,42,233,94,162,12,120,73,38,175,22,29,6,27,209,145,129,46,85,142,30,92, + 45,48,117,67,151,103,38,230,15,180,234,54,34,37,50,191,50,80,101,138,222,50,32,71,52,114,109,162,202,49,207,124,194,147,62,4,43,90,38,31, + 213,44,76,161,83,39,169,162,50,70,157,193,244,134,39,203,88,149,88,79,96,50,43,196,29,116,4,8,100,216,102,226,22,108,45,117,214,167,244,187, + 114,91,40,221,157,238,236,107,84,248,190,9,254,102,178,148,234,139,127,57,231,63,117,245,90,103,151,33,214,181,226,223,183,44,95,77,75,80,111,42, + 4,19,39,170,135,64,250,222,202,160,33,75,75,182,81,193,68,178,93,205,26,82,51,92,47,37,27,148,60,34,89,83,204,12,70,82,171,5,47,26, + 9,148,74,60,162,41,53,80,63,153,5,15,174,164,69,215,154,145,208,251,156,117,154,156,219,135,49,169,76,242,129,150,197,105,4,11,206,32,216,86, + 141,208,80,28,59,81,102,7,125,45,107,33,101,151,117,168,0,229,199,36,251,208,179,81,116,87,145,26,123,116,141,56,43,173,196,226,179,226,250,24, + 231,172,182,97,214,190,224,196,32,34,113,57,218,179,116,153,187,208,97,97,152,211,244,121,240,164,194,68,57,45,75,157,86,155,143,77,47,145,246,96, + 153,101,118,36,122,234,88,69,66,89,130,209,42,94,89,77,193,236,126,205,216,141,173,6,178,185,168,137,118,176,168,171,65,131,106,5,58,68,13,139, + 37,130,55,150,140,115,162,89,14,6,255,93,161,33,63,143,184,68,83,99,44,227,12,145,137,249,8,109,50,234,21,215,193,72,2,211,84,12,82,83, + 65,242,60,235,183,21,107,5,130,136,214,170,115,178,103,132,145,175,250,173,91,210,94,41,88,40,167,43,189,188,87,88,134,40,39,151,42,63,95,233, + 173,193,64,62,125,208,158,43,108,222,31,141,9,31,85,45,161,212,235,104,202,212,15,218,153,0,126,147,187,251,200,2,247,78,242,24,143,201,86,211, + 15,110,227,67,51,58,233,166,104,140,175,120,21,34,23,90,18,148,217,50,23,198,235,188,232,16,131,118,31,198,44,131,48,87,183,23,210,228,152,66, + 210,171,45,140,142,158,149,49,90,1,200,119,104,210,51,63,151,213,24,181,65,169,61,94,111,126,158,213,18,13,167,171,83,229,170,5,105,187,38,29, + 116,112,229,202,183,49,99,155,169,243,173,187,241,6,156,98,116,3,218,97,187,4,235,96,85,34,29,73,77,229,228,173,141,82,78,43,234,112,179,190, + 212,65,52,65,36,107,123,153,71,209,137,129,57,154,26,221,225,195,63,163,238,4,178,73,236,165,0,7,83,233,37,207,75,241,107,175,55,57,227,93, + 70,214,205,3,61,91,25,243,66,204,85,101,92,173,100,158,55,172,177,217,169,153,33,197,51,171,118,169,170,75,169,79,86,19,101,178,66,196,228,236, + 81,167,96,209,187,118,193,170,122,28,49,36,76,154,234,196,248,124,108,36,150,56,89,245,146,169,80,202,197,124,5,102,154,34,217,156,27,246,120,48, + 0,205,4,198,51,148,226,202,168,152,164,53,111,143,221,228,41,34,202,100,213,150,158,8,229,243,249,37,153,131,176,251,148,203,201,53,74,153,28,11, + 60,36,234,212,103,14,26,49,46,5,19,125,5,96,169,14,153,199,250,182,83,108,147,207,209,142,158,162,54,225,30,247,98,67,90,239,214,167,13,191, + 17,186,93,106,248,28,171,190,183,19,43,222,145,236,66,103,10,8,227,209,174,238,85,240,52,69,102,202,78,161,50,15,235,55,210,237,100,29,154,233, + 172,220,83,193,138,201,238,138,78,214,24,76,191,49,162,81,104,178,155,137,52,53,94,171,86,180,33,46,90,140,10,199,162,85,109,252,24,43,70,202, + 106,138,150,167,117,222,50,2,108,178,150,49,154,183,40,214,167,174,54,128,68,145,165,107,186,213,218,135,197,33,22,127,108,167,240,207,106,56,205,86, + 40,7,111,217,6,70,192,207,226,86,184,64,181,26,150,218,158,202,247,204,103,4,35,129,149,162,156,88,77,217,147,34,153,6,97,117,85,253,178,192, + 31,77,106,43,196,171,71,108,39,103,96,16,184,248,146,228,54,129,22,209,198,228,238,48,94,249,219,142,131,172,134,148,103,16,152,174,21,2,158,60, + 215,100,190,92,149,64,11,132,64,48,86,216,170,101,242,207,134,83,46,98,170,26,99,90,113,49,131,155,250,136,169,196,69,201,194,198,9,253,25,109, + 21,141,19,240,172,180,65,195,48,198,40,34,151,171,147,211,171,166,121,55,140,3,141,246,165,109,77,181,65,44,116,95,107,189,94,63,240,216,193,35, + 174,51,160,216,163,176,32,181,15,35,183,146,105,41,248,204,92,30,164,65,172,150,5,8,36,88,46,47,174,237,228,42,252,117,114,245,78,29,216,213, + 17,214,245,7,188,106,244,188,181,118,221,242,229,247,104,70,71,216,22,255,211,125,21,119,201,24,63,133,117,235,221,125,111,77,53,157,183,116,89,101, + 236,26,133,3,110,169,246,110,37,198,108,213,248,91,170,118,196,130,48,41,180,98,128,33,222,161,233,234,246,145,132,5,113,114,199,113,201,21,181,143, + 142,166,128,242,119,211,94,45,169,167,27,125,121,135,120,154,81,31,63,73,111,111,103,190,245,228,23,106,171,6,244,145,136,240,17,107,78,167,189,207, + 181,243,250,224,109,220,169,181,97,117,82,225,167,31,127,185,190,121,243,24,90,25,123,55,132,111,14,137,60,92,24,235,213,130,26,166,164,173,78,164, + 186,73,34,212,222,67,133,171,168,204,25,55,122,28,187,123,122,28,47,250,97,126,127,253,243,205,219,223,62,33,92,121,46,151,174,156,254,18,230,1, + 128,150,76,182,72,184,87,75,210,80,122,122,113,217,254,148,156,239,240,5,240,92,91,114,196,70,119,0,1,31,14,74,61,182,232,99,252,31,107,53, + 189,249,253,229,51,13,220,248,205,111,47,159,133,227,198,47,180,131,228,183,232,48,164,101,15,228,197,139,230,247,118,41,221,56,156,243,252,181,115,251, + 221,243,181,53,231,190,84,244,144,192,74,0,222,71,169,232,23,117,198,235,155,125,245,72,141,123,128,148,222,124,29,122,232,31,84,117,242,235,170,211, + 227,150,220,194,98,234,14,3,251,75,147,188,215,134,87,102,255,81,188,202,67,157,27,215,75,218,51,122,113,214,79,5,212,251,91,102,3,56,122,110, + 251,90,102,131,77,86,239,180,29,221,131,154,102,91,126,35,191,255,8,79,246,221,162,27,159,207,170,104,235,130,74,157,221,249,183,111,222,126,243,237, + 207,47,159,229,227,157,207,41,160,119,231,49,232,90,177,84,117,167,152,9,23,190,230,80,30,252,33,201,39,137,238,147,104,89,75,52,174,36,234,151, + 194,244,97,41,205,115,141,94,14,102,233,145,228,87,244,255,77,65,75,15,238,185,232,250,166,115,98,62,111,205,255,93,77,207,159,148,231,239,80,158, + 7,9,250,73,40,255,180,69,215,181,225,244,135,88,116,219,41,104,59,107,252,249,103,63,253,202,63,127,2,80,75,3,4,20,0,2,0,8,0,131, + 128,249,52,23,55,187,63,234,22,0,0,20,138,0,0,13,0,0,0,101,100,105,116,45,102,105,110,100,46,115,118,103,236,93,109,115,226,72,146,254, + 62,191,130,163,191,140,99,65,212,251,139,187,221,27,179,61,55,19,123,49,123,23,177,51,19,247,89,6,129,217,198,224,19,184,109,247,175,191,204,146, + 144,170,68,9,132,49,211,179,14,67,116,180,72,149,234,37,243,169,204,172,84,86,249,195,95,31,111,23,189,47,89,190,158,175,150,87,125,154,144,126, + 47,91,142,87,147,249,114,118,213,255,253,183,159,134,166,223,91,111,210,229,36,93,172,150,217,85,127,185,234,255,245,227,119,31,254,99,56,236,125,202, + 179,116,147,77,122,15,243,205,77,239,239,203,207,235,113,122,151,245,190,191,217,108,238,46,71,163,135,135,135,100,94,18,147,85,62,27,93,244,134,67, + 120,114,253,101,246,93,175,215,131,102,151,235,203,201,248,170,95,150,191,187,207,23,174,220,100,60,202,22,217,109,182,220,172,71,52,161,163,126,93,124, + 92,23,127,200,174,147,60,91,175,238,243,113,81,253,120,236,151,204,39,211,186,40,244,228,129,187,66,212,90,59,34,108,196,216,16,74,12,215,79,203, + 77,250,56,92,174,223,121,143,66,7,99,143,50,66,200,8,238,213,37,187,149,186,124,92,0,27,90,59,227,238,250,173,3,235,239,224,95,245,192,150, + 144,20,99,157,194,147,89,178,204,54,163,31,127,251,177,186,57,36,201,100,51,241,170,217,114,62,104,55,16,199,50,189,205,214,119,233,56,91,143,182, + 116,247,252,246,199,101,246,120,183,202,55,195,167,201,29,116,198,146,132,184,79,180,204,99,135,50,211,249,34,195,54,175,250,163,155,213,109,54,90,111, + 178,47,217,114,148,77,230,120,111,57,25,10,147,220,45,11,198,109,135,117,57,89,141,139,103,170,98,201,150,185,126,153,235,116,93,213,251,175,249,237, + 109,58,30,173,243,241,104,252,101,61,2,232,206,86,195,249,120,181,28,110,110,50,108,119,156,46,210,235,69,54,74,199,27,192,252,58,236,108,53,19, + 72,34,248,95,38,208,197,69,216,154,87,128,179,226,217,201,85,31,58,197,132,117,63,111,178,249,236,102,115,213,135,225,20,220,184,123,116,244,135,249, + 100,115,19,146,63,2,253,195,36,155,174,241,126,81,17,254,226,238,6,220,202,211,201,60,93,252,140,255,193,108,40,10,121,125,29,175,22,139,108,12, + 77,165,139,135,244,169,24,8,126,28,164,46,111,242,12,166,192,59,184,206,210,124,91,135,36,138,84,229,176,189,176,9,73,56,173,110,207,74,226,239, + 203,249,6,176,126,191,206,242,95,17,47,255,179,252,125,157,237,148,250,45,79,151,107,0,231,237,85,255,54,221,228,243,199,239,135,44,209,90,112,99, + 7,4,190,52,177,202,106,162,6,148,2,93,49,62,24,26,205,18,99,164,184,168,42,27,63,94,245,21,145,137,166,130,217,154,250,132,108,83,137,18, + 218,212,212,105,180,236,52,90,54,7,205,70,117,2,37,141,234,247,70,37,123,67,214,116,102,47,178,45,194,213,143,229,253,15,235,205,234,110,91,22, + 128,179,121,90,0,54,145,56,132,26,87,249,229,245,34,29,127,126,239,8,43,224,231,124,243,116,73,223,247,235,39,86,211,233,58,131,102,137,71,115, + 24,131,39,160,37,86,13,224,121,109,145,88,91,52,222,150,168,153,53,10,135,252,237,16,234,9,251,84,132,198,1,58,164,198,210,68,241,63,47,66, + 35,0,20,166,255,226,160,136,3,80,146,118,0,122,165,84,172,194,68,246,143,159,25,127,24,220,37,59,4,247,103,106,140,189,112,7,201,237,19,44, + 211,127,0,220,89,66,181,141,193,253,145,94,245,57,1,170,212,180,150,221,19,82,85,19,194,143,44,90,150,225,36,176,9,2,71,159,65,247,10,41, + 88,119,232,191,43,108,239,51,181,47,180,37,142,129,99,180,181,206,128,132,214,212,51,1,185,195,37,42,149,106,101,211,182,65,44,36,162,211,150,120, + 126,93,235,96,167,238,211,96,237,246,209,247,135,149,6,54,31,211,26,180,99,243,6,191,7,155,63,206,144,65,215,210,249,44,159,240,192,0,48,146, + 192,156,161,129,250,87,34,145,74,7,10,93,38,76,234,192,26,52,31,156,70,30,220,63,203,91,120,24,67,109,132,71,63,17,252,246,99,188,151,154, + 183,139,232,72,81,216,20,191,173,162,136,55,47,61,17,133,210,232,38,34,118,80,68,148,34,171,141,104,202,72,29,148,209,206,147,223,74,72,74,125, + 83,33,41,115,72,72,93,21,18,83,246,144,58,98,154,60,95,25,165,28,191,207,87,70,76,211,231,171,34,49,198,239,115,85,81,103,22,202,195,44, + 84,39,176,112,154,226,247,4,22,170,19,88,120,237,62,47,172,205,79,240,211,16,175,237,171,18,48,93,158,22,57,213,79,35,224,154,25,166,249,96, + 43,168,250,2,88,192,153,86,122,192,19,46,185,148,88,70,9,37,132,14,151,40,38,49,76,8,106,73,160,0,121,162,165,162,204,200,64,225,237,150, + 157,70,203,130,182,228,26,168,84,211,218,84,156,131,213,242,16,171,205,233,172,198,40,80,230,56,77,132,229,200,87,65,41,103,33,23,57,135,251,202, + 55,206,142,139,176,162,227,202,210,208,108,236,150,157,70,203,2,23,97,241,167,137,17,222,66,234,12,92,44,60,190,189,124,84,230,207,5,89,42,184, + 179,112,62,179,117,194,20,44,50,148,110,64,182,89,118,26,45,139,144,133,178,210,40,43,15,49,123,215,25,136,25,254,105,87,223,34,230,132,236,227, + 31,99,176,26,139,241,175,186,37,18,69,185,100,22,24,105,181,53,196,92,28,41,190,93,16,48,102,120,28,76,13,151,170,21,137,221,152,170,247,122, + 188,211,142,46,245,191,11,75,229,30,150,242,147,89,122,138,82,112,139,229,246,190,195,109,19,114,91,36,156,128,8,100,24,233,98,9,209,192,174,80, + 128,59,69,167,177,162,24,231,146,96,112,168,164,162,131,16,105,68,118,181,16,141,0,205,90,83,56,92,1,56,58,11,241,232,48,155,16,130,28,114, + 185,160,12,235,31,237,243,235,9,126,79,9,125,189,187,166,248,237,224,207,123,209,184,93,87,204,27,134,57,236,226,65,41,241,124,31,79,25,252,158, + 219,77,22,128,234,195,66,107,137,87,118,26,135,102,118,58,110,4,62,0,157,68,27,193,169,120,223,133,141,158,75,115,52,27,227,205,43,173,192,165, + 147,47,201,71,48,172,7,7,226,185,201,157,193,31,13,28,117,98,219,41,139,180,88,171,32,53,81,240,237,5,217,166,245,97,157,127,120,164,207,224, + 107,75,172,179,3,95,13,61,16,163,236,30,235,124,169,197,46,7,103,175,187,50,108,129,84,183,48,47,180,213,65,247,49,174,69,87,173,218,29,126, + 128,61,64,32,59,78,245,31,136,188,118,155,34,222,184,200,139,73,205,136,99,164,102,82,252,30,101,194,246,140,195,236,179,96,177,168,141,193,239,75, + 113,209,72,242,199,71,41,66,101,19,89,243,189,224,219,164,253,174,25,215,176,32,28,12,49,182,64,137,50,217,16,28,53,102,18,11,75,65,115,209, + 244,49,41,39,132,154,112,145,173,97,69,169,45,99,77,39,179,81,118,26,45,139,94,166,74,36,51,138,177,147,223,57,237,11,85,32,190,247,189,117, + 57,250,101,53,190,112,99,58,1,109,199,5,13,94,184,49,24,144,33,204,170,240,133,27,77,56,151,214,123,111,243,228,94,195,37,82,106,173,207,58, + 120,231,13,239,27,252,11,230,146,224,40,133,180,241,248,2,179,148,89,54,24,42,88,196,113,35,224,74,39,66,17,37,77,243,69,102,162,164,98,146, + 132,47,50,69,210,152,197,142,175,28,116,177,209,126,217,130,219,4,43,32,103,5,21,87,251,65,197,249,51,64,69,13,240,137,41,205,131,193,83,158, + 40,194,168,183,160,198,193,83,141,70,204,88,30,12,158,201,68,11,142,30,222,57,87,168,232,173,239,211,96,252,88,13,134,58,6,7,47,136,109,100, + 108,48,154,24,10,139,211,48,182,180,91,118,26,45,139,129,60,88,242,130,158,151,244,188,28,81,251,117,58,127,201,132,24,9,3,87,28,103,144,6, + 73,19,146,13,153,24,12,93,14,139,16,220,253,98,9,147,160,212,129,12,136,32,210,106,137,57,4,137,21,148,144,80,181,195,74,95,80,193,117,35, + 84,198,19,92,26,145,48,126,176,91,118,26,45,11,108,87,229,52,222,206,194,15,35,204,154,115,87,85,154,30,102,13,78,190,204,179,135,239,66,1, + 60,204,151,147,213,195,16,163,133,91,182,53,239,97,124,177,90,143,53,111,110,179,251,76,165,135,155,37,202,60,63,74,232,78,137,201,106,124,143,121, + 173,195,251,66,62,101,102,160,87,98,150,207,39,195,235,235,21,244,97,147,223,111,69,182,190,89,61,224,157,128,88,99,234,62,207,177,210,69,250,148, + 1,119,220,127,59,77,59,198,139,196,26,98,5,223,185,249,232,102,183,229,70,147,157,129,127,93,173,110,107,231,191,34,223,165,179,108,125,147,194,136, + 225,217,216,205,210,133,114,78,90,121,255,122,149,79,178,220,187,193,164,176,132,86,172,44,238,59,119,12,166,129,114,159,242,22,214,184,189,81,184,187, + 253,58,105,18,211,63,155,93,64,158,249,125,156,166,139,42,228,243,225,54,219,164,147,116,147,214,85,108,41,162,202,189,156,76,47,255,249,227,79,149, + 251,56,30,95,254,239,42,255,92,123,122,88,32,189,94,221,3,24,42,23,23,211,57,199,151,56,165,210,205,199,249,45,52,143,185,192,127,121,188,93, + 0,70,171,27,65,225,205,211,93,86,87,90,84,187,205,107,142,230,70,79,198,183,115,124,104,244,235,102,190,88,252,29,27,241,220,220,178,210,249,102, + 145,125,252,207,201,124,211,251,9,80,233,26,47,104,65,177,245,253,245,191,64,27,125,244,218,119,227,254,91,58,243,105,37,117,49,255,136,89,184,31, + 70,229,143,104,137,169,107,110,95,137,197,106,156,110,178,253,101,214,160,255,198,55,177,50,5,45,232,160,27,221,206,80,80,96,139,249,56,91,174,15, + 179,119,140,137,236,243,47,0,176,219,219,213,114,237,56,93,62,187,30,93,63,13,215,233,136,37,100,180,195,102,247,220,42,15,250,7,205,254,48,171, + 124,252,93,161,252,234,210,158,123,63,167,121,14,98,140,73,6,71,180,91,139,43,185,211,160,147,162,27,204,78,223,86,75,80,233,215,247,199,246,239, + 191,210,207,247,215,61,232,37,24,161,252,216,238,237,182,233,202,226,196,241,39,210,47,77,185,120,115,169,155,72,10,121,132,210,190,203,114,152,25,235, + 131,210,142,237,28,248,103,118,151,175,38,247,46,35,60,20,243,137,21,255,56,95,23,44,137,85,156,103,255,119,63,135,39,158,85,243,127,175,54,192, + 143,151,173,243,135,77,123,103,79,226,66,150,207,191,56,121,34,20,214,47,219,233,95,111,210,60,251,97,49,255,236,51,195,225,174,196,89,149,176,82, + 171,244,15,163,173,194,119,191,102,59,102,120,117,127,119,187,154,100,165,57,245,108,77,220,188,46,210,235,108,113,213,255,213,25,155,173,9,153,125,23, + 6,27,38,243,245,29,60,126,57,95,162,135,23,248,116,51,73,188,229,235,38,226,152,81,37,97,57,9,14,88,153,189,41,140,212,206,33,27,8,240, + 145,136,86,3,193,18,101,192,27,188,168,35,46,57,168,196,154,167,96,114,135,84,194,34,8,150,230,126,34,238,163,163,75,139,126,29,247,232,213,78, + 6,13,142,174,212,212,143,81,111,189,28,206,45,166,74,203,70,8,4,27,22,84,243,221,24,88,29,235,18,132,17,69,141,124,239,231,238,78,193,166, + 93,130,181,251,254,221,110,34,236,133,187,235,197,243,220,207,252,126,145,93,46,87,203,175,224,89,188,135,201,182,250,236,126,102,229,117,225,143,93,210, + 237,79,172,22,68,118,9,18,94,78,124,226,191,86,243,229,37,32,60,203,223,223,166,249,231,44,47,106,41,174,135,235,77,154,111,2,202,237,124,18, + 252,206,150,147,160,93,87,213,98,14,255,93,138,45,109,146,130,59,146,231,128,1,191,36,82,139,152,210,37,217,210,234,65,126,153,175,231,215,243,5, + 254,112,151,139,236,125,8,164,247,171,47,89,62,93,172,30,182,247,253,105,112,151,110,110,60,25,84,238,49,96,27,157,8,112,66,199,240,105,72,15, + 31,130,101,141,47,111,160,254,163,55,100,20,164,13,203,98,204,26,70,32,25,194,77,239,83,11,221,163,114,166,193,103,39,130,198,137,80,131,86,176, + 224,128,21,190,0,178,73,164,36,70,245,40,174,56,13,21,106,192,24,192,197,16,45,183,52,110,6,198,36,248,58,147,75,120,188,166,14,97,54,72, + 205,56,97,189,33,172,225,149,148,130,123,189,82,45,125,253,218,59,1,169,187,59,20,222,144,122,50,82,79,148,1,167,111,50,232,40,131,230,36,175, + 76,65,99,146,71,233,30,213,155,228,49,34,214,160,9,24,50,166,164,55,201,135,248,198,3,138,48,233,205,114,143,232,79,115,143,236,207,115,170,133, + 76,24,149,58,152,231,209,238,6,243,188,86,117,129,105,107,85,146,117,56,127,86,248,16,51,223,121,216,103,228,15,58,22,13,63,226,111,222,130,118, + 235,115,208,106,101,234,25,245,178,209,240,21,92,219,172,112,169,115,205,105,81,189,224,104,157,30,45,53,169,139,198,156,169,106,234,52,119,2,170,143, + 254,102,53,62,222,155,247,118,71,113,218,100,220,51,123,174,97,221,250,185,125,242,108,157,30,12,199,213,33,172,210,75,226,34,193,80,178,23,98,174, + 92,43,146,88,70,132,173,99,158,143,46,190,69,184,148,172,6,165,203,199,116,73,115,94,78,95,142,33,157,132,10,152,19,254,158,177,110,240,112,195, + 125,25,36,40,243,134,132,40,18,148,151,125,189,69,2,238,193,146,198,11,35,111,145,192,49,130,170,184,9,144,0,186,19,42,145,60,64,130,72,164, + 225,182,137,4,82,34,193,203,181,203,31,3,114,133,144,89,100,157,225,46,23,233,6,115,98,139,236,204,193,144,39,218,26,203,113,145,113,17,174,86, + 24,230,230,87,150,123,22,170,212,25,245,95,12,85,32,116,176,219,190,170,62,22,121,239,66,105,199,80,226,181,184,121,102,50,160,85,154,24,10,23, + 76,8,171,217,133,31,96,136,7,246,91,98,242,97,14,152,159,185,72,172,13,239,120,185,163,36,184,179,205,71,109,140,205,79,151,108,86,54,109,173, + 172,219,126,149,200,123,242,182,92,137,174,123,87,130,13,36,34,216,62,119,160,53,122,184,53,161,241,219,222,154,10,3,13,209,29,43,17,223,211,107, + 171,242,15,131,70,156,159,196,120,34,152,113,111,32,221,91,10,184,2,23,197,167,202,132,8,14,84,124,119,180,165,225,166,73,6,52,88,132,24,41, + 67,26,172,99,116,98,12,109,148,84,9,51,172,174,177,73,171,219,246,169,48,167,172,194,146,88,99,65,35,54,1,84,135,109,87,180,79,126,47,43, + 170,63,26,172,177,73,219,182,29,184,85,181,99,69,195,36,194,163,103,145,36,71,204,162,50,91,152,176,216,44,210,71,206,162,120,101,127,146,89,36, + 217,31,57,139,164,248,99,102,145,42,193,20,206,34,85,78,34,127,22,185,157,199,142,86,35,185,166,249,179,200,43,89,205,141,186,70,143,230,181,237, + 81,203,73,228,207,34,89,78,13,191,237,154,230,207,162,154,234,141,166,156,68,36,58,238,214,89,36,131,93,127,163,217,254,53,115,155,251,143,201,254, + 23,221,86,193,7,236,171,147,156,77,172,133,149,19,177,3,6,151,176,206,98,10,198,95,83,57,174,217,165,228,4,104,138,105,240,81,41,210,180,6, + 238,74,160,193,170,13,174,124,218,167,158,73,52,35,70,24,238,81,77,185,109,132,149,53,114,66,61,154,223,118,64,21,214,192,220,118,53,82,162,13, + 65,26,229,84,90,237,181,93,211,62,121,189,244,75,122,99,20,214,82,198,162,227,142,46,43,113,83,43,57,24,225,216,35,45,121,22,105,81,88,80, + 43,77,117,40,45,124,129,207,96,133,236,75,11,16,206,12,40,65,95,90,53,205,151,86,77,173,101,80,215,24,208,170,182,3,42,161,28,26,240,164, + 5,51,174,112,67,253,182,43,154,47,45,191,164,55,26,168,17,92,184,232,184,91,165,165,155,75,252,134,208,124,145,237,46,160,0,177,114,199,143,197, + 151,125,171,201,164,197,143,45,214,75,176,6,52,160,74,56,221,9,59,93,223,111,54,45,81,167,14,235,165,186,99,132,106,41,184,241,82,107,28,40, + 192,166,75,130,81,148,129,4,116,11,166,149,234,253,226,81,5,40,41,66,76,99,235,99,193,45,165,107,219,24,143,152,212,204,124,97,30,86,233,174, + 93,214,156,47,197,66,88,165,43,109,188,148,182,130,131,172,76,247,5,14,18,70,36,149,2,57,88,81,241,221,12,55,140,153,40,7,69,55,14,54, + 2,77,157,223,82,201,150,232,210,63,210,217,114,62,125,154,47,103,189,159,23,233,122,155,133,20,15,96,237,89,51,214,123,255,8,124,105,124,239,95, + 113,193,18,174,184,98,166,186,181,179,160,148,188,237,181,85,123,16,227,157,189,198,111,19,66,18,237,174,150,246,168,136,239,55,140,89,224,182,37,106, + 52,229,220,124,179,168,69,16,183,48,106,247,77,31,99,69,247,69,228,5,97,44,17,186,72,233,114,84,223,137,6,223,218,70,74,151,161,10,152,63, + 74,88,255,173,97,17,218,32,74,114,75,140,167,160,223,80,242,237,81,98,206,137,18,74,147,55,148,188,2,148,88,114,86,148,240,55,148,188,10,148, + 176,179,162,68,190,161,228,85,160,68,156,21,37,250,13,37,175,2,37,103,245,94,169,125,67,201,171,64,201,89,189,87,246,230,189,190,6,148,104,114, + 86,239,149,189,121,175,175,2,37,60,226,189,218,196,98,223,37,63,2,37,34,177,248,105,162,164,213,123,37,202,48,34,24,183,111,48,249,183,128,201, + 11,57,38,45,48,121,115,76,94,7,74,204,57,81,194,223,28,147,87,129,18,65,206,138,146,55,199,228,117,160,132,157,21,37,111,97,181,215,129,146, + 72,88,13,143,99,128,190,211,23,64,73,123,88,141,40,98,165,100,29,80,82,231,99,204,130,247,198,84,235,125,219,38,73,162,160,42,173,163,105,191, + 229,45,24,169,53,74,72,76,36,129,70,185,244,246,79,182,236,158,195,23,244,87,253,52,31,239,219,52,70,53,165,140,89,243,190,235,230,140,221,13, + 142,145,188,232,70,46,196,201,200,62,207,22,38,186,101,115,247,173,76,135,19,250,79,218,218,180,77,187,16,66,203,216,94,159,248,73,84,126,129,232, + 65,83,94,1,196,116,125,232,84,172,128,219,197,97,57,103,38,152,86,46,145,68,224,217,68,0,67,210,171,26,233,253,208,171,234,235,85,15,246,72, + 143,194,183,167,19,133,41,78,74,13,58,62,16,107,225,235,222,164,121,154,8,161,4,143,39,118,72,252,235,117,100,48,4,81,91,45,36,238,178,114, + 135,131,43,115,113,228,254,211,245,122,60,30,151,255,190,194,39,34,53,102,196,14,199,168,193,20,48,169,240,240,94,119,26,180,192,93,106,20,183,144, + 25,193,125,42,199,228,77,13,107,229,129,77,180,128,113,75,235,209,92,110,39,76,123,204,73,171,169,76,37,196,37,152,249,53,50,220,234,76,165,241, + 219,174,104,159,122,96,89,41,209,148,9,143,10,139,119,170,141,212,100,0,158,55,19,70,43,217,99,192,40,226,142,172,130,53,27,227,68,82,220,29, + 7,84,97,165,165,18,243,28,25,215,220,50,164,41,198,153,212,238,105,16,159,182,61,134,27,226,52,238,106,5,26,136,0,174,122,191,244,184,77,4, + 3,29,66,6,2,101,163,141,192,241,56,153,131,29,118,155,195,165,177,84,203,30,94,17,99,97,140,112,37,96,104,68,245,112,51,157,33,156,186,167, + 161,26,110,44,62,141,123,237,168,226,102,0,181,91,67,173,166,72,131,238,50,28,185,73,40,3,20,105,124,154,105,24,36,71,40,18,169,164,181,216, + 35,150,112,202,53,148,132,81,72,102,169,65,30,65,159,149,96,76,56,14,91,33,45,1,89,144,196,48,232,18,69,154,214,156,81,71,35,96,212,185, + 163,25,128,173,82,197,211,214,10,134,84,145,112,112,130,133,232,129,175,202,53,30,90,56,96,120,74,152,86,138,123,180,64,186,21,181,198,1,182,168, + 148,178,62,94,98,200,250,218,115,136,147,0,123,41,6,208,184,194,179,198,156,220,84,66,45,21,148,123,84,232,39,32,70,51,11,45,225,233,227,48, + 0,143,134,25,139,10,92,36,94,140,168,164,66,61,156,43,197,84,175,192,30,225,46,135,214,74,152,197,198,107,187,166,125,194,84,61,38,44,33,210, + 163,74,0,10,232,48,162,6,128,61,208,118,212,42,143,230,183,93,83,109,162,52,112,83,81,172,17,83,58,169,173,70,67,162,227,222,183,97,186,86, + 217,49,39,110,50,198,239,209,150,46,114,38,0,30,175,215,216,122,134,235,22,105,192,167,121,179,126,221,55,87,159,69,94,237,158,137,120,147,77,22, + 51,102,132,89,156,200,48,255,112,247,39,45,141,25,104,57,229,83,193,68,81,80,123,196,160,18,35,154,107,235,211,80,221,105,176,250,182,48,102,37, + 21,21,10,55,168,238,188,26,25,58,192,204,112,191,237,138,230,140,25,177,160,43,141,71,117,198,12,140,7,115,230,72,43,65,85,97,204,164,85,46, + 193,158,57,115,177,53,102,214,82,167,194,152,2,55,93,20,198,76,43,93,60,109,185,52,210,25,51,240,189,133,198,86,8,35,194,136,210,152,129,163, + 162,185,51,102,218,40,75,11,99,6,102,83,148,39,157,72,46,160,71,104,204,80,157,73,103,224,192,46,129,10,3,115,164,184,226,160,214,208,152,105, + 201,156,242,7,195,5,14,57,177,122,0,245,16,14,230,138,57,99,166,209,204,59,99,6,38,12,188,37,120,26,253,38,77,209,152,81,194,9,227,165, + 49,131,15,30,69,1,198,12,15,72,150,165,49,195,179,55,29,135,193,118,43,148,15,24,51,48,55,133,129,211,232,111,49,103,204,64,13,131,129,196, + 114,184,172,114,230,8,70,12,22,84,203,194,152,89,161,153,51,81,160,199,209,104,162,49,195,63,156,225,209,2,233,86,212,26,7,206,152,25,46,124, + 188,196,144,181,53,102,96,100,96,68,10,4,4,253,21,78,234,34,49,176,58,5,85,191,165,130,140,240,85,6,122,142,3,48,14,28,132,206,3,26, + 166,223,203,242,233,138,202,192,253,100,138,67,91,117,141,24,160,102,133,145,169,218,174,105,120,136,7,24,51,105,193,221,168,169,248,23,49,13,3,46, + 120,53,214,52,191,237,45,213,120,189,172,107,172,199,24,27,119,116,67,128,16,156,188,140,10,141,154,174,221,3,42,222,86,123,47,171,83,65,139,72, + 220,89,37,10,45,2,158,40,110,208,226,136,45,195,113,59,145,77,56,17,146,112,212,44,232,71,115,208,3,206,29,100,202,160,30,32,150,18,116,189, + 113,30,91,238,102,124,140,234,116,3,129,218,157,110,224,20,180,88,148,230,230,7,55,224,134,59,151,88,104,33,172,65,13,8,64,7,231,24,81,143, + 103,84,48,130,52,9,62,184,59,35,7,183,34,129,94,43,180,226,206,120,218,144,219,229,60,139,113,135,117,90,135,72,199,94,232,119,59,102,160,139, + 171,199,249,206,41,3,140,192,234,84,188,65,191,37,208,17,236,158,13,2,29,187,231,251,54,2,29,197,222,45,198,121,107,160,3,255,96,150,145,193, + 170,60,8,116,196,10,20,27,62,13,6,108,193,9,233,85,141,96,220,98,91,220,187,42,227,22,10,150,187,12,140,189,30,116,124,32,214,194,161,64, + 7,115,75,234,248,233,210,197,173,33,110,216,148,232,1,12,21,250,10,4,0,121,48,136,237,29,95,132,225,0,73,236,139,77,146,150,93,80,120,250, + 148,228,246,109,78,196,98,221,160,112,101,36,212,109,17,64,34,200,162,168,206,103,73,192,129,22,218,240,48,212,13,6,131,107,112,207,116,24,234,198, + 195,54,136,81,68,138,70,172,27,15,19,7,27,192,84,35,212,205,192,87,212,220,242,67,135,87,128,19,107,13,254,165,35,133,97,26,61,24,226,33, + 29,198,18,6,36,173,8,56,133,187,208,189,56,77,189,119,141,90,243,103,68,173,223,129,105,44,254,58,103,232,202,104,33,149,149,127,58,236,158,130, + 210,184,102,102,251,52,51,254,9,43,186,71,51,3,28,153,109,13,65,215,103,146,183,104,230,88,129,66,51,203,196,252,127,123,87,146,194,48,12,3, + 239,125,69,30,80,130,181,88,142,160,244,255,207,234,140,27,130,41,110,155,75,111,189,25,37,194,11,178,208,140,45,57,1,130,98,57,58,129,163,61, + 126,31,90,187,163,101,210,111,65,28,82,174,39,21,102,61,124,243,204,6,195,23,159,122,230,253,19,252,177,34,138,103,241,63,214,184,223,178,126,164, + 160,95,61,51,240,18,212,235,249,115,26,203,127,228,254,115,54,132,55,116,129,234,219,202,35,142,236,156,2,208,92,122,154,142,210,109,109,198,231,122, + 132,168,47,196,162,155,221,33,11,62,63,162,189,248,220,32,133,93,178,130,125,48,181,188,106,180,218,19,216,91,201,2,252,143,70,203,234,204,89,229, + 201,134,136,251,147,104,45,38,8,38,136,203,29,176,188,54,142,199,130,181,131,40,107,206,247,47,23,49,168,3,56,142,50,104,39,169,110,13,29,164, + 196,197,205,176,217,251,40,183,42,136,230,177,63,20,129,140,96,60,176,203,146,145,157,75,177,149,1,144,231,21,115,32,231,2,116,194,251,197,78,38, + 103,88,139,217,170,189,193,7,161,211,98,118,55,86,43,191,95,30,80,75,3,4,20,0,2,0,8,0,141,128,249,52,100,188,189,164,140,9,0,0, + 25,36,0,0,13,0,0,0,101,100,105,116,45,117,110,100,111,46,115,118,103,221,89,89,147,219,184,17,126,247,175,96,228,23,187,86,4,113,17,36, + 52,199,150,227,201,166,54,229,36,85,107,187,242,152,162,72,72,162,135,34,21,144,26,73,254,245,105,128,20,143,17,53,135,199,187,78,69,83,83,35, + 52,26,221,192,215,7,186,49,151,63,239,215,153,115,167,116,153,22,249,213,132,32,60,113,84,30,23,73,154,47,175,38,159,63,253,226,134,19,167,172, + 162,60,137,178,34,87,87,147,188,152,252,124,253,234,242,79,174,235,188,215,42,170,84,226,236,210,106,229,252,154,223,150,113,180,81,206,155,85,85,109, + 102,158,183,219,237,80,218,16,81,161,151,222,91,199,117,97,101,121,183,124,229,56,14,168,205,203,89,18,95,77,26,254,205,86,103,150,47,137,61,149, + 169,181,202,171,210,35,136,120,147,142,61,238,216,119,106,142,180,42,139,173,142,107,241,113,220,231,212,201,162,99,133,157,236,152,101,34,82,74,15,83, + 143,82,23,56,220,242,144,87,209,222,205,203,215,189,165,176,193,177,165,20,99,236,193,92,199,249,52,174,217,62,3,24,206,110,198,206,246,181,3,244, + 27,248,109,23,180,24,214,103,93,192,74,133,114,85,121,55,159,110,188,35,183,139,81,82,37,61,49,199,85,3,189,3,115,228,209,90,149,155,40,86, + 101,171,194,174,63,14,102,106,191,41,116,229,30,146,13,108,70,98,132,237,103,148,103,255,4,158,69,154,41,163,243,106,226,173,138,181,242,190,164,235, + 117,20,123,55,170,188,173,138,141,183,75,129,3,109,242,26,185,93,154,84,171,171,9,15,55,123,59,94,169,116,185,170,122,132,52,185,154,0,204,132, + 176,70,221,17,137,89,235,203,24,49,58,220,73,111,138,179,159,18,117,167,178,225,218,164,136,231,81,217,110,177,74,151,74,87,94,124,87,122,11,173, + 84,82,111,213,162,7,17,177,44,220,52,46,114,183,90,129,179,122,160,33,139,230,153,242,162,184,2,29,229,137,224,250,236,42,73,43,119,155,39,5, + 58,58,73,187,187,98,91,109,182,213,191,213,190,82,121,189,77,80,212,179,153,157,54,203,90,218,228,26,4,92,38,106,81,26,65,53,40,102,196,236, + 4,76,129,111,169,72,255,85,71,73,10,225,84,51,245,52,198,69,150,169,24,96,141,178,93,116,168,183,124,148,51,92,74,25,21,141,80,16,91,2, + 10,71,94,56,100,117,200,224,100,134,232,130,196,66,207,94,47,236,231,194,146,10,240,177,180,58,204,200,197,164,91,83,44,22,165,2,197,184,71,179, + 38,133,21,160,11,114,142,247,50,109,120,76,27,25,213,198,112,171,237,210,27,30,251,251,195,72,158,3,99,204,35,136,166,111,134,145,60,15,198,49, + 109,207,128,145,254,145,48,226,240,25,48,170,36,225,47,129,17,63,11,198,49,109,207,128,145,208,63,12,198,80,8,250,12,24,235,220,254,141,48,130, + 46,254,44,24,199,180,61,25,70,208,38,30,131,209,140,162,236,217,48,218,251,122,182,210,10,234,139,215,35,120,246,225,30,170,128,233,176,157,142,247, + 87,19,202,81,200,2,2,153,181,165,30,174,38,76,32,78,9,161,65,75,93,140,242,46,70,121,53,0,226,35,193,121,192,58,226,178,217,193,39,29, + 229,37,20,16,235,171,201,58,170,116,186,127,67,154,27,123,138,71,190,248,76,4,148,77,93,129,40,13,168,240,149,75,248,148,8,20,6,12,139,183, + 39,210,63,231,105,5,53,209,182,84,250,163,169,43,254,153,127,46,85,103,133,51,110,123,26,220,36,236,118,126,214,28,103,28,169,141,35,18,202,71, + 60,243,233,215,214,89,183,237,180,73,242,136,103,62,253,218,250,125,162,255,1,183,29,2,126,98,15,18,64,228,62,205,214,143,251,155,75,80,72,24, + 15,8,248,146,152,194,136,4,68,210,254,183,1,3,23,64,230,28,79,125,142,8,38,132,116,94,183,39,0,112,128,176,192,33,238,130,226,96,168,4, + 49,233,227,46,20,247,20,136,20,9,202,89,47,40,14,53,213,135,176,18,242,81,55,125,9,190,230,182,122,176,38,224,131,83,81,129,252,193,129,24, + 71,212,31,156,6,88,122,20,115,18,206,144,31,144,144,145,239,20,150,47,58,47,17,15,151,146,244,7,158,247,251,167,125,91,27,159,79,251,80,96, + 210,65,218,135,252,140,37,199,108,144,245,9,67,52,132,44,75,6,89,255,132,117,49,202,106,146,62,70,68,112,33,158,16,131,20,113,41,48,35,54, + 232,124,34,177,111,99,13,174,2,65,2,95,216,1,69,208,87,137,80,78,93,234,35,66,57,166,192,29,160,144,10,246,204,204,127,233,153,142,196,126, + 107,187,33,211,10,37,119,169,218,189,106,114,163,46,110,33,57,54,21,104,35,30,250,197,12,104,117,57,53,233,26,28,211,160,53,195,77,180,84,54, + 153,2,95,157,77,155,137,121,161,19,165,143,83,194,126,6,83,77,190,53,157,32,245,185,196,68,30,231,91,79,48,194,123,108,120,108,190,92,69,73, + 177,3,255,188,63,249,181,40,0,112,10,128,133,156,6,228,254,180,113,3,22,192,221,141,89,235,215,221,36,232,115,193,242,224,221,66,158,72,142,183, + 90,3,228,110,22,29,20,28,206,254,57,202,47,87,197,110,169,13,72,139,40,107,81,106,151,154,41,119,62,47,64,121,165,183,39,211,208,163,110,205, + 171,11,180,167,214,156,77,167,221,227,48,242,251,199,30,213,178,75,161,187,221,185,77,7,31,74,114,134,225,216,210,75,70,207,112,152,178,71,242,51, + 147,0,82,32,142,181,242,229,90,85,81,18,85,81,231,38,71,10,63,246,194,58,89,204,126,187,249,165,189,202,227,120,246,175,66,223,118,87,180,97, + 136,230,208,102,95,77,218,242,194,180,215,241,204,132,79,84,93,167,107,56,187,121,220,249,105,191,206,192,175,219,137,1,115,117,216,168,78,104,45,246, + 248,80,53,250,216,149,196,235,212,44,242,62,86,224,242,191,26,37,189,146,163,22,26,155,167,182,66,95,247,4,155,3,188,91,182,133,193,96,11,105, + 149,169,235,191,69,183,219,185,243,177,82,144,173,180,221,110,77,239,203,240,78,133,88,206,19,125,70,108,125,134,235,230,8,245,251,13,90,111,203,52, + 94,69,89,134,226,175,118,105,195,245,170,191,207,44,141,85,94,62,14,139,85,155,222,65,80,175,215,69,94,90,132,154,181,165,55,63,184,101,228,81, + 132,189,19,120,234,131,253,37,73,43,231,51,120,199,216,97,237,1,182,243,47,144,220,7,8,152,125,252,57,90,222,3,209,80,179,244,218,188,214,92, + 122,205,96,148,99,107,213,61,196,161,213,157,210,163,82,106,218,64,121,141,224,112,155,214,72,198,85,251,174,251,225,62,162,61,239,125,38,152,67,83, + 109,148,6,119,44,31,53,213,216,251,235,111,106,163,139,100,107,31,192,134,54,122,161,224,155,20,238,136,116,190,29,21,172,213,127,182,41,172,248,38, + 201,255,40,42,128,228,251,202,124,87,157,223,236,139,80,80,58,189,179,38,53,222,80,126,223,77,127,92,69,90,189,203,210,219,62,24,214,245,26,87, + 59,118,37,189,60,122,233,29,179,172,29,45,187,236,59,184,150,218,212,157,69,115,5,119,250,7,51,233,144,211,235,169,216,110,214,69,162,154,229,199, + 196,189,137,170,213,241,72,213,88,71,193,67,25,48,49,210,194,186,166,189,37,212,167,83,129,145,192,28,152,2,31,49,232,162,113,87,196,192,110,255, + 238,112,12,82,72,40,152,211,182,212,206,59,167,237,164,157,16,90,10,40,135,152,239,96,135,192,143,35,17,116,43,44,12,253,233,19,23,140,105,248, + 218,110,162,45,141,52,220,107,237,218,145,233,253,88,127,223,78,143,191,31,116,211,163,15,9,198,94,6,227,80,136,174,63,110,250,213,182,47,69,132, + 19,211,9,6,23,195,247,25,83,165,205,224,50,123,243,250,244,177,227,173,157,237,117,210,118,168,183,153,154,65,78,204,139,36,185,168,75,191,89,94, + 228,170,249,94,23,14,192,220,12,77,173,13,238,49,131,120,170,250,180,47,69,154,207,32,148,148,190,88,71,250,86,233,90,72,253,221,45,171,72,87, + 3,202,58,77,6,99,149,39,3,181,86,84,150,194,159,25,193,71,98,18,65,169,163,117,116,24,176,26,106,221,227,207,90,206,238,144,119,105,153,206, + 211,204,12,236,215,76,93,36,105,185,1,151,158,165,185,217,249,69,1,23,194,34,43,118,199,249,83,67,153,114,0,90,16,29,119,125,75,63,10,238, + 25,135,156,181,201,105,167,121,223,38,8,247,172,2,135,252,10,181,241,209,42,163,34,40,125,123,207,82,77,180,17,250,3,77,198,127,39,139,205,179, + 34,190,61,111,48,155,59,36,242,67,202,57,153,114,232,214,24,36,25,233,188,119,184,132,132,3,100,105,222,48,152,239,251,88,58,220,54,110,28,251, + 83,66,17,133,248,246,29,10,205,152,160,16,90,134,196,101,32,124,231,67,143,200,160,247,162,20,178,1,80,125,243,48,34,169,12,167,208,136,5,56, + 12,137,28,242,50,48,132,96,220,104,31,163,118,52,202,16,99,129,20,227,180,247,38,65,249,212,247,41,80,41,10,124,243,111,74,147,190,4,147,146, + 193,121,56,10,2,12,77,211,216,193,191,58,39,105,133,240,94,255,219,181,128,144,231,141,151,67,159,17,215,159,51,174,254,192,130,251,154,40,9,130, + 161,105,24,56,39,120,108,8,56,72,200,251,62,156,197,216,198,156,202,103,161,1,135,50,63,148,212,129,105,74,49,14,216,20,186,107,28,6,112,165, + 56,20,110,22,30,6,152,24,26,156,87,250,22,240,150,234,35,238,227,80,4,161,1,124,132,10,253,29,198,82,208,218,96,132,131,162,81,90,95,38, + 3,152,253,16,250,240,129,204,142,218,209,192,52,44,196,50,144,163,52,107,68,10,215,147,111,169,0,66,0,14,200,124,227,148,194,184,5,180,151,44, + 244,129,115,12,162,158,21,79,238,1,33,67,184,196,196,104,206,177,33,119,54,231,63,158,93,204,5,115,47,187,96,36,237,39,248,127,188,15,206,100, + 151,167,228,124,140,124,66,24,24,130,63,241,66,54,207,80,15,38,255,255,233,43,153,255,160,27,217,102,17,129,4,149,80,49,17,19,180,34,164,129, + 12,32,104,77,14,15,125,72,199,144,58,113,0,17,40,32,234,72,136,124,1,65,196,76,212,65,89,106,162,14,234,181,128,153,162,211,252,239,36,32, + 24,114,171,67,5,146,126,200,185,48,185,69,16,33,25,171,147,57,134,248,148,210,220,6,82,134,148,240,58,59,72,106,222,235,56,164,104,16,46,40, + 16,199,246,52,146,124,225,190,230,79,72,190,237,91,29,180,162,151,230,133,227,250,213,127,1,80,75,3,4,20,0,2,0,8,0,143,128,249,52,187, + 167,102,138,170,9,0,0,119,36,0,0,13,0,0,0,101,100,105,116,45,114,101,100,111,46,115,118,103,221,89,235,147,219,182,17,255,238,191,130,149, + 191,196,19,17,196,139,0,161,123,100,220,184,233,164,147,182,51,113,50,253,216,161,72,72,98,142,34,85,146,58,73,254,235,187,0,223,39,202,167,179, + 29,183,19,122,60,34,119,23,187,192,62,126,192,226,110,191,59,110,83,231,81,23,101,146,103,119,51,130,240,204,209,89,148,199,73,182,190,155,253,250, + 203,15,110,48,115,202,42,204,226,48,205,51,125,55,203,242,217,119,247,175,110,255,228,186,206,247,133,14,43,29,59,135,164,218,56,63,102,15,101,20, + 238,180,243,205,166,170,118,11,207,59,28,14,40,105,136,40,47,214,222,27,199,117,97,100,249,184,126,229,56,14,152,205,202,69,28,221,205,26,249,221, + 190,72,173,92,28,121,58,213,91,157,85,165,71,16,241,102,189,120,212,139,31,244,18,21,186,204,247,69,84,171,143,162,161,100,17,175,122,81,152,201, + 129,89,33,162,148,242,48,245,40,117,65,194,45,79,89,21,30,221,172,124,61,24,10,19,156,26,74,49,198,30,240,122,201,235,164,22,199,20,220,112, + 113,50,150,59,180,14,174,223,193,255,110,64,231,195,122,173,43,24,169,81,166,43,239,221,47,239,188,86,218,197,40,174,226,129,154,118,212,200,238,40, + 28,89,184,213,229,46,140,116,217,153,176,227,219,143,133,62,238,242,162,114,79,241,14,38,163,48,194,246,153,148,57,94,33,179,74,82,109,108,222,205, + 188,77,190,213,222,111,201,118,27,70,222,59,93,62,84,249,206,59,36,32,129,118,89,237,185,67,18,87,155,187,25,15,118,71,251,189,209,201,122,83, + 13,8,73,124,55,3,55,19,194,26,115,173,39,22,93,46,99,196,232,120,38,3,22,103,223,198,250,81,167,227,177,113,30,45,195,178,155,98,149,172, + 117,81,121,209,99,233,173,10,173,227,122,170,214,123,80,17,235,220,77,162,60,115,171,13,36,171,7,22,210,112,153,106,47,140,42,176,81,158,41,174, + 215,174,227,164,114,11,29,231,168,77,146,110,118,249,190,218,237,171,127,235,99,165,179,122,154,96,104,16,51,203,54,195,58,218,236,30,20,220,198,122, + 85,26,69,181,83,204,23,179,12,96,65,110,233,176,248,107,17,198,9,148,83,45,52,176,24,229,105,170,35,112,107,152,30,194,83,61,229,86,207,120, + 40,165,28,55,74,65,109,9,94,104,101,97,145,213,41,133,149,25,162,11,26,243,98,241,90,169,37,198,203,27,75,202,33,199,146,234,180,32,55,179, + 126,76,190,90,149,26,12,227,1,205,134,20,70,128,45,58,115,188,207,179,134,167,172,145,105,107,188,179,118,235,141,151,253,229,221,8,41,121,253,194, + 100,16,8,140,63,217,141,140,191,200,141,83,214,94,224,70,38,190,154,27,185,82,228,5,110,92,217,231,19,221,8,182,216,139,220,56,101,237,106,55, + 130,53,255,171,185,49,16,226,37,217,88,99,251,39,186,17,108,189,44,27,167,172,93,237,70,176,246,108,54,154,175,48,125,177,27,237,126,189,216,20, + 26,206,23,175,39,252,57,116,247,216,4,176,131,142,29,29,239,102,148,163,128,73,66,69,79,61,221,205,152,64,156,18,66,101,71,93,77,202,174,38, + 101,11,112,136,143,4,231,146,245,196,117,51,131,95,138,48,43,225,0,177,189,155,109,195,170,72,142,223,144,102,199,158,227,137,23,159,9,73,217,220, + 245,81,64,125,70,149,118,9,159,19,129,2,201,176,120,115,166,253,215,44,169,224,76,180,47,117,241,222,156,43,254,153,253,90,234,62,10,23,210,246, + 28,35,73,208,207,252,98,56,46,36,82,7,71,36,80,207,100,230,245,64,113,49,109,123,107,138,60,147,153,215,3,197,239,83,253,31,73,219,177,195, + 207,226,65,36,84,238,117,177,190,38,223,2,194,184,36,144,74,98,238,194,233,94,18,69,197,124,240,50,224,19,36,3,26,96,50,247,57,34,152,16, + 210,231,220,145,128,123,37,194,2,7,184,47,137,147,161,18,196,148,143,251,66,60,82,32,82,36,40,103,131,146,56,213,84,31,138,74,168,222,231,95, + 30,20,236,94,117,25,20,128,45,71,160,0,245,229,11,22,12,166,106,64,1,86,69,152,221,99,135,160,112,46,187,154,148,53,160,160,192,89,212,191, + 34,68,16,21,170,48,96,138,118,41,132,64,4,62,81,210,196,2,142,218,129,161,48,66,184,244,13,23,68,49,39,176,4,120,195,136,16,95,146,47, + 5,11,159,147,207,148,209,143,159,193,130,81,30,49,54,74,32,230,35,233,143,178,135,17,228,143,18,135,83,228,255,63,172,147,227,143,31,217,197,215, + 94,231,173,103,218,15,251,214,181,62,166,239,137,31,19,125,120,213,0,97,145,63,0,18,54,199,205,70,61,52,135,41,208,234,147,252,172,239,102,76, + 55,214,124,238,194,181,182,200,9,114,53,116,54,140,101,94,196,186,104,89,194,62,35,86,3,174,166,237,163,62,135,220,86,45,191,115,191,81,62,16, + 195,83,252,114,19,198,249,1,182,226,167,204,15,121,14,229,195,159,146,77,53,251,204,108,167,92,202,51,166,217,189,13,51,192,231,179,137,246,69,1, + 158,118,211,240,164,97,77,246,167,5,145,114,147,31,214,133,241,205,42,76,59,231,116,67,13,203,93,46,115,176,93,21,251,51,54,244,161,123,115,179, + 226,238,235,40,54,221,244,64,194,232,31,174,118,210,202,33,201,128,233,54,93,122,160,232,5,129,182,109,15,24,185,32,113,52,135,152,224,2,19,124, + 228,203,54,181,182,186,10,227,176,10,251,228,104,41,188,109,119,139,120,181,248,249,221,15,221,110,29,69,139,127,229,197,67,191,11,27,129,112,9,157, + 244,221,172,59,65,152,14,58,90,24,8,12,171,251,100,11,75,55,247,55,223,30,183,41,100,115,199,24,9,87,167,157,238,149,214,106,219,187,168,201, + 251,172,56,218,38,102,144,247,190,130,68,255,209,24,25,156,42,106,165,145,185,77,203,139,251,129,98,179,128,183,235,110,239,31,77,33,169,82,125,255, + 183,240,97,191,116,222,87,26,42,191,176,211,173,233,67,29,222,185,18,43,121,102,207,168,173,215,112,223,44,161,190,162,65,219,125,153,68,155,48,77, + 81,244,193,14,109,164,94,13,231,153,38,145,206,202,231,221,98,205,38,143,80,202,219,109,158,149,214,67,205,216,210,91,158,220,50,244,40,194,222,153, + 123,234,133,253,37,78,42,231,103,29,231,83,139,181,11,216,47,127,3,28,29,121,192,204,227,207,225,250,137,19,13,53,77,238,205,133,204,173,215,124, + 76,74,20,214,220,199,36,194,117,152,100,207,41,9,119,187,244,52,37,84,211,70,19,172,189,60,94,138,13,164,73,231,97,122,255,244,212,235,131,12, + 127,161,195,199,225,220,233,2,82,182,124,54,156,83,215,176,63,235,93,145,199,123,123,15,54,142,227,103,42,126,151,192,238,145,44,247,147,138,11,253, + 159,125,2,35,62,73,243,63,242,10,92,242,101,117,190,173,46,79,246,179,188,160,139,228,209,134,212,100,67,249,101,39,253,126,19,22,250,109,154,60, + 12,157,97,83,175,73,181,182,57,25,96,237,173,215,34,177,253,90,247,8,61,218,185,58,116,79,195,165,134,221,254,39,195,116,200,249,14,150,239,119, + 219,60,214,205,240,22,220,119,97,181,105,151,84,77,52,22,60,80,146,137,137,70,214,156,82,225,60,235,155,243,42,244,1,208,93,136,185,244,225,24, + 75,5,238,143,171,48,219,191,59,28,131,26,18,8,230,116,157,181,243,214,233,26,106,39,128,222,66,4,138,249,14,118,8,252,115,20,130,182,133,5, + 129,63,191,114,192,148,133,15,221,36,186,67,83,1,91,95,55,118,130,125,156,106,243,59,246,244,53,66,207,158,188,79,48,241,50,62,14,132,232,143, + 149,77,219,218,181,167,136,112,98,26,66,121,51,190,166,49,231,183,5,108,120,223,188,62,191,243,120,99,185,131,134,218,126,22,251,84,47,244,163,206, + 242,56,190,169,15,133,139,44,207,116,243,94,159,45,64,184,249,52,103,91,72,143,5,212,83,53,164,253,150,39,217,2,74,73,23,55,219,176,120,208, + 69,173,164,126,119,203,42,44,170,17,101,155,196,163,111,157,197,35,179,86,85,154,192,207,130,224,150,24,135,112,26,42,138,240,52,18,53,212,186,213, + 95,116,146,253,34,31,147,50,89,38,169,249,176,175,169,190,137,147,114,7,41,189,72,50,51,243,155,252,81,23,171,52,63,180,252,243,64,153,35,3, + 116,4,69,212,183,17,195,42,120,18,28,114,49,38,231,141,193,211,152,32,60,136,10,44,242,3,156,154,219,168,76,170,96,16,214,113,164,154,114,35, + 244,127,24,50,254,59,69,108,153,230,209,195,229,128,89,236,96,80,175,146,75,49,231,62,194,140,51,161,156,239,29,192,30,225,19,204,3,32,11,196, + 124,223,199,202,225,72,128,160,242,249,28,240,136,66,129,251,14,245,17,87,64,51,20,174,164,240,157,159,122,26,67,132,130,199,149,0,34,180,100,132, + 51,42,201,156,72,36,113,16,16,53,18,53,45,133,96,220,216,158,32,118,36,202,16,99,82,137,73,210,247,14,1,56,101,68,4,115,74,161,73,52, + 127,167,116,36,0,166,164,130,240,57,231,72,74,12,141,212,212,146,63,56,103,128,98,230,123,158,219,80,247,218,228,55,52,33,81,253,92,72,242,143, + 12,120,106,137,18,41,199,65,33,2,41,202,21,157,51,5,243,247,97,41,176,58,31,81,76,2,138,185,241,12,101,62,244,47,0,212,210,192,161,132, + 152,128,183,2,9,187,137,67,5,242,49,64,59,80,124,115,49,111,61,221,208,192,107,240,43,100,96,28,125,70,3,148,247,125,1,69,98,163,68,56, + 152,152,164,245,250,24,134,68,9,4,145,3,125,61,173,165,64,56,24,52,140,82,77,80,108,212,0,110,133,37,98,200,17,72,53,72,39,198,3,31, + 114,192,71,132,5,62,200,77,184,100,16,180,51,192,23,10,250,116,38,38,193,197,214,214,69,112,127,30,70,204,78,242,4,70,48,82,246,145,127,68, + 224,191,0,35,215,128,59,54,85,202,72,64,174,221,121,205,197,226,155,171,131,115,190,243,254,161,3,241,220,14,108,177,3,74,12,3,164,5,106,206, + 145,15,117,133,149,65,101,56,87,73,202,36,149,115,2,56,168,2,202,137,41,89,133,100,32,232,128,234,48,218,14,7,100,149,204,231,64,3,176,85, + 132,88,154,64,2,246,5,160,89,244,86,146,115,67,165,8,162,12,150,76,53,99,163,82,213,84,192,121,98,202,217,84,184,29,15,208,203,107,73,3, + 209,212,142,134,189,65,168,102,52,67,80,180,140,3,92,51,137,96,176,8,136,35,16,5,133,10,91,140,99,181,198,126,70,164,182,66,106,80,58,91, + 249,4,176,115,53,248,35,203,243,192,126,235,65,135,123,107,46,87,238,95,253,23,80,75,3,4,20,0,2,0,8,0,171,128,249,52,75,77,50,197, + 89,10,0,0,186,54,0,0,23,0,0,0,109,101,100,105,97,45,115,101,101,107,45,98,97,99,107,119,97,114,100,46,115,118,103,237,90,109,143,219, + 54,18,254,158,95,225,115,190,36,232,74,226,155,40,201,251,82,244,26,244,16,32,185,3,154,4,247,241,64,75,180,173,174,44,185,146,188,182,243,235, + 111,72,189,91,114,214,222,85,18,92,174,110,131,181,56,195,25,242,225,195,209,12,233,155,159,247,235,104,242,32,211,44,76,226,219,41,54,209,116,34, + 99,63,9,194,120,121,59,253,244,241,55,195,157,78,178,92,196,129,136,146,88,222,78,227,100,250,243,221,139,155,191,25,198,228,215,84,138,92,6,147, + 93,152,175,38,111,227,251,204,23,27,57,121,181,202,243,205,204,178,118,187,157,25,150,141,102,146,46,173,215,19,195,128,158,217,195,242,197,100,50,1, + 183,113,54,11,252,219,105,169,191,217,166,145,214,11,124,75,70,114,45,227,60,179,176,137,173,105,163,238,55,234,59,57,55,83,153,37,219,212,47,204, + 251,126,91,51,13,22,141,42,140,100,71,181,18,246,60,207,66,196,34,196,0,13,35,59,196,185,216,27,113,246,178,213,21,6,56,212,149,32,132,44, + 144,53,154,231,105,205,246,17,192,112,114,48,90,218,246,14,208,111,224,95,221,161,198,176,152,235,2,122,74,51,150,185,245,230,227,27,171,210,54,144, + 25,228,65,203,76,213,171,227,183,179,28,177,88,203,108,35,124,153,213,46,116,255,93,24,228,171,219,41,115,55,123,253,188,146,225,114,149,183,26,194, + 224,118,10,51,196,20,57,250,185,26,195,172,102,17,50,41,41,84,75,195,109,17,163,63,5,242,65,70,221,190,65,226,207,69,6,195,181,86,201,90, + 90,127,132,235,181,240,173,44,245,45,255,33,179,128,127,203,196,8,253,36,54,242,21,80,195,2,171,145,152,71,210,18,126,14,118,179,158,49,53,187, + 219,233,90,6,161,48,50,41,239,141,185,240,239,119,34,13,204,106,113,234,177,201,253,38,73,115,99,17,70,178,232,85,12,33,18,155,196,122,35,179, + 251,60,217,88,255,72,197,34,244,133,245,22,134,32,173,194,108,233,218,72,182,57,172,161,204,204,77,60,108,121,31,108,96,57,61,52,40,60,84,194, + 59,144,222,4,114,145,41,173,2,101,245,4,48,123,90,6,82,229,70,164,48,150,32,132,221,81,232,21,154,93,9,161,152,151,125,160,87,6,19,168, + 116,1,164,252,16,193,28,85,163,225,39,81,146,206,94,34,253,185,214,77,9,48,34,204,15,51,124,61,109,250,36,139,69,38,129,2,168,213,166,89, + 0,61,192,23,68,8,235,124,111,11,253,233,122,67,38,183,61,199,163,142,55,228,22,15,186,37,168,118,123,99,117,231,127,41,92,182,203,190,25,92, + 182,203,159,15,215,217,40,217,174,59,22,74,54,114,236,11,80,18,193,28,9,247,137,40,129,47,231,34,148,24,103,14,99,71,222,206,4,9,156,121, + 163,81,137,131,173,90,92,109,117,24,100,36,125,112,47,162,157,56,100,167,80,172,87,141,187,248,17,160,206,36,10,62,13,98,203,25,125,4,168,1, + 103,1,13,28,127,49,222,6,244,240,163,160,216,30,29,9,148,235,51,80,177,61,251,114,84,164,250,248,71,123,245,137,32,157,226,206,105,20,93,206, + 201,183,10,99,224,139,93,180,65,135,188,157,29,198,192,27,127,12,70,245,36,162,139,97,212,233,215,108,149,74,72,23,95,14,224,217,134,187,235,2, + 123,180,17,47,203,198,79,113,152,67,94,184,205,100,250,65,229,86,255,138,63,101,178,167,245,49,21,113,6,137,220,26,50,20,145,167,225,254,21,190, + 66,234,63,211,166,220,33,244,138,153,200,179,49,162,210,192,244,10,115,211,117,40,226,175,107,59,254,254,118,74,152,233,82,7,19,222,180,30,110,167, + 148,155,140,96,76,156,186,117,49,168,187,24,212,77,1,126,219,228,140,57,180,9,191,79,37,232,23,144,213,175,146,211,68,198,12,225,231,35,155,171, + 175,17,20,40,175,12,230,152,144,106,243,43,3,19,220,160,184,199,183,83,155,153,158,235,218,152,213,173,7,172,64,104,144,218,19,173,229,122,220,115, + 154,214,3,180,98,70,76,236,58,158,247,53,161,210,185,201,151,160,106,45,234,40,80,1,32,30,178,241,149,225,57,38,225,4,211,46,96,204,131,4, + 30,181,23,72,3,134,137,233,49,143,211,14,108,160,203,185,67,9,235,194,6,20,195,192,70,218,192,54,254,222,237,190,135,251,123,151,81,62,218,222, + 69,38,33,4,242,215,43,40,194,128,101,196,161,87,64,12,2,140,35,176,163,153,195,17,3,56,137,7,82,198,175,8,50,129,111,78,119,51,115,6, + 54,28,228,176,206,102,198,154,183,212,38,157,205,220,215,93,12,234,194,102,118,77,216,103,223,21,101,239,27,163,76,145,251,157,81,254,10,33,64,85, + 115,95,42,246,8,233,108,81,136,246,0,7,230,188,187,69,41,212,88,174,205,89,103,139,18,10,131,239,110,103,162,222,12,103,46,91,49,235,27,75, + 21,170,250,91,93,130,171,74,58,120,8,229,174,169,102,85,125,95,218,221,136,165,212,137,1,76,182,72,209,74,193,60,73,3,153,86,34,174,63,29, + 81,153,59,168,131,4,108,19,143,97,168,62,95,116,33,86,198,91,106,104,72,158,173,68,144,236,96,254,199,194,207,73,2,156,235,217,212,244,129,184, + 229,129,199,190,80,49,195,1,120,109,226,244,12,250,219,52,5,252,140,72,28,36,204,73,255,169,208,206,86,201,110,153,42,108,22,34,170,193,169,187, + 42,145,49,159,39,123,21,161,183,61,113,144,248,91,117,74,102,108,139,181,41,143,103,212,154,133,129,58,217,9,227,229,94,33,96,15,73,14,125,137, + 92,111,74,225,0,48,122,48,155,36,140,149,171,214,112,22,97,20,169,85,244,197,130,202,246,188,182,96,48,59,53,51,37,236,79,77,55,231,73,36, + 97,247,251,144,64,226,122,120,89,158,38,247,208,242,210,33,222,194,95,28,219,219,133,49,44,167,81,30,93,97,204,216,9,141,234,48,203,69,238,9, + 13,24,17,115,240,9,161,202,154,88,107,146,5,39,135,151,71,201,219,84,107,3,81,244,43,41,1,9,110,117,192,83,111,31,141,68,181,7,147,84, + 237,64,145,235,3,180,21,60,125,78,224,49,170,247,232,38,201,194,66,72,93,21,27,161,22,238,196,11,109,140,96,175,201,216,159,237,200,51,17,100, + 105,46,179,7,29,241,139,28,61,200,52,15,253,39,184,113,199,114,163,96,115,108,124,148,105,21,110,8,66,227,193,70,136,74,55,73,171,188,111,59, + 34,99,205,7,162,186,135,92,199,229,131,110,216,88,110,176,173,222,134,12,15,176,141,81,74,198,131,205,128,82,5,113,194,24,31,244,52,34,175,13, + 219,53,17,225,158,61,232,104,52,94,99,23,222,75,136,184,195,200,141,198,107,140,96,129,8,25,92,32,181,108,99,185,33,158,233,65,230,53,236,198, + 27,111,117,176,167,194,155,235,12,172,14,84,203,124,60,71,156,154,136,122,220,97,67,142,198,156,17,148,72,136,115,138,6,103,68,240,136,196,118,29, + 19,1,183,28,50,224,73,221,228,140,231,9,35,2,232,145,161,232,99,171,203,140,49,61,193,54,98,200,118,251,158,40,198,99,162,231,17,211,102,80, + 138,15,4,110,117,4,80,39,194,253,252,87,183,175,101,46,2,145,139,38,25,174,90,48,197,213,161,221,77,26,44,102,191,191,249,173,62,84,243,253, + 217,191,147,244,190,57,15,83,10,98,158,108,33,129,169,15,250,212,165,145,63,83,165,146,200,239,194,53,36,28,234,250,241,167,253,58,130,180,188,22, + 116,148,243,195,70,54,70,11,179,213,85,234,224,117,108,224,175,67,213,201,250,144,67,182,247,86,57,105,29,254,149,70,195,60,146,119,239,213,205,216, + 228,131,148,247,147,191,151,23,110,122,24,133,180,211,193,87,183,199,73,122,215,26,137,154,241,47,203,250,76,175,111,254,157,216,36,147,95,69,36,214, + 34,14,82,25,14,217,86,203,208,183,163,53,123,46,149,195,40,244,101,156,61,14,136,238,28,62,64,221,178,94,39,113,166,177,41,251,102,214,252,96, + 100,194,2,222,91,237,83,81,171,92,193,246,138,190,59,118,215,90,212,11,61,117,231,177,145,41,172,82,246,232,60,134,46,206,127,151,155,52,9,182, + 250,66,179,187,178,207,52,252,38,132,204,61,156,111,7,13,167,242,207,109,8,61,158,100,249,159,9,188,142,228,184,54,127,201,79,15,246,89,40,200, + 52,124,208,75,170,216,144,141,59,232,15,43,145,202,95,162,240,94,30,83,175,164,90,117,108,222,10,47,55,86,21,127,244,211,178,137,75,157,250,180, + 174,101,34,49,151,80,229,189,83,194,9,238,151,134,201,118,179,78,2,89,118,175,107,54,125,11,16,132,217,6,154,103,97,172,206,45,170,88,183,17, + 249,170,119,56,146,254,71,149,210,173,98,170,43,219,31,201,154,96,11,190,85,124,130,114,211,47,63,157,56,173,156,65,77,216,4,111,104,123,63,129, + 44,217,70,136,93,97,248,59,121,55,129,20,83,61,17,6,223,43,17,101,90,212,209,252,60,121,63,97,184,211,149,176,86,223,74,86,246,237,168,126, + 158,52,131,47,208,233,94,143,168,98,26,102,19,75,253,173,117,45,163,31,211,109,36,103,242,65,194,116,131,235,162,34,158,65,148,126,245,178,127,32, + 244,186,148,23,37,241,140,86,143,74,19,224,156,101,127,110,129,53,237,214,63,160,180,159,193,66,198,193,245,90,164,247,50,45,198,81,124,55,178,92, + 164,121,167,101,29,6,157,103,25,151,207,165,77,216,44,80,225,134,240,103,198,170,182,64,64,49,156,166,64,134,182,166,106,45,110,127,102,168,106,107, + 102,254,16,102,225,60,140,212,131,254,26,201,235,46,163,174,19,72,77,23,81,178,171,229,205,175,10,112,235,96,110,12,198,157,252,241,198,41,133,253, + 99,10,79,253,213,73,253,99,147,47,109,132,222,38,176,109,108,143,180,9,206,32,178,230,102,255,72,248,245,217,228,110,179,164,32,50,54,11,7,252, + 76,66,107,22,254,175,19,122,92,14,95,186,94,252,175,245,186,116,189,58,59,108,132,119,133,218,190,219,76,194,238,117,46,216,243,95,35,210,92,28, + 223,234,8,57,46,135,191,240,230,247,143,153,222,188,14,144,131,8,252,111,95,159,34,127,255,114,245,89,228,63,38,125,241,122,253,33,95,186,95,228, + 60,67,38,148,185,222,21,102,38,129,114,185,67,117,245,83,7,234,12,176,191,243,110,114,202,55,16,162,152,219,186,193,197,68,181,97,117,128,162,76, + 115,120,217,115,210,121,81,217,117,183,150,153,163,109,165,216,72,188,83,121,194,215,75,210,212,111,28,94,63,47,86,254,128,188,249,190,41,121,147,37, + 17,124,97,145,113,78,206,216,138,113,23,146,173,250,25,219,211,67,17,253,255,125,255,170,168,81,70,154,34,206,112,211,227,176,227,107,90,105,41,165, + 102,29,61,218,234,37,181,186,22,128,92,45,19,149,184,54,113,164,175,67,25,41,155,90,97,170,108,162,216,116,89,97,215,53,61,196,121,53,178,227, + 46,122,40,168,103,167,106,106,217,33,188,109,168,215,103,152,242,246,121,111,215,175,73,253,230,77,109,115,172,63,215,223,117,55,252,128,17,86,221,212, + 56,64,12,90,81,25,23,13,138,28,110,167,69,221,85,22,58,221,62,3,236,161,216,115,198,37,196,147,11,244,114,68,12,181,46,58,138,48,224,169, + 28,68,79,171,216,53,173,41,195,67,57,107,53,255,182,98,191,206,61,230,40,242,254,226,232,120,28,61,89,213,84,23,44,203,187,23,55,234,130,227, + 238,197,127,1,80,75,3,4,20,0,2,0,8,0,174,128,249,52,207,153,178,73,172,10,0,0,72,56,0,0,22,0,0,0,109,101,100,105,97,45, + 115,101,101,107,45,102,111,114,119,97,114,100,46,115,118,103,237,90,109,147,155,56,18,254,158,95,225,115,190,36,181,6,244,134,16,158,151,173,173,77, + 229,42,87,201,93,213,38,169,251,120,37,131,108,179,131,193,11,120,236,201,175,191,22,239,24,60,51,158,33,201,85,46,36,169,24,117,171,91,122,244, + 168,213,146,184,252,245,176,9,39,183,42,73,131,56,186,154,98,19,77,39,42,242,98,63,136,86,87,211,207,159,222,26,98,58,73,51,25,249,50,140, + 35,117,53,141,226,233,175,215,47,46,255,102,24,147,223,19,37,51,229,79,246,65,182,158,188,139,110,82,79,110,213,228,213,58,203,182,115,203,218,239, + 247,102,80,22,154,113,178,178,94,79,12,3,106,166,183,171,23,147,201,4,220,70,233,220,247,174,166,165,254,118,151,132,185,158,239,89,42,84,27,21, + 101,169,133,77,108,77,27,117,175,81,223,171,133,153,168,52,222,37,94,97,222,243,218,154,137,191,108,84,161,37,123,154,43,97,215,117,45,68,44,66, + 12,208,48,210,187,40,147,7,35,74,95,182,170,66,3,135,170,18,132,144,5,178,70,243,113,90,243,67,8,48,156,108,76,46,109,123,7,232,183,240, + 175,174,80,99,88,244,117,9,53,149,25,169,204,122,243,233,141,85,105,27,200,244,51,191,101,166,170,213,241,219,25,142,72,110,84,186,149,158,74,107, + 23,121,253,125,224,103,235,171,41,19,219,67,254,190,86,193,106,157,181,10,2,255,106,10,61,196,20,57,249,123,213,134,121,205,34,100,82,82,168,150, + 134,219,34,70,127,241,213,173,10,187,117,253,216,91,200,20,154,107,173,227,141,178,254,12,54,27,233,89,105,226,89,222,109,106,1,255,86,177,17,120, + 113,100,100,107,160,134,5,86,67,185,8,149,37,189,12,236,166,61,99,186,119,87,211,141,242,3,105,164,74,221,24,128,219,94,38,190,89,141,77,221, + 52,117,216,198,73,102,44,131,80,21,149,138,22,132,114,27,91,111,84,122,147,197,91,235,239,137,92,6,158,180,222,65,11,148,85,88,45,61,27,241, + 46,131,33,84,169,185,141,134,45,31,252,45,140,166,139,6,133,119,149,240,26,164,151,190,90,166,90,171,0,89,191,1,202,110,46,3,169,118,35,19, + 104,139,31,192,228,40,244,10,205,174,132,80,204,203,58,80,43,133,14,84,186,128,81,118,23,66,31,117,161,225,197,97,156,204,95,162,252,185,200,139, + 98,32,68,144,221,205,241,197,180,169,19,47,151,169,2,6,160,86,89,78,2,168,1,190,32,64,88,143,247,182,204,159,174,55,100,114,219,117,92,234, + 184,67,110,241,160,91,130,106,183,151,86,183,255,231,194,101,11,246,205,224,178,5,127,62,92,143,70,201,22,98,44,148,108,228,216,103,160,36,253,5, + 146,226,137,40,129,47,231,44,148,24,103,14,99,71,222,30,9,18,56,115,71,163,18,7,91,181,184,154,234,208,200,80,121,224,94,134,123,121,151,158, + 66,177,30,53,46,240,3,64,61,146,40,248,52,136,45,103,244,1,160,6,156,249,212,119,188,229,120,19,208,197,15,130,98,187,116,36,80,46,30,129, + 138,237,218,231,163,162,244,227,29,205,213,39,130,116,138,59,167,81,20,156,147,111,21,198,192,23,59,107,130,14,121,123,116,24,3,111,252,33,24,245, + 155,12,207,134,49,207,190,230,235,68,65,182,248,114,0,207,54,220,93,23,216,165,141,120,85,22,126,142,130,12,210,194,93,170,146,143,58,181,250,87, + 244,57,85,61,173,79,137,140,82,200,71,54,144,160,200,44,9,14,175,240,12,233,63,166,77,185,67,232,140,153,200,101,88,8,101,96,58,195,220,20, + 14,69,252,117,109,199,59,92,77,9,51,5,117,48,225,77,233,221,213,148,114,147,17,140,137,83,151,46,7,117,151,131,186,9,192,111,155,156,49,135, + 54,225,247,169,4,189,7,217,124,41,57,77,100,204,16,30,13,89,163,128,22,207,92,219,132,116,219,101,51,3,19,220,96,121,192,87,83,155,154,76, + 203,26,124,238,176,134,66,152,12,51,42,26,93,50,168,11,165,152,17,19,217,176,220,126,77,216,242,60,229,62,216,90,3,60,30,108,4,96,67,194, + 158,25,174,99,18,78,48,237,98,199,92,72,232,81,123,196,114,236,48,84,99,46,167,29,236,64,151,115,135,18,214,197,14,56,135,129,158,180,193,110, + 252,201,220,93,152,251,147,153,209,17,177,67,38,33,4,50,218,25,252,2,166,16,135,206,12,98,98,2,180,33,48,201,153,195,17,195,51,74,5,96, + 196,233,140,32,83,216,216,233,206,111,206,192,136,131,28,214,153,223,152,57,96,145,218,164,51,191,251,186,203,65,93,152,223,194,132,169,247,93,113,118, + 191,57,206,54,255,222,56,127,133,88,160,183,120,247,237,0,9,233,76,83,88,2,0,14,204,143,66,28,133,141,151,176,57,235,76,83,66,161,241,221, + 41,77,244,114,49,126,112,97,194,132,172,128,178,25,122,93,130,117,105,233,77,111,254,171,222,205,235,93,185,127,27,168,125,179,51,214,71,5,165,163, + 173,92,169,60,201,0,140,138,116,175,20,44,226,196,87,73,37,226,249,211,17,149,121,136,62,147,192,54,129,5,23,87,161,190,30,25,109,188,165,134, + 134,228,233,90,250,241,30,96,59,22,126,137,99,232,51,44,168,54,23,54,235,137,53,251,28,219,36,176,110,56,61,153,94,159,77,88,178,93,82,179, + 173,17,238,146,4,112,53,66,121,167,160,107,249,127,213,88,165,235,120,191,74,52,68,75,25,214,24,213,85,181,200,88,44,98,112,157,37,187,158,216, + 143,189,157,62,119,51,118,197,200,150,7,62,122,44,3,95,159,21,5,209,234,160,129,176,135,36,119,125,137,218,108,75,225,0,62,121,99,182,113,16, + 105,87,173,230,44,131,48,212,131,233,201,37,85,237,126,237,192,96,122,170,103,90,216,239,90,94,156,197,161,2,18,122,144,147,226,186,121,105,150,196, + 55,80,242,210,33,238,210,91,30,219,219,7,17,140,170,81,30,134,97,204,216,9,141,234,120,76,32,113,66,227,160,87,62,247,132,16,64,171,211,76, + 221,201,130,154,195,195,163,229,109,198,181,129,40,234,149,148,128,156,185,58,51,170,103,81,142,68,53,55,227,68,207,76,153,229,71,114,107,120,251,18, + 195,107,88,207,221,109,156,6,133,80,47,82,46,100,251,78,39,218,228,198,8,118,155,77,192,179,29,185,38,130,196,79,48,123,208,17,63,203,209,173, + 74,178,192,123,130,27,49,150,27,13,155,99,227,163,132,173,112,67,16,26,15,54,2,137,150,16,164,117,98,208,118,68,198,234,15,172,9,144,5,58, + 130,15,186,97,99,185,193,182,94,75,25,30,96,27,163,148,140,7,155,1,187,31,196,9,99,124,208,211,136,188,54,96,27,129,8,119,237,65,71,163, + 241,26,11,88,158,16,17,195,200,141,198,107,140,96,128,8,25,28,32,61,108,99,185,33,174,233,82,36,134,221,184,227,141,14,118,117,120,19,206,192, + 232,216,24,241,241,28,113,106,34,234,114,135,13,57,26,179,71,176,201,66,156,83,52,216,35,130,71,36,182,112,76,4,220,114,200,128,39,125,55,52, + 158,39,140,96,123,77,201,80,244,177,245,253,200,152,158,96,26,49,100,139,190,39,138,241,152,232,193,198,218,102,176,163,31,8,220,88,212,39,210,151, + 86,63,13,206,203,55,42,147,190,204,100,147,19,87,37,152,226,234,28,240,50,241,151,243,63,222,188,173,207,233,60,111,254,239,56,185,105,142,216,180, + 130,92,196,59,72,96,234,179,67,125,15,229,205,117,198,46,179,235,96,3,9,135,190,208,252,229,176,9,33,59,175,5,29,229,236,110,171,26,163,133, + 217,234,114,118,240,130,215,247,54,129,174,100,125,204,32,219,123,167,157,180,206,19,75,163,65,22,170,235,15,250,178,109,242,81,169,155,201,219,226,10, + 47,111,69,33,236,232,123,250,58,58,78,174,91,13,209,29,254,109,85,159,18,246,173,191,151,219,120,242,187,12,229,70,70,126,162,130,33,219,122,20, + 250,118,114,205,158,75,237,48,12,60,21,165,15,227,145,87,14,110,97,247,178,217,196,81,154,67,83,214,77,173,197,157,145,74,11,104,111,245,112,241, + 128,83,73,176,216,157,219,215,127,200,155,221,98,242,49,83,176,85,76,206,237,104,223,103,174,171,217,212,102,215,251,227,190,183,8,118,102,183,187,160, + 110,85,2,140,73,31,4,117,232,179,128,63,212,54,137,253,93,126,95,219,69,243,153,134,223,4,105,129,202,144,225,68,253,181,11,160,198,147,44,255, + 51,134,165,81,141,107,243,183,236,116,99,159,133,130,74,130,219,124,72,53,27,210,113,27,253,113,45,19,245,91,24,220,180,193,200,169,87,82,173,186, + 21,104,133,186,75,171,138,133,249,219,170,137,145,157,189,114,189,175,10,229,66,193,142,243,189,22,78,112,127,155,26,239,182,155,216,87,101,245,122,255, + 152,95,114,248,65,186,133,226,121,16,233,19,152,42,238,110,101,182,238,29,243,36,255,209,219,250,214,198,174,43,59,28,201,154,192,15,190,117,172,132, + 173,175,87,62,157,53,67,59,131,253,105,179,144,64,217,135,137,62,241,209,231,221,116,134,169,105,79,222,79,24,46,14,192,233,140,48,120,109,228,148, + 229,242,163,10,95,38,31,38,188,40,33,78,101,67,111,3,90,54,26,121,105,227,168,194,151,73,211,155,2,174,230,198,31,219,23,221,187,33,189,237, + 135,190,70,42,255,213,186,147,202,95,147,93,168,230,234,86,1,24,254,69,177,119,159,195,122,242,234,101,255,224,235,117,41,47,54,239,115,90,189,106, + 77,0,123,158,254,181,3,78,181,75,255,140,131,104,14,195,28,249,23,27,153,220,168,164,104,71,241,219,72,51,153,100,157,146,77,224,119,222,85,84, + 190,151,54,97,42,193,94,60,128,255,230,172,42,243,37,108,219,147,4,168,210,214,212,165,197,213,215,28,85,101,77,207,111,131,52,88,4,161,126,201, + 127,134,234,162,203,183,139,24,146,232,101,24,239,43,121,147,160,140,65,193,147,31,171,156,82,56,60,164,240,212,175,108,234,143,107,238,155,25,189,89, + 97,219,216,30,123,86,28,51,122,128,196,57,47,251,7,223,175,31,77,236,54,67,10,18,99,179,112,192,31,73,230,156,129,63,201,220,137,167,103,142, + 23,255,57,94,231,142,87,103,170,141,184,120,232,249,188,75,21,76,103,231,140,32,240,53,66,207,217,1,175,14,153,227,114,249,158,220,192,59,189,230, + 34,7,17,248,59,184,242,14,44,166,250,70,249,89,147,224,152,252,197,18,251,99,46,188,247,115,223,49,185,112,88,94,192,76,2,27,252,35,194,235, + 47,62,168,51,56,11,142,22,45,167,92,149,92,46,184,91,148,8,76,242,66,97,130,13,198,242,79,70,176,205,201,209,250,101,215,117,59,214,142,230, + 153,166,39,113,177,61,76,216,211,65,244,185,153,155,254,234,227,245,243,130,232,15,72,164,255,177,44,190,73,172,8,62,115,163,242,152,52,179,21,5, + 207,100,95,245,165,223,211,131,21,253,255,93,169,117,52,41,57,195,204,34,10,1,205,16,197,216,109,104,86,106,80,106,214,129,165,91,169,160,154,219, + 68,180,194,18,161,29,75,141,70,109,169,87,41,143,121,118,109,190,21,204,234,66,138,77,193,10,7,212,213,177,147,215,77,237,87,212,246,156,198,73, + 99,175,41,108,217,35,184,99,111,160,226,240,132,176,31,183,58,127,205,137,209,172,244,54,199,240,32,247,226,187,206,149,31,48,32,83,219,180,133,227, + 114,119,6,60,113,4,44,90,154,50,249,101,162,40,57,87,44,238,77,25,33,38,161,136,186,84,147,181,95,125,128,77,20,187,206,147,9,242,96,130, + 60,238,17,65,217,100,134,90,247,64,69,84,65,38,113,132,160,0,0,53,9,114,48,114,0,128,242,139,159,114,58,21,80,53,101,16,84,144,45,4, + 209,248,13,84,191,239,60,233,39,227,199,103,252,3,20,186,180,86,215,47,46,245,229,208,245,139,255,2,80,75,3,4,20,0,2,0,8,0,168,128, + 249,52,105,10,147,139,124,11,0,0,198,82,0,0,23,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,115,116,111,112,46,115,118, + 103,237,92,109,115,219,54,18,254,158,95,161,83,190,36,83,145,196,27,241,34,191,116,122,205,180,211,155,244,174,211,52,115,31,111,40,18,178,88,83, + 164,74,82,150,149,95,127,11,146,162,72,137,178,229,152,86,166,182,149,201,88,0,22,88,224,193,179,139,133,164,229,249,247,183,243,104,112,163,211,44, + 76,226,139,33,182,209,112,160,99,63,9,194,248,234,98,248,249,143,159,44,57,28,100,185,23,7,94,148,196,250,98,24,39,195,239,47,223,156,255,195, + 178,6,63,166,218,203,117,48,88,133,249,108,240,75,124,157,249,222,66,15,222,205,242,124,49,118,156,213,106,101,135,85,165,157,164,87,206,251,129,101, + 65,207,236,230,234,205,96,48,0,181,113,54,14,252,139,97,37,191,88,166,81,33,23,248,142,142,244,92,199,121,230,96,27,59,195,173,184,191,21,95, + 233,137,157,234,44,89,166,126,57,188,239,55,37,211,96,186,21,133,153,172,104,33,132,149,82,14,34,14,33,22,72,88,217,58,206,189,91,43,206,222, + 54,186,194,4,187,186,18,132,144,3,109,91,201,227,164,198,183,17,192,112,112,50,69,107,83,59,64,191,128,255,117,135,26,195,114,173,83,232,169,237, + 88,231,206,135,63,62,56,27,105,11,217,65,30,52,134,217,244,106,233,109,109,71,236,205,117,182,240,124,157,213,42,138,254,171,48,200,103,23,67,38, + 139,210,76,135,87,179,188,46,134,193,197,16,86,135,41,18,69,121,163,127,92,51,8,217,148,148,162,213,160,205,38,70,191,11,244,141,142,218,125,131, + 196,159,120,25,76,213,153,37,115,237,252,25,206,231,158,239,100,169,239,248,55,153,3,220,187,74,172,208,79,98,43,159,1,45,28,24,53,242,38,145, + 118,60,63,135,113,179,189,193,204,202,46,134,115,29,132,158,181,136,188,245,196,243,175,173,44,79,22,246,102,99,234,185,233,219,69,146,230,214,52,140, + 116,217,171,156,66,228,45,18,231,131,206,174,161,147,243,115,234,77,67,223,115,126,129,41,104,167,28,182,82,109,37,203,28,246,79,103,246,34,238,30, + 249,54,88,192,86,42,212,217,184,110,54,182,108,176,37,157,254,207,191,189,24,230,233,82,239,213,175,171,250,75,104,56,15,244,52,51,2,229,54,153, + 18,236,147,42,218,160,213,204,211,75,97,49,65,8,166,85,202,149,146,237,22,34,177,168,250,64,47,3,219,70,22,80,206,215,17,128,100,42,45,63, + 137,146,116,252,22,21,175,179,162,42,1,58,133,249,122,140,207,134,219,62,201,116,154,105,96,16,106,212,21,52,130,30,160,75,13,7,206,241,218,166, + 197,171,173,13,104,37,153,75,57,146,93,106,113,167,90,130,107,181,231,78,123,253,15,133,203,149,236,100,112,185,146,63,30,174,163,81,114,165,236,13, + 37,174,14,146,170,214,199,149,186,7,136,142,37,78,188,73,48,185,3,149,122,116,129,240,61,11,239,24,221,117,93,225,210,254,80,16,219,21,214,102, + 12,170,34,237,195,92,188,104,229,173,179,251,97,146,248,225,48,77,133,249,183,195,187,35,80,227,146,62,28,53,223,15,144,127,80,217,195,64,60,132, + 210,97,148,41,2,128,30,103,35,71,91,36,232,162,167,179,72,208,230,158,12,70,201,57,57,149,99,3,93,236,65,48,118,105,59,26,70,208,198,239, + 131,209,148,188,232,193,48,22,209,220,120,150,106,136,62,223,222,101,252,48,149,182,10,130,49,169,155,175,170,202,207,113,152,67,152,185,204,116,250,201, + 132,106,255,137,63,103,122,79,234,143,212,139,51,136,11,231,16,244,120,121,26,222,190,163,182,203,9,156,253,218,226,35,11,226,9,65,144,59,194,182, + 82,4,35,102,106,136,139,184,43,139,102,70,108,142,49,119,71,68,82,91,72,133,223,215,10,76,216,129,185,178,133,192,98,11,164,9,58,48,66,54, + 65,184,138,2,205,107,218,41,59,237,148,77,161,178,225,15,190,146,178,119,98,173,196,29,212,38,152,244,128,117,110,222,70,112,3,122,103,97,50,66, + 91,216,110,113,1,69,93,94,155,50,134,192,152,74,228,110,165,200,142,20,148,21,5,164,32,154,81,79,9,78,225,31,239,4,135,245,9,14,166,116, + 36,16,112,15,94,59,24,185,54,146,202,37,184,141,148,107,19,5,87,35,214,70,138,181,128,114,137,237,98,228,138,173,215,120,2,139,45,60,224,93, + 22,75,69,111,22,139,71,200,252,179,33,142,21,132,142,152,205,4,21,148,106,11,211,17,230,182,20,20,241,182,97,18,102,75,42,48,225,45,195,164, + 220,102,198,149,180,13,115,95,118,218,41,155,22,240,115,102,148,127,91,100,213,83,33,11,206,143,97,206,92,174,141,213,190,60,104,5,113,159,142,180, + 46,225,140,171,23,74,90,65,196,83,146,150,18,42,229,51,37,237,125,177,145,32,234,53,54,58,81,108,36,40,126,141,141,14,131,67,95,99,163,163, + 156,33,123,202,99,70,40,48,218,151,122,204,176,39,61,102,152,164,228,165,158,50,236,245,148,57,217,41,227,190,158,50,119,128,243,122,202,28,103,177, + 10,191,90,236,169,44,86,209,151,107,177,247,131,227,190,186,179,195,224,136,191,163,59,59,61,80,18,161,94,89,196,180,5,158,75,65,188,197,181,69, + 254,94,88,221,103,113,18,209,158,195,96,240,249,136,81,105,124,61,3,112,144,241,250,2,34,98,78,220,103,227,167,36,226,253,250,169,26,41,37,108, + 164,24,125,34,164,78,31,90,72,244,109,46,3,88,192,85,8,19,60,34,24,130,12,197,212,115,8,45,204,79,138,238,98,37,233,209,150,109,140,40, + 225,100,99,210,46,83,88,0,172,156,218,152,16,9,38,205,109,138,49,149,59,76,21,230,178,74,57,109,241,85,50,155,112,202,164,106,243,21,100,5, + 115,73,219,43,130,71,180,153,106,254,30,224,91,156,32,196,125,130,19,132,112,99,219,132,63,175,203,131,164,248,219,90,56,150,252,197,88,184,43,159, + 165,133,127,3,214,114,244,122,46,157,42,90,226,228,53,198,124,248,25,196,217,235,45,230,56,172,40,35,125,158,65,192,39,172,100,73,180,145,197,33, + 34,71,252,153,222,255,0,57,214,27,114,4,220,186,148,96,149,109,19,101,152,217,136,99,249,212,38,122,242,67,4,192,235,239,59,36,105,43,224,130, + 32,173,67,132,217,74,34,194,119,63,54,85,8,28,191,34,47,232,110,67,25,69,61,242,148,19,136,74,220,157,200,135,81,14,33,17,86,167,139,124, + 206,29,147,93,82,188,171,19,111,76,254,76,112,19,234,213,54,5,197,100,245,84,227,44,188,43,93,252,118,23,0,44,127,3,93,53,76,146,52,208, + 233,166,137,23,175,86,83,245,243,94,147,62,132,21,71,66,178,205,58,234,109,51,131,55,196,80,87,123,54,243,130,100,117,49,36,187,141,95,146,4, + 16,102,187,213,134,144,12,12,154,113,37,247,250,24,94,18,215,22,48,161,250,55,128,219,198,101,154,194,246,89,145,183,214,176,166,226,207,134,166,217, + 44,89,93,165,6,155,169,23,213,224,212,93,77,147,53,153,36,205,116,159,70,115,144,248,75,147,23,103,45,75,2,45,110,43,9,211,207,228,114,133, + 241,213,173,65,192,237,106,89,239,183,232,249,162,106,236,0,166,152,204,34,9,99,163,170,49,157,105,24,69,102,23,125,111,74,117,115,93,75,24,48, + 59,180,50,211,184,191,180,162,58,79,34,13,92,247,53,16,173,158,94,150,167,201,53,212,188,21,68,77,253,233,238,120,171,48,134,237,180,170,100,53, + 41,200,1,129,77,254,154,201,101,233,150,128,9,169,250,20,220,109,92,111,127,175,110,150,88,50,178,123,115,76,123,147,104,37,12,149,223,169,173,164, + 88,240,198,180,146,212,216,185,151,23,105,95,51,40,125,73,160,24,213,166,183,72,178,176,108,164,224,101,21,231,172,237,106,138,193,8,86,141,131,248, + 177,138,148,141,48,67,178,241,235,141,166,34,254,32,69,55,58,205,67,255,43,212,200,190,212,24,216,132,139,37,235,80,67,16,234,15,54,66,224,192, + 147,100,39,216,219,40,34,125,173,135,80,56,108,165,144,188,83,13,235,75,13,118,5,208,141,225,14,182,49,74,73,127,176,89,112,114,33,56,211,24, + 239,212,212,35,175,45,87,218,16,144,40,183,83,81,111,188,198,18,142,31,68,100,55,114,189,241,26,34,28,91,17,210,185,65,102,219,250,82,67,148, + 173,224,10,211,173,70,245,183,59,88,25,247,38,69,199,238,192,77,131,247,167,136,195,37,137,42,46,88,151,162,62,87,196,192,195,113,78,81,231,138, + 154,217,167,143,38,182,4,19,66,2,115,217,161,201,164,105,247,167,9,35,176,33,133,144,234,212,164,122,213,4,193,158,203,72,135,38,136,111,113,29, + 133,238,7,159,69,253,92,231,94,224,229,222,54,18,221,212,96,138,55,73,109,231,105,48,29,255,254,225,167,58,233,204,247,199,255,77,210,235,109,190, + 152,17,240,38,201,18,194,135,58,17,206,164,89,251,99,19,149,123,249,101,56,135,243,222,100,251,127,119,59,143,32,38,174,27,90,194,249,122,161,183, + 131,150,195,110,158,92,208,249,244,131,192,159,135,166,147,243,41,135,80,235,23,163,164,145,28,87,13,26,230,145,190,252,213,36,163,15,126,171,114,220, + 7,191,121,112,165,40,230,81,54,183,122,248,230,105,13,73,122,217,152,138,89,242,15,87,117,210,219,254,248,31,189,69,50,248,209,139,188,185,23,7, + 169,14,187,198,54,251,176,63,78,33,185,167,210,40,140,66,95,199,217,253,136,20,157,195,27,184,53,204,231,73,156,21,224,84,125,51,103,178,182,50, + 207,33,54,114,246,144,201,150,147,63,225,14,215,154,160,81,240,79,239,106,103,153,166,54,10,47,139,140,254,115,167,42,117,138,152,172,193,187,37,54, + 207,25,184,91,234,6,8,156,220,45,50,95,102,161,223,37,82,214,181,86,81,128,188,183,222,98,179,193,180,210,112,178,124,232,134,255,203,187,94,78, + 6,159,114,13,151,216,244,161,187,189,175,179,144,53,70,213,52,178,143,187,4,104,216,217,3,247,190,205,172,133,78,193,112,178,123,153,213,245,232,144, + 223,245,34,77,130,101,241,88,135,54,165,30,57,240,135,48,43,81,233,26,56,213,127,45,67,232,241,85,35,255,59,129,115,91,247,59,230,15,249,225, + 201,62,10,5,157,134,55,197,150,26,54,100,253,78,250,211,204,75,245,15,81,120,221,4,163,160,94,69,181,77,166,111,195,227,159,59,155,35,161,40, + 93,109,143,138,214,125,189,190,221,69,222,68,195,173,247,163,105,28,224,253,171,114,178,92,204,147,64,87,221,235,59,108,145,184,28,132,153,113,15,227, + 48,54,159,13,237,246,221,121,186,199,225,231,123,192,52,23,94,62,123,211,206,138,222,62,5,3,187,103,237,236,104,115,81,31,199,73,172,139,119,141, + 172,236,162,152,46,35,61,214,55,58,78,130,224,172,188,109,143,225,16,122,247,118,255,3,172,247,85,123,121,221,30,227,242,183,87,202,37,155,122,211, + 5,166,60,206,254,90,194,86,52,107,255,76,194,120,12,232,196,193,217,220,75,175,117,90,78,168,124,111,101,185,151,230,173,154,121,24,180,202,58,174, + 202,213,152,192,64,157,70,33,252,25,179,77,93,224,193,157,59,77,1,225,166,164,169,45,179,192,199,104,83,183,133,224,38,204,194,73,24,153,66,241, + 54,210,103,237,109,58,75,32,48,158,70,201,106,211,94,135,34,192,145,95,7,230,163,97,68,37,25,97,98,75,162,48,162,131,143,219,74,106,62,255, + 36,212,85,80,73,139,239,121,204,55,61,221,181,157,3,108,43,191,12,90,49,144,97,0,92,51,221,253,199,72,236,241,168,155,73,117,144,214,228,82, + 151,224,49,10,42,14,118,208,174,96,210,254,167,206,239,143,166,98,115,43,43,218,29,201,182,130,34,207,142,109,238,8,83,155,33,87,184,37,79,92, + 67,167,77,153,118,149,119,229,235,114,39,165,136,232,151,26,245,200,162,241,37,234,102,49,12,174,96,84,148,51,18,138,241,114,138,85,173,153,188,249, + 38,171,92,7,147,66,34,217,93,217,221,127,91,219,88,232,97,166,62,222,65,18,182,227,32,209,203,116,144,39,114,45,61,108,24,62,176,97,130,191, + 96,31,99,190,226,81,204,100,126,109,29,201,182,146,110,189,9,188,5,91,116,149,219,93,217,217,189,174,236,62,207,112,55,121,246,98,156,206,16,103, + 243,112,163,131,156,0,16,191,232,52,57,124,180,236,217,105,105,144,167,49,83,140,158,104,219,39,81,226,95,223,183,235,220,108,141,130,163,217,149,102, + 195,248,136,184,118,185,159,35,66,108,129,192,167,150,37,16,147,46,163,162,148,218,118,234,218,80,214,245,156,171,35,3,148,122,239,235,207,118,32,174, + 54,31,135,100,224,13,204,171,254,244,7,110,194,231,230,211,151,203,55,255,7,80,75,3,4,20,0,2,0,8,0,164,128,249,52,67,149,237,100,185, + 11,0,0,111,89,0,0,24,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,112,97,117,115,101,46,115,118,103,237,92,89,115,227, + 54,18,126,207,175,208,106,94,102,42,34,137,139,56,228,35,149,205,84,82,217,154,236,166,50,73,237,227,22,69,66,54,99,138,84,72,202,199,252,250, + 109,144,20,15,137,146,237,49,101,87,108,105,106,74,98,119,3,13,124,248,26,104,72,128,79,191,187,93,68,163,107,157,102,97,18,159,141,177,141,198, + 35,29,251,73,16,198,23,103,227,63,126,255,209,146,227,81,150,123,113,224,69,73,172,207,198,113,50,254,238,252,155,211,127,88,214,232,135,84,123,185, + 14,70,55,97,126,57,250,57,190,202,124,111,169,71,239,47,243,124,57,117,156,155,155,27,59,172,132,118,146,94,56,31,70,150,5,37,179,235,139,111, + 70,163,17,184,141,179,105,224,159,141,43,251,229,42,141,10,187,192,119,116,164,23,58,206,51,7,219,216,25,55,230,126,99,126,163,103,118,170,179,100, + 149,250,101,245,190,223,182,76,131,121,99,10,45,185,161,133,17,86,74,57,136,56,132,88,96,97,101,119,113,238,221,90,113,246,174,85,20,26,216,87, + 148,32,132,28,208,53,150,15,179,154,222,70,0,195,206,198,20,218,182,119,128,126,9,255,235,2,53,134,101,95,231,80,82,219,177,206,157,143,191,127, + 116,214,214,22,178,131,60,104,85,179,46,213,241,219,25,142,216,91,232,108,233,249,58,171,93,20,229,111,194,32,191,60,27,51,185,188,45,158,47,117, + 120,113,153,183,4,97,112,54,134,30,98,138,68,241,188,110,195,180,102,17,178,41,41,77,171,138,219,42,70,191,13,244,181,142,186,101,131,196,159,121, + 25,52,215,185,76,22,218,249,51,92,44,60,223,201,82,223,241,175,51,7,248,119,145,88,161,159,196,86,126,9,212,112,160,214,200,155,69,218,241,252, + 28,234,205,182,42,51,189,59,27,47,116,16,122,214,50,242,238,102,158,127,101,45,189,85,6,56,86,163,83,55,78,223,46,147,52,183,230,97,164,203, + 98,101,27,34,111,153,56,31,117,118,149,39,75,231,167,212,155,135,190,231,252,12,109,208,78,89,111,229,219,74,86,57,12,162,206,236,101,220,95,243, + 109,176,132,241,84,168,87,121,183,86,158,131,246,52,208,243,204,88,149,48,155,39,192,89,21,58,208,26,55,94,10,109,9,66,8,143,210,174,180,236, + 106,136,196,162,42,3,165,50,232,192,218,22,80,202,239,34,232,163,17,90,126,18,37,233,244,29,42,94,39,133,40,1,74,132,249,221,20,159,140,155, + 50,201,124,158,105,224,0,106,201,10,26,64,9,240,165,198,35,231,225,222,230,197,171,235,13,104,33,153,75,57,146,125,110,113,175,91,130,107,183,167, + 78,183,255,143,133,203,149,236,217,224,114,37,127,58,92,15,70,201,149,114,48,148,184,218,73,170,218,31,87,234,30,32,122,186,56,243,102,193,108,15, + 42,117,237,2,225,123,58,222,83,187,235,186,194,165,195,161,32,154,30,214,177,12,174,34,237,67,91,188,232,198,187,203,238,135,73,226,199,195,52,23, + 230,223,6,239,30,128,26,151,244,241,168,249,126,128,252,157,206,30,7,226,46,148,118,163,76,17,0,244,180,24,121,112,68,130,47,250,124,17,9,222, + 220,103,131,81,114,78,158,107,98,3,95,236,81,48,246,121,123,48,140,224,141,223,7,163,121,242,162,71,195,88,100,100,211,203,84,67,6,249,110,95, + 240,67,83,186,46,8,198,164,86,95,84,194,63,226,48,135,84,17,50,143,244,179,73,183,254,19,255,145,233,45,171,223,83,47,206,32,183,91,64,210, + 226,229,105,120,251,158,218,46,39,176,246,107,139,79,44,200,203,5,65,238,4,219,74,17,140,152,145,16,23,113,87,22,106,70,108,142,49,119,39,68, + 82,91,72,133,63,212,14,252,91,0,144,43,91,8,44,26,32,253,59,144,34,100,19,132,171,44,206,188,230,189,182,243,94,219,20,132,173,249,224,43, + 41,187,23,107,37,246,80,155,96,50,0,214,185,249,24,193,46,230,189,133,137,93,16,114,130,202,119,212,96,120,139,11,92,234,231,59,243,140,33,203, + 165,18,185,141,21,217,176,130,103,69,1,54,72,109,212,33,145,42,38,203,189,72,177,33,145,194,148,22,8,77,4,2,54,194,107,3,40,215,70,82, + 185,4,119,225,114,109,162,96,195,195,186,112,177,14,90,46,177,93,140,92,209,204,35,7,136,225,98,78,220,23,195,84,12,22,195,184,162,82,205,169, + 246,7,72,119,5,161,19,102,51,65,5,165,218,194,116,130,185,45,5,69,188,27,191,132,217,146,10,76,120,39,126,41,183,153,153,113,186,241,187,109, + 59,239,181,77,139,49,225,204,56,127,89,184,213,179,194,13,19,39,195,156,185,28,240,38,111,16,111,65,220,225,240,158,160,73,135,201,46,225,140,171, + 55,202,100,65,196,161,144,53,164,165,132,74,249,74,73,123,95,94,37,136,58,230,85,207,148,87,9,138,7,206,171,38,175,39,149,130,117,122,224,84, + 234,149,102,81,130,29,114,153,17,10,130,246,173,46,51,236,160,203,12,147,148,188,213,85,134,29,87,153,103,91,101,220,227,42,179,7,156,227,42,243, + 176,136,85,248,24,177,207,21,177,138,190,221,136,189,31,28,247,56,157,237,6,71,252,29,167,179,231,7,74,34,52,40,139,152,182,96,230,82,144,111, + 113,109,145,191,23,86,247,69,156,68,116,224,52,216,124,123,200,168,52,115,61,115,205,247,134,240,73,64,70,204,137,251,106,230,41,137,248,176,243,84, + 141,148,18,54,82,140,30,8,169,231,79,45,36,122,153,205,0,22,176,21,194,4,79,8,134,36,67,49,245,26,82,11,115,28,105,31,43,201,128,177, + 108,99,68,9,39,235,144,118,153,194,2,96,229,212,198,132,72,8,105,110,83,140,169,220,96,170,48,155,85,202,105,135,175,146,217,132,83,38,85,151, + 175,96,43,152,75,186,179,34,204,136,54,83,237,179,4,47,177,130,16,247,0,43,8,225,38,182,9,127,93,155,7,73,241,203,70,56,150,252,205,68, + 184,43,95,101,132,191,0,107,57,58,174,75,207,149,45,113,114,204,49,31,191,6,113,246,119,220,197,156,58,230,180,117,241,169,62,72,110,142,131,7, + 215,161,190,105,142,100,155,83,234,85,61,75,239,66,23,103,217,0,162,242,76,96,165,152,37,105,160,211,181,138,23,175,142,170,58,238,102,142,195,99, + 197,145,144,108,61,43,213,3,99,42,111,153,161,62,125,118,233,5,201,205,217,152,108,42,191,36,201,162,57,55,215,12,182,9,62,4,253,134,52,65, + 108,41,77,12,42,91,113,201,169,187,165,92,165,41,12,144,21,121,119,26,250,84,188,173,171,207,46,147,155,139,212,96,51,247,162,26,156,186,168,81, + 89,179,89,114,107,6,117,181,165,14,18,127,101,238,122,88,171,146,34,213,37,3,67,138,48,48,247,19,194,248,226,214,32,224,246,105,238,182,53,122, + 177,172,148,61,192,20,141,89,38,97,108,92,181,154,51,15,163,200,140,162,239,205,169,110,247,107,5,21,102,187,122,102,148,219,93,43,196,121,18,105, + 160,176,175,1,212,186,121,89,158,38,87,32,121,39,136,154,251,243,205,250,110,194,24,134,211,170,46,96,72,65,118,24,172,111,100,152,179,221,253,22, + 208,32,69,240,14,229,93,115,126,211,116,177,100,100,255,224,24,125,155,104,37,12,213,204,82,71,73,209,225,117,104,37,169,137,100,47,47,110,123,92, + 194,211,151,4,30,163,58,244,150,73,22,150,74,42,97,165,225,156,117,167,224,162,50,130,85,43,53,124,170,35,101,35,204,144,108,253,34,217,118,196, + 31,229,232,90,167,121,232,127,133,27,57,148,27,3,155,112,177,100,61,110,8,66,195,193,70,136,173,164,36,27,147,253,218,17,25,170,63,132,218,144, + 83,9,201,123,221,176,161,220,96,87,0,221,24,238,97,27,163,148,12,7,155,69,97,183,196,9,99,188,215,211,128,188,182,92,105,35,200,97,220,94, + 71,131,241,26,75,115,138,142,200,126,228,6,227,53,100,126,182,34,164,119,128,204,176,13,229,134,192,26,7,41,76,191,27,53,220,232,152,181,20,22, + 83,209,51,58,144,119,240,225,28,193,190,7,81,197,5,235,115,52,100,143,24,204,112,156,83,212,219,163,246,109,172,39,19,27,54,198,8,9,204,101, + 143,39,115,237,112,56,79,24,65,12,41,132,84,175,39,53,168,39,72,246,92,70,122,60,193,110,21,215,89,232,118,242,89,200,23,58,247,2,47,247, + 154,76,116,45,193,20,175,47,121,156,166,193,124,250,219,199,31,235,75,24,190,63,253,111,146,94,53,247,39,140,129,55,75,86,144,62,212,23,67,204, + 181,67,127,106,242,110,47,63,15,23,176,222,155,27,172,223,222,46,34,200,137,107,69,199,56,191,91,234,166,210,178,218,245,109,220,222,27,189,129,191, + 8,77,33,231,115,14,169,214,207,198,73,235,178,72,85,105,152,71,250,252,23,115,183,114,244,107,117,103,115,244,171,185,179,89,180,163,84,119,74,248, + 230,6,114,146,158,183,154,98,186,252,253,69,125,9,100,187,254,79,222,50,25,253,224,69,222,194,139,131,84,135,125,117,155,113,216,174,167,176,220,114, + 105,28,70,161,175,227,236,126,68,138,194,225,53,236,26,22,139,36,206,10,112,170,178,153,51,187,179,50,207,33,54,114,182,144,201,86,179,63,97,151, + 214,105,160,113,240,79,239,98,163,155,70,26,133,231,197,5,213,83,167,122,234,53,89,150,192,238,53,169,6,97,191,213,53,48,56,217,111,178,88,101, + 161,223,103,82,202,58,221,40,80,222,234,112,49,218,16,91,105,56,91,61,118,196,255,229,93,173,102,163,207,185,134,125,106,250,216,225,222,246,89,216, + 154,168,106,71,217,167,77,6,180,2,237,145,131,223,165,214,82,167,16,57,217,189,212,234,187,15,255,155,94,166,73,176,42,174,41,119,57,245,196,138, + 63,134,89,137,74,95,197,169,254,107,21,66,137,175,170,249,223,9,44,220,122,216,58,191,207,119,55,246,73,40,232,52,188,46,134,212,176,33,27,182, + 209,159,47,189,84,127,31,133,87,109,48,10,234,85,84,91,95,125,107,77,249,167,206,122,77,40,158,46,154,181,162,179,97,175,183,119,145,55,211,176, + 237,253,100,148,35,188,189,87,78,86,203,69,18,232,170,120,189,137,45,110,242,5,97,102,166,135,105,24,155,175,127,214,235,207,69,103,109,35,146,182, + 110,12,47,189,252,178,117,145,111,237,38,253,159,249,230,161,181,251,220,212,222,110,107,161,114,83,27,236,77,220,150,24,164,191,140,204,111,21,146,187, + 220,157,96,98,75,162,48,162,163,79,45,41,101,176,171,33,212,85,32,53,159,49,225,174,220,33,237,175,161,145,126,25,109,223,161,109,110,180,99,247, + 164,123,211,209,124,201,48,141,147,88,23,159,90,55,44,139,199,116,21,233,169,190,214,113,18,4,39,229,55,5,83,88,64,223,191,219,254,177,236,67, + 165,47,191,42,152,226,242,44,132,114,201,90,110,138,0,124,211,236,175,21,176,168,45,253,51,9,227,41,12,108,28,156,44,188,244,74,167,101,131,202, + 207,86,150,123,105,222,145,44,194,160,243,172,227,234,185,170,19,130,71,167,81,8,111,83,182,150,5,94,6,228,77,129,28,109,75,35,45,111,116,78, + 209,90,214,64,112,29,102,225,44,140,204,67,241,49,210,39,93,134,157,36,144,212,207,163,228,102,173,111,135,197,6,181,106,122,180,14,153,54,244,96, + 144,150,79,48,181,25,114,133,91,142,108,33,130,113,95,139,204,199,29,162,158,130,181,168,143,15,61,20,40,70,117,251,231,230,15,15,166,69,27,214, + 138,2,15,28,249,98,184,94,239,200,239,198,252,233,97,135,182,195,174,116,128,223,86,216,237,11,40,161,24,239,70,148,107,0,234,70,212,166,168,175, + 100,35,235,196,84,29,217,162,245,203,204,189,171,69,207,74,243,128,185,3,227,173,174,138,170,113,205,172,176,22,209,102,86,48,31,119,136,122,10,214, + 162,7,206,29,3,240,24,109,240,184,58,74,167,196,113,14,25,181,255,138,16,32,169,205,150,53,131,129,48,175,241,192,201,11,107,253,208,187,102,152, + 180,17,134,212,162,224,133,98,68,184,210,112,165,150,18,106,83,72,170,164,42,73,133,48,69,76,78,8,177,5,82,92,116,132,80,129,116,25,21,157, + 242,77,173,251,83,151,222,204,101,253,247,71,118,178,15,198,235,139,78,147,221,171,212,214,68,89,206,136,207,51,79,98,116,32,134,205,162,196,191,218, + 77,176,83,231,162,47,57,134,205,55,145,140,109,255,41,153,30,210,236,163,91,190,235,143,25,40,65,136,50,167,136,247,175,149,135,207,87,93,121,204, + 87,251,23,206,151,217,168,52,75,28,147,135,89,68,31,153,250,114,116,76,125,135,200,190,14,186,157,105,88,227,162,3,165,94,131,124,35,224,146,23, + 205,80,15,153,185,113,114,220,129,188,216,246,143,179,99,218,220,51,255,60,219,150,168,21,225,236,160,171,214,49,11,30,50,11,126,236,6,199,28,138, + 20,130,203,238,6,135,217,176,231,65,76,125,245,14,167,197,30,254,36,246,60,100,159,184,145,249,23,111,167,230,39,213,243,111,254,15,80,75,3,4, + 20,0,2,0,8,0,165,128,249,52,158,228,190,4,151,9,0,0,193,42,0,0,24,0,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107, + 45,115,116,97,114,116,46,115,118,103,237,89,235,115,219,184,17,255,158,191,130,85,190,196,115,34,137,7,159,178,229,155,52,158,235,164,147,235,221,92, + 146,233,199,14,68,66,18,99,138,224,145,148,37,229,175,239,2,124,75,148,45,219,236,181,211,86,153,140,73,236,11,216,253,45,176,11,222,252,184,223, + 196,218,3,207,242,72,36,243,9,54,208,68,227,73,32,194,40,89,205,39,95,191,252,164,123,19,45,47,88,18,178,88,36,124,62,73,196,228,199,219, + 55,55,127,210,117,237,67,198,89,193,67,109,23,21,107,237,99,114,159,7,44,229,218,187,117,81,164,51,211,220,237,118,70,84,13,26,34,91,153,87, + 154,174,131,100,254,176,122,163,105,26,152,77,242,89,24,204,39,21,127,186,205,98,197,23,6,38,143,249,134,39,69,110,98,3,155,147,150,61,104,217, + 119,124,97,100,60,23,219,44,40,213,7,65,151,51,11,151,45,43,204,100,71,21,19,246,125,223,68,196,36,68,7,14,61,63,36,5,219,235,73,254, + 182,35,10,19,28,18,37,8,33,19,104,45,231,101,92,179,125,12,110,56,59,25,69,237,90,7,215,167,240,191,17,104,124,88,174,117,9,146,220,72, + 120,97,222,125,185,51,107,110,29,25,97,17,118,212,212,82,61,187,189,112,36,108,195,243,148,5,60,111,76,40,249,93,20,22,235,249,196,242,210,189, + 122,95,243,104,181,46,58,3,81,56,159,192,10,49,69,174,122,175,231,48,107,80,132,12,74,74,214,74,113,151,100,209,31,66,254,192,227,190,108,40, + 130,5,203,97,186,230,90,108,184,249,45,218,108,88,96,230,89,96,6,15,185,9,248,91,9,61,10,68,162,23,107,128,134,9,90,99,182,136,185,201, + 130,2,244,230,39,202,228,234,230,147,13,15,35,166,167,49,59,44,88,112,175,3,142,179,194,168,163,211,76,142,239,83,145,21,250,50,138,121,41,86, + 206,33,102,169,48,239,120,126,95,136,212,252,75,198,150,81,192,204,143,48,7,110,150,122,43,219,186,216,22,16,68,158,27,105,50,172,121,31,166,16, + 79,31,13,18,15,53,241,22,168,55,33,95,230,146,171,116,179,124,3,63,251,138,6,84,105,134,101,48,151,48,130,244,40,249,74,206,62,133,56,158, + 85,201,128,84,14,11,168,121,171,240,193,8,240,56,147,118,88,44,151,57,135,48,163,206,88,94,28,98,94,114,235,129,136,69,54,123,187,84,191,107, + 53,36,0,61,81,113,152,225,235,137,102,62,109,205,27,176,134,31,183,134,212,239,172,181,27,179,191,236,231,122,201,62,239,165,203,39,243,184,11,155, + 245,219,224,237,179,94,186,208,209,232,250,9,23,118,172,121,99,121,201,70,174,253,12,47,177,112,129,152,247,66,47,129,45,247,89,94,178,28,203,181, + 172,35,107,23,58,9,140,249,163,65,201,241,91,19,77,134,195,36,99,30,128,121,22,239,216,33,127,58,35,125,58,82,70,94,146,144,190,253,252,132, + 12,105,232,6,203,177,188,70,169,133,38,175,75,137,139,161,5,182,200,235,19,208,112,136,231,57,182,239,92,154,137,96,214,122,161,187,206,161,168,102, + 80,149,195,108,157,113,168,116,222,14,228,236,35,104,165,168,221,250,87,213,224,215,36,42,160,164,217,230,60,251,44,203,130,95,146,175,57,111,141,225, + 249,196,197,6,172,222,183,91,217,3,140,98,98,25,24,59,54,105,121,9,240,34,195,3,136,89,237,232,1,70,59,144,171,205,126,201,88,146,67,81, + 179,153,79,10,249,24,67,73,249,78,183,108,3,246,90,139,76,117,48,138,64,141,125,213,122,81,74,178,120,76,127,245,211,23,252,213,55,65,40,182, + 158,233,175,129,229,109,88,145,69,251,119,54,20,71,22,128,145,235,176,58,240,18,117,8,245,166,196,64,216,183,92,58,69,6,38,158,237,120,83,29, + 219,216,240,177,111,79,49,242,12,228,58,222,85,163,61,216,131,223,145,107,192,54,223,78,44,56,204,39,30,53,124,31,121,157,233,46,135,88,151,131, + 172,153,12,166,97,219,216,233,98,118,124,116,170,234,228,209,189,20,141,230,109,44,221,137,61,60,69,240,175,121,209,109,185,120,136,234,84,7,55,80, + 7,33,255,170,15,117,4,174,167,39,80,71,216,112,45,124,10,117,223,198,199,80,247,60,195,39,212,37,245,17,115,99,202,98,78,61,53,117,170,172, + 54,195,135,136,239,218,138,79,22,193,149,158,148,173,184,218,139,192,129,229,102,84,17,22,34,11,121,86,147,28,245,235,145,170,237,74,86,219,216,119, + 144,235,89,245,185,210,132,77,42,239,176,149,181,13,26,226,202,215,44,20,187,249,132,28,19,191,11,177,105,55,189,22,16,0,56,203,50,108,23,128, + 116,34,35,49,10,24,243,61,68,154,122,176,37,110,179,12,130,168,67,185,206,97,101,234,79,173,62,95,139,221,42,147,30,90,178,184,113,81,35,42, + 73,250,98,33,246,114,23,217,158,144,161,33,216,202,134,82,223,150,48,170,58,25,9,156,40,148,77,16,116,187,123,233,7,123,136,114,56,165,240,77, + 90,17,7,28,163,38,147,138,40,145,166,58,211,129,6,35,134,128,217,54,248,134,118,215,181,5,133,249,185,149,73,226,233,210,212,112,33,98,14,136, + 15,224,228,194,205,244,242,34,19,247,252,216,78,163,111,23,37,16,78,189,234,242,60,151,156,97,168,219,62,187,233,18,142,57,96,66,148,156,35,130, + 207,108,167,27,188,18,153,195,225,145,244,46,212,74,71,84,251,79,147,45,106,201,117,138,137,76,230,59,43,84,83,185,134,183,239,2,94,227,38,5, + 83,145,71,37,145,66,34,250,14,212,137,189,45,71,41,35,144,181,237,70,247,90,67,62,108,225,22,242,44,123,208,144,243,44,67,208,47,23,208,110, + 62,223,140,55,150,25,233,54,215,198,71,59,117,105,134,192,78,49,154,219,136,220,14,60,216,151,7,13,145,177,214,67,96,199,71,158,219,233,121,187, + 102,172,177,204,96,219,5,184,89,120,0,109,22,165,100,60,183,233,212,49,144,67,44,203,25,180,52,34,174,117,27,202,143,94,187,208,53,52,26,174, + 177,39,143,33,226,13,123,110,52,92,203,90,200,39,100,48,64,50,108,99,153,33,190,225,83,228,13,155,241,199,139,14,246,229,246,230,185,3,209,177, + 49,114,198,51,228,80,3,81,223,113,173,33,67,99,174,200,130,29,206,113,40,26,92,17,193,35,2,219,131,20,66,46,118,188,1,75,242,118,115,60, + 75,170,132,247,161,204,28,180,228,143,106,9,138,62,219,34,3,150,40,198,184,169,70,79,139,80,53,190,225,5,11,89,193,218,138,180,30,193,20,202, + 185,186,3,11,151,179,223,238,126,106,154,233,32,152,253,93,100,247,109,251,43,25,216,66,108,161,128,104,26,124,121,187,25,204,100,117,206,138,219,104, + 3,231,189,188,40,255,97,191,137,161,54,110,8,61,230,226,144,242,86,105,169,182,190,244,31,252,112,16,6,155,72,10,153,159,11,40,182,62,74,35, + 157,166,191,82,26,21,49,191,253,89,94,225,106,191,86,87,195,218,103,121,53,172,230,81,146,123,18,129,252,208,33,178,219,206,84,228,146,223,175,154, + 30,254,84,255,39,150,10,237,3,139,217,134,37,97,198,163,33,221,50,14,167,122,20,231,137,73,105,48,142,2,158,228,79,123,68,9,71,15,208,61, + 108,54,34,201,149,115,42,217,220,92,28,244,156,153,208,111,154,39,158,201,183,139,111,208,203,245,38,40,13,252,153,173,142,150,41,71,227,232,86,222, + 172,223,152,213,203,32,135,186,41,127,130,101,155,71,193,227,44,15,128,94,241,56,75,170,218,133,33,158,114,172,183,6,229,226,147,213,170,80,67,98, + 101,209,98,251,220,112,255,149,221,111,23,128,34,14,173,108,246,220,88,159,218,84,188,50,165,186,41,246,233,56,252,157,44,123,102,228,251,184,74,121, + 6,105,147,63,137,171,161,111,110,191,241,52,19,225,86,125,10,233,3,234,149,138,239,162,188,244,202,144,226,140,255,190,141,64,226,69,154,255,38,224, + 212,230,227,234,124,95,156,159,236,171,188,192,179,232,65,133,84,162,33,31,119,210,159,215,44,227,239,227,232,190,235,12,5,189,10,106,245,181,101,103, + 191,191,49,235,3,65,189,173,78,122,95,177,77,55,34,228,85,255,62,105,15,18,245,110,29,247,126,49,91,112,232,138,101,14,136,44,17,77,19,171, + 238,99,195,40,151,121,61,139,18,121,69,84,159,93,171,35,157,248,140,206,79,146,168,225,201,101,83,28,54,89,121,32,101,197,186,118,113,123,114,130, + 14,121,216,64,235,30,192,175,119,224,74,1,226,120,237,157,16,140,253,172,97,50,165,190,97,107,159,228,147,15,127,160,203,66,142,239,123,83,104,79, + 60,236,34,215,47,105,138,235,187,214,72,87,147,235,127,137,146,247,9,48,137,132,171,167,206,149,184,122,205,182,49,159,241,7,14,179,12,175,203,75, + 129,25,156,148,239,78,175,62,209,85,69,47,111,5,102,24,42,74,248,121,148,214,227,82,4,124,55,203,127,223,2,98,186,163,223,68,148,204,192,161, + 73,120,189,97,217,61,207,202,9,149,207,229,7,215,222,200,38,10,123,239,60,169,222,43,157,144,40,60,139,35,248,51,179,234,177,144,229,0,212,12, + 130,210,229,148,163,229,205,251,12,213,99,173,11,30,162,60,90,68,177,124,81,143,49,191,238,71,246,90,64,245,190,140,197,174,161,183,151,252,216,62, + 253,150,147,253,35,232,223,192,244,105,135,138,214,20,114,93,196,12,49,94,98,224,124,212,85,32,79,47,169,175,46,70,66,215,147,117,212,75,3,212, + 249,95,138,250,113,126,26,22,116,239,206,148,186,144,142,216,42,179,177,26,195,213,53,169,76,95,104,190,29,68,92,203,157,170,123,5,219,181,188,46, + 107,35,222,73,225,122,87,160,180,211,171,157,221,75,254,32,28,189,122,247,160,200,185,250,63,142,254,29,56,34,150,235,255,199,224,168,254,90,250,242, + 237,231,210,179,70,133,248,191,14,45,126,141,12,207,181,106,180,148,99,128,16,159,66,137,32,193,98,27,182,79,9,110,176,210,229,107,100,191,107,160, + 145,214,163,196,144,119,132,74,154,26,182,131,125,167,39,93,243,129,106,236,149,86,78,101,7,193,215,185,175,61,7,190,243,0,172,128,212,158,184,246, + 245,75,64,5,33,250,206,51,113,30,84,228,24,84,229,94,243,199,236,64,24,253,139,64,181,136,69,112,255,20,166,32,138,112,208,200,32,218,14,177, + 171,184,202,17,98,25,240,254,65,195,158,65,144,227,200,218,19,70,144,77,176,173,1,52,48,194,142,93,129,196,178,168,163,81,192,27,49,64,178,163, + 163,214,58,132,12,74,253,23,87,79,23,110,103,55,38,244,242,55,242,246,232,246,205,63,1,80,75,3,4,20,0,2,0,8,0,4,134,250,52,115, + 77,182,120,141,10,0,0,123,45,0,0,16,0,0,0,109,101,100,105,97,45,114,101,99,111,114,100,46,115,118,103,229,90,89,143,227,54,18,126,159, + 95,161,245,188,100,16,139,226,45,210,125,4,179,25,36,8,144,236,2,57,176,143,11,181,68,187,149,145,37,71,146,187,237,249,245,91,164,37,89,178, + 228,62,102,156,236,67,186,209,104,139,85,172,34,191,250,84,197,195,215,223,236,214,153,247,96,202,42,45,242,155,25,65,120,230,153,60,46,146,52,95, + 221,204,126,251,245,59,95,205,188,170,142,242,36,202,138,220,220,204,242,98,246,205,237,155,235,127,248,190,247,109,105,162,218,36,222,99,90,223,123,63, + 228,31,171,56,218,24,239,171,251,186,222,44,130,224,241,241,17,165,77,35,42,202,85,240,206,243,125,232,89,61,172,222,120,158,7,110,243,106,145,196, + 55,179,70,127,179,45,51,167,151,196,129,201,204,218,228,117,21,16,68,130,217,81,61,62,170,63,154,59,84,154,170,216,150,241,193,124,28,247,53,203, + 100,121,84,133,145,60,50,167,68,180,214,1,166,1,165,62,104,248,213,62,175,163,157,159,87,111,123,93,97,128,83,93,41,198,56,0,217,81,243,101, + 90,139,93,6,48,156,29,140,147,246,189,3,244,27,248,235,58,116,24,30,230,186,132,158,6,229,166,14,62,252,250,33,104,181,125,140,146,58,233,153, + 105,123,13,252,14,194,145,71,107,83,109,162,216,84,157,11,215,255,49,77,234,251,155,25,87,155,157,123,190,55,233,234,190,238,53,164,201,205,12,102, + 72,24,14,221,115,59,134,69,199,34,140,24,61,168,54,134,251,34,206,190,78,204,131,201,134,125,147,34,190,139,42,24,110,112,95,172,77,240,123,186, + 94,71,113,80,149,113,16,63,84,1,240,111,85,248,105,92,228,126,125,15,212,8,192,106,22,221,101,38,136,226,26,236,86,35,99,118,118,55,179,181, + 73,210,200,47,77,92,148,9,106,163,210,13,202,236,54,69,89,251,203,52,51,7,245,131,239,44,218,20,193,7,83,125,172,139,77,240,125,25,45,211, + 56,10,126,0,223,38,56,216,107,124,250,197,182,134,224,153,10,109,242,105,203,187,100,3,113,212,120,82,184,111,133,183,32,189,78,204,178,178,90,7, + 120,237,19,224,171,157,12,164,214,77,84,194,88,146,20,94,139,131,222,65,115,40,97,138,133,77,31,232,85,193,4,90,93,64,167,222,103,48,71,219, + 232,199,69,86,148,139,183,216,253,92,185,166,2,168,144,214,251,5,185,154,29,251,20,203,101,101,32,246,184,215,230,194,15,61,192,151,158,121,193,203, + 189,45,221,207,208,27,70,161,98,2,11,194,167,220,146,73,183,156,116,110,175,131,225,252,95,9,23,165,226,53,112,153,37,213,84,191,16,30,176,253, + 58,120,226,216,6,227,133,40,80,42,63,23,133,150,134,224,54,51,49,216,143,178,199,104,95,205,158,96,21,227,120,246,101,113,126,57,171,24,167,95, + 206,170,23,147,137,113,254,151,193,168,164,164,127,213,203,9,190,248,171,96,156,242,246,98,24,193,155,124,14,70,251,20,101,175,134,209,149,199,197,125, + 105,160,156,191,157,192,179,15,247,208,5,165,84,117,226,85,211,248,91,158,214,80,183,183,149,41,127,177,181,239,223,249,111,149,25,105,253,90,70,121, + 5,133,118,13,21,36,170,203,116,247,21,153,99,251,139,4,147,33,101,115,159,33,202,137,20,212,248,132,205,137,68,42,100,88,190,235,12,197,187,155, + 25,229,8,178,49,161,242,216,186,191,153,49,137,56,37,132,134,93,235,114,82,119,57,169,91,2,254,2,73,206,67,200,243,29,224,151,135,214,189,241, + 231,161,37,76,94,14,90,134,164,80,138,104,11,42,97,76,41,192,84,206,9,10,137,6,180,221,3,69,88,225,80,209,185,47,41,2,220,249,156,80, + 20,74,138,249,9,228,4,65,130,38,106,8,185,13,22,81,84,51,62,196,124,164,188,156,86,182,160,179,63,19,109,87,134,158,34,178,100,195,105,82, + 36,6,51,164,10,17,34,49,215,195,9,246,213,150,147,106,118,106,28,72,29,170,222,171,116,62,84,20,49,41,132,132,56,112,164,57,165,156,186,240, + 8,196,132,14,101,27,43,138,169,226,2,194,9,197,157,10,18,194,39,142,40,211,186,247,130,60,77,154,14,235,207,204,189,79,49,219,174,144,158,90, + 64,241,35,214,59,226,88,18,98,202,212,17,179,61,180,42,164,9,17,140,28,73,178,163,78,87,1,190,228,136,250,30,90,153,64,130,75,130,213,107, + 39,255,151,19,13,38,47,46,246,90,95,142,43,127,34,229,15,88,95,7,118,189,237,62,117,91,8,187,33,72,30,82,243,120,92,148,219,253,73,99, + 102,19,173,140,43,156,0,241,97,1,210,8,238,96,163,97,202,86,36,221,207,64,212,212,86,187,17,34,132,193,156,187,161,117,129,181,198,123,106,120, + 74,94,221,71,73,241,8,243,59,21,126,42,138,245,177,72,31,201,178,59,148,19,173,41,99,35,161,173,53,128,137,22,29,73,143,178,109,89,66,124, + 253,44,218,27,152,146,251,215,90,175,238,139,199,85,105,161,89,70,89,135,77,215,213,138,252,187,187,2,92,215,229,118,36,134,77,218,214,110,242,253, + 237,129,97,205,238,210,114,42,77,236,198,52,205,87,59,11,128,152,146,236,199,18,179,222,52,194,9,92,220,96,54,69,154,91,87,189,225,192,230,47, + 131,72,13,150,246,110,94,91,48,88,157,155,153,21,142,167,230,154,235,34,51,240,50,196,176,190,34,221,240,170,186,44,62,154,83,63,157,189,199,52, + 135,104,250,205,206,91,133,244,140,66,187,21,151,103,53,96,64,92,243,51,66,23,102,222,155,228,129,146,211,225,177,242,62,211,14,64,52,169,169,123, + 77,220,148,219,87,171,40,109,42,136,106,183,209,191,135,167,79,5,60,102,221,171,183,41,170,244,32,100,144,64,53,44,81,135,217,200,25,163,68,247, + 150,228,95,234,72,35,76,56,238,231,181,190,35,249,42,71,15,166,172,211,248,51,220,168,75,185,177,176,133,130,40,62,225,134,194,222,241,98,176,65, + 30,213,74,81,69,38,29,209,75,205,135,50,164,177,10,123,75,176,190,27,126,41,55,68,132,64,55,78,38,216,198,25,163,151,131,205,135,20,139,37, + 229,92,78,122,186,32,175,125,161,16,166,82,139,73,71,23,227,53,81,80,127,160,68,79,35,119,49,94,19,12,1,162,116,50,64,54,108,151,114,67, + 53,210,12,171,105,55,250,114,209,33,218,166,55,21,78,68,71,16,44,47,231,72,50,132,153,150,33,159,114,116,201,25,113,200,112,82,50,60,57,35, + 74,46,72,108,5,175,16,14,73,111,131,121,244,100,79,156,47,231,9,150,228,8,107,140,245,164,39,125,81,79,176,218,19,156,78,120,98,132,144,110, + 25,58,94,125,186,246,181,169,163,36,170,163,227,82,180,109,33,140,180,71,74,215,101,178,92,252,252,225,187,238,200,39,142,23,255,41,202,143,199,211, + 26,171,16,221,21,91,88,64,116,199,80,246,228,57,94,216,133,123,84,223,166,107,168,247,246,242,226,235,221,58,131,69,113,39,24,40,215,251,141,57, + 26,61,152,109,47,98,38,47,115,146,120,157,218,78,193,47,53,44,182,126,176,78,122,71,83,141,209,180,206,204,237,79,246,120,221,251,217,29,215,59, + 255,135,230,129,102,108,47,157,138,242,182,55,4,59,213,247,171,238,168,105,108,247,199,104,83,120,223,70,89,180,142,242,164,52,233,148,109,139,255,216, + 142,211,28,185,180,14,179,52,54,121,245,60,18,174,115,250,0,115,90,175,139,188,114,160,52,125,171,224,110,239,87,81,64,17,14,70,136,84,219,187, + 223,97,123,55,24,160,117,240,207,104,117,50,77,219,154,165,183,238,110,226,58,104,158,38,85,54,110,249,254,180,78,217,160,255,148,206,122,91,165,241, + 211,42,128,66,254,140,149,7,160,127,49,165,114,104,27,76,212,197,225,4,18,23,47,75,241,62,229,127,60,13,75,143,245,175,140,200,48,222,27,83, + 2,141,171,103,227,61,117,47,249,179,217,148,69,178,117,215,70,195,64,127,161,225,15,41,236,44,210,187,237,164,225,210,252,177,77,161,199,103,89,254, + 87,1,85,212,92,214,230,251,250,252,96,191,8,5,83,166,15,46,164,150,13,213,101,7,253,203,125,84,154,247,89,250,177,15,134,163,94,67,181,246, + 212,187,151,127,175,131,54,65,187,167,213,49,113,15,246,207,221,94,43,139,238,12,236,66,127,180,66,143,140,183,174,197,118,179,46,18,211,116,239,246, + 148,238,16,63,73,43,251,90,47,210,220,158,245,180,197,96,19,213,247,237,116,235,209,217,12,134,213,22,150,58,108,14,181,181,102,66,205,25,146,161, + 230,138,207,9,146,156,80,214,59,129,129,129,255,228,193,218,86,120,148,122,239,61,194,61,194,60,236,17,248,245,20,18,243,113,107,171,252,169,179,209, + 213,182,114,239,206,83,199,237,59,123,50,51,110,119,167,61,116,162,253,244,188,199,226,107,231,205,20,59,54,54,40,29,239,27,137,184,26,94,121,216, + 19,128,5,148,171,175,222,142,79,195,222,57,105,239,250,197,61,150,219,204,44,204,131,201,139,36,185,58,108,237,15,6,198,103,137,239,26,249,97,111, + 191,176,39,220,82,18,216,248,182,237,182,11,68,121,81,253,177,5,158,245,91,127,47,210,124,81,218,52,122,181,142,202,143,166,92,228,69,110,154,207, + 126,85,71,101,61,104,89,167,201,224,217,228,205,115,99,19,94,47,83,102,41,252,91,240,182,45,137,96,123,95,150,64,159,190,166,109,61,92,247,44, + 112,219,118,132,224,33,173,210,187,52,179,15,238,99,102,174,134,28,188,42,96,13,190,204,138,199,86,62,142,157,93,14,220,204,162,50,158,141,142,53, + 203,255,198,195,83,149,161,108,223,200,186,197,89,159,233,103,175,216,207,41,236,158,83,248,220,239,6,116,95,9,120,102,218,35,122,194,114,222,253,188, + 144,164,246,146,235,229,36,237,7,249,64,72,114,202,67,72,207,245,136,133,142,58,23,103,33,193,255,39,26,182,137,2,192,147,103,242,202,232,62,110, + 144,142,198,23,115,195,44,214,93,209,77,38,63,133,96,203,166,116,47,73,185,252,202,49,226,138,40,201,188,206,188,205,170,173,45,175,235,214,230,88, + 141,136,166,76,41,49,127,97,135,41,15,199,4,61,46,19,4,146,37,22,140,181,119,159,82,72,112,230,115,36,66,41,236,173,167,16,84,137,119,211, + 239,226,243,164,127,41,195,37,59,101,56,194,231,57,222,124,143,226,132,230,8,135,34,164,92,254,45,211,110,199,119,65,197,11,234,232,179,149,247,92, + 165,62,169,236,151,88,53,76,173,93,20,172,82,36,109,215,46,82,132,176,116,81,66,132,161,189,80,146,18,51,174,46,201,73,23,162,151,102,216,183, + 203,48,76,194,228,148,125,148,132,76,195,223,223,157,126,225,185,116,123,134,124,252,149,228,227,39,228,83,30,229,13,201,120,75,50,130,231,227,198,131, + 230,51,188,163,132,83,221,240,174,121,224,8,50,32,33,33,124,32,154,112,113,54,27,158,214,121,121,54,225,217,47,87,124,73,73,199,136,138,77,253, + 138,186,62,138,245,201,150,98,0,41,133,119,141,51,2,233,159,32,141,69,200,189,111,61,18,66,109,96,146,40,215,168,160,98,8,143,80,196,153,10, + 105,232,190,29,163,195,80,107,219,134,25,134,210,1,70,176,102,212,245,85,136,192,166,35,100,115,10,133,139,96,76,61,248,160,49,193,225,156,218,157, + 8,197,36,244,152,64,36,164,82,128,91,141,66,66,152,176,125,25,135,122,198,41,119,181,72,75,26,42,225,49,128,150,132,80,244,142,3,180,183,12, + 90,243,254,136,109,19,15,165,102,3,45,72,44,33,110,155,176,10,39,38,251,201,155,162,181,30,211,17,98,100,108,150,169,32,167,196,113,21,119,103, + 124,171,219,55,215,246,140,237,246,205,255,0,80,75,3,4,20,0,2,0,8,0,225,128,249,52,157,141,185,194,180,16,0,0,195,74,0,0,22,0, + 0,0,112,114,101,102,101,114,101,110,99,101,115,45,115,121,115,116,101,109,46,115,118,103,237,91,217,114,219,72,150,125,247,87,112,232,151,170,104,18, + 204,125,161,37,117,212,148,163,39,122,194,179,68,187,42,230,25,4,65,9,101,146,208,0,208,230,175,159,115,19,32,9,144,144,68,173,49,209,46,50, + 202,34,114,207,147,119,57,247,38,234,228,175,183,171,229,224,58,45,202,44,95,159,14,121,196,134,131,116,157,228,243,108,125,126,58,252,253,183,191,141, + 221,112,80,86,241,122,30,47,243,117,122,58,92,231,195,191,158,125,56,249,151,241,120,240,107,145,198,85,58,31,220,100,213,197,224,239,235,111,101,18, + 95,166,131,159,46,170,234,114,58,153,220,220,220,68,89,83,24,229,197,249,228,231,193,120,140,158,229,245,249,135,193,96,128,105,215,229,116,158,156,14, + 155,246,151,87,197,50,180,155,39,147,116,153,174,210,117,85,78,120,196,39,195,93,243,100,215,252,38,157,69,69,90,230,87,69,82,15,159,36,237,150, + 197,124,177,107,138,149,220,200,208,136,123,239,39,76,76,132,24,163,197,184,188,91,87,241,237,120,93,126,108,117,197,2,251,186,10,198,216,4,117,187, + 150,199,181,154,222,46,1,195,189,139,9,181,237,217,1,253,37,254,219,118,216,98,88,239,117,129,158,105,180,78,171,201,231,223,62,79,54,173,199,44, + 154,87,243,214,48,155,94,157,121,59,199,177,142,87,105,121,25,39,105,185,157,34,244,223,60,76,211,219,203,188,168,198,119,243,75,44,198,179,136,133, + 79,111,155,219,35,218,44,178,101,74,115,158,14,39,23,249,42,157,252,145,173,86,113,50,249,156,150,223,170,252,114,114,147,161,69,116,185,174,145,187, + 201,230,213,197,233,80,185,203,219,240,124,145,102,231,23,85,171,32,155,159,14,1,51,231,178,153,110,131,196,116,43,203,44,146,162,187,146,86,149,146, + 127,153,167,215,233,178,219,119,158,39,179,184,220,95,98,89,36,147,228,186,156,64,11,206,243,113,150,228,235,113,117,1,1,157,96,212,101,60,91,166, + 147,4,122,112,158,23,89,90,30,140,87,111,249,178,72,23,105,1,197,74,75,8,93,89,165,171,136,132,228,12,173,79,230,233,162,164,94,245,166,232, + 73,134,10,84,65,54,210,184,248,183,34,158,103,80,135,186,81,107,63,73,190,92,166,9,96,137,151,55,241,93,61,247,102,156,110,87,33,52,107,6, + 197,176,37,0,223,180,197,106,171,187,37,150,72,133,99,140,152,23,211,143,139,240,249,20,138,114,200,72,86,221,77,249,167,225,174,79,190,88,148,41, + 38,102,173,178,112,36,232,129,185,196,112,48,121,217,108,172,111,54,222,63,155,218,206,118,50,233,110,251,245,97,52,250,9,48,214,218,240,108,24,141, + 125,18,140,125,179,61,1,70,227,223,17,70,109,223,81,26,253,123,74,163,225,207,132,241,0,37,201,220,83,80,146,202,232,88,61,19,37,204,245,0, + 74,187,86,94,63,50,96,207,194,252,98,150,164,252,96,97,79,57,19,51,243,58,137,159,45,1,74,60,190,55,180,82,125,3,70,86,63,188,61,57, + 55,113,172,95,180,61,233,76,58,59,230,232,120,239,209,249,87,20,57,251,20,145,243,46,102,177,127,182,200,217,167,41,102,34,231,108,62,127,54,74, + 238,21,81,130,146,191,147,249,194,92,242,197,94,224,9,40,193,191,189,26,74,202,63,1,165,153,161,239,179,81,210,252,24,21,55,162,87,197,31,209, + 240,133,160,239,139,52,124,17,211,247,152,221,69,198,26,46,188,118,253,222,69,29,181,77,215,59,178,83,128,201,10,241,240,110,231,142,190,199,239,182, + 53,173,233,159,214,190,61,190,243,25,125,159,45,245,90,190,27,247,129,90,240,247,162,144,152,75,190,31,133,196,108,143,26,15,122,138,151,79,134,49, + 4,201,211,11,4,81,167,195,143,61,120,182,225,238,78,129,106,187,173,78,110,79,135,66,69,142,139,157,68,38,119,167,67,233,163,118,209,162,167,217, + 226,176,89,1,24,108,100,218,226,125,222,204,250,91,17,175,75,68,234,171,211,225,42,174,138,236,246,39,222,132,198,35,214,243,67,90,165,181,27,217, + 136,123,37,165,76,199,92,143,176,0,101,177,183,159,15,6,255,125,157,85,229,233,240,170,76,139,175,20,191,255,215,250,247,50,221,1,255,76,73,125, + 24,98,255,160,68,235,29,2,183,28,168,248,200,40,39,213,206,208,220,161,84,137,72,104,105,216,238,180,110,5,112,134,193,147,28,228,107,215,22,165, + 38,178,86,59,38,249,145,155,127,28,127,50,67,78,216,126,252,155,42,17,97,125,222,185,145,138,60,172,176,3,246,111,138,170,225,15,162,106,108,7, + 85,205,34,174,133,111,97,66,168,142,37,240,3,117,181,182,11,171,142,132,231,204,153,14,172,99,21,73,198,16,195,202,215,199,117,204,33,198,218,43, + 21,164,183,243,176,109,163,35,41,156,240,30,213,70,51,161,228,27,3,220,2,165,55,188,146,29,128,165,139,132,176,70,171,14,192,28,0,51,161,69, + 23,95,105,33,43,90,218,61,169,53,194,105,231,205,59,75,173,83,86,51,9,116,181,115,150,139,55,6,213,61,12,170,239,130,234,35,90,155,216,179, + 5,18,182,192,73,107,58,152,114,19,121,146,240,46,168,48,186,74,73,193,221,63,177,41,8,249,144,7,179,78,93,80,185,192,130,149,105,35,69,160, + 106,56,35,167,76,215,192,114,70,186,230,152,238,162,42,201,215,120,163,95,13,85,114,112,86,104,53,26,11,88,36,163,133,73,199,98,212,254,189,109, + 193,35,237,165,226,28,14,207,115,88,41,134,218,55,198,183,181,209,62,124,45,239,226,171,34,198,173,222,23,90,200,167,194,250,101,23,95,29,41,174, + 109,75,236,3,190,176,37,198,73,243,202,82,203,96,59,97,104,173,20,210,178,26,211,221,239,109,11,17,113,160,238,44,132,23,78,196,121,255,214,194, + 203,30,206,245,153,174,153,229,17,183,86,177,61,51,235,35,39,184,230,170,3,174,194,158,180,231,182,107,18,64,47,180,113,109,235,123,36,53,122,119, + 246,9,193,99,175,170,97,143,83,72,97,201,197,222,67,33,223,140,0,215,16,159,76,232,246,34,252,218,94,129,208,253,199,252,58,75,111,62,52,65, + 71,145,127,67,212,241,81,48,21,111,93,201,34,91,46,81,86,167,48,135,187,203,16,186,140,105,30,47,227,243,52,68,41,104,87,103,84,154,138,89, + 94,204,211,98,83,101,194,167,83,213,4,50,20,138,66,123,61,227,91,7,189,61,121,26,188,213,140,245,213,151,23,241,60,191,1,48,251,149,223,243, + 28,135,164,246,139,9,107,72,53,44,134,228,246,160,18,243,8,67,167,230,14,235,174,138,2,2,48,94,198,119,41,182,20,254,108,132,172,188,200,111, + 206,11,130,102,17,47,183,216,108,187,82,213,120,54,203,49,117,85,92,29,84,207,243,228,138,238,85,199,87,181,8,54,119,105,173,22,52,126,123,179, + 189,179,220,100,107,84,142,155,59,58,206,164,186,167,197,230,214,142,51,206,238,105,66,146,118,120,30,77,37,64,114,155,0,246,100,149,86,241,60,174, + 226,157,116,108,74,212,230,186,172,152,47,166,255,248,252,183,109,188,155,36,211,255,201,139,111,187,80,149,26,196,179,252,10,107,218,198,224,116,3,151, + 76,73,211,226,234,44,91,97,243,116,127,251,151,219,213,18,226,188,173,232,52,174,238,46,211,221,160,245,176,155,187,232,222,251,236,121,178,202,168,211, + 228,107,5,73,255,59,77,210,138,203,235,65,19,186,77,207,139,179,214,192,180,129,95,206,183,209,115,103,9,89,181,76,207,254,61,254,118,53,27,124, + 173,82,24,165,34,44,183,46,111,143,49,57,28,36,180,60,152,143,134,173,247,112,214,108,161,190,255,140,86,87,101,150,92,196,203,101,148,124,15,93, + 155,86,31,218,235,92,102,73,186,46,31,135,37,76,155,93,67,151,87,171,124,93,6,132,154,190,229,100,118,55,46,227,9,216,205,228,0,158,122,99, + 255,189,187,71,29,124,13,247,168,125,187,14,59,185,154,253,1,99,222,129,130,22,244,175,241,249,30,154,84,186,204,206,90,87,180,39,147,166,172,183, + 97,153,86,85,182,62,127,164,85,146,175,97,234,150,176,91,235,116,249,112,211,234,38,141,191,61,54,105,179,217,195,54,117,89,103,91,245,33,117,1, + 8,114,64,218,208,214,142,47,251,135,214,82,144,39,158,87,87,26,46,211,2,18,95,62,42,13,125,111,113,252,35,189,44,242,249,85,82,101,249,186, + 43,6,47,28,248,115,6,239,147,205,174,122,7,46,210,255,189,202,208,227,89,35,255,103,94,1,146,215,29,243,151,234,254,197,190,8,133,180,200,174, + 195,145,146,52,148,175,187,232,175,23,113,145,254,178,204,190,181,193,8,162,215,136,218,38,59,216,50,213,39,147,141,33,15,79,231,59,3,223,113,125, + 91,231,176,140,103,41,216,194,23,170,28,240,67,23,152,95,93,174,242,121,218,116,223,248,134,203,184,186,216,108,169,234,97,215,86,115,206,93,47,183, + 210,214,89,196,215,224,58,76,33,252,29,193,171,75,35,219,188,10,107,253,143,129,66,208,56,168,41,210,224,151,65,195,140,6,148,20,208,3,54,224, + 248,14,44,85,142,30,110,211,30,230,251,118,134,45,159,42,238,234,68,131,238,169,186,61,204,72,110,43,123,104,222,174,174,135,239,17,254,132,25,248, + 251,46,136,105,82,198,219,212,48,130,72,231,16,107,216,79,221,4,50,241,185,41,252,223,79,31,15,249,240,207,161,182,149,204,14,143,197,213,50,157, + 174,243,245,119,240,181,79,53,73,164,199,180,249,93,147,141,41,223,60,18,11,199,113,79,161,31,85,187,236,143,60,91,79,161,26,105,241,105,21,23, + 223,210,162,30,164,254,61,46,171,184,168,58,37,171,108,222,121,78,215,243,206,180,97,168,101,134,63,83,181,41,155,199,96,71,69,17,223,117,90,82, + 105,157,29,159,178,77,217,110,143,215,89,153,205,178,37,61,132,159,203,244,211,60,43,47,33,161,211,108,77,11,255,148,95,167,197,98,153,223,108,234, + 15,79,137,8,4,98,147,34,217,5,52,109,161,238,105,119,239,177,73,156,244,145,71,70,9,244,63,143,236,105,71,182,209,29,201,164,63,78,219,142, + 82,211,7,245,251,208,46,188,189,81,234,179,163,78,26,102,121,175,29,69,204,174,164,25,141,109,228,181,71,171,17,215,145,229,182,147,92,235,72,116, + 87,108,249,189,18,123,120,31,113,188,196,126,116,206,197,78,119,133,150,69,62,124,236,15,40,188,65,108,32,4,158,25,203,229,72,240,72,112,109,172, + 25,124,25,72,19,57,239,37,19,35,133,211,84,86,13,126,29,72,136,139,177,150,82,165,60,210,2,45,7,168,228,76,64,190,71,116,231,195,148,50, + 124,128,74,43,188,165,164,212,182,171,146,116,29,225,49,9,73,150,146,168,37,65,243,136,138,153,27,97,96,38,148,150,134,250,42,198,72,116,164,142, + 16,48,107,35,177,24,33,35,110,141,148,146,196,200,43,195,180,193,152,2,45,68,40,245,145,241,161,80,80,98,76,40,165,70,42,194,90,148,115,3, + 174,112,192,150,138,52,188,59,167,162,47,3,46,35,43,149,151,35,131,165,42,193,177,198,47,141,54,112,165,71,156,69,74,27,103,116,93,218,192,67, + 157,52,147,142,83,41,70,213,26,173,71,220,80,210,218,187,48,2,86,47,188,178,130,74,33,154,161,208,70,142,25,195,156,25,113,17,25,192,166,8, + 144,190,82,67,153,104,108,58,76,229,25,22,237,122,203,126,29,16,10,218,10,233,136,160,104,84,99,169,152,220,41,236,69,82,50,72,211,154,77,239, + 217,126,31,28,58,126,174,216,161,153,89,131,89,145,131,41,79,135,73,242,61,217,124,202,199,156,210,61,253,146,164,199,104,182,146,225,181,48,186,136, + 115,43,157,166,141,121,197,8,107,72,135,20,76,24,75,178,227,33,128,92,212,194,232,185,198,201,53,82,134,243,39,171,229,24,227,94,145,128,98,24, + 102,45,73,20,131,9,114,188,211,155,164,213,82,106,122,36,29,250,72,96,73,45,61,96,165,50,75,105,85,174,5,201,183,131,87,20,156,228,209,91, + 8,27,137,143,16,112,171,146,59,79,231,44,181,224,78,146,60,74,24,250,80,138,101,212,133,130,4,73,97,27,16,52,169,172,86,26,231,164,119,101, + 138,146,228,58,136,153,142,184,83,194,146,68,42,237,133,32,185,7,26,80,20,238,73,194,189,195,136,190,46,244,216,155,198,228,138,150,233,157,172,251, + 195,5,225,252,137,187,42,35,148,49,181,64,50,195,57,212,137,24,45,83,66,219,90,34,29,102,165,82,202,126,11,27,52,158,174,185,184,231,70,83, + 41,6,114,82,7,57,21,192,147,74,105,47,156,107,167,73,248,153,0,45,70,25,20,83,144,156,29,28,91,75,202,14,40,9,180,22,75,146,190,207, + 200,7,187,119,180,65,223,190,111,213,99,208,249,143,100,209,119,121,239,52,169,238,167,240,150,65,244,180,121,49,240,189,174,216,128,60,246,157,132,21, + 63,40,47,164,179,128,137,219,241,194,38,141,10,173,17,198,137,214,157,232,38,123,42,200,107,40,207,119,183,81,68,32,161,92,78,75,217,186,214,59, + 29,210,213,27,12,134,242,187,166,196,25,97,174,156,116,142,217,221,29,85,113,215,91,220,71,232,140,183,94,82,96,108,185,129,166,143,198,219,95,173, + 186,61,178,247,218,132,206,201,167,16,58,235,22,126,254,39,161,235,248,80,120,39,229,157,133,23,148,140,88,188,116,181,115,146,82,72,178,217,30,118, + 28,84,204,14,224,210,172,19,70,56,114,99,116,245,109,121,111,25,92,48,156,164,54,154,88,8,156,22,254,50,242,57,32,117,168,103,16,15,31,193, + 255,42,80,13,106,11,54,102,132,149,228,223,184,213,2,75,161,82,9,98,167,225,239,71,240,73,144,113,116,235,150,42,122,163,194,104,154,141,94,20, + 178,140,195,151,9,184,42,77,126,154,118,0,137,51,160,123,40,117,240,112,160,44,240,175,116,41,202,36,81,72,136,170,3,151,20,125,219,239,167,60, + 234,17,202,179,97,45,79,96,59,247,19,29,167,15,15,9,76,5,36,25,231,129,90,98,1,225,148,24,177,57,218,34,188,49,179,142,14,132,88,46, + 72,55,92,188,211,26,100,176,183,44,28,146,132,241,32,78,170,35,196,92,70,17,93,160,112,206,32,240,177,196,33,84,195,73,233,140,44,232,147,25, + 129,91,121,163,193,169,169,84,129,194,131,34,56,226,164,28,0,27,91,151,74,148,213,108,193,211,203,60,130,206,136,227,236,57,157,50,150,138,62,82, + 133,245,19,203,148,129,131,130,186,8,237,76,56,35,7,110,238,5,237,20,76,12,114,212,187,251,135,24,131,150,222,90,1,71,242,6,142,139,110,173, + 247,28,215,230,250,85,168,31,145,66,244,152,241,99,141,183,127,138,241,174,175,133,95,110,188,31,129,238,126,144,94,118,98,47,53,211,100,196,160,227, + 156,143,200,142,130,89,35,116,254,117,0,75,234,192,243,17,23,42,29,65,135,173,167,96,85,73,4,227,161,200,66,19,132,33,186,207,160,226,90,83, + 220,237,25,71,0,132,206,148,100,49,214,25,65,241,143,49,8,6,57,133,128,92,43,227,29,69,58,148,195,133,162,146,51,80,28,148,96,36,233,173, + 29,132,63,158,148,23,138,238,16,205,251,145,228,20,80,11,230,66,140,13,53,111,148,23,113,137,226,212,14,33,167,9,58,14,27,161,185,168,67,34, + 78,209,17,52,26,129,18,24,140,241,181,61,64,60,45,17,82,81,22,12,225,150,20,20,43,32,102,65,44,69,45,97,253,17,101,241,240,46,131,224, + 152,37,188,120,195,131,49,161,128,151,195,174,104,90,15,204,184,148,158,64,163,224,1,17,17,108,32,247,22,230,138,146,90,48,111,136,72,168,12,86, + 17,65,30,69,120,145,19,176,159,112,100,18,46,203,1,107,129,176,153,57,43,224,250,66,44,72,215,0,134,114,95,24,155,118,72,152,193,128,106,50, + 144,125,135,211,239,69,196,17,94,164,76,94,156,200,237,37,80,155,248,231,104,149,139,57,125,247,141,29,151,206,64,132,204,15,156,190,197,65,154,254, + 244,45,164,226,254,75,22,27,221,151,187,165,151,98,251,51,183,221,170,58,115,139,128,64,83,70,35,36,101,169,190,249,119,147,146,133,7,28,61,80, + 189,235,254,72,194,246,136,151,33,21,52,145,81,178,140,89,171,140,250,249,229,55,16,6,140,225,62,231,253,84,9,254,243,210,161,67,43,121,235,21, + 251,142,212,114,208,42,38,149,87,253,130,75,156,141,245,118,174,133,23,94,196,182,222,73,223,147,223,189,218,154,207,130,127,91,88,125,184,135,102,236, + 32,171,117,211,221,143,70,98,201,224,131,84,10,59,58,166,117,207,216,15,203,185,182,140,72,116,255,5,111,168,242,228,20,157,114,20,141,8,186,14, + 126,65,24,251,114,2,106,228,30,1,21,145,0,87,103,61,57,172,34,191,90,207,15,196,187,46,253,231,186,150,112,17,189,208,202,66,192,106,132,114, + 44,48,156,158,82,10,40,25,56,144,34,79,15,134,162,4,220,55,215,20,201,200,64,122,12,119,123,47,93,55,202,35,31,241,221,79,8,253,202,141, + 159,63,188,84,183,108,159,248,57,112,55,134,32,9,220,13,68,42,48,37,206,34,161,44,37,185,21,162,48,68,234,180,177,16,29,107,196,236,40,3, + 195,243,220,83,238,21,12,16,91,162,206,224,47,164,12,129,248,129,235,40,227,40,25,46,173,209,206,147,142,81,6,156,72,30,197,236,76,114,69,44, + 13,177,158,85,154,136,31,131,254,169,38,55,160,48,148,86,68,180,192,225,36,69,109,88,133,181,176,33,1,104,68,141,152,27,237,180,10,111,115,83, + 116,167,65,216,92,19,9,42,122,249,148,200,155,195,106,57,175,163,117,7,242,138,117,6,62,200,20,198,164,116,54,115,94,115,106,9,14,199,164,164, + 85,58,33,193,95,41,214,7,11,97,194,213,251,225,142,94,111,165,21,17,201,210,22,204,24,4,208,81,114,159,82,241,0,6,177,190,197,121,91,69, + 87,54,180,71,102,176,135,112,59,98,241,155,251,112,177,196,133,19,134,238,86,32,17,74,136,112,13,96,132,245,90,162,55,248,174,167,219,17,160,230, + 165,20,33,171,209,115,60,135,161,233,155,102,174,213,15,196,196,62,29,188,96,162,142,178,196,80,23,202,247,120,254,70,38,217,242,255,255,38,249,13, + 83,136,208,94,161,64,220,130,254,193,200,8,213,232,244,126,41,108,148,102,220,73,79,186,6,18,169,132,39,131,76,255,67,154,242,193,70,9,206,140, + 239,49,139,202,30,103,125,79,38,231,103,31,78,232,69,221,179,15,255,7,80,75,3,4,20,0,2,0,8,0,183,128,249,52,199,174,1,222,145,13, + 0,0,154,63,0,0,18,0,0,0,115,121,115,116,101,109,45,108,111,103,45,111,117,116,46,115,118,103,237,90,109,111,219,200,17,254,158,95,161,42, + 95,18,156,68,237,251,139,98,187,184,94,112,197,21,105,15,184,220,161,31,11,154,90,219,60,83,162,74,82,182,149,95,223,153,37,197,23,137,178,41, + 199,201,29,208,72,9,44,206,206,190,61,251,204,236,204,46,207,254,250,176,76,70,119,46,203,227,116,117,62,166,1,25,143,220,42,74,23,241,234,250, + 124,252,219,175,63,78,205,120,148,23,225,106,17,38,233,202,157,143,87,233,248,175,23,175,206,254,50,157,142,126,200,92,88,184,197,232,62,46,110,70, + 63,173,110,243,40,92,187,209,155,155,162,88,207,103,179,251,251,251,32,174,132,65,154,93,207,222,142,166,83,168,153,223,93,191,26,141,70,208,237,42, + 159,47,162,243,113,165,191,222,100,137,215,91,68,51,151,184,165,91,21,249,140,6,116,54,110,212,163,70,253,222,93,6,153,203,211,77,22,149,205,71, + 81,91,51,91,92,53,170,48,146,123,238,149,168,181,118,70,216,140,177,41,104,76,243,237,170,8,31,166,171,252,117,171,42,12,176,175,42,35,132,204, + 160,172,209,28,166,53,127,72,0,134,163,131,241,165,237,222,1,250,53,252,175,43,212,24,150,115,189,130,154,46,88,185,98,246,254,215,247,179,157,246, + 148,4,139,98,209,106,102,87,171,211,111,103,57,86,225,210,229,235,48,114,121,221,133,175,191,123,152,187,135,117,154,21,211,237,98,13,131,177,36,32, + 254,211,171,243,48,64,231,42,78,28,246,121,62,158,221,164,75,55,251,61,94,46,195,104,246,222,229,183,69,186,158,221,199,160,17,172,87,37,114,247, + 241,162,184,57,31,11,179,126,240,207,55,46,190,190,41,90,130,120,113,62,6,152,41,229,85,119,59,36,230,53,151,73,192,89,119,36,173,34,193,191, + 91,184,59,151,116,235,46,210,232,50,204,247,135,152,103,209,44,186,203,103,96,5,215,233,52,142,210,213,180,184,1,130,206,160,213,36,188,76,220,44, + 140,10,104,55,63,104,172,156,111,190,205,11,183,156,38,233,245,52,221,20,1,178,227,2,52,207,22,238,42,199,26,229,108,240,137,251,2,40,2,82, + 184,48,251,123,22,46,98,176,131,82,169,84,235,150,88,99,85,85,7,106,229,0,228,78,183,130,8,36,160,99,198,141,56,189,186,202,29,64,73,90, + 178,188,216,38,174,212,158,70,105,146,102,243,215,145,195,239,59,47,74,129,38,113,177,157,211,119,227,209,236,169,222,44,33,61,189,209,138,26,79,244, + 106,29,126,247,122,221,85,109,122,63,155,117,97,56,25,53,211,32,82,179,3,134,144,184,8,198,26,38,247,225,54,31,0,43,57,29,214,43,255,121, + 6,172,198,178,62,88,79,239,237,69,97,36,47,0,163,97,167,195,40,25,126,159,3,163,17,167,195,216,215,219,75,194,168,204,49,148,122,6,35,28, + 126,143,154,72,15,148,61,166,215,224,161,201,113,212,122,122,87,20,191,123,80,60,214,59,125,188,119,246,114,40,74,241,52,215,164,26,8,208,233,192, + 15,224,158,52,207,247,140,225,37,126,191,188,103,20,236,5,76,90,136,211,77,90,51,237,72,248,28,147,22,234,116,147,238,235,237,37,97,228,228,105, + 148,56,123,62,25,37,193,239,231,144,145,139,231,147,145,26,252,190,48,25,143,177,237,56,204,70,41,118,130,231,172,134,183,207,176,199,153,186,3,12, + 250,18,39,121,202,190,222,250,61,100,127,111,234,43,194,40,201,9,48,30,9,97,134,194,40,217,73,48,30,9,97,134,194,40,197,83,48,226,83,152, + 156,12,163,207,219,230,55,153,131,60,243,117,15,158,109,184,187,93,64,113,227,176,162,7,24,185,13,52,161,84,52,51,136,182,231,99,22,64,108,111, + 185,105,164,87,189,186,87,189,186,25,168,234,128,106,208,148,181,240,186,26,193,175,89,184,202,33,145,92,158,143,151,97,145,197,15,111,104,192,36,23, + 130,77,166,44,96,86,81,43,221,148,170,9,13,180,208,66,17,255,64,2,43,57,68,247,147,41,149,129,208,150,152,9,133,122,90,41,254,246,160,139, + 223,86,113,1,9,242,38,119,217,71,76,50,127,94,253,150,187,102,41,250,65,199,65,203,64,9,161,185,238,204,143,171,64,48,74,153,238,96,193,68, + 96,184,166,76,117,112,59,212,141,122,117,31,3,163,180,221,9,233,249,33,185,210,140,3,50,74,115,169,17,38,57,161,42,48,154,19,53,20,134,227, + 220,176,166,53,194,71,41,166,6,236,211,79,192,61,108,144,199,113,98,1,161,218,90,58,17,129,80,148,82,229,105,50,149,1,164,87,76,10,255,196, + 96,57,9,74,169,16,129,20,214,76,166,10,234,113,64,241,109,135,172,10,178,117,42,169,232,172,187,0,188,5,108,116,172,179,238,150,7,218,16,210, + 226,72,212,171,27,245,234,246,129,206,7,129,238,119,245,225,160,247,251,231,71,105,199,164,164,108,66,240,11,184,193,22,13,6,73,2,244,98,22,140, + 17,76,131,19,118,50,203,182,12,232,111,2,48,9,176,235,102,158,32,229,96,210,92,90,214,184,141,45,5,32,1,50,9,228,110,233,210,62,221,222, + 232,209,12,3,82,176,23,3,114,192,228,53,76,200,18,213,157,60,53,64,67,202,246,38,15,254,213,16,65,169,238,76,94,128,129,11,9,164,126,116, + 242,74,12,155,188,20,127,2,211,149,10,230,195,39,50,32,48,51,137,166,107,208,249,11,170,152,194,39,1,46,78,16,206,20,80,144,3,128,16,173, + 242,201,212,6,192,74,78,120,199,118,97,75,98,76,211,86,30,143,182,11,187,15,183,138,104,210,245,217,26,188,3,135,127,29,219,61,212,141,122,117, + 251,108,87,15,180,93,101,190,132,237,22,248,51,9,11,247,102,74,193,196,20,101,205,110,241,44,67,21,129,86,64,53,209,53,84,1,77,106,88,155, + 125,174,82,162,53,219,51,84,26,24,201,172,124,220,80,205,64,212,12,249,138,134,10,158,71,8,107,133,238,26,42,240,75,74,217,114,45,126,242,60, + 128,192,3,64,233,76,222,0,122,132,40,241,248,228,237,64,67,53,230,43,78,30,253,17,236,149,124,207,69,131,51,166,68,201,174,151,98,52,144,176, + 225,26,185,191,242,68,27,43,31,245,82,150,176,97,147,183,106,232,228,207,102,120,118,237,127,213,135,223,120,242,189,184,139,221,253,171,42,176,207,210, + 91,136,236,95,135,162,149,93,94,197,73,2,178,50,23,31,55,71,225,120,6,95,61,174,195,107,231,51,1,208,43,83,129,170,224,50,205,22,46,219, + 21,41,255,233,20,85,201,2,102,212,16,140,88,66,235,9,213,211,193,198,91,106,164,175,60,191,9,23,233,61,64,190,95,248,41,77,151,77,214,209, + 64,132,142,11,186,180,82,104,125,80,184,197,20,219,106,170,77,29,150,55,133,155,44,3,228,167,73,184,117,48,39,255,103,215,124,126,147,222,95,103, + 136,77,145,109,220,126,77,44,153,94,94,166,15,253,197,139,52,218,224,117,218,116,83,146,176,186,66,105,105,96,243,237,201,94,133,73,126,208,204,125, + 188,130,194,105,117,53,67,27,166,238,107,236,46,107,32,33,57,162,241,128,55,57,242,72,33,98,4,241,90,197,173,165,43,194,69,88,132,13,59,118, + 146,221,113,223,89,182,184,154,255,242,254,199,58,167,140,162,249,191,211,236,182,73,7,81,33,188,76,55,48,166,58,207,197,251,151,104,142,78,60,44, + 46,226,37,76,30,175,237,190,123,88,38,64,231,186,160,163,92,108,215,174,105,180,108,118,119,5,217,123,141,185,136,150,49,86,154,125,44,128,233,63, + 97,39,173,220,183,108,52,194,75,212,52,187,104,53,140,19,248,254,186,206,80,59,67,136,139,196,93,252,35,188,221,92,142,62,22,14,76,54,243,195, + 45,229,237,54,102,135,141,120,205,131,254,176,217,114,14,23,213,20,202,107,175,96,185,201,227,232,38,76,146,32,250,228,171,86,90,175,218,227,76,226, + 200,173,242,167,97,241,221,198,119,96,203,203,101,186,202,61,66,85,221,124,118,185,157,230,225,12,210,130,217,1,60,229,196,62,250,27,180,209,135,244, + 122,244,243,166,232,155,177,159,197,230,242,119,240,78,29,24,112,48,127,11,175,247,144,68,105,18,95,36,208,94,138,237,85,207,199,148,158,212,113,15, + 113,175,70,41,235,244,95,34,217,29,169,95,44,164,108,155,194,31,246,145,109,177,248,68,80,187,75,182,118,25,208,50,127,114,201,250,110,216,127,113, + 235,44,93,108,252,117,103,119,173,62,179,225,247,49,108,17,241,229,166,183,225,204,253,119,19,67,141,103,181,252,175,180,0,72,94,182,205,239,139,227, + 131,253,44,20,92,22,223,249,37,69,54,228,47,59,232,143,55,97,230,190,79,226,219,54,24,158,122,21,213,118,199,100,45,127,122,54,219,121,91,255, + 116,221,120,225,206,246,84,187,240,36,188,116,176,165,127,192,194,17,61,220,167,210,205,122,153,46,92,85,189,118,224,96,11,117,62,225,183,98,77,32, + 234,105,69,124,217,67,45,149,172,9,96,252,209,151,84,150,145,214,21,247,131,15,14,37,161,186,165,89,191,64,0,219,175,96,132,53,234,213,126,6, + 193,147,133,208,169,27,59,225,192,172,105,41,87,7,148,205,177,103,247,176,23,3,154,57,108,0,111,94,31,158,48,188,245,165,173,19,83,255,152,109, + 18,55,119,119,110,149,46,22,239,202,40,169,117,116,140,143,229,134,91,31,175,11,179,147,99,192,6,176,206,129,135,69,91,246,123,26,175,230,64,65, + 151,189,91,134,217,173,203,230,171,116,229,170,223,211,188,8,179,162,35,89,198,139,206,179,91,85,207,85,155,190,169,36,134,63,115,90,15,106,17,66, + 172,144,101,225,182,163,138,210,242,60,118,94,107,54,19,190,139,243,248,50,78,240,193,255,76,220,187,69,156,175,129,10,243,120,133,35,127,151,222,185, + 236,42,73,239,119,229,135,17,104,246,159,168,27,229,116,203,182,85,89,147,62,183,168,181,245,171,172,185,146,173,227,7,100,139,56,160,9,101,1,83, + 92,200,67,154,16,160,9,124,76,15,79,4,57,157,39,135,7,40,195,121,210,70,190,34,201,55,110,156,192,141,117,88,220,212,11,86,39,46,224,158, + 48,102,131,56,57,194,79,103,157,177,134,53,173,35,70,144,253,115,68,33,59,231,90,41,54,129,4,214,10,136,108,237,232,195,8,124,144,197,151,27, + 236,132,7,68,10,124,131,0,164,28,53,40,101,18,165,214,104,106,69,37,53,146,83,208,5,49,53,84,75,108,161,167,221,79,163,3,142,237,225,178, + 143,91,15,178,251,232,215,55,119,61,75,213,87,118,184,184,29,30,84,85,14,56,115,132,83,7,172,235,180,188,199,218,71,248,221,245,147,164,99,37, + 135,54,212,53,178,224,49,155,84,226,237,158,253,30,32,119,132,84,93,47,64,2,193,202,79,159,59,216,221,116,29,181,126,152,200,39,72,107,143,91, + 63,223,71,7,182,219,213,226,0,200,82,250,210,230,47,190,144,245,95,38,105,116,123,220,248,75,3,4,243,80,214,16,218,49,64,46,2,74,181,37, + 220,27,149,98,92,121,179,148,129,148,224,218,237,4,67,1,99,165,101,29,41,218,31,225,156,168,202,132,141,52,70,29,72,247,123,107,153,229,206,79, + 80,174,200,179,125,212,147,110,41,122,194,141,161,238,249,56,204,162,241,81,50,50,107,133,146,108,120,12,195,14,98,152,218,214,78,217,163,246,61,202, + 31,178,87,5,67,188,218,99,126,240,16,131,207,217,194,42,206,24,213,226,76,189,150,253,247,151,77,113,239,165,103,93,140,161,243,225,173,106,83,188, + 197,83,83,110,149,177,92,118,205,74,128,195,50,212,40,62,170,155,31,125,63,170,219,26,213,213,70,100,68,225,59,178,1,181,140,27,3,155,219,176, + 10,125,61,124,170,7,81,28,92,91,64,10,160,141,176,253,55,179,85,209,84,7,82,91,131,215,178,129,132,191,220,190,29,228,157,155,133,236,115,206, + 81,212,240,252,4,250,87,231,157,93,11,168,66,72,48,168,63,210,97,255,217,108,160,244,228,16,158,83,92,189,9,133,101,196,55,26,188,207,174,165, + 16,126,115,41,185,194,160,201,6,74,9,240,202,226,152,84,5,84,43,42,52,72,25,13,140,209,90,200,9,3,159,13,177,24,225,94,87,90,202,5, + 19,248,34,131,146,138,18,218,149,226,24,52,81,186,51,134,102,100,61,94,31,130,5,62,192,123,31,245,223,251,78,90,18,67,24,21,67,157,52,190, + 91,242,69,157,244,255,61,67,109,96,25,216,180,1,118,176,64,104,67,68,201,164,90,170,241,190,94,41,100,18,11,136,22,138,74,122,68,10,78,29, + 130,126,33,200,232,135,17,180,198,57,228,8,32,197,131,14,142,78,17,88,105,165,176,150,77,240,10,91,115,200,23,144,201,204,10,102,136,103,178,64, + 174,119,251,175,71,213,207,78,249,249,177,69,31,155,15,123,106,229,206,30,56,22,64,178,3,51,180,19,138,251,0,184,63,233,193,216,73,153,197,119, + 107,8,243,6,15,196,247,200,28,145,226,173,152,229,86,163,20,224,18,68,128,157,150,128,64,22,174,74,93,1,27,145,214,19,188,40,52,66,83,209, + 149,26,168,197,140,55,237,190,145,125,203,179,78,205,179,122,83,39,43,222,14,200,189,218,78,205,143,169,63,219,242,193,2,51,92,12,75,183,134,7, + 182,90,125,59,116,121,214,110,45,2,2,249,15,245,153,80,249,206,144,63,182,56,126,226,209,150,194,222,108,180,63,241,80,134,18,99,170,19,143,253, + 6,123,220,24,164,228,106,124,194,201,205,23,60,32,202,243,222,35,34,189,239,252,32,44,17,156,0,8,232,120,36,190,96,137,32,80,124,13,71,104, + 134,62,223,18,99,53,238,15,16,205,80,2,81,7,56,63,25,104,166,32,145,132,253,161,79,138,113,143,102,140,89,220,31,24,51,154,27,108,147,66, + 7,12,220,161,10,24,101,76,51,172,13,59,9,181,216,63,212,134,206,13,56,73,159,31,27,98,160,119,230,223,44,163,198,47,11,39,128,175,223,133, + 164,96,150,98,109,124,47,3,122,130,221,197,6,92,49,60,158,226,248,102,159,193,190,97,70,10,246,40,12,226,123,100,31,122,231,222,227,94,135,132, + 225,189,62,198,124,75,75,95,56,224,25,110,0,192,254,60,202,251,12,116,239,140,20,8,40,180,174,2,36,46,33,190,38,37,45,15,164,232,15,4, + 225,82,248,221,88,114,34,75,90,130,135,48,22,9,8,252,130,248,187,164,37,56,14,165,9,146,21,2,3,78,37,146,77,40,197,132,193,224,74,161, + 113,169,94,217,15,35,102,2,180,3,234,77,130,25,129,39,177,254,53,73,195,153,66,77,140,247,33,62,0,25,190,41,167,36,202,40,12,82,84,181, + 15,164,64,127,34,240,69,108,28,15,161,154,106,142,51,52,156,40,174,113,228,202,114,197,105,57,111,41,53,129,126,112,62,198,80,45,112,148,16,243, + 89,124,209,19,140,71,74,162,76,175,204,247,13,1,13,32,131,168,89,60,34,54,222,61,112,170,168,198,151,145,185,176,138,200,94,116,191,197,53,95, + 253,252,24,220,238,208,243,227,179,217,245,197,171,51,124,17,229,226,213,255,0,80,75,1,2,20,0,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,0,0,0,0,1,0,32,0,0,0,0,0,0,0,100,111,99,117,109,101,110,116,45,110,101,119,46, + 115,118,103,80,75,1,2,20,0,20,0,0,0,8,0,96,128,249,52,242,213,5,70,140,20,0,0,25,120,0,0,17,0,0,0,0,0,0,0,1, + 0,32,0,0,0,252,13,0,0,100,111,99,117,109,101,110,116,45,111,112,101,110,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,96,125, + 250,52,34,86,64,46,27,23,0,0,165,116,0,0,17,0,0,0,0,0,0,0,1,0,32,0,0,0,183,34,0,0,100,111,99,117,109,101,110,116, + 45,115,97,118,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,118,128,249,52,254,120,218,95,213,23,0,0,110,124,0,0,20,0,0, + 0,0,0,0,0,1,0,32,0,0,0,1,58,0,0,100,111,99,117,109,101,110,116,45,115,97,118,101,45,97,115,46,115,118,103,80,75,1,2,20, + 0,20,0,2,0,8,0,106,128,249,52,126,63,165,149,12,18,0,0,232,90,0,0,18,0,0,0,0,0,0,0,1,0,32,0,0,0,8,82,0, + 0,100,111,99,117,109,101,110,116,45,112,114,105,110,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,121,128,249,52,162,251,72,104,220, + 10,0,0,238,60,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,68,100,0,0,101,100,105,116,45,99,111,112,121,46,115,118,103,80,75, + 1,2,20,0,20,0,2,0,8,0,125,128,249,52,153,109,230,156,183,23,0,0,27,89,0,0,12,0,0,0,0,0,0,0,1,0,32,0,0,0, + 75,111,0,0,101,100,105,116,45,99,117,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,136,128,249,52,38,221,82,145,115,17,0,0, + 142,92,0,0,14,0,0,0,0,0,0,0,1,0,32,0,0,0,44,135,0,0,101,100,105,116,45,112,97,115,116,101,46,115,118,103,80,75,1,2, + 20,0,20,0,2,0,8,0,130,128,249,52,145,40,234,161,189,30,0,0,76,213,0,0,15,0,0,0,0,0,0,0,1,0,32,0,0,0,203,152, + 0,0,101,100,105,116,45,100,101,108,101,116,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,131,128,249,52,23,55,187,63,234,22,0, + 0,20,138,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,181,183,0,0,101,100,105,116,45,102,105,110,100,46,115,118,103,80,75,1,2, + 20,0,20,0,2,0,8,0,141,128,249,52,100,188,189,164,140,9,0,0,25,36,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,202,206, + 0,0,101,100,105,116,45,117,110,100,111,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,143,128,249,52,187,167,102,138,170,9,0,0,119, + 36,0,0,13,0,0,0,0,0,0,0,1,0,32,0,0,0,129,216,0,0,101,100,105,116,45,114,101,100,111,46,115,118,103,80,75,1,2,20,0, + 20,0,2,0,8,0,171,128,249,52,75,77,50,197,89,10,0,0,186,54,0,0,23,0,0,0,0,0,0,0,1,0,32,0,0,0,86,226,0,0, + 109,101,100,105,97,45,115,101,101,107,45,98,97,99,107,119,97,114,100,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,174,128,249,52,207, + 153,178,73,172,10,0,0,72,56,0,0,22,0,0,0,0,0,0,0,1,0,32,0,0,0,228,236,0,0,109,101,100,105,97,45,115,101,101,107,45, + 102,111,114,119,97,114,100,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,168,128,249,52,105,10,147,139,124,11,0,0,198,82,0,0,23, + 0,0,0,0,0,0,0,1,0,32,0,0,0,196,247,0,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,115,116,111,112,46,115,118,103, + 80,75,1,2,20,0,20,0,2,0,8,0,164,128,249,52,67,149,237,100,185,11,0,0,111,89,0,0,24,0,0,0,0,0,0,0,1,0,32,0, + 0,0,117,3,1,0,109,101,100,105,97,45,112,108,97,121,98,97,99,107,45,112,97,117,115,101,46,115,118,103,80,75,1,2,20,0,20,0,2,0, + 8,0,165,128,249,52,158,228,190,4,151,9,0,0,193,42,0,0,24,0,0,0,0,0,0,0,1,0,32,0,0,0,100,15,1,0,109,101,100,105, + 97,45,112,108,97,121,98,97,99,107,45,115,116,97,114,116,46,115,118,103,80,75,1,2,20,0,20,0,2,0,8,0,4,134,250,52,115,77,182,120, + 141,10,0,0,123,45,0,0,16,0,0,0,0,0,0,0,1,0,32,0,0,0,49,25,1,0,109,101,100,105,97,45,114,101,99,111,114,100,46,115, + 118,103,80,75,1,2,20,0,20,0,2,0,8,0,225,128,249,52,157,141,185,194,180,16,0,0,195,74,0,0,22,0,0,0,0,0,0,0,1,0, + 32,0,0,0,236,35,1,0,112,114,101,102,101,114,101,110,99,101,115,45,115,121,115,116,101,109,46,115,118,103,80,75,1,2,20,0,20,0,2,0, + 8,0,183,128,249,52,199,174,1,222,145,13,0,0,154,63,0,0,18,0,0,0,0,0,0,0,1,0,32,0,0,0,212,52,1,0,115,121,115,116, + 101,109,45,108,111,103,45,111,117,116,46,115,118,103,80,75,5,6,0,0,0,0,20,0,20,0,249,4,0,0,149,66,1,0,0,0,0,0}; +const char* BinaryData::icons_zip = (const char*) temp16; + +static const unsigned char temp17[] = {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,61,61,61,61,61,61,61,61,13,10,32,32,32,32,87,105,100,103,101,116,115,68,101,109,111,32,40,65,112,112,108,105,99,97,116,105, - 111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99,111,109,109,97,110,100,77,97,110,97,103,101,114,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,84,40,34,87,105,100,103,101,116,115,34,41,41,59,13,10,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,116,97,98,115,32,61,32,110,101,119,32,68,101,109,111,84, - 97,98,98,101,100,67,111,109,112,111,110,101,110,116,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,41,59,13,10,13,10,32,32,32, - 32,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,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,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,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,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,84,40,34,99,108,105,99,107,32,102,111,114,32,97,32,112,111,112,117,112,32,109,101,110,117,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,99,108,105,99, - 107,32,102,111,114,32,97,32,100,101,109,111,32,111,102,32,116,104,101,32,100,105,102,102,101,114,101,110,116,32,116,121,112,101,115,32,111,102,32,105, - 116,101,109,32,121,111,117,32,99,97,110,32,112,117,116,32,105,110,116,111,32,97,32,112,111,112,117,112,32,109,101,110,117,46,46,46,34,41,41,59, - 13,10,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,109,101,110,117,66,117,116,116,111, - 110,41,59,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,50,48,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,109,101,110,117,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,109,101,110,117,66,117,116,116,111,110, - 45,62,115,101,116,84,114,105,103,103,101,114,101,100,79,110,77,111,117,115,101,68,111,119,110,32,40,116,114,117,101,41,59,32,47,47,32,98,101,99, - 97,117,115,101,32,116,104,105,115,32,98,117,116,116,111,110,32,112,111,112,115,32,117,112,32,97,32,109,101,110,117,44,32,116,104,105,115,32,108,101, - 116,115,32,117,115,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,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,32,32,47,47,32,104,111,108,100,32,100,111,119,110,32,116,104,101,32,98,117,116,116, - 111,110,32,97,110,100,32,100,114,97,103,32,115,116,114,97,105,103,104,116,32,111,110,116,111,32,116,104,101,32,109,101,110,117,13,10,13,10,32,32, - 32,32,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,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,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,61,61,61,61,61,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108, - 101,66,117,116,116,111,110,32,40,84,40,34,101,110,97,98,108,101,47,100,105,115,97,98,108,101,32,99,111,109,112,111,110,101,110,116,115,34,41,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,101,110,97,98,108,101,66,117,116,116, - 111,110,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,115,101,116,66,111,117,110,100,115,32,40,50, - 51,48,44,32,49,48,44,32,49,56,48,44,32,50,52,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45, - 62,115,101,116,84,111,111,108,116,105,112,32,40,84,40,34,116,111,103,103,108,101,32,98,117,116,116,111,110,34,41,41,59,13,10,32,32,32,32,32, - 32,32,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,115,101,116,84,111,103,103,108,101,83,116,97,116,101,32,40,116,114,117,101,44,32,102, - 97,108,115,101,41,59,13,10,32,32,32,32,32,32,32,32,101,110,97,98,108,101,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,125,13,10,13,10,32,32,32,32,126,87,105,100,103,101,116,115,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,116,97,98,115,45,62,115,101,116,66,111,117,110,100,115,32,40,49,48,44,32,52,48,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,48,41,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,13,10,99,108,97,115,115,32,70,111,110,116,115,65,110,100,84,101,120,116,68,101,109,111,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,32,112,117,98,108,105,99, + 32,76,105,115,116,66,111,120,77,111,100,101,108,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,32,112,117,98,108,105,99,32,66,117,116,116,111,110,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,32,112,117,98,108,105,99,32,83,108,105,100,101,114,76,105,115,116,101,110,101,114,13,10,123,13,10,32,32, + 32,32,79,119,110,101,100,65,114,114,97,121,32,60,70,111,110,116,62,32,102,111,110,116,115,59,13,10,32,32,32,32,76,105,115,116,66,111,120,42, + 32,108,105,115,116,66,111,120,59,13,10,32,32,32,32,84,101,120,116,69,100,105,116,111,114,42,32,116,101,120,116,66,111,120,59,13,10,32,32,32, + 32,84,111,103,103,108,101,66,117,116,116,111,110,42,32,98,111,108,100,66,117,116,116,111,110,59,13,10,32,32,32,32,84,111,103,103,108,101,66,117, + 116,116,111,110,42,32,105,116,97,108,105,99,66,117,116,116,111,110,59,13,10,32,32,32,32,83,108,105,100,101,114,42,32,115,105,122,101,83,108,105, + 100,101,114,59,13,10,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,77,97,110,97,103,101,114,32,118,101,114, + 116,105,99,97,108,76,97,121,111,117,116,59,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,77,97,110,97,103, + 101,114,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,59,13,10,13,10,32,32,32,32,83,116,114,101,116,99,104,97,98,108,101,76, + 97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,42,32,118,101,114,116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,59,13,10,32,32, + 32,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,42,32,104,111,114,105,122,111,110,116,97, + 108,68,105,118,105,100,101,114,66,97,114,59,13,10,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,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,117,116,116, - 111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,105,102,32,40,98,117,116,116,111,110,32,61,61,32,101,110,97,98,108,101, - 66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116,32,98,111, - 111,108,32,101,110,97,98,108,101,100,32,61,32,101,110,97,98,108,101,66,117,116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97,116, - 101,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,101,110,117,66,117,116,116,111,110,45,62,115,101,116,69,110,97,98,108, - 101,100,32,40,101,110,97,98,108,101,100,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,69,110,97,98, - 108,101,100,32,40,101,110,97,98,108,101,100,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,101,108,115,101,32, - 105,102,32,40,98,117,116,116,111,110,32,61,61,32,109,101,110,117,66,117,116,116,111,110,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,109,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100, - 100,73,116,101,109,32,40,49,44,32,84,40,34,78,111,114,109,97,108,32,105,116,101,109,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,109,46,97,100,100,73,116,101,109,32,40,50,44,32,84,40,34,68,105,115,97,98,108,101,100,32,105,116,101,109,34,41,44,32,102,97,108,115, - 101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,51,44,32,84,40,34,84,105,99,107,101,100, - 32,105,116,101,109,34,41,44,32,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100, - 67,111,108,111,117,114,101,100,73,116,101,109,32,40,52,44,32,84,40,34,67,111,108,111,117,114,101,100,32,105,116,101,109,34,41,44,32,67,111,108, - 111,117,114,115,58,58,103,114,101,101,110,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111, - 114,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,67,117,115,116,111,109,73,116,101,109,32,40,53,44,32,110,101, - 119,32,67,117,115,116,111,109,77,101,110,117,67,111,109,112,111,110,101,110,116,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77, - 101,110,117,32,116,97,98,115,77,101,110,117,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73, - 116,101,109,32,40,49,48,48,49,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32,97,116,32,116,104,101,32,116,111,112,34,41,44,32,116,114, - 117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116, - 111,110,66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117, - 46,97,100,100,73,116,101,109,32,40,49,48,48,50,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32,97,116,32,116,104,101,32,98,111,116,116, - 111,109,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97, - 98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,66,111,116,116,111,109,41,59,13,10,32,32,32,32,32,32,32,32,32, - 32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,48,51,44,32,84,40,34,83,104,111,119,32,116,97,98,115,32, - 97,116,32,116,104,101,32,108,101,102,116,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114,105,101,110,116,97,116,105,111, - 110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,76,101,102,116,41,59,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,116,97,98,115,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,48,52,44,32,84,40,34,83,104,111, - 119,32,116,97,98,115,32,97,116,32,116,104,101,32,114,105,103,104,116,34,41,44,32,116,114,117,101,44,32,116,97,98,115,45,62,103,101,116,79,114, - 105,101,110,116,97,116,105,111,110,40,41,32,61,61,32,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,82,105, - 103,104,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,84,97,98,32, - 112,111,115,105,116,105,111,110,34,41,44,32,116,97,98,115,77,101,110,117,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46, - 97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117, - 32,100,105,97,108,111,103,77,101,110,117,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100, - 73,116,101,109,32,40,49,48,48,44,32,84,40,34,83,104,111,119,32,97,32,112,108,97,105,110,32,97,108,101,114,116,45,119,105,110,100,111,119,46, - 46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40, - 49,48,49,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32,119,105,116,104,32,97,32,39,119,97,114, - 110,105,110,103,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110, - 117,46,97,100,100,73,116,101,109,32,40,49,48,50,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32, - 119,105,116,104,32,97,110,32,39,105,110,102,111,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,48,51,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114, - 116,45,119,105,110,100,111,119,32,119,105,116,104,32,97,32,39,113,117,101,115,116,105,111,110,39,32,105,99,111,110,46,46,46,34,41,41,59,13,10, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,49,48,44, - 32,84,40,34,83,104,111,119,32,97,110,32,111,107,47,99,97,110,99,101,108,32,97,108,101,114,116,45,119,105,110,100,111,119,46,46,46,34,41,41, - 59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114, - 40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49, - 49,49,44,32,84,40,34,83,104,111,119,32,97,110,32,97,108,101,114,116,45,119,105,110,100,111,119,32,119,105,116,104,32,115,111,109,101,32,101,120, - 116,114,97,32,99,111,109,112,111,110,101,110,116,115,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100,105,97, - 108,111,103,77,101,110,117,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,100, - 105,97,108,111,103,77,101,110,117,46,97,100,100,73,116,101,109,32,40,49,49,50,44,32,84,40,34,83,104,111,119,32,97,32,84,104,114,101,97,100, - 87,105,116,104,80,114,111,103,114,101,115,115,87,105,110,100,111,119,32,100,101,109,111,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,109,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,65,108,101,114,116,87,105,110,100,111,119,32,100,101,109,111,110, - 115,116,114,97,116,105,111,110,115,34,41,44,32,100,105,97,108,111,103,77,101,110,117,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32, - 32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73, - 116,101,109,32,40,49,50,48,44,32,84,40,34,83,104,111,119,32,97,32,99,111,108,111,117,114,32,115,101,108,101,99,116,111,114,32,100,101,109,111, - 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10, - 13,10,35,105,102,32,74,85,67,69,95,77,65,67,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,73,116,101,109,32,40,49, - 52,48,44,32,84,40,34,82,117,110,32,116,104,101,32,65,112,112,108,101,32,82,101,109,111,116,101,32,67,111,110,116,114,111,108,32,116,101,115,116, - 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,101,112,97,114,97,116,111,114,40,41,59,13,10, - 35,101,110,100,105,102,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,110,97,116,105,118,101,70,105, - 108,101,67,104,111,111,115,101,114,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115, - 101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,49,44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114, - 46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46, - 97,100,100,73,116,101,109,32,40,49,50,52,44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,32,119,105,116, - 104,32,97,110,32,105,109,97,103,101,32,102,105,108,101,32,112,114,101,118,105,101,119,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,50,44,32,84,40,34, - 39,83,97,118,101,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,50,51,44,32,84,40,34,39,67,104,111, - 111,115,101,32,100,105,114,101,99,116,111,114,121,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,59,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,51,49, - 44,32,84,40,34,39,76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100,73,116,101,109,32,40,49,51,52,44,32,84,40,34,39, - 76,111,97,100,39,32,102,105,108,101,32,98,114,111,119,115,101,114,32,119,105,116,104,32,97,110,32,105,109,97,103,101,32,102,105,108,101,32,112,114, - 101,118,105,101,119,46,46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101, - 114,115,46,97,100,100,73,116,101,109,32,40,49,51,50,44,32,84,40,34,39,83,97,118,101,39,32,102,105,108,101,32,98,114,111,119,115,101,114,46, - 46,46,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,46,97,100,100, - 73,116,101,109,32,40,49,51,51,44,32,84,40,34,39,67,104,111,111,115,101,32,100,105,114,101,99,116,111,114,121,39,32,102,105,108,101,32,98,114, - 111,119,115,101,114,46,46,46,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,80,111,112,117,112,77,101,110,117,32,102,105, - 108,101,67,104,111,111,115,101,114,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,67,104,111,111,115,101,114,115,46,97,100, - 100,83,117,98,77,101,110,117,32,40,84,40,34,79,112,101,114,97,116,105,110,103,32,115,121,115,116,101,109,32,100,105,97,108,111,103,115,34,41,44, - 32,110,97,116,105,118,101,70,105,108,101,67,104,111,111,115,101,114,115,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,105,108,101,67, - 104,111,111,115,101,114,115,46,97,100,100,83,117,98,77,101,110,117,32,40,84,40,34,74,117,99,101,32,100,105,97,108,111,103,115,34,41,44,32,106, - 117,99,101,70,105,108,101,67,104,111,111,115,101,114,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,109,46,97,100,100,83,117, - 98,77,101,110,117,32,40,84,40,34,70,105,108,101,32,99,104,111,111,115,101,114,32,100,105,97,108,111,103,115,34,41,44,32,102,105,108,101,67,104, - 111,111,115,101,114,115,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32,114,101,115,117,108,116,32,61,32,109,46,115, - 104,111,119,65,116,32,40,109,101,110,117,66,117,116,116,111,110,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114, - 101,115,117,108,116,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,47,47,32,117,115,101,114,32,99,104,111,115,101,32,115,111,109,101,116,104,105,110,103,32,102,114,111,109,32,116,104,101,32,109,101,110, - 117,46,46,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,62,61,32,49,48,48, - 32,38,38,32,114,101,115,117,108,116,32,60,32,49,48,53,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,65,108,101,114,116,73,99,111,110, - 84,121,112,101,32,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58,78,111,73,99,111,110,59,13,10,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,49,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58, - 87,97,114,110,105,110,103,73,99,111,110,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105, - 102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,50,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,59,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,51,41,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,105,99,111,110,32,61,32,65,108,101,114,116,87,105,110,100,111, - 119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,105,99,111,110,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,84,40,34,84,104,105,115,32,105,115,32,97,110,32,65,108,101,114,116,87,105,110,100,111,119,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,84,40,34,65,110,100,32,116,104,105,115,32,105,115,32,116,104,101,32,65,108,101,114,116,87,105,110,100,111,119,39,115,32,109,101,115, - 115,97,103,101,46,32,66,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104, - 32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,46,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,84,40,34,111,107,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,48,41,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,98,111,111,108,32, - 117,115,101,114,80,105,99,107,101,100,79,107,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,61,32, - 65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,79,107,67,97,110,99,101,108,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111, - 119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,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,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,32,32,32,32,32,32,84,40,34,84,104,105, - 115,32,105,115,32,97,110,32,111,107,47,99,97,110,99,101,108,32,65,108,101,114,116,87,105,110,100,111,119,34,41,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,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,32,32,32,32,32,32,84,40,34,65,110,100,32,116,104,105,115,32,105,115,32,116,104,101,32,65,108,101,114,116,87,105,110,100,111,119, - 39,115,32,109,101,115,115,97,103,101,46,32,66,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97, - 104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,32,98,108,97,104,46,34,41,41, - 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108, - 115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,49,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,32,119,32,40,84,40,34, - 65,108,101,114,116,87,105,110,100,111,119,32,100,101,109,111,46,46,34,41,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,32,32,32,32,32,32,32,32,32,32,84,40,34,84,104,105,115,32,65,108,101,114,116,87,105,110,100,111,119,32,104,97, - 115,32,97,32,99,111,117,112,108,101,32,111,102,32,101,120,116,114,97,32,99,111,109,112,111,110,101,110,116,115,32,97,100,100,101,100,32,116,111,32, - 115,104,111,119,32,104,111,119,32,116,111,32,97,100,100,32,100,114,111,112,45,100,111,119,110,32,108,105,115,116,115,32,97,110,100,32,116,101,120,116, - 32,101,110,116,114,121,32,98,111,120,101,115,46,34,41,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,32,32,32,32,32,32,32,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,81,117,101,115,116,105,111,110,73,99,111,110,41,59, - 13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,119,46,97,100,100,84,101,120,116,69,100,105,116,111,114,32, - 40,84,40,34,116,101,120,116,34,41,44,32,84,40,34,101,110,116,101,114,32,115,111,109,101,32,116,101,120,116,32,104,101,114,101,34,41,44,32,84, - 40,34,116,101,120,116,32,102,105,101,108,100,58,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,83,116,114,105,110,103,65,114,114,97,121,32,111,112,116,105,111,110,115,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,49,34,41,41,59,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,50,34,41,41, - 59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115,46,97,100,100,32,40,84,40,34,111, - 112,116,105,111,110,32,51,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,112,116,105,111,110,115, - 46,97,100,100,32,40,84,40,34,111,112,116,105,111,110,32,52,34,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,119,46,97,100,100,67,111,109,98,111,66,111,120,32,40,84,40,34,111,112,116,105,111,110,34,41,44,32,111,112,116,105,111,110,115,44,32, - 84,40,34,115,111,109,101,32,111,112,116,105,111,110,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,119,46,97,100,100,66,117,116,116,111,110,32,40,84,40,34,111,107,34,41,44,32,49,44,32,75,101,121,80,114,101,115,115,32,40,75,101, - 121,80,114,101,115,115,58,58,114,101,116,117,114,110,75,101,121,44,32,48,44,32,48,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,119,46,97,100,100,66,117,116,116,111,110,32,40,84,40,34,99,97,110,99,101,108,34,41,44,32,48,44,32,75,101,121, - 80,114,101,115,115,32,40,75,101,121,80,114,101,115,115,58,58,101,115,99,97,112,101,75,101,121,44,32,48,44,32,48,41,41,59,13,10,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,119,46,114,117,110,77,111,100,97,108,76,111,111,112,40,41,32, - 33,61,32,48,41,32,47,47,32,105,115,32,116,104,101,121,32,112,105,99,107,101,100,32,39,111,107,39,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,123,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,47,47,32, - 116,104,105,115,32,105,115,32,116,104,101,32,105,116,101,109,32,116,104,101,121,32,99,104,111,115,101,32,105,110,32,116,104,101,32,100,114,111,112,45, - 100,111,119,110,32,108,105,115,116,46,46,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,99,111,110, - 115,116,32,105,110,116,32,111,112,116,105,111,110,73,110,100,101,120,67,104,111,115,101,110,32,61,32,119,46,103,101,116,67,111,109,98,111,66,111,120, - 67,111,109,112,111,110,101,110,116,32,40,84,40,34,111,112,116,105,111,110,34,41,41,45,62,103,101,116,83,101,108,101,99,116,101,100,73,116,101,109, - 73,110,100,101,120,40,41,59,13,10,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,47,47,32,116, - 104,105,115,32,105,115,32,116,104,101,32,116,101,120,116,32,116,104,101,121,32,101,110,116,101,114,101,100,46,46,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,83,116,114,105,110,103,32,116,101,120,116,32,61,32,119,46,103,101,116,84,101,120,116,69, - 100,105,116,111,114,67,111,110,116,101,110,116,115,32,40,84,40,34,116,101,120,116,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,49,50,41,13,10,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,68,101,109,111,66,97,99,107, - 103,114,111,117,110,100,84,104,114,101,97,100,32,100,101,109,111,84,104,114,101,97,100,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,105,102,32,40,100,101,109,111,84,104,114,101,97,100,46,114,117,110,84,104,114,101,97,100,40,41,41,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,47,47,32,116,104,114,101,97,100,32,102,105,110,105,115,104,101,100,32,110,111,114,109,97,108,108,121,46,46,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,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115, - 97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99,111,110,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,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,32,32,32,84,40,34,80,114,111,103,114,101,115,115,32,119,105,110,100,111,119,34,41,44,13,10,32,32,32,32,32,32,32,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,13,10,32,32,32,32,70,111,110,116,115, + 65,110,100,84,101,120,116,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,84, + 40,34,70,111,110,116,115,34,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,70,111,110,116,58,58,102,105,110,100,70,111,110,116,115,32,40, + 102,111,110,116,115,41,59,13,10,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,108,105, + 115,116,66,111,120,32,61,32,110,101,119,32,76,105,115,116,66,111,120,32,40,84,40,34,102,111,110,116,115,34,41,44,32,116,104,105,115,41,41,59, + 13,10,32,32,32,32,32,32,32,32,108,105,115,116,66,111,120,45,62,115,101,116,82,111,119,72,101,105,103,104,116,32,40,50,56,41,59,13,10,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,116,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,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116, + 67,111,108,111,117,114,32,40,84,101,120,116,69,100,105,116,111,114,58,58,98,97,99,107,103,114,111,117,110,100,67,111,108,111,117,114,73,100,44,32, + 67,111,108,111,117,114,115,58,58,119,104,105,116,101,41,59,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,67,111, + 108,111,117,114,32,40,84,101,120,116,69,100,105,116,111,114,58,58,111,117,116,108,105,110,101,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117, + 114,115,58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,53,102,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32, + 116,101,120,116,66,111,120,45,62,115,101,116,77,117,108,116,105,76,105,110,101,32,40,116,114,117,101,44,32,116,114,117,101,41,59,13,10,32,32,32, + 32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,82,101,116,117,114,110,75,101,121,83,116,97,114,116,115,78,101,119,76,105,110,101,32, + 40,116,114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,115,101,116,84,101,120,116,32,40,84,40,34,84,104, + 101,32,81,117,105,99,107,32,66,114,111,119,110,32,70,111,120,32,74,117,109,112,101,100,32,79,118,101,114,32,84,104,101,32,76,97,122,121,32,68, + 111,103,92,110,92,110,65,97,32,66,98,32,67,99,32,68,100,32,69,101,32,70,102,32,71,103,32,72,104,32,73,105,32,74,106,32,75,107,32,76, + 108,32,77,109,32,78,110,32,79,111,32,80,112,32,81,113,32,82,114,32,83,115,32,84,116,32,85,117,32,86,118,32,87,119,32,88,120,32,89,121, + 32,90,122,32,48,49,50,51,52,53,54,55,56,57,34,41,41,59,13,10,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,111,108,100,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108,101,66,117,116,116,111,110,32,40, + 84,40,34,98,111,108,100,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,98,111,108,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,97,100,100,65,110,100,77,97,107, + 101,86,105,115,105,98,108,101,32,40,105,116,97,108,105,99,66,117,116,116,111,110,32,61,32,110,101,119,32,84,111,103,103,108,101,66,117,116,116,111, + 110,32,40,84,40,34,105,116,97,108,105,99,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,105,116,97,108,105,99,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,97,100, + 100,65,110,100,77,97,107,101,86,105,115,105,98,108,101,32,40,115,105,122,101,83,108,105,100,101,114,32,61,32,110,101,119,32,83,108,105,100,101,114, + 32,40,84,40,34,115,105,122,101,34,41,41,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105,100,101,114,45,62,115,101,116,82, + 97,110,103,101,32,40,51,46,48,44,32,49,53,48,46,48,44,32,48,46,49,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105, + 100,101,114,45,62,115,101,116,86,97,108,117,101,32,40,50,48,46,48,41,59,13,10,32,32,32,32,32,32,32,32,115,105,122,101,83,108,105,100,101, + 114,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,108,105,115,116,66,111, + 120,45,62,115,101,108,101,99,116,82,111,119,32,40,48,41,59,13,10,32,32,32,32,32,32,32,32,108,105,115,116,66,111,120,45,62,115,101,116,67, + 111,108,111,117,114,32,40,76,105,115,116,66,111,120,58,58,111,117,116,108,105,110,101,67,111,108,111,117,114,73,100,44,32,67,111,108,111,117,114,115, + 58,58,98,108,97,99,107,46,119,105,116,104,65,108,112,104,97,32,40,48,46,53,102,41,41,59,13,10,32,32,32,32,32,32,32,32,108,105,115,116, + 66,111,120,45,62,115,101,116,79,117,116,108,105,110,101,84,104,105,99,107,110,101,115,115,32,40,49,41,59,13,10,13,10,32,32,32,32,32,32,32, + 32,47,47,32,115,101,116,32,117,112,32,116,104,101,32,108,97,121,111,117,116,32,97,110,100,32,114,101,115,105,122,101,114,32,98,97,114,115,46,46, + 13,10,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116, + 32,40,48,44,32,45,48,46,50,44,32,45,48,46,56,44,32,45,48,46,53,41,59,32,32,47,47,32,119,105,100,116,104,32,111,102,32,116,104,101, + 32,102,111,110,116,32,108,105,115,116,32,109,117,115,116,32,98,101,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,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,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,84,40,34,84,104,114,101,97,100,32,102,105,110,105,115,104,101,100,32,111,107,33,34,41,41,59,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,13, - 10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,47,47,32,117,115,101,114,32,112,114,101,115,115,101,100,32,116,104,101,32,99,97,110,99,101,108,32,98,117,116,116,111, - 110,46,46,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,65,108,101,114,116,87,105,110,100,111,119, - 58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,87,97,114,110,105,110,103,73,99, - 111,110,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,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,32,32,32,84,40,34,80,114,111,103,114,101,115,115,32,119,105,110,100,111,119,34,41,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,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,32,32,32,84,40,34,89,111,117,32,112,114,101,115,115,101,100,32,99,97,110,99,101,108,33,34,41,41,59, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61, - 32,49,50,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,67,111,108,111,117,114,83,101,108,101,99,116,111,114,68,105,97,108,111,103,87,105,110,100,111,119,32,99,111,108,111,117,114,68, - 105,97,108,111,103,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,105,115,32,119,105, - 108,108,32,114,117,110,32,97,110,32,101,118,101,110,116,32,108,111,111,112,32,117,110,116,105,108,32,116,104,101,32,100,105,97,108,111,103,39,115,32, - 99,108,111,115,101,66,117,116,116,111,110,80,114,101,115,115,101,100,40,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,47,47,32,109,101,116,104,111,100,32,99,97,117,115,101,115,32,116,104,101,32,108,111,111,112,32,116,111,32,101,120,105,116,46,13,10,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,108,111,117,114,68,105,97,108,111,103,46,114,117,110,77,111,100,97,108,76, - 111,111,112,40,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,52,48,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,123,13,10,35,105,102,32,74,85,67,69,95,77,65,67,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,65,112,112,108,101,82,101,109,111,116,101,84,101,115,116,87,105,110,100,111,119,32,116,101,115,116,59,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,116,101,115,116,46,114,117,110,77,111,100,97,108,76,111,111,112,40,41,59,13,10,35,101,110,100,105,102,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32, - 105,102,32,40,114,101,115,117,108,116,32,62,61,32,49,50,49,32,38,38,32,114,101,115,117,108,116,32,60,32,49,51,57,41,13,10,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,111,110,115,116, - 32,98,111,111,108,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,32,61,32,114,101,115,117,108,116,32,60,32,49,51,48,59,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,62,32,49,51,48,41,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,114,101,115,117,108,116,32,45,61,32,49,48,59,13,10,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,49,41,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,70,105,108,101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,102,105,108,101,32, - 116,111,32,111,112,101,110,46,46,46,34,41,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, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105, - 114,101,99,116,111,114,121,40,41,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,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,84,40,34,42,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13, - 10,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,105,102,32,40,102,99,46,98,114,111,119,115,101, - 70,111,114,70,105,108,101,84,111,79,112,101,110,40,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104, - 111,115,101,110,70,105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97, - 103,101,66,111,120,32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,44,13,10,32,32,32,32,32,32,32,32,32, + 32,47,47,32,98,101,116,119,101,101,110,32,50,48,37,32,97,110,100,32,56,48,37,44,32,112,114,101,102,101,114,97,98,108,121,32,53,48,37,13, + 10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49, + 44,32,56,44,32,56,44,32,56,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,118,101,114,116,105,99,97,108,32,100,105, + 118,105,100,101,114,32,100,114,97,103,45,98,97,114,32,116,104,105,110,103,32,105,115,32,97,108,119,97,121,115,32,56,32,112,105,120,101,108,115,32, + 119,105,100,101,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111, + 117,116,32,40,50,44,32,49,53,48,44,32,45,49,46,48,44,32,45,48,46,53,41,59,32,32,32,47,47,32,116,104,101,32,99,111,109,112,111,110, + 101,110,116,115,32,111,110,32,116,104,101,32,114,105,103,104,116,32,109,117,115,116,32,98,101,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,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,32,32,32, - 32,32,32,32,32,32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,44,13,10,32,32,32,32,32,32,32,32,32, + 32,32,32,32,32,32,32,32,47,47,32,97,116,32,108,101,97,115,116,32,49,53,48,32,112,105,120,101,108,115,32,119,105,100,101,44,32,112,114,101, + 102,101,114,97,98,108,121,32,53,48,37,32,111,102,32,116,104,101,32,116,111,116,97,108,32,119,105,100,116,104,13,10,13,10,32,32,32,32,32,32, + 32,32,118,101,114,116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,32,61,32,110,101,119,32,83,116,114,101,116,99,104,97,98,108,101,76,97, + 121,111,117,116,82,101,115,105,122,101,114,66,97,114,32,40,38,118,101,114,116,105,99,97,108,76,97,121,111,117,116,44,32,49,44,32,116,114,117,101, + 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,118,101,114,116,105,99,97,108,68, + 105,118,105,100,101,114,66,97,114,41,59,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46, + 115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,48,44,32,45,48,46,50,44,32,45,49,46,48,44,32,45,48,46,52,41,59,32,32,47,47, + 32,104,101,105,103,104,116,32,111,102,32,116,104,101,32,102,111,110,116,32,116,101,120,116,32,98,111,120,32,109,117,115,116,32,98,101,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,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,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103, - 101,116,70,117,108,108,80,97,116,104,78,97,109,101,40,41,41,59,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,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,52,41,13,10,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,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,73,109,97,103,101,80,114,101,118,105,101,119,67,111,109,112,111,110,101,110,116,32,105,109,97,103,101,80,114,101,118,105,101,119,59,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,105,109,97,103,101,80,114,101,118,105,101,119,46,115,101,116,83, - 105,122,101,32,40,50,48,48,44,32,50,48,48,41,59,13,10,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,70,105,108,101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,110,32,105,109,97,103,101,32,116,111, - 32,111,112,101,110,46,46,46,34,41,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,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101, - 99,116,111,114,121,40,41,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,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,84,40,34,42,46,106,112,103,59,42,46,106,112,101,103,59,42,46,112,110,103,59,42,46,103,105,102,34,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,70,105,108,101,84,111,79,112,101,110,32,40,38,105,109,97, - 103,101,80,114,101,118,105,101,119,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,70, - 105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120, - 32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,32,32,32,32,32,32,32,32,32,32,47,47,32,98,101,116,119,101,101,110,32,50,48,37,32,97,110,100,32, + 49,48,48,37,44,32,112,114,101,102,101,114,97,98,108,121,32,52,48,37,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, + 76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49,44,32,56,44,32,56,44,32,56,41,59,32,32,32,32,32,32, + 32,32,32,32,32,47,47,32,116,104,101,32,104,111,114,105,122,111,110,116,97,108,32,100,105,118,105,100,101,114,32,100,114,97,103,45,98,97,114,32, + 116,104,105,110,103,32,105,115,32,97,108,119,97,121,115,32,56,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104, + 111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,50,44,32,50,44,32,53,44,32, + 53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114, + 111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121, + 111,117,116,32,40,51,44,32,49,53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,105,116,97,108,105, + 99,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104, + 13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116, + 32,40,52,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101, + 110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116, + 46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,53,44,32,49,53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47, + 47,32,116,104,101,32,98,111,108,100,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105, + 120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73, + 116,101,109,76,97,121,111,117,116,32,40,54,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32,32,32,32,32,32,47,47,32,97,32,103, + 97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110, + 116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,55,44,32,49,53,44,32,50,48,44,32,50,48,41,59, + 32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,105,116,97,108,105,99,32,98,117,116,116,111,110,32,119,111,117,108,100,32,108,105,107,101,32, + 116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, + 76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,56,44,32,50,44,32,53,44,32,53,41,59,32,32,32,32,32,32, + 32,32,32,32,32,47,47,32,97,32,103,97,112,32,98,101,116,119,101,101,110,32,116,104,101,32,99,111,110,116,114,111,108,115,13,10,32,32,32,32, + 32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,57,44,32,49, + 53,44,32,50,48,44,32,50,48,41,59,32,32,32,32,32,32,32,32,47,47,32,116,104,101,32,99,111,112,121,32,99,111,100,101,32,98,117,116,116, + 111,110,32,119,111,117,108,100,32,108,105,107,101,32,116,111,32,98,101,32,50,48,32,112,105,120,101,108,115,32,104,105,103,104,13,10,32,32,32,32, + 32,32,32,32,104,111,114,105,122,111,110,116,97,108,76,97,121,111,117,116,46,115,101,116,73,116,101,109,76,97,121,111,117,116,32,40,49,48,44,32, + 53,44,32,45,49,46,48,44,32,53,41,59,32,32,32,32,32,32,32,32,47,47,32,97,100,100,32,97,32,103,97,112,32,97,116,32,116,104,101,32, + 98,111,116,116,111,109,32,116,104,97,116,32,119,105,108,108,32,102,105,108,108,32,117,112,32,97,110,121,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,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, - 32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,32,32,47,47,32,115,112,97,99,101,32,108,101,102,116,32,111,118,101,114,32,45,32,116,104,105,115,32,119, + 105,108,108,32,115,116,111,112,32,116,104,101,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,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,32,32,32,32,32,32,32,32,32,32,32,32,32,47,47,32, + 115,108,105,100,101,114,115,32,102,114,111,109,32,97,108,119,97,121,115,32,115,116,105,99,107,105,110,103,32,116,111,32,116,104,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103,101,116,70,117,108, - 108,80,97,116,104,78,97,109,101,40,41,41,59,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,125, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,50,41,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,123,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,70,105,108, - 101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,102,105,108,101,32,116,111,32,115,97,118,101,46,46,46, - 34,41,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,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101,99,116,111,114,121,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,84,40,34,42,34,41,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,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,70,105,108,101,84,111,83, - 97,118,101,32,40,116,114,117,101,41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,70, - 105,108,101,32,61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120, - 32,40,65,108,101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,32,32,32,32,32,32,32,32,32,47,47,32,98,111,116,116,111,109,32,111,102,32,116,104,101,32,119,105,110, + 100,111,119,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,32,61,32,110,101, + 119,32,83,116,114,101,116,99,104,97,98,108,101,76,97,121,111,117,116,82,101,115,105,122,101,114,66,97,114,32,40,38,104,111,114,105,122,111,110,116, + 97,108,76,97,121,111,117,116,44,32,49,44,32,102,97,108,115,101,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,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,41,59,13,10,32,32,32,32,125,13,10, + 13,10,32,32,32,32,126,70,111,110,116,115,65,110,100,84,101,120,116,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,47,47,32,108,97,121,32,111,117,116,32,116, + 104,101,32,108,105,115,116,32,98,111,120,32,97,110,100,32,118,101,114,116,105,99,97,108,32,100,105,118,105,100,101,114,46,46,13,10,32,32,32,32, + 32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,118,99,111,109,112,115,91,93,32,61,32,123,32,108,105,115,116,66,111,120,44,32,118,101,114, + 116,105,99,97,108,68,105,118,105,100,101,114,66,97,114,44,32,48,32,125,59,13,10,13,10,32,32,32,32,32,32,32,32,118,101,114,116,105,99,97, + 108,76,97,121,111,117,116,46,108,97,121,79,117,116,67,111,109,112,111,110,101,110,116,115,32,40,118,99,111,109,112,115,44,32,51,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,52, + 44,32,52,44,32,103,101,116,87,105,100,116,104,40,41,32,45,32,56,44,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,84,40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,44,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 102,97,108,115,101,44,32,32,32,32,32,47,47,32,108,97,121,32,111,117,116,32,115,105,100,101,45,98,121,45,115,105,100,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117, + 101,41,59,32,32,32,32,32,47,47,32,114,101,115,105,122,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,115,39,32,104,101,105,103,104,116, + 115,32,97,115,32,119,101,108,108,32,97,115,32,119,105,100,116,104,115,13,10,13,10,32,32,32,32,32,32,32,32,47,47,32,110,111,119,32,108,97, + 121,32,111,117,116,32,116,104,101,32,116,101,120,116,32,98,111,120,32,97,110,100,32,116,104,101,32,99,111,110,116,114,111,108,115,32,98,101,108,111, + 119,32,105,116,46,46,13,10,32,32,32,32,32,32,32,32,67,111,109,112,111,110,101,110,116,42,32,104,99,111,109,112,115,91,93,32,61,32,123,32, + 116,101,120,116,66,111,120,44,32,104,111,114,105,122,111,110,116,97,108,68,105,118,105,100,101,114,66,97,114,44,32,48,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,32,32,32,32,32,32,32,98,111,108,100,66,117,116,116,111,110,44,32,48, + 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,32,32,32,32,32,32,32,105,116,97,108,105, + 99,66,117,116,116,111,110,44,32,48,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,32,32, + 32,32,32,32,32,115,105,122,101,83,108,105,100,101,114,32,125,59,13,10,13,10,32,32,32,32,32,32,32,32,104,111,114,105,122,111,110,116,97,108, + 76,97,121,111,117,116,46,108,97,121,79,117,116,67,111,109,112,111,110,101,110,116,115,32,40,104,99,111,109,112,115,44,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,84,40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,70,105,108,101,46,103,101,116,70,117,108, - 108,80,97,116,104,78,97,109,101,40,41,41,59,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,125, - 13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,50,51,41,13,10,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,123,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,70,105,108, - 101,67,104,111,111,115,101,114,32,102,99,32,40,84,40,34,67,104,111,111,115,101,32,97,32,100,105,114,101,99,116,111,114,121,46,46,46,34,41,44, + 52,32,43,32,118,101,114,116,105,99,97,108,76,97,121,111,117,116,46,103,101,116,73,116,101,109,67,117,114,114,101,110,116,80,111,115,105,116,105,111, + 110,32,40,50,41,44,32,47,47,32,102,111,114,32,116,104,101,105,114,32,119,105,100,116,104,115,44,32,114,101,102,101,114,32,116,111,32,116,104,101, + 32,118,101,114,116,105,99,97,108,32,108,97,121,111,117,116,32,115,116,97,116,101,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,52,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,118,101,114,116,105,99, + 97,108,76,97,121,111,117,116,46,103,101,116,73,116,101,109,67,117,114,114,101,110,116,65,98,115,111,108,117,116,101,83,105,122,101,32,40,50,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,70,105,108,101,58,58,103,101,116,67,117,114,114,101,110,116,87,111,114,107,105,110,103,68,105,114,101,99,116,111,114,121,40,41,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,84, - 40,34,42,34,41,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,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,117,115,101,78,97,116,105,118,101,86,101,114,115,105,111,110,41,59,13,10,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,105,102,32,40,102,99,46,98,114,111,119,115,101,70,111,114,68,105,114,101,99,116,111,114,121,40, - 41,41,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,123,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,32,32,32,70,105,108,101,32,99,104,111,115,101,110,68,105,114,101,99,116,111,114,121,32, - 61,32,102,99,46,103,101,116,82,101,115,117,108,116,40,41,59,13,10,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,32,32,32,65,108,101,114,116,87,105,110,100,111,119,58,58,115,104,111,119,77,101,115,115,97,103,101,66,111,120,32,40,65,108, - 101,114,116,87,105,110,100,111,119,58,58,73,110,102,111,73,99,111,110,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,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,32,32,32,32,32,32,32,84, - 40,34,70,105,108,101,32,67,104,111,111,115,101,114,46,46,46,34,41,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,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,32,32,32,32,32,32,32,84, - 40,34,89,111,117,32,112,105,99,107,101,100,58,32,34,41,32,43,32,99,104,111,115,101,110,68,105,114,101,99,116,111,114,121,46,103,101,116,70,117, - 108,108,80,97,116,104,78,97,109,101,40,41,41,59,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, - 125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32, - 49,48,48,49,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110, - 66,97,114,58,58,84,97,98,115,65,116,84,111,112,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,50,41,13,10,32, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97, - 98,115,45,62,115,101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98, - 115,65,116,66,111,116,116,111,109,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,51,41,13,10,32,32,32,32,32,32, - 32,32,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115, - 101,116,79,114,105,101,110,116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,76,101, - 102,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,101,108,115,101,32,105,102,32,40,114,101,115,117,108,116,32,61,61,32,49,48,48,52,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32, - 32,32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,97,98,115,45,62,115,101,116,79,114,105,101,110, - 116,97,116,105,111,110,32,40,84,97,98,98,101,100,66,117,116,116,111,110,66,97,114,58,58,84,97,98,115,65,116,82,105,103,104,116,41,59,13,10, - 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,32,32, - 32,32,125,13,10,32,32,32,32,125,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, + 32,32,32,32,32,103,101,116,72,101,105,103,104,116,40,41,32,45,32,56,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,44,32,32,32,32,47,47,32,108,97, + 121,32,111,117,116,32,97,98,111,118,101,32,101,97,99,104,32,111,116,104,101,114,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,116,114,117,101,41,59,32,32,32,47,47,32,114, + 101,115,105,122,101,32,116,104,101,32,99,111,109,112,111,110,101,110,116,115,39,32,119,105,100,116,104,115,32,97,115,32,119,101,108,108,32,97,115,32, + 104,101,105,103,104,116,115,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32, + 76,105,115,116,66,111,120,77,111,100,101,108,32,109,101,116,104,111,100,13,10,32,32,32,32,105,110,116,32,103,101,116,78,117,109,82,111,119,115,40, + 41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,102,111,110,116,115,46,115,105,122,101,40,41,59,13,10, + 32,32,32,32,125,13,10,13,10,32,32,32,32,47,47,32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32,76,105,115,116,66,111,120,77,111, + 100,101,108,32,109,101,116,104,111,100,13,10,32,32,32,32,118,111,105,100,32,112,97,105,110,116,76,105,115,116,66,111,120,73,116,101,109,32,40,105, + 110,116,32,114,111,119,78,117,109,98,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, + 32,32,71,114,97,112,104,105,99,115,38,32,103,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,32,32,105,110,116,32,119,105,100,116,104,44,32,105,110,116,32,104,101,105,103,104,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,32,32,98,111,111,108,32,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123, + 13,10,32,32,32,32,32,32,32,32,105,102,32,40,114,111,119,73,115,83,101,108,101,99,116,101,100,41,13,10,32,32,32,32,32,32,32,32,32,32, + 32,32,103,46,102,105,108,108,65,108,108,32,40,67,111,108,111,117,114,115,58,58,108,105,103,104,116,98,108,117,101,41,59,13,10,13,10,32,32,32, + 32,32,32,32,32,105,102,32,40,102,111,110,116,115,32,91,114,111,119,78,117,109,98,101,114,93,32,33,61,32,48,41,13,10,32,32,32,32,32,32, + 32,32,123,13,10,32,32,32,32,32,32,32,32,32,32,32,32,70,111,110,116,32,102,111,110,116,32,40,42,102,111,110,116,115,32,91,114,111,119,78, + 117,109,98,101,114,93,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,110,116,46,115,101,116,72,101,105,103,104,116,32,40,104,101, + 105,103,104,116,32,42,32,48,46,55,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,115,101,116,70,111,110,116,32,40, + 102,111,110,116,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,103,46,100,114,97,119,84,101,120,116,32,40,102,111,110,116,46,103,101,116, + 84,121,112,101,102,97,99,101,78,97,109,101,40,41,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,52,44,32,48,44,32,119,105,100,116,104,32,45,32,52,44,32,104,101,105,103,104,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,74,117,115,116,105,102,105,99,97,116,105,111,110,58,58,99,101,110,116,114,101,100,76,101,102,116,44,32,116, + 114,117,101,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,117,112,100,97, + 116,101,80,114,101,118,105,101,119,66,111,120,84,101,120,116,40,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,70,111,110,116,42, + 32,102,32,61,32,102,111,110,116,115,32,91,108,105,115,116,66,111,120,45,62,103,101,116,83,101,108,101,99,116,101,100,82,111,119,40,41,93,59,13, + 10,13,10,32,32,32,32,32,32,32,32,105,102,32,40,102,32,33,61,32,48,41,13,10,32,32,32,32,32,32,32,32,123,13,10,32,32,32,32,32, + 32,32,32,32,32,32,32,70,111,110,116,32,102,111,110,116,32,40,42,102,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111, + 110,116,46,115,101,116,72,101,105,103,104,116,32,40,40,102,108,111,97,116,41,32,115,105,122,101,83,108,105,100,101,114,45,62,103,101,116,86,97,108, + 117,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111,110,116,46,115,101,116,66,111,108,100,32,40,98,111,108,100,66,117, + 116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97,116,101,40,41,41,59,13,10,32,32,32,32,32,32,32,32,32,32,32,32,102,111, + 110,116,46,115,101,116,73,116,97,108,105,99,32,40,105,116,97,108,105,99,66,117,116,116,111,110,45,62,103,101,116,84,111,103,103,108,101,83,116,97, + 116,101,40,41,41,59,13,10,13,10,32,32,32,32,32,32,32,32,32,32,32,32,116,101,120,116,66,111,120,45,62,97,112,112,108,121,70,111,110,116, + 84,111,65,108,108,84,101,120,116,32,40,102,111,110,116,41,59,13,10,32,32,32,32,32,32,32,32,125,13,10,32,32,32,32,125,13,10,13,10,32, + 32,32,32,118,111,105,100,32,115,101,108,101,99,116,101,100,82,111,119,115,67,104,97,110,103,101,100,32,40,105,110,116,32,108,97,115,116,82,111,119, + 115,101,108,101,99,116,101,100,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,80,114,101,118,105,101,119,66, + 111,120,84,101,120,116,40,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,117,116,116,111,110,41,13,10,32,32,32,32,123,13,10,32,32,32,32,32,32,32,32,117,112,100,97, + 116,101,80,114,101,118,105,101,119,66,111,120,84,101,120,116,40,41,59,13,10,32,32,32,32,125,13,10,13,10,32,32,32,32,118,111,105,100,32,115, + 108,105,100,101,114,86,97,108,117,101,67,104,97,110,103,101,100,32,40,83,108,105,100,101,114,42,41,13,10,32,32,32,32,123,13,10,32,32,32,32, + 32,32,32,32,47,47,32,40,116,104,105,115,32,105,115,32,99,97,108,108,101,100,32,119,104,101,110,32,116,104,101,32,115,105,122,101,32,115,108,105, + 100,101,114,32,105,115,32,109,111,118,101,100,41,13,10,32,32,32,32,32,32,32,32,117,112,100,97,116,101,80,114,101,118,105,101,119,66,111,120,84, + 101,120,116,40,41,59,13,10,32,32,32,32,125,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,13,10,67,111,109,112,111,110,101,110,116,42,32,99,114,101,97,116,101,87, - 105,100,103,101,116,115,68,101,109,111,32,40,65,112,112,108,105,99,97,116,105,111,110,67,111,109,109,97,110,100,77,97,110,97,103,101,114,42,32,99, - 111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,105,100,103,101,116, - 115,68,101,109,111,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,59,13,10,125,13,10,0,0}; -const char* BinaryData::widgetsdemo_cpp = (const char*) temp17; - + 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,70,111,110,116,115,65,110,100,84,101,120,116,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, + 70,111,110,116,115,65,110,100,84,101,120,116,68,101,109,111,40,41,59,13,10,125,13,10,0,0}; +const char* BinaryData::fontsandtextdemo_cpp = (const char*) temp17; diff --git a/extras/juce demo/src/BinaryData.h b/extras/juce demo/src/BinaryData.h index d0b5d813ca..a98338d6d2 100644 --- a/extras/juce demo/src/BinaryData.h +++ b/extras/juce demo/src/BinaryData.h @@ -5,57 +5,57 @@ namespace BinaryData { - extern const char* audiodemo_cpp; - const int audiodemo_cppSize = 23584; + extern const char* pathsandtransformsdemo_cpp; + const int pathsandtransformsdemo_cppSize = 14231; - extern const char* cello_wav; - const int cello_wavSize = 46348; + extern const char* opengldemo_cpp; + const int opengldemo_cppSize = 9575; extern const char* demo_table_data_xml; const int demo_table_data_xmlSize = 5239; - extern const char* draganddropdemo_cpp; - const int draganddropdemo_cppSize = 7937; - - extern const char* fontsandtextdemo_cpp; - const int fontsandtextdemo_cppSize = 9064; + extern const char* tabledemo_cpp; + const int tabledemo_cppSize = 12381; - extern const char* icons_zip; - const int icons_zipSize = 83876; + extern const char* cello_wav; + const int cello_wavSize = 46348; - extern const char* interprocesscommsdemo_cpp; - const int interprocesscommsdemo_cppSize = 12631; + extern const char* draganddropdemo_cpp; + const int draganddropdemo_cppSize = 7937; - extern const char* juce_png; - const int juce_pngSize = 15290; + extern const char* readme__what_this_directory_is_for_txt; + const int readme__what_this_directory_is_for_txtSize = 259; - extern const char* opengldemo_cpp; - const int opengldemo_cppSize = 9667; + extern const char* treeviewdemo_cpp; + const int treeviewdemo_cppSize = 7715; - 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; - extern const char* readme__what_this_directory_is_for_txt; - const int readme__what_this_directory_is_for_txtSize = 259; - - extern const char* tabledemo_cpp; - const int tabledemo_cppSize = 12381; + extern const char* audiodemo_cpp; + const int audiodemo_cppSize = 23584; extern const char* threadingdemo_cpp; - const int threadingdemo_cppSize = 10047; - - extern const char* treedemo_xml; - const int treedemo_xmlSize = 1126; + const int threadingdemo_cppSize = 10049; - extern const char* treeviewdemo_cpp; - const int treeviewdemo_cppSize = 7715; + extern const char* juce_png; + const int juce_pngSize = 15290; extern const char* widgetsdemo_cpp; const int widgetsdemo_cppSize = 53388; + extern const char* interprocesscommsdemo_cpp; + const int interprocesscommsdemo_cppSize = 12631; + + extern const char* icons_zip; + const int icons_zipSize = 83876; + + extern const char* fontsandtextdemo_cpp; + const int fontsandtextdemo_cppSize = 9064; + }; #endif diff --git a/extras/juce demo/src/binarydata/OpenGLDemo.cpp b/extras/juce demo/src/binarydata/OpenGLDemo.cpp index dde289c785..ece0bf0165 100644 --- a/extras/juce demo/src/binarydata/OpenGLDemo.cpp +++ b/extras/juce demo/src/binarydata/OpenGLDemo.cpp @@ -31,9 +31,6 @@ #ifdef _WIN32 #include -#elif ! defined (LINUX) - #include - #include #endif #include "../jucedemo_headers.h" @@ -48,7 +45,6 @@ #include #undef KeyPress #else - #include #include #endif diff --git a/extras/juce demo/src/binarydata/ThreadingDemo.cpp b/extras/juce demo/src/binarydata/ThreadingDemo.cpp index d77d1edeee..02b832937b 100644 --- a/extras/juce demo/src/binarydata/ThreadingDemo.cpp +++ b/extras/juce demo/src/binarydata/ThreadingDemo.cpp @@ -40,7 +40,7 @@ class BouncingBallComp : public Component, float innerX, innerY; Colour colour; CriticalSection lock; - int threadId; + int64 threadId; public: BouncingBallComp() diff --git a/extras/juce demo/src/demos/ThreadingDemo.cpp b/extras/juce demo/src/demos/ThreadingDemo.cpp index d77d1edeee..02b832937b 100644 --- a/extras/juce demo/src/demos/ThreadingDemo.cpp +++ b/extras/juce demo/src/demos/ThreadingDemo.cpp @@ -40,7 +40,7 @@ class BouncingBallComp : public Component, float innerX, innerY; Colour colour; CriticalSection lock; - int threadId; + int64 threadId; public: BouncingBallComp() diff --git a/extras/juce demo/src/juce_AppConfig.h b/extras/juce demo/src/juce_AppConfig.h index 00ed78cd97..8fce15e0ba 100644 --- a/extras/juce demo/src/juce_AppConfig.h +++ b/extras/juce demo/src/juce_AppConfig.h @@ -50,8 +50,8 @@ //#define JUCE_ENABLE_REPAINT_DEBUGGING 1 //#define JUCE_USE_XINERAMA 1 //#define JUCE_USE_XSHM 1 -//#define JUCE_PLUGINHOST_VST 1 -//#define JUCE_PLUGINHOST_AU 1 +#define JUCE_PLUGINHOST_VST 0 +#define JUCE_PLUGINHOST_AU 0 //#define JUCE_BUILD_GUI_CLASSES 1 //#define JUCE_CHECK_MEMORY_LEAKS 1 //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 diff --git a/extras/the jucer/build/mac/Jucer.xcodeproj/project.pbxproj b/extras/the jucer/build/mac/Jucer.xcodeproj/project.pbxproj index 54033f37b8..bb925e5917 100644 --- a/extras/the jucer/build/mac/Jucer.xcodeproj/project.pbxproj +++ b/extras/the jucer/build/mac/Jucer.xcodeproj/project.pbxproj @@ -9,10 +9,7 @@ /* Begin PBXBuildFile section */ 846929140A49DB9C00314975 /* juce.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 846929130A49DB9C00314975 /* juce.xcconfig */; }; 846C10D40DE33F4D00E8CCE8 /* juce_LibrarySource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 846C10D30DE33F4D00E8CCE8 /* juce_LibrarySource.mm */; }; - 846C10E90DE33FA100E8CCE8 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10DB0DE33FA100E8CCE8 /* AGL.framework */; }; 846C10EA0DE33FA100E8CCE8 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10DC0DE33FA100E8CCE8 /* ApplicationServices.framework */; }; - 846C10EB0DE33FA100E8CCE8 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10DD0DE33FA100E8CCE8 /* AudioUnit.framework */; }; - 846C10EC0DE33FA100E8CCE8 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10DE0DE33FA100E8CCE8 /* Carbon.framework */; }; 846C10ED0DE33FA100E8CCE8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10DF0DE33FA100E8CCE8 /* Cocoa.framework */; }; 846C10EE0DE33FA100E8CCE8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E00DE33FA100E8CCE8 /* CoreAudio.framework */; }; 846C10EF0DE33FA100E8CCE8 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E10DE33FA100E8CCE8 /* CoreFoundation.framework */; }; @@ -21,8 +18,8 @@ 846C10F20DE33FA100E8CCE8 /* DiscRecording.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E40DE33FA100E8CCE8 /* DiscRecording.framework */; }; 846C10F30DE33FA100E8CCE8 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E50DE33FA100E8CCE8 /* IOKit.framework */; }; 846C10F40DE33FA100E8CCE8 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E60DE33FA100E8CCE8 /* OpenGL.framework */; }; - 846C10F50DE33FA100E8CCE8 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E70DE33FA100E8CCE8 /* QuickTime.framework */; }; 846C10F60DE33FA100E8CCE8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 846C10E80DE33FA100E8CCE8 /* WebKit.framework */; }; + 84E01DD90E910B7B003E41AF /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E01DD80E910B7B003E41AF /* QTKit.framework */; }; 84F1769F0A271BBD00908B2F /* jucer_StoredSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1769B0A271BBD00908B2F /* jucer_StoredSettings.cpp */; }; 84F176A00A271BBD00908B2F /* jucer_UtilityFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F1769D0A271BBD00908B2F /* jucer_UtilityFunctions.cpp */; }; 84F176BA0A271BD000908B2F /* jucer_ComponentLayoutEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F176A20A271BD000908B2F /* jucer_ComponentLayoutEditor.cpp */; }; @@ -57,6 +54,7 @@ 84F555CF0A22381100A8311C /* Jucer To Do list.txt in Resources */ = {isa = PBXBuildFile; fileRef = 84F5556A0A22381000A8311C /* Jucer To Do list.txt */; }; 84F555D30A22381100A8311C /* BinaryData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F555700A22381000A8311C /* BinaryData.cpp */; }; 84F555D40A22381100A8311C /* jucer_Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F555730A22381000A8311C /* jucer_Main.cpp */; }; + 84F8B68E0EB5FB290020D98D /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F8B68D0EB5FB290020D98D /* QuickTime.framework */; }; 8D0C4E8D0486CD37000505A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; }; /* End PBXBuildFile section */ @@ -65,10 +63,7 @@ 846929130A49DB9C00314975 /* juce.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = juce.xcconfig; path = ../../../../build/macosx/juce.xcconfig; sourceTree = SOURCE_ROOT; }; 846C10D20DE33F4D00E8CCE8 /* juce_AppConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = juce_AppConfig.h; path = ../../src/juce_AppConfig.h; sourceTree = SOURCE_ROOT; }; 846C10D30DE33F4D00E8CCE8 /* juce_LibrarySource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = juce_LibrarySource.mm; path = ../../src/juce_LibrarySource.mm; sourceTree = SOURCE_ROOT; }; - 846C10DB0DE33FA100E8CCE8 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 846C10DC0DE33FA100E8CCE8 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; - 846C10DD0DE33FA100E8CCE8 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - 846C10DE0DE33FA100E8CCE8 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 846C10DF0DE33FA100E8CCE8 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 846C10E00DE33FA100E8CCE8 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 846C10E10DE33FA100E8CCE8 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; @@ -77,8 +72,8 @@ 846C10E40DE33FA100E8CCE8 /* DiscRecording.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiscRecording.framework; path = /System/Library/Frameworks/DiscRecording.framework; sourceTree = ""; }; 846C10E50DE33FA100E8CCE8 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 846C10E60DE33FA100E8CCE8 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 846C10E70DE33FA100E8CCE8 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 846C10E80DE33FA100E8CCE8 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 84E01DD80E910B7B003E41AF /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 84F176990A271BBD00908B2F /* jucer_ColourEditorComponent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = jucer_ColourEditorComponent.h; sourceTree = ""; }; 84F1769A0A271BBD00908B2F /* jucer_Colours.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = jucer_Colours.h; sourceTree = ""; }; 84F1769B0A271BBD00908B2F /* jucer_StoredSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = jucer_StoredSettings.cpp; sourceTree = ""; }; @@ -183,6 +178,7 @@ 84F555720A22381000A8311C /* jucer_Headers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = jucer_Headers.h; path = ../../src/jucer_Headers.h; sourceTree = SOURCE_ROOT; }; 84F555730A22381000A8311C /* jucer_Main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = jucer_Main.cpp; path = ../../src/jucer_Main.cpp; sourceTree = SOURCE_ROOT; }; 84F555B00A22381000A8311C /* jucer_ComponentTemplate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = jucer_ComponentTemplate.h; path = ../../src/templates/jucer_ComponentTemplate.h; sourceTree = SOURCE_ROOT; }; + 84F8B68D0EB5FB290020D98D /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 8D0C4E960486CD37000505A6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D0C4E970486CD37000505A6 /* Jucer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jucer.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -192,10 +188,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 846C10E90DE33FA100E8CCE8 /* AGL.framework in Frameworks */, 846C10EA0DE33FA100E8CCE8 /* ApplicationServices.framework in Frameworks */, - 846C10EB0DE33FA100E8CCE8 /* AudioUnit.framework in Frameworks */, - 846C10EC0DE33FA100E8CCE8 /* Carbon.framework in Frameworks */, 846C10ED0DE33FA100E8CCE8 /* Cocoa.framework in Frameworks */, 846C10EE0DE33FA100E8CCE8 /* CoreAudio.framework in Frameworks */, 846C10EF0DE33FA100E8CCE8 /* CoreFoundation.framework in Frameworks */, @@ -204,8 +197,9 @@ 846C10F20DE33FA100E8CCE8 /* DiscRecording.framework in Frameworks */, 846C10F30DE33FA100E8CCE8 /* IOKit.framework in Frameworks */, 846C10F40DE33FA100E8CCE8 /* OpenGL.framework in Frameworks */, - 846C10F50DE33FA100E8CCE8 /* QuickTime.framework in Frameworks */, 846C10F60DE33FA100E8CCE8 /* WebKit.framework in Frameworks */, + 84E01DD90E910B7B003E41AF /* QTKit.framework in Frameworks */, + 84F8B68E0EB5FB290020D98D /* QuickTime.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -264,19 +258,17 @@ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 846C10DB0DE33FA100E8CCE8 /* AGL.framework */, 846C10DC0DE33FA100E8CCE8 /* ApplicationServices.framework */, - 846C10DD0DE33FA100E8CCE8 /* AudioUnit.framework */, - 846C10DE0DE33FA100E8CCE8 /* Carbon.framework */, 846C10DF0DE33FA100E8CCE8 /* Cocoa.framework */, - 846C10E00DE33FA100E8CCE8 /* CoreAudio.framework */, 846C10E10DE33FA100E8CCE8 /* CoreFoundation.framework */, - 846C10E20DE33FA100E8CCE8 /* CoreMIDI.framework */, 846C10E30DE33FA100E8CCE8 /* CoreServices.framework */, + 846C10E00DE33FA100E8CCE8 /* CoreAudio.framework */, + 846C10E20DE33FA100E8CCE8 /* CoreMIDI.framework */, 846C10E40DE33FA100E8CCE8 /* DiscRecording.framework */, 846C10E50DE33FA100E8CCE8 /* IOKit.framework */, 846C10E60DE33FA100E8CCE8 /* OpenGL.framework */, - 846C10E70DE33FA100E8CCE8 /* QuickTime.framework */, + 84E01DD80E910B7B003E41AF /* QTKit.framework */, + 84F8B68D0EB5FB290020D98D /* QuickTime.framework */, 846C10E80DE33FA100E8CCE8 /* WebKit.framework */, ); name = "External Frameworks and Libraries"; diff --git a/extras/the jucer/src/BinaryData.cpp b/extras/the jucer/src/BinaryData.cpp index c08fddd03e..1279f531a8 100644 --- a/extras/the jucer/src/BinaryData.cpp +++ b/extras/the jucer/src/BinaryData.cpp @@ -911,4 +911,3 @@ static const unsigned char temp4[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68 0,98,28,9,155,95,0,2,104,68,236,11,1,8,160,17,225,73,128,0,3,0,120,52,172,151,198,78,252,63,0,0,0,0,73,69,78,68,174,66, 96,130,0,0}; const char* BinaryData::prefs_misc_png = (const char*) temp4; - diff --git a/extras/the jucer/src/juce_AppConfig.h b/extras/the jucer/src/juce_AppConfig.h index 00ed78cd97..8fce15e0ba 100644 --- a/extras/the jucer/src/juce_AppConfig.h +++ b/extras/the jucer/src/juce_AppConfig.h @@ -50,8 +50,8 @@ //#define JUCE_ENABLE_REPAINT_DEBUGGING 1 //#define JUCE_USE_XINERAMA 1 //#define JUCE_USE_XSHM 1 -//#define JUCE_PLUGINHOST_VST 1 -//#define JUCE_PLUGINHOST_AU 1 +#define JUCE_PLUGINHOST_VST 0 +#define JUCE_PLUGINHOST_AU 0 //#define JUCE_BUILD_GUI_CLASSES 1 //#define JUCE_CHECK_MEMORY_LEAKS 1 //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 diff --git a/extras/the jucer/src/jucer_Headers.h b/extras/the jucer/src/jucer_Headers.h index 718cb8a93a..484d8f0218 100644 --- a/extras/the jucer/src/jucer_Headers.h +++ b/extras/the jucer/src/jucer_Headers.h @@ -43,7 +43,7 @@ //============================================================================== #define JUCER_MAJOR_VERSION 1 -#define JUCER_MINOR_VERSION 11 +#define JUCER_MINOR_VERSION 12 //============================================================================== #include "BinaryData.h" diff --git a/extras/the jucer/src/jucer_Main.cpp b/extras/the jucer/src/jucer_Main.cpp index fa37717eb9..655f301126 100644 --- a/extras/the jucer/src/jucer_Main.cpp +++ b/extras/the jucer/src/jucer_Main.cpp @@ -83,7 +83,7 @@ public: StoredSettings::deleteInstance(); - quit (false); + quit(); } } diff --git a/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp b/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp index 1170eedfff..c14f28883c 100644 --- a/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp +++ b/extras/the jucer/src/utility/jucer_UtilityFunctions.cpp @@ -202,6 +202,9 @@ const String makeValidCppIdentifier (String s, if (allowTemplates) allowedChars += T("<>"); + if (! removeColons) + allowedChars += T(":"); + StringArray words; words.addTokens (s.retainCharacters (allowedChars), false); words.trim(); diff --git a/juce_Config.h b/juce_Config.h index 83fd150064..57c67807b8 100644 --- a/juce_Config.h +++ b/juce_Config.h @@ -30,7 +30,7 @@ */ #ifndef __JUCE_CONFIG_JUCEHEADER__ -#define __JUCE_CONFIG_JUCEHEADER__ +#define __JUCE_CONFIG_JUCEHEADER__ // (this comment is here to force the amalgamator to reinclude this file) //============================================================================== /* @@ -159,12 +159,16 @@ /** Enabling this builds support for VST audio plugins. @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU */ -//#define JUCE_PLUGINHOST_VST 1 +#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 */ -#define JUCE_PLUGINHOST_AU 1 +#ifndef JUCE_PLUGINHOST_AU +// #define JUCE_PLUGINHOST_AU 1 +#endif //============================================================================= /** Disabling this will avoid linking to any UI code. This is handy for diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 8cf2e13ab8..1b043163de 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -37,81 +37,575 @@ */ +#ifdef __JUCE_JUCEHEADER__ + /* When you add the amalgamated cpp file to your project, you mustn't include it in + a file where you've already included juce.h - just put it inside a file on its own, + possibly with your config flags preceding it, but don't include anything else. */ + #error +#endif + +/********* 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 _WIN32 -/********* Start of inlined file: win32_headers.h *********/ -#ifndef __WIN32_HEADERS_JUCEHEADER__ -#define __WIN32_HEADERS_JUCEHEADER__ +/********* Start of inlined file: juce_win32_NativeIncludes.h *********/ + +#ifndef __JUCE_WIN32_NATIVE_INCLUDES_H__ +#define __JUCE_WIN32_NATIVE_INCLUDES_H__ + +/********* 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 -#define WIN32_LEAN_AND_MEAN -// don't want to get told about microsoft's mistakes.. +#undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 + #ifdef _MSC_VER #pragma warning (push) - #pragma warning (disable : 4100 4201) -#endif - -// use Platform SDK as win2000 unless this is disabled -#ifndef DISABLE_TRANSPARENT_WINDOWS - #define _WIN32_WINNT 0x0500 + #pragma warning (disable : 4100 4201 4514 4312) #endif +#define _WIN32_WINNT 0x0500 #define _UNICODE 1 #define UNICODE 1 +#ifndef _WIN32_IE + #define _WIN32_IE 0x0400 +#endif + #include +#include #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if JUCE_OPENGL + #include +#endif #undef PACKED -#ifdef _MSC_VER - #pragma warning (pop) +#if JUCE_ASIO +/* + This is very frustrating - we only need to use a handful of definitions from + a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy + about 30 lines of code into this cpp file to create a fully stand-alone ASIO + implementation... + + ..unfortunately that would break Steinberg's license agreement for use of + their SDK, so I'm not allowed to do this. + + This means that anyone who wants to use JUCE's ASIO abilities will have to: + + 1) Agree to Steinberg's licensing terms and download the ASIO SDK + (see www.steinberg.net/Steinberg/Developers.asp). + + 2) Rebuild the whole of JUCE, setting the global definition JUCE_ASIO (you + can un-comment the "#define JUCE_ASIO" line in juce_Config.h + if you prefer). Make sure that your header search path will find the + iasiodrv.h file that comes with the SDK. (Only about 2-3 of the SDK header + files are actually needed - so to simplify things, you could just copy + these into your JUCE directory). + + If you're compiling and you get an error here because you don't have the + ASIO SDK installed, you can disable ASIO support by commenting-out the + "#define JUCE_ASIO" line in juce_Config.h, and rebuild your Juce library. + */ + #include "iasiodrv.h" #endif -#endif // __WIN32_HEADERS_JUCEHEADER__ -/********* End of inlined file: win32_headers.h *********/ +#if JUCE_USE_CDBURNER - #include - #include - #include + /* You'll need the Platform SDK for these headers - if you don't have it and don't + need to use CD-burning, then you might just want to disable the JUCE_USE_CDBURNER + flag in juce_Config.h to avoid these includes. + */ + #include + #include +#endif - #if JUCE_QUICKTIME - #include - #include - #include - #include - #include - #undef TARGET_OS_MAC // quicktime sets these, but they confuse some of the 3rd party libs - #undef MACOS - #endif +#if JUCE_QUICKTIME -#elif defined (LINUX) + /* If you've got an include error here, you probably need to install the QuickTime SDK and + add its header directory to your include path. + Alternatively, if you don't need any QuickTime services, just turn off the JUCE_QUICKTIME + flag in juce_Config.h + */ + #include + #include + #include + #include + #include + + /* If you've got QuickTime 7 installed, then these COM objects should be found in + the "\Program Files\Quicktime" directory. You'll need to add this directory to + your include search path to make these import statements work. + */ + #import + #import +#endif + +#ifdef _MSC_VER + #pragma warning (pop) +#endif + +#endif +/********* End of inlined file: juce_win32_NativeIncludes.h *********/ + +#elif defined (LINUX) + // #else - #include - #include - #define __Point__ - #include - #include - #include - #include - #include - #include - #include - #include - - #include - #include - #include - #include + +/********* Start of inlined file: juce_mac_NativeIncludes.h *********/ +#ifndef _JUCE_MAC_NATIVEINCLUDES_H_ +#define _JUCE_MAC_NATIVEINCLUDES_H_ + +/* + 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. +*/ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#include +#include +#include +#include +#include +#include +#include + +#if MACOS_10_4_OR_EARLIER + #include +#endif + +#endif +/********* End of inlined file: juce_mac_NativeIncludes.h *********/ + #endif //============================================================================== @@ -596,6 +1090,10 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI() { if (! juceInitialisedNonGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + #ifdef JUCE_DEBUG // Some simple test code to keep an eye on things and make sure these functions // work ok on all platforms. Let me know if any of these assertions fail! @@ -638,6 +1136,10 @@ void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI() { if (juceInitialisedNonGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + #if JUCE_WIN32 // need to shut down sockets if they were used.. if (juce_CloseWin32SocketLib != 0) @@ -1086,7 +1588,9 @@ static int extendedModulo (const int64 value, const int modulo) throw() int Time::getMinutes() const throw() { - return extendedModulo (millisSinceEpoch / 60000, 60); + struct tm t; + millisToLocal (millisSinceEpoch, t); + return t.tm_min; } int Time::getSeconds() const throw() @@ -5966,7 +6470,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_Socket.cpp *********/ #ifdef _WIN32 - #include #ifdef _MSC_VER @@ -5974,19 +6477,20 @@ END_JUCE_NAMESPACE #endif #else - #ifndef LINUX - #include + #ifdef LINUX + #include + #include + #include + #include + #include + #include + #else + #include #endif - #include #include - #include #include - #include #include - #include - #include - #include #endif BEGIN_JUCE_NAMESPACE @@ -6626,9 +7130,9 @@ static const String getMangledParameters (const StringPairArray& parameters) if (i > 0) p += T("&"); - p << URL::addEscapeChars (parameters.getAllKeys() [i]) + p << URL::addEscapeChars (parameters.getAllKeys() [i], true) << T("=") - << URL::addEscapeChars (parameters.getAllValues() [i]); + << URL::addEscapeChars (parameters.getAllValues() [i], true); } return p; @@ -7003,11 +7507,13 @@ const String URL::removeEscapeChars (const String& s) return stringResult; } -const String URL::addEscapeChars (const String& s) +const String URL::addEscapeChars (const String& s, const bool isParameter) { String result; result.preallocateStorage (s.length() + 8); const char* utf8 = s.toUTF8(); + const char* legalChars = isParameter ? "_-.*!'()" + : "_-$.*!'(),"; while (*utf8 != 0) { @@ -7018,7 +7524,7 @@ const String URL::addEscapeChars (const String& s) result += T('+'); } else if (CharacterFunctions::isLetterOrDigit (c) - || CharacterFunctions::indexOfChar ("_-$.*!'(),", c, false) >= 0) + || CharacterFunctions::indexOfChar (legalChars, c, false) >= 0) { result << c; } @@ -12812,7 +13318,8 @@ static void writeSpaces (OutputStream& out, int numSpaces) throw() } void XmlElement::writeElementAsText (OutputStream& outputStream, - const int indentationLevel) const throw() + const int indentationLevel, + const int lineWrapLength) const throw() { writeSpaces (outputStream, indentationLevel); @@ -12828,7 +13335,7 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, const XmlAttributeNode* att = attributes; while (att != 0) { - if (lineLen > 60 && indentationLevel >= 0) + if (lineLen > lineWrapLength && indentationLevel >= 0) { outputStream.write ("\r\n", 2); writeSpaces (outputStream, attIndent); @@ -12881,11 +13388,11 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, if (lastWasTextNode) outputStream.write ("\r\n", 2); - child->writeElementAsText (outputStream, indentationLevel + 2); + child->writeElementAsText (outputStream, indentationLevel + 2, lineWrapLength); } else { - child->writeElementAsText (outputStream, indentationLevel); + child->writeElementAsText (outputStream, indentationLevel, lineWrapLength); } lastWasTextNode = false; @@ -12931,7 +13438,8 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, const String XmlElement::createDocument (const String& dtd, const bool allOnOneLine, const bool includeXmlHeader, - const tchar* const encoding) const throw() + const tchar* const encoding, + const int lineWrapLength) const throw() { String doc; doc.preallocateStorage (1024); @@ -12956,7 +13464,7 @@ const String XmlElement::createDocument (const String& dtd, } MemoryOutputStream mem (2048, 4096); - writeElementAsText (mem, allOnOneLine ? -1 : 0); + writeElementAsText (mem, allOnOneLine ? -1 : 0, lineWrapLength); return doc + String (mem.getData(), mem.getDataSize()); @@ -12964,7 +13472,8 @@ const String XmlElement::createDocument (const String& dtd, bool XmlElement::writeToFile (const File& f, const String& dtd, - const tchar* const encoding) const throw() + const tchar* const encoding, + const int lineWrapLength) const throw() { if (f.hasWriteAccess()) { @@ -12977,7 +13486,7 @@ bool XmlElement::writeToFile (const File& f, *out << "\r\n\r\n" << dtd << "\r\n"; - writeElementAsText (*out, 0); + writeElementAsText (*out, 0, lineWrapLength); delete out; @@ -13738,7 +14247,7 @@ ReadWriteLock::~ReadWriteLock() throw() void ReadWriteLock::enterRead() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (;;) @@ -13774,14 +14283,14 @@ void ReadWriteLock::enterRead() const throw() void ReadWriteLock::exitRead() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (int i = 0; i < readerThreads.size(); i += 2) { if (readerThreads.getUnchecked(i) == threadId) { - const int newCount = readerThreads.getUnchecked (i + 1) - 1; + const int newCount = ((int) readerThreads.getUnchecked (i + 1)) - 1; if (newCount == 0) { @@ -13802,7 +14311,7 @@ void ReadWriteLock::exitRead() const throw() void ReadWriteLock::enterWrite() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (;;) @@ -13827,7 +14336,7 @@ void ReadWriteLock::enterWrite() const throw() bool ReadWriteLock::tryEnterWrite() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); if (readerThreads.size() + numWriters == 0 @@ -14043,7 +14552,7 @@ void Thread::setAffinityMask (const uint32 affinityMask) throw() affinityMask_ = affinityMask; } -int Thread::getThreadId() const throw() +int64 Thread::getThreadId() const throw() { return threadId_; } @@ -14065,7 +14574,7 @@ int Thread::getNumRunningThreads() throw() Thread* Thread::getCurrentThread() throw() { - const int thisId = getCurrentThreadId(); + const int64 thisId = getCurrentThreadId(); Thread* result = 0; runningThreadsLock.enter(); @@ -14655,9 +15164,9 @@ void JUCEApplication::systemRequestedQuit() quit(); } -void JUCEApplication::quit (const bool useMaximumForce) +void JUCEApplication::quit() { - MessageManager::getInstance()->postQuitMessage (useMaximumForce); + MessageManager::getInstance()->stopDispatchLoop(); } void JUCEApplication::setApplicationReturnValue (const int newReturnValue) throw() @@ -14718,7 +15227,6 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) { jassert (appInstance == 0); appInstance = app; - bool useForce = true; initialiseJuce_GUI(); @@ -14756,7 +15264,7 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) app->stillInitialising = false; // now loop until a quit message is received.. - useForce = MessageManager::getInstance()->runDispatchLoop(); + MessageManager::getInstance()->runDispatchLoop(); MessageManager::getInstance()->deregisterBroadcastListener (app); @@ -14777,10 +15285,10 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) } #endif - return shutdownAppAndClearUp (useForce); + return shutdownAppAndClearUp(); } -int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) +int JUCEApplication::shutdownAppAndClearUp() { jassert (appInstance != 0); JUCEApplication* const app = appInstance; @@ -14819,11 +15327,6 @@ int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) } JUCE_CATCH_ALL_ASSERT - if (useMaximumForce) - { - Process::terminate(); - } - reentrancyCheck = false; } @@ -14833,6 +15336,10 @@ int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) int JUCEApplication::main (int argc, char* argv[], JUCEApplication* const newApp) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + juce_setCurrentExecutableFileName (String::fromUTF8 ((const uint8*) argv[0])); String cmd; @@ -14854,6 +15361,9 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI() { if (! juceInitialisedGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif juceInitialisedGUI = true; initialiseJuce_NonGUI(); @@ -14887,6 +15397,9 @@ void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI() { if (juceInitialisedGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif DeletedAtShutdown::deleteAll(); LookAndFeel::clearDefaultLookAndFeel(); @@ -15174,7 +15687,7 @@ ApplicationCommandTarget* ApplicationCommandManager::findDefaultComponentTarget( } } - if (c == 0) + if (c == 0 && Process::isForegroundProcess()) { // getting a bit desperate now - try all desktop comps.. for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) @@ -18232,6 +18745,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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) @@ -18263,6 +18972,8 @@ END_JUCE_NAMESPACE #endif #endif +#if ! (JUCE_MAC && JUCE_64BIT) + BEGIN_JUCE_NAMESPACE bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle); @@ -18599,6 +19310,7 @@ AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*stream END_JUCE_NAMESPACE +#endif #endif /********* End of inlined file: juce_QuickTimeAudioFormat.cpp *********/ @@ -21173,7 +21885,7 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne newSetup.inputDeviceName); if (currentAudioDevice == 0) - error = "Can't open device"; + error = "Can't open the audio device!\n\nThis may be because another application is currently using the same device - if so, you should close any other applications and try again!"; else error = currentAudioDevice->getLastError(); @@ -21194,6 +21906,12 @@ const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& ne outputChannels.clear(); outputChannels.setRange (0, numOutputChansNeeded, true); } + + if (newSetup.inputDeviceName.isEmpty()) + inputChannels.clear(); + + if (newSetup.outputDeviceName.isEmpty()) + outputChannels.clear(); } if (! newSetup.useDefaultInputChannels) @@ -22224,10 +22942,11 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, size (numSamples) { jassert (numSamples >= 0); - jassert (numChannels_ > 0 && numChannels_ <= maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); allocatedBytes = numChannels * numSamples * sizeof (float) + 32; allocatedData = (float*) juce_malloc (allocatedBytes); + channels = (float**) juce_malloc (numChannels_ * sizeof (float*)); float* chan = allocatedData; for (int i = 0; i < numChannels_; ++i) @@ -22247,7 +22966,9 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, allocatedBytes (0), allocatedData (0) { - jassert (((unsigned int) numChannels_) <= (unsigned int) maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); + + channels = (float**) juce_malloc (numChannels_ * sizeof (float*)); for (int i = 0; i < numChannels_; ++i) { @@ -22264,12 +22985,15 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, const int numChannels_, const int numSamples) throw() { - jassert (((unsigned int) numChannels_) <= (unsigned int) maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); juce_free (allocatedData); allocatedData = 0; allocatedBytes = 0; + if (numChannels_ > numChannels) + channels = (float**) juce_realloc (channels, numChannels_ * sizeof (float*)); + numChannels = numChannels_; size = numSamples; @@ -22288,6 +23012,8 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw() : numChannels (other.numChannels), size (other.size) { + channels = (float**) juce_malloc (other.numChannels * sizeof (float*)); + if (other.allocatedData != 0) { allocatedBytes = numChannels * size * sizeof (float) + 32; @@ -22331,6 +23057,7 @@ const AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& AudioSampleBuffer::~AudioSampleBuffer() throw() { juce_free (allocatedData); + juce_free (channels); } float* AudioSampleBuffer::getSampleData (const int channelNumber, @@ -22348,7 +23075,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, const bool clearExtraSpace, const bool avoidReallocating) throw() { - jassert (newNumChannels > 0 && newNumChannels <= maxNumAudioSampleBufferChannels); + jassert (newNumChannels > 0); if (newNumSamples != size || newNumChannels != numChannels) { @@ -22391,6 +23118,10 @@ void AudioSampleBuffer::setSize (const int newNumChannels, } size = newNumSamples; + + if (newNumChannels > numChannels) + channels = (float**) juce_realloc (channels, newNumChannels * sizeof (float*)); + numChannels = newNumChannels; float* chan = allocatedData; @@ -22859,6 +23590,27 @@ void IIRFilter::reset() throw() y2 = 0; } +float IIRFilter::processSingleSampleRaw (const float in) throw() +{ + float out = coefficients[0] * in + + coefficients[1] * x1 + + coefficients[2] * x2 + - coefficients[4] * y1 + - coefficients[5] * y2; + +#if JUCE_INTEL + if (! (out < -1.0e-8 || out > 1.0e-8)) + out = 0; +#endif + + x2 = x1; + x1 = in; + y2 = y1; + y1 = out; + + return out; +} + void IIRFilter::processSamples (float* const samples, const int numSamples) throw() { @@ -26421,7 +27173,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format) aw.enterModalState(); - MessageManager::getInstance()->dispatchPendingMessages(); + MessageManager::getInstance()->runDispatchLoopUntil (300); PluginDirectoryScanner scanner (list, *format, path, true, deadMansPedalFile); @@ -26430,7 +27182,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format) aw.setMessage (TRANS("Testing:\n\n") + scanner.getNextPluginFileThatWillBeScanned().getFileName()); - MessageManager::getInstance()->dispatchPendingMessages (500); + MessageManager::getInstance()->runDispatchLoopUntil (20); if (! scanner.scanNextFile (true)) break; @@ -26460,6 +27212,202 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_AudioUnitPluginFormat.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -27673,9 +28621,209 @@ END_JUCE_NAMESPACE #endif /********* End of inlined file: juce_AudioUnitPluginFormat.cpp *********/ +/********* Start of inlined file: juce_VSTPluginFormat.mm *********/ +// This file just wraps juce_VSTPluginFormat.cpp in an objective-C wrapper +#define JUCE_MAC_VST_INCLUDED 1 + /********* Start of inlined file: juce_VSTPluginFormat.cpp *********/ -#if JUCE_PLUGINHOST_VST +/********* 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 && (JUCE_MAC || JUCE_WIN32) #ifdef _WIN32 #undef _WIN32_WINNT @@ -27684,7 +28832,7 @@ END_JUCE_NAMESPACE #define STRICT #include #include - #pragma warning (disable : 4312) + #pragma warning (disable : 4312 4355) #elif defined (LINUX) #include #include @@ -27696,11 +28844,238 @@ END_JUCE_NAMESPACE #undef Drawable #undef Time #else + #ifndef JUCE_MAC_VST_INCLUDED + // On the mac, this file needs to be compiled indirectly, by using + // juce_VSTPluginFormat.mm instead - that wraps it as an objective-C file for cocoa + #error + #endif + #include #include #endif +#if ! (JUCE_MAC && JUCE_64BIT) + BEGIN_JUCE_NAMESPACE +#if JUCE_MAC + +/********* Start of inlined file: juce_mac_CarbonViewWrapperComponent.h *********/ +/** Creates a floating carbon window that can be used to hold a carbon UI. + + This is a handy class that's designed to be inlined where needed, e.g. + in the audio plugin hosting code. +*/ +class CarbonViewWrapperComponent : public Component, + public ComponentMovementWatcher, + public Timer +{ +public: + CarbonViewWrapperComponent() + : ComponentMovementWatcher (this), + wrapperWindow (0), + embeddedView (0), + recursiveResize (false) + { + } + + virtual ~CarbonViewWrapperComponent() + { + jassert (embeddedView == 0); // must call deleteWindow() in the subclass's destructor! + } + + virtual HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) = 0; + virtual void removeView (HIViewRef embeddedView) = 0; + virtual void mouseDown (int x, int y) {} + virtual void paint() {} + + virtual bool getEmbeddedViewSize (int& w, int& h) + { + if (embeddedView == 0) + return false; + + HIRect bounds; + HIViewGetBounds (embeddedView, &bounds); + w = jmax (1, roundFloatToInt (bounds.size.width)); + h = jmax (1, roundFloatToInt (bounds.size.height)); + return true; + } + + void createWindow() + { + if (wrapperWindow == 0) + { + Rect r; + r.left = getScreenX(); + r.top = getScreenY(); + r.right = r.left + getWidth(); + r.bottom = r.top + getHeight(); + + CreateNewWindow (kDocumentWindowClass, + (WindowAttributes) (kWindowStandardHandlerAttribute | kWindowCompositingAttribute + | kWindowNoShadowAttribute | kWindowNoTitleBarAttribute), + &r, &wrapperWindow); + + jassert (wrapperWindow != 0); + if (wrapperWindow == 0) + return; + + NSWindow* carbonWindow = [[NSWindow alloc] initWithWindowRef: wrapperWindow]; + NSWindow* ownerWindow = [((NSView*) getWindowHandle()) window]; + + [ownerWindow addChildWindow: carbonWindow + ordered: NSWindowAbove]; + + embeddedView = attachView (wrapperWindow, HIViewGetRoot (wrapperWindow)); + + EventTypeSpec windowEventTypes[] = { { kEventClassWindow, kEventWindowGetClickActivation }, + { kEventClassWindow, kEventWindowHandleDeactivate } }; + + EventHandlerUPP upp = NewEventHandlerUPP (carbonEventCallback); + InstallWindowEventHandler (wrapperWindow, upp, + sizeof (windowEventTypes) / sizeof (EventTypeSpec), + windowEventTypes, this, &eventHandlerRef); + + setOurSizeToEmbeddedViewSize(); + setEmbeddedWindowToOurSize(); + } + } + + void deleteWindow() + { + removeView (embeddedView); + embeddedView = 0; + + if (wrapperWindow != 0) + { + RemoveEventHandler (eventHandlerRef); + DisposeWindow (wrapperWindow); + wrapperWindow = 0; + } + } + + void setOurSizeToEmbeddedViewSize() + { + int w, h; + if (getEmbeddedViewSize (w, h)) + { + if (w != getWidth() || h != getHeight()) + { + startTimer (50); + + setSize (w, h); + if (getParentComponent() != 0) + getParentComponent()->setSize (w, h); + } + else + { + startTimer (jlimit (50, 500, getTimerInterval() + 20)); + } + } + else + { + stopTimer(); + } + } + + void setEmbeddedWindowToOurSize() + { + if (! recursiveResize) + { + recursiveResize = true; + + if (embeddedView != 0) + { + HIRect r; + r.origin.x = 0; + r.origin.y = 0; + r.size.width = (float) getWidth(); + r.size.height = (float) getHeight(); + HIViewSetFrame (embeddedView, &r); + } + + if (wrapperWindow != 0) + { + Rect wr; + wr.left = getScreenX(); + wr.top = getScreenY(); + wr.right = wr.left + getWidth(); + wr.bottom = wr.top + getHeight(); + + SetWindowBounds (wrapperWindow, kWindowContentRgn, &wr); + ShowWindow (wrapperWindow); + } + + recursiveResize = false; + } + } + + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) + { + setEmbeddedWindowToOurSize(); + } + + void componentPeerChanged() + { + deleteWindow(); + createWindow(); + } + + void componentVisibilityChanged (Component&) + { + if (isShowing()) + createWindow(); + else + deleteWindow(); + + setEmbeddedWindowToOurSize(); + } + + void timerCallback() + { + setOurSizeToEmbeddedViewSize(); + } + + OSStatus carbonEventHandler (EventHandlerCallRef nextHandlerRef, + EventRef event) + { + switch (GetEventKind (event)) + { + case kEventWindowHandleDeactivate: + ActivateWindow (wrapperWindow, TRUE); + break; + + case kEventWindowGetClickActivation: + { + getTopLevelComponent()->toFront (false); + + ClickActivationResult howToHandleClick = kActivateAndHandleClick; + + SetEventParameter (event, kEventParamClickActivation, typeClickActivationResult, + sizeof (ClickActivationResult), &howToHandleClick); + } + break; + } + + return noErr; + } + + static pascal OSStatus carbonEventCallback (EventHandlerCallRef nextHandlerRef, + EventRef event, void* userData) + { + return ((CarbonViewWrapperComponent*) userData)->carbonEventHandler (nextHandlerRef, event); + } + +protected: + WindowRef wrapperWindow; + HIViewRef embeddedView; + bool recursiveResize; + + EventHandlerRef eventHandlerRef; +}; +/********* End of inlined file: juce_mac_CarbonViewWrapperComponent.h *********/ + +#endif + #undef PRAGMA_ALIGN_SUPPORTED #define VST_FORCE_DEPRECATED 0 @@ -27826,11 +29201,7 @@ class VSTPluginWindow; #define log(a) #endif -#if JUCE_MAC -extern bool juce_isHIViewCreatedByJuce (HIViewRef view); -extern bool juce_isWindowCreatedByJuce (WindowRef window); - -#if JUCE_PPC +#if JUCE_MAC && JUCE_PPC static void* NewCFMFromMachO (void* const machofp) throw() { void* result = juce_malloc (8); @@ -27841,7 +29212,6 @@ static void* NewCFMFromMachO (void* const machofp) throw() return result; } #endif -#endif #if JUCE_LINUX @@ -28005,7 +29375,9 @@ public: #if JUCE_WIN32 || JUCE_LINUX fullParentDirectoryPathName = file_.getParentDirectory().getFullPathName(); #elif JUCE_MAC - PlatformUtilities::makeFSSpecFromPath (&parentDirFSSpec, file_.getParentDirectory().getFullPathName()); + FSRef ref; + PlatformUtilities::makeFSRefFromPath (&ref, file_.getParentDirectory().getFullPathName()); + FSGetCatalogInfo (&ref, kFSCatInfoNone, 0, 0, &parentDirFSSpec, 0); #endif } @@ -28036,12 +29408,12 @@ public: pluginName = file.getFileNameWithoutExtension(); - hModule = Process::loadDynamicLibrary (file.getFullPathName()); + hModule = PlatformUtilities::loadDynamicLibrary (file.getFullPathName()); - moduleMain = (MainCall) Process::getProcedureEntryPoint (hModule, "VSTPluginMain"); + moduleMain = (MainCall) PlatformUtilities::getProcedureEntryPoint (hModule, "VSTPluginMain"); if (moduleMain == 0) - moduleMain = (MainCall) Process::getProcedureEntryPoint (hModule, "main"); + moduleMain = (MainCall) PlatformUtilities::getProcedureEntryPoint (hModule, "main"); return moduleMain != 0; } @@ -28050,7 +29422,7 @@ public: { _fpreset(); // (doesn't do any harm) - Process::freeDynamicLibrary (hModule); + PlatformUtilities::freeDynamicLibrary (hModule); } void closeEffect (AEffect* eff) @@ -28631,6 +30003,26 @@ void VSTPluginInstance::processBlock (AudioSampleBuffer& buffer, if (initialised) { + AudioPlayHead* playHead = getPlayHead(); + + if (playHead != 0) + { + AudioPlayHead::CurrentPositionInfo position; + playHead->getCurrentPosition (position); + + vstHostTime.tempo = position.bpm; + vstHostTime.timeSigNumerator = position.timeSigNumerator; + vstHostTime.timeSigDenominator = position.timeSigDenominator; + vstHostTime.ppqPos = position.ppqPosition; + vstHostTime.barStartPos = position.ppqPositionOfLastBarStart; + vstHostTime.flags |= kVstTempoValid | kVstTimeSigValid | kVstPpqPosValid | kVstBarsValid; + + if (position.isPlaying) + vstHostTime.flags |= kVstTransportPlaying; + else + vstHostTime.flags &= ~kVstTransportPlaying; + } + #if JUCE_WIN32 vstHostTime.nanoSeconds = timeGetTime() * 1000000.0; #elif JUCE_LINUX @@ -28806,12 +30198,18 @@ void VSTPluginInstance::handleMidiFromPlugin (const VstEvents* const events) static Array activeVSTWindows; class VSTPluginWindow : public AudioProcessorEditor, + #if ! JUCE_MAC + public ComponentMovementWatcher, + #endif public Timer { public: VSTPluginWindow (VSTPluginInstance& plugin_) : AudioProcessorEditor (&plugin_), +#if ! JUCE_MAC + ComponentMovementWatcher (this), +#endif plugin (plugin_), isOpen (false), wasShowing (false), @@ -28827,11 +30225,9 @@ public: pluginWindow = None; pluginProc = None; #else - pluginViewRef = 0; + addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this)); #endif - movementWatcher = new CompMovementWatcher (this); - activeVSTWindows.add (this); setSize (1, 1); @@ -28841,15 +30237,17 @@ public: ~VSTPluginWindow() { - deleteAndZero (movementWatcher); - +#if JUCE_MAC + deleteAndZero (innerWrapper); +#else closePluginWindow(); - +#endif activeVSTWindows.removeValue (this); plugin.editorBeingDeleted (this); } - void componentMovedOrResized() +#if ! JUCE_MAC + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) { if (recursiveResize) return; @@ -28863,39 +30261,7 @@ public: recursiveResize = true; -#if JUCE_MAC - if (pluginViewRef != 0) - { - HIRect r; - r.origin.x = (float) x; - r.origin.y = (float) y; - r.size.width = (float) getWidth(); - r.size.height = (float) getHeight(); - HIViewSetFrame (pluginViewRef, &r); - } - else if (pluginWindowRef != 0) - { - Rect r; - r.left = getScreenX(); - r.top = getScreenY(); - r.right = r.left + getWidth(); - r.bottom = r.top + getHeight(); - - WindowGroupRef group = GetWindowGroup (pluginWindowRef); - WindowGroupAttributes atts; - GetWindowGroupAttributes (group, &atts); - ChangeWindowGroupAttributes (group, 0, kWindowGroupAttrMoveTogether); - - SetWindowBounds (pluginWindowRef, kWindowContentRgn, &r); - - if ((atts & kWindowGroupAttrMoveTogether) != 0) - ChangeWindowGroupAttributes (group, kWindowGroupAttrMoveTogether, 0); - } - else - { - repaint(); - } -#elif JUCE_WIN32 +#if JUCE_WIN32 if (pluginHWND != 0) MoveWindow (pluginHWND, x, y, getWidth(), getHeight(), TRUE); #elif JUCE_LINUX @@ -28911,7 +30277,7 @@ public: } } - void componentVisibilityChanged() + void componentVisibilityChanged (Component&) { const bool isShowingNow = isShowing(); @@ -28925,7 +30291,7 @@ public: closePluginWindow(); } - componentMovedOrResized(); + componentMovedOrResized (true, true); } void componentPeerChanged() @@ -28933,6 +30299,7 @@ public: closePluginWindow(); openPluginWindow(); } +#endif bool keyStateChanged() { @@ -28944,6 +30311,12 @@ public: return pluginWantsKeys; } +#if JUCE_MAC + void paint (Graphics& g) + { + g.fillAll (Colours::black); + } +#else void paint (Graphics& g) { if (isOpen) @@ -28956,18 +30329,7 @@ public: getScreenY() - peer->getScreenY(), getWidth(), getHeight()); -#if JUCE_MAC - if (pluginViewRef == 0) - { - ERect r; - r.left = getScreenX() - peer->getScreenX(); - r.right = r.left + getWidth(); - r.top = getScreenY() - peer->getScreenY(); - r.bottom = r.top + getHeight(); - - dispatch (effEditDraw, 0, 0, &r, 0); - } -#elif JUCE_LINUX +#if JUCE_LINUX if (pluginWindow != 0) { const Rectangle clip (g.getClipBounds()); @@ -28992,6 +30354,7 @@ public: g.fillAll (Colours::black); } } +#endif void timerCallback() { @@ -29021,20 +30384,7 @@ public: void mouseDown (const MouseEvent& e) { -#if JUCE_MAC - if (! alreadyInside) - { - alreadyInside = true; - toFront (true); - dispatch (effEditMouse, e.x, e.y, 0, 0); - alreadyInside = false; - } - else - { - PostEvent (::mouseDown, 0); - } -#elif JUCE_LINUX - +#if JUCE_LINUX if (pluginWindow == 0) return; @@ -29056,7 +30406,7 @@ public: sendEventToChild (&ev); -#else +#elif JUCE_WIN32 (void) e; toFront (true); @@ -29084,14 +30434,55 @@ private: HWND pluginHWND; void* originalWndProc; int sizeCheckCount; -#elif JUCE_MAC - HIViewRef pluginViewRef; - WindowRef pluginWindowRef; #elif JUCE_LINUX Window pluginWindow; EventProcPtr pluginProc; #endif +#if JUCE_MAC + void openPluginWindow (WindowRef parentWindow) + { + if (isOpen || parentWindow == 0) + return; + + isOpen = true; + + ERect* rect = 0; + dispatch (effEditGetRect, 0, 0, &rect, 0); + dispatch (effEditOpen, 0, 0, parentWindow, 0); + + // do this before and after like in the steinberg example + dispatch (effEditGetRect, 0, 0, &rect, 0); + dispatch (effGetProgram, 0, 0, 0, 0); // also in steinberg code + + // Install keyboard hooks + pluginWantsKeys = (dispatch (effKeysRequired, 0, 0, 0, 0) == 0); + + // double-check it's not too tiny + int w = 250, h = 150; + + if (rect != 0) + { + w = rect->right - rect->left; + h = rect->bottom - rect->top; + + if (w == 0 || h == 0) + { + w = 250; + h = 150; + } + } + + w = jmax (w, 32); + h = jmax (h, 32); + + setSize (w, h); + + startTimer (18 + JUCE_NAMESPACE::Random::getSystemRandom().nextInt (5)); + repaint(); + } + +#else void openPluginWindow() { if (isOpen || getWindowHandle() == 0) @@ -29165,44 +30556,6 @@ private: } } } -#elif JUCE_MAC - HIViewRef root = HIViewGetRoot ((WindowRef) getWindowHandle()); - HIViewFindByID (root, kHIViewWindowContentID, &root); - pluginViewRef = HIViewGetFirstSubview (root); - - while (pluginViewRef != 0 && juce_isHIViewCreatedByJuce (pluginViewRef)) - pluginViewRef = HIViewGetNextView (pluginViewRef); - - pluginWindowRef = 0; - - if (pluginViewRef == 0) - { - WindowGroupRef ourGroup = GetWindowGroup ((WindowRef) getWindowHandle()); - //DebugPrintWindowGroup (ourGroup); - //DebugPrintAllWindowGroups(); - - GetIndexedWindow (ourGroup, 1, - kWindowGroupContentsVisible, - &pluginWindowRef); - - if (pluginWindowRef == (WindowRef) getWindowHandle() - || juce_isWindowCreatedByJuce (pluginWindowRef)) - pluginWindowRef = 0; - } - - int w = 250, h = 150; - - if (rect != 0) - { - w = rect->right - rect->left; - h = rect->bottom - rect->top; - - if (w == 0 || h == 0) - { - w = 250; - h = 150; - } - } #elif JUCE_LINUX pluginWindow = getChildWindow ((Window) getWindowHandle()); @@ -29242,7 +30595,9 @@ private: startTimer (18 + JUCE_NAMESPACE::Random::getSystemRandom().nextInt (5)); repaint(); } +#endif +#if ! JUCE_MAC void closePluginWindow() { if (isOpen) @@ -29267,10 +30622,6 @@ private: DestroyWindow (pluginHWND); pluginHWND = 0; -#elif JUCE_MAC - dispatch (effEditSleep, 0, 0, 0, 0); - pluginViewRef = 0; - stopTimer(); #elif JUCE_LINUX stopTimer(); pluginWindow = 0; @@ -29278,6 +30629,12 @@ private: #endif } } +#endif + + int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) + { + return plugin.dispatch (opcode, index, value, ptr, opt); + } #if JUCE_WIN32 void checkPluginWindowSize() throw() @@ -29295,45 +30652,8 @@ private: sizeCheckCount = 0; } } -#endif - - class CompMovementWatcher : public ComponentMovementWatcher - { - public: - CompMovementWatcher (VSTPluginWindow* const owner_) - : ComponentMovementWatcher (owner_), - owner (owner_) - { - } - - void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) - { - owner->componentMovedOrResized(); - } - - void componentPeerChanged() - { - owner->componentPeerChanged(); - } - - void componentVisibilityChanged (Component&) - { - owner->componentVisibilityChanged(); - } - - private: - VSTPluginWindow* const owner; - }; - - CompMovementWatcher* movementWatcher; - - int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) - { - return plugin.dispatch (opcode, index, value, ptr, opt); - } // hooks to get keyboard events from VST windows.. -#if JUCE_WIN32 static LRESULT CALLBACK vstHookWndProc (HWND hW, UINT message, WPARAM wParam, LPARAM lParam) { for (int i = activeVSTWindows.size(); --i >= 0;) @@ -29526,6 +30846,86 @@ private: } #endif +#if JUCE_MAC + class InnerWrapperComponent : public CarbonViewWrapperComponent + { + public: + InnerWrapperComponent (VSTPluginWindow* const owner_) + : owner (owner_), + alreadyInside (false) + { + } + + ~InnerWrapperComponent() + { + deleteWindow(); + } + + HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) + { + owner->openPluginWindow (windowRef); + return 0; + } + + void removeView (HIViewRef) + { + owner->dispatch (effEditClose, 0, 0, 0, 0); + owner->dispatch (effEditSleep, 0, 0, 0, 0); + } + + bool getEmbeddedViewSize (int& w, int& h) + { + ERect* rect = 0; + owner->dispatch (effEditGetRect, 0, 0, &rect, 0); + w = rect->right - rect->left; + h = rect->bottom - rect->top; + return true; + } + + void mouseDown (int x, int y) + { + if (! alreadyInside) + { + alreadyInside = true; + getTopLevelComponent()->toFront (true); + owner->dispatch (effEditMouse, x, y, 0, 0); + alreadyInside = false; + } + else + { + PostEvent (::mouseDown, 0); + } + } + + void paint() + { + ComponentPeer* const peer = getPeer(); + + if (peer != 0) + { + ERect r; + r.left = getScreenX() - peer->getScreenX(); + r.right = r.left + getWidth(); + r.top = getScreenY() - peer->getScreenY(); + r.bottom = r.top + getHeight(); + + owner->dispatch (effEditDraw, 0, 0, &r, 0); + } + } + + private: + VSTPluginWindow* const owner; + bool alreadyInside; + }; + + friend class InnerWrapperComponent; + InnerWrapperComponent* innerWrapper; + + void resized() + { + innerWrapper->setSize (getWidth(), getHeight()); + } +#endif }; AudioProcessorEditor* VSTPluginInstance::createEditor() @@ -30587,11 +31987,15 @@ const FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() END_JUCE_NAMESPACE +#endif + #undef log #endif /********* End of inlined file: juce_VSTPluginFormat.cpp *********/ +/********* End of inlined file: juce_VSTPluginFormat.mm *********/ + /********* Start of inlined file: juce_AudioProcessor.cpp *********/ BEGIN_JUCE_NAMESPACE @@ -32724,7 +34128,8 @@ Synthesiser::Synthesiser() lastNoteOnCounter (0), shouldStealNotes (true) { - zeromem (lastPitchWheelValues, sizeof (lastPitchWheelValues)); + for (int i = 0; i < numElementsInArray (lastPitchWheelValues); ++i) + lastPitchWheelValues[i] = 0x2000; } Synthesiser::~Synthesiser() @@ -34416,14 +35821,7 @@ static const int quitMessageId = 0xfffff321; MessageManager::MessageManager() throw() : broadcastListeners (0), quitMessagePosted (false), - quitMessageReceived (false), - useMaximumForceWhenQuitting (true), - messageCounter (0), - lastMessageCounter (-1), - isInMessageDispatcher (0), - needToGetRidOfWaitCursor (false), - timeBeforeWaitCursor (0), - lastActivityCheckOkTime (0) + quitMessageReceived (false) { currentLockingThreadId = messageThreadId = Thread::getCurrentThreadId(); } @@ -34443,8 +35841,6 @@ MessageManager* MessageManager::getInstance() throw() { instance = new MessageManager(); doPlatformSpecificInitialisation(); - - instance->setTimeBeforeShowingWaitCursor (500); } return instance; @@ -34471,105 +35867,52 @@ void MessageManager::deliverMessage (void* message) recipient->handleMessage (*m); } JUCE_CATCH_EXCEPTION - - if (needToGetRidOfWaitCursor) - { - needToGetRidOfWaitCursor = false; - MouseCursor::hideWaitCursor(); - } - - ++messageCounter; } else if (recipient == 0 && m->intParameter1 == quitMessageId) { quitMessageReceived = true; - useMaximumForceWhenQuitting = (m->intParameter2 != 0); } delete m; } -bool MessageManager::dispatchNextMessage (const bool returnImmediatelyIfNoMessages, - bool* const wasAMessageDispatched) +#if ! JUCE_MAC +void MessageManager::runDispatchLoop() { - if (quitMessageReceived) - { - if (wasAMessageDispatched != 0) - *wasAMessageDispatched = false; - - return false; - } - - ++isInMessageDispatcher; - - bool result = false; - - JUCE_TRY - { - result = juce_dispatchNextMessageOnSystemQueue (returnImmediatelyIfNoMessages); - - if (wasAMessageDispatched != 0) - *wasAMessageDispatched = result; + jassert (isThisTheMessageThread()); // must only be called by the message thread - if (instance == 0) - return false; - } - JUCE_CATCH_EXCEPTION + runDispatchLoopUntil (-1); +} - --isInMessageDispatcher; - ++messageCounter; +void MessageManager::stopDispatchLoop() +{ + Message* const m = new Message (quitMessageId, 0, 0, 0); + m->messageRecipient = 0; + postMessageToQueue (m); - return result || ! returnImmediatelyIfNoMessages; + quitMessagePosted = true; } -void MessageManager::dispatchPendingMessages (int maxNumberOfMessagesToDispatch) +bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) { jassert (isThisTheMessageThread()); // must only be called by the message thread - while (--maxNumberOfMessagesToDispatch >= 0 && ! quitMessageReceived) - { - ++isInMessageDispatcher; - - bool carryOn = false; + const int64 endTime = Time::currentTimeMillis() + millisecondsToRunFor; + while ((millisecondsToRunFor < 0 || endTime > Time::currentTimeMillis()) + && ! quitMessageReceived) + { JUCE_TRY { - carryOn = juce_dispatchNextMessageOnSystemQueue (true); + juce_dispatchNextMessageOnSystemQueue (millisecondsToRunFor >= 0); } JUCE_CATCH_EXCEPTION - - --isInMessageDispatcher; - ++messageCounter; - - if (! carryOn) - break; } -} -bool MessageManager::runDispatchLoop() -{ - jassert (isThisTheMessageThread()); // must only be called by the message thread - - while (dispatchNextMessage()) - { - } - - return useMaximumForceWhenQuitting; -} - -void MessageManager::postQuitMessage (const bool useMaximumForce) -{ - Message* const m = new Message (quitMessageId, (useMaximumForce) ? 1 : 0, 0, 0); - m->messageRecipient = 0; - postMessageToQueue (m); - - quitMessagePosted = true; + return ! quitMessageReceived; } -bool MessageManager::hasQuitMessageBeenPosted() const throw() -{ - return quitMessagePosted; -} +#endif void MessageManager::deliverBroadcastMessage (const String& value) { @@ -34591,78 +35934,6 @@ void MessageManager::deregisterBroadcastListener (ActionListener* const listener broadcastListeners->removeActionListener (listener); } -// This gets called occasionally by the timer thread (to save using an extra thread -// for it). -void MessageManager::inactivityCheckCallback() throw() -{ - if (instance != 0) - instance->inactivityCheckCallbackInt(); -} - -void MessageManager::inactivityCheckCallbackInt() throw() -{ - const unsigned int now = Time::getApproximateMillisecondCounter(); - - if (isInMessageDispatcher > 0 - && lastMessageCounter == messageCounter - && timeBeforeWaitCursor > 0 - && lastActivityCheckOkTime > 0 - && ! ModifierKeys::getCurrentModifiersRealtime().isAnyMouseButtonDown()) - { - if (now >= lastActivityCheckOkTime + timeBeforeWaitCursor - && ! needToGetRidOfWaitCursor) - { - // been in the same message call too long.. - MouseCursor::showWaitCursor(); - needToGetRidOfWaitCursor = true; - } - } - else - { - lastActivityCheckOkTime = now; - lastMessageCounter = messageCounter; - } -} - -void MessageManager::delayWaitCursor() throw() -{ - if (instance != 0) - { - instance->messageCounter++; - - if (instance->needToGetRidOfWaitCursor) - { - instance->needToGetRidOfWaitCursor = false; - MouseCursor::hideWaitCursor(); - } - } -} - -void MessageManager::setTimeBeforeShowingWaitCursor (const int millisecs) throw() -{ - // if this is a bit too small you'll get a lot of unwanted hourglass cursors.. - jassert (millisecs <= 0 || millisecs > 200); - - timeBeforeWaitCursor = millisecs; - - if (millisecs > 0) - startTimer (millisecs / 2); // (see timerCallback() for explanation of this) - else - stopTimer(); -} - -void MessageManager::timerCallback() -{ - // dummy callback - the message manager is just a Timer to ensure that there are always - // some events coming in - otherwise it'll show the egg-timer/beachball-of-death. - ++messageCounter; -} - -int MessageManager::getTimeBeforeShowingWaitCursor() const throw() -{ - return timeBeforeWaitCursor; -} - bool MessageManager::isThisTheMessageThread() const throw() { return Thread::getCurrentThreadId() == messageThreadId; @@ -34979,7 +36250,6 @@ public: void run() { uint32 lastTime = Time::getMillisecondCounter(); - uint32 lastMessageManagerCallback = lastTime; while (! threadShouldExit()) { @@ -35018,12 +36288,6 @@ public: now = Time::getMillisecondCounter(); - if (now > lastMessageManagerCallback + 200) - { - lastMessageManagerCallback = now; - MessageManager::inactivityCheckCallback(); - } - if (now > messageDeliveryTimeout) break; } @@ -35034,12 +36298,6 @@ public: // Time::getApproximateMillisecondTimer value stay up-to-date wait (jlimit (1, 50, timeUntilFirstTimer)); } - - if (now > lastMessageManagerCallback + 200) - { - lastMessageManagerCallback = now; - MessageManager::inactivityCheckCallback(); - } } } @@ -36552,7 +37810,7 @@ int Component::runModalLoop() { while (flags.currentlyModalFlag && flags.visibleFlag) { - if (! MessageManager::getInstance()->dispatchNextMessage()) + if (! MessageManager::getInstance()->runDispatchLoopUntil (20)) break; // check whether this component was deleted during the last message @@ -38185,7 +39443,7 @@ void Component::internalBroughtToFront() if (cm != 0 && cm->getTopLevelComponent() != getTopLevelComponent()) { - cm->getTopLevelComponent()->toFront (false); + cm->getTopLevelComponent()->toFront (true); } } } @@ -41212,6 +42470,7 @@ Label::Label (const String& componentName, deletionWatcher (0), horizontalBorderSize (3), verticalBorderSize (1), + minimumHorizontalScale (0.7f), editSingleClick (false), editDoubleClick (false), lossOfFocusDiscardsChanges (false) @@ -41447,32 +42706,7 @@ TextEditor* Label::createEditorComponent() void Label::paint (Graphics& g) { - g.fillAll (findColour (backgroundColourId)); - - if (editor == 0) - { - const float alpha = isEnabled() ? 1.0f : 0.5f; - - g.setColour (findColour (textColourId).withMultipliedAlpha (alpha)); - g.setFont (font); - g.drawFittedText (text, - horizontalBorderSize, - verticalBorderSize, - getWidth() - 2 * horizontalBorderSize, - getHeight() - 2 * verticalBorderSize, - justification, - jmax (1, (int) (getHeight() / font.getHeight()))); - - g.setColour (findColour (outlineColourId).withMultipliedAlpha (alpha)); - g.drawRect (0, 0, getWidth(), getHeight()); - } - else if (isEnabled()) - { - g.setColour (editor->findColour (TextEditor::backgroundColourId) - .overlaidWith (findColour (outlineColourId))); - - g.drawRect (0, 0, getWidth(), getHeight()); - } + getLookAndFeel().drawLabel (g, *this); } void Label::mouseUp (const MouseEvent& e) @@ -43306,7 +44540,7 @@ float Slider::getLinearSliderPos (const double value) sliderPosProportional = 0.5; } - if (style == LinearVertical || style == IncDecButtons) + if (isVertical() || style == IncDecButtons) sliderPosProportional = 1.0 - sliderPosProportional; return (float) (sliderRegionStart + sliderPosProportional * sliderRegionSize); @@ -43677,13 +44911,37 @@ void Slider::restoreMouseIfHidden() : ((sliderBeingDragged == 1) ? getMinValue() : currentValue); - const int pixelPos = (int) getLinearSliderPos (pos); + if (style == RotaryHorizontalDrag || style == RotaryVerticalDrag) + { + int x, y, downX, downY; + Desktop::getMousePosition (x, y); + Desktop::getLastMouseDownPosition (downX, downY); - int x = isHorizontal() ? pixelPos : (getWidth() / 2); - int y = isVertical() ? pixelPos : (getHeight() / 2); + if (style == RotaryHorizontalDrag) + { + const double posDiff = valueToProportionOfLength (pos) - valueToProportionOfLength (valueOnMouseDown); + x = roundDoubleToInt (pixelsForFullDragExtent * posDiff + downX); + y = downY; + } + else + { + const double posDiff = valueToProportionOfLength (valueOnMouseDown) - valueToProportionOfLength (pos); + x = downX; + y = roundDoubleToInt (pixelsForFullDragExtent * posDiff + downY); + } - relativePositionToGlobal (x, y); - Desktop::setMousePosition (x, y); + Desktop::setMousePosition (x, y); + } + else + { + const int pixelPos = (int) getLinearSliderPos (pos); + + int x = isHorizontal() ? pixelPos : (getWidth() / 2); + int y = isVertical() ? pixelPos : (getHeight() / 2); + + relativePositionToGlobal (x, y); + Desktop::setMousePosition (x, y); + } } } @@ -43807,7 +45065,7 @@ void Slider::mouseDrag (const MouseEvent& e) } else { - if (style == LinearVertical) + if (isVertical()) scaledMousePos = 1.0 - scaledMousePos; valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, scaledMousePos)); @@ -43833,7 +45091,7 @@ void Slider::mouseDrag (const MouseEvent& e) if (mouseDiff < 0) speed = -speed; - if (style == LinearVertical || style == RotaryVerticalDrag + if (isVertical() || style == RotaryVerticalDrag || (style == IncDecButtons && ! incDecDragDirectionIsHorizontal())) speed = -speed; @@ -46974,10 +48232,13 @@ void TextEditor::setHighlightedRegion (int startPos, int numChars) throw() void TextEditor::copy() { - const String selection (getTextSubstring (selectionStart, selectionEnd)); + if (passwordCharacter == 0) + { + const String selection (getTextSubstring (selectionStart, selectionEnd)); - if (selection.isNotEmpty()) - SystemClipboard::copyTextToClipboard (selection); + if (selection.isNotEmpty()) + SystemClipboard::copyTextToClipboard (selection); + } } void TextEditor::paste() @@ -47398,9 +48659,13 @@ void TextEditor::addPopupMenuItems (PopupMenu& m, const MouseEvent*) { const bool writable = ! isReadOnly(); - m.addItem (baseMenuItemID + 1, TRANS("cut"), writable); - m.addItem (baseMenuItemID + 2, TRANS("copy"), selectionStart < selectionEnd); - m.addItem (baseMenuItemID + 3, TRANS("paste"), writable); + if (passwordCharacter == 0) + { + m.addItem (baseMenuItemID + 1, TRANS("cut"), writable); + m.addItem (baseMenuItemID + 2, TRANS("copy"), selectionStart < selectionEnd); + m.addItem (baseMenuItemID + 3, TRANS("paste"), writable); + } + m.addItem (baseMenuItemID + 4, TRANS("delete"), writable); m.addSeparator(); m.addItem (baseMenuItemID + 5, TRANS("select all")); @@ -58581,6 +59846,35 @@ void LookAndFeel::positionComboBoxText (ComboBox& box, Label& label) label.setFont (getComboBoxFont (box)); } +void LookAndFeel::drawLabel (Graphics& g, Label& label) +{ + g.fillAll (label.findColour (Label::backgroundColourId)); + + if (! label.isBeingEdited()) + { + const float alpha = label.isEnabled() ? 1.0f : 0.5f; + + g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha)); + g.setFont (label.getFont()); + g.drawFittedText (label.getText(), + label.getHorizontalBorderSize(), + label.getVerticalBorderSize(), + label.getWidth() - 2 * label.getHorizontalBorderSize(), + label.getHeight() - 2 * label.getVerticalBorderSize(), + label.getJustificationType(), + jmax (1, (int) (label.getHeight() / label.getFont().getHeight())), + label.getMinimumHorizontalScale()); + + g.setColour (label.findColour (Label::outlineColourId).withMultipliedAlpha (alpha)); + g.drawRect (0, 0, label.getWidth(), label.getHeight()); + } + else if (label.isEnabled()) + { + g.setColour (label.findColour (Label::outlineColourId)); + g.drawRect (0, 0, label.getWidth(), label.getHeight()); + } +} + void LookAndFeel::drawLinearSliderBackground (Graphics& g, int x, int y, int width, int height, @@ -61579,6 +62873,7 @@ public: { menuCreationTime = lastFocused = lastScroll = Time::getMillisecondCounter(); setWantsKeyboardFocus (true); + setMouseClickGrabsKeyboardFocus (false); setOpaque (true); setAlwaysOnTop (true); @@ -61709,7 +63004,7 @@ public: int itemW = 80; int itemH = 16; mic->getIdealSize (itemW, itemH, standardItemHeight); - mic->setSize (itemW, jlimit (10, 600, itemH)); + mic->setSize (itemW, jlimit (2, 600, itemH)); mic->addMouseListener (this, false); } @@ -65670,15 +66965,15 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& const bool showChannelsAsStereoPairs_, const bool hideAdvancedOptionsWithButton_) : deviceManager (deviceManager_), + deviceTypeDropDown (0), + deviceTypeDropDownLabel (0), + audioDeviceSettingsComp (0), minOutputChannels (minOutputChannels_), maxOutputChannels (maxOutputChannels_), minInputChannels (minInputChannels_), maxInputChannels (maxInputChannels_), showChannelsAsStereoPairs (showChannelsAsStereoPairs_), - hideAdvancedOptionsWithButton (hideAdvancedOptionsWithButton_), - deviceTypeDropDown (0), - deviceTypeDropDownLabel (0), - audioDeviceSettingsComp (0) + hideAdvancedOptionsWithButton (hideAdvancedOptionsWithButton_) { jassert (minOutputChannels >= 0 && minOutputChannels <= maxOutputChannels); jassert (minInputChannels >= 0 && minInputChannels <= maxInputChannels); @@ -65766,7 +67061,7 @@ void AudioDeviceSelectorComponent::resized() if (midiInputsList != 0) { - const int bh = midiInputsList->getBestHeight (jmin (h * 8, getHeight() - y - space)); + const int bh = midiInputsList->getBestHeight (jmin (h * 8, getHeight() - y - space - h)); midiInputsList->setBounds (lx, y, w, bh); y += bh + space; } @@ -68631,1074 +69926,6 @@ void PreferencesPanel::buttonClicked (Button*) END_JUCE_NAMESPACE /********* End of inlined file: juce_PreferencesPanel.cpp *********/ -/********* Start of inlined file: juce_QuickTimeMovieComponent.cpp *********/ - -#if JUCE_QUICKTIME - -#ifdef _MSC_VER - #pragma warning (disable: 4514) -#endif - -#ifdef _WIN32 - #include - - #ifdef _MSC_VER - #pragma warning (push) - #pragma warning (disable : 4100) - #endif - - /* If you've got an include error here, you probably need to install the QuickTime SDK and - add its header directory to your include path. - - Alternatively, if you don't need any QuickTime services, just turn off the JUCE_QUICKTIME - flag in juce_Config.h - */ - #include - #include - #include - #include - #include - - #ifdef _MSC_VER - #pragma warning (pop) - #endif - - // If you've got QuickTime 7 installed, then these COM objects should be found in - // the "\Program Files\Quicktime" directory. You'll need to add this directory to - // your include search path to make these import statements work. - #import - #import - - using namespace QTOLibrary; - using namespace QTOControlLib; -#else - #include - #include - #include - #include -#endif - -BEGIN_JUCE_NAMESPACE - -bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle); - -static bool hasLoadedQT = false; -static bool isQTAvailable = false; - -struct QTMovieCompInternal -{ - QTMovieCompInternal() - : dataHandle (0) - { -#if JUCE_MAC - movie = 0; - controller = 0; -#endif - } - - ~QTMovieCompInternal() - { - clearHandle(); - } - -#if JUCE_MAC - Movie movie; - MovieController controller; -#else - IQTControlPtr qtControlInternal; - IQTMoviePtr qtMovieInternal; -#endif - - Handle dataHandle; - - void clearHandle() - { - if (dataHandle != 0) - { - DisposeHandle (dataHandle); - dataHandle = 0; - } - } -}; - -#if JUCE_WIN32 - -#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal) -#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal) - -QuickTimeMovieComponent::QuickTimeMovieComponent() - : movieLoaded (false), - controllerVisible (true) -{ - internal = new QTMovieCompInternal(); - setMouseEventsAllowed (false); -} - -QuickTimeMovieComponent::~QuickTimeMovieComponent() -{ - closeMovie(); - qtControl = 0; - - deleteControl(); - - delete internal; - internal = 0; -} - -bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - - isQTAvailable = (InitializeQTML (0) == noErr) - && (EnterMovies() == noErr); - } - - return isQTAvailable; -} - -void QuickTimeMovieComponent::createControlIfNeeded() -{ - if (isShowing() && ! isControlCreated()) - { - const IID qtIID = __uuidof (QTControl); - - if (createControl (&qtIID)) - { - const IID qtInterfaceIID = __uuidof (IQTControl); - qtControl = (IQTControl*) queryInterface (&qtInterfaceIID); - - if (qtControl != 0) - { - qtControl->Release(); // it has one ref too many at this point - - qtControl->QuickTimeInitialize(); - qtControl->PutSizing (qtMovieFitsControl); - - if (movieFile != File::nonexistent) - loadMovie (movieFile, controllerVisible); - } - } - } -} - -bool QuickTimeMovieComponent::isControlCreated() const -{ - return isControlOpen(); -} - -bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, - const bool isControllerVisible) -{ - movieFile = File::nonexistent; - movieLoaded = false; - qtMovie = 0; - controllerVisible = isControllerVisible; - createControlIfNeeded(); - - if (isControlCreated()) - { - if (qtControl != 0) - { - qtControl->Put_MovieHandle (0); - ((QTMovieCompInternal*) internal)->clearHandle(); - - Movie movie; - if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, ((QTMovieCompInternal*) internal)->dataHandle)) - { - qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie); - - qtMovie = qtControl->GetMovie(); - - if (qtMovie != 0) - qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard - : qtMovieControllerTypeNone); - } - - if (movie == 0) - ((QTMovieCompInternal*) internal)->clearHandle(); - } - - movieLoaded = (qtMovie != 0); - } - else - { - // You're trying to open a movie when the control hasn't yet been created, probably because - // you've not yet added this component to a Window and made the whole component hierarchy visible. - jassertfalse - } - - delete movieStream; - return movieLoaded; -} - -void QuickTimeMovieComponent::closeMovie() -{ - stop(); - movieFile = File::nonexistent; - movieLoaded = false; - qtMovie = 0; - - if (qtControl != 0) - qtControl->Put_MovieHandle (0); - - ((QTMovieCompInternal*) internal)->clearHandle(); -} - -const File QuickTimeMovieComponent::getCurrentMovieFile() const -{ - return movieFile; -} - -bool QuickTimeMovieComponent::isMovieOpen() const -{ - return movieLoaded; -} - -double QuickTimeMovieComponent::getMovieDuration() const -{ - if (qtMovie != 0) - return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale(); - - return 0.0; -} - -void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const -{ - if (qtMovie != 0) - { - struct QTRECT r = qtMovie->GetNaturalRect(); - - width = r.right - r.left; - height = r.bottom - r.top; - } - else - { - width = height = 0; - } -} - -void QuickTimeMovieComponent::play() -{ - if (qtMovie != 0) - qtMovie->Play(); -} - -void QuickTimeMovieComponent::stop() -{ - if (qtMovie != 0) - qtMovie->Stop(); -} - -bool QuickTimeMovieComponent::isPlaying() const -{ - return qtMovie != 0 && qtMovie->GetRate() != 0.0f; -} - -void QuickTimeMovieComponent::setPosition (const double seconds) -{ - if (qtMovie != 0) - qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale())); -} - -double QuickTimeMovieComponent::getPosition() const -{ - if (qtMovie != 0) - return qtMovie->GetTime() / (double) qtMovie->GetTimeScale(); - - return 0.0; -} - -void QuickTimeMovieComponent::setSpeed (const float newSpeed) -{ - if (qtMovie != 0) - qtMovie->PutRate (newSpeed); -} - -void QuickTimeMovieComponent::setMovieVolume (const float newVolume) -{ - if (qtMovie != 0) - { - qtMovie->PutAudioVolume (newVolume); - qtMovie->PutAudioMute (newVolume <= 0); - } -} - -float QuickTimeMovieComponent::getMovieVolume() const -{ - if (qtMovie != 0) - return qtMovie->GetAudioVolume(); - - return 0.0f; -} - -void QuickTimeMovieComponent::setLooping (const bool shouldLoop) -{ - if (qtMovie != 0) - qtMovie->PutLoop (shouldLoop); -} - -bool QuickTimeMovieComponent::isLooping() const -{ - return qtMovie != 0 && qtMovie->GetLoop(); -} - -bool QuickTimeMovieComponent::isControllerVisible() const -{ - return controllerVisible; -} - -void QuickTimeMovieComponent::parentHierarchyChanged() -{ - createControlIfNeeded(); - QTWinBaseClass::parentHierarchyChanged(); -} - -void QuickTimeMovieComponent::visibilityChanged() -{ - createControlIfNeeded(); - QTWinBaseClass::visibilityChanged(); -} - -void QuickTimeMovieComponent::paint (Graphics& g) -{ - if (! isControlCreated()) - g.fillAll (Colours::black); -} - -#endif - -#if JUCE_MAC - -static VoidArray activeQTWindows (2); - -struct MacClickEventData -{ - ::Point where; - long when; - long modifiers; -}; - -void OfferMouseClickToQuickTime (WindowRef window, - ::Point where, long when, long modifiers, - Component* topLevelComp) -{ - if (hasLoadedQT) - { - for (int i = activeQTWindows.size(); --i >= 0;) - { - QuickTimeMovieComponent* const qtw = (QuickTimeMovieComponent*) activeQTWindows[i]; - - if (qtw->isVisible() && topLevelComp->isParentOf (qtw)) - { - MacClickEventData data; - data.where = where; - data.when = when; - data.modifiers = modifiers; - - qtw->handleMCEvent (&data); - } - } - } -} - -QuickTimeMovieComponent::QuickTimeMovieComponent() - : internal (new QTMovieCompInternal()), - associatedWindow (0), - controllerVisible (false), - controllerAssignedToWindow (false), - reentrant (false) -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - isQTAvailable = EnterMovies() == noErr; - } - - setOpaque (true); - setVisible (true); - - activeQTWindows.add (this); -} - -QuickTimeMovieComponent::~QuickTimeMovieComponent() -{ - closeMovie(); - - activeQTWindows.removeValue ((void*) this); - - QTMovieCompInternal* const i = (QTMovieCompInternal*) internal; - delete i; - - if (activeQTWindows.size() == 0 && isQTAvailable) - { - isQTAvailable = false; - hasLoadedQT = false; - - ExitMovies(); - } -} - -bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - isQTAvailable = EnterMovies() == noErr; - } - - return isQTAvailable; -} - -bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, - const bool controllerVisible_) -{ - if (! isQTAvailable) - return false; - - closeMovie(); - movieFile = File::nonexistent; - - if (getPeer() == 0) - { - // To open a movie, this component must be visible inside a functioning window, so that - // the QT control can be assigned to the window. - jassertfalse - return false; - } - - controllerVisible = controllerVisible_; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - GrafPtr savedPort; - GetPort (&savedPort); - bool result = false; - - if (juce_OpenQuickTimeMovieFromStream (movieStream, qmci->movie, qmci->dataHandle)) - { - qmci->controller = 0; - - void* window = getWindowHandle(); - - if (window != associatedWindow && window != 0) - associatedWindow = window; - - assignMovieToWindow(); - - SetMovieActive (qmci->movie, true); - SetMovieProgressProc (qmci->movie, (MovieProgressUPP) -1, 0); - - startTimer (1000 / 50); // this needs to be quite a high frequency for smooth playback - result = true; - - repaint(); - } - - MacSetPort (savedPort); - - return result; -} - -void QuickTimeMovieComponent::closeMovie() -{ - stop(); - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - DisposeMovieController (qmci->controller); - qmci->controller = 0; - } - - if (qmci->movie != 0) - { - DisposeMovie (qmci->movie); - qmci->movie = 0; - } - - qmci->clearHandle(); - - stopTimer(); - movieFile = File::nonexistent; -} - -bool QuickTimeMovieComponent::isMovieOpen() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - return qmci->movie != 0 && qmci->controller != 0; -} - -const File QuickTimeMovieComponent::getCurrentMovieFile() const -{ - return movieFile; -} - -static GrafPtr getPortForWindow (void* window) -{ - if (window == 0) - return 0; - - return (GrafPtr) GetWindowPort ((WindowRef) window); -} - -void QuickTimeMovieComponent::assignMovieToWindow() -{ - if (reentrant) - return; - - reentrant = true; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - if (qmci->controller != 0) - { - DisposeMovieController (qmci->controller); - qmci->controller = 0; - } - - controllerAssignedToWindow = false; - - void* window = getWindowHandle(); - GrafPtr port = getPortForWindow (window); - - if (port != 0) - { - GrafPtr savedPort; - GetPort (&savedPort); - - SetMovieGWorld (qmci->movie, (CGrafPtr) port, 0); - MacSetPort (port); - - Rect r; - r.top = 0; - r.left = 0; - r.right = (short) jmax (1, getWidth()); - r.bottom = (short) jmax (1, getHeight()); - SetMovieBox (qmci->movie, &r); - - // create the movie controller - qmci->controller = NewMovieController (qmci->movie, &r, - controllerVisible ? mcTopLeftMovie - : mcNotVisible); - - if (qmci->controller != 0) - { - MCEnableEditing (qmci->controller, true); - - MCDoAction (qmci->controller, mcActionSetUseBadge, (void*) false); - MCDoAction (qmci->controller, mcActionSetLoopIsPalindrome, (void*) false); - setLooping (looping); - - MCDoAction (qmci->controller, mcActionSetFlags, - (void*) (pointer_sized_int) (mcFlagSuppressMovieFrame | (controllerVisible ? 0 : (mcFlagSuppressStepButtons | mcFlagSuppressSpeakerButton)))); - - MCSetControllerBoundsRect (qmci->controller, &r); - - controllerAssignedToWindow = true; - - resized(); - } - - MacSetPort (savedPort); - } - else - { - SetMovieGWorld (qmci->movie, 0, 0); - } - - reentrant = false; -} - -void QuickTimeMovieComponent::play() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - StartMovie (qmci->movie); -} - -void QuickTimeMovieComponent::stop() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - StopMovie (qmci->movie); -} - -bool QuickTimeMovieComponent::isPlaying() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - return qmci->movie != 0 && GetMovieRate (qmci->movie) != 0; -} - -void QuickTimeMovieComponent::setPosition (const double seconds) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - TimeRecord time; - time.base = GetMovieTimeBase (qmci->movie); - time.scale = 100000; - const uint64 t = (uint64) (100000.0 * seconds); - time.value.lo = (UInt32) (t & 0xffffffff); - time.value.hi = (UInt32) (t >> 32); - - SetMovieTime (qmci->movie, &time); - timerCallback(); // to call MCIdle - } - else - { - jassertfalse // no movie is open, so can't set the position. - } -} - -double QuickTimeMovieComponent::getPosition() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - { - TimeRecord time; - GetMovieTime (qmci->movie, &time); - - return ((int64) (((uint64) time.value.hi << 32) | (uint64) time.value.lo)) - / (double) time.scale; - } - - return 0.0; -} - -void QuickTimeMovieComponent::setSpeed (const float newSpeed) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - SetMovieRate (qmci->movie, (Fixed) (newSpeed * (Fixed) 0x00010000L)); -} - -double QuickTimeMovieComponent::getMovieDuration() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - return GetMovieDuration (qmci->movie) / (double) GetMovieTimeScale (qmci->movie); - - return 0.0; -} - -void QuickTimeMovieComponent::setLooping (const bool shouldLoop) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - looping = shouldLoop; - - if (qmci->controller != 0) - MCDoAction (qmci->controller, mcActionSetLooping, (void*) shouldLoop); -} - -bool QuickTimeMovieComponent::isLooping() const -{ - return looping; -} - -void QuickTimeMovieComponent::setMovieVolume (const float newVolume) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - SetMovieVolume (qmci->movie, jlimit ((short) 0, (short) 0x100, (short) (newVolume * 0x0100))); -} - -float QuickTimeMovieComponent::getMovieVolume() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - return jmax (0.0f, GetMovieVolume (qmci->movie) / (float) 0x0100); - - return 0.0f; -} - -void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const -{ - width = 0; - height = 0; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - { - Rect r; - GetMovieNaturalBoundsRect (qmci->movie, &r); - width = r.right - r.left; - height = r.bottom - r.top; - } -} - -void QuickTimeMovieComponent::paint (Graphics& g) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie == 0 || qmci->controller == 0) - { - g.fillAll (Colours::black); - return; - } - - GrafPtr savedPort; - GetPort (&savedPort); - - MacSetPort (getPortForWindow (getWindowHandle())); - MCDraw (qmci->controller, (WindowRef) getWindowHandle()); - - MacSetPort (savedPort); - - ComponentPeer* const peer = getPeer(); - - if (peer != 0) - { - peer->addMaskedRegion (getScreenX() - peer->getScreenX(), - getScreenY() - peer->getScreenY(), - getWidth(), getHeight()); - } - - timerCallback(); -} - -static const Rectangle getMoviePos (Component* const c) -{ - return Rectangle (c->getScreenX() - c->getTopLevelComponent()->getScreenX(), - c->getScreenY() - c->getTopLevelComponent()->getScreenY(), - jmax (1, c->getWidth()), - jmax (1, c->getHeight())); -} - -void QuickTimeMovieComponent::moved() -{ - resized(); -} - -void QuickTimeMovieComponent::resized() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0 && isShowing()) - { - checkWindowAssociation(); - - GrafPtr port = getPortForWindow (getWindowHandle()); - - if (port != 0) - { - GrafPtr savedPort; - GetPort (&savedPort); - - SetMovieGWorld (qmci->movie, (CGrafPtr) port, 0); - MacSetPort (port); - - lastPositionApplied = getMoviePos (this); - - Rect r; - r.left = (short) lastPositionApplied.getX(); - r.top = (short) lastPositionApplied.getY(); - r.right = (short) lastPositionApplied.getRight(); - r.bottom = (short) lastPositionApplied.getBottom(); - - if (MCGetVisible (qmci->controller)) - MCSetControllerBoundsRect (qmci->controller, &r); - else - SetMovieBox (qmci->movie, &r); - - if (! isPlaying()) - timerCallback(); - - MacSetPort (savedPort); - - repaint(); - } - } -} - -void QuickTimeMovieComponent::visibilityChanged() -{ - checkWindowAssociation(); - QTWinBaseClass::visibilityChanged(); -} - -void QuickTimeMovieComponent::timerCallback() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - if (isTimerRunning()) - startTimer (getTimerInterval()); - - MCIdle (qmci->controller); - - if (lastPositionApplied != getMoviePos (this)) - resized(); - } -} - -void QuickTimeMovieComponent::checkWindowAssociation() -{ - void* const window = getWindowHandle(); - - if (window != associatedWindow - || (window != 0 && ! controllerAssignedToWindow)) - { - associatedWindow = window; - assignMovieToWindow(); - } -} - -void QuickTimeMovieComponent::parentHierarchyChanged() -{ - checkWindowAssociation(); -} - -void QuickTimeMovieComponent::handleMCEvent (void* ev) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0 && isShowing()) - { - MacClickEventData* data = (MacClickEventData*) ev; - - data->where.h -= getTopLevelComponent()->getScreenX(); - data->where.v -= getTopLevelComponent()->getScreenY(); - - Boolean b = false; - MCPtInController (qmci->controller, data->where, &b); - - if (b) - { - const int oldTimeBeforeWaitCursor = MessageManager::getInstance()->getTimeBeforeShowingWaitCursor(); - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); - - MCClick (qmci->controller, - (WindowRef) getWindowHandle(), - data->where, - data->when, - data->modifiers); - - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (oldTimeBeforeWaitCursor); - } - } -} - -#endif - -// (methods common to both platforms..) - -static Handle createHandleDataRef (Handle dataHandle, const char* fileName) -{ - Handle dataRef = 0; - OSStatus err = PtrToHand (&dataHandle, &dataRef, sizeof (Handle)); - if (err == noErr) - { - Str255 suffix; - - CharacterFunctions::copy ((char*) suffix, fileName, 128); - - StringPtr name = suffix; - err = PtrAndHand (name, dataRef, name[0] + 1); - - if (err == noErr) - { - long atoms[3]; - atoms[0] = EndianU32_NtoB (3 * sizeof (long)); - atoms[1] = EndianU32_NtoB (kDataRefExtensionMacOSFileType); - atoms[2] = EndianU32_NtoB (MovieFileType); - - err = PtrAndHand (atoms, dataRef, 3 * sizeof (long)); - - if (err == noErr) - return dataRef; - } - - DisposeHandle (dataRef); - } - - return 0; -} - -static CFStringRef juceStringToCFString (const String& s) -{ - const int len = s.length(); - const juce_wchar* const t = (const juce_wchar*) s; - - UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); - - for (int i = 0; i <= len; ++i) - temp[i] = t[i]; - - CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); - juce_free (temp); - - return result; -} - -static bool openMovie (QTNewMoviePropertyElement* props, int prop, Movie& movie) -{ - Boolean trueBool = true; - props[prop].propClass = kQTPropertyClass_MovieInstantiation; - props[prop].propID = kQTMovieInstantiationPropertyID_DontResolveDataRefs; - props[prop].propValueSize = sizeof (trueBool); - props[prop].propValueAddress = &trueBool; - ++prop; - - props[prop].propClass = kQTPropertyClass_MovieInstantiation; - props[prop].propID = kQTMovieInstantiationPropertyID_AsyncOK; - props[prop].propValueSize = sizeof (trueBool); - props[prop].propValueAddress = &trueBool; - ++prop; - - Boolean isActive = true; - props[prop].propClass = kQTPropertyClass_NewMovieProperty; - props[prop].propID = kQTNewMoviePropertyID_Active; - props[prop].propValueSize = sizeof (isActive); - props[prop].propValueAddress = &isActive; - ++prop; - -#if JUCE_MAC - SetPort (0); -#else - MacSetPort (0); -#endif - - jassert (prop <= 5); - OSStatus err = NewMovieFromProperties (prop, props, 0, 0, &movie); - - return err == noErr; -} - -bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle) -{ - if (input == 0) - return false; - - dataHandle = 0; - bool ok = false; - - QTNewMoviePropertyElement props[5]; - zeromem (props, sizeof (props)); - int prop = 0; - - DataReferenceRecord dr; - props[prop].propClass = kQTPropertyClass_DataLocation; - props[prop].propID = kQTDataLocationPropertyID_DataReference; - props[prop].propValueSize = sizeof (dr); - props[prop].propValueAddress = (void*) &dr; - ++prop; - - FileInputStream* const fin = dynamic_cast (input); - - if (fin != 0) - { - CFStringRef filePath = juceStringToCFString (fin->getFile().getFullPathName()); - - QTNewDataReferenceFromFullPathCFString (filePath, (QTPathStyle) kQTNativeDefaultPathStyle, 0, - &dr.dataRef, &dr.dataRefType); - - ok = openMovie (props, prop, movie); - - DisposeHandle (dr.dataRef); - CFRelease (filePath); - } - else - { - // sanity-check because this currently needs to load the whole stream into memory.. - jassert (input->getTotalLength() < 50 * 1024 * 1024); - - dataHandle = NewHandle ((Size) input->getTotalLength()); - HLock (dataHandle); - // read the entire stream into memory - this is a pain, but can't get it to work - // properly using a custom callback to supply the data. - input->read (*dataHandle, (int) input->getTotalLength()); - HUnlock (dataHandle); - - // different types to get QT to try. (We should really be a bit smarter here by - // working out in advance which one the stream contains, rather than just trying - // each one) - const char* const suffixesToTry[] = { "\04.mov", "\04.mp3", - "\04.avi", "\04.m4a" }; - - for (int i = 0; i < numElementsInArray (suffixesToTry) && ! ok; ++i) - { - /* // this fails for some bizarre reason - it can be bodged to work with - // movies, but can't seem to do it for other file types.. - QTNewMovieUserProcRecord procInfo; - procInfo.getMovieUserProc = NewGetMovieUPP (readMovieStreamProc); - procInfo.getMovieUserProcRefcon = this; - procInfo.defaultDataRef.dataRef = dataRef; - procInfo.defaultDataRef.dataRefType = HandleDataHandlerSubType; - - props[prop].propClass = kQTPropertyClass_DataLocation; - props[prop].propID = kQTDataLocationPropertyID_MovieUserProc; - props[prop].propValueSize = sizeof (procInfo); - props[prop].propValueAddress = (void*) &procInfo; - ++prop; */ - - dr.dataRef = createHandleDataRef (dataHandle, suffixesToTry [i]); - dr.dataRefType = HandleDataHandlerSubType; - ok = openMovie (props, prop, movie); - - DisposeHandle (dr.dataRef); - } - } - - return ok; -} - -bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, - const bool isControllerVisible) -{ - const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); - movieFile = movieFile_; - return ok; -} - -void QuickTimeMovieComponent::goToStart() -{ - setPosition (0.0); -} - -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, - const RectanglePlacement& placement) -{ - int normalWidth, normalHeight; - getMovieNormalSize (normalWidth, normalHeight); - - if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) - { - double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; - - placement.applyTo (x, y, w, h, - spaceToFitWithin.getX(), spaceToFitWithin.getY(), - spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); - - if (w > 0 && h > 0) - { - setBounds (roundDoubleToInt (x), roundDoubleToInt (y), - roundDoubleToInt (w), roundDoubleToInt (h)); - } - } - else - { - setBounds (spaceToFitWithin); - } -} - -END_JUCE_NAMESPACE - -#endif -/********* End of inlined file: juce_QuickTimeMovieComponent.cpp *********/ - /********* Start of inlined file: juce_SystemTrayIconComponent.cpp *********/ #if JUCE_WIN32 || JUCE_LINUX @@ -70690,9 +70917,10 @@ void ComponentPeer::handleMessage (const Message& message) { if (message.intParameter1 == fakeMouseMoveMessage) { - handleMouseMove (message.intParameter2, - message.intParameter3, - Time::currentTimeMillis()); + if (! ModifierKeys::getCurrentModifiers().isAnyMouseButtonDown()) + handleMouseMove (message.intParameter2, + message.intParameter3, + Time::currentTimeMillis()); } } @@ -72086,7 +72314,7 @@ void SplashScreen::show (const String& title, addToDesktop (useDropShadow ? ComponentPeer::windowHasDropShadow : 0); toFront (false); - MessageManager::getInstance()->dispatchPendingMessages(); + MessageManager::getInstance()->runDispatchLoopUntil (300); repaint(); @@ -72218,19 +72446,12 @@ TooltipWindow::TooltipWindow (Component* const parentComponent, setOpaque (true); if (parentComponent != 0) - { parentComponent->addChildComponent (this); - } - else - { - setSize (1, 1); // to keep the OS happy by not having zero-size windows - addToDesktop (ComponentPeer::windowHasDropShadow - | ComponentPeer::windowIsTemporary); - } } TooltipWindow::~TooltipWindow() { + hide(); } void TooltipWindow::paint (Graphics& g) @@ -72240,7 +72461,7 @@ void TooltipWindow::paint (Graphics& g) void TooltipWindow::mouseEnter (const MouseEvent&) { - setVisible (false); + hide(); } void TooltipWindow::showFor (Component* const c) @@ -72254,7 +72475,7 @@ void TooltipWindow::showFor (Component* const c) if (tip.isEmpty()) { - setVisible (false); + hide(); } else { @@ -72279,10 +72500,23 @@ void TooltipWindow::showFor (Component* const c) setBounds (x, y, w, h); setVisible (true); + + if (getParentComponent() == 0) + { + addToDesktop (ComponentPeer::windowHasDropShadow + | ComponentPeer::windowIsTemporary); + } + toFront (false); } } +void TooltipWindow::hide() +{ + removeFromDesktop(); + setVisible (false); +} + void TooltipWindow::timerCallback() { int mx, my; @@ -72303,7 +72537,7 @@ void TooltipWindow::timerCallback() if (isVisible()) { lastHideTime = now; - setVisible (false); + hide(); } changedCompsSinceShown = changedCompsSinceShown || changedComp; @@ -72359,7 +72593,8 @@ public: void timerCallback() { - startTimer (1731); + startTimer (jmin (1731, getTimerInterval() * 2)); + TopLevelWindow* active = 0; if (Process::isForegroundProcess()) @@ -76627,8 +76862,8 @@ static void transformedImageRender (Image& destImage, for (int y = 0; y < destClipH; ++y) { - double sx = srcX; - double sy = srcY; + double sx = srcX - (srcClipWidth == destClipW ? 0.0 : 0.5); + double sy = srcY - (srcClipHeight == destClipH ? 0.0 : 0.5); DestPixelType* dest = (DestPixelType*) (destPixels + destStride * y); for (int x = 0; x < destClipW; ++x) @@ -79656,7 +79891,7 @@ private: tokens.trim(); tokens.removeEmptyStrings(); - if (tokens[0].containsChar T('%')) + if (tokens[0].containsChar (T('%'))) return Colour ((uint8) roundDoubleToInt (2.55 * tokens[0].getDoubleValue()), (uint8) roundDoubleToInt (2.55 * tokens[1].getDoubleValue()), (uint8) roundDoubleToInt (2.55 * tokens[2].getDoubleValue())); @@ -88220,6 +88455,7 @@ END_JUCE_NAMESPACE namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen @@ -89881,6 +90117,9 @@ ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); /********* End of inlined file: zlib.h *********/ #undef OS_CODE +#else + #include +#endif } BEGIN_JUCE_NAMESPACE @@ -90074,6 +90313,7 @@ END_JUCE_NAMESPACE namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE extern "C" { #undef OS_CODE @@ -98044,6 +98284,9 @@ void zcfree (voidpf opaque, voidpf ptr) #undef Byte } +#else + #include +#endif } #if JUCE_MSVC @@ -98279,6 +98522,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -98292,13 +98731,14 @@ END_JUCE_NAMESPACE namespace FlacNamespace { -#define FLAC__NO_DLL 1 +#if JUCE_INCLUDE_FLAC_CODE + #define FLAC__NO_DLL 1 -#if ! defined (SIZE_MAX) + #if ! defined (SIZE_MAX) #define SIZE_MAX 0xffffffff -#endif + #endif -#define __STDC_LIMIT_MACROS 1 + #define __STDC_LIMIT_MACROS 1 /********* Start of inlined file: all.h *********/ #ifndef FLAC__ALL_H @@ -105296,6 +105736,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -105448,6 +106084,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -106945,6 +107777,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -108085,6 +109113,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -108494,6 +109718,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -108627,6 +110047,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -109200,6 +110816,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -109498,6 +111310,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -110084,6 +112092,202 @@ 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) + +/* + 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -111634,6 +113838,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -112125,6 +114525,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -112361,6 +114957,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -115757,6 +118549,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -120226,6 +123214,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -120770,6 +123954,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -120979,6 +124359,9 @@ void FLAC__window_welch(FLAC__real *window, const FLAC__int32 L) #endif /********* End of inlined file: window_flac.c *********/ +#else + #include +#endif } #ifdef _MSC_VER @@ -121479,6 +124862,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -121487,6 +125066,7 @@ END_JUCE_NAMESPACE namespace OggVorbisNamespace { +#if JUCE_INCLUDE_OGGVORBIS_CODE /********* Start of inlined file: vorbisenc.h *********/ #ifndef _OV_ENC_H_ @@ -122248,6 +125828,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -123027,6 +126803,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -124808,6 +128780,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -125961,6 +130129,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -126206,6 +130570,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -127192,6 +131752,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -127793,6 +132549,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -128159,6 +133111,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -128380,6 +133528,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -129437,6 +134781,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -130051,6 +135591,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -130171,6 +135907,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -130222,6 +136154,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -130565,6 +136693,202 @@ 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 +#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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -131187,6 +137511,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -132015,6 +138535,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -132551,6 +139267,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -134529,6 +141441,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -134574,6 +141682,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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,6 +142758,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -136185,6 +143685,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -137423,6 +145119,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -137585,6 +145477,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -175938,6 +184026,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -177911,6 +186195,202 @@ 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 @@ -180038,6 +188518,11 @@ void _vorbis_apply_window(float *d,int *winno,long *blocksizes, #endif /********* End of inlined file: window.c *********/ +#else + #include + #include + #include +#endif } BEGIN_JUCE_NAMESPACE @@ -180481,6 +188966,7 @@ END_JUCE_NAMESPACE namespace jpeglibNamespace { +#if JUCE_INCLUDE_JPEGLIB_CODE extern "C" { #define JPEG_INTERNALS @@ -203796,6 +212282,11 @@ jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, /********* End of inlined file: transupp.c *********/ } +#else + #define JPEG_INTERNALS + #undef FAR + #include +#endif } #if JUCE_MSVC @@ -204058,15 +212549,21 @@ END_JUCE_NAMESPACE namespace zlibNamespace { +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen #undef OS_CODE +#else + #include +#endif } namespace pnglibNamespace { using namespace zlibNamespace; + +#if JUCE_INCLUDE_PNGLIB_CODE using ::malloc; using ::free; @@ -222182,7 +230679,7 @@ png_read_finish_row(png_structp png_ptr) char extra; int ret; - png_ptr->zstream.next_out = (Byte *)&extra; + png_ptr->zstream.next_out = (Bytef *)&extra; png_ptr->zstream.avail_out = (uInt)1; for(;;) { @@ -229451,6 +237948,13 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) /********* End of inlined file: pngwutil.c *********/ } +#else + #define PNG_INTERNAL + #define PNG_SETJMP_NOT_SUPPORTED + + #include + #include +#endif } #ifdef _MSC_VER @@ -229713,805 +238217,25 @@ END_JUCE_NAMESPACE //============================================================================== #if JUCE_WIN32 -/********* Start of inlined file: juce_win32_Files.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include - -#ifndef _WIN32_IE - #define _WIN32_IE 0x0400 -#endif -#include - -#ifndef CSIDL_MYMUSIC - #define CSIDL_MYMUSIC 0x000d -#endif +/********* Start of inlined file: juce_win32_NativeCode.cpp *********/ -#ifndef CSIDL_MYVIDEO - #define CSIDL_MYVIDEO 0x000e -#endif +/* + This file wraps together all the win32-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. +*/ BEGIN_JUCE_NAMESPACE -#ifdef _MSC_VER - #pragma warning (pop) -#endif - -const tchar File::separator = T('\\'); -const tchar* File::separatorString = T("\\"); - -bool juce_fileExists (const String& fileName, - const bool dontCountDirectories) throw() -{ - if (fileName.isEmpty()) - return false; - - const DWORD attr = GetFileAttributes (fileName); - - return dontCountDirectories ? ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) - : (attr != 0xffffffff); -} - -bool juce_isDirectory (const String& fileName) throw() -{ - const DWORD attr = GetFileAttributes (fileName); - - return (attr != 0xffffffff) - && ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0); -} - -bool juce_canWriteToFile (const String& fileName) throw() -{ - const DWORD attr = GetFileAttributes (fileName); - - return ((attr & FILE_ATTRIBUTE_READONLY) == 0); -} - -bool juce_setFileReadOnly (const String& fileName, - bool isReadOnly) -{ - DWORD attr = GetFileAttributes (fileName); - - if (attr == 0xffffffff) - return false; - - if (isReadOnly != juce_canWriteToFile (fileName)) - return true; - - if (isReadOnly) - attr |= FILE_ATTRIBUTE_READONLY; - else - attr &= ~FILE_ATTRIBUTE_READONLY; - - return SetFileAttributes (fileName, attr) != FALSE; -} +#define JUCE_INCLUDED_FILE 1 -bool File::isHidden() const throw() -{ - return (GetFileAttributes (getFullPathName()) & FILE_ATTRIBUTE_HIDDEN) != 0; -} - -bool juce_deleteFile (const String& fileName) throw() -{ - if (juce_isDirectory (fileName)) - return RemoveDirectory (fileName) != 0; - - return DeleteFile (fileName) != 0; -} - -bool juce_moveFile (const String& source, const String& dest) throw() -{ - return MoveFile (source, dest) != 0; -} +// Now include the actual code files.. -bool juce_copyFile (const String& source, const String& dest) throw() -{ - return CopyFile (source, dest, false) != 0; -} - -void juce_createDirectory (const String& fileName) throw() -{ - if (! juce_fileExists (fileName, true)) - { - CreateDirectory (fileName, 0); - } -} - -// return 0 if not possible -void* juce_fileOpen (const String& fileName, bool forWriting) throw() -{ - HANDLE h; - - if (forWriting) - { - h = CreateFile (fileName, GENERIC_WRITE, FILE_SHARE_READ, 0, - OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - - if (h != INVALID_HANDLE_VALUE) - SetFilePointer (h, 0, 0, FILE_END); - else - h = 0; - } - else - { - h = CreateFile (fileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); - - if (h == INVALID_HANDLE_VALUE) - h = 0; - } - - return (void*) h; -} - -void juce_fileClose (void* handle) throw() -{ - CloseHandle (handle); -} - -int juce_fileRead (void* handle, void* buffer, int size) throw() -{ - DWORD num = 0; - ReadFile ((HANDLE) handle, buffer, size, &num, 0); - return num; -} - -int juce_fileWrite (void* handle, const void* buffer, int size) throw() -{ - DWORD num; - - WriteFile ((HANDLE) handle, - buffer, size, - &num, 0); - - return num; -} - -int64 juce_fileSetPosition (void* handle, int64 pos) throw() -{ - LARGE_INTEGER li; - li.QuadPart = pos; - li.LowPart = SetFilePointer ((HANDLE) handle, - li.LowPart, - &li.HighPart, - FILE_BEGIN); // (returns -1 if it fails) - - return li.QuadPart; -} - -int64 juce_fileGetPosition (void* handle) throw() -{ - LARGE_INTEGER li; - li.QuadPart = 0; - li.LowPart = SetFilePointer ((HANDLE) handle, - 0, &li.HighPart, - FILE_CURRENT); // (returns -1 if it fails) - - return jmax ((int64) 0, li.QuadPart); -} - -void juce_fileFlush (void* handle) throw() -{ - FlushFileBuffers ((HANDLE) handle); -} - -int64 juce_getFileSize (const String& fileName) throw() -{ - WIN32_FILE_ATTRIBUTE_DATA attributes; - - if (GetFileAttributesEx (fileName, GetFileExInfoStandard, &attributes)) - { - return (((int64) attributes.nFileSizeHigh) << 32) - | attributes.nFileSizeLow; - } - - return 0; -} - -static int64 fileTimeToTime (const FILETIME* const ft) throw() -{ - // tell me if this fails! - static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); - -#if JUCE_GCC - return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000LL) / 10000; -#else - return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000) / 10000; -#endif -} - -static void timeToFileTime (const int64 time, FILETIME* const ft) throw() -{ -#if JUCE_GCC - ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000LL; -#else - ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000; -#endif -} - -void juce_getFileTimes (const String& fileName, - int64& modificationTime, - int64& accessTime, - int64& creationTime) throw() -{ - WIN32_FILE_ATTRIBUTE_DATA attributes; - - if (GetFileAttributesEx (fileName, GetFileExInfoStandard, &attributes)) - { - modificationTime = fileTimeToTime (&attributes.ftLastWriteTime); - creationTime = fileTimeToTime (&attributes.ftCreationTime); - accessTime = fileTimeToTime (&attributes.ftLastAccessTime); - } - else - { - creationTime = accessTime = modificationTime = 0; - } -} - -bool juce_setFileTimes (const String& fileName, - int64 modificationTime, - int64 accessTime, - int64 creationTime) throw() -{ - FILETIME m, a, c; - - if (modificationTime > 0) - timeToFileTime (modificationTime, &m); - - if (accessTime > 0) - timeToFileTime (accessTime, &a); - - if (creationTime > 0) - timeToFileTime (creationTime, &c); - - void* const h = juce_fileOpen (fileName, true); - bool ok = false; - - if (h != 0) - { - ok = SetFileTime ((HANDLE) h, - (creationTime > 0) ? &c : 0, - (accessTime > 0) ? &a : 0, - (modificationTime > 0) ? &m : 0) != 0; - juce_fileClose (h); - } - - return ok; -} - -// return '\0' separated list of strings -const StringArray juce_getFileSystemRoots() throw() -{ - TCHAR buffer [2048]; - buffer[0] = 0; - buffer[1] = 0; - GetLogicalDriveStrings (2048, buffer); - - TCHAR* n = buffer; - StringArray roots; - - while (*n != 0) - { - roots.add (String (n)); - - while (*n++ != 0) - { - } - } - - roots.sort (true); - return roots; -} - -const String juce_getVolumeLabel (const String& filenameOnVolume, - int& volumeSerialNumber) throw() -{ - TCHAR n [4]; - n[0] = *(const TCHAR*) filenameOnVolume; - n[1] = L':'; - n[2] = L'\\'; - n[3] = 0; - - TCHAR dest [64]; - DWORD serialNum; - - if (! GetVolumeInformation (n, dest, 64, (DWORD*) &serialNum, 0, 0, 0, 0)) - { - dest[0] = 0; - serialNum = 0; - } - - volumeSerialNumber = serialNum; - return String (dest); -} - -int64 File::getBytesFreeOnVolume() const throw() -{ - String fn (getFullPathName()); - if (fn[1] == T(':')) - fn = fn.substring (0, 2) + T("\\"); - - ULARGE_INTEGER spc; - ULARGE_INTEGER tot; - ULARGE_INTEGER totFree; - - if (GetDiskFreeSpaceEx (fn, &spc, &tot, &totFree)) - return (int64)(spc.QuadPart); - - return 0; -} - -static unsigned int getWindowsDriveType (const String& fileName) throw() -{ - TCHAR n[4]; - n[0] = *(const TCHAR*) fileName; - n[1] = L':'; - n[2] = L'\\'; - n[3] = 0; - - return GetDriveType (n); -} - -bool File::isOnCDRomDrive() const throw() -{ - return getWindowsDriveType (getFullPathName()) == DRIVE_CDROM; -} - -bool File::isOnHardDisk() const throw() -{ - if (fullPath.isEmpty()) - return false; - - const unsigned int n = getWindowsDriveType (getFullPathName()); - - if (fullPath.toLowerCase()[0] <= 'b' - && fullPath[1] == T(':')) - { - return n != DRIVE_REMOVABLE; - } - else - { - return n != DRIVE_CDROM && n != DRIVE_REMOTE; - } -} - -bool File::isOnRemovableDrive() const throw() -{ - if (fullPath.isEmpty()) - return false; - - const unsigned int n = getWindowsDriveType (getFullPathName()); - - return n == DRIVE_CDROM - || n == DRIVE_REMOTE - || n == DRIVE_REMOVABLE - || n == DRIVE_RAMDISK; -} - -#define MAX_PATH_CHARS (MAX_PATH + 256) - -static const File juce_getSpecialFolderPath (int type) throw() -{ - WCHAR path [MAX_PATH_CHARS]; - - if (SHGetSpecialFolderPath (0, path, type, 0)) - return File (String (path)); - - return File::nonexistent; -} - -const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType type) -{ - int csidlType = 0; - - switch (type) - { - case userHomeDirectory: - case userDocumentsDirectory: - csidlType = CSIDL_PERSONAL; - break; - - case userDesktopDirectory: - csidlType = CSIDL_DESKTOP; - break; - - case userApplicationDataDirectory: - csidlType = CSIDL_APPDATA; - break; - - case commonApplicationDataDirectory: - csidlType = CSIDL_COMMON_APPDATA; - break; - - case globalApplicationsDirectory: - csidlType = CSIDL_PROGRAM_FILES; - break; - - case userMusicDirectory: - csidlType = CSIDL_MYMUSIC; - break; - - case userMoviesDirectory: - csidlType = CSIDL_MYVIDEO; - break; - - case tempDirectory: - { - WCHAR dest [2048]; - dest[0] = 0; - GetTempPath (2048, dest); - return File (String (dest)); - } - - case currentExecutableFile: - case currentApplicationFile: - { - HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(); - - WCHAR dest [MAX_PATH_CHARS]; - dest[0] = 0; - GetModuleFileName (moduleHandle, dest, MAX_PATH_CHARS); - return File (String (dest)); - } - break; - - default: - jassertfalse // unknown type? - return File::nonexistent; - } - - return juce_getSpecialFolderPath (csidlType); -} - -void juce_setCurrentExecutableFileName (const String&) throw() -{ - // n/a on windows -} - -const File File::getCurrentWorkingDirectory() throw() -{ - WCHAR dest [MAX_PATH_CHARS]; - dest[0] = 0; - GetCurrentDirectory (MAX_PATH_CHARS, dest); - return File (String (dest)); -} - -bool File::setAsCurrentWorkingDirectory() const throw() -{ - return SetCurrentDirectory (getFullPathName()) != FALSE; -} - -template -static void getFindFileInfo (FindDataType& findData, - String& filename, bool* const isDir, bool* const isHidden, - int64* const fileSize, Time* const modTime, Time* const creationTime, - bool* const isReadOnly) throw() -{ - filename = findData.cFileName; - - if (isDir != 0) - *isDir = ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0); - - if (isHidden != 0) - *isHidden = ((findData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) != 0); - - if (fileSize != 0) - *fileSize = findData.nFileSizeLow + (((int64) findData.nFileSizeHigh) << 32); - - if (modTime != 0) - *modTime = fileTimeToTime (&findData.ftLastWriteTime); - - if (creationTime != 0) - *creationTime = fileTimeToTime (&findData.ftCreationTime); - - if (isReadOnly != 0) - *isReadOnly = ((findData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) != 0); - -} - -void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResult, - bool* isDir, bool* isHidden, int64* fileSize, - Time* modTime, Time* creationTime, bool* isReadOnly) throw() -{ - String wc (directory); - - if (! wc.endsWithChar (File::separator)) - wc += File::separator; - - wc += wildCard; - - WIN32_FIND_DATA findData; - HANDLE h = FindFirstFile (wc, &findData); - - if (h != INVALID_HANDLE_VALUE) - { - getFindFileInfo (findData, firstResult, isDir, isHidden, fileSize, - modTime, creationTime, isReadOnly); - return h; - } - - firstResult = String::empty; - return 0; -} - -bool juce_findFileNext (void* handle, String& resultFile, - bool* isDir, bool* isHidden, int64* fileSize, - Time* modTime, Time* creationTime, bool* isReadOnly) throw() -{ - WIN32_FIND_DATA findData; - - if (handle != 0 && FindNextFile ((HANDLE) handle, &findData) != 0) - { - getFindFileInfo (findData, resultFile, isDir, isHidden, fileSize, - modTime, creationTime, isReadOnly); - return true; - } - - resultFile = String::empty; - return false; -} - -void juce_findFileClose (void* handle) throw() -{ - FindClose (handle); -} - -bool juce_launchFile (const String& fileName, - const String& parameters) throw() -{ - HINSTANCE hInstance = 0; - - JUCE_TRY - { - hInstance = ShellExecute (0, 0, fileName, parameters, 0, SW_SHOWDEFAULT); - } - JUCE_CATCH_ALL - - return hInstance > (HINSTANCE) 32; -} - -struct NamedPipeInternal -{ - HANDLE pipeH; - HANDLE cancelEvent; - bool connected, createdPipe; - - NamedPipeInternal() - : pipeH (0), - cancelEvent (0), - connected (false), - createdPipe (false) - { - cancelEvent = CreateEvent (0, FALSE, FALSE, 0); - } - - ~NamedPipeInternal() - { - disconnect(); - - if (pipeH != 0) - CloseHandle (pipeH); - - CloseHandle (cancelEvent); - } - - bool connect (const int timeOutMs) - { - if (! createdPipe) - return true; - - if (! connected) - { - OVERLAPPED over; - zerostruct (over); - - over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - - if (ConnectNamedPipe (pipeH, &over)) - { - connected = false; // yes, you read that right. In overlapped mode it should always return 0. - } - else - { - const int err = GetLastError(); - - if (err == ERROR_IO_PENDING || err == ERROR_PIPE_LISTENING) - { - HANDLE handles[] = { over.hEvent, cancelEvent }; - - if (WaitForMultipleObjects (2, handles, FALSE, - timeOutMs >= 0 ? timeOutMs : INFINITE) == WAIT_OBJECT_0) - connected = true; - } - else if (err == ERROR_PIPE_CONNECTED) - { - connected = true; - } - } - - CloseHandle (over.hEvent); - } - - return connected; - } - - void disconnect() - { - if (connected) - { - DisconnectNamedPipe (pipeH); - connected = false; - } - } -}; - -void NamedPipe::close() -{ - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - delete intern; - internal = 0; -} - -bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) -{ - close(); - - NamedPipeInternal* const intern = new NamedPipeInternal(); - - String file ("\\\\.\\pipe\\"); - file += pipeName; - - intern->createdPipe = createPipe; - - if (createPipe) - { - intern->pipeH = CreateNamedPipe (file, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, 0, - 1, 64, 64, 0, NULL); - } - else - { - intern->pipeH = CreateFile (file, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, 0); - } - - if (intern->pipeH != INVALID_HANDLE_VALUE) - { - internal = intern; - return true; - } - - delete intern; - return false; -} - -int NamedPipe::read (void* destBuffer, int maxBytesToRead, int timeOutMilliseconds) -{ - int bytesRead = -1; - bool waitAgain = true; - - while (waitAgain && internal != 0) - { - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - waitAgain = false; - - if (! intern->connect (timeOutMilliseconds)) - break; - - if (maxBytesToRead <= 0) - return 0; - - OVERLAPPED over; - zerostruct (over); - over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - - unsigned long numRead; - - if (ReadFile (intern->pipeH, destBuffer, maxBytesToRead, &numRead, &over)) - { - bytesRead = (int) numRead; - } - else if (GetLastError() == ERROR_IO_PENDING) - { - HANDLE handles[] = { over.hEvent, intern->cancelEvent }; - - if (WaitForMultipleObjects (2, handles, FALSE, - timeOutMilliseconds >= 0 ? timeOutMilliseconds - : INFINITE) == WAIT_OBJECT_0) - { - if (GetOverlappedResult (intern->pipeH, &over, &numRead, FALSE)) - { - bytesRead = (int) numRead; - } - else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) - { - intern->disconnect(); - waitAgain = true; - } - } - } - else - { - waitAgain = internal != 0; - Sleep (5); - } - - CloseHandle (over.hEvent); - } - - return bytesRead; -} - -int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) -{ - int bytesWritten = -1; - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - if (intern != 0 && intern->connect (timeOutMilliseconds)) - { - if (numBytesToWrite <= 0) - return 0; - - OVERLAPPED over; - zerostruct (over); - - over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - - unsigned long numWritten; - - if (WriteFile (intern->pipeH, sourceBuffer, numBytesToWrite, &numWritten, &over)) - { - bytesWritten = (int) numWritten; - } - else if (GetLastError() == ERROR_IO_PENDING) - { - HANDLE handles[] = { over.hEvent, intern->cancelEvent }; - - if (WaitForMultipleObjects (2, handles, FALSE, timeOutMilliseconds >= 0 ? timeOutMilliseconds - : INFINITE) == WAIT_OBJECT_0) - { - if (GetOverlappedResult (intern->pipeH, &over, &numWritten, FALSE)) - { - bytesWritten = (int) numWritten; - } - else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) - { - intern->disconnect(); - } - } - } - - CloseHandle (over.hEvent); - } - - return bytesWritten; -} - -void NamedPipe::cancelPendingReads() -{ - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - if (intern != 0) - SetEvent (intern->cancelEvent); -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Files.cpp *********/ - -/********* Start of inlined file: juce_win32_Network.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE +/********* Start of inlined file: juce_win32_DynamicLibraryLoader.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE /********* Start of inlined file: juce_win32_DynamicLibraryLoader.h *********/ #ifndef __JUCE_WIN32_DYNAMICLIBRARYLOADER_JUCEHEADER__ @@ -230549,672 +238273,28 @@ private: #endif // __JUCE_WIN32_DYNAMICLIBRARYLOADER_JUCEHEADER__ /********* End of inlined file: juce_win32_DynamicLibraryLoader.h *********/ -#ifndef INTERNET_FLAG_NEED_FILE - #define INTERNET_FLAG_NEED_FILE 0x00000010 -#endif - -#ifdef _MSC_VER - #pragma warning (pop) -#endif - -bool juce_isOnLine() -{ - DWORD connectionType; - - return InternetGetConnectedState (&connectionType, 0) != 0 - || (connectionType & (INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_PROXY)) != 0; -} - -struct ConnectionAndRequestStruct -{ - HINTERNET connection, request; -}; - -static HINTERNET sessionHandle = 0; - -void* juce_openInternetFile (const String& url, - const String& headers, - const MemoryBlock& postData, - const bool isPost, - URL::OpenStreamProgressCallback* callback, - void* callbackContext, - int timeOutMs) -{ - if (sessionHandle == 0) - sessionHandle = InternetOpen (_T("juce"), - INTERNET_OPEN_TYPE_PRECONFIG, - 0, 0, 0); - - if (sessionHandle != 0) - { - // break up the url.. - TCHAR file[1024], server[1024]; - - URL_COMPONENTS uc; - zerostruct (uc); - - uc.dwStructSize = sizeof (uc); - uc.dwUrlPathLength = sizeof (file); - uc.dwHostNameLength = sizeof (server); - uc.lpszUrlPath = file; - uc.lpszHostName = server; - - if (InternetCrackUrl (url, 0, 0, &uc)) - { - if (timeOutMs == 0) - timeOutMs = 30000; - else if (timeOutMs < 0) - timeOutMs = -1; - - InternetSetOption (sessionHandle, INTERNET_OPTION_CONNECT_TIMEOUT, &timeOutMs, sizeof (timeOutMs)); - - const bool isFtp = url.startsWithIgnoreCase (T("ftp:")); - - HINTERNET connection = InternetConnect (sessionHandle, - uc.lpszHostName, - uc.nPort, - _T(""), _T(""), - isFtp ? INTERNET_SERVICE_FTP - : INTERNET_SERVICE_HTTP, - 0, 0); - - if (connection != 0) - { - if (isFtp) - { - HINTERNET request = FtpOpenFile (connection, - uc.lpszUrlPath, - GENERIC_READ, - FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_NEED_FILE, - 0); - - ConnectionAndRequestStruct* const result = new ConnectionAndRequestStruct(); - result->connection = connection; - result->request = request; - return result; - } - else - { - const TCHAR* mimeTypes[] = { _T("*/*"), 0 }; - - HINTERNET request = HttpOpenRequest (connection, - isPost ? _T("POST") - : _T("GET"), - uc.lpszUrlPath, - 0, 0, mimeTypes, - INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE, - 0); - - if (request != 0) - { - INTERNET_BUFFERS buffers; - zerostruct (buffers); - buffers.dwStructSize = sizeof (INTERNET_BUFFERS); - buffers.lpcszHeader = (LPCTSTR) headers; - buffers.dwHeadersLength = headers.length(); - buffers.dwBufferTotal = (DWORD) postData.getSize(); - ConnectionAndRequestStruct* result = 0; - - if (HttpSendRequestEx (request, &buffers, 0, HSR_INITIATE, 0)) - { - int bytesSent = 0; - - for (;;) - { - const int bytesToDo = jmin (1024, postData.getSize() - bytesSent); - DWORD bytesDone = 0; - - if (bytesToDo > 0 - && ! InternetWriteFile (request, - ((const char*) postData.getData()) + bytesSent, - bytesToDo, &bytesDone)) - { - break; - } - - if (bytesToDo == 0 || (int) bytesDone < bytesToDo) - { - result = new ConnectionAndRequestStruct(); - result->connection = connection; - result->request = request; - - HttpEndRequest (request, 0, 0, 0); - return result; - } - - bytesSent += bytesDone; - - if (callback != 0 && ! callback (callbackContext, bytesSent, postData.getSize())) - break; - } - } - - InternetCloseHandle (request); - } - - InternetCloseHandle (connection); - } - } - } - } - - return 0; -} - -int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) -{ - DWORD bytesRead = 0; - - const ConnectionAndRequestStruct* const crs = (const ConnectionAndRequestStruct*) handle; - - if (crs != 0) - InternetReadFile (crs->request, - buffer, bytesToRead, - &bytesRead); - - return bytesRead; -} - -int juce_seekInInternetFile (void* handle, int newPosition) -{ - if (handle != 0) - { - const ConnectionAndRequestStruct* const crs = (const ConnectionAndRequestStruct*) handle; - - return InternetSetFilePointer (crs->request, - newPosition, 0, - FILE_BEGIN, 0); - } - else - { - return -1; - } -} - -void juce_closeInternetFile (void* handle) -{ - if (handle != 0) - { - ConnectionAndRequestStruct* const crs = (ConnectionAndRequestStruct*) handle; - InternetCloseHandle (crs->request); - InternetCloseHandle (crs->connection); - delete crs; - } -} - -static int getMACAddressViaGetAdaptersInfo (int64* addresses, int maxNum, const bool littleEndian) throw() -{ - int numFound = 0; - - DynamicLibraryLoader dll ("iphlpapi.dll"); - DynamicLibraryImport (GetAdaptersInfo, getAdaptersInfo, DWORD, dll, (PIP_ADAPTER_INFO, PULONG)) - - if (getAdaptersInfo != 0) - { - ULONG len = sizeof (IP_ADAPTER_INFO); - MemoryBlock mb; - PIP_ADAPTER_INFO adapterInfo = (PIP_ADAPTER_INFO) mb.getData(); - - if (getAdaptersInfo (adapterInfo, &len) == ERROR_BUFFER_OVERFLOW) - { - mb.setSize (len); - adapterInfo = (PIP_ADAPTER_INFO) mb.getData(); - } - - if (getAdaptersInfo (adapterInfo, &len) == NO_ERROR) - { - PIP_ADAPTER_INFO adapter = adapterInfo; - - while (adapter != 0) - { - int64 mac = 0; - for (unsigned int i = 0; i < adapter->AddressLength; ++i) - mac = (mac << 8) | adapter->Address[i]; - - if (littleEndian) - mac = (int64) swapByteOrder ((uint64) mac); - - if (numFound < maxNum && mac != 0) - addresses [numFound++] = mac; - - adapter = adapter->Next; - } - } - } - - return numFound; -} - -static int getMACAddressesViaNetBios (int64* addresses, int maxNum, const bool littleEndian) throw() -{ - int numFound = 0; - - DynamicLibraryLoader dll ("netapi32.dll"); - DynamicLibraryImport (Netbios, NetbiosCall, UCHAR, dll, (PNCB)) - - if (NetbiosCall != 0) - { - NCB ncb; - zerostruct (ncb); - - typedef struct _ASTAT_ - { - ADAPTER_STATUS adapt; - NAME_BUFFER NameBuff [30]; - } ASTAT; - - ASTAT astat; - zerostruct (astat); - - LANA_ENUM enums; - zerostruct (enums); - - ncb.ncb_command = NCBENUM; - ncb.ncb_buffer = (unsigned char*) &enums; - ncb.ncb_length = sizeof (LANA_ENUM); - NetbiosCall (&ncb); - - for (int i = 0; i < enums.length; ++i) - { - zerostruct (ncb); - ncb.ncb_command = NCBRESET; - ncb.ncb_lana_num = enums.lana[i]; - - if (NetbiosCall (&ncb) == 0) - { - zerostruct (ncb); - memcpy (ncb.ncb_callname, "* ", NCBNAMSZ); - ncb.ncb_command = NCBASTAT; - ncb.ncb_lana_num = enums.lana[i]; - - ncb.ncb_buffer = (unsigned char*) &astat; - ncb.ncb_length = sizeof (ASTAT); - - if (NetbiosCall (&ncb) == 0) - { - if (astat.adapt.adapter_type == 0xfe) - { - int64 mac = 0; - for (unsigned int i = 0; i < 6; ++i) - mac = (mac << 8) | astat.adapt.adapter_address[i]; - - if (littleEndian) - mac = (int64) swapByteOrder ((uint64) mac); - - if (numFound < maxNum && mac != 0) - addresses [numFound++] = mac; - } - } - } - } - } - - return numFound; -} - -int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() -{ - int numFound = getMACAddressViaGetAdaptersInfo (addresses, maxNum, littleEndian); - - if (numFound == 0) - numFound = getMACAddressesViaNetBios (addresses, maxNum, littleEndian); - - return numFound; -} - -typedef ULONG (WINAPI *MAPISendMailType) (LHANDLE, ULONG, lpMapiMessage, ::FLAGS, ULONG); - -bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, - const String& emailSubject, - const String& bodyText, - const StringArray& filesToAttach) -{ - HMODULE h = LoadLibraryA ("MAPI32.dll"); - - MAPISendMailType mapiSendMail = (MAPISendMailType) GetProcAddress (h, "MAPISendMail"); - bool ok = false; - - if (mapiSendMail != 0) - { - MapiMessage message; - zerostruct (message); - message.lpszSubject = (LPSTR) (LPCSTR) emailSubject; - message.lpszNoteText = (LPSTR) (LPCSTR) bodyText; - - MapiRecipDesc recip; - zerostruct (recip); - recip.ulRecipClass = MAPI_TO; - recip.lpszName = (LPSTR) (LPCSTR) targetEmailAddress; - message.nRecipCount = 1; - message.lpRecips = &recip; - - MemoryBlock mb (sizeof (MapiFileDesc) * filesToAttach.size()); - mb.fillWith (0); - MapiFileDesc* files = (MapiFileDesc*) mb.getData(); - - message.nFileCount = filesToAttach.size(); - message.lpFiles = files; - - for (int i = 0; i < filesToAttach.size(); ++i) - { - files[i].nPosition = (ULONG) -1; - files[i].lpszPathName = (LPSTR) (LPCSTR) filesToAttach [i]; - } - - ok = (mapiSendMail (0, 0, &message, MAPI_DIALOG | MAPI_LOGON_UI, 0) == SUCCESS_SUCCESS); - } - - FreeLibrary (h); - return ok; -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Network.cpp *********/ - -/********* Start of inlined file: juce_win32_Misc.cpp *********/ - -BEGIN_JUCE_NAMESPACE - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) -{ - return MessageBox (0, bodyText, title, - MB_SETFOREGROUND | (isOkCancel ? MB_OKCANCEL - : MB_OK)) == IDOK; -} - -#endif - -void PlatformUtilities::beep() -{ - MessageBeep (MB_OK); -} - -#if JUCE_MSVC - #pragma warning (disable : 4127) // "Conditional expression is constant" warning -#endif - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - -void SystemClipboard::copyTextToClipboard (const String& text) throw() -{ - if (OpenClipboard (0) != 0) - { - if (EmptyClipboard() != 0) - { - const int len = text.length(); - - if (len > 0) - { - HGLOBAL bufH = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, - (len + 1) * sizeof (wchar_t)); - - if (bufH != 0) - { - wchar_t* const data = (wchar_t*) GlobalLock (bufH); - text.copyToBuffer (data, len); - GlobalUnlock (bufH); - - SetClipboardData (CF_UNICODETEXT, bufH); - } - } - } - - CloseClipboard(); - } -} - -const String SystemClipboard::getTextFromClipboard() throw() -{ - String result; - - if (OpenClipboard (0) != 0) - { - HANDLE bufH = GetClipboardData (CF_UNICODETEXT); - - if (bufH != 0) - { - const wchar_t* const data = (const wchar_t*) GlobalLock (bufH); - - if (data != 0) - { - result = String (data, (int) (GlobalSize (bufH) / sizeof (tchar))); - - GlobalUnlock (bufH); - } - } - - CloseClipboard(); - } - - return result; -} - -#endif - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Misc.cpp *********/ - -/********* Start of inlined file: juce_win32_PlatformUtils.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif - -#include - -BEGIN_JUCE_NAMESPACE - -#ifdef _MSC_VER - #pragma warning (pop) -#endif - -static HKEY findKeyForPath (String name, - const bool createForWriting, - String& valueName) throw() -{ - HKEY rootKey = 0; - - if (name.startsWithIgnoreCase (T("HKEY_CURRENT_USER\\"))) - rootKey = HKEY_CURRENT_USER; - else if (name.startsWithIgnoreCase (T("HKEY_LOCAL_MACHINE\\"))) - rootKey = HKEY_LOCAL_MACHINE; - else if (name.startsWithIgnoreCase (T("HKEY_CLASSES_ROOT\\"))) - rootKey = HKEY_CLASSES_ROOT; - - if (rootKey != 0) - { - name = name.substring (name.indexOfChar (T('\\')) + 1); - - const int lastSlash = name.lastIndexOfChar (T('\\')); - valueName = name.substring (lastSlash + 1); - name = name.substring (0, lastSlash); - - HKEY key; - DWORD result; - - if (createForWriting) - { - if (RegCreateKeyEx (rootKey, name, 0, L"", REG_OPTION_NON_VOLATILE, - (KEY_WRITE | KEY_QUERY_VALUE), 0, &key, &result) == ERROR_SUCCESS) - return key; - } - else - { - if (RegOpenKeyEx (rootKey, name, 0, KEY_READ, &key) == ERROR_SUCCESS) - return key; - } - } - - return 0; -} - -const String PlatformUtilities::getRegistryValue (const String& regValuePath, - const String& defaultValue) -{ - String valueName, s; - HKEY k = findKeyForPath (regValuePath, false, valueName); - - if (k != 0) - { - WCHAR buffer [2048]; - unsigned long bufferSize = sizeof (buffer); - DWORD type = REG_SZ; - - if (RegQueryValueEx (k, valueName, 0, &type, (LPBYTE) buffer, &bufferSize) == ERROR_SUCCESS) - s = buffer; - else - s = defaultValue; - - RegCloseKey (k); - } - - return s; -} - -void PlatformUtilities::setRegistryValue (const String& regValuePath, - const String& value) -{ - String valueName; - HKEY k = findKeyForPath (regValuePath, true, valueName); - - if (k != 0) - { - RegSetValueEx (k, valueName, 0, REG_SZ, - (const BYTE*) (const WCHAR*) value, - sizeof (WCHAR) * (value.length() + 1)); - - RegCloseKey (k); - } -} - -bool PlatformUtilities::registryValueExists (const String& regValuePath) -{ - bool exists = false; - String valueName; - HKEY k = findKeyForPath (regValuePath, false, valueName); - - if (k != 0) - { - unsigned char buffer [2048]; - unsigned long bufferSize = sizeof (buffer); - DWORD type = 0; - - if (RegQueryValueEx (k, valueName, 0, &type, buffer, &bufferSize) == ERROR_SUCCESS) - exists = true; - - RegCloseKey (k); - } - - return exists; -} - -void PlatformUtilities::deleteRegistryValue (const String& regValuePath) -{ - String valueName; - HKEY k = findKeyForPath (regValuePath, true, valueName); - - if (k != 0) - { - RegDeleteValue (k, valueName); - RegCloseKey (k); - } -} - -void PlatformUtilities::deleteRegistryKey (const String& regKeyPath) -{ - String valueName; - HKEY k = findKeyForPath (regKeyPath, true, valueName); - - if (k != 0) - { - RegDeleteKey (k, valueName); - RegCloseKey (k); - } -} - -bool juce_IsRunningInWine() throw() -{ - HKEY key; - if (RegOpenKeyEx (HKEY_CURRENT_USER, _T("Software\\Wine"), 0, KEY_READ, &key) == ERROR_SUCCESS) - { - RegCloseKey (key); - return true; - } - - return false; -} - -const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() throw() +DynamicLibraryLoader::DynamicLibraryLoader (const String& name) { - String s (::GetCommandLineW()); - - StringArray tokens; - tokens.addTokens (s, true); // tokenise so that we can remove the initial filename argument - - return tokens.joinIntoString (T(" "), 1); + libHandle = LoadLibrary (name); } -static void* currentModuleHandle = 0; - -void* PlatformUtilities::getCurrentModuleInstanceHandle() throw() +DynamicLibraryLoader::~DynamicLibraryLoader() { - if (currentModuleHandle == 0) - currentModuleHandle = GetModuleHandle (0); - - return currentModuleHandle; + FreeLibrary ((HMODULE) libHandle); } -void PlatformUtilities::setCurrentModuleInstanceHandle (void* const newHandle) throw() +void* DynamicLibraryLoader::findProcAddress (const String& functionName) { - currentModuleHandle = newHandle; + return (void*) GetProcAddress ((HMODULE) libHandle, functionName); } -void PlatformUtilities::fpuReset() -{ -#if JUCE_MSVC - _clearfp(); #endif -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_PlatformUtils.cpp *********/ +/********* End of inlined file: juce_win32_DynamicLibraryLoader.cpp *********/ /********* Start of inlined file: juce_win32_SystemStats.cpp *********/ - -// Auto-link the other win32 libs that are needed by library calls.. -#if defined (JUCE_DLL_BUILD) && JUCE_MSVC - -/********* Start of inlined file: juce_win32_AutoLinkLibraries.h *********/ -// Auto-links to various win32 libs that are needed by library calls.. -#pragma comment(lib, "kernel32.lib") -#pragma comment(lib, "user32.lib") -#pragma comment(lib, "shell32.lib") -#pragma comment(lib, "gdi32.lib") -#pragma comment(lib, "vfw32.lib") -#pragma comment(lib, "comdlg32.lib") -#pragma comment(lib, "winmm.lib") -#pragma comment(lib, "wininet.lib") -#pragma comment(lib, "ole32.lib") -#pragma comment(lib, "advapi32.lib") -#pragma comment(lib, "ws2_32.lib") -#pragma comment(lib, "comsupp.lib") - -#if JUCE_OPENGL - #pragma comment(lib, "OpenGL32.Lib") - #pragma comment(lib, "GlU32.Lib") -#endif - -#if JUCE_QUICKTIME - #pragma comment (lib, "QTMLClient.lib") -#endif -/********* End of inlined file: juce_win32_AutoLinkLibraries.h *********/ - -#endif - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE extern void juce_updateMultiMonitorInfo() throw(); extern void juce_initialiseThreadEvents() throw(); @@ -231643,29 +238723,18 @@ int SystemStats::getPageSize() throw() return systemInfo.dwPageSize; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_win32_SystemStats.cpp *********/ /********* Start of inlined file: juce_win32_Threads.cpp *********/ - -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) - #include -#endif - -#include - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE #if ! JUCE_ONLY_BUILD_CORE_LIBRARY extern HWND juce_messageWindowHandle; #endif -#ifdef _MSC_VER - #pragma warning (pop) -#endif - CriticalSection::CriticalSection() throw() { // (just to check the MS haven't changed this structure and broken things...) @@ -231734,7 +238803,7 @@ static unsigned int __stdcall threadEntryProc (void* userData) throw() juce_threadEntryPoint (userData); - _endthreadex(0); + _endthreadex (0); return 0; } @@ -231793,7 +238862,7 @@ void juce_setCurrentThreadName (const String& name) throw() #endif } -int Thread::getCurrentThreadId() throw() +int64 Thread::getCurrentThreadId() throw() { return (int) GetCurrentThreadId(); } @@ -231937,7 +239006,7 @@ void Process::terminate() ExitProcess (0); } -void* Process::loadDynamicLibrary (const String& name) +void* PlatformUtilities::loadDynamicLibrary (const String& name) { void* result = 0; @@ -231950,7 +239019,7 @@ void* Process::loadDynamicLibrary (const String& name) return result; } -void Process::freeDynamicLibrary (void* h) +void PlatformUtilities::freeDynamicLibrary (void* h) { JUCE_TRY { @@ -231960,7 +239029,7 @@ void Process::freeDynamicLibrary (void* h) JUCE_CATCH_ALL } -void* Process::getProcedureEntryPoint (void* h, const String& name) +void* PlatformUtilities::getProcedureEntryPoint (void* h, const String& name) { return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name) : 0; @@ -232010,6952 +239079,9468 @@ void InterProcessLock::exit() throw() } } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_win32_Threads.cpp *********/ -/********* Start of inlined file: juce_win32_DynamicLibraryLoader.cpp *********/ +/********* Start of inlined file: juce_win32_Files.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -BEGIN_JUCE_NAMESPACE +#ifndef CSIDL_MYMUSIC + #define CSIDL_MYMUSIC 0x000d +#endif -DynamicLibraryLoader::DynamicLibraryLoader (const String& name) +#ifndef CSIDL_MYVIDEO + #define CSIDL_MYVIDEO 0x000e +#endif + +const tchar File::separator = T('\\'); +const tchar* File::separatorString = T("\\"); + +bool juce_fileExists (const String& fileName, + const bool dontCountDirectories) throw() { - libHandle = LoadLibrary (name); + if (fileName.isEmpty()) + return false; + + const DWORD attr = GetFileAttributes (fileName); + + return dontCountDirectories ? ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) + : (attr != 0xffffffff); } -DynamicLibraryLoader::~DynamicLibraryLoader() +bool juce_isDirectory (const String& fileName) throw() { - FreeLibrary ((HMODULE) libHandle); + const DWORD attr = GetFileAttributes (fileName); + + return (attr != 0xffffffff) + && ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0); } -void* DynamicLibraryLoader::findProcAddress (const String& functionName) +bool juce_canWriteToFile (const String& fileName) throw() { - return (void*) GetProcAddress ((HMODULE) libHandle, functionName); + const DWORD attr = GetFileAttributes (fileName); + + return ((attr & FILE_ATTRIBUTE_READONLY) == 0); } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_DynamicLibraryLoader.cpp *********/ +bool juce_setFileReadOnly (const String& fileName, + bool isReadOnly) +{ + DWORD attr = GetFileAttributes (fileName); -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY + if (attr == 0xffffffff) + return false; -/********* Start of inlined file: juce_win32_ASIO.cpp *********/ + if (isReadOnly != juce_canWriteToFile (fileName)) + return true; -#undef WINDOWS + if (isReadOnly) + attr |= FILE_ATTRIBUTE_READONLY; + else + attr &= ~FILE_ATTRIBUTE_READONLY; -#if JUCE_ASIO + return SetFileAttributes (fileName, attr) != FALSE; +} -/* - This is very frustrating - we only need to use a handful of definitions from - a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy - about 30 lines of code into this cpp file to create a fully stand-alone ASIO - implementation... +bool File::isHidden() const throw() +{ + return (GetFileAttributes (getFullPathName()) & FILE_ATTRIBUTE_HIDDEN) != 0; +} - ..unfortunately that would break Steinberg's license agreement for use of - their SDK, so I'm not allowed to do this. +bool juce_deleteFile (const String& fileName) throw() +{ + if (juce_isDirectory (fileName)) + return RemoveDirectory (fileName) != 0; - This means that anyone who wants to use JUCE's ASIO abilities will have to: + return DeleteFile (fileName) != 0; +} - 1) Agree to Steinberg's licensing terms and download the ASIO SDK - (see www.steinberg.net/Steinberg/Developers.asp). +bool juce_moveFile (const String& source, const String& dest) throw() +{ + return MoveFile (source, dest) != 0; +} - 2) Rebuild the whole of JUCE, setting the global definition JUCE_ASIO (you - can un-comment the "#define JUCE_ASIO" line in juce_Config.h - if you prefer). Make sure that your header search path will find the - iasiodrv.h file that comes with the SDK. (Only about 2-3 of the SDK header - files are actually needed - so to simplify things, you could just copy - these into your JUCE directory). -*/ -#include "iasiodrv.h" // if you're compiling and this line causes an error because - // you don't have the ASIO SDK installed, you can disable ASIO - // support by commenting-out the "#define JUCE_ASIO" line in - // juce_Config.h +bool juce_copyFile (const String& source, const String& dest) throw() +{ + return CopyFile (source, dest, false) != 0; +} -BEGIN_JUCE_NAMESPACE +void juce_createDirectory (const String& fileName) throw() +{ + if (! juce_fileExists (fileName, true)) + { + CreateDirectory (fileName, 0); + } +} -// #define ASIO_DEBUGGING +// return 0 if not possible +void* juce_fileOpen (const String& fileName, bool forWriting) throw() +{ + HANDLE h; -#ifdef ASIO_DEBUGGING - #define log(a) { Logger::writeToLog (a); DBG (a) } -#else - #define log(a) {} -#endif + if (forWriting) + { + h = CreateFile (fileName, GENERIC_WRITE, FILE_SHARE_READ, 0, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); -#ifdef ASIO_DEBUGGING -static void logError (const String& context, long error) -{ - String err ("unknown error"); + if (h != INVALID_HANDLE_VALUE) + SetFilePointer (h, 0, 0, FILE_END); + else + h = 0; + } + else + { + h = CreateFile (fileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); - if (error == ASE_NotPresent) - err = "Not Present"; - else if (error == ASE_HWMalfunction) - err = "Hardware Malfunction"; - else if (error == ASE_InvalidParameter) - err = "Invalid Parameter"; - else if (error == ASE_InvalidMode) - err = "Invalid Mode"; - else if (error == ASE_SPNotAdvancing) - err = "Sample position not advancing"; - else if (error == ASE_NoClock) - err = "No Clock"; - else if (error == ASE_NoMemory) - err = "Out of memory"; + if (h == INVALID_HANDLE_VALUE) + h = 0; + } - log (T("!!error: ") + context + T(" - ") + err); + return (void*) h; } -#else - #define logError(a, b) {} -#endif -class ASIOAudioIODevice; -static ASIOAudioIODevice* volatile currentASIODev[3] = { 0, 0, 0 }; +void juce_fileClose (void* handle) throw() +{ + CloseHandle (handle); +} -static const int maxASIOChannels = 160; +int juce_fileRead (void* handle, void* buffer, int size) throw() +{ + DWORD num = 0; + ReadFile ((HANDLE) handle, buffer, size, &num, 0); + return num; +} -class JUCE_API ASIOAudioIODevice : public AudioIODevice, - private Timer +int juce_fileWrite (void* handle, const void* buffer, int size) throw() { -public: - Component ourWindow; + DWORD num; - ASIOAudioIODevice (const String& name_, const CLSID classId_, const int slotNumber) - : AudioIODevice (name_, T("ASIO")), - asioObject (0), - classId (classId_), - currentBitDepth (16), - currentSampleRate (0), - tempBuffer (0), - isOpen_ (false), - isStarted (false), - postOutput (true), - insideControlPanelModalLoop (false), - shouldUsePreferredSize (false) - { - name = name_; + WriteFile ((HANDLE) handle, + buffer, size, + &num, 0); - ourWindow.addToDesktop (0); - windowHandle = ourWindow.getWindowHandle(); + return num; +} - jassert (currentASIODev [slotNumber] == 0); - currentASIODev [slotNumber] = this; +int64 juce_fileSetPosition (void* handle, int64 pos) throw() +{ + LARGE_INTEGER li; + li.QuadPart = pos; + li.LowPart = SetFilePointer ((HANDLE) handle, + li.LowPart, + &li.HighPart, + FILE_BEGIN); // (returns -1 if it fails) - openDevice(); - } + return li.QuadPart; +} - ~ASIOAudioIODevice() - { - for (int i = 0; i < numElementsInArray (currentASIODev); ++i) - if (currentASIODev[i] == this) - currentASIODev[i] = 0; +int64 juce_fileGetPosition (void* handle) throw() +{ + LARGE_INTEGER li; + li.QuadPart = 0; + li.LowPart = SetFilePointer ((HANDLE) handle, + 0, &li.HighPart, + FILE_CURRENT); // (returns -1 if it fails) - close(); - log ("ASIO - exiting"); - removeCurrentDriver(); + return jmax ((int64) 0, li.QuadPart); +} - juce_free (tempBuffer); - } +void juce_fileFlush (void* handle) throw() +{ + FlushFileBuffers ((HANDLE) handle); +} - void updateSampleRates() +int64 juce_getFileSize (const String& fileName) throw() +{ + WIN32_FILE_ATTRIBUTE_DATA attributes; + + if (GetFileAttributesEx (fileName, GetFileExInfoStandard, &attributes)) { - // find a list of sample rates.. - const double possibleSampleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; - sampleRates.clear(); + return (((int64) attributes.nFileSizeHigh) << 32) + | attributes.nFileSizeLow; + } - if (asioObject != 0) - { - for (int index = 0; index < numElementsInArray (possibleSampleRates); ++index) - { - const long err = asioObject->canSampleRate (possibleSampleRates[index]); + return 0; +} - if (err == 0) - { - sampleRates.add ((int) possibleSampleRates[index]); - log (T("rate: ") + String ((int) possibleSampleRates[index])); - } - else if (err != ASE_NoClock) - { - logError (T("CanSampleRate"), err); - } - } +static int64 fileTimeToTime (const FILETIME* const ft) throw() +{ + // tell me if this fails! + static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); - if (sampleRates.size() == 0) - { - double cr = 0; - const long err = asioObject->getSampleRate (&cr); - log (T("No sample rates supported - current rate: ") + String ((int) cr)); +#if JUCE_GCC + return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000LL) / 10000; +#else + return (((const ULARGE_INTEGER*) ft)->QuadPart - 116444736000000000) / 10000; +#endif +} - if (err == 0) - sampleRates.add ((int) cr); - } - } - } +static void timeToFileTime (const int64 time, FILETIME* const ft) throw() +{ +#if JUCE_GCC + ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000LL; +#else + ((ULARGE_INTEGER*) ft)->QuadPart = time * 10000 + 116444736000000000; +#endif +} - const StringArray getOutputChannelNames() - { - return outputChannelNames; - } +void juce_getFileTimes (const String& fileName, + int64& modificationTime, + int64& accessTime, + int64& creationTime) throw() +{ + WIN32_FILE_ATTRIBUTE_DATA attributes; - const StringArray getInputChannelNames() + if (GetFileAttributesEx (fileName, GetFileExInfoStandard, &attributes)) { - return inputChannelNames; + modificationTime = fileTimeToTime (&attributes.ftLastWriteTime); + creationTime = fileTimeToTime (&attributes.ftCreationTime); + accessTime = fileTimeToTime (&attributes.ftLastAccessTime); } - - int getNumSampleRates() + else { - return sampleRates.size(); + creationTime = accessTime = modificationTime = 0; } +} - double getSampleRate (int index) - { - return sampleRates [index]; - } +bool juce_setFileTimes (const String& fileName, + int64 modificationTime, + int64 accessTime, + int64 creationTime) throw() +{ + FILETIME m, a, c; - int getNumBufferSizesAvailable() - { - return bufferSizes.size(); - } + if (modificationTime > 0) + timeToFileTime (modificationTime, &m); - int getBufferSizeSamples (int index) - { - return bufferSizes [index]; - } + if (accessTime > 0) + timeToFileTime (accessTime, &a); - int getDefaultBufferSize() - { - return preferredSize; - } + if (creationTime > 0) + timeToFileTime (creationTime, &c); - const String open (const BitArray& inputChannels, - const BitArray& outputChannels, - double sr, - int bufferSizeSamples) + void* const h = juce_fileOpen (fileName, true); + bool ok = false; + + if (h != 0) { - close(); - currentCallback = 0; + ok = SetFileTime ((HANDLE) h, + (creationTime > 0) ? &c : 0, + (accessTime > 0) ? &a : 0, + (modificationTime > 0) ? &m : 0) != 0; + juce_fileClose (h); + } - if (bufferSizeSamples <= 0) - shouldUsePreferredSize = true; - - if (asioObject == 0 || ! isASIOOpen) - { - log ("Warning: device not open"); - const String err (openDevice()); - - if (asioObject == 0 || ! isASIOOpen) - return err; - } - - isStarted = false; - bufferIndex = -1; - long err = 0; - - long newPreferredSize = 0; - - // if the preferred size has just changed, assume it's a control panel thing and use it as the new value. - minSize = 0; - maxSize = 0; - newPreferredSize = 0; - granularity = 0; + return ok; +} - if (asioObject->getBufferSize (&minSize, &maxSize, &newPreferredSize, &granularity) == 0) - { - if (preferredSize != 0 && newPreferredSize != 0 && newPreferredSize != preferredSize) - shouldUsePreferredSize = true; +// return '\0' separated list of strings +const StringArray juce_getFileSystemRoots() throw() +{ + TCHAR buffer [2048]; + buffer[0] = 0; + buffer[1] = 0; + GetLogicalDriveStrings (2048, buffer); - preferredSize = newPreferredSize; - } + TCHAR* n = buffer; + StringArray roots; - // unfortunate workaround for certain manufacturers whose drivers crash horribly if you make - // dynamic changes to the buffer size... - shouldUsePreferredSize = shouldUsePreferredSize - || getName().containsIgnoreCase (T("Digidesign")); + while (*n != 0) + { + roots.add (String (n)); - if (shouldUsePreferredSize) + while (*n++ != 0) { - log ("Using preferred size for buffer.."); - - if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) - { - bufferSizeSamples = preferredSize; - } - else - { - bufferSizeSamples = 1024; - logError ("GetBufferSize1", err); - } - - shouldUsePreferredSize = false; } + } - int sampleRate = roundDoubleToInt (sr); - currentSampleRate = sampleRate; - currentBlockSizeSamples = bufferSizeSamples; - currentChansOut.clear(); - currentChansIn.clear(); - zeromem (inBuffers, sizeof (inBuffers)); - zeromem (outBuffers, sizeof (outBuffers)); + roots.sort (true); + return roots; +} - updateSampleRates(); +const String juce_getVolumeLabel (const String& filenameOnVolume, + int& volumeSerialNumber) throw() +{ + TCHAR n [4]; + n[0] = *(const TCHAR*) filenameOnVolume; + n[1] = L':'; + n[2] = L'\\'; + n[3] = 0; - if (sampleRate == 0 || (sampleRates.size() > 0 && ! sampleRates.contains (sampleRate))) - sampleRate = sampleRates[0]; + TCHAR dest [64]; + DWORD serialNum; - jassert (sampleRate != 0); - if (sampleRate == 0) - sampleRate = 44100; + if (! GetVolumeInformation (n, dest, 64, (DWORD*) &serialNum, 0, 0, 0, 0)) + { + dest[0] = 0; + serialNum = 0; + } - long numSources = 32; - ASIOClockSource clocks[32]; - zeromem (clocks, sizeof (clocks)); - asioObject->getClockSources (clocks, &numSources); - bool isSourceSet = false; + volumeSerialNumber = serialNum; + return String (dest); +} - // careful not to remove this loop because it does more than just logging! - int i; - for (i = 0; i < numSources; ++i) - { - String s ("clock: "); - s += clocks[i].name; +int64 File::getBytesFreeOnVolume() const throw() +{ + String fn (getFullPathName()); + if (fn[1] == T(':')) + fn = fn.substring (0, 2) + T("\\"); - if (clocks[i].isCurrentSource) - { - isSourceSet = true; - s << " (cur)"; - } + ULARGE_INTEGER spc; + ULARGE_INTEGER tot; + ULARGE_INTEGER totFree; - log (s); - } + if (GetDiskFreeSpaceEx (fn, &spc, &tot, &totFree)) + return (int64)(spc.QuadPart); - if (numSources > 1 && ! isSourceSet) - { - log ("setting clock source"); - asioObject->setClockSource (clocks[0].index); - Thread::sleep (20); - } - else - { - if (numSources == 0) - { - log ("ASIO - no clock sources!"); - } - } + return 0; +} - double cr = 0; - err = asioObject->getSampleRate (&cr); - if (err == 0) - { - currentSampleRate = cr; - } - else - { - logError ("GetSampleRate", err); - currentSampleRate = 0; - } +static unsigned int getWindowsDriveType (const String& fileName) throw() +{ + TCHAR n[4]; + n[0] = *(const TCHAR*) fileName; + n[1] = L':'; + n[2] = L'\\'; + n[3] = 0; - error = String::empty; - needToReset = false; - isReSync = false; - err = 0; - bool buffersCreated = false; + return GetDriveType (n); +} - if (currentSampleRate != sampleRate) - { - log (T("ASIO samplerate: ") + String (currentSampleRate) + T(" to ") + String (sampleRate)); - err = asioObject->setSampleRate (sampleRate); +bool File::isOnCDRomDrive() const throw() +{ + return getWindowsDriveType (getFullPathName()) == DRIVE_CDROM; +} - if (err == ASE_NoClock && numSources > 0) - { - log ("trying to set a clock source.."); - Thread::sleep (10); - err = asioObject->setClockSource (clocks[0].index); - if (err != 0) - { - logError ("SetClock", err); - } +bool File::isOnHardDisk() const throw() +{ + if (fullPath.isEmpty()) + return false; - Thread::sleep (10); - err = asioObject->setSampleRate (sampleRate); - } - } + const unsigned int n = getWindowsDriveType (getFullPathName()); - if (err == 0) - { - currentSampleRate = sampleRate; + if (fullPath.toLowerCase()[0] <= 'b' + && fullPath[1] == T(':')) + { + return n != DRIVE_REMOVABLE; + } + else + { + return n != DRIVE_CDROM && n != DRIVE_REMOTE; + } +} - if (needToReset) - { - if (isReSync) - { - log ("Resync request"); - } +bool File::isOnRemovableDrive() const throw() +{ + if (fullPath.isEmpty()) + return false; - log ("! Resetting ASIO after sample rate change"); - removeCurrentDriver(); + const unsigned int n = getWindowsDriveType (getFullPathName()); - loadDriver(); - const String error (initDriver()); + return n == DRIVE_CDROM + || n == DRIVE_REMOTE + || n == DRIVE_REMOVABLE + || n == DRIVE_RAMDISK; +} - if (error.isNotEmpty()) - { - log (T("ASIOInit: ") + error); - } +#define MAX_PATH_CHARS (MAX_PATH + 256) - needToReset = false; - isReSync = false; - } +static const File juce_getSpecialFolderPath (int type) throw() +{ + WCHAR path [MAX_PATH_CHARS]; - numActiveInputChans = 0; - numActiveOutputChans = 0; + if (SHGetSpecialFolderPath (0, path, type, 0)) + return File (String (path)); - ASIOBufferInfo* info = bufferInfos; - int i; - for (i = 0; i < totalNumInputChans; ++i) - { - if (inputChannels[i]) - { - currentChansIn.setBit (i); - info->isInput = 1; - info->channelNum = i; - info->buffers[0] = info->buffers[1] = 0; - ++info; - ++numActiveInputChans; - } - } + return File::nonexistent; +} - for (i = 0; i < totalNumOutputChans; ++i) - { - if (outputChannels[i]) - { - currentChansOut.setBit (i); - info->isInput = 0; - info->channelNum = i; - info->buffers[0] = info->buffers[1] = 0; - ++info; - ++numActiveOutputChans; - } - } +const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType type) +{ + int csidlType = 0; - const int totalBuffers = numActiveInputChans + numActiveOutputChans; + switch (type) + { + case userHomeDirectory: + case userDocumentsDirectory: + csidlType = CSIDL_PERSONAL; + break; - callbacks.sampleRateDidChange = &sampleRateChangedCallback; + case userDesktopDirectory: + csidlType = CSIDL_DESKTOP; + break; - if (currentASIODev[0] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback0; - callbacks.asioMessage = &asioMessagesCallback0; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback0; - } - else if (currentASIODev[1] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback1; - callbacks.asioMessage = &asioMessagesCallback1; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback1; - } - else if (currentASIODev[2] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback2; - callbacks.asioMessage = &asioMessagesCallback2; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback2; - } - else - { - jassertfalse - } + case userApplicationDataDirectory: + csidlType = CSIDL_APPDATA; + break; - log ("disposing buffers"); - err = asioObject->disposeBuffers(); + case commonApplicationDataDirectory: + csidlType = CSIDL_COMMON_APPDATA; + break; - log (T("creating buffers: ") + String (totalBuffers) + T(", ") + String (currentBlockSizeSamples)); - err = asioObject->createBuffers (bufferInfos, - totalBuffers, - currentBlockSizeSamples, - &callbacks); + case globalApplicationsDirectory: + csidlType = CSIDL_PROGRAM_FILES; + break; - if (err != 0) - { - currentBlockSizeSamples = preferredSize; - logError ("create buffers 2", err); + case userMusicDirectory: + csidlType = CSIDL_MYMUSIC; + break; - asioObject->disposeBuffers(); - err = asioObject->createBuffers (bufferInfos, - totalBuffers, - currentBlockSizeSamples, - &callbacks); - } + case userMoviesDirectory: + csidlType = CSIDL_MYVIDEO; + break; - if (err == 0) - { - buffersCreated = true; + case tempDirectory: + { + WCHAR dest [2048]; + dest[0] = 0; + GetTempPath (2048, dest); + return File (String (dest)); + } - juce_free (tempBuffer); + case currentExecutableFile: + case currentApplicationFile: + { + HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(); - tempBuffer = (float*) juce_calloc (totalBuffers * currentBlockSizeSamples * sizeof (float) + 128); + WCHAR dest [MAX_PATH_CHARS]; + dest[0] = 0; + GetModuleFileName (moduleHandle, dest, MAX_PATH_CHARS); + return File (String (dest)); + } + break; - int n = 0; - Array types; - currentBitDepth = 16; + default: + jassertfalse // unknown type? + return File::nonexistent; + } - for (i = 0; i < jmin (totalNumInputChans, maxASIOChannels); ++i) - { - if (inputChannels[i]) - { - inBuffers[n] = tempBuffer + (currentBlockSizeSamples * n); + return juce_getSpecialFolderPath (csidlType); +} - ASIOChannelInfo channelInfo; - zerostruct (channelInfo); +void juce_setCurrentExecutableFileName (const String&) throw() +{ + // n/a on windows +} - channelInfo.channel = i; - channelInfo.isInput = 1; - asioObject->getChannelInfo (&channelInfo); +const File File::getCurrentWorkingDirectory() throw() +{ + WCHAR dest [MAX_PATH_CHARS]; + dest[0] = 0; + GetCurrentDirectory (MAX_PATH_CHARS, dest); + return File (String (dest)); +} - types.addIfNotAlreadyThere (channelInfo.type); - typeToFormatParameters (channelInfo.type, - inputChannelBitDepths[n], - inputChannelBytesPerSample[n], - inputChannelIsFloat[n], - inputChannelLittleEndian[n]); +bool File::setAsCurrentWorkingDirectory() const throw() +{ + return SetCurrentDirectory (getFullPathName()) != FALSE; +} - currentBitDepth = jmax (currentBitDepth, inputChannelBitDepths[n]); +template +static void getFindFileInfo (FindDataType& findData, + String& filename, bool* const isDir, bool* const isHidden, + int64* const fileSize, Time* const modTime, Time* const creationTime, + bool* const isReadOnly) throw() +{ + filename = findData.cFileName; - ++n; - } - } + if (isDir != 0) + *isDir = ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0); - jassert (numActiveInputChans == n); - n = 0; + if (isHidden != 0) + *isHidden = ((findData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) != 0); - for (i = 0; i < jmin (totalNumOutputChans, maxASIOChannels); ++i) - { - if (outputChannels[i]) - { - outBuffers[n] = tempBuffer + (currentBlockSizeSamples * (numActiveInputChans + n)); + if (fileSize != 0) + *fileSize = findData.nFileSizeLow + (((int64) findData.nFileSizeHigh) << 32); - ASIOChannelInfo channelInfo; - zerostruct (channelInfo); + if (modTime != 0) + *modTime = fileTimeToTime (&findData.ftLastWriteTime); - channelInfo.channel = i; - channelInfo.isInput = 0; - asioObject->getChannelInfo (&channelInfo); + if (creationTime != 0) + *creationTime = fileTimeToTime (&findData.ftCreationTime); - types.addIfNotAlreadyThere (channelInfo.type); - typeToFormatParameters (channelInfo.type, - outputChannelBitDepths[n], - outputChannelBytesPerSample[n], - outputChannelIsFloat[n], - outputChannelLittleEndian[n]); + if (isReadOnly != 0) + *isReadOnly = ((findData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) != 0); - currentBitDepth = jmax (currentBitDepth, outputChannelBitDepths[n]); +} - ++n; - } - } +void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResult, + bool* isDir, bool* isHidden, int64* fileSize, + Time* modTime, Time* creationTime, bool* isReadOnly) throw() +{ + String wc (directory); - jassert (numActiveOutputChans == n); + if (! wc.endsWithChar (File::separator)) + wc += File::separator; - for (i = types.size(); --i >= 0;) - { - log (T("channel format: ") + String (types[i])); - } + wc += wildCard; - jassert (n <= totalBuffers); + WIN32_FIND_DATA findData; + HANDLE h = FindFirstFile (wc, &findData); - for (i = 0; i < numActiveOutputChans; ++i) - { - const int size = currentBlockSizeSamples * (outputChannelBitDepths[i] >> 3); + if (h != INVALID_HANDLE_VALUE) + { + getFindFileInfo (findData, firstResult, isDir, isHidden, fileSize, + modTime, creationTime, isReadOnly); + return h; + } - if (bufferInfos [numActiveInputChans + i].buffers[0] == 0 - || bufferInfos [numActiveInputChans + i].buffers[1] == 0) - { - log ("!! Null buffers"); - } - else - { - zeromem (bufferInfos[numActiveInputChans + i].buffers[0], size); - zeromem (bufferInfos[numActiveInputChans + i].buffers[1], size); - } - } + firstResult = String::empty; + return 0; +} - inputLatency = outputLatency = 0; +bool juce_findFileNext (void* handle, String& resultFile, + bool* isDir, bool* isHidden, int64* fileSize, + Time* modTime, Time* creationTime, bool* isReadOnly) throw() +{ + WIN32_FIND_DATA findData; - if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0) - { - log ("ASIO - no latencies"); - } - else - { - log (T("ASIO latencies: ") - + String ((int) outputLatency) - + T(", ") - + String ((int) inputLatency)); - } + if (handle != 0 && FindNextFile ((HANDLE) handle, &findData) != 0) + { + getFindFileInfo (findData, resultFile, isDir, isHidden, fileSize, + modTime, creationTime, isReadOnly); + return true; + } - isOpen_ = true; + resultFile = String::empty; + return false; +} - log ("starting ASIO"); - calledback = false; - err = asioObject->start(); +void juce_findFileClose (void* handle) throw() +{ + FindClose (handle); +} - if (err != 0) - { - isOpen_ = false; - log ("ASIO - stop on failure"); - Thread::sleep (10); - asioObject->stop(); - error = "Can't start device"; - Thread::sleep (10); - } - else - { - int count = 300; - while (--count > 0 && ! calledback) - Thread::sleep (10); +bool juce_launchFile (const String& fileName, + const String& parameters) throw() +{ + HINSTANCE hInstance = 0; - isStarted = true; + JUCE_TRY + { + hInstance = ShellExecute (0, 0, fileName, parameters, 0, SW_SHOWDEFAULT); + } + JUCE_CATCH_ALL - if (! calledback) - { - error = "Device didn't start correctly"; - log ("ASIO didn't callback - stopping.."); - asioObject->stop(); - } - } - } - else - { - error = "Can't create i/o buffers"; - } - } - else - { - error = "Can't set sample rate: "; - error << sampleRate; - } + return hInstance > (HINSTANCE) 32; +} - if (error.isNotEmpty()) - { - logError (error, err); +struct NamedPipeInternal +{ + HANDLE pipeH; + HANDLE cancelEvent; + bool connected, createdPipe; - if (asioObject != 0 && buffersCreated) - asioObject->disposeBuffers(); + NamedPipeInternal() + : pipeH (0), + cancelEvent (0), + connected (false), + createdPipe (false) + { + cancelEvent = CreateEvent (0, FALSE, FALSE, 0); + } - Thread::sleep (20); - isStarted = false; - isOpen_ = false; - close(); - } + ~NamedPipeInternal() + { + disconnect(); - needToReset = false; - isReSync = false; + if (pipeH != 0) + CloseHandle (pipeH); - return error; + CloseHandle (cancelEvent); } - void close() + bool connect (const int timeOutMs) { - error = String::empty; - stopTimer(); - stop(); + if (! createdPipe) + return true; - if (isASIOOpen && isOpen_) + if (! connected) { - const ScopedLock sl (callbackLock); - - isOpen_ = false; - isStarted = false; - needToReset = false; - isReSync = false; + OVERLAPPED over; + zerostruct (over); - log ("ASIO - stopping"); + over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - if (asioObject != 0) + if (ConnectNamedPipe (pipeH, &over)) { - Thread::sleep (20); - asioObject->stop(); - Thread::sleep (10); - asioObject->disposeBuffers(); + connected = false; // yes, you read that right. In overlapped mode it should always return 0. } + else + { + const int err = GetLastError(); - Thread::sleep (10); + if (err == ERROR_IO_PENDING || err == ERROR_PIPE_LISTENING) + { + HANDLE handles[] = { over.hEvent, cancelEvent }; + + if (WaitForMultipleObjects (2, handles, FALSE, + timeOutMs >= 0 ? timeOutMs : INFINITE) == WAIT_OBJECT_0) + connected = true; + } + else if (err == ERROR_PIPE_CONNECTED) + { + connected = true; + } + } + + CloseHandle (over.hEvent); } - } - bool isOpen() - { - return isOpen_ || insideControlPanelModalLoop; + return connected; } - int getCurrentBufferSizeSamples() + void disconnect() { - return currentBlockSizeSamples; + if (connected) + { + DisconnectNamedPipe (pipeH); + connected = false; + } } +}; - double getCurrentSampleRate() - { - return currentSampleRate; - } +void NamedPipe::close() +{ + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + delete intern; + internal = 0; +} - const BitArray getActiveOutputChannels() const - { - return currentChansOut; - } +bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) +{ + close(); - const BitArray getActiveInputChannels() const - { - return currentChansIn; - } + NamedPipeInternal* const intern = new NamedPipeInternal(); - int getCurrentBitDepth() - { - return currentBitDepth; - } + String file ("\\\\.\\pipe\\"); + file += pipeName; - int getOutputLatencyInSamples() - { - return outputLatency + currentBlockSizeSamples / 4; - } + intern->createdPipe = createPipe; - int getInputLatencyInSamples() + if (createPipe) { - return inputLatency + currentBlockSizeSamples / 4; + intern->pipeH = CreateNamedPipe (file, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, 0, + PIPE_UNLIMITED_INSTANCES, + 4096, 4096, 0, NULL); } - - void start (AudioIODeviceCallback* callback) + else { - if (callback != 0) - { - callback->audioDeviceAboutToStart (this); - - const ScopedLock sl (callbackLock); - currentCallback = callback; - } + intern->pipeH = CreateFile (file, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, 0); } - void stop() + if (intern->pipeH != INVALID_HANDLE_VALUE) { - AudioIODeviceCallback* const lastCallback = currentCallback; + internal = intern; + return true; + } - { - const ScopedLock sl (callbackLock); - currentCallback = 0; - } + delete intern; + return false; +} - if (lastCallback != 0) - lastCallback->audioDeviceStopped(); - } +int NamedPipe::read (void* destBuffer, int maxBytesToRead, int timeOutMilliseconds) +{ + int bytesRead = -1; + bool waitAgain = true; - bool isPlaying() + while (waitAgain && internal != 0) { - return isASIOOpen && (currentCallback != 0); - } + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; + waitAgain = false; - const String getLastError() - { - return error; - } + if (! intern->connect (timeOutMilliseconds)) + break; - bool hasControlPanel() const - { - return true; - } + if (maxBytesToRead <= 0) + return 0; - bool showControlPanel() - { - log ("ASIO - showing control panel"); + OVERLAPPED over; + zerostruct (over); + over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - Component modalWindow (String::empty); - modalWindow.setOpaque (true); - modalWindow.addToDesktop (0); - modalWindow.enterModalState(); - bool done = false; + unsigned long numRead; - JUCE_TRY + if (ReadFile (intern->pipeH, destBuffer, maxBytesToRead, &numRead, &over)) { - close(); - insideControlPanelModalLoop = true; - - const uint32 started = Time::getMillisecondCounter(); + bytesRead = (int) numRead; + } + else if (GetLastError() == ERROR_IO_PENDING) + { + HANDLE handles[] = { over.hEvent, intern->cancelEvent }; + DWORD waitResult = WaitForMultipleObjects (2, handles, FALSE, + timeOutMilliseconds >= 0 ? timeOutMilliseconds + : INFINITE); + if (waitResult != WAIT_OBJECT_0) + { + // if the operation timed out, let's cancel it... + CancelIo (intern->pipeH); + WaitForSingleObject (over.hEvent, INFINITE); // makes sure cancel is complete + } - if (asioObject != 0) + if (GetOverlappedResult (intern->pipeH, &over, &numRead, FALSE)) { - asioObject->controlPanel(); - - const int spent = (int) Time::getMillisecondCounter() - (int) started; - - log (T("spent: ") + String (spent)); - - if (spent > 300) - { - shouldUsePreferredSize = true; - done = true; - } + bytesRead = (int) numRead; + } + else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) + { + intern->disconnect(); + waitAgain = true; } } - JUCE_CATCH_ALL + else + { + waitAgain = internal != 0; + Sleep (5); + } - insideControlPanelModalLoop = false; - return done; + CloseHandle (over.hEvent); } - void resetRequest() throw() - { - needToReset = true; - } + return bytesRead; +} - void resyncRequest() throw() - { - needToReset = true; - isReSync = true; - } +int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) +{ + int bytesWritten = -1; + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - void timerCallback() + if (intern != 0 && intern->connect (timeOutMilliseconds)) { - if (! insideControlPanelModalLoop) - { - stopTimer(); + if (numBytesToWrite <= 0) + return 0; - // used to cause a reset - log ("! ASIO restart request!"); + OVERLAPPED over; + zerostruct (over); - if (isOpen_) - { - AudioIODeviceCallback* const oldCallback = currentCallback; + over.hEvent = CreateEvent (0, TRUE, FALSE, 0); - close(); - open (BitArray (currentChansIn), BitArray (currentChansOut), - currentSampleRate, currentBlockSizeSamples); + unsigned long numWritten; - if (oldCallback != 0) - start (oldCallback); - } + if (WriteFile (intern->pipeH, sourceBuffer, numBytesToWrite, &numWritten, &over)) + { + bytesWritten = (int) numWritten; } - else + else if (GetLastError() == ERROR_IO_PENDING) { - startTimer (100); + HANDLE handles[] = { over.hEvent, intern->cancelEvent }; + DWORD waitResult; + + waitResult = WaitForMultipleObjects (2, handles, FALSE, + timeOutMilliseconds >= 0 ? timeOutMilliseconds + : INFINITE); + + if (waitResult != WAIT_OBJECT_0) + { + CancelIo (intern->pipeH); + WaitForSingleObject (over.hEvent, INFINITE); + } + + if (GetOverlappedResult (intern->pipeH, &over, &numWritten, FALSE)) + { + bytesWritten = (int) numWritten; + } + else if (GetLastError() == ERROR_BROKEN_PIPE && intern->createdPipe) + { + intern->disconnect(); + } } + + CloseHandle (over.hEvent); } - juce_UseDebuggingNewOperator + return bytesWritten; +} -private: +void NamedPipe::cancelPendingReads() +{ + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - IASIO* volatile asioObject; - ASIOCallbacks callbacks; + if (intern != 0) + SetEvent (intern->cancelEvent); +} - void* windowHandle; - CLSID classId; - String error; +#endif +/********* End of inlined file: juce_win32_Files.cpp *********/ - long totalNumInputChans, totalNumOutputChans; - StringArray inputChannelNames, outputChannelNames; +/********* Start of inlined file: juce_win32_Network.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE - Array sampleRates, bufferSizes; - long inputLatency, outputLatency; - long minSize, maxSize, preferredSize, granularity; +#ifndef INTERNET_FLAG_NEED_FILE + #define INTERNET_FLAG_NEED_FILE 0x00000010 +#endif - int volatile currentBlockSizeSamples; - int volatile currentBitDepth; - double volatile currentSampleRate; - BitArray currentChansOut, currentChansIn; - AudioIODeviceCallback* volatile currentCallback; - CriticalSection callbackLock; +bool juce_isOnLine() +{ + DWORD connectionType; - ASIOBufferInfo bufferInfos [maxASIOChannels]; - float* inBuffers [maxASIOChannels]; - float* outBuffers [maxASIOChannels]; + return InternetGetConnectedState (&connectionType, 0) != 0 + || (connectionType & (INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_PROXY)) != 0; +} - int inputChannelBitDepths [maxASIOChannels]; - int outputChannelBitDepths [maxASIOChannels]; - int inputChannelBytesPerSample [maxASIOChannels]; - int outputChannelBytesPerSample [maxASIOChannels]; - bool inputChannelIsFloat [maxASIOChannels]; - bool outputChannelIsFloat [maxASIOChannels]; - bool inputChannelLittleEndian [maxASIOChannels]; - bool outputChannelLittleEndian [maxASIOChannels]; +struct ConnectionAndRequestStruct +{ + HINTERNET connection, request; +}; - WaitableEvent event1; - float* tempBuffer; - int volatile bufferIndex, numActiveInputChans, numActiveOutputChans; +static HINTERNET sessionHandle = 0; - bool isOpen_, isStarted; - bool volatile isASIOOpen; - bool volatile calledback; - bool volatile littleEndian, postOutput, needToReset, isReSync; - bool volatile insideControlPanelModalLoop; - bool volatile shouldUsePreferredSize; +void* juce_openInternetFile (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) +{ + if (sessionHandle == 0) + sessionHandle = InternetOpen (_T("juce"), + INTERNET_OPEN_TYPE_PRECONFIG, + 0, 0, 0); - void removeCurrentDriver() + if (sessionHandle != 0) { - if (asioObject != 0) - { - asioObject->Release(); - asioObject = 0; - } - } + // break up the url.. + TCHAR file[1024], server[1024]; - bool loadDriver() - { - removeCurrentDriver(); + URL_COMPONENTS uc; + zerostruct (uc); - JUCE_TRY + uc.dwStructSize = sizeof (uc); + uc.dwUrlPathLength = sizeof (file); + uc.dwHostNameLength = sizeof (server); + uc.lpszUrlPath = file; + uc.lpszHostName = server; + + if (InternetCrackUrl (url, 0, 0, &uc)) { - if (CoCreateInstance (classId, 0, CLSCTX_INPROC_SERVER, - classId, (void**) &asioObject) == S_OK) - { - return true; - } - } - JUCE_CATCH_ALL + if (timeOutMs == 0) + timeOutMs = 30000; + else if (timeOutMs < 0) + timeOutMs = -1; - asioObject = 0; + InternetSetOption (sessionHandle, INTERNET_OPTION_CONNECT_TIMEOUT, &timeOutMs, sizeof (timeOutMs)); - return false; - } + const bool isFtp = url.startsWithIgnoreCase (T("ftp:")); - const String initDriver() - { - if (asioObject != 0) - { - char buffer [256]; - zeromem (buffer, sizeof (buffer)); + HINTERNET connection = InternetConnect (sessionHandle, + uc.lpszHostName, + uc.nPort, + _T(""), _T(""), + isFtp ? INTERNET_SERVICE_FTP + : INTERNET_SERVICE_HTTP, + 0, 0); - if (! asioObject->init (windowHandle)) + if (connection != 0) { - asioObject->getErrorMessage (buffer); - return String (buffer, sizeof (buffer) - 1); - } + if (isFtp) + { + HINTERNET request = FtpOpenFile (connection, + uc.lpszUrlPath, + GENERIC_READ, + FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_NEED_FILE, + 0); - // just in case any daft drivers expect this to be called.. - asioObject->getDriverName (buffer); + ConnectionAndRequestStruct* const result = new ConnectionAndRequestStruct(); + result->connection = connection; + result->request = request; + return result; + } + else + { + const TCHAR* mimeTypes[] = { _T("*/*"), 0 }; - return String::empty; - } + DWORD flags = INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_CACHE_WRITE; - return "No Driver"; - } + if (url.startsWithIgnoreCase (T("https:"))) + flags |= INTERNET_FLAG_SECURE; // (this flag only seems necessary if the OS is running IE6 - + // IE7 seems to automatically work out when it's https) - const String openDevice() - { - // use this in case the driver starts opening dialog boxes.. - Component modalWindow (String::empty); - modalWindow.setOpaque (true); - modalWindow.addToDesktop (0); - modalWindow.enterModalState(); + HINTERNET request = HttpOpenRequest (connection, + isPost ? _T("POST") + : _T("GET"), + uc.lpszUrlPath, + 0, 0, mimeTypes, flags, 0); - // open the device and get its info.. - log (T("opening ASIO device: ") + getName()); + if (request != 0) + { + INTERNET_BUFFERS buffers; + zerostruct (buffers); + buffers.dwStructSize = sizeof (INTERNET_BUFFERS); + buffers.lpcszHeader = (LPCTSTR) headers; + buffers.dwHeadersLength = headers.length(); + buffers.dwBufferTotal = (DWORD) postData.getSize(); + ConnectionAndRequestStruct* result = 0; - needToReset = false; - isReSync = false; - outputChannelNames.clear(); - inputChannelNames.clear(); - bufferSizes.clear(); - sampleRates.clear(); - isASIOOpen = false; - isOpen_ = false; - totalNumInputChans = 0; - totalNumOutputChans = 0; - numActiveInputChans = 0; - numActiveOutputChans = 0; - currentCallback = 0; - - error = String::empty; - - if (getName().isEmpty()) - return error; - - long err = 0; + if (HttpSendRequestEx (request, &buffers, 0, HSR_INITIATE, 0)) + { + int bytesSent = 0; - if (loadDriver()) - { - if ((error = initDriver()).isEmpty()) - { - numActiveInputChans = 0; - numActiveOutputChans = 0; - totalNumInputChans = 0; - totalNumOutputChans = 0; + for (;;) + { + const int bytesToDo = jmin (1024, postData.getSize() - bytesSent); + DWORD bytesDone = 0; - if (asioObject != 0 - && (err = asioObject->getChannels (&totalNumInputChans, &totalNumOutputChans)) == 0) - { - log (String ((int) totalNumInputChans) + T(" in, ") + String ((int) totalNumOutputChans) + T(" out")); + if (bytesToDo > 0 + && ! InternetWriteFile (request, + ((const char*) postData.getData()) + bytesSent, + bytesToDo, &bytesDone)) + { + break; + } - if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) - { - // find a list of buffer sizes.. - log (String ((int) minSize) + T(" ") + String ((int) maxSize) + T(" ") + String ((int)preferredSize) + T(" ") + String ((int)granularity)); + if (bytesToDo == 0 || (int) bytesDone < bytesToDo) + { + result = new ConnectionAndRequestStruct(); + result->connection = connection; + result->request = request; - if (granularity >= 0) - { - granularity = jmax (1, (int) granularity); + HttpEndRequest (request, 0, 0, 0); + return result; + } - for (int i = jmax (minSize, (int) granularity); i < jmin (6400, maxSize); i += granularity) - bufferSizes.addIfNotAlreadyThere (granularity * (i / granularity)); - } - else if (granularity < 0) - { - for (int i = 0; i < 18; ++i) - { - const int s = (1 << i); + bytesSent += bytesDone; - if (s >= minSize && s <= maxSize) - bufferSizes.add (s); + if (callback != 0 && ! callback (callbackContext, bytesSent, postData.getSize())) + break; } } - if (! bufferSizes.contains (preferredSize)) - bufferSizes.insert (0, preferredSize); - - double currentRate = 0; - asioObject->getSampleRate (¤tRate); + InternetCloseHandle (request); + } - if (currentRate <= 0.0 || currentRate > 192001.0) - { - log ("setting sample rate"); - err = asioObject->setSampleRate (44100.0); - if (err != 0) - { - logError ("setting sample rate", err); - } + InternetCloseHandle (connection); + } + } + } + } - asioObject->getSampleRate (¤tRate); - } + return 0; +} - currentSampleRate = currentRate; +int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) +{ + DWORD bytesRead = 0; - postOutput = (asioObject->outputReady() == 0); - if (postOutput) - { - log ("ASIO outputReady = ok"); - } + const ConnectionAndRequestStruct* const crs = (const ConnectionAndRequestStruct*) handle; - updateSampleRates(); + if (crs != 0) + InternetReadFile (crs->request, + buffer, bytesToRead, + &bytesRead); - // ..because cubase does it at this point - inputLatency = outputLatency = 0; - if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0) - { - log ("ASIO - no latencies"); - } + return bytesRead; +} - log (String ("latencies: ") - + String ((int) inputLatency) - + T(", ") + String ((int) outputLatency)); +int juce_seekInInternetFile (void* handle, int newPosition) +{ + if (handle != 0) + { + const ConnectionAndRequestStruct* const crs = (const ConnectionAndRequestStruct*) handle; - // create some dummy buffers now.. because cubase does.. - numActiveInputChans = 0; - numActiveOutputChans = 0; + return InternetSetFilePointer (crs->request, + newPosition, 0, + FILE_BEGIN, 0); + } + else + { + return -1; + } +} - ASIOBufferInfo* info = bufferInfos; - int i, numChans = 0; - for (i = 0; i < jmin (2, totalNumInputChans); ++i) - { - info->isInput = 1; - info->channelNum = i; - info->buffers[0] = info->buffers[1] = 0; - ++info; - ++numChans; - } +void juce_closeInternetFile (void* handle) +{ + if (handle != 0) + { + ConnectionAndRequestStruct* const crs = (ConnectionAndRequestStruct*) handle; + InternetCloseHandle (crs->request); + InternetCloseHandle (crs->connection); + delete crs; + } +} - const int outputBufferIndex = numChans; +static int getMACAddressViaGetAdaptersInfo (int64* addresses, int maxNum, const bool littleEndian) throw() +{ + int numFound = 0; - for (i = 0; i < jmin (2, totalNumOutputChans); ++i) - { - info->isInput = 0; - info->channelNum = i; - info->buffers[0] = info->buffers[1] = 0; - ++info; - ++numChans; - } + DynamicLibraryLoader dll ("iphlpapi.dll"); + DynamicLibraryImport (GetAdaptersInfo, getAdaptersInfo, DWORD, dll, (PIP_ADAPTER_INFO, PULONG)) - callbacks.sampleRateDidChange = &sampleRateChangedCallback; + if (getAdaptersInfo != 0) + { + ULONG len = sizeof (IP_ADAPTER_INFO); + MemoryBlock mb; + PIP_ADAPTER_INFO adapterInfo = (PIP_ADAPTER_INFO) mb.getData(); - if (currentASIODev[0] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback0; - callbacks.asioMessage = &asioMessagesCallback0; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback0; - } - else if (currentASIODev[1] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback1; - callbacks.asioMessage = &asioMessagesCallback1; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback1; - } - else if (currentASIODev[2] == this) - { - callbacks.bufferSwitch = &bufferSwitchCallback2; - callbacks.asioMessage = &asioMessagesCallback2; - callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback2; - } - else - { - jassertfalse - } + if (getAdaptersInfo (adapterInfo, &len) == ERROR_BUFFER_OVERFLOW) + { + mb.setSize (len); + adapterInfo = (PIP_ADAPTER_INFO) mb.getData(); + } - log (T("creating buffers (dummy): ") + String (numChans) - + T(", ") + String ((int) preferredSize)); + if (getAdaptersInfo (adapterInfo, &len) == NO_ERROR) + { + PIP_ADAPTER_INFO adapter = adapterInfo; - if (preferredSize > 0) - { - err = asioObject->createBuffers (bufferInfos, numChans, preferredSize, &callbacks); - if (err != 0) - { - logError ("dummy buffers", err); - } - } + while (adapter != 0) + { + int64 mac = 0; + for (unsigned int i = 0; i < adapter->AddressLength; ++i) + mac = (mac << 8) | adapter->Address[i]; - long newInps = 0, newOuts = 0; - asioObject->getChannels (&newInps, &newOuts); + if (littleEndian) + mac = (int64) swapByteOrder ((uint64) mac); - if (totalNumInputChans != newInps || totalNumOutputChans != newOuts) - { - totalNumInputChans = newInps; - totalNumOutputChans = newOuts; + if (numFound < maxNum && mac != 0) + addresses [numFound++] = mac; - log (String ((int) totalNumInputChans) + T(" in; ") - + String ((int) totalNumOutputChans) + T(" out")); - } + adapter = adapter->Next; + } + } + } - updateSampleRates(); + return numFound; +} - ASIOChannelInfo channelInfo; - channelInfo.type = 0; +static int getMACAddressesViaNetBios (int64* addresses, int maxNum, const bool littleEndian) throw() +{ + int numFound = 0; - for (i = 0; i < totalNumInputChans; ++i) - { - zerostruct (channelInfo); - channelInfo.channel = i; - channelInfo.isInput = 1; - asioObject->getChannelInfo (&channelInfo); + DynamicLibraryLoader dll ("netapi32.dll"); + DynamicLibraryImport (Netbios, NetbiosCall, UCHAR, dll, (PNCB)) - inputChannelNames.add (String (channelInfo.name)); - } + if (NetbiosCall != 0) + { + NCB ncb; + zerostruct (ncb); - for (i = 0; i < totalNumOutputChans; ++i) - { - zerostruct (channelInfo); - channelInfo.channel = i; - channelInfo.isInput = 0; - asioObject->getChannelInfo (&channelInfo); + typedef struct _ASTAT_ + { + ADAPTER_STATUS adapt; + NAME_BUFFER NameBuff [30]; + } ASTAT; - outputChannelNames.add (String (channelInfo.name)); + ASTAT astat; + zerostruct (astat); - typeToFormatParameters (channelInfo.type, - outputChannelBitDepths[i], - outputChannelBytesPerSample[i], - outputChannelIsFloat[i], - outputChannelLittleEndian[i]); + LANA_ENUM enums; + zerostruct (enums); - if (i < 2) - { - // clear the channels that are used with the dummy stuff - const int bytesPerBuffer = preferredSize * (outputChannelBitDepths[i] >> 3); - zeromem (bufferInfos [outputBufferIndex + i].buffers[0], bytesPerBuffer); - zeromem (bufferInfos [outputBufferIndex + i].buffers[1], bytesPerBuffer); - } - } + ncb.ncb_command = NCBENUM; + ncb.ncb_buffer = (unsigned char*) &enums; + ncb.ncb_length = sizeof (LANA_ENUM); + NetbiosCall (&ncb); - outputChannelNames.trim(); - inputChannelNames.trim(); - outputChannelNames.appendNumbersToDuplicates (false, true); - inputChannelNames.appendNumbersToDuplicates (false, true); + for (int i = 0; i < enums.length; ++i) + { + zerostruct (ncb); + ncb.ncb_command = NCBRESET; + ncb.ncb_lana_num = enums.lana[i]; - // start and stop because cubase does it.. - asioObject->getLatencies (&inputLatency, &outputLatency); + if (NetbiosCall (&ncb) == 0) + { + zerostruct (ncb); + memcpy (ncb.ncb_callname, "* ", NCBNAMSZ); + ncb.ncb_command = NCBASTAT; + ncb.ncb_lana_num = enums.lana[i]; - if ((err = asioObject->start()) != 0) - { - // ignore an error here, as it might start later after setting other stuff up - logError ("ASIO start", err); - } + ncb.ncb_buffer = (unsigned char*) &astat; + ncb.ncb_length = sizeof (ASTAT); - Thread::sleep (100); - asioObject->stop(); - } - else + if (NetbiosCall (&ncb) == 0) + { + if (astat.adapt.adapter_type == 0xfe) { - error = "Can't detect buffer sizes"; + int64 mac = 0; + for (unsigned int i = 0; i < 6; ++i) + mac = (mac << 8) | astat.adapt.adapter_address[i]; + + if (littleEndian) + mac = (int64) swapByteOrder ((uint64) mac); + + if (numFound < maxNum && mac != 0) + addresses [numFound++] = mac; } } - else - { - error = "Can't detect asio channels"; - } } } - else - { - error = "No such device"; - } + } - if (error.isNotEmpty()) - { - logError (error, err); + return numFound; +} - if (asioObject != 0) - asioObject->disposeBuffers(); +int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() +{ + int numFound = getMACAddressViaGetAdaptersInfo (addresses, maxNum, littleEndian); - removeCurrentDriver(); - isASIOOpen = false; - } - else - { - isASIOOpen = true; - log ("ASIO device open"); - } + if (numFound == 0) + numFound = getMACAddressesViaNetBios (addresses, maxNum, littleEndian); - isOpen_ = false; - needToReset = false; - isReSync = false; + return numFound; +} - return error; - } +typedef ULONG (WINAPI *MAPISendMailType) (LHANDLE, ULONG, lpMapiMessage, ::FLAGS, ULONG); - void callback (const long index) throw() - { - if (isStarted) - { - bufferIndex = index; - processBuffer(); - } - else - { - if (postOutput && (asioObject != 0)) - asioObject->outputReady(); - } +bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, + const String& emailSubject, + const String& bodyText, + const StringArray& filesToAttach) +{ + HMODULE h = LoadLibraryA ("MAPI32.dll"); - calledback = true; - } + MAPISendMailType mapiSendMail = (MAPISendMailType) GetProcAddress (h, "MAPISendMail"); + bool ok = false; - void processBuffer() throw() + if (mapiSendMail != 0) { - const ASIOBufferInfo* const infos = bufferInfos; - const int bi = bufferIndex; + MapiMessage message; + zerostruct (message); + message.lpszSubject = (LPSTR) (LPCSTR) emailSubject; + message.lpszNoteText = (LPSTR) (LPCSTR) bodyText; - const ScopedLock sl (callbackLock); + MapiRecipDesc recip; + zerostruct (recip); + recip.ulRecipClass = MAPI_TO; + recip.lpszName = (LPSTR) (LPCSTR) targetEmailAddress; + message.nRecipCount = 1; + message.lpRecips = &recip; - if (needToReset) - { - needToReset = false; + MemoryBlock mb (sizeof (MapiFileDesc) * filesToAttach.size()); + mb.fillWith (0); + MapiFileDesc* files = (MapiFileDesc*) mb.getData(); - if (isReSync) - { - log ("! ASIO resync"); - isReSync = false; - } - else - { - startTimer (20); - } - } + message.nFileCount = filesToAttach.size(); + message.lpFiles = files; - if (bi >= 0) + for (int i = 0; i < filesToAttach.size(); ++i) { - const int samps = currentBlockSizeSamples; - - if (currentCallback != 0) - { - int i; - for (i = 0; i < numActiveInputChans; ++i) - { - float* const dst = inBuffers[i]; + files[i].nPosition = (ULONG) -1; + files[i].lpszPathName = (LPSTR) (LPCSTR) filesToAttach [i]; + } - jassert (dst != 0); + ok = (mapiSendMail (0, 0, &message, MAPI_DIALOG | MAPI_LOGON_UI, 0) == SUCCESS_SUCCESS); + } - const char* const src = (const char*) (infos[i].buffers[bi]); + FreeLibrary (h); + return ok; +} - if (inputChannelIsFloat[i]) - { - memcpy (dst, src, samps * sizeof (float)); - } - else - { - jassert (dst == tempBuffer + (samps * i)); +#endif +/********* End of inlined file: juce_win32_Network.cpp *********/ - switch (inputChannelBitDepths[i]) - { - case 16: - convertInt16ToFloat (src, dst, inputChannelBytesPerSample[i], - samps, inputChannelLittleEndian[i]); - break; +/********* Start of inlined file: juce_win32_PlatformUtils.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE - case 24: - convertInt24ToFloat (src, dst, inputChannelBytesPerSample[i], - samps, inputChannelLittleEndian[i]); - break; +static HKEY findKeyForPath (String name, + const bool createForWriting, + String& valueName) throw() +{ + HKEY rootKey = 0; - case 32: - convertInt32ToFloat (src, dst, inputChannelBytesPerSample[i], - samps, inputChannelLittleEndian[i]); - break; + if (name.startsWithIgnoreCase (T("HKEY_CURRENT_USER\\"))) + rootKey = HKEY_CURRENT_USER; + else if (name.startsWithIgnoreCase (T("HKEY_LOCAL_MACHINE\\"))) + rootKey = HKEY_LOCAL_MACHINE; + else if (name.startsWithIgnoreCase (T("HKEY_CLASSES_ROOT\\"))) + rootKey = HKEY_CLASSES_ROOT; - case 64: - jassertfalse - break; - } - } - } + if (rootKey != 0) + { + name = name.substring (name.indexOfChar (T('\\')) + 1); - currentCallback->audioDeviceIOCallback ((const float**) inBuffers, - numActiveInputChans, - outBuffers, - numActiveOutputChans, - samps); + const int lastSlash = name.lastIndexOfChar (T('\\')); + valueName = name.substring (lastSlash + 1); + name = name.substring (0, lastSlash); - for (i = 0; i < numActiveOutputChans; ++i) - { - float* const src = outBuffers[i]; + HKEY key; + DWORD result; - jassert (src != 0); + if (createForWriting) + { + if (RegCreateKeyEx (rootKey, name, 0, L"", REG_OPTION_NON_VOLATILE, + (KEY_WRITE | KEY_QUERY_VALUE), 0, &key, &result) == ERROR_SUCCESS) + return key; + } + else + { + if (RegOpenKeyEx (rootKey, name, 0, KEY_READ, &key) == ERROR_SUCCESS) + return key; + } + } - char* const dst = (char*) (infos [numActiveInputChans + i].buffers[bi]); + return 0; +} - if (outputChannelIsFloat[i]) - { - memcpy (dst, src, samps * sizeof (float)); - } - else - { - jassert (src == tempBuffer + (samps * (numActiveInputChans + i))); +const String PlatformUtilities::getRegistryValue (const String& regValuePath, + const String& defaultValue) +{ + String valueName, s; + HKEY k = findKeyForPath (regValuePath, false, valueName); - switch (outputChannelBitDepths[i]) - { - case 16: - convertFloatToInt16 (src, dst, outputChannelBytesPerSample[i], - samps, outputChannelLittleEndian[i]); - break; + if (k != 0) + { + WCHAR buffer [2048]; + unsigned long bufferSize = sizeof (buffer); + DWORD type = REG_SZ; - case 24: - convertFloatToInt24 (src, dst, outputChannelBytesPerSample[i], - samps, outputChannelLittleEndian[i]); - break; + if (RegQueryValueEx (k, valueName, 0, &type, (LPBYTE) buffer, &bufferSize) == ERROR_SUCCESS) + s = buffer; + else + s = defaultValue; - case 32: - convertFloatToInt32 (src, dst, outputChannelBytesPerSample[i], - samps, outputChannelLittleEndian[i]); - break; + RegCloseKey (k); + } - case 64: - jassertfalse - break; - } - } - } - } - else - { - for (int i = 0; i < numActiveOutputChans; ++i) - { - const int bytesPerBuffer = samps * (outputChannelBitDepths[i] >> 3); - zeromem (infos[numActiveInputChans + i].buffers[bi], bytesPerBuffer); - } - } - } + return s; +} - if (postOutput) - asioObject->outputReady(); - } +void PlatformUtilities::setRegistryValue (const String& regValuePath, + const String& value) +{ + String valueName; + HKEY k = findKeyForPath (regValuePath, true, valueName); - static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) throw() + if (k != 0) { - if (currentASIODev[0] != 0) - currentASIODev[0]->callback (index); + RegSetValueEx (k, valueName, 0, REG_SZ, + (const BYTE*) (const WCHAR*) value, + sizeof (WCHAR) * (value.length() + 1)); - return 0; + RegCloseKey (k); } +} - static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) throw() +bool PlatformUtilities::registryValueExists (const String& regValuePath) +{ + bool exists = false; + String valueName; + HKEY k = findKeyForPath (regValuePath, false, valueName); + + if (k != 0) { - if (currentASIODev[1] != 0) - currentASIODev[1]->callback (index); + unsigned char buffer [2048]; + unsigned long bufferSize = sizeof (buffer); + DWORD type = 0; - return 0; + if (RegQueryValueEx (k, valueName, 0, &type, buffer, &bufferSize) == ERROR_SUCCESS) + exists = true; + + RegCloseKey (k); } - static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) throw() - { - if (currentASIODev[2] != 0) - currentASIODev[2]->callback (index); + return exists; +} - return 0; - } +void PlatformUtilities::deleteRegistryValue (const String& regValuePath) +{ + String valueName; + HKEY k = findKeyForPath (regValuePath, true, valueName); - static void bufferSwitchCallback0 (long index, long) throw() + if (k != 0) { - if (currentASIODev[0] != 0) - currentASIODev[0]->callback (index); + RegDeleteValue (k, valueName); + RegCloseKey (k); } +} - static void bufferSwitchCallback1 (long index, long) throw() - { - if (currentASIODev[1] != 0) - currentASIODev[1]->callback (index); - } +void PlatformUtilities::deleteRegistryKey (const String& regKeyPath) +{ + String valueName; + HKEY k = findKeyForPath (regKeyPath, true, valueName); - static void bufferSwitchCallback2 (long index, long) throw() + if (k != 0) { - if (currentASIODev[2] != 0) - currentASIODev[2]->callback (index); + RegDeleteKey (k, valueName); + RegCloseKey (k); } +} - static long asioMessagesCallback0 (long selector, long value, void*, double*) throw() +bool juce_IsRunningInWine() throw() +{ + HKEY key; + if (RegOpenKeyEx (HKEY_CURRENT_USER, _T("Software\\Wine"), 0, KEY_READ, &key) == ERROR_SUCCESS) { - return asioMessagesCallback (selector, value, 0); + RegCloseKey (key); + return true; } - static long asioMessagesCallback1 (long selector, long value, void*, double*) throw() - { - return asioMessagesCallback (selector, value, 1); - } + return false; +} - static long asioMessagesCallback2 (long selector, long value, void*, double*) throw() - { - return asioMessagesCallback (selector, value, 2); - } +const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() throw() +{ + String s (::GetCommandLineW()); - static long asioMessagesCallback (long selector, long value, const int deviceIndex) throw() - { - switch (selector) - { - case kAsioSelectorSupported: - if (value == kAsioResetRequest - || value == kAsioEngineVersion - || value == kAsioResyncRequest - || value == kAsioLatenciesChanged - || value == kAsioSupportsInputMonitor) - return 1; - break; + StringArray tokens; + tokens.addTokens (s, true); // tokenise so that we can remove the initial filename argument - case kAsioBufferSizeChange: - break; + return tokens.joinIntoString (T(" "), 1); +} - case kAsioResetRequest: - if (currentASIODev[deviceIndex] != 0) - currentASIODev[deviceIndex]->resetRequest(); +static void* currentModuleHandle = 0; - return 1; +void* PlatformUtilities::getCurrentModuleInstanceHandle() throw() +{ + if (currentModuleHandle == 0) + currentModuleHandle = GetModuleHandle (0); - case kAsioResyncRequest: - if (currentASIODev[deviceIndex] != 0) - currentASIODev[deviceIndex]->resyncRequest(); + return currentModuleHandle; +} - return 1; +void PlatformUtilities::setCurrentModuleInstanceHandle (void* const newHandle) throw() +{ + currentModuleHandle = newHandle; +} - case kAsioLatenciesChanged: - return 1; +void PlatformUtilities::fpuReset() +{ +#if JUCE_MSVC + _clearfp(); +#endif +} - case kAsioEngineVersion: - return 2; +void PlatformUtilities::beep() +{ + MessageBeep (MB_OK); +} - case kAsioSupportsTimeInfo: - case kAsioSupportsTimeCode: - return 0; - } +#endif +/********* End of inlined file: juce_win32_PlatformUtils.cpp *********/ - return 0; - } +#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - static void sampleRateChangedCallback (ASIOSampleRate) throw() - { - } +/********* Start of inlined file: juce_win32_Messaging.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE - static void convertInt16ToFloat (const char* src, - float* dest, - const int srcStrideBytes, - int numSamples, - const bool littleEndian) throw() - { - const double g = 1.0 / 32768.0; +static const unsigned int specialId = WM_APP + 0x4400; +static const unsigned int broadcastId = WM_APP + 0x4403; +static const unsigned int specialCallbackId = WM_APP + 0x4402; - if (littleEndian) - { - while (--numSamples >= 0) - { - *dest++ = (float) (g * (short) littleEndianShort (src)); - src += srcStrideBytes; - } - } - else - { - while (--numSamples >= 0) - { - *dest++ = (float) (g * (short) bigEndianShort (src)); - src += srcStrideBytes; - } - } - } +static const TCHAR* const messageWindowName = _T("JUCEWindow"); - static void convertFloatToInt16 (const float* src, - char* dest, - const int dstStrideBytes, - int numSamples, - const bool littleEndian) throw() - { - const double maxVal = (double) 0x7fff; +HWND juce_messageWindowHandle = 0; - if (littleEndian) +extern long improbableWindowNumber; // defined in windowing.cpp + +static LRESULT CALLBACK juce_MessageWndProc (HWND h, + const UINT message, + const WPARAM wParam, + const LPARAM lParam) throw() +{ + JUCE_TRY + { + if (h == juce_messageWindowHandle) { - while (--numSamples >= 0) + if (message == specialCallbackId) { - *(uint16*) dest = swapIfBigEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); - dest += dstStrideBytes; + MessageCallbackFunction* const func = (MessageCallbackFunction*) wParam; + return (LRESULT) (*func) ((void*) lParam); } - } - else - { - while (--numSamples >= 0) + else if (message == specialId) { - *(uint16*) dest = swapIfLittleEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); - dest += dstStrideBytes; - } - } - } - - static void convertInt24ToFloat (const char* src, - float* dest, - const int srcStrideBytes, - int numSamples, - const bool littleEndian) throw() - { - const double g = 1.0 / 0x7fffff; + // these are trapped early in the dispatch call, but must also be checked + // here in case there are windows modal dialog boxes doing their own + // dispatch loop and not calling our version - if (littleEndian) - { - while (--numSamples >= 0) + MessageManager::getInstance()->deliverMessage ((void*) lParam); + return 0; + } + else if (message == broadcastId) { - *dest++ = (float) (g * littleEndian24Bit (src)); - src += srcStrideBytes; + String* const messageString = (String*) lParam; + MessageManager::getInstance()->deliverBroadcastMessage (*messageString); + delete messageString; + return 0; } - } - else - { - while (--numSamples >= 0) + else if (message == WM_COPYDATA && ((const COPYDATASTRUCT*) lParam)->dwData == broadcastId) { - *dest++ = (float) (g * bigEndian24Bit (src)); - src += srcStrideBytes; + const String messageString ((const juce_wchar*) ((const COPYDATASTRUCT*) lParam)->lpData, + ((const COPYDATASTRUCT*) lParam)->cbData / sizeof (juce_wchar)); + + PostMessage (juce_messageWindowHandle, broadcastId, 0, (LPARAM) new String (messageString)); + return 0; } } } + JUCE_CATCH_EXCEPTION - static void convertFloatToInt24 (const float* src, - char* dest, - const int dstStrideBytes, - int numSamples, - const bool littleEndian) throw() - { - const double maxVal = (double) 0x7fffff; + return DefWindowProc (h, message, wParam, lParam); +} - if (littleEndian) +bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages) +{ + MSG m; + + if (returnIfNoPendingMessages && ! PeekMessage (&m, (HWND) 0, 0, 0, 0)) + return false; + + if (GetMessage (&m, (HWND) 0, 0, 0) > 0) + { + if (m.message == specialId + && m.hwnd == juce_messageWindowHandle) { - while (--numSamples >= 0) - { - littleEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest); - dest += dstStrideBytes; - } + MessageManager::getInstance()->deliverMessage ((void*) m.lParam); } else { - while (--numSamples >= 0) + if (GetWindowLong (m.hwnd, GWLP_USERDATA) != improbableWindowNumber + && (m.message == WM_LBUTTONDOWN || m.message == WM_RBUTTONDOWN)) { - bigEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest); - dest += dstStrideBytes; + // if it's someone else's window being clicked on, and the focus is + // currently on a juce window, pass the kb focus over.. + HWND currentFocus = GetFocus(); + + if (currentFocus == 0 || GetWindowLong (currentFocus, GWLP_USERDATA) == improbableWindowNumber) + SetFocus (m.hwnd); } + + TranslateMessage (&m); + DispatchMessage (&m); } } - static void convertInt32ToFloat (const char* src, - float* dest, - const int srcStrideBytes, - int numSamples, - const bool littleEndian) throw() + return true; +} + +bool juce_postMessageToSystemQueue (void* message) +{ + return PostMessage (juce_messageWindowHandle, specialId, 0, (LPARAM) message) != 0; +} + +void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback, + void* userData) +{ + if (MessageManager::getInstance()->isThisTheMessageThread()) { - const double g = 1.0 / 0x7fffffff; + return (*callback) (userData); + } + else + { + // If a thread has a MessageManagerLock and then tries to call this method, it'll + // deadlock because the message manager is blocked from running, and can't + // call your function.. + jassert (! MessageManager::getInstance()->currentThreadHasLockedMessageManager()); - if (littleEndian) - { - while (--numSamples >= 0) - { - *dest++ = (float) (g * (int) littleEndianInt (src)); - src += srcStrideBytes; - } - } - else - { - while (--numSamples >= 0) - { - *dest++ = (float) (g * (int) bigEndianInt (src)); - src += srcStrideBytes; - } - } + return (void*) SendMessage (juce_messageWindowHandle, + specialCallbackId, + (WPARAM) callback, + (LPARAM) userData); } +} - static void convertFloatToInt32 (const float* src, - char* dest, - const int dstStrideBytes, - int numSamples, - const bool littleEndian) throw() +static BOOL CALLBACK BroadcastEnumWindowProc (HWND hwnd, LPARAM lParam) +{ + if (hwnd != juce_messageWindowHandle) + (reinterpret_cast (lParam))->add ((void*) hwnd); + + return TRUE; +} + +void MessageManager::broadcastMessage (const String& value) throw() +{ + VoidArray windows; + EnumWindows (&BroadcastEnumWindowProc, (LPARAM) &windows); + + const String localCopy (value); + + COPYDATASTRUCT data; + data.dwData = broadcastId; + data.cbData = (localCopy.length() + 1) * sizeof (juce_wchar); + data.lpData = (void*) (const juce_wchar*) localCopy; + + for (int i = windows.size(); --i >= 0;) { - const double maxVal = (double) 0x7fffffff; + HWND hwnd = (HWND) windows.getUnchecked(i); - if (littleEndian) - { - while (--numSamples >= 0) - { - *(uint32*) dest = swapIfBigEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); - dest += dstStrideBytes; - } - } - else + TCHAR windowName [64]; // no need to read longer strings than this + GetWindowText (hwnd, windowName, 64); + windowName [63] = 0; + + if (String (windowName) == String (messageWindowName)) { - while (--numSamples >= 0) - { - *(uint32*) dest = swapIfLittleEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); - dest += dstStrideBytes; - } + DWORD_PTR result; + SendMessageTimeout (hwnd, WM_COPYDATA, + (WPARAM) juce_messageWindowHandle, + (LPARAM) &data, + SMTO_BLOCK | SMTO_ABORTIFHUNG, + 8000, + &result); } } +} - static void typeToFormatParameters (const long type, - int& bitDepth, - int& byteStride, - bool& formatIsFloat, - bool& littleEndian) throw() - { - bitDepth = 0; - littleEndian = false; - formatIsFloat = false; +static const String getMessageWindowClassName() +{ + // this name has to be different for each app/dll instance because otherwise + // poor old Win32 can get a bit confused (even despite it not being a process-global + // window class). - switch (type) - { - case ASIOSTInt16MSB: - case ASIOSTInt16LSB: - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - bitDepth = 16; break; + static int number = 0; + if (number == 0) + number = 0x7fffffff & (int) Time::getHighResolutionTicks(); - case ASIOSTFloat32MSB: - case ASIOSTFloat32LSB: - formatIsFloat = true; - bitDepth = 32; break; + return T("JUCEcs_") + String (number); +} - case ASIOSTInt32MSB: - case ASIOSTInt32LSB: - bitDepth = 32; break; +void MessageManager::doPlatformSpecificInitialisation() +{ + OleInitialize (0); - case ASIOSTInt24MSB: - case ASIOSTInt24LSB: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB24: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - bitDepth = 24; break; + const String className (getMessageWindowClassName()); - case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: - default: - bitDepth = 64; - break; - } + HMODULE hmod = (HMODULE) PlatformUtilities::getCurrentModuleInstanceHandle(); - switch (type) + WNDCLASSEX wc; + zerostruct (wc); + + wc.cbSize = sizeof (wc); + wc.lpfnWndProc = (WNDPROC) juce_MessageWndProc; + wc.cbWndExtra = 4; + wc.hInstance = hmod; + wc.lpszClassName = className; + + RegisterClassEx (&wc); + + juce_messageWindowHandle = CreateWindow (wc.lpszClassName, + messageWindowName, + 0, 0, 0, 0, 0, 0, 0, + hmod, 0); +} + +void MessageManager::doPlatformSpecificShutdown() +{ + DestroyWindow (juce_messageWindowHandle); + UnregisterClass (getMessageWindowClassName(), 0); + OleUninitialize(); +} + +#endif +/********* End of inlined file: juce_win32_Messaging.cpp *********/ + +/********* Start of inlined file: juce_win32_Windowing.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +#undef GetSystemMetrics // multimon overrides this for some reason and causes a mess.. + +// these are in the windows SDK, but need to be repeated here for GCC.. +#ifndef GET_APPCOMMAND_LPARAM + #define FAPPCOMMAND_MASK 0xF000 + #define GET_APPCOMMAND_LPARAM(lParam) ((short) (HIWORD (lParam) & ~FAPPCOMMAND_MASK)) + #define APPCOMMAND_MEDIA_NEXTTRACK 11 + #define APPCOMMAND_MEDIA_PREVIOUSTRACK 12 + #define APPCOMMAND_MEDIA_STOP 13 + #define APPCOMMAND_MEDIA_PLAY_PAUSE 14 + #define WM_APPCOMMAND 0x0319 +#endif + +extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp +extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.cpp +extern bool juce_IsRunningInWine() throw(); + +#ifndef ULW_ALPHA + #define ULW_ALPHA 0x00000002 +#endif + +#ifndef AC_SRC_ALPHA + #define AC_SRC_ALPHA 0x01 +#endif + +#define DEBUG_REPAINT_TIMES 0 + +static HPALETTE palette = 0; +static bool createPaletteIfNeeded = true; +static bool shouldDeactivateTitleBar = true; +static bool screenSaverAllowed = true; + +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw(); +#define WM_TRAYNOTIFY WM_USER + 100 + +using ::abs; + +typedef BOOL (WINAPI* UpdateLayeredWinFunc) (HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD); +static UpdateLayeredWinFunc updateLayeredWindow = 0; + +bool Desktop::canUseSemiTransparentWindows() throw() +{ + if (updateLayeredWindow == 0) + { + if (! juce_IsRunningInWine()) { - case ASIOSTInt16MSB: - case ASIOSTInt32MSB16: - case ASIOSTFloat32MSB: - case ASIOSTFloat64MSB: - case ASIOSTInt32MSB: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt24MSB: - littleEndian = false; break; + HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); + updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow"); + } + } - case ASIOSTInt16LSB: - case ASIOSTInt32LSB16: - case ASIOSTFloat32LSB: - case ASIOSTFloat64LSB: - case ASIOSTInt32LSB: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: - case ASIOSTInt24LSB: - littleEndian = true; break; + return updateLayeredWindow != 0; +} - default: - break; +#undef DefWindowProc +#define DefWindowProc DefWindowProcW + +const int extendedKeyModifier = 0x10000; + +const int KeyPress::spaceKey = VK_SPACE; +const int KeyPress::returnKey = VK_RETURN; +const int KeyPress::escapeKey = VK_ESCAPE; +const int KeyPress::backspaceKey = VK_BACK; +const int KeyPress::deleteKey = VK_DELETE | extendedKeyModifier; +const int KeyPress::insertKey = VK_INSERT | extendedKeyModifier; +const int KeyPress::tabKey = VK_TAB; +const int KeyPress::leftKey = VK_LEFT | extendedKeyModifier; +const int KeyPress::rightKey = VK_RIGHT | extendedKeyModifier; +const int KeyPress::upKey = VK_UP | extendedKeyModifier; +const int KeyPress::downKey = VK_DOWN | extendedKeyModifier; +const int KeyPress::homeKey = VK_HOME | extendedKeyModifier; +const int KeyPress::endKey = VK_END | extendedKeyModifier; +const int KeyPress::pageUpKey = VK_PRIOR | extendedKeyModifier; +const int KeyPress::pageDownKey = VK_NEXT | extendedKeyModifier; +const int KeyPress::F1Key = VK_F1 | extendedKeyModifier; +const int KeyPress::F2Key = VK_F2 | extendedKeyModifier; +const int KeyPress::F3Key = VK_F3 | extendedKeyModifier; +const int KeyPress::F4Key = VK_F4 | extendedKeyModifier; +const int KeyPress::F5Key = VK_F5 | extendedKeyModifier; +const int KeyPress::F6Key = VK_F6 | extendedKeyModifier; +const int KeyPress::F7Key = VK_F7 | extendedKeyModifier; +const int KeyPress::F8Key = VK_F8 | extendedKeyModifier; +const int KeyPress::F9Key = VK_F9 | extendedKeyModifier; +const int KeyPress::F10Key = VK_F10 | extendedKeyModifier; +const int KeyPress::F11Key = VK_F11 | extendedKeyModifier; +const int KeyPress::F12Key = VK_F12 | extendedKeyModifier; +const int KeyPress::F13Key = VK_F13 | extendedKeyModifier; +const int KeyPress::F14Key = VK_F14 | extendedKeyModifier; +const int KeyPress::F15Key = VK_F15 | extendedKeyModifier; +const int KeyPress::F16Key = VK_F16 | extendedKeyModifier; +const int KeyPress::numberPad0 = VK_NUMPAD0 | extendedKeyModifier; +const int KeyPress::numberPad1 = VK_NUMPAD1 | extendedKeyModifier; +const int KeyPress::numberPad2 = VK_NUMPAD2 | extendedKeyModifier; +const int KeyPress::numberPad3 = VK_NUMPAD3 | extendedKeyModifier; +const int KeyPress::numberPad4 = VK_NUMPAD4 | extendedKeyModifier; +const int KeyPress::numberPad5 = VK_NUMPAD5 | extendedKeyModifier; +const int KeyPress::numberPad6 = VK_NUMPAD6 | extendedKeyModifier; +const int KeyPress::numberPad7 = VK_NUMPAD7 | extendedKeyModifier; +const int KeyPress::numberPad8 = VK_NUMPAD8 | extendedKeyModifier; +const int KeyPress::numberPad9 = VK_NUMPAD9 | extendedKeyModifier; +const int KeyPress::numberPadAdd = VK_ADD | extendedKeyModifier; +const int KeyPress::numberPadSubtract = VK_SUBTRACT | extendedKeyModifier; +const int KeyPress::numberPadMultiply = VK_MULTIPLY | extendedKeyModifier; +const int KeyPress::numberPadDivide = VK_DIVIDE | extendedKeyModifier; +const int KeyPress::numberPadSeparator = VK_SEPARATOR | extendedKeyModifier; +const int KeyPress::numberPadDecimalPoint = VK_DECIMAL | extendedKeyModifier; +const int KeyPress::numberPadEquals = 0x92 /*VK_OEM_NEC_EQUAL*/ | extendedKeyModifier; +const int KeyPress::numberPadDelete = VK_DELETE | extendedKeyModifier; +const int KeyPress::playKey = 0x30000; +const int KeyPress::stopKey = 0x30001; +const int KeyPress::fastForwardKey = 0x30002; +const int KeyPress::rewindKey = 0x30003; + +class WindowsBitmapImage : public Image +{ +public: + + HBITMAP hBitmap; + BITMAPV4HEADER bitmapInfo; + HDC hdc; + unsigned char* bitmapData; + + WindowsBitmapImage (const PixelFormat format_, + const int w, const int h, const bool clearImage) + : Image (format_, w, h) + { + jassert (format_ == RGB || format_ == ARGB); + + pixelStride = (format_ == RGB) ? 3 : 4; + + zerostruct (bitmapInfo); + bitmapInfo.bV4Size = sizeof (BITMAPV4HEADER); + bitmapInfo.bV4Width = w; + bitmapInfo.bV4Height = h; + bitmapInfo.bV4Planes = 1; + bitmapInfo.bV4CSType = 1; + bitmapInfo.bV4BitCount = (unsigned short) (pixelStride * 8); + + if (format_ == ARGB) + { + bitmapInfo.bV4AlphaMask = 0xff000000; + bitmapInfo.bV4RedMask = 0xff0000; + bitmapInfo.bV4GreenMask = 0xff00; + bitmapInfo.bV4BlueMask = 0xff; + bitmapInfo.bV4V4Compression = BI_BITFIELDS; + } + else + { + bitmapInfo.bV4V4Compression = BI_RGB; } - switch (type) + lineStride = -((w * pixelStride + 3) & ~3); + + HDC dc = GetDC (0); + hdc = CreateCompatibleDC (dc); + ReleaseDC (0, dc); + + SetMapMode (hdc, MM_TEXT); + + hBitmap = CreateDIBSection (hdc, + (BITMAPINFO*) &(bitmapInfo), + DIB_RGB_COLORS, + (void**) &bitmapData, + 0, 0); + + SelectObject (hdc, hBitmap); + + if (format_ == ARGB && clearImage) + zeromem (bitmapData, abs (h * lineStride)); + + imageData = bitmapData - (lineStride * (h - 1)); + } + + ~WindowsBitmapImage() + { + DeleteDC (hdc); + DeleteObject (hBitmap); + imageData = 0; // to stop the base class freeing this + } + + void blitToWindow (HWND hwnd, HDC dc, const bool transparent, + const int x, const int y, + const RectangleList& maskedRegion) throw() + { + static HDRAWDIB hdd = 0; + static bool needToCreateDrawDib = true; + + if (needToCreateDrawDib) { - case ASIOSTInt16LSB: - case ASIOSTInt16MSB: - byteStride = 2; break; + needToCreateDrawDib = false; - case ASIOSTInt24LSB: - case ASIOSTInt24MSB: - byteStride = 3; break; + HDC dc = GetDC (0); + const int n = GetDeviceCaps (dc, BITSPIXEL); + ReleaseDC (0, dc); - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - case ASIOSTInt32MSB: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: - case ASIOSTFloat32LSB: - case ASIOSTFloat32MSB: - byteStride = 4; break; + // only open if we're not palettised + if (n > 8) + hdd = DrawDibOpen(); + } - case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: - byteStride = 8; break; + if (createPaletteIfNeeded) + { + HDC dc = GetDC (0); + const int n = GetDeviceCaps (dc, BITSPIXEL); + ReleaseDC (0, dc); - default: - break; + if (n <= 8) + palette = CreateHalftonePalette (dc); + + createPaletteIfNeeded = false; + } + + if (palette != 0) + { + SelectPalette (dc, palette, FALSE); + RealizePalette (dc); + SetStretchBltMode (dc, HALFTONE); + } + + SetMapMode (dc, MM_TEXT); + + if (transparent) + { + POINT p, pos; + SIZE size; + + RECT windowBounds; + GetWindowRect (hwnd, &windowBounds); + + p.x = -x; + p.y = -y; + pos.x = windowBounds.left; + pos.y = windowBounds.top; + size.cx = windowBounds.right - windowBounds.left; + size.cy = windowBounds.bottom - windowBounds.top; + + BLENDFUNCTION bf; + bf.AlphaFormat = AC_SRC_ALPHA; + bf.BlendFlags = 0; + bf.BlendOp = AC_SRC_OVER; + bf.SourceConstantAlpha = 0xff; + + if (! maskedRegion.isEmpty()) + { + for (RectangleList::Iterator i (maskedRegion); i.next();) + { + const Rectangle& r = *i.getRectangle(); + ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom()); + } + } + + updateLayeredWindow (hwnd, 0, &pos, &size, hdc, &p, 0, &bf, ULW_ALPHA); + } + else + { + int savedDC = 0; + + if (! maskedRegion.isEmpty()) + { + savedDC = SaveDC (dc); + + for (RectangleList::Iterator i (maskedRegion); i.next();) + { + const Rectangle& r = *i.getRectangle(); + ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom()); + } + } + + const int w = getWidth(); + const int h = getHeight(); + + if (hdd == 0) + { + StretchDIBits (dc, + x, y, w, h, + 0, 0, w, h, + bitmapData, (const BITMAPINFO*) &bitmapInfo, + DIB_RGB_COLORS, SRCCOPY); + } + else + { + DrawDibDraw (hdd, dc, x, y, -1, -1, + (BITMAPINFOHEADER*) &bitmapInfo, bitmapData, + 0, 0, w, h, 0); + } + + if (! maskedRegion.isEmpty()) + RestoreDC (dc, savedDC); } } + + juce_UseDebuggingNewOperator + +private: + WindowsBitmapImage (const WindowsBitmapImage&); + const WindowsBitmapImage& operator= (const WindowsBitmapImage&); }; -class ASIOAudioIODeviceType : public AudioIODeviceType +long improbableWindowNumber = 0xf965aa01; // also referenced by messaging.cpp + +static int currentModifiers = 0; +static int modifiersAtLastCallback = 0; + +static void updateKeyModifiers() throw() +{ + currentModifiers &= ~(ModifierKeys::shiftModifier + | ModifierKeys::ctrlModifier + | ModifierKeys::altModifier); + + if ((GetKeyState (VK_SHIFT) & 0x8000) != 0) + currentModifiers |= ModifierKeys::shiftModifier; + + if ((GetKeyState (VK_CONTROL) & 0x8000) != 0) + currentModifiers |= ModifierKeys::ctrlModifier; + + if ((GetKeyState (VK_MENU) & 0x8000) != 0) + currentModifiers |= ModifierKeys::altModifier; + + if ((GetKeyState (VK_RMENU) & 0x8000) != 0) + currentModifiers &= ~(ModifierKeys::ctrlModifier | ModifierKeys::altModifier); +} + +void ModifierKeys::updateCurrentModifiers() throw() +{ + currentModifierFlags = currentModifiers; +} + +bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +{ + SHORT k = (SHORT) keyCode; + + if ((keyCode & extendedKeyModifier) == 0 + && (k >= (SHORT) T('a') && k <= (SHORT) T('z'))) + k += (SHORT) T('A') - (SHORT) T('a'); + + const SHORT translatedValues[] = { (SHORT) ',', VK_OEM_COMMA, + (SHORT) '+', VK_OEM_PLUS, + (SHORT) '-', VK_OEM_MINUS, + (SHORT) '.', VK_OEM_PERIOD, + (SHORT) ';', VK_OEM_1, + (SHORT) ':', VK_OEM_1, + (SHORT) '/', VK_OEM_2, + (SHORT) '?', VK_OEM_2, + (SHORT) '[', VK_OEM_4, + (SHORT) ']', VK_OEM_6 }; + + for (int i = 0; i < numElementsInArray (translatedValues); i += 2) + if (k == translatedValues [i]) + k = translatedValues [i + 1]; + + return (GetKeyState (k) & 0x8000) != 0; +} + +const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() +{ + updateKeyModifiers(); + + currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + + if ((GetKeyState (VK_LBUTTON) & 0x8000) != 0) + currentModifiers |= ModifierKeys::leftButtonModifier; + + if ((GetKeyState (VK_RBUTTON) & 0x8000) != 0) + currentModifiers |= ModifierKeys::rightButtonModifier; + + if ((GetKeyState (VK_MBUTTON) & 0x8000) != 0) + currentModifiers |= ModifierKeys::middleButtonModifier; + + return ModifierKeys (currentModifiers); +} + +static int64 getMouseEventTime() throw() +{ + static int64 eventTimeOffset = 0; + static DWORD lastMessageTime = 0; + const DWORD thisMessageTime = GetMessageTime(); + + if (thisMessageTime < lastMessageTime || lastMessageTime == 0) + { + lastMessageTime = thisMessageTime; + eventTimeOffset = Time::currentTimeMillis() - thisMessageTime; + } + + return eventTimeOffset + thisMessageTime; +} + +class Win32ComponentPeer : public ComponentPeer { public: - ASIOAudioIODeviceType() - : AudioIODeviceType (T("ASIO")), - classIds (2), - hasScanned (false) + + Win32ComponentPeer (Component* const component, + const int windowStyleFlags) + : ComponentPeer (component, windowStyleFlags), + dontRepaint (false), + fullScreen (false), + isDragging (false), + isMouseOver (false), + hasCreatedCaret (false), + currentWindowIcon (0), + taskBarIcon (0), + dropTarget (0) { - CoInitialize (0); + MessageManager::getInstance() + ->callFunctionOnMessageThread (&createWindowCallback, (void*) this); + + setTitle (component->getName()); + + if ((windowStyleFlags & windowHasDropShadow) != 0 + && Desktop::canUseSemiTransparentWindows()) + { + shadower = component->getLookAndFeel().createDropShadowerForComponent (component); + + if (shadower != 0) + shadower->setOwner (component); + } + else + { + shadower = 0; + } } - ~ASIOAudioIODeviceType() + ~Win32ComponentPeer() { + setTaskBarIcon (0); + deleteAndZero (shadower); + + // do this before the next bit to avoid messages arriving for this window + // before it's destroyed + SetWindowLongPtr (hwnd, GWLP_USERDATA, 0); + + MessageManager::getInstance() + ->callFunctionOnMessageThread (&destroyWindowCallback, (void*) hwnd); + + if (currentWindowIcon != 0) + DestroyIcon (currentWindowIcon); + + if (dropTarget != 0) + { + dropTarget->Release(); + dropTarget = 0; + } } - void scanForDevices() + void* getNativeHandle() const { - hasScanned = true; + return (void*) hwnd; + } - deviceNames.clear(); - classIds.clear(); + void setVisible (bool shouldBeVisible) + { + ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); - HKEY hk = 0; - int index = 0; + if (shouldBeVisible) + InvalidateRect (hwnd, 0, 0); + else + lastPaintTime = 0; + } - if (RegOpenKeyA (HKEY_LOCAL_MACHINE, "software\\asio", &hk) == ERROR_SUCCESS) + void setTitle (const String& title) + { + SetWindowText (hwnd, title); + } + + void setPosition (int x, int y) + { + offsetWithinParent (x, y); + SetWindowPos (hwnd, 0, + x - windowBorder.getLeft(), + y - windowBorder.getTop(), + 0, 0, + SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); + } + + void repaintNowIfTransparent() + { + if (isTransparent() && lastPaintTime > 0 && Time::getMillisecondCounter() > lastPaintTime + 30) + handlePaintMessage(); + } + + void updateBorderSize() + { + WINDOWINFO info; + info.cbSize = sizeof (info); + + if (GetWindowInfo (hwnd, &info)) { - for (;;) + windowBorder = BorderSize (info.rcClient.top - info.rcWindow.top, + info.rcClient.left - info.rcWindow.left, + info.rcWindow.bottom - info.rcClient.bottom, + info.rcWindow.right - info.rcClient.right); + } + } + + void setSize (int w, int h) + { + SetWindowPos (hwnd, 0, 0, 0, + w + windowBorder.getLeftAndRight(), + h + windowBorder.getTopAndBottom(), + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); + + updateBorderSize(); + + repaintNowIfTransparent(); + } + + void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) + { + fullScreen = isNowFullScreen; + offsetWithinParent (x, y); + + SetWindowPos (hwnd, 0, + x - windowBorder.getLeft(), + y - windowBorder.getTop(), + w + windowBorder.getLeftAndRight(), + h + windowBorder.getTopAndBottom(), + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); + + updateBorderSize(); + + repaintNowIfTransparent(); + } + + void getBounds (int& x, int& y, int& w, int& h) const + { + RECT r; + GetWindowRect (hwnd, &r); + + x = r.left; + y = r.top; + w = r.right - x; + h = r.bottom - y; + + HWND parentH = GetParent (hwnd); + if (parentH != 0) + { + GetWindowRect (parentH, &r); + x -= r.left; + y -= r.top; + } + + x += windowBorder.getLeft(); + y += windowBorder.getTop(); + w -= windowBorder.getLeftAndRight(); + h -= windowBorder.getTopAndBottom(); + } + + int getScreenX() const + { + RECT r; + GetWindowRect (hwnd, &r); + return r.left + windowBorder.getLeft(); + } + + int getScreenY() const + { + RECT r; + GetWindowRect (hwnd, &r); + return r.top + windowBorder.getTop(); + } + + void relativePositionToGlobal (int& x, int& y) + { + RECT r; + GetWindowRect (hwnd, &r); + + x += r.left + windowBorder.getLeft(); + y += r.top + windowBorder.getTop(); + } + + void globalPositionToRelative (int& x, int& y) + { + RECT r; + GetWindowRect (hwnd, &r); + + x -= r.left + windowBorder.getLeft(); + y -= r.top + windowBorder.getTop(); + } + + void setMinimised (bool shouldBeMinimised) + { + if (shouldBeMinimised != isMinimised()) + ShowWindow (hwnd, shouldBeMinimised ? SW_MINIMIZE : SW_SHOWNORMAL); + } + + bool isMinimised() const + { + WINDOWPLACEMENT wp; + wp.length = sizeof (WINDOWPLACEMENT); + GetWindowPlacement (hwnd, &wp); + + return wp.showCmd == SW_SHOWMINIMIZED; + } + + void setFullScreen (bool shouldBeFullScreen) + { + setMinimised (false); + + if (fullScreen != shouldBeFullScreen) + { + fullScreen = shouldBeFullScreen; + const ComponentDeletionWatcher deletionChecker (component); + + if (! fullScreen) { - char name [256]; + const Rectangle boundsCopy (lastNonFullscreenBounds); - if (RegEnumKeyA (hk, index++, name, 256) == ERROR_SUCCESS) + if (hasTitleBar()) + ShowWindow (hwnd, SW_SHOWNORMAL); + + if (! boundsCopy.isEmpty()) { - addDriverInfo (name, hk); + setBounds (boundsCopy.getX(), + boundsCopy.getY(), + boundsCopy.getWidth(), + boundsCopy.getHeight(), + false); } + } + else + { + if (hasTitleBar()) + ShowWindow (hwnd, SW_SHOWMAXIMIZED); else - { - break; - } + SendMessageW (hwnd, WM_SETTINGCHANGE, 0, 0); } - RegCloseKey (hk); + if (! deletionChecker.hasBeenDeleted()) + handleMovedOrResized(); } } - const StringArray getDeviceNames (const bool /*wantInputNames*/) const + bool isFullScreen() const { - jassert (hasScanned); // need to call scanForDevices() before doing this + if (! hasTitleBar()) + return fullScreen; - return deviceNames; + WINDOWPLACEMENT wp; + wp.length = sizeof (wp); + GetWindowPlacement (hwnd, &wp); + + return wp.showCmd == SW_SHOWMAXIMIZED; } - int getDefaultDeviceIndex (const bool) const + bool contains (int x, int y, bool trueIfInAChildWindow) const { - jassert (hasScanned); // need to call scanForDevices() before doing this + RECT r; + GetWindowRect (hwnd, &r); - for (int i = deviceNames.size(); --i >= 0;) - if (deviceNames[i].containsIgnoreCase (T("asio4all"))) - return i; // asio4all is a safe choice for a default.. + POINT p; + p.x = x + r.left + windowBorder.getLeft(); + p.y = y + r.top + windowBorder.getTop(); -#if JUCE_DEBUG - if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase (T("digidesign"))) - return 1; // (the digi m-box driver crashes the app when you run - // it in the debugger, which can be a bit annoying) -#endif + HWND w = WindowFromPoint (p); - return 0; + return w == hwnd || (trueIfInAChildWindow && (IsChild (hwnd, w) != 0)); } - static int findFreeSlot() + const BorderSize getFrameSize() const { - for (int i = 0; i < numElementsInArray (currentASIODev); ++i) - if (currentASIODev[i] == 0) - return i; - - jassertfalse; // unfortunately you can only have a finite number - // of ASIO devices open at the same time.. - return -1; + return windowBorder; } - int getIndexOfDevice (AudioIODevice* d, const bool /*asInput*/) const + bool setAlwaysOnTop (bool alwaysOnTop) { - jassert (hasScanned); // need to call scanForDevices() before doing this + const bool oldDeactivate = shouldDeactivateTitleBar; + shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); - return d == 0 ? -1 : deviceNames.indexOf (d->getName()); + SetWindowPos (hwnd, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); + + shouldDeactivateTitleBar = oldDeactivate; + + if (shadower != 0) + shadower->componentBroughtToFront (*component); + + return true; } - bool hasSeparateInputsAndOutputs() const { return false; } + void toFront (bool makeActive) + { + setMinimised (false); - AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) + const bool oldDeactivate = shouldDeactivateTitleBar; + shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); + + MessageManager::getInstance() + ->callFunctionOnMessageThread (makeActive ? &toFrontCallback1 + : &toFrontCallback2, + (void*) hwnd); + + shouldDeactivateTitleBar = oldDeactivate; + + if (! makeActive) + { + // in this case a broughttofront call won't have occured, so do it now.. + handleBroughtToFront(); + } + } + + void toBehind (ComponentPeer* other) { - jassert (inputDeviceName == outputDeviceName); - (void) inputDeviceName; - jassert (hasScanned); // need to call scanForDevices() before doing this + Win32ComponentPeer* const otherPeer = dynamic_cast (other); - const int index = deviceNames.indexOf (outputDeviceName); + jassert (otherPeer != 0); // wrong type of window? - if (index >= 0) + if (otherPeer != 0) { - const int freeSlot = findFreeSlot(); + setMinimised (false); - if (freeSlot >= 0) - return new ASIOAudioIODevice (outputDeviceName, *(classIds [index]), freeSlot); + SetWindowPos (hwnd, otherPeer->hwnd, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); } + } - return 0; + bool isFocused() const + { + return MessageManager::getInstance() + ->callFunctionOnMessageThread (&getFocusCallback, 0) == (void*) hwnd; } - juce_UseDebuggingNewOperator + void grabFocus() + { + const bool oldDeactivate = shouldDeactivateTitleBar; + shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); -private: - StringArray deviceNames; - OwnedArray classIds; + MessageManager::getInstance() + ->callFunctionOnMessageThread (&setFocusCallback, (void*) hwnd); - bool hasScanned; + shouldDeactivateTitleBar = oldDeactivate; + } - static bool checkClassIsOk (const String& classId) + void textInputRequired (int /*x*/, int /*y*/) { - HKEY hk = 0; - bool ok = false; - - if (RegOpenKeyA (HKEY_CLASSES_ROOT, "clsid", &hk) == ERROR_SUCCESS) + if (! hasCreatedCaret) { - int index = 0; + hasCreatedCaret = true; + CreateCaret (hwnd, (HBITMAP) 1, 0, 0); + } - for (;;) - { - char buf [512]; + ShowCaret (hwnd); + SetCaretPos (0, 0); + } - if (RegEnumKeyA (hk, index++, buf, 512) == ERROR_SUCCESS) - { - if (classId.equalsIgnoreCase (buf)) - { - HKEY subKey, pathKey; + void repaint (int x, int y, int w, int h) + { + const RECT r = { x, y, x + w, y + h }; + InvalidateRect (hwnd, &r, FALSE); + } - if (RegOpenKeyExA (hk, buf, 0, KEY_READ, &subKey) == ERROR_SUCCESS) - { - if (RegOpenKeyExA (subKey, "InprocServer32", 0, KEY_READ, &pathKey) == ERROR_SUCCESS) - { - char pathName [600]; - DWORD dtype = REG_SZ; - DWORD dsize = sizeof (pathName); + void performAnyPendingRepaintsNow() + { + MSG m; + if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE)) + DispatchMessage (&m); + } - if (RegQueryValueExA (pathKey, 0, 0, &dtype, - (LPBYTE) pathName, &dsize) == ERROR_SUCCESS) - { - OFSTRUCT of; - zerostruct (of); + static Win32ComponentPeer* getOwnerOfWindow (HWND h) throw() + { + if (h != 0 && GetWindowLongPtr (h, GWLP_USERDATA) == improbableWindowNumber) + return (Win32ComponentPeer*) GetWindowLongPtr (h, 8); - of.cBytes = sizeof (of); + return 0; + } - ok = (OpenFile (String (pathName), &of, OF_EXIST) != 0); - } + void setTaskBarIcon (const Image* const image) + { + if (image != 0) + { + HICON hicon = createHICONFromImage (*image, TRUE, 0, 0); - RegCloseKey (pathKey); - } + if (taskBarIcon == 0) + { + taskBarIcon = new NOTIFYICONDATA(); + taskBarIcon->cbSize = sizeof (NOTIFYICONDATA); + taskBarIcon->hWnd = (HWND) hwnd; + taskBarIcon->uID = (int) (pointer_sized_int) hwnd; + taskBarIcon->uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; + taskBarIcon->uCallbackMessage = WM_TRAYNOTIFY; + taskBarIcon->hIcon = hicon; + taskBarIcon->szTip[0] = 0; - RegCloseKey (subKey); - } + Shell_NotifyIcon (NIM_ADD, taskBarIcon); + } + else + { + HICON oldIcon = taskBarIcon->hIcon; - break; - } - } - else - { - break; - } + taskBarIcon->hIcon = hicon; + taskBarIcon->uFlags = NIF_ICON; + Shell_NotifyIcon (NIM_MODIFY, taskBarIcon); + + DestroyIcon (oldIcon); } - RegCloseKey (hk); + DestroyIcon (hicon); } + else if (taskBarIcon != 0) + { + taskBarIcon->uFlags = 0; + Shell_NotifyIcon (NIM_DELETE, taskBarIcon); + DestroyIcon (taskBarIcon->hIcon); + deleteAndZero (taskBarIcon); + } + } - return ok; + void setTaskBarIconToolTip (const String& toolTip) const + { + if (taskBarIcon != 0) + { + taskBarIcon->uFlags = NIF_TIP; + toolTip.copyToBuffer (taskBarIcon->szTip, sizeof (taskBarIcon->szTip) - 1); + Shell_NotifyIcon (NIM_MODIFY, taskBarIcon); + } } - void addDriverInfo (const String& keyName, HKEY hk) + juce_UseDebuggingNewOperator + + bool dontRepaint; + +private: + HWND hwnd; + DropShadower* shadower; + bool fullScreen, isDragging, isMouseOver, hasCreatedCaret; + BorderSize windowBorder; + HICON currentWindowIcon; + NOTIFYICONDATA* taskBarIcon; + IDropTarget* dropTarget; + + class TemporaryImage : public Timer { - HKEY subKey; + public: - if (RegOpenKeyExA (hk, keyName, 0, KEY_READ, &subKey) == ERROR_SUCCESS) + TemporaryImage() + : image (0) { - char buf [256]; - DWORD dtype = REG_SZ; - DWORD dsize = sizeof (buf); - zeromem (buf, dsize); + } - if (RegQueryValueExA (subKey, "clsid", 0, &dtype, (LPBYTE) buf, &dsize) == ERROR_SUCCESS) + ~TemporaryImage() + { + delete image; + } + + WindowsBitmapImage* getImage (const bool transparent, const int w, const int h) throw() + { + const Image::PixelFormat format = transparent ? Image::ARGB : Image::RGB; + + if (image == 0 || image->getWidth() < w || image->getHeight() < h || image->getFormat() != format) { - if (dsize > 0 && checkClassIsOk (buf)) - { - wchar_t classIdStr [130]; - MultiByteToWideChar (CP_ACP, 0, buf, -1, classIdStr, 128); + delete image; + image = new WindowsBitmapImage (format, (w + 31) & ~31, (h + 31) & ~31, false); + } - String deviceName; - CLSID classId; + startTimer (3000); + return image; + } - if (CLSIDFromString ((LPOLESTR) classIdStr, &classId) == S_OK) - { - dtype = REG_SZ; - dsize = sizeof (buf); + void timerCallback() + { + stopTimer(); + deleteAndZero (image); + } - if (RegQueryValueExA (subKey, "description", 0, &dtype, (LPBYTE) buf, &dsize) == ERROR_SUCCESS) - deviceName = buf; - else - deviceName = keyName; + private: + WindowsBitmapImage* image; - log (T("found ") + deviceName); - deviceNames.add (deviceName); - classIds.add (new CLSID (classId)); + TemporaryImage (const TemporaryImage&); + const TemporaryImage& operator= (const TemporaryImage&); + }; + + TemporaryImage offscreenImageGenerator; + + class WindowClassHolder : public DeletedAtShutdown + { + public: + WindowClassHolder() + : windowClassName ("JUCE_") + { + // this name has to be different for each app/dll instance because otherwise + // poor old Win32 can get a bit confused (even despite it not being a process-global + // window class). + windowClassName << (int) (Time::currentTimeMillis() & 0x7fffffff); + + HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(); + + TCHAR moduleFile [1024]; + moduleFile[0] = 0; + GetModuleFileName (moduleHandle, moduleFile, 1024); + WORD iconNum = 0; + + WNDCLASSEX wcex; + wcex.cbSize = sizeof (wcex); + wcex.style = CS_OWNDC; + wcex.lpfnWndProc = (WNDPROC) windowProc; + wcex.lpszClassName = windowClassName; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 32; + wcex.hInstance = moduleHandle; + wcex.hIcon = ExtractAssociatedIcon (moduleHandle, moduleFile, &iconNum); + iconNum = 1; + wcex.hIconSm = ExtractAssociatedIcon (moduleHandle, moduleFile, &iconNum); + wcex.hCursor = 0; + wcex.hbrBackground = 0; + wcex.lpszMenuName = 0; + + RegisterClassEx (&wcex); + } + + ~WindowClassHolder() + { + if (ComponentPeer::getNumPeers() == 0) + UnregisterClass (windowClassName, (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle()); + + clearSingletonInstance(); + } + + String windowClassName; + + juce_DeclareSingleton_SingleThreaded_Minimal (WindowClassHolder); + }; + + static void* createWindowCallback (void* userData) + { + ((Win32ComponentPeer*) userData)->createWindow(); + return 0; + } + + void createWindow() + { + DWORD exstyle = WS_EX_ACCEPTFILES; + DWORD type = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; + + if (hasTitleBar()) + { + type |= WS_OVERLAPPED; + exstyle |= WS_EX_APPWINDOW; + + if ((styleFlags & windowHasCloseButton) != 0) + { + type |= WS_SYSMENU; + } + else + { + // annoyingly, windows won't let you have a min/max button without a close button + jassert ((styleFlags & (windowHasMinimiseButton | windowHasMaximiseButton)) == 0); + } + + if ((styleFlags & windowIsResizable) != 0) + type |= WS_THICKFRAME; + } + else + { + type |= WS_POPUP | WS_SYSMENU; + + if ((styleFlags & windowAppearsOnTaskbar) == 0) + exstyle |= WS_EX_TOOLWINDOW; + else + exstyle |= WS_EX_APPWINDOW; + } + + if ((styleFlags & windowHasMinimiseButton) != 0) + type |= WS_MINIMIZEBOX; + + if ((styleFlags & windowHasMaximiseButton) != 0) + type |= WS_MAXIMIZEBOX; + + if ((styleFlags & windowIgnoresMouseClicks) != 0) + exstyle |= WS_EX_TRANSPARENT; + + if ((styleFlags & windowIsSemiTransparent) != 0 + && Desktop::canUseSemiTransparentWindows()) + exstyle |= WS_EX_LAYERED; + + hwnd = CreateWindowEx (exstyle, WindowClassHolder::getInstance()->windowClassName, L"", type, 0, 0, 0, 0, 0, 0, 0, 0); + + if (hwnd != 0) + { + SetWindowLongPtr (hwnd, 0, 0); + SetWindowLongPtr (hwnd, 8, (LONG_PTR) this); + SetWindowLongPtr (hwnd, GWLP_USERDATA, improbableWindowNumber); + + if (dropTarget == 0) + dropTarget = new JuceDropTarget (this); + + RegisterDragDrop (hwnd, dropTarget); + + updateBorderSize(); + + // Calling this function here is (for some reason) necessary to make Windows + // correctly enable the menu items that we specify in the wm_initmenu message. + GetSystemMenu (hwnd, false); + } + else + { + jassertfalse + } + } + + static void* destroyWindowCallback (void* handle) + { + RevokeDragDrop ((HWND) handle); + DestroyWindow ((HWND) handle); + return 0; + } + + static void* toFrontCallback1 (void* h) + { + SetForegroundWindow ((HWND) h); + return 0; + } + + static void* toFrontCallback2 (void* h) + { + SetWindowPos ((HWND) h, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); + return 0; + } + + static void* setFocusCallback (void* h) + { + SetFocus ((HWND) h); + return 0; + } + + static void* getFocusCallback (void*) + { + return (void*) GetFocus(); + } + + void offsetWithinParent (int& x, int& y) const + { + if (isTransparent()) + { + HWND parentHwnd = GetParent (hwnd); + + if (parentHwnd != 0) + { + RECT parentRect; + GetWindowRect (parentHwnd, &parentRect); + x += parentRect.left; + y += parentRect.top; + } + } + } + + bool isTransparent() const + { + return (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0; + } + + inline bool hasTitleBar() const throw() { return (styleFlags & windowHasTitleBar) != 0; } + + void setIcon (const Image& newIcon) + { + HICON hicon = createHICONFromImage (newIcon, TRUE, 0, 0); + + if (hicon != 0) + { + SendMessage (hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon); + SendMessage (hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon); + + if (currentWindowIcon != 0) + DestroyIcon (currentWindowIcon); + + currentWindowIcon = hicon; + } + } + + void handlePaintMessage() + { +#if DEBUG_REPAINT_TIMES + const double paintStart = Time::getMillisecondCounterHiRes(); +#endif + HRGN rgn = CreateRectRgn (0, 0, 0, 0); + const int regionType = GetUpdateRgn (hwnd, rgn, false); + + PAINTSTRUCT paintStruct; + HDC dc = BeginPaint (hwnd, &paintStruct); // Note this can immediately generate a WM_NCPAINT + // message and become re-entrant, but that's OK + + // if something in a paint handler calls, e.g. a message box, this can become reentrant and + // corrupt the image it's using to paint into, so do a check here. + static bool reentrant = false; + if (reentrant) + { + DeleteObject (rgn); + EndPaint (hwnd, &paintStruct); + return; + } + + reentrant = true; + + // this is the rectangle to update.. + int x = paintStruct.rcPaint.left; + int y = paintStruct.rcPaint.top; + int w = paintStruct.rcPaint.right - x; + int h = paintStruct.rcPaint.bottom - y; + + const bool transparent = isTransparent(); + + if (transparent) + { + // it's not possible to have a transparent window with a title bar at the moment! + jassert (! hasTitleBar()); + + RECT r; + GetWindowRect (hwnd, &r); + x = y = 0; + w = r.right - r.left; + h = r.bottom - r.top; + } + + if (w > 0 && h > 0) + { + clearMaskedRegion(); + + WindowsBitmapImage* const offscreenImage = offscreenImageGenerator.getImage (transparent, w, h); + + LowLevelGraphicsSoftwareRenderer context (*offscreenImage); + + RectangleList* const contextClip = context.getRawClipRegion(); + contextClip->clear(); + + context.setOrigin (-x, -y); + + bool needToPaintAll = true; + + if (regionType == COMPLEXREGION && ! transparent) + { + HRGN clipRgn = CreateRectRgnIndirect (&paintStruct.rcPaint); + CombineRgn (rgn, rgn, clipRgn, RGN_AND); + DeleteObject (clipRgn); + + char rgnData [8192]; + const DWORD res = GetRegionData (rgn, sizeof (rgnData), (RGNDATA*) rgnData); + + if (res > 0 && res <= sizeof (rgnData)) + { + const RGNDATAHEADER* const hdr = &(((const RGNDATA*) rgnData)->rdh); + + if (hdr->iType == RDH_RECTANGLES + && hdr->rcBound.right - hdr->rcBound.left >= w + && hdr->rcBound.bottom - hdr->rcBound.top >= h) + { + needToPaintAll = false; + + const RECT* rects = (const RECT*) (rgnData + sizeof (RGNDATAHEADER)); + int num = ((RGNDATA*) rgnData)->rdh.nCount; + + while (--num >= 0) + { + // (need to move this one pixel to the left because of a win32 bug) + const int cx = jmax (x, rects->left - 1); + const int cy = rects->top; + const int cw = rects->right - cx; + const int ch = rects->bottom - rects->top; + + if (cx + cw - x <= w && cy + ch - y <= h) + { + contextClip->addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); + } + else + { + needToPaintAll = true; + break; + } + + ++rects; + } + } + } + } + + if (needToPaintAll) + { + contextClip->clear(); + contextClip->addWithoutMerging (Rectangle (0, 0, w, h)); + } + + if (transparent) + { + RectangleList::Iterator i (*contextClip); + + while (i.next()) + { + const Rectangle& r = *i.getRectangle(); + offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + } + + // if the component's not opaque, this won't draw properly unless the platform can support this + jassert (Desktop::canUseSemiTransparentWindows() || component->isOpaque()); + + updateCurrentModifiers(); + + handlePaint (context); + + if (! dontRepaint) + offscreenImage->blitToWindow (hwnd, dc, transparent, x, y, maskedRegion); + } + + DeleteObject (rgn); + EndPaint (hwnd, &paintStruct); + reentrant = false; + +#ifndef JUCE_GCC //xxx should add this fn for gcc.. + _fpreset(); // because some graphics cards can unmask FP exceptions +#endif + + lastPaintTime = Time::getMillisecondCounter(); + +#if DEBUG_REPAINT_TIMES + const double elapsed = Time::getMillisecondCounterHiRes() - paintStart; + Logger::outputDebugString (T("repaint time: ") + String (elapsed, 2)); +#endif + } + + void doMouseMove (const int x, const int y) + { + static uint32 lastMouseTime = 0; + // this can be set to throttle the mouse-messages to less than a + // certain number per second, as things can get unresponsive + // if each drag or move callback has to do a lot of work. + const int maxMouseMovesPerSecond = 60; + + const int64 mouseEventTime = getMouseEventTime(); + + if (! isMouseOver) + { + isMouseOver = true; + + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof (tme); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hwnd; + tme.dwHoverTime = 0; + + if (! TrackMouseEvent (&tme)) + { + jassertfalse; + } + + updateKeyModifiers(); + handleMouseEnter (x, y, mouseEventTime); + } + else if (! isDragging) + { + if (((unsigned int) x) < (unsigned int) component->getWidth() + && ((unsigned int) y) < (unsigned int) component->getHeight()) + { + RECT r; + GetWindowRect (hwnd, &r); + + POINT p; + p.x = x + r.left + windowBorder.getLeft(); + p.y = y + r.top + windowBorder.getTop(); + + if (WindowFromPoint (p) == hwnd) + { + const uint32 now = Time::getMillisecondCounter(); + + if (now > lastMouseTime + 1000 / maxMouseMovesPerSecond) + { + lastMouseTime = now; + handleMouseMove (x, y, mouseEventTime); + } + } + } + } + else + { + const uint32 now = Time::getMillisecondCounter(); + + if (now > lastMouseTime + 1000 / maxMouseMovesPerSecond) + { + lastMouseTime = now; + handleMouseDrag (x, y, mouseEventTime); + } + } + } + + void doMouseDown (const int x, const int y, const WPARAM wParam) + { + if (GetCapture() != hwnd) + SetCapture (hwnd); + + doMouseMove (x, y); + + currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + + if ((wParam & MK_LBUTTON) != 0) + currentModifiers |= ModifierKeys::leftButtonModifier; + + if ((wParam & MK_RBUTTON) != 0) + currentModifiers |= ModifierKeys::rightButtonModifier; + + if ((wParam & MK_MBUTTON) != 0) + currentModifiers |= ModifierKeys::middleButtonModifier; + + updateKeyModifiers(); + isDragging = true; + + handleMouseDown (x, y, getMouseEventTime()); + } + + void doMouseUp (const int x, const int y, const WPARAM wParam) + { + int numButtons = 0; + + if ((wParam & MK_LBUTTON) != 0) + ++numButtons; + + if ((wParam & MK_RBUTTON) != 0) + ++numButtons; + + if ((wParam & MK_MBUTTON) != 0) + ++numButtons; + + const int oldModifiers = currentModifiers; + + // update the currentmodifiers only after the callback, so the callback + // knows which button was released. + currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + + if ((wParam & MK_LBUTTON) != 0) + currentModifiers |= ModifierKeys::leftButtonModifier; + + if ((wParam & MK_RBUTTON) != 0) + currentModifiers |= ModifierKeys::rightButtonModifier; + + if ((wParam & MK_MBUTTON) != 0) + currentModifiers |= ModifierKeys::middleButtonModifier; + + updateKeyModifiers(); + isDragging = false; + + // release the mouse capture if the user's not still got a button down + if (numButtons == 0 && hwnd == GetCapture()) + ReleaseCapture(); + + handleMouseUp (oldModifiers, x, y, getMouseEventTime()); + } + + void doCaptureChanged() + { + if (isDragging) + { + RECT wr; + GetWindowRect (hwnd, &wr); + + const DWORD mp = GetMessagePos(); + + doMouseUp (GET_X_LPARAM (mp) - wr.left - windowBorder.getLeft(), + GET_Y_LPARAM (mp) - wr.top - windowBorder.getTop(), + (WPARAM) getMouseEventTime()); + } + } + + void doMouseExit() + { + if (isMouseOver) + { + isMouseOver = false; + RECT wr; + GetWindowRect (hwnd, &wr); + + const DWORD mp = GetMessagePos(); + + handleMouseExit (GET_X_LPARAM (mp) - wr.left - windowBorder.getLeft(), + GET_Y_LPARAM (mp) - wr.top - windowBorder.getTop(), + getMouseEventTime()); + } + } + + void doMouseWheel (const WPARAM wParam, const bool isVertical) + { + updateKeyModifiers(); + + const int amount = jlimit (-1000, 1000, (int) (0.75f * (short) HIWORD (wParam))); + + handleMouseWheel (isVertical ? 0 : amount, + isVertical ? amount : 0, + getMouseEventTime()); + } + + void sendModifierKeyChangeIfNeeded() + { + if (modifiersAtLastCallback != currentModifiers) + { + modifiersAtLastCallback = currentModifiers; + handleModifierKeysChange(); + } + } + + bool doKeyUp (const WPARAM key) + { + updateKeyModifiers(); + + switch (key) + { + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_CAPITAL: + case VK_LWIN: + case VK_RWIN: + case VK_APPS: + case VK_NUMLOCK: + case VK_SCROLL: + case VK_LSHIFT: + case VK_RSHIFT: + case VK_LCONTROL: + case VK_LMENU: + case VK_RCONTROL: + case VK_RMENU: + sendModifierKeyChangeIfNeeded(); + } + + return handleKeyUpOrDown(); + } + + bool doKeyDown (const WPARAM key) + { + updateKeyModifiers(); + bool used = false; + + switch (key) + { + case VK_SHIFT: + case VK_LSHIFT: + case VK_RSHIFT: + case VK_CONTROL: + case VK_LCONTROL: + case VK_RCONTROL: + case VK_MENU: + case VK_LMENU: + case VK_RMENU: + case VK_LWIN: + case VK_RWIN: + case VK_CAPITAL: + case VK_NUMLOCK: + case VK_SCROLL: + case VK_APPS: + sendModifierKeyChangeIfNeeded(); + break; + + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_HOME: + case VK_END: + case VK_DELETE: + case VK_INSERT: + case VK_F1: + case VK_F2: + case VK_F3: + case VK_F4: + case VK_F5: + case VK_F6: + case VK_F7: + case VK_F8: + case VK_F9: + case VK_F10: + case VK_F11: + case VK_F12: + case VK_F13: + case VK_F14: + case VK_F15: + case VK_F16: + used = handleKeyUpOrDown(); + used = handleKeyPress (extendedKeyModifier | (int) key, 0) || used; + break; + + case VK_ADD: + case VK_SUBTRACT: + case VK_MULTIPLY: + case VK_DIVIDE: + case VK_SEPARATOR: + case VK_DECIMAL: + used = handleKeyUpOrDown(); + break; + + default: + used = handleKeyUpOrDown(); + + { + MSG msg; + + if (! PeekMessage (&msg, hwnd, WM_CHAR, WM_DEADCHAR, PM_NOREMOVE)) + { + // if there isn't a WM_CHAR or WM_DEADCHAR message pending, we need to + // manually generate the key-press event that matches this key-down. + + const UINT keyChar = MapVirtualKey (key, 2); + used = handleKeyPress ((int) LOWORD (keyChar), 0) || used; + } + } + + break; + } + + return used; + } + + bool doKeyChar (int key, const LPARAM flags) + { + updateKeyModifiers(); + + juce_wchar textChar = (juce_wchar) key; + + const int virtualScanCode = (flags >> 16) & 0xff; + + if (key >= '0' && key <= '9') + { + switch (virtualScanCode) // check for a numeric keypad scan-code + { + case 0x52: + case 0x4f: + case 0x50: + case 0x51: + case 0x4b: + case 0x4c: + case 0x4d: + case 0x47: + case 0x48: + case 0x49: + key = (key - '0') + KeyPress::numberPad0; + break; + default: + break; + } + } + else + { + // convert the scan code to an unmodified character code.. + const UINT virtualKey = MapVirtualKey (virtualScanCode, 1); + UINT keyChar = MapVirtualKey (virtualKey, 2); + + keyChar = LOWORD (keyChar); + + if (keyChar != 0) + key = (int) keyChar; + + // avoid sending junk text characters for some control-key combinations + if (textChar < ' ' && (currentModifiers & (ModifierKeys::ctrlModifier | ModifierKeys::altModifier)) != 0) + textChar = 0; + } + + return handleKeyPress (key, textChar); + } + + bool doAppCommand (const LPARAM lParam) + { + int key = 0; + + switch (GET_APPCOMMAND_LPARAM (lParam)) + { + case APPCOMMAND_MEDIA_PLAY_PAUSE: + key = KeyPress::playKey; + break; + + case APPCOMMAND_MEDIA_STOP: + key = KeyPress::stopKey; + break; + + case APPCOMMAND_MEDIA_NEXTTRACK: + key = KeyPress::fastForwardKey; + break; + + case APPCOMMAND_MEDIA_PREVIOUSTRACK: + key = KeyPress::rewindKey; + break; + } + + if (key != 0) + { + updateKeyModifiers(); + + if (hwnd == GetActiveWindow()) + { + handleKeyPress (key, 0); + return true; + } + } + + return false; + } + + class JuceDropTarget : public IDropTarget + { + public: + JuceDropTarget (Win32ComponentPeer* const owner_) + : owner (owner_), + refCount (1) + { + } + + virtual ~JuceDropTarget() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IDropTarget) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + { + updateFileList (pDataObject); + int x = mousePos.x, y = mousePos.y; + owner->globalPositionToRelative (x, y); + owner->handleFileDragMove (files, x, y); + *pdwEffect = DROPEFFECT_COPY; + return S_OK; + } + + HRESULT __stdcall DragLeave() + { + owner->handleFileDragExit (files); + return S_OK; + } + + HRESULT __stdcall DragOver (DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + { + int x = mousePos.x, y = mousePos.y; + owner->globalPositionToRelative (x, y); + owner->handleFileDragMove (files, x, y); + *pdwEffect = DROPEFFECT_COPY; + return S_OK; + } + + HRESULT __stdcall Drop (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + { + updateFileList (pDataObject); + int x = mousePos.x, y = mousePos.y; + owner->globalPositionToRelative (x, y); + owner->handleFileDragDrop (files, x, y); + *pdwEffect = DROPEFFECT_COPY; + return S_OK; + } + + private: + Win32ComponentPeer* const owner; + int refCount; + StringArray files; + + void updateFileList (IDataObject* const pDataObject) + { + files.clear(); + + FORMATETC format = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; + + if (pDataObject->GetData (&format, &medium) == S_OK) + { + const SIZE_T totalLen = GlobalSize (medium.hGlobal); + const LPDROPFILES pDropFiles = (const LPDROPFILES) GlobalLock (medium.hGlobal); + unsigned int i = 0; + + if (pDropFiles->fWide) + { + const WCHAR* const fname = (WCHAR*) (((const char*) pDropFiles) + sizeof (DROPFILES)); + + for (;;) + { + unsigned int len = 0; + while (i + len < totalLen && fname [i + len] != 0) + ++len; + + if (len == 0) + break; + + files.add (String (fname + i, len)); + i += len + 1; + } + } + else + { + const char* const fname = ((const char*) pDropFiles) + sizeof (DROPFILES); + + for (;;) + { + unsigned int len = 0; + while (i + len < totalLen && fname [i + len] != 0) + ++len; + + if (len == 0) + break; + + files.add (String (fname + i, len)); + i += len + 1; + } + } + + GlobalUnlock (medium.hGlobal); + } + } + + JuceDropTarget (const JuceDropTarget&); + const JuceDropTarget& operator= (const JuceDropTarget&); + }; + + void doSettingChange() + { + Desktop::getInstance().refreshMonitorSizes(); + + if (fullScreen && ! isMinimised()) + { + const Rectangle r (component->getParentMonitorArea()); + + SetWindowPos (hwnd, 0, + r.getX(), r.getY(), r.getWidth(), r.getHeight(), + SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSENDCHANGING); + } + } + +public: + static LRESULT CALLBACK windowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) + { + Win32ComponentPeer* const peer = getOwnerOfWindow (h); + + if (peer != 0) + return peer->peerWindowProc (h, message, wParam, lParam); + + return DefWindowProc (h, message, wParam, lParam); + } + +private: + LRESULT peerWindowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) + { + { + const MessageManagerLock messLock; + + if (isValidPeer (this)) + { + switch (message) + { + case WM_NCHITTEST: + if (hasTitleBar()) + break; + + return HTCLIENT; + + case WM_PAINT: + handlePaintMessage(); + return 0; + + case WM_NCPAINT: + if (wParam != 1) + handlePaintMessage(); + + if (hasTitleBar()) + break; + + return 0; + + case WM_ERASEBKGND: + case WM_NCCALCSIZE: + if (hasTitleBar()) + break; + + return 1; + + case WM_MOUSEMOVE: + doMouseMove (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam)); + return 0; + + case WM_MOUSELEAVE: + doMouseExit(); + return 0; + + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + doMouseDown (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); + return 0; + + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + doMouseUp (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); + return 0; + + case WM_CAPTURECHANGED: + doCaptureChanged(); + return 0; + + case WM_NCMOUSEMOVE: + if (hasTitleBar()) + break; + + return 0; + + case 0x020A: /* WM_MOUSEWHEEL */ + doMouseWheel (wParam, true); + return 0; + + case 0x020E: /* WM_MOUSEHWHEEL */ + doMouseWheel (wParam, false); + return 0; + + case WM_WINDOWPOSCHANGING: + if ((styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) + { + WINDOWPOS* const wp = (WINDOWPOS*) lParam; + + if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE)) + { + if (constrainer != 0) + { + const Rectangle current (component->getX() - windowBorder.getLeft(), + component->getY() - windowBorder.getTop(), + component->getWidth() + windowBorder.getLeftAndRight(), + component->getHeight() + windowBorder.getTopAndBottom()); + + constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, + current, + Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), + wp->y != current.getY() && wp->y + wp->cy == current.getBottom(), + wp->x != current.getX() && wp->x + wp->cx == current.getRight(), + wp->y == current.getY() && wp->y + wp->cy != current.getBottom(), + wp->x == current.getX() && wp->x + wp->cx != current.getRight()); + } + } + } + + return 0; + + case WM_WINDOWPOSCHANGED: + handleMovedOrResized(); + + if (dontRepaint) + break; // needed for non-accelerated openGL windows to draw themselves correctly.. + else + return 0; + + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + if (doKeyDown (wParam)) + return 0; + + break; + + case WM_KEYUP: + case WM_SYSKEYUP: + if (doKeyUp (wParam)) + return 0; + + break; + + case WM_CHAR: + if (doKeyChar ((int) wParam, lParam)) + return 0; + + break; + + case WM_APPCOMMAND: + if (doAppCommand (lParam)) + return TRUE; + + break; + + case WM_SETFOCUS: + updateKeyModifiers(); + handleFocusGain(); + break; + + case WM_KILLFOCUS: + if (hasCreatedCaret) + { + hasCreatedCaret = false; + DestroyCaret(); + } + + handleFocusLoss(); + break; + + case WM_ACTIVATEAPP: + // Windows does weird things to process priority when you swap apps, + // so this forces an update when the app is brought to the front + if (wParam != FALSE) + juce_repeatLastProcessPriority(); + + juce_CheckCurrentlyFocusedTopLevelWindow(); + modifiersAtLastCallback = -1; + return 0; + + case WM_ACTIVATE: + if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE) + { + modifiersAtLastCallback = -1; + updateKeyModifiers(); + + if (isMinimised()) + { + component->repaint(); + handleMovedOrResized(); + + if (! isValidMessageListener()) + return 0; + } + + if (LOWORD (wParam) == WA_CLICKACTIVE + && component->isCurrentlyBlockedByAnotherModalComponent()) + { + int mx, my; + component->getMouseXYRelative (mx, my); + Component* const underMouse = component->getComponentAt (mx, my); + + if (underMouse != 0 && underMouse->isCurrentlyBlockedByAnotherModalComponent()) + Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); + + return 0; + } + + handleBroughtToFront(); + + if (component->isCurrentlyBlockedByAnotherModalComponent()) + Component::getCurrentlyModalComponent()->toFront (true); + + return 0; + } + + break; + + case WM_NCACTIVATE: + // while a temporary window is being shown, prevent Windows from deactivating the + // title bars of our main windows. + if (wParam == 0 && ! shouldDeactivateTitleBar) + wParam = TRUE; // change this and let it get passed to the DefWindowProc. + + break; + + case WM_MOUSEACTIVATE: + if (! component->getMouseClickGrabsKeyboardFocus()) + return MA_NOACTIVATE; + + break; + + case WM_SHOWWINDOW: + if (wParam != 0) + handleBroughtToFront(); + + break; + + case WM_CLOSE: + handleUserClosingWindow(); + return 0; + + case WM_QUIT: + JUCEApplication::quit(); + return 0; + + case WM_TRAYNOTIFY: + if (component->isCurrentlyBlockedByAnotherModalComponent()) + { + if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN + || lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) + { + Component* const current = Component::getCurrentlyModalComponent(); + + if (current != 0) + current->inputAttemptWhenModal(); + } + } + else + { + const int oldModifiers = currentModifiers; + + MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component, + getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false); + + if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) + e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::leftButtonModifier); + else if (lParam == WM_RBUTTONDOWN || lParam == WM_RBUTTONDBLCLK) + e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::rightButtonModifier); + + if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) + { + SetFocus (hwnd); + SetForegroundWindow (hwnd); + + component->mouseDown (e); + } + else if (lParam == WM_LBUTTONUP || lParam == WM_RBUTTONUP) + { + e.mods = ModifierKeys (oldModifiers); + component->mouseUp (e); + } + else if (lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) + { + e.mods = ModifierKeys (oldModifiers); + component->mouseDoubleClick (e); + } + else if (lParam == WM_MOUSEMOVE) + { + component->mouseMove (e); + } + } + + break; + + case WM_SYNCPAINT: + return 0; + + case WM_PALETTECHANGED: + InvalidateRect (h, 0, 0); + break; + + case WM_DISPLAYCHANGE: + InvalidateRect (h, 0, 0); + createPaletteIfNeeded = true; + // intentional fall-through... + case WM_SETTINGCHANGE: // note the fall-through in the previous case! + doSettingChange(); + break; + + case WM_INITMENU: + if (! hasTitleBar()) + { + if (isFullScreen()) + { + EnableMenuItem ((HMENU) wParam, SC_RESTORE, MF_BYCOMMAND | MF_ENABLED); + EnableMenuItem ((HMENU) wParam, SC_MOVE, MF_BYCOMMAND | MF_GRAYED); + } + else if (! isMinimised()) + { + EnableMenuItem ((HMENU) wParam, SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED); + } + } + break; + + case WM_SYSCOMMAND: + switch (wParam & 0xfff0) + { + case SC_CLOSE: + if (hasTitleBar()) + { + PostMessage (h, WM_CLOSE, 0, 0); + return 0; + } + break; + + case SC_KEYMENU: + if (hasTitleBar() && h == GetCapture()) + ReleaseCapture(); + + break; + + case SC_MAXIMIZE: + setFullScreen (true); + return 0; + + case SC_MINIMIZE: + if (! hasTitleBar()) + { + setMinimised (true); + return 0; + } + break; + + case SC_RESTORE: + if (hasTitleBar()) + { + if (isFullScreen()) + { + setFullScreen (false); + return 0; + } + } + else + { + if (isMinimised()) + setMinimised (false); + else if (isFullScreen()) + setFullScreen (false); + + return 0; + } + + break; + + case SC_MONITORPOWER: + case SC_SCREENSAVE: + if (! screenSaverAllowed) + return 0; + + break; + } + + break; + + case WM_NCLBUTTONDOWN: + case WM_NCRBUTTONDOWN: + case WM_NCMBUTTONDOWN: + if (component->isCurrentlyBlockedByAnotherModalComponent()) + { + Component* const current = Component::getCurrentlyModalComponent(); + + if (current != 0) + current->inputAttemptWhenModal(); + } + + break; + + //case WM_IME_STARTCOMPOSITION; + // return 0; + + case WM_GETDLGCODE: + return DLGC_WANTALLKEYS; + + default: + break; + } + } + } + + // (the message manager lock exits before calling this, to avoid deadlocks if + // this calls into non-juce windows) + return DefWindowProc (h, message, wParam, lParam); + } + + Win32ComponentPeer (const Win32ComponentPeer&); + const Win32ComponentPeer& operator= (const Win32ComponentPeer&); +}; + +ComponentPeer* Component::createNewPeer (int styleFlags, void* /*nativeWindowToAttachTo*/) +{ + return new Win32ComponentPeer (this, styleFlags); +} + +juce_ImplementSingleton_SingleThreaded (Win32ComponentPeer::WindowClassHolder); + +void SystemTrayIconComponent::setIconImage (const Image& newImage) +{ + Win32ComponentPeer* const wp = dynamic_cast (getPeer()); + + if (wp != 0) + wp->setTaskBarIcon (&newImage); +} + +void SystemTrayIconComponent::setIconTooltip (const String& tooltip) +{ + Win32ComponentPeer* const wp = dynamic_cast (getPeer()); + + if (wp != 0) + wp->setTaskBarIconToolTip (tooltip); +} + +void juce_setWindowStyleBit (HWND h, const int styleType, const int feature, const bool bitIsSet) throw() +{ + DWORD val = GetWindowLong (h, styleType); + + if (bitIsSet) + val |= feature; + else + val &= ~feature; + + SetWindowLongPtr (h, styleType, val); + SetWindowPos (h, 0, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER + | SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING); +} + +bool Process::isForegroundProcess() throw() +{ + HWND fg = GetForegroundWindow(); + + if (fg == 0) + return true; + + DWORD processId = 0; + GetWindowThreadProcessId (fg, &processId); + + return processId == GetCurrentProcessId(); +} + +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) +{ + return MessageBox (0, bodyText, title, + MB_SETFOREGROUND | (isOkCancel ? MB_OKCANCEL + : MB_OK)) == IDOK; +} + +void Desktop::getMousePosition (int& x, int& y) throw() +{ + POINT mousePos; + GetCursorPos (&mousePos); + x = mousePos.x; + y = mousePos.y; +} + +void Desktop::setMousePosition (int x, int y) throw() +{ + SetCursorPos (x, y); +} + +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() +{ + screenSaverAllowed = isEnabled; +} + +bool Desktop::isScreenSaverEnabled() throw() +{ + return screenSaverAllowed; +} + +static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) +{ + Array * const monitorCoords = (Array *) userInfo; + + monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); + + return TRUE; +} + +void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() +{ + EnumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords); + + // make sure the first in the list is the main monitor + for (int i = 1; i < monitorCoords.size(); ++i) + if (monitorCoords[i].getX() == 0 && monitorCoords[i].getY() == 0) + monitorCoords.swap (i, 0); + + if (monitorCoords.size() == 0) + { + RECT r; + GetWindowRect (GetDesktopWindow(), &r); + + monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); + } + + if (clipToWorkArea) + { + // clip the main monitor to the active non-taskbar area + RECT r; + SystemParametersInfo (SPI_GETWORKAREA, 0, &r, 0); + + Rectangle& screen = monitorCoords.getReference (0); + + screen.setPosition (jmax (screen.getX(), r.left), + jmax (screen.getY(), r.top)); + + screen.setSize (jmin (screen.getRight(), r.right) - screen.getX(), + jmin (screen.getBottom(), r.bottom) - screen.getY()); + } +} + +static Image* createImageFromHBITMAP (HBITMAP bitmap) throw() +{ + Image* im = 0; + + if (bitmap != 0) + { + BITMAP bm; + + if (GetObject (bitmap, sizeof (BITMAP), &bm) + && bm.bmWidth > 0 && bm.bmHeight > 0) + { + HDC tempDC = GetDC (0); + HDC dc = CreateCompatibleDC (tempDC); + ReleaseDC (0, tempDC); + + SelectObject (dc, bitmap); + + im = new Image (Image::ARGB, bm.bmWidth, bm.bmHeight, true); + + for (int y = bm.bmHeight; --y >= 0;) + { + for (int x = bm.bmWidth; --x >= 0;) + { + COLORREF col = GetPixel (dc, x, y); + + im->setPixelAt (x, y, Colour ((uint8) GetRValue (col), + (uint8) GetGValue (col), + (uint8) GetBValue (col))); + } + } + + DeleteDC (dc); + } + } + + return im; +} + +static Image* createImageFromHICON (HICON icon) throw() +{ + ICONINFO info; + + if (GetIconInfo (icon, &info)) + { + Image* const mask = createImageFromHBITMAP (info.hbmMask); + + if (mask == 0) + return 0; + + Image* const image = createImageFromHBITMAP (info.hbmColor); + + if (image == 0) + return mask; + + for (int y = image->getHeight(); --y >= 0;) + { + for (int x = image->getWidth(); --x >= 0;) + { + const float brightness = mask->getPixelAt (x, y).getBrightness(); + + if (brightness > 0.0f) + image->multiplyAlphaAt (x, y, 1.0f - brightness); + } + } + + delete mask; + return image; + } + + return 0; +} + +static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw() +{ + HBITMAP mask = CreateBitmap (image.getWidth(), image.getHeight(), 1, 1, 0); + + ICONINFO info; + info.fIcon = isIcon; + info.xHotspot = hotspotX; + info.yHotspot = hotspotY; + info.hbmMask = mask; + HICON hi = 0; + + if (SystemStats::getOperatingSystemType() >= SystemStats::WinXP) + { + WindowsBitmapImage bitmap (Image::ARGB, image.getWidth(), image.getHeight(), true); + Graphics g (bitmap); + g.drawImageAt (&image, 0, 0); + + info.hbmColor = bitmap.hBitmap; + hi = CreateIconIndirect (&info); + } + else + { + HBITMAP colour = CreateCompatibleBitmap (GetDC (0), image.getWidth(), image.getHeight()); + + HDC colDC = CreateCompatibleDC (GetDC (0)); + HDC alphaDC = CreateCompatibleDC (GetDC (0)); + SelectObject (colDC, colour); + SelectObject (alphaDC, mask); + + for (int y = image.getHeight(); --y >= 0;) + { + for (int x = image.getWidth(); --x >= 0;) + { + const Colour c (image.getPixelAt (x, y)); + + SetPixel (colDC, x, y, COLORREF (c.getRed() | (c.getGreen() << 8) | (c.getBlue() << 16))); + SetPixel (alphaDC, x, y, COLORREF (0xffffff - (c.getAlpha() | (c.getAlpha() << 8) | (c.getAlpha() << 16)))); + } + } + + DeleteDC (colDC); + DeleteDC (alphaDC); + + info.hbmColor = colour; + hi = CreateIconIndirect (&info); + DeleteObject (colour); + } + + DeleteObject (mask); + return hi; +} + +Image* juce_createIconForFile (const File& file) +{ + Image* image = 0; + + TCHAR filename [1024]; + file.getFullPathName().copyToBuffer (filename, 1023); + WORD iconNum = 0; + + HICON icon = ExtractAssociatedIcon ((HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(), + filename, &iconNum); + + if (icon != 0) + { + image = createImageFromHICON (icon); + DestroyIcon (icon); + } + + return image; +} + +void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() +{ + const int maxW = GetSystemMetrics (SM_CXCURSOR); + const int maxH = GetSystemMetrics (SM_CYCURSOR); + + const Image* im = ℑ + Image* newIm = 0; + + if (image.getWidth() > maxW || image.getHeight() > maxH) + { + im = newIm = image.createCopy (maxW, maxH); + + hotspotX = (hotspotX * maxW) / image.getWidth(); + hotspotY = (hotspotY * maxH) / image.getHeight(); + } + + void* cursorH = 0; + + const SystemStats::OperatingSystemType os = SystemStats::getOperatingSystemType(); + + if (os == SystemStats::WinXP) + { + cursorH = (void*) createHICONFromImage (*im, FALSE, hotspotX, hotspotY); + } + else + { + const int stride = (maxW + 7) >> 3; + uint8* const andPlane = (uint8*) juce_calloc (stride * maxH); + uint8* const xorPlane = (uint8*) juce_calloc (stride * maxH); + int index = 0; + + for (int y = 0; y < maxH; ++y) + { + for (int x = 0; x < maxW; ++x) + { + const unsigned char bit = (unsigned char) (1 << (7 - (x & 7))); + + const Colour pixelColour (im->getPixelAt (x, y)); + + if (pixelColour.getAlpha() < 127) + andPlane [index + (x >> 3)] |= bit; + else if (pixelColour.getBrightness() >= 0.5f) + xorPlane [index + (x >> 3)] |= bit; + } + + index += stride; + } + + cursorH = CreateCursor (0, hotspotX, hotspotY, maxW, maxH, andPlane, xorPlane); + + juce_free (andPlane); + juce_free (xorPlane); + } + + delete newIm; + return cursorH; +} + +void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() +{ + if (cursorHandle != 0 && ! isStandard) + DestroyCursor ((HCURSOR) cursorHandle); +} + +void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() +{ + LPCTSTR cursorName = IDC_ARROW; + + switch (type) + { + case MouseCursor::NormalCursor: + cursorName = IDC_ARROW; + break; + + case MouseCursor::NoCursor: + return 0; + + case MouseCursor::DraggingHandCursor: + { + static void* dragHandCursor = 0; + + if (dragHandCursor == 0) + { + static const 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 }; + + Image* const image = ImageFileFormat::loadFrom ((const char*) dragHandData, sizeof (dragHandData)); + dragHandCursor = juce_createMouseCursorFromImage (*image, 8, 7); + delete image; + } + + return dragHandCursor; + } + + case MouseCursor::WaitCursor: + cursorName = IDC_WAIT; + break; + + case MouseCursor::IBeamCursor: + cursorName = IDC_IBEAM; + break; + + case MouseCursor::PointingHandCursor: + cursorName = MAKEINTRESOURCE(32649); + break; + + case MouseCursor::LeftRightResizeCursor: + case MouseCursor::LeftEdgeResizeCursor: + case MouseCursor::RightEdgeResizeCursor: + cursorName = IDC_SIZEWE; + break; + + case MouseCursor::UpDownResizeCursor: + case MouseCursor::TopEdgeResizeCursor: + case MouseCursor::BottomEdgeResizeCursor: + cursorName = IDC_SIZENS; + break; + + case MouseCursor::TopLeftCornerResizeCursor: + case MouseCursor::BottomRightCornerResizeCursor: + cursorName = IDC_SIZENWSE; + break; + + case MouseCursor::TopRightCornerResizeCursor: + case MouseCursor::BottomLeftCornerResizeCursor: + cursorName = IDC_SIZENESW; + break; + + case MouseCursor::UpDownLeftRightResizeCursor: + cursorName = IDC_SIZEALL; + break; + + case MouseCursor::CrosshairCursor: + cursorName = IDC_CROSS; + break; + + case MouseCursor::CopyingCursor: + // can't seem to find one of these in the win32 list.. + break; + } + + HCURSOR cursorH = LoadCursor (0, cursorName); + + if (cursorH == 0) + cursorH = LoadCursor (0, IDC_ARROW); + + return (void*) cursorH; +} + +void MouseCursor::showInWindow (ComponentPeer*) const throw() +{ + SetCursor ((HCURSOR) getHandle()); +} + +void MouseCursor::showInAllWindows() const throw() +{ + showInWindow (0); +} + +class JuceDropSource : public IDropSource +{ + int refCount; + +public: + JuceDropSource() + : refCount (1) + { + } + + virtual ~JuceDropSource() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IDropSource) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall QueryContinueDrag (BOOL escapePressed, DWORD keys) + { + if (escapePressed) + return DRAGDROP_S_CANCEL; + + if ((keys & (MK_LBUTTON | MK_RBUTTON)) == 0) + return DRAGDROP_S_DROP; + + return S_OK; + } + + HRESULT __stdcall GiveFeedback (DWORD) + { + return DRAGDROP_S_USEDEFAULTCURSORS; + } +}; + +class JuceEnumFormatEtc : public IEnumFORMATETC +{ +public: + JuceEnumFormatEtc (const FORMATETC* const format_) + : refCount (1), + format (format_), + index (0) + { + } + + virtual ~JuceEnumFormatEtc() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IEnumFORMATETC) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall Clone (IEnumFORMATETC** result) + { + if (result == 0) + return E_POINTER; + + JuceEnumFormatEtc* const newOne = new JuceEnumFormatEtc (format); + newOne->index = index; + + *result = newOne; + return S_OK; + } + + HRESULT __stdcall Next (ULONG celt, LPFORMATETC lpFormatEtc, ULONG* pceltFetched) + { + if (pceltFetched != 0) + *pceltFetched = 0; + else if (celt != 1) + return S_FALSE; + + if (index == 0 && celt > 0 && lpFormatEtc != 0) + { + copyFormatEtc (lpFormatEtc [0], *format); + ++index; + + if (pceltFetched != 0) + *pceltFetched = 1; + + return S_OK; + } + + return S_FALSE; + } + + HRESULT __stdcall Skip (ULONG celt) + { + if (index + (int) celt >= 1) + return S_FALSE; + + index += celt; + return S_OK; + } + + HRESULT __stdcall Reset() + { + index = 0; + return S_OK; + } + +private: + int refCount; + const FORMATETC* const format; + int index; + + static void copyFormatEtc (FORMATETC& dest, const FORMATETC& source) + { + dest = source; + + if (source.ptd != 0) + { + dest.ptd = (DVTARGETDEVICE*) CoTaskMemAlloc (sizeof (DVTARGETDEVICE)); + *(dest.ptd) = *(source.ptd); + } + } + + JuceEnumFormatEtc (const JuceEnumFormatEtc&); + const JuceEnumFormatEtc& operator= (const JuceEnumFormatEtc&); +}; + +class JuceDataObject : public IDataObject +{ + JuceDropSource* const dropSource; + const FORMATETC* const format; + const STGMEDIUM* const medium; + int refCount; + + JuceDataObject (const JuceDataObject&); + const JuceDataObject& operator= (const JuceDataObject&); + +public: + JuceDataObject (JuceDropSource* const dropSource_, + const FORMATETC* const format_, + const STGMEDIUM* const medium_) + : dropSource (dropSource_), + format (format_), + medium (medium_), + refCount (1) + { + } + + virtual ~JuceDataObject() + { + jassert (refCount == 0); + } + + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IDataObject) + { + AddRef(); + *result = this; + return S_OK; + } + + *result = 0; + return E_NOINTERFACE; + } + + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + + HRESULT __stdcall GetData (FORMATETC __RPC_FAR* pFormatEtc, STGMEDIUM __RPC_FAR* pMedium) + { + if (pFormatEtc->tymed == format->tymed + && pFormatEtc->cfFormat == format->cfFormat + && pFormatEtc->dwAspect == format->dwAspect) + { + pMedium->tymed = format->tymed; + pMedium->pUnkForRelease = 0; + + if (format->tymed == TYMED_HGLOBAL) + { + const SIZE_T len = GlobalSize (medium->hGlobal); + void* const src = GlobalLock (medium->hGlobal); + void* const dst = GlobalAlloc (GMEM_FIXED, len); + + memcpy (dst, src, len); + + GlobalUnlock (medium->hGlobal); + + pMedium->hGlobal = dst; + return S_OK; + } + } + + return DV_E_FORMATETC; + } + + HRESULT __stdcall QueryGetData (FORMATETC __RPC_FAR* f) + { + if (f == 0) + return E_INVALIDARG; + + if (f->tymed == format->tymed + && f->cfFormat == format->cfFormat + && f->dwAspect == format->dwAspect) + return S_OK; + + return DV_E_FORMATETC; + } + + HRESULT __stdcall GetCanonicalFormatEtc (FORMATETC __RPC_FAR*, FORMATETC __RPC_FAR* pFormatEtcOut) + { + pFormatEtcOut->ptd = 0; + return E_NOTIMPL; + } + + HRESULT __stdcall EnumFormatEtc (DWORD direction, IEnumFORMATETC __RPC_FAR *__RPC_FAR *result) + { + if (result == 0) + return E_POINTER; + + if (direction == DATADIR_GET) + { + *result = new JuceEnumFormatEtc (format); + return S_OK; + } + + *result = 0; + return E_NOTIMPL; + } + + HRESULT __stdcall GetDataHere (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*) { return DATA_E_FORMATETC; } + HRESULT __stdcall SetData (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*, BOOL) { return E_NOTIMPL; } + HRESULT __stdcall DAdvise (FORMATETC __RPC_FAR*, DWORD, IAdviseSink __RPC_FAR*, DWORD __RPC_FAR*) { return OLE_E_ADVISENOTSUPPORTED; } + HRESULT __stdcall DUnadvise (DWORD) { return E_NOTIMPL; } + HRESULT __stdcall EnumDAdvise (IEnumSTATDATA __RPC_FAR *__RPC_FAR *) { return OLE_E_ADVISENOTSUPPORTED; } +}; + +static HDROP createHDrop (const StringArray& fileNames) throw() +{ + int totalChars = 0; + for (int i = fileNames.size(); --i >= 0;) + totalChars += fileNames[i].length() + 1; + + HDROP hDrop = (HDROP) GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, + sizeof (DROPFILES) + + sizeof (WCHAR) * (totalChars + 2)); + + if (hDrop != 0) + { + LPDROPFILES pDropFiles = (LPDROPFILES) GlobalLock (hDrop); + pDropFiles->pFiles = sizeof (DROPFILES); + + pDropFiles->fWide = true; + + WCHAR* fname = (WCHAR*) (((char*) pDropFiles) + sizeof (DROPFILES)); + + for (int i = 0; i < fileNames.size(); ++i) + { + fileNames[i].copyToBuffer (fname, 2048); + fname += fileNames[i].length() + 1; + } + + *fname = 0; + + GlobalUnlock (hDrop); + } + + return hDrop; +} + +static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) throw() +{ + JuceDropSource* const source = new JuceDropSource(); + JuceDataObject* const data = new JuceDataObject (source, format, medium); + + DWORD effect; + const HRESULT res = DoDragDrop (data, source, whatToDo, &effect); + + data->Release(); + source->Release(); + + return res == DRAGDROP_S_DROP; +} + +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMove) +{ + FORMATETC format = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; + + medium.hGlobal = createHDrop (files); + + return performDragDrop (&format, &medium, canMove ? (DROPEFFECT_COPY | DROPEFFECT_MOVE) + : DROPEFFECT_COPY); +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +{ + FORMATETC format = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; + STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; + + const int numChars = text.length(); + + medium.hGlobal = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, (numChars + 2) * sizeof (WCHAR)); + char* d = (char*) GlobalLock (medium.hGlobal); + + text.copyToBuffer ((WCHAR*) d, numChars + 1); + format.cfFormat = CF_UNICODETEXT; + + GlobalUnlock (medium.hGlobal); + + return performDragDrop (&format, &medium, DROPEFFECT_COPY | DROPEFFECT_MOVE); +} + +#endif +/********* End of inlined file: juce_win32_Windowing.cpp *********/ + +/********* Start of inlined file: juce_win32_Fonts.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +static int CALLBACK wfontEnum2 (ENUMLOGFONTEXW* lpelfe, + NEWTEXTMETRICEXW*, + int type, + LPARAM lParam) +{ + if (lpelfe != 0 && type == TRUETYPE_FONTTYPE) + { + const String fontName (lpelfe->elfLogFont.lfFaceName); + + ((StringArray*) lParam)->addIfNotAlreadyThere (fontName.removeCharacters (T("@"))); + } + + return 1; +} + +static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe, + NEWTEXTMETRICEXW*, + int type, + LPARAM lParam) +{ + if (lpelfe != 0 + && ((type & (DEVICE_FONTTYPE | RASTER_FONTTYPE)) == 0)) + { + LOGFONTW lf; + zerostruct (lf); + + lf.lfWeight = FW_DONTCARE; + lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfPitchAndFamily = FF_DONTCARE; + + const String fontName (lpelfe->elfLogFont.lfFaceName); + fontName.copyToBuffer (lf.lfFaceName, LF_FACESIZE - 1); + + HDC dc = CreateCompatibleDC (0); + EnumFontFamiliesEx (dc, &lf, + (FONTENUMPROCW) &wfontEnum2, + lParam, 0); + DeleteDC (dc); + } + + return 1; +} + +const StringArray Font::findAllTypefaceNames() throw() +{ + StringArray results; + HDC dc = CreateCompatibleDC (0); + + { + LOGFONTW lf; + zerostruct (lf); + + lf.lfWeight = FW_DONTCARE; + lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfPitchAndFamily = FF_DONTCARE; + lf.lfFaceName[0] = 0; + + EnumFontFamiliesEx (dc, &lf, + (FONTENUMPROCW) &wfontEnum1, + (LPARAM) &results, 0); + } + + DeleteDC (dc); + + results.sort (true); + return results; +} + +extern bool juce_IsRunningInWine() throw(); + +void Font::getDefaultFontNames (String& defaultSans, + String& defaultSerif, + String& defaultFixed) throw() +{ + if (juce_IsRunningInWine()) + { + // If we're running in Wine, then use fonts that might be available on Linux.. + defaultSans = "Bitstream Vera Sans"; + defaultSerif = "Bitstream Vera Serif"; + defaultFixed = "Bitstream Vera Sans Mono"; + } + else + { + defaultSans = "Verdana"; + defaultSerif = "Times"; + defaultFixed = "Lucida Console"; + } +} + +class FontDCHolder : private DeletedAtShutdown +{ + HDC dc; + String fontName; + KERNINGPAIR* kps; + int numKPs; + bool bold, italic; + int size; + + FontDCHolder (const FontDCHolder&); + const FontDCHolder& operator= (const FontDCHolder&); + +public: + HFONT fontH; + + FontDCHolder() throw() + : dc (0), + kps (0), + numKPs (0), + bold (false), + italic (false), + size (0) + { + } + + ~FontDCHolder() throw() + { + if (dc != 0) + { + DeleteDC (dc); + DeleteObject (fontH); + juce_free (kps); + } + + clearSingletonInstance(); + } + + juce_DeclareSingleton_SingleThreaded_Minimal (FontDCHolder); + + HDC loadFont (const String& fontName_, + const bool bold_, + const bool italic_, + const int size_) throw() + { + if (fontName != fontName_ || bold != bold_ || italic != italic_ || size != size_) + { + fontName = fontName_; + bold = bold_; + italic = italic_; + size = size_; + + if (dc != 0) + { + DeleteDC (dc); + DeleteObject (fontH); + + juce_free (kps); + kps = 0; + } + + fontH = 0; + + dc = CreateCompatibleDC (0); + SetMapperFlags (dc, 0); + SetMapMode (dc, MM_TEXT); + + LOGFONTW lfw; + zerostruct (lfw); + + lfw.lfCharSet = DEFAULT_CHARSET; + lfw.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lfw.lfOutPrecision = OUT_OUTLINE_PRECIS; + lfw.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; + lfw.lfQuality = PROOF_QUALITY; + lfw.lfItalic = (BYTE) (italic ? TRUE : FALSE); + lfw.lfWeight = bold ? FW_BOLD : FW_NORMAL; + fontName.copyToBuffer (lfw.lfFaceName, LF_FACESIZE - 1); + + lfw.lfHeight = size > 0 ? size : -256; + HFONT standardSizedFont = CreateFontIndirect (&lfw); + + if (standardSizedFont != 0) + { + if (SelectObject (dc, standardSizedFont) != 0) + { + fontH = standardSizedFont; + + if (size == 0) + { + OUTLINETEXTMETRIC otm; + if (GetOutlineTextMetrics (dc, sizeof (otm), &otm) != 0) + { + lfw.lfHeight = -(int) otm.otmEMSquare; + fontH = CreateFontIndirect (&lfw); + + SelectObject (dc, fontH); + DeleteObject (standardSizedFont); + } } } - - RegCloseKey (subKey); + else + { + jassertfalse + } + } + else + { + jassertfalse } } + + return dc; } - ASIOAudioIODeviceType (const ASIOAudioIODeviceType&); - const ASIOAudioIODeviceType& operator= (const ASIOAudioIODeviceType&); + KERNINGPAIR* getKerningPairs (int& numKPs_) throw() + { + if (kps == 0) + { + numKPs = GetKerningPairs (dc, 0, 0); + kps = (KERNINGPAIR*) juce_calloc (sizeof (KERNINGPAIR) * numKPs); + GetKerningPairs (dc, numKPs, kps); + } + + numKPs_ = numKPs; + return kps; + } }; -AudioIODeviceType* juce_createASIOAudioIODeviceType() -{ - return new ASIOAudioIODeviceType(); -} +juce_ImplementSingleton_SingleThreaded (FontDCHolder); -AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, - void* guid) +static bool addGlyphToTypeface (HDC dc, + juce_wchar character, + Typeface& dest, + bool addKerning) { - const int freeSlot = ASIOAudioIODeviceType::findFreeSlot(); - - if (freeSlot < 0) - return 0; - - return new ASIOAudioIODevice (name, *(CLSID*) guid, freeSlot); -} - -END_JUCE_NAMESPACE + Path destShape; + GLYPHMETRICS gm; -#undef log + float height; + BOOL ok = false; -#endif -/********* End of inlined file: juce_win32_ASIO.cpp *********/ + { + const WCHAR charToTest[] = { (WCHAR) character, 0 }; + WORD index = 0; -/********* Start of inlined file: juce_win32_AudioCDReader.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif + if (GetGlyphIndices (dc, charToTest, 1, &index, GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR + && index == 0xffff) + { + return false; + } + } -#include + TEXTMETRIC tm; + ok = GetTextMetrics (dc, &tm); -#if JUCE_USE_CDBURNER - // you'll need the Platform SDK for these headers - if you don't have it and don't - // need to use CD-burning, then you might just want to disable the JUCE_USE_CDBURNER - // flag in juce_Config.h to avoid these includes. - #include - #include -#endif + height = (float) tm.tmHeight; -BEGIN_JUCE_NAMESPACE + if (! ok) + { + dest.addGlyph (character, destShape, 0); + return true; + } -#ifdef _MSC_VER - #pragma warning (pop) -#endif + const float scaleX = 1.0f / height; + const float scaleY = -1.0f / height; + static const MAT2 identityMatrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; -//*************************************************************************** -// %%% TARGET STATUS VALUES %%% -//*************************************************************************** -#define STATUS_GOOD 0x00 // Status Good -#define STATUS_CHKCOND 0x02 // Check Condition -#define STATUS_CONDMET 0x04 // Condition Met -#define STATUS_BUSY 0x08 // Busy -#define STATUS_INTERM 0x10 // Intermediate -#define STATUS_INTCDMET 0x14 // Intermediate-condition met -#define STATUS_RESCONF 0x18 // Reservation conflict -#define STATUS_COMTERM 0x22 // Command Terminated -#define STATUS_QFULL 0x28 // Queue full + const int bufSize = GetGlyphOutline (dc, character, GGO_NATIVE, + &gm, 0, 0, &identityMatrix); -//*************************************************************************** -// %%% SCSI MISCELLANEOUS EQUATES %%% -//*************************************************************************** -#define MAXLUN 7 // Maximum Logical Unit Id -#define MAXTARG 7 // Maximum Target Id -#define MAX_SCSI_LUNS 64 // Maximum Number of SCSI LUNs -#define MAX_NUM_HA 8 // Maximum Number of SCSI HA's + if (bufSize > 0) + { + char* const data = (char*) juce_malloc (bufSize); -//*************************************************************************** -// %%% Commands for all Device Types %%% -//*************************************************************************** -#define SCSI_CHANGE_DEF 0x40 // Change Definition (Optional) -#define SCSI_COMPARE 0x39 // Compare (O) -#define SCSI_COPY 0x18 // Copy (O) -#define SCSI_COP_VERIFY 0x3A // Copy and Verify (O) -#define SCSI_INQUIRY 0x12 // Inquiry (MANDATORY) -#define SCSI_LOG_SELECT 0x4C // Log Select (O) -#define SCSI_LOG_SENSE 0x4D // Log Sense (O) -#define SCSI_MODE_SEL6 0x15 // Mode Select 6-byte (Device Specific) -#define SCSI_MODE_SEL10 0x55 // Mode Select 10-byte (Device Specific) -#define SCSI_MODE_SEN6 0x1A // Mode Sense 6-byte (Device Specific) -#define SCSI_MODE_SEN10 0x5A // Mode Sense 10-byte (Device Specific) -#define SCSI_READ_BUFF 0x3C // Read Buffer (O) -#define SCSI_REQ_SENSE 0x03 // Request Sense (MANDATORY) -#define SCSI_SEND_DIAG 0x1D // Send Diagnostic (O) -#define SCSI_TST_U_RDY 0x00 // Test Unit Ready (MANDATORY) -#define SCSI_WRITE_BUFF 0x3B // Write Buffer (O) + GetGlyphOutline (dc, character, GGO_NATIVE, &gm, + bufSize, data, &identityMatrix); -//*************************************************************************** -// %%% Commands Unique to Direct Access Devices %%% -//*************************************************************************** -#define SCSI_COMPARE 0x39 // Compare (O) -#define SCSI_FORMAT 0x04 // Format Unit (MANDATORY) -#define SCSI_LCK_UN_CAC 0x36 // Lock Unlock Cache (O) -#define SCSI_PREFETCH 0x34 // Prefetch (O) -#define SCSI_MED_REMOVL 0x1E // Prevent/Allow medium Removal (O) -#define SCSI_READ6 0x08 // Read 6-byte (MANDATORY) -#define SCSI_READ10 0x28 // Read 10-byte (MANDATORY) -#define SCSI_RD_CAPAC 0x25 // Read Capacity (MANDATORY) -#define SCSI_RD_DEFECT 0x37 // Read Defect Data (O) -#define SCSI_READ_LONG 0x3E // Read Long (O) -#define SCSI_REASS_BLK 0x07 // Reassign Blocks (O) -#define SCSI_RCV_DIAG 0x1C // Receive Diagnostic Results (O) -#define SCSI_RELEASE 0x17 // Release Unit (MANDATORY) -#define SCSI_REZERO 0x01 // Rezero Unit (O) -#define SCSI_SRCH_DAT_E 0x31 // Search Data Equal (O) -#define SCSI_SRCH_DAT_H 0x30 // Search Data High (O) -#define SCSI_SRCH_DAT_L 0x32 // Search Data Low (O) -#define SCSI_SEEK6 0x0B // Seek 6-Byte (O) -#define SCSI_SEEK10 0x2B // Seek 10-Byte (O) -#define SCSI_SEND_DIAG 0x1D // Send Diagnostics (MANDATORY) -#define SCSI_SET_LIMIT 0x33 // Set Limits (O) -#define SCSI_START_STP 0x1B // Start/Stop Unit (O) -#define SCSI_SYNC_CACHE 0x35 // Synchronize Cache (O) -#define SCSI_VERIFY 0x2F // Verify (O) -#define SCSI_WRITE6 0x0A // Write 6-Byte (MANDATORY) -#define SCSI_WRITE10 0x2A // Write 10-Byte (MANDATORY) -#define SCSI_WRT_VERIFY 0x2E // Write and Verify (O) -#define SCSI_WRITE_LONG 0x3F // Write Long (O) -#define SCSI_WRITE_SAME 0x41 // Write Same (O) + const TTPOLYGONHEADER* pheader = (TTPOLYGONHEADER*) data; -//*************************************************************************** -// %%% Commands Unique to Sequential Access Devices %%% -//*************************************************************************** -#define SCSI_ERASE 0x19 // Erase (MANDATORY) -#define SCSI_LOAD_UN 0x1b // Load/Unload (O) -#define SCSI_LOCATE 0x2B // Locate (O) -#define SCSI_RD_BLK_LIM 0x05 // Read Block Limits (MANDATORY) -#define SCSI_READ_POS 0x34 // Read Position (O) -#define SCSI_READ_REV 0x0F // Read Reverse (O) -#define SCSI_REC_BF_DAT 0x14 // Recover Buffer Data (O) -#define SCSI_RESERVE 0x16 // Reserve Unit (MANDATORY) -#define SCSI_REWIND 0x01 // Rewind (MANDATORY) -#define SCSI_SPACE 0x11 // Space (MANDATORY) -#define SCSI_VERIFY_T 0x13 // Verify (Tape) (O) -#define SCSI_WRT_FILE 0x10 // Write Filemarks (MANDATORY) + while ((char*) pheader < data + bufSize) + { + #define remapX(v) (scaleX * (v).x.value) + #define remapY(v) (scaleY * (v).y.value) -//*************************************************************************** -// %%% Commands Unique to Printer Devices %%% -//*************************************************************************** -#define SCSI_PRINT 0x0A // Print (MANDATORY) -#define SCSI_SLEW_PNT 0x0B // Slew and Print (O) -#define SCSI_STOP_PNT 0x1B // Stop Print (O) -#define SCSI_SYNC_BUFF 0x10 // Synchronize Buffer (O) + float x = remapX (pheader->pfxStart); + float y = remapY (pheader->pfxStart); -//*************************************************************************** -// %%% Commands Unique to Processor Devices %%% -//*************************************************************************** -#define SCSI_RECEIVE 0x08 // Receive (O) -#define SCSI_SEND 0x0A // Send (O) + destShape.startNewSubPath (x, y); -//*************************************************************************** -// %%% Commands Unique to Write-Once Devices %%% -//*************************************************************************** -#define SCSI_MEDIUM_SCN 0x38 // Medium Scan (O) -#define SCSI_SRCHDATE10 0x31 // Search Data Equal 10-Byte (O) -#define SCSI_SRCHDATE12 0xB1 // Search Data Equal 12-Byte (O) -#define SCSI_SRCHDATH10 0x30 // Search Data High 10-Byte (O) -#define SCSI_SRCHDATH12 0xB0 // Search Data High 12-Byte (O) -#define SCSI_SRCHDATL10 0x32 // Search Data Low 10-Byte (O) -#define SCSI_SRCHDATL12 0xB2 // Search Data Low 12-Byte (O) -#define SCSI_SET_LIM_10 0x33 // Set Limits 10-Byte (O) -#define SCSI_SET_LIM_12 0xB3 // Set Limits 10-Byte (O) -#define SCSI_VERIFY10 0x2F // Verify 10-Byte (O) -#define SCSI_VERIFY12 0xAF // Verify 12-Byte (O) -#define SCSI_WRITE12 0xAA // Write 12-Byte (O) -#define SCSI_WRT_VER10 0x2E // Write and Verify 10-Byte (O) -#define SCSI_WRT_VER12 0xAE // Write and Verify 12-Byte (O) + const TTPOLYCURVE* curve = (const TTPOLYCURVE*) ((const char*) pheader + sizeof (TTPOLYGONHEADER)); + const char* const curveEnd = ((const char*) pheader) + pheader->cb; -//*************************************************************************** -// %%% Commands Unique to CD-ROM Devices %%% -//*************************************************************************** -#define SCSI_PLAYAUD_10 0x45 // Play Audio 10-Byte (O) -#define SCSI_PLAYAUD_12 0xA5 // Play Audio 12-Byte 12-Byte (O) -#define SCSI_PLAYAUDMSF 0x47 // Play Audio MSF (O) -#define SCSI_PLAYA_TKIN 0x48 // Play Audio Track/Index (O) -#define SCSI_PLYTKREL10 0x49 // Play Track Relative 10-Byte (O) -#define SCSI_PLYTKREL12 0xA9 // Play Track Relative 12-Byte (O) -#define SCSI_READCDCAP 0x25 // Read CD-ROM Capacity (MANDATORY) -#define SCSI_READHEADER 0x44 // Read Header (O) -#define SCSI_SUBCHANNEL 0x42 // Read Subchannel (O) -#define SCSI_READ_TOC 0x43 // Read TOC (O) + while ((const char*) curve < curveEnd) + { + if (curve->wType == TT_PRIM_LINE) + { + for (int i = 0; i < curve->cpfx; ++i) + { + x = remapX (curve->apfx [i]); + y = remapY (curve->apfx [i]); -//*************************************************************************** -// %%% Commands Unique to Scanner Devices %%% -//*************************************************************************** -#define SCSI_GETDBSTAT 0x34 // Get Data Buffer Status (O) -#define SCSI_GETWINDOW 0x25 // Get Window (O) -#define SCSI_OBJECTPOS 0x31 // Object Postion (O) -#define SCSI_SCAN 0x1B // Scan (O) -#define SCSI_SETWINDOW 0x24 // Set Window (MANDATORY) + destShape.lineTo (x, y); + } + } + else if (curve->wType == TT_PRIM_QSPLINE) + { + for (int i = 0; i < curve->cpfx - 1; ++i) + { + const float x2 = remapX (curve->apfx [i]); + const float y2 = remapY (curve->apfx [i]); + float x3, y3; -//*************************************************************************** -// %%% Commands Unique to Optical Memory Devices %%% -//*************************************************************************** -#define SCSI_UpdateBlk 0x3D // Update Block (O) + if (i < curve->cpfx - 2) + { + x3 = 0.5f * (x2 + remapX (curve->apfx [i + 1])); + y3 = 0.5f * (y2 + remapY (curve->apfx [i + 1])); + } + else + { + x3 = remapX (curve->apfx [i + 1]); + y3 = remapY (curve->apfx [i + 1]); + } -//*************************************************************************** -// %%% Commands Unique to Medium Changer Devices %%% -//*************************************************************************** -#define SCSI_EXCHMEDIUM 0xA6 // Exchange Medium (O) -#define SCSI_INITELSTAT 0x07 // Initialize Element Status (O) -#define SCSI_POSTOELEM 0x2B // Position to Element (O) -#define SCSI_REQ_VE_ADD 0xB5 // Request Volume Element Address (O) -#define SCSI_SENDVOLTAG 0xB6 // Send Volume Tag (O) + destShape.quadraticTo (x2, y2, x3, y3); -//*************************************************************************** -// %%% Commands Unique to Communication Devices %%% -//*************************************************************************** -#define SCSI_GET_MSG_6 0x08 // Get Message 6-Byte (MANDATORY) -#define SCSI_GET_MSG_10 0x28 // Get Message 10-Byte (O) -#define SCSI_GET_MSG_12 0xA8 // Get Message 12-Byte (O) -#define SCSI_SND_MSG_6 0x0A // Send Message 6-Byte (MANDATORY) -#define SCSI_SND_MSG_10 0x2A // Send Message 10-Byte (O) -#define SCSI_SND_MSG_12 0xAA // Send Message 12-Byte (O) + x = x3; + y = y3; + } + } -//*************************************************************************** -// %%% Request Sense Data Format %%% -//*************************************************************************** -typedef struct { - BYTE ErrorCode; // Error Code (70H or 71H) - BYTE SegmentNum; // Number of current segment descriptor - BYTE SenseKey; // Sense Key(See bit definitions too) - BYTE InfoByte0; // Information MSB - BYTE InfoByte1; // Information MID - BYTE InfoByte2; // Information MID - BYTE InfoByte3; // Information LSB - BYTE AddSenLen; // Additional Sense Length - BYTE ComSpecInf0; // Command Specific Information MSB - BYTE ComSpecInf1; // Command Specific Information MID - BYTE ComSpecInf2; // Command Specific Information MID - BYTE ComSpecInf3; // Command Specific Information LSB - BYTE AddSenseCode; // Additional Sense Code - BYTE AddSenQual; // Additional Sense Code Qualifier - BYTE FieldRepUCode; // Field Replaceable Unit Code - BYTE SenKeySpec15; // Sense Key Specific 15th byte - BYTE SenKeySpec16; // Sense Key Specific 16th byte - BYTE SenKeySpec17; // Sense Key Specific 17th byte - BYTE AddSenseBytes; // Additional Sense Bytes -} SENSE_DATA_FMT; + curve = (const TTPOLYCURVE*) &(curve->apfx [curve->cpfx]); + } -//*************************************************************************** -// %%% REQUEST SENSE ERROR CODE %%% -//*************************************************************************** -#define SERROR_CURRENT 0x70 // Current Errors -#define SERROR_DEFERED 0x71 // Deferred Errors + pheader = (const TTPOLYGONHEADER*) curve; -//*************************************************************************** -// %%% REQUEST SENSE BIT DEFINITIONS %%% -//*************************************************************************** -#define SENSE_VALID 0x80 // Byte 0 Bit 7 -#define SENSE_FILEMRK 0x80 // Byte 2 Bit 7 -#define SENSE_EOM 0x40 // Byte 2 Bit 6 -#define SENSE_ILI 0x20 // Byte 2 Bit 5 + destShape.closeSubPath(); + } -//*************************************************************************** -// %%% REQUEST SENSE SENSE KEY DEFINITIONS %%% -//*************************************************************************** -#define KEY_NOSENSE 0x00 // No Sense -#define KEY_RECERROR 0x01 // Recovered Error -#define KEY_NOTREADY 0x02 // Not Ready -#define KEY_MEDIUMERR 0x03 // Medium Error -#define KEY_HARDERROR 0x04 // Hardware Error -#define KEY_ILLGLREQ 0x05 // Illegal Request -#define KEY_UNITATT 0x06 // Unit Attention -#define KEY_DATAPROT 0x07 // Data Protect -#define KEY_BLANKCHK 0x08 // Blank Check -#define KEY_VENDSPEC 0x09 // Vendor Specific -#define KEY_COPYABORT 0x0A // Copy Abort -#define KEY_EQUAL 0x0C // Equal (Search) -#define KEY_VOLOVRFLW 0x0D // Volume Overflow -#define KEY_MISCOMP 0x0E // Miscompare (Search) -#define KEY_RESERVED 0x0F // Reserved + juce_free (data); + } -//*************************************************************************** -// %%% PERIPHERAL DEVICE TYPE DEFINITIONS %%% -//*************************************************************************** -#define DTYPE_DASD 0x00 // Disk Device -#define DTYPE_SEQD 0x01 // Tape Device -#define DTYPE_PRNT 0x02 // Printer -#define DTYPE_PROC 0x03 // Processor -#define DTYPE_WORM 0x04 // Write-once read-multiple -#define DTYPE_CROM 0x05 // CD-ROM device -#define DTYPE_SCAN 0x06 // Scanner device -#define DTYPE_OPTI 0x07 // Optical memory device -#define DTYPE_JUKE 0x08 // Medium Changer device -#define DTYPE_COMM 0x09 // Communications device -#define DTYPE_RESL 0x0A // Reserved (low) -#define DTYPE_RESH 0x1E // Reserved (high) -#define DTYPE_UNKNOWN 0x1F // Unknown or no device type + dest.addGlyph (character, destShape, gm.gmCellIncX / height); -//*************************************************************************** -// %%% ANSI APPROVED VERSION DEFINITIONS %%% -//*************************************************************************** -#define ANSI_MAYBE 0x0 // Device may or may not be ANSI approved stand -#define ANSI_SCSI1 0x1 // Device complies to ANSI X3.131-1986 (SCSI-1) -#define ANSI_SCSI2 0x2 // Device complies to SCSI-2 -#define ANSI_RESLO 0x3 // Reserved (low) -#define ANSI_RESHI 0x7 // Reserved (high) + if (addKerning) + { + int numKPs; + const KERNINGPAIR* const kps = FontDCHolder::getInstance()->getKerningPairs (numKPs); -typedef struct -{ - USHORT Length; - UCHAR ScsiStatus; - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; - UCHAR CdbLength; - UCHAR SenseInfoLength; - UCHAR DataIn; - ULONG DataTransferLength; - ULONG TimeOutValue; - ULONG DataBufferOffset; - ULONG SenseInfoOffset; - UCHAR Cdb[16]; -} SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH; + for (int i = 0; i < numKPs; ++i) + { + if (kps[i].wFirst == character) + { + dest.addKerningPair (kps[i].wFirst, + kps[i].wSecond, + kps[i].iKernAmount / height); + } + } + } -typedef struct -{ - USHORT Length; - UCHAR ScsiStatus; - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; - UCHAR CdbLength; - UCHAR SenseInfoLength; - UCHAR DataIn; - ULONG DataTransferLength; - ULONG TimeOutValue; - PVOID DataBuffer; - ULONG SenseInfoOffset; - UCHAR Cdb[16]; -} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT; + return true; +} -typedef struct +bool Typeface::findAndAddSystemGlyph (juce_wchar character) throw() { - SCSI_PASS_THROUGH_DIRECT spt; - ULONG Filler; - UCHAR ucSenseBuf[32]; -} SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, *PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER; + HDC dc = FontDCHolder::getInstance()->loadFont (getName(), isBold(), isItalic(), 0); + return addGlyphToTypeface (dc, character, *this, true); +} -typedef struct +/*Image* Typeface::renderGlyphToImage (juce_wchar character, float& topLeftX, float& topLeftY) { - ULONG Length; - UCHAR PortNumber; - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; -} SCSI_ADDRESS, *PSCSI_ADDRESS; - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -#define FILE_ANY_ACCESS 0 -#ifndef FILE_READ_ACCESS -#define FILE_READ_ACCESS (0x0001) -#endif -#ifndef FILE_WRITE_ACCESS -#define FILE_WRITE_ACCESS (0x0002) -#endif + HDC dc = FontDCHolder::getInstance()->loadFont (getName(), isBold(), isItalic(), hintingSize); -#define IOCTL_SCSI_BASE 0x00000004 + int bufSize; + GLYPHMETRICS gm; -#define SCSI_IOCTL_DATA_OUT 0 -#define SCSI_IOCTL_DATA_IN 1 -#define SCSI_IOCTL_DATA_UNSPECIFIED 2 + const UINT format = GGO_GRAY2_BITMAP; + const int shift = 6; -#define CTL_CODE2( DevType, Function, Method, Access ) ( \ - ((DevType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) + if (wGetGlyphOutlineW != 0) + bufSize = wGetGlyphOutlineW (dc, character, format, &gm, 0, 0, &identityMatrix); + else + bufSize = GetGlyphOutline (dc, character, format, &gm, 0, 0, &identityMatrix); -#define IOCTL_SCSI_PASS_THROUGH CTL_CODE2( IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS ) -#define IOCTL_SCSI_GET_CAPABILITIES CTL_CODE2( IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE2( IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS ) -#define IOCTL_SCSI_GET_ADDRESS CTL_CODE2( IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS ) + Image* im = new Image (Image::SingleChannel, jmax (1, gm.gmBlackBoxX), jmax (1, gm.gmBlackBoxY), true); -#define SENSE_LEN 14 -#define SRB_DIR_SCSI 0x00 -#define SRB_POSTING 0x01 -#define SRB_ENABLE_RESIDUAL_COUNT 0x04 -#define SRB_DIR_IN 0x08 -#define SRB_DIR_OUT 0x10 -#define SRB_EVENT_NOTIFY 0x40 -#define RESIDUAL_COUNT_SUPPORTED 0x02 -#define MAX_SRB_TIMEOUT 1080001u -#define DEFAULT_SRB_TIMEOUT 1080001u + if (bufSize > 0) + { + topLeftX = (float) gm.gmptGlyphOrigin.x; + topLeftY = (float) -gm.gmptGlyphOrigin.y; -#define SC_HA_INQUIRY 0x00 -#define SC_GET_DEV_TYPE 0x01 -#define SC_EXEC_SCSI_CMD 0x02 -#define SC_ABORT_SRB 0x03 -#define SC_RESET_DEV 0x04 -#define SC_SET_HA_PARMS 0x05 -#define SC_GET_DISK_INFO 0x06 -#define SC_RESCAN_SCSI_BUS 0x07 -#define SC_GETSET_TIMEOUTS 0x08 + uint8* const data = (uint8*) juce_calloc (bufSize); -#define SS_PENDING 0x00 -#define SS_COMP 0x01 -#define SS_ABORTED 0x02 -#define SS_ABORT_FAIL 0x03 -#define SS_ERR 0x04 -#define SS_INVALID_CMD 0x80 -#define SS_INVALID_HA 0x81 -#define SS_NO_DEVICE 0x82 -#define SS_INVALID_SRB 0xE0 -#define SS_OLD_MANAGER 0xE1 -#define SS_BUFFER_ALIGN 0xE1 -#define SS_ILLEGAL_MODE 0xE2 -#define SS_NO_ASPI 0xE3 -#define SS_FAILED_INIT 0xE4 -#define SS_ASPI_IS_BUSY 0xE5 -#define SS_BUFFER_TO_BIG 0xE6 -#define SS_BUFFER_TOO_BIG 0xE6 -#define SS_MISMATCHED_COMPONENTS 0xE7 -#define SS_NO_ADAPTERS 0xE8 -#define SS_INSUFFICIENT_RESOURCES 0xE9 -#define SS_ASPI_IS_SHUTDOWN 0xEA -#define SS_BAD_INSTALL 0xEB + if (wGetGlyphOutlineW != 0) + wGetGlyphOutlineW (dc, character, format, &gm, bufSize, data, &identityMatrix); + else + GetGlyphOutline (dc, character, format, &gm, bufSize, data, &identityMatrix); -#define HASTAT_OK 0x00 -#define HASTAT_SEL_TO 0x11 -#define HASTAT_DO_DU 0x12 -#define HASTAT_BUS_FREE 0x13 -#define HASTAT_PHASE_ERR 0x14 -#define HASTAT_TIMEOUT 0x09 -#define HASTAT_COMMAND_TIMEOUT 0x0B -#define HASTAT_MESSAGE_REJECT 0x0D -#define HASTAT_BUS_RESET 0x0E -#define HASTAT_PARITY_ERROR 0x0F -#define HASTAT_REQUEST_SENSE_FAILED 0x10 + const int stride = ((gm.gmBlackBoxX + 3) & ~3); -#define PACKED -#pragma pack(1) + for (int y = gm.gmBlackBoxY; --y >= 0;) + { + for (int x = gm.gmBlackBoxX; --x >= 0;) + { + const int level = data [x + y * stride] << shift; -typedef struct -{ - BYTE SRB_Cmd; - BYTE SRB_Status; - BYTE SRB_HaID; - BYTE SRB_Flags; - DWORD SRB_Hdr_Rsvd; - BYTE HA_Count; - BYTE HA_SCSI_ID; - BYTE HA_ManagerId[16]; - BYTE HA_Identifier[16]; - BYTE HA_Unique[16]; - WORD HA_Rsvd1; - BYTE pad[20]; -} PACKED SRB_HAInquiry, *PSRB_HAInquiry, FAR *LPSRB_HAInquiry; + if (level > 0) + im->setPixelAt (x, y, Colour ((uint8) 0xff, (uint8) 0xff, (uint8) 0xff, (uint8) jmin (0xff, level))); + } + } -typedef struct -{ - BYTE SRB_Cmd; - BYTE SRB_Status; - BYTE SRB_HaID; - BYTE SRB_Flags; - DWORD SRB_Hdr_Rsvd; - BYTE SRB_Target; - BYTE SRB_Lun; - BYTE SRB_DeviceType; - BYTE SRB_Rsvd1; - BYTE pad[68]; -} PACKED SRB_GDEVBlock, *PSRB_GDEVBlock, FAR *LPSRB_GDEVBlock; + juce_free (data); + } -typedef struct -{ - BYTE SRB_Cmd; - BYTE SRB_Status; - BYTE SRB_HaID; - BYTE SRB_Flags; - DWORD SRB_Hdr_Rsvd; - BYTE SRB_Target; - BYTE SRB_Lun; - WORD SRB_Rsvd1; - DWORD SRB_BufLen; - BYTE FAR *SRB_BufPointer; - BYTE SRB_SenseLen; - BYTE SRB_CDBLen; - BYTE SRB_HaStat; - BYTE SRB_TargStat; - VOID FAR *SRB_PostProc; - BYTE SRB_Rsvd2[20]; - BYTE CDBByte[16]; - BYTE SenseArea[SENSE_LEN+2]; -} PACKED SRB_ExecSCSICmd, *PSRB_ExecSCSICmd, FAR *LPSRB_ExecSCSICmd; + return im; +}*/ -typedef struct +void Typeface::initialiseTypefaceCharacteristics (const String& fontName, + bool bold, + bool italic, + bool addAllGlyphsToFont) throw() { - BYTE SRB_Cmd; - BYTE SRB_Status; - BYTE SRB_HaId; - BYTE SRB_Flags; - DWORD SRB_Hdr_Rsvd; -} PACKED SRB, *PSRB, FAR *LPSRB; + clear(); -#pragma pack() + HDC dc = FontDCHolder::getInstance()->loadFont (fontName, bold, italic, 0); -struct CDDeviceInfo -{ - char vendor[9]; - char productId[17]; - char rev[5]; - char vendorSpec[21]; + float height; + int firstChar, lastChar; - BYTE ha; - BYTE tgt; - BYTE lun; - char scsiDriveLetter; // will be 0 if not using scsi -}; + { + TEXTMETRIC tm; + GetTextMetrics (dc, &tm); -class CDReadBuffer -{ -public: - int startFrame; - int numFrames; - int dataStartOffset; - int dataLength; - BYTE* buffer; - int bufferSize; - int index; - bool wantsIndex; + height = (float) tm.tmHeight; + firstChar = tm.tmFirstChar; + lastChar = tm.tmLastChar; - CDReadBuffer (const int numberOfFrames) - : startFrame (0), - numFrames (0), - dataStartOffset (0), - dataLength (0), - index (0), - wantsIndex (false) - { - bufferSize = 2352 * numberOfFrames; - buffer = (BYTE*) malloc (bufferSize); + setAscent (tm.tmAscent / height); + setDefaultCharacter (tm.tmDefaultChar); } - ~CDReadBuffer() - { - free (buffer); - } + setName (fontName); + setBold (bold); + setItalic (italic); - bool isZero() const + if (addAllGlyphsToFont) { - BYTE* p = buffer + dataStartOffset; + for (int character = firstChar; character <= lastChar; ++character) + addGlyphToTypeface (dc, (juce_wchar) character, *this, false); - for (int i = dataLength; --i >= 0;) - if (*p++ != 0) - return false; + int numKPs; + const KERNINGPAIR* const kps = FontDCHolder::getInstance()->getKerningPairs (numKPs); - return true; + for (int i = 0; i < numKPs; ++i) + { + addKerningPair (kps[i].wFirst, + kps[i].wSecond, + kps[i].iKernAmount / height); + } } -}; - -class CDDeviceHandle; - -class CDController -{ -public: - CDController(); - virtual ~CDController(); - - virtual bool read (CDReadBuffer* t) = 0; - virtual void shutDown(); - - bool readAudio (CDReadBuffer* t, CDReadBuffer* overlapBuffer = 0); - int getLastIndex(); - -public: - bool initialised; - - CDDeviceHandle* deviceInfo; - int framesToCheck, framesOverlap; +} - void prepare (SRB_ExecSCSICmd& s); - void perform (SRB_ExecSCSICmd& s); - void setPaused (bool paused); -}; +#endif +/********* End of inlined file: juce_win32_Fonts.cpp *********/ -#pragma pack(1) +/********* Start of inlined file: juce_win32_FileChooser.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -struct TOCTRACK -{ - BYTE rsvd; - BYTE ADR; - BYTE trackNumber; - BYTE rsvd2; - BYTE addr[4]; -}; +static const void* defaultDirPath = 0; +static String returnedString; // need this to get non-existent pathnames from the directory chooser +static Component* currentExtraFileWin = 0; -struct TOC +static bool areThereAnyAlwaysOnTopWindows() { - WORD tocLen; - BYTE firstTrack; - BYTE lastTrack; - TOCTRACK tracks[100]; -}; + for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) + { + Component* c = Desktop::getInstance().getComponent (i); -#pragma pack() + if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) + return true; + } -enum -{ - READTYPE_ANY = 0, - READTYPE_ATAPI1 = 1, - READTYPE_ATAPI2 = 2, - READTYPE_READ6 = 3, - READTYPE_READ10 = 4, - READTYPE_READ_D8 = 5, - READTYPE_READ_D4 = 6, - READTYPE_READ_D4_1 = 7, - READTYPE_READ10_2 = 8 -}; + return false; +} -class CDDeviceHandle +static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) { -public: - CDDeviceHandle (const CDDeviceInfo* const device) - : scsiHandle (0), - readType (READTYPE_ANY), - controller (0) + if (msg == BFFM_INITIALIZED) { - memcpy (&info, device, sizeof (info)); + SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); } - - ~CDDeviceHandle() + else if (msg == BFFM_VALIDATEFAILEDW) { - if (controller != 0) - { - controller->shutDown(); - delete controller; - } - - if (scsiHandle != 0) - CloseHandle (scsiHandle); + returnedString = (LPCWSTR) lParam; + } + else if (msg == BFFM_VALIDATEFAILEDA) + { + returnedString = (const char*) lParam; } - bool readTOC (TOC* lpToc, bool useMSF); - bool readAudio (CDReadBuffer* buffer, CDReadBuffer* overlapBuffer = 0); - void openDrawer (bool shouldBeOpen); - - CDDeviceInfo info; - HANDLE scsiHandle; - BYTE readType; - -private: - CDController* controller; - - bool testController (const int readType, - CDController* const newController, - CDReadBuffer* const bufferToUse); -}; - -DWORD (*fGetASPI32SupportInfo)(void); -DWORD (*fSendASPI32Command)(LPSRB); + return 0; +} -static HINSTANCE winAspiLib = 0; -static bool usingScsi = false; -static bool initialised = false; +void juce_setWindowStyleBit (HWND h, int styleType, int feature, bool bitIsSet); -static bool InitialiseCDRipper() +static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) { - if (! initialised) + if (currentExtraFileWin != 0) { - initialised = true; + if (uiMsg == WM_INITDIALOG) + { + HWND dialogH = GetParent (hdlg); + jassert (dialogH != 0); + if (dialogH == 0) + dialogH = hdlg; - OSVERSIONINFO info; - info.dwOSVersionInfoSize = sizeof (info); - GetVersionEx (&info); + RECT r, cr; + GetWindowRect (dialogH, &r); + GetClientRect (dialogH, &cr); - usingScsi = (info.dwPlatformId == VER_PLATFORM_WIN32_NT) && (info.dwMajorVersion > 4); + SetWindowPos (dialogH, 0, + r.left, r.top, + currentExtraFileWin->getWidth() + jmax (150, r.right - r.left), + jmax (150, r.bottom - r.top), + SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); - if (! usingScsi) + currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); + currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); + + SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); + } + else if (uiMsg == WM_NOTIFY) { - fGetASPI32SupportInfo = 0; - fSendASPI32Command = 0; - winAspiLib = LoadLibrary (_T("WNASPI32.DLL")); + LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; - if (winAspiLib != 0) + if (ofn->hdr.code == CDN_SELCHANGE) { - fGetASPI32SupportInfo = (DWORD(*)(void)) GetProcAddress (winAspiLib, "GetASPI32SupportInfo"); - fSendASPI32Command = (DWORD(*)(LPSRB)) GetProcAddress (winAspiLib, "SendASPI32Command"); + FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); - if (fGetASPI32SupportInfo == 0 || fSendASPI32Command == 0) - return false; - } - else - { - usingScsi = true; + if (comp != 0) + { + TCHAR path [MAX_PATH * 2]; + path[0] = 0; + CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); + + const String fn ((const WCHAR*) path); + + comp->selectedFileChanged (File (fn)); + } } } } - return true; + return 0; } -static void DeinitialiseCDRipper() +class FPComponentHolder : public Component { - if (winAspiLib != 0) +public: + FPComponentHolder() { - fGetASPI32SupportInfo = 0; - fSendASPI32Command = 0; - FreeLibrary (winAspiLib); - winAspiLib = 0; + setVisible (true); + setOpaque (true); } - initialised = false; -} + ~FPComponentHolder() + { + } -static HANDLE CreateSCSIDeviceHandle (char driveLetter) + void paint (Graphics& g) + { + g.fillAll (Colours::lightgrey); + } + +private: + FPComponentHolder (const FPComponentHolder&); + const FPComponentHolder& operator= (const FPComponentHolder&); +}; + +void FileChooser::showPlatformDialog (OwnedArray& results, + const String& title, + const File& currentFileOrDirectory, + const String& filter, + bool selectsDirectory, + bool isSaveDialogue, + bool warnAboutOverwritingExistingFiles, + bool selectMultipleFiles, + FilePreviewComponent* extraInfoComponent) { - TCHAR devicePath[8]; - devicePath[0] = '\\'; - devicePath[1] = '\\'; - devicePath[2] = '.'; - devicePath[3] = '\\'; - devicePath[4] = driveLetter; - devicePath[5] = ':'; - devicePath[6] = 0; + const int numCharsAvailable = 32768; + MemoryBlock filenameSpace ((numCharsAvailable + 1) * sizeof (WCHAR), true); + WCHAR* const fname = (WCHAR*) filenameSpace.getData(); + int fnameIdx = 0; - OSVERSIONINFO info; - info.dwOSVersionInfoSize = sizeof (info); - GetVersionEx (&info); + JUCE_TRY + { + // use a modal window as the parent for this dialog box + // to block input from other app windows + const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); - DWORD flags = GENERIC_READ; + Component w (String::empty); + w.setBounds (mainMon.getX() + mainMon.getWidth() / 4, + mainMon.getY() + mainMon.getHeight() / 4, + 0, 0); + w.setOpaque (true); + w.setAlwaysOnTop (areThereAnyAlwaysOnTopWindows()); + w.addToDesktop (0); - if ((info.dwPlatformId == VER_PLATFORM_WIN32_NT) && (info.dwMajorVersion > 4)) - flags = GENERIC_READ | GENERIC_WRITE; + if (extraInfoComponent == 0) + w.enterModalState(); - HANDLE h = CreateFile (devicePath, flags, FILE_SHARE_WRITE | FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + String initialDir; - if (h == INVALID_HANDLE_VALUE) - { - flags ^= GENERIC_WRITE; - h = CreateFile (devicePath, flags, FILE_SHARE_WRITE | FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - } + if (currentFileOrDirectory.isDirectory()) + { + initialDir = currentFileOrDirectory.getFullPathName(); + } + else + { + currentFileOrDirectory.getFileName().copyToBuffer (fname, numCharsAvailable); - return h; -} + initialDir = currentFileOrDirectory.getParentDirectory().getFullPathName(); + } -static DWORD performScsiPassThroughCommand (const LPSRB_ExecSCSICmd srb, - const char driveLetter, - HANDLE& deviceHandle, - const bool retryOnFailure = true) -{ - SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER s; - zerostruct (s); + if (currentExtraFileWin->isValidComponent()) + { + jassertfalse + return; + } - s.spt.Length = sizeof (SCSI_PASS_THROUGH); - s.spt.CdbLength = srb->SRB_CDBLen; + if (selectsDirectory) + { + LPITEMIDLIST list = 0; + filenameSpace.fillWith (0); - s.spt.DataIn = (BYTE) ((srb->SRB_Flags & SRB_DIR_IN) - ? SCSI_IOCTL_DATA_IN - : ((srb->SRB_Flags & SRB_DIR_OUT) - ? SCSI_IOCTL_DATA_OUT - : SCSI_IOCTL_DATA_UNSPECIFIED)); + { + BROWSEINFO bi; + zerostruct (bi); - s.spt.DataTransferLength = srb->SRB_BufLen; - s.spt.TimeOutValue = 5; - s.spt.DataBuffer = srb->SRB_BufPointer; - s.spt.SenseInfoOffset = offsetof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, ucSenseBuf); + bi.hwndOwner = (HWND) w.getWindowHandle(); + bi.pszDisplayName = fname; + bi.lpszTitle = title; + bi.lpfn = browseCallbackProc; +#ifdef BIF_USENEWUI + bi.ulFlags = BIF_USENEWUI | BIF_VALIDATE; +#else + bi.ulFlags = 0x50; +#endif + defaultDirPath = (const WCHAR*) initialDir; - memcpy (s.spt.Cdb, srb->CDBByte, srb->SRB_CDBLen); + list = SHBrowseForFolder (&bi); - srb->SRB_Status = SS_ERR; - srb->SRB_TargStat = 0x0004; + if (! SHGetPathFromIDListW (list, fname)) + { + fname[0] = 0; + returnedString = String::empty; + } + } - DWORD bytesReturned = 0; + LPMALLOC al; + if (list != 0 && SUCCEEDED (SHGetMalloc (&al))) + al->Free (list); - if (DeviceIoControl (deviceHandle, IOCTL_SCSI_PASS_THROUGH_DIRECT, - &s, sizeof (s), - &s, sizeof (s), - &bytesReturned, 0) != 0) - { - srb->SRB_Status = SS_COMP; - } - else if (retryOnFailure) - { - const DWORD error = GetLastError(); + defaultDirPath = 0; - if ((error == ERROR_MEDIA_CHANGED) || (error == ERROR_INVALID_HANDLE)) + if (returnedString.isNotEmpty()) + { + const String stringFName (fname); + + results.add (new File (File (stringFName).getSiblingFile (returnedString))); + returnedString = String::empty; + + return; + } + } + else { - if (error != ERROR_INVALID_HANDLE) - CloseHandle (deviceHandle); + DWORD flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - deviceHandle = CreateSCSIDeviceHandle (driveLetter); + if (warnAboutOverwritingExistingFiles) + flags |= OFN_OVERWRITEPROMPT; - return performScsiPassThroughCommand (srb, driveLetter, deviceHandle, false); - } - } + if (selectMultipleFiles) + flags |= OFN_ALLOWMULTISELECT; - return srb->SRB_Status; -} + if (extraInfoComponent != 0) + { + flags |= OFN_ENABLEHOOK; -// Controller types.. + currentExtraFileWin = new FPComponentHolder(); + currentExtraFileWin->addAndMakeVisible (extraInfoComponent); + currentExtraFileWin->setSize (jlimit (20, 800, extraInfoComponent->getWidth()), + extraInfoComponent->getHeight()); + currentExtraFileWin->addToDesktop (0); -class ControllerType1 : public CDController -{ -public: - ControllerType1() {} - ~ControllerType1() {} + currentExtraFileWin->enterModalState(); + } - bool read (CDReadBuffer* rb) - { - if (rb->numFrames * 2352 > rb->bufferSize) - return false; + { + WCHAR filters [1024]; + zeromem (filters, sizeof (filters)); + filter.copyToBuffer (filters, 1024); + filter.copyToBuffer (filters + filter.length() + 1, + 1022 - filter.length()); - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = rb->bufferSize; - s.SRB_BufPointer = rb->buffer; - s.SRB_CDBLen = 12; - s.CDBByte[0] = 0xBE; - s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); - s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); - s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); - s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); - s.CDBByte[9] = (BYTE)((deviceInfo->readType == READTYPE_ATAPI1) ? 0x10 : 0xF0); - perform (s); + OPENFILENAMEW of; + zerostruct (of); - if (s.SRB_Status != SS_COMP) - return false; +#ifdef OPENFILENAME_SIZE_VERSION_400W + of.lStructSize = OPENFILENAME_SIZE_VERSION_400W; +#else + of.lStructSize = sizeof (of); +#endif + of.hwndOwner = (HWND) w.getWindowHandle(); + of.lpstrFilter = filters; + of.nFilterIndex = 1; + of.lpstrFile = fname; + of.nMaxFile = numCharsAvailable; + of.lpstrInitialDir = initialDir; + of.lpstrTitle = title; + of.Flags = flags; - rb->dataLength = rb->numFrames * 2352; - rb->dataStartOffset = 0; - return true; + if (extraInfoComponent != 0) + of.lpfnHook = &openCallback; + + if (isSaveDialogue) + { + if (! GetSaveFileName (&of)) + fname[0] = 0; + else + fnameIdx = of.nFileOffset; + } + else + { + if (! GetOpenFileName (&of)) + fname[0] = 0; + else + fnameIdx = of.nFileOffset; + } + } + } } -}; +#if JUCE_CATCH_UNHANDLED_EXCEPTIONS + catch (...) + { + fname[0] = 0; + } +#endif -class ControllerType2 : public CDController -{ -public: - ControllerType2() {} - ~ControllerType2() {} + deleteAndZero (currentExtraFileWin); - void shutDown() + const WCHAR* const files = fname; + + if (selectMultipleFiles && fnameIdx > 0 && files [fnameIdx - 1] == 0) { - if (initialised) - { - BYTE bufPointer[] = { 0, 0, 0, 8, 83, 0, 0, 0, 0, 0, 8, 0 }; + const WCHAR* filename = files + fnameIdx; - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_EVENT_NOTIFY | SRB_ENABLE_RESIDUAL_COUNT; - s.SRB_BufLen = 0x0C; - s.SRB_BufPointer = bufPointer; - s.SRB_CDBLen = 6; - s.CDBByte[0] = 0x15; - s.CDBByte[4] = 0x0C; - perform (s); + while (*filename != 0) + { + const String filepath (String (files) + T("\\") + String (filename)); + results.add (new File (filepath)); + filename += CharacterFunctions::length (filename) + 1; } } - - bool init() + else if (files[0] != 0) { - SRB_ExecSCSICmd s; - s.SRB_Status = SS_ERR; + results.add (new File (files)); + } +} - if (deviceInfo->readType == READTYPE_READ10_2) +#endif +/********* End of inlined file: juce_win32_FileChooser.cpp *********/ + +/********* Start of inlined file: juce_win32_Misc.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +void SystemClipboard::copyTextToClipboard (const String& text) throw() +{ + if (OpenClipboard (0) != 0) + { + if (EmptyClipboard() != 0) { - BYTE bufPointer1[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48, 35, 6, 0, 0, 0, 0, 0, 128 }; - BYTE bufPointer2[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48, 1, 6, 32, 7, 0, 0, 0, 0 }; + const int len = text.length(); - for (int i = 0; i < 2; ++i) + if (len > 0) { - prepare (s); - s.SRB_Flags = SRB_EVENT_NOTIFY; - s.SRB_BufLen = 0x14; - s.SRB_BufPointer = (i == 0) ? bufPointer1 : bufPointer2; - s.SRB_CDBLen = 6; - s.CDBByte[0] = 0x15; - s.CDBByte[1] = 0x10; - s.CDBByte[4] = 0x14; - perform (s); + HGLOBAL bufH = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, + (len + 1) * sizeof (wchar_t)); - if (s.SRB_Status != SS_COMP) - return false; - } - } - else - { - BYTE bufPointer[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48 }; + if (bufH != 0) + { + wchar_t* const data = (wchar_t*) GlobalLock (bufH); + text.copyToBuffer (data, len); + GlobalUnlock (bufH); - prepare (s); - s.SRB_Flags = SRB_EVENT_NOTIFY; - s.SRB_BufLen = 0x0C; - s.SRB_BufPointer = bufPointer; - s.SRB_CDBLen = 6; - s.CDBByte[0] = 0x15; - s.CDBByte[4] = 0x0C; - perform (s); + SetClipboardData (CF_UNICODETEXT, bufH); + } + } } - return s.SRB_Status == SS_COMP; + CloseClipboard(); } +} - bool read (CDReadBuffer* rb) +const String SystemClipboard::getTextFromClipboard() throw() +{ + String result; + + if (OpenClipboard (0) != 0) { - if (rb->numFrames * 2352 > rb->bufferSize) - return false; + HANDLE bufH = GetClipboardData (CF_UNICODETEXT); - if (!initialised) + if (bufH != 0) { - initialised = init(); + const wchar_t* const data = (const wchar_t*) GlobalLock (bufH); - if (!initialised) - return false; + if (data != 0) + { + result = String (data, (int) (GlobalSize (bufH) / sizeof (tchar))); + + GlobalUnlock (bufH); + } } - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = rb->bufferSize; - s.SRB_BufPointer = rb->buffer; - s.SRB_CDBLen = 10; - s.CDBByte[0] = 0x28; - s.CDBByte[1] = (BYTE)(deviceInfo->info.lun << 5); - s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); - s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); - s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); - s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); - perform (s); + CloseClipboard(); + } - if (s.SRB_Status != SS_COMP) - return false; + return result; +} - rb->dataLength = rb->numFrames * 2352; - rb->dataStartOffset = 0; +#endif +/********* End of inlined file: juce_win32_Misc.cpp *********/ - return true; - } -}; +/********* Start of inlined file: juce_win32_ActiveXComponent.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -class ControllerType3 : public CDController +class JuceIStorage : public IStorage { + int refCount; + public: - ControllerType3() {} - ~ControllerType3() {} + JuceIStorage() : refCount (1) {} - bool read (CDReadBuffer* rb) + virtual ~JuceIStorage() { - if (rb->numFrames * 2352 > rb->bufferSize) - return false; + jassert (refCount == 0); + } - if (!initialised) + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IStorage) { - setPaused (false); - initialised = true; + AddRef(); + *result = this; + return S_OK; } - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = rb->numFrames * 2352; - s.SRB_BufPointer = rb->buffer; - s.SRB_CDBLen = 12; - s.CDBByte[0] = 0xD8; - s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); - s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); - s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); - s.CDBByte[9] = (BYTE)(rb->numFrames & 0xFF); - perform (s); + *result = 0; + return E_NOINTERFACE; + } - if (s.SRB_Status != SS_COMP) - return false; + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - rb->dataLength = rb->numFrames * 2352; - rb->dataStartOffset = 0; + HRESULT __stdcall CreateStream (const WCHAR*, DWORD, DWORD, DWORD, IStream**) { return E_NOTIMPL; } + HRESULT __stdcall OpenStream (const WCHAR*, void*, DWORD, DWORD, IStream**) { return E_NOTIMPL; } + HRESULT __stdcall CreateStorage (const WCHAR*, DWORD, DWORD, DWORD, IStorage**) { return E_NOTIMPL; } + HRESULT __stdcall OpenStorage (const WCHAR*, IStorage*, DWORD, SNB, DWORD, IStorage**) { return E_NOTIMPL; } + HRESULT __stdcall CopyTo (DWORD, IID const*, SNB, IStorage*) { return E_NOTIMPL; } + HRESULT __stdcall MoveElementTo (const OLECHAR*,IStorage*, const OLECHAR*, DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Commit (DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Revert() { return E_NOTIMPL; } + HRESULT __stdcall EnumElements (DWORD, void*, DWORD, IEnumSTATSTG**) { return E_NOTIMPL; } + HRESULT __stdcall DestroyElement (const OLECHAR*) { return E_NOTIMPL; } + HRESULT __stdcall RenameElement (const WCHAR*, const WCHAR*) { return E_NOTIMPL; } + HRESULT __stdcall SetElementTimes (const WCHAR*, FILETIME const*, FILETIME const*, FILETIME const*) { return E_NOTIMPL; } + HRESULT __stdcall SetClass (REFCLSID) { return S_OK; } + HRESULT __stdcall SetStateBits (DWORD, DWORD) { return E_NOTIMPL; } + HRESULT __stdcall Stat (STATSTG*, DWORD) { return E_NOTIMPL; } - return true; - } + juce_UseDebuggingNewOperator }; -class ControllerType4 : public CDController +class JuceOleInPlaceFrame : public IOleInPlaceFrame { -public: - ControllerType4() {} - ~ControllerType4() {} + int refCount; + HWND window; - bool selectD4Mode() +public: + JuceOleInPlaceFrame (HWND window_) + : refCount (1), + window (window_) { - BYTE bufPointer[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 48 }; - - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_EVENT_NOTIFY; - s.SRB_CDBLen = 6; - s.SRB_BufLen = 12; - s.SRB_BufPointer = bufPointer; - s.CDBByte[0] = 0x15; - s.CDBByte[1] = 0x10; - s.CDBByte[4] = 0x08; - perform (s); - - return s.SRB_Status == SS_COMP; } - bool read (CDReadBuffer* rb) + virtual ~JuceOleInPlaceFrame() { - if (rb->numFrames * 2352 > rb->bufferSize) - return false; + jassert (refCount == 0); + } - if (!initialised) + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleInPlaceFrame) { - setPaused (true); - - if (deviceInfo->readType == READTYPE_READ_D4_1) - selectD4Mode(); - - initialised = true; + AddRef(); + *result = this; + return S_OK; } - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = rb->bufferSize; - s.SRB_BufPointer = rb->buffer; - s.SRB_CDBLen = 10; - s.CDBByte[0] = 0xD4; - s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); - s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); - s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); - s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); - perform (s); - - if (s.SRB_Status != SS_COMP) - return false; - - rb->dataLength = rb->numFrames * 2352; - rb->dataStartOffset = 0; - - return true; + *result = 0; + return E_NOINTERFACE; } -}; - -CDController::CDController() : initialised (false) -{ -} - -CDController::~CDController() -{ -} - -void CDController::prepare (SRB_ExecSCSICmd& s) -{ - zerostruct (s); - - s.SRB_Cmd = SC_EXEC_SCSI_CMD; - s.SRB_HaID = deviceInfo->info.ha; - s.SRB_Target = deviceInfo->info.tgt; - s.SRB_Lun = deviceInfo->info.lun; - s.SRB_SenseLen = SENSE_LEN; -} - -void CDController::perform (SRB_ExecSCSICmd& s) -{ - HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - s.SRB_PostProc = (void*)event; - ResetEvent (event); - - DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, - deviceInfo->info.scsiDriveLetter, - deviceInfo->scsiHandle) - : fSendASPI32Command ((LPSRB)&s); + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - if (status == SS_PENDING) - WaitForSingleObject (event, 4000); + HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } + HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall GetBorder (LPRECT) { return E_NOTIMPL; } + HRESULT __stdcall RequestBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetActiveObject (IOleInPlaceActiveObject*, LPCOLESTR) { return S_OK; } + HRESULT __stdcall InsertMenus (HMENU, LPOLEMENUGROUPWIDTHS) { return E_NOTIMPL; } + HRESULT __stdcall SetMenu (HMENU, HOLEMENU, HWND) { return S_OK; } + HRESULT __stdcall RemoveMenus (HMENU) { return E_NOTIMPL; } + HRESULT __stdcall SetStatusText (LPCOLESTR) { return S_OK; } + HRESULT __stdcall EnableModeless (BOOL) { return S_OK; } + HRESULT __stdcall TranslateAccelerator(LPMSG, WORD) { return E_NOTIMPL; } - CloseHandle (event); -} + juce_UseDebuggingNewOperator +}; -void CDController::setPaused (bool paused) +class JuceIOleInPlaceSite : public IOleInPlaceSite { - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_EVENT_NOTIFY; - s.SRB_CDBLen = 10; - s.CDBByte[0] = 0x4B; - s.CDBByte[8] = (BYTE) (paused ? 0 : 1); - perform (s); -} + int refCount; + HWND window; + JuceOleInPlaceFrame* frame; -void CDController::shutDown() -{ -} +public: + JuceIOleInPlaceSite (HWND window_) + : refCount (1), + window (window_) + { + frame = new JuceOleInPlaceFrame (window); + } -bool CDController::readAudio (CDReadBuffer* rb, CDReadBuffer* overlapBuffer) -{ - if (overlapBuffer != 0) + virtual ~JuceIOleInPlaceSite() { - const bool canDoJitter = (overlapBuffer->bufferSize >= 2352 * framesToCheck); - const bool doJitter = canDoJitter && ! overlapBuffer->isZero(); + jassert (refCount == 0); + frame->Release(); + } - if (doJitter - && overlapBuffer->startFrame > 0 - && overlapBuffer->numFrames > 0 - && overlapBuffer->dataLength > 0) + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleInPlaceSite) { - const int numFrames = rb->numFrames; + AddRef(); + *result = this; + return S_OK; + } - if (overlapBuffer->startFrame == (rb->startFrame - framesToCheck)) - { - rb->startFrame -= framesOverlap; + *result = 0; + return E_NOINTERFACE; + } - if (framesToCheck < framesOverlap - && numFrames + framesOverlap <= rb->bufferSize / 2352) - rb->numFrames += framesOverlap; - } - else - { - overlapBuffer->dataLength = 0; - overlapBuffer->startFrame = 0; - overlapBuffer->numFrames = 0; - } - } + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - if (! read (rb)) - return false; + HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } + HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall CanInPlaceActivate() { return S_OK; } + HRESULT __stdcall OnInPlaceActivate() { return S_OK; } + HRESULT __stdcall OnUIActivate() { return S_OK; } - if (doJitter) - { - const int checkLen = framesToCheck * 2352; - const int maxToCheck = rb->dataLength - checkLen; + HRESULT __stdcall GetWindowContext (LPOLEINPLACEFRAME* lplpFrame, LPOLEINPLACEUIWINDOW* lplpDoc, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO lpFrameInfo) + { + frame->AddRef(); + *lplpFrame = frame; + *lplpDoc = 0; + lpFrameInfo->fMDIApp = FALSE; + lpFrameInfo->hwndFrame = window; + lpFrameInfo->haccel = 0; + lpFrameInfo->cAccelEntries = 0; + return S_OK; + } - if (overlapBuffer->dataLength == 0 || overlapBuffer->isZero()) - return true; + HRESULT __stdcall Scroll (SIZE) { return E_NOTIMPL; } + HRESULT __stdcall OnUIDeactivate (BOOL) { return S_OK; } + HRESULT __stdcall OnInPlaceDeactivate() { return S_OK; } + HRESULT __stdcall DiscardUndoState() { return E_NOTIMPL; } + HRESULT __stdcall DeactivateAndUndo() { return E_NOTIMPL; } + HRESULT __stdcall OnPosRectChange (LPCRECT) { return S_OK; } - BYTE* const p = overlapBuffer->buffer + overlapBuffer->dataStartOffset; - bool found = false; + juce_UseDebuggingNewOperator +}; - for (int i = 0; i < maxToCheck; ++i) - { - if (!memcmp (p, rb->buffer + i, checkLen)) - { - i += checkLen; - rb->dataStartOffset = i; - rb->dataLength -= i; - rb->startFrame = overlapBuffer->startFrame + framesToCheck; - found = true; - break; - } - } +class JuceIOleClientSite : public IOleClientSite +{ + int refCount; + JuceIOleInPlaceSite* inplaceSite; - rb->numFrames = rb->dataLength / 2352; - rb->dataLength = 2352 * rb->numFrames; +public: + JuceIOleClientSite (HWND window) + : refCount (1) + { + inplaceSite = new JuceIOleInPlaceSite (window); + } - if (!found) - return false; - } + virtual ~JuceIOleClientSite() + { + jassert (refCount == 0); + inplaceSite->Release(); + } - if (canDoJitter) + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IOleClientSite) { - memcpy (overlapBuffer->buffer, - rb->buffer + rb->dataStartOffset + 2352 * (rb->numFrames - framesToCheck), - 2352 * framesToCheck); - - overlapBuffer->startFrame = rb->startFrame + rb->numFrames - framesToCheck; - overlapBuffer->numFrames = framesToCheck; - overlapBuffer->dataLength = 2352 * framesToCheck; - overlapBuffer->dataStartOffset = 0; + AddRef(); + *result = this; + return S_OK; } - else + else if (id == IID_IOleInPlaceSite) { - overlapBuffer->startFrame = 0; - overlapBuffer->numFrames = 0; - overlapBuffer->dataLength = 0; + inplaceSite->AddRef(); + *result = inplaceSite; + return S_OK; } - return true; - } - else - { - return read (rb); + *result = 0; + return E_NOINTERFACE; } -} - -int CDController::getLastIndex() -{ - char qdata[100]; - SRB_ExecSCSICmd s; - prepare (s); - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = sizeof (qdata); - s.SRB_BufPointer = (BYTE*)qdata; - s.SRB_CDBLen = 12; - s.CDBByte[0] = 0x42; - s.CDBByte[1] = (BYTE)(deviceInfo->info.lun << 5); - s.CDBByte[2] = 64; - s.CDBByte[3] = 1; // get current position - s.CDBByte[7] = 0; - s.CDBByte[8] = (BYTE)sizeof (qdata); - perform (s); + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - if (s.SRB_Status == SS_COMP) - return qdata[7]; + HRESULT __stdcall SaveObject() { return E_NOTIMPL; } + HRESULT __stdcall GetMoniker (DWORD, DWORD, IMoniker**) { return E_NOTIMPL; } + HRESULT __stdcall GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = 0; return E_NOINTERFACE; } + HRESULT __stdcall ShowObject() { return S_OK; } + HRESULT __stdcall OnShowWindow (BOOL) { return E_NOTIMPL; } + HRESULT __stdcall RequestNewObjectLayout() { return E_NOTIMPL; } - return 0; -} + juce_UseDebuggingNewOperator +}; -bool CDDeviceHandle::readTOC (TOC* lpToc, bool useMSF) +class ActiveXControlData : public ComponentMovementWatcher { - HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - - SRB_ExecSCSICmd s; - zerostruct (s); - - s.SRB_Cmd = SC_EXEC_SCSI_CMD; - s.SRB_HaID = info.ha; - s.SRB_Target = info.tgt; - s.SRB_Lun = info.lun; - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = 0x324; - s.SRB_BufPointer = (BYTE*)lpToc; - s.SRB_SenseLen = 0x0E; - s.SRB_CDBLen = 0x0A; - s.SRB_PostProc = (void*)event; - s.CDBByte[0] = 0x43; - s.CDBByte[1] = (BYTE)(useMSF ? 0x02 : 0x00); - s.CDBByte[7] = 0x03; - s.CDBByte[8] = 0x24; - - ResetEvent (event); - DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, info.scsiDriveLetter, scsiHandle) - : fSendASPI32Command ((LPSRB)&s); - - if (status == SS_PENDING) - WaitForSingleObject (event, 4000); + ActiveXControlComponent* const owner; + bool wasShowing; - CloseHandle (event); - return (s.SRB_Status == SS_COMP); -} +public: + HWND controlHWND; + IStorage* storage; + IOleClientSite* clientSite; + IOleObject* control; -bool CDDeviceHandle::readAudio (CDReadBuffer* const buffer, - CDReadBuffer* const overlapBuffer) -{ - if (controller == 0) + ActiveXControlData (HWND hwnd, + ActiveXControlComponent* const owner_) + : ComponentMovementWatcher (owner_), + owner (owner_), + wasShowing (owner_ != 0 && owner_->isShowing()), + controlHWND (0), + storage (new JuceIStorage()), + clientSite (new JuceIOleClientSite (hwnd)), + control (0) { - testController (READTYPE_ATAPI2, new ControllerType1(), buffer) - || testController (READTYPE_ATAPI1, new ControllerType1(), buffer) - || testController (READTYPE_READ10_2, new ControllerType2(), buffer) - || testController (READTYPE_READ10, new ControllerType2(), buffer) - || testController (READTYPE_READ_D8, new ControllerType3(), buffer) - || testController (READTYPE_READ_D4, new ControllerType4(), buffer) - || testController (READTYPE_READ_D4_1, new ControllerType4(), buffer); } - buffer->index = 0; - - if ((controller != 0) - && controller->readAudio (buffer, overlapBuffer)) + ~ActiveXControlData() { - if (buffer->wantsIndex) - buffer->index = controller->getLastIndex(); + if (control != 0) + { + control->Close (OLECLOSE_NOSAVE); + control->Release(); + } - return true; + clientSite->Release(); + storage->Release(); } - return false; -} - -void CDDeviceHandle::openDrawer (bool shouldBeOpen) -{ - if (shouldBeOpen) + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) { - if (controller != 0) - { - controller->shutDown(); - delete controller; - controller = 0; - } + Component* const topComp = owner->getTopLevelComponent(); - if (scsiHandle != 0) + if (topComp->getPeer() != 0) { - CloseHandle (scsiHandle); - scsiHandle = 0; + int x = 0, y = 0; + owner->relativePositionToOtherComponent (topComp, x, y); + + owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); } } - SRB_ExecSCSICmd s; - zerostruct (s); - - s.SRB_Cmd = SC_EXEC_SCSI_CMD; - s.SRB_HaID = info.ha; - s.SRB_Target = info.tgt; - s.SRB_Lun = info.lun; - s.SRB_SenseLen = SENSE_LEN; - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = 0; - s.SRB_BufPointer = 0; - s.SRB_CDBLen = 12; - s.CDBByte[0] = 0x1b; - s.CDBByte[1] = (BYTE)(info.lun << 5); - s.CDBByte[4] = (BYTE)((shouldBeOpen) ? 2 : 3); + void componentPeerChanged() + { + const bool isShowingNow = owner->isShowing(); - HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - s.SRB_PostProc = (void*)event; + if (wasShowing != isShowingNow) + { + wasShowing = isShowingNow; - ResetEvent (event); + owner->setControlVisible (isShowingNow); + } + } - DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, info.scsiDriveLetter, scsiHandle) - : fSendASPI32Command ((LPSRB)&s); + void componentVisibilityChanged (Component&) + { + componentPeerChanged(); + } - if (status == SS_PENDING) - WaitForSingleObject (event, 4000); + static bool doesWindowMatch (const ActiveXControlComponent* const ax, HWND hwnd) + { + return ((ActiveXControlData*) ax->control) != 0 + && ((ActiveXControlData*) ax->control)->controlHWND == hwnd; + } +}; - CloseHandle (event); -} +static VoidArray activeXComps; -bool CDDeviceHandle::testController (const int type, - CDController* const newController, - CDReadBuffer* const rb) +static HWND getHWND (const ActiveXControlComponent* const component) { - controller = newController; - readType = (BYTE)type; - - controller->deviceInfo = this; - controller->framesToCheck = 1; - controller->framesOverlap = 3; - - bool passed = false; - - memset (rb->buffer, 0xcd, rb->bufferSize); - - if (controller->read (rb)) - { - passed = true; - int* p = (int*) (rb->buffer + rb->dataStartOffset); - int wrong = 0; + HWND hwnd = 0; - for (int i = rb->dataLength / 4; --i >= 0;) - { - if (*p++ == (int) 0xcdcdcdcd) - { - if (++wrong == 4) - { - passed = false; - break; - } - } - else - { - wrong = 0; - } - } - } + const IID iid = IID_IOleWindow; + IOleWindow* const window = (IOleWindow*) component->queryInterface (&iid); - if (! passed) + if (window != 0) { - controller->shutDown(); - delete controller; - controller = 0; + window->GetWindow (&hwnd); + window->Release(); } - return passed; + return hwnd; } -static void GetAspiDeviceInfo (CDDeviceInfo* dev, BYTE ha, BYTE tgt, BYTE lun) +static void offerActiveXMouseEventToPeer (ComponentPeer* const peer, HWND hwnd, UINT message, LPARAM lParam) { - HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - - const int bufSize = 128; - BYTE buffer[bufSize]; - zeromem (buffer, bufSize); + RECT activeXRect, peerRect; + GetWindowRect (hwnd, &activeXRect); + GetWindowRect ((HWND) peer->getNativeHandle(), &peerRect); - SRB_ExecSCSICmd s; - zerostruct (s); + const int mx = GET_X_LPARAM (lParam) + activeXRect.left - peerRect.left; + const int my = GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top; + const int64 mouseEventTime = getMouseEventTime(); - s.SRB_Cmd = SC_EXEC_SCSI_CMD; - s.SRB_HaID = ha; - s.SRB_Target = tgt; - s.SRB_Lun = lun; - s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; - s.SRB_BufLen = bufSize; - s.SRB_BufPointer = buffer; - s.SRB_SenseLen = SENSE_LEN; - s.SRB_CDBLen = 6; - s.SRB_PostProc = (void*)event; - s.CDBByte[0] = SCSI_INQUIRY; - s.CDBByte[4] = 100; + const int oldModifiers = currentModifiers; + ModifierKeys::getCurrentModifiersRealtime(); // to update the mouse button flags - ResetEvent (event); + switch (message) + { + case WM_MOUSEMOVE: + if (ModifierKeys (currentModifiers).isAnyMouseButtonDown()) + peer->handleMouseDrag (mx, my, mouseEventTime); + else + peer->handleMouseMove (mx, my, mouseEventTime); + break; - if (fSendASPI32Command ((LPSRB)&s) == SS_PENDING) - WaitForSingleObject (event, 4000); + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + peer->handleMouseDown (mx, my, mouseEventTime); + break; - CloseHandle (event); + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + peer->handleMouseUp (oldModifiers, mx, my, mouseEventTime); + break; - if (s.SRB_Status == SS_COMP) - { - memcpy (dev->vendor, &buffer[8], 8); - memcpy (dev->productId, &buffer[16], 16); - memcpy (dev->rev, &buffer[32], 4); - memcpy (dev->vendorSpec, &buffer[36], 20); + default: + break; } } -static int FindCDDevices (CDDeviceInfo* const list, - int maxItems) +// intercepts events going to an activeX control, so we can sneakily use the mouse events +static LRESULT CALLBACK activeXHookWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - int count = 0; - - if (usingScsi) + for (int i = activeXComps.size(); --i >= 0;) { - for (char driveLetter = 'b'; driveLetter <= 'z'; ++driveLetter) - { - TCHAR drivePath[8]; - drivePath[0] = driveLetter; - drivePath[1] = ':'; - drivePath[2] = '\\'; - drivePath[3] = 0; + const ActiveXControlComponent* const ax = (const ActiveXControlComponent*) activeXComps.getUnchecked(i); - if (GetDriveType (drivePath) == DRIVE_CDROM) + if (ActiveXControlData::doesWindowMatch (ax, hwnd)) + { + switch (message) { - HANDLE h = CreateSCSIDeviceHandle (driveLetter); - - if (h != INVALID_HANDLE_VALUE) + case WM_MOUSEMOVE: + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_MBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + if (ax->isShowing()) { - BYTE buffer[100], passThroughStruct[1024]; - zeromem (buffer, sizeof (buffer)); - zeromem (passThroughStruct, sizeof (passThroughStruct)); - - PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER p = (PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER)passThroughStruct; - - p->spt.Length = sizeof (SCSI_PASS_THROUGH); - p->spt.CdbLength = 6; - p->spt.SenseInfoLength = 24; - p->spt.DataIn = SCSI_IOCTL_DATA_IN; - p->spt.DataTransferLength = 100; - p->spt.TimeOutValue = 2; - p->spt.DataBuffer = buffer; - p->spt.SenseInfoOffset = offsetof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, ucSenseBuf); - p->spt.Cdb[0] = 0x12; - p->spt.Cdb[4] = 100; - - DWORD bytesReturned = 0; + ComponentPeer* const peer = ax->getPeer(); - if (DeviceIoControl (h, IOCTL_SCSI_PASS_THROUGH_DIRECT, - p, sizeof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER), - p, sizeof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER), - &bytesReturned, 0) != 0) + if (peer != 0) { - zeromem (&list[count], sizeof (CDDeviceInfo)); - - list[count].scsiDriveLetter = driveLetter; - - memcpy (list[count].vendor, &buffer[8], 8); - memcpy (list[count].productId, &buffer[16], 16); - memcpy (list[count].rev, &buffer[32], 4); - memcpy (list[count].vendorSpec, &buffer[36], 20); - - zeromem (passThroughStruct, sizeof (passThroughStruct)); - PSCSI_ADDRESS scsiAddr = (PSCSI_ADDRESS)passThroughStruct; - - scsiAddr->Length = sizeof (SCSI_ADDRESS); + offerActiveXMouseEventToPeer (peer, hwnd, message, lParam); - if (DeviceIoControl (h, IOCTL_SCSI_GET_ADDRESS, - 0, 0, scsiAddr, sizeof (SCSI_ADDRESS), - &bytesReturned, 0) != 0) - { - list[count].ha = scsiAddr->PortNumber; - list[count].tgt = scsiAddr->TargetId; - list[count].lun = scsiAddr->Lun; - ++count; - } + if (! ax->areMouseEventsAllowed()) + return 0; } - - CloseHandle (h); } + break; + + default: + break; } + + return CallWindowProc ((WNDPROC) (ax->originalWndProc), hwnd, message, wParam, lParam); } } - else - { - const DWORD d = fGetASPI32SupportInfo(); - BYTE status = HIBYTE (LOWORD (d)); - if (status != SS_COMP || status == SS_NO_ADAPTERS) - return 0; + return DefWindowProc (hwnd, message, wParam, lParam); +} - const int numAdapters = LOBYTE (LOWORD (d)); +ActiveXControlComponent::ActiveXControlComponent() + : originalWndProc (0), + control (0), + mouseEventsAllowed (true) +{ + activeXComps.add (this); +} - for (BYTE ha = 0; ha < numAdapters; ++ha) - { - SRB_HAInquiry s; - zerostruct (s); +ActiveXControlComponent::~ActiveXControlComponent() +{ + deleteControl(); + activeXComps.removeValue (this); +} - s.SRB_Cmd = SC_HA_INQUIRY; - s.SRB_HaID = ha; - fSendASPI32Command ((LPSRB)&s); +void ActiveXControlComponent::paint (Graphics& g) +{ + if (control == 0) + g.fillAll (Colours::lightgrey); +} - if (s.SRB_Status == SS_COMP) - { - maxItems = (int)s.HA_Unique[3]; +bool ActiveXControlComponent::createControl (const void* controlIID) +{ + deleteControl(); + ComponentPeer* const peer = getPeer(); - if (maxItems == 0) - maxItems = 8; + // the component must have already been added to a real window when you call this! + jassert (dynamic_cast (peer) != 0); - for (BYTE tgt = 0; tgt < maxItems; ++tgt) - { - for (BYTE lun = 0; lun < 8; ++lun) - { - SRB_GDEVBlock sb; - zerostruct (sb); + if (dynamic_cast (peer) != 0) + { + int x = 0, y = 0; + relativePositionToOtherComponent (getTopLevelComponent(), x, y); - sb.SRB_Cmd = SC_GET_DEV_TYPE; - sb.SRB_HaID = ha; - sb.SRB_Target = tgt; - sb.SRB_Lun = lun; - fSendASPI32Command ((LPSRB) &sb); + HWND hwnd = (HWND) peer->getNativeHandle(); - if (sb.SRB_Status == SS_COMP - && sb.SRB_DeviceType == DTYPE_CROM) - { - zeromem (&list[count], sizeof (CDDeviceInfo)); + ActiveXControlData* const info = new ActiveXControlData (hwnd, this); - list[count].ha = ha; - list[count].tgt = tgt; - list[count].lun = lun; + HRESULT hr; + if ((hr = OleCreate (*(const IID*) controlIID, IID_IOleObject, 1 /*OLERENDER_DRAW*/, 0, + info->clientSite, info->storage, + (void**) &(info->control))) == S_OK) + { + info->control->SetHostNames (L"Juce", 0); + + if (OleSetContainedObject (info->control, TRUE) == S_OK) + { + RECT rect; + rect.left = x; + rect.top = y; + rect.right = x + getWidth(); + rect.bottom = y + getHeight(); - GetAspiDeviceInfo (&(list[count]), ha, tgt, lun); + if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) + { + control = info; + setControlBounds (Rectangle (x, y, getWidth(), getHeight())); - ++count; - } + info->controlHWND = getHWND (this); + + if (info->controlHWND != 0) + { + originalWndProc = (void*) GetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC); + SetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); } + + return true; } } } + + delete info; } - return count; + return false; } -static int ripperUsers = 0; -static bool initialisedOk = false; - -class DeinitialiseTimer : private Timer, - private DeletedAtShutdown +void ActiveXControlComponent::deleteControl() { - DeinitialiseTimer (const DeinitialiseTimer&); - const DeinitialiseTimer& operator= (const DeinitialiseTimer&); + ActiveXControlData* const info = (ActiveXControlData*) control; -public: - DeinitialiseTimer() + if (info != 0) { - startTimer (4000); + delete info; + control = 0; + originalWndProc = 0; } +} - ~DeinitialiseTimer() - { - if (--ripperUsers == 0) - DeinitialiseCDRipper(); - } +void* ActiveXControlComponent::queryInterface (const void* iid) const +{ + ActiveXControlData* const info = (ActiveXControlData*) control; - void timerCallback() - { - delete this; - } + void* result = 0; - juce_UseDebuggingNewOperator -}; + if (info != 0 && info->control != 0 + && info->control->QueryInterface (*(const IID*) iid, &result) == S_OK) + return result; -static void incUserCount() -{ - if (ripperUsers++ == 0) - initialisedOk = InitialiseCDRipper(); + return 0; } -static void decUserCount() +void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const { - new DeinitialiseTimer(); + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; + + if (hwnd != 0) + MoveWindow (hwnd, newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight(), TRUE); } -struct CDDeviceWrapper +void ActiveXControlComponent::setControlVisible (const bool shouldBeVisible) const { - CDDeviceHandle* cdH; - CDReadBuffer* overlapBuffer; - bool jitter; -}; + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; -static int getAddressOf (const TOCTRACK* const t) -{ - return (((DWORD)t->addr[0]) << 24) + (((DWORD)t->addr[1]) << 16) + - (((DWORD)t->addr[2]) << 8) + ((DWORD)t->addr[3]); + if (hwnd != 0) + ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); } -static int getMSFAddressOf (const TOCTRACK* const t) +void ActiveXControlComponent::setMouseEventsAllowed (const bool eventsCanReachControl) { - return 60 * t->addr[1] + t->addr[2]; + mouseEventsAllowed = eventsCanReachControl; } -static const int samplesPerFrame = 44100 / 75; -static const int bytesPerFrame = samplesPerFrame * 4; - -const StringArray AudioCDReader::getAvailableCDNames() -{ - StringArray results; - incUserCount(); - - if (initialisedOk) - { - CDDeviceInfo list[8]; - const int num = FindCDDevices (list, 8); - - decUserCount(); - - for (int i = 0; i < num; ++i) - { - String s; +#endif +/********* End of inlined file: juce_win32_ActiveXComponent.cpp *********/ - if (list[i].scsiDriveLetter > 0) - s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": "); +/********* Start of inlined file: juce_win32_QuickTimeMovieComponent.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_QUICKTIME - s << String (list[i].vendor).trim() - << T(" ") << String (list[i].productId).trim() - << T(" ") << String (list[i].rev).trim(); +using namespace QTOLibrary; +using namespace QTOControlLib; - results.add (s); - } - } +bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle); - return results; -} +static bool hasLoadedQT = false; +static bool isQTAvailable = false; -static CDDeviceHandle* openHandle (const CDDeviceInfo* const device) +struct QTMovieCompInternal { - SRB_GDEVBlock s; - zerostruct (s); - - s.SRB_Cmd = SC_GET_DEV_TYPE; - s.SRB_HaID = device->ha; - s.SRB_Target = device->tgt; - s.SRB_Lun = device->lun; - - if (usingScsi) + QTMovieCompInternal() + : dataHandle (0) { - HANDLE h = CreateSCSIDeviceHandle (device->scsiDriveLetter); - - if (h != INVALID_HANDLE_VALUE) - { - CDDeviceHandle* cdh = new CDDeviceHandle (device); - cdh->scsiHandle = h; - return cdh; - } } - else + + ~QTMovieCompInternal() { - if (fSendASPI32Command ((LPSRB)&s) == SS_COMP - && s.SRB_DeviceType == DTYPE_CROM) - { - return new CDDeviceHandle (device); - } + clearHandle(); } - return 0; -} + IQTControlPtr qtControlInternal; + IQTMoviePtr qtMovieInternal; -AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) -{ - incUserCount(); + Handle dataHandle; - if (initialisedOk) + void clearHandle() { - CDDeviceInfo list[8]; - const int num = FindCDDevices (list, 8); - - if (((unsigned int) deviceIndex) < (unsigned int) num) + if (dataHandle != 0) { - CDDeviceHandle* const handle = openHandle (&(list[deviceIndex])); - - if (handle != 0) - { - CDDeviceWrapper* const d = new CDDeviceWrapper(); - d->cdH = handle; - d->overlapBuffer = new CDReadBuffer(3); - - return new AudioCDReader (d); - } + DisposeHandle (dataHandle); + dataHandle = 0; } } +}; - decUserCount(); - return 0; -} +#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal) +#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal) -AudioCDReader::AudioCDReader (void* handle_) - : AudioFormatReader (0, T("CD Audio")), - handle (handle_), - indexingEnabled (false), - lastIndex (0), - firstFrameInBuffer (0), - samplesInBuffer (0) +QuickTimeMovieComponent::QuickTimeMovieComponent() + : movieLoaded (false), + controllerVisible (true) { - jassert (handle_ != 0); - - refreshTrackLengths(); - - sampleRate = 44100.0; - bitsPerSample = 16; - lengthInSamples = getPositionOfTrackStart (numTracks); - numChannels = 2; - usesFloatingPointData = false; - - buffer.setSize (4 * bytesPerFrame, true); + internal = new QTMovieCompInternal(); + setMouseEventsAllowed (false); } -AudioCDReader::~AudioCDReader() +QuickTimeMovieComponent::~QuickTimeMovieComponent() { - CDDeviceWrapper* const device = (CDDeviceWrapper*)handle; + closeMovie(); + qtControl = 0; - delete device->cdH; - delete device->overlapBuffer; - delete device; + deleteControl(); - decUserCount(); + delete internal; + internal = 0; } -bool AudioCDReader::read (int** destSamples, - int64 startSampleInFile, - int numSamples) +bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() { - CDDeviceWrapper* const device = (CDDeviceWrapper*)handle; - - bool ok = true; - int offset = 0; - - if (startSampleInFile < 0) + if (! hasLoadedQT) { - int* l = destSamples[0]; - int* r = destSamples[1]; - - numSamples += (int) startSampleInFile; - offset -= (int) startSampleInFile; - - while (++startSampleInFile <= 0) - { - *l++ = 0; + hasLoadedQT = true; - if (r != 0) - *r++ = 0; - } + isQTAvailable = (InitializeQTML (0) == noErr) + && (EnterMovies() == noErr); } - while (numSamples > 0) + return isQTAvailable; +} + +void QuickTimeMovieComponent::createControlIfNeeded() +{ + if (isShowing() && ! isControlCreated()) { - const int bufferStartSample = firstFrameInBuffer * samplesPerFrame; - const int bufferEndSample = bufferStartSample + samplesInBuffer; + const IID qtIID = __uuidof (QTControl); - if (startSampleInFile >= bufferStartSample - && startSampleInFile < bufferEndSample) + if (createControl (&qtIID)) { - const int toDo = (int) jmin ((int64) numSamples, bufferEndSample - startSampleInFile); - - int* const l = destSamples[0] + offset; - int* const r = destSamples[1] + offset; - const short* src = (const short*) buffer.getData(); - src += 2 * (startSampleInFile - bufferStartSample); + const IID qtInterfaceIID = __uuidof (IQTControl); + qtControl = (IQTControl*) queryInterface (&qtInterfaceIID); - for (int i = 0; i < toDo; ++i) + if (qtControl != 0) { - l[i] = src [i << 1] << 16; + qtControl->Release(); // it has one ref too many at this point - if (r != 0) - r[i] = src [(i << 1) + 1] << 16; - } + qtControl->QuickTimeInitialize(); + qtControl->PutSizing (qtMovieFitsControl); - offset += toDo; - startSampleInFile += toDo; - numSamples -= toDo; + if (movieFile != File::nonexistent) + loadMovie (movieFile, controllerVisible); + } } - else - { - const int framesInBuffer = buffer.getSize() / bytesPerFrame; - const int frameNeeded = (int) (startSampleInFile / samplesPerFrame); + } +} - if (firstFrameInBuffer + framesInBuffer != frameNeeded) - { - device->overlapBuffer->dataLength = 0; - device->overlapBuffer->startFrame = 0; - device->overlapBuffer->numFrames = 0; - device->jitter = false; - } +bool QuickTimeMovieComponent::isControlCreated() const +{ + return isControlOpen(); +} - firstFrameInBuffer = frameNeeded; - lastIndex = 0; +bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, + const bool isControllerVisible) +{ + movieFile = File::nonexistent; + movieLoaded = false; + qtMovie = 0; + controllerVisible = isControllerVisible; + createControlIfNeeded(); - CDReadBuffer readBuffer (framesInBuffer + 4); - readBuffer.wantsIndex = indexingEnabled; + if (isControlCreated()) + { + if (qtControl != 0) + { + qtControl->Put_MovieHandle (0); + ((QTMovieCompInternal*) internal)->clearHandle(); - int i; - for (i = 5; --i >= 0;) + Movie movie; + if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, ((QTMovieCompInternal*) internal)->dataHandle)) { - readBuffer.startFrame = frameNeeded; - readBuffer.numFrames = framesInBuffer; - - if (device->cdH->readAudio (&readBuffer, (device->jitter) ? device->overlapBuffer : 0)) - break; - else - device->overlapBuffer->dataLength = 0; - } + qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie); - if (i >= 0) - { - memcpy ((char*) buffer.getData(), - readBuffer.buffer + readBuffer.dataStartOffset, - readBuffer.dataLength); + qtMovie = qtControl->GetMovie(); - samplesInBuffer = readBuffer.dataLength >> 2; - lastIndex = readBuffer.index; + if (qtMovie != 0) + qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard + : qtMovieControllerTypeNone); } - else - { - int* l = destSamples[0] + offset; - int* r = destSamples[1] + offset; - - while (--numSamples >= 0) - { - *l++ = 0; - - if (r != 0) - *r++ = 0; - } - // sometimes the read fails for just the very last couple of blocks, so - // we'll ignore and errors in the last half-second of the disk.. - ok = startSampleInFile > (trackStarts [numTracks] - 20000); - break; - } + if (movie == 0) + ((QTMovieCompInternal*) internal)->clearHandle(); } + + movieLoaded = (qtMovie != 0); + } + else + { + // You're trying to open a movie when the control hasn't yet been created, probably because + // you've not yet added this component to a Window and made the whole component hierarchy visible. + jassertfalse } - return ok; + delete movieStream; + return movieLoaded; } -bool AudioCDReader::isCDStillPresent() const +void QuickTimeMovieComponent::closeMovie() { - TOC toc; - zerostruct (toc); + stop(); + movieFile = File::nonexistent; + movieLoaded = false; + qtMovie = 0; - return ((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false); + if (qtControl != 0) + qtControl->Put_MovieHandle (0); + + ((QTMovieCompInternal*) internal)->clearHandle(); } -int AudioCDReader::getNumTracks() const +const File QuickTimeMovieComponent::getCurrentMovieFile() const { - return numTracks; + return movieFile; } -int AudioCDReader::getPositionOfTrackStart (int trackNum) const +bool QuickTimeMovieComponent::isMovieOpen() const { - return (trackNum >= 0 && trackNum <= numTracks) ? trackStarts [trackNum] * samplesPerFrame - : 0; + return movieLoaded; } -void AudioCDReader::refreshTrackLengths() +double QuickTimeMovieComponent::getMovieDuration() const { - zeromem (trackStarts, sizeof (trackStarts)); - zeromem (audioTracks, sizeof (audioTracks)); + if (qtMovie != 0) + return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale(); - TOC toc; - zerostruct (toc); + return 0.0; +} - if (((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false)) +void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const +{ + if (qtMovie != 0) { - numTracks = 1 + toc.lastTrack - toc.firstTrack; + struct QTRECT r = qtMovie->GetNaturalRect(); - for (int i = 0; i <= numTracks; ++i) - { - trackStarts[i] = getAddressOf (&toc.tracks[i]); - audioTracks[i] = ((toc.tracks[i].ADR & 4) == 0); - } + width = r.right - r.left; + height = r.bottom - r.top; } else { - numTracks = 0; + width = height = 0; } } -bool AudioCDReader::isTrackAudio (int trackNum) const +void QuickTimeMovieComponent::play() { - return (trackNum >= 0 && trackNum <= numTracks) ? audioTracks [trackNum] - : false; + if (qtMovie != 0) + qtMovie->Play(); } -void AudioCDReader::enableIndexScanning (bool b) +void QuickTimeMovieComponent::stop() { - indexingEnabled = b; + if (qtMovie != 0) + qtMovie->Stop(); } -int AudioCDReader::getLastIndex() const +bool QuickTimeMovieComponent::isPlaying() const { - return lastIndex; + return qtMovie != 0 && qtMovie->GetRate() != 0.0f; } -const int framesPerIndexRead = 4; +void QuickTimeMovieComponent::setPosition (const double seconds) +{ + if (qtMovie != 0) + qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale())); +} -int AudioCDReader::getIndexAt (int samplePos) +double QuickTimeMovieComponent::getPosition() const { - CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; + if (qtMovie != 0) + return qtMovie->GetTime() / (double) qtMovie->GetTimeScale(); - const int frameNeeded = samplePos / samplesPerFrame; + return 0.0; +} - device->overlapBuffer->dataLength = 0; - device->overlapBuffer->startFrame = 0; - device->overlapBuffer->numFrames = 0; - device->jitter = false; +void QuickTimeMovieComponent::setSpeed (const float newSpeed) +{ + if (qtMovie != 0) + qtMovie->PutRate (newSpeed); +} - firstFrameInBuffer = 0; - lastIndex = 0; +void QuickTimeMovieComponent::setMovieVolume (const float newVolume) +{ + if (qtMovie != 0) + { + qtMovie->PutAudioVolume (newVolume); + qtMovie->PutAudioMute (newVolume <= 0); + } +} - CDReadBuffer readBuffer (4 + framesPerIndexRead); - readBuffer.wantsIndex = true; +float QuickTimeMovieComponent::getMovieVolume() const +{ + if (qtMovie != 0) + return qtMovie->GetAudioVolume(); - int i; - for (i = 5; --i >= 0;) - { - readBuffer.startFrame = frameNeeded; - readBuffer.numFrames = framesPerIndexRead; + return 0.0f; +} - if (device->cdH->readAudio (&readBuffer, (false) ? device->overlapBuffer : 0)) - break; - } +void QuickTimeMovieComponent::setLooping (const bool shouldLoop) +{ + if (qtMovie != 0) + qtMovie->PutLoop (shouldLoop); +} - if (i >= 0) - return readBuffer.index; +bool QuickTimeMovieComponent::isLooping() const +{ + return qtMovie != 0 && qtMovie->GetLoop(); +} - return -1; +bool QuickTimeMovieComponent::isControllerVisible() const +{ + return controllerVisible; } -const Array AudioCDReader::findIndexesInTrack (const int trackNumber) +void QuickTimeMovieComponent::parentHierarchyChanged() { - Array indexes; + createControlIfNeeded(); + QTCompBaseClass::parentHierarchyChanged(); +} - const int trackStart = getPositionOfTrackStart (trackNumber); - const int trackEnd = getPositionOfTrackStart (trackNumber + 1); +void QuickTimeMovieComponent::visibilityChanged() +{ + createControlIfNeeded(); + QTCompBaseClass::visibilityChanged(); +} - bool needToScan = true; +void QuickTimeMovieComponent::paint (Graphics& g) +{ + if (! isControlCreated()) + g.fillAll (Colours::black); +} - if (trackEnd - trackStart > 20 * 44100) +static Handle createHandleDataRef (Handle dataHandle, const char* fileName) +{ + Handle dataRef = 0; + OSStatus err = PtrToHand (&dataHandle, &dataRef, sizeof (Handle)); + if (err == noErr) { - // check the end of the track for indexes before scanning the whole thing - needToScan = false; - int pos = jmax (trackStart, trackEnd - 44100 * 5); - bool seenAnIndex = false; - - while (pos <= trackEnd - samplesPerFrame) - { - const int index = getIndexAt (pos); + Str255 suffix; - if (index == 0) - { - // lead-out, so skip back a bit if we've not found any indexes yet.. - if (seenAnIndex) - break; + CharacterFunctions::copy ((char*) suffix, fileName, 128); - pos -= 44100 * 5; + StringPtr name = suffix; + err = PtrAndHand (name, dataRef, name[0] + 1); - if (pos < trackStart) - break; - } - else - { - if (index > 0) - seenAnIndex = true; + if (err == noErr) + { + long atoms[3]; + atoms[0] = EndianU32_NtoB (3 * sizeof (long)); + atoms[1] = EndianU32_NtoB (kDataRefExtensionMacOSFileType); + atoms[2] = EndianU32_NtoB (MovieFileType); - if (index > 1) - { - needToScan = true; - break; - } + err = PtrAndHand (atoms, dataRef, 3 * sizeof (long)); - pos += samplesPerFrame * framesPerIndexRead; - } + if (err == noErr) + return dataRef; } - } - if (needToScan) - { - CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; + DisposeHandle (dataRef); + } - int pos = trackStart; - int last = -1; + return 0; +} - while (pos < trackEnd - samplesPerFrame * 10) - { - const int frameNeeded = pos / samplesPerFrame; +static CFStringRef juceStringToCFString (const String& s) +{ + const int len = s.length(); + const juce_wchar* const t = (const juce_wchar*) s; - device->overlapBuffer->dataLength = 0; - device->overlapBuffer->startFrame = 0; - device->overlapBuffer->numFrames = 0; - device->jitter = false; + UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); - firstFrameInBuffer = 0; + for (int i = 0; i <= len; ++i) + temp[i] = t[i]; - CDReadBuffer readBuffer (4); - readBuffer.wantsIndex = true; + CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); + juce_free (temp); - int i; - for (i = 5; --i >= 0;) - { - readBuffer.startFrame = frameNeeded; - readBuffer.numFrames = framesPerIndexRead; + return result; +} - if (device->cdH->readAudio (&readBuffer, (false) ? device->overlapBuffer : 0)) - break; - } +static bool openMovie (QTNewMoviePropertyElement* props, int prop, Movie& movie) +{ + Boolean trueBool = true; + props[prop].propClass = kQTPropertyClass_MovieInstantiation; + props[prop].propID = kQTMovieInstantiationPropertyID_DontResolveDataRefs; + props[prop].propValueSize = sizeof (trueBool); + props[prop].propValueAddress = &trueBool; + ++prop; - if (i < 0) - break; + props[prop].propClass = kQTPropertyClass_MovieInstantiation; + props[prop].propID = kQTMovieInstantiationPropertyID_AsyncOK; + props[prop].propValueSize = sizeof (trueBool); + props[prop].propValueAddress = &trueBool; + ++prop; - if (readBuffer.index > last && readBuffer.index > 1) - { - last = readBuffer.index; - indexes.add (pos); - } + Boolean isActive = true; + props[prop].propClass = kQTPropertyClass_NewMovieProperty; + props[prop].propID = kQTNewMoviePropertyID_Active; + props[prop].propValueSize = sizeof (isActive); + props[prop].propValueAddress = &isActive; + ++prop; - pos += samplesPerFrame * framesPerIndexRead; - } + MacSetPort (0); - indexes.removeValue (trackStart); - } + jassert (prop <= 5); + OSStatus err = NewMovieFromProperties (prop, props, 0, 0, &movie); - return indexes; + return err == noErr; } -int AudioCDReader::getCDDBId() +bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle) { - refreshTrackLengths(); + if (input == 0) + return false; - if (numTracks > 0) + dataHandle = 0; + bool ok = false; + + QTNewMoviePropertyElement props[5]; + zeromem (props, sizeof (props)); + int prop = 0; + + DataReferenceRecord dr; + props[prop].propClass = kQTPropertyClass_DataLocation; + props[prop].propID = kQTDataLocationPropertyID_DataReference; + props[prop].propValueSize = sizeof (dr); + props[prop].propValueAddress = (void*) &dr; + ++prop; + + FileInputStream* const fin = dynamic_cast (input); + + if (fin != 0) { - TOC toc; - zerostruct (toc); + CFStringRef filePath = juceStringToCFString (fin->getFile().getFullPathName()); - if (((CDDeviceWrapper*) handle)->cdH->readTOC (&toc, true)) - { - int n = 0; + QTNewDataReferenceFromFullPathCFString (filePath, (QTPathStyle) kQTNativeDefaultPathStyle, 0, + &dr.dataRef, &dr.dataRefType); - for (int i = numTracks; --i >= 0;) - { - int j = getMSFAddressOf (&toc.tracks[i]); + ok = openMovie (props, prop, movie); - while (j > 0) - { - n += (j % 10); - j /= 10; - } - } + DisposeHandle (dr.dataRef); + CFRelease (filePath); + } + else + { + // sanity-check because this currently needs to load the whole stream into memory.. + jassert (input->getTotalLength() < 50 * 1024 * 1024); - if (n != 0) - { - const int t = getMSFAddressOf (&toc.tracks[numTracks]) - - getMSFAddressOf (&toc.tracks[0]); + dataHandle = NewHandle ((Size) input->getTotalLength()); + HLock (dataHandle); + // read the entire stream into memory - this is a pain, but can't get it to work + // properly using a custom callback to supply the data. + input->read (*dataHandle, (int) input->getTotalLength()); + HUnlock (dataHandle); - return ((n % 0xff) << 24) | (t << 8) | numTracks; - } + // different types to get QT to try. (We should really be a bit smarter here by + // working out in advance which one the stream contains, rather than just trying + // each one) + const char* const suffixesToTry[] = { "\04.mov", "\04.mp3", + "\04.avi", "\04.m4a" }; + + for (int i = 0; i < numElementsInArray (suffixesToTry) && ! ok; ++i) + { + /* // this fails for some bizarre reason - it can be bodged to work with + // movies, but can't seem to do it for other file types.. + QTNewMovieUserProcRecord procInfo; + procInfo.getMovieUserProc = NewGetMovieUPP (readMovieStreamProc); + procInfo.getMovieUserProcRefcon = this; + procInfo.defaultDataRef.dataRef = dataRef; + procInfo.defaultDataRef.dataRefType = HandleDataHandlerSubType; + + props[prop].propClass = kQTPropertyClass_DataLocation; + props[prop].propID = kQTDataLocationPropertyID_MovieUserProc; + props[prop].propValueSize = sizeof (procInfo); + props[prop].propValueAddress = (void*) &procInfo; + ++prop; */ + + dr.dataRef = createHandleDataRef (dataHandle, suffixesToTry [i]); + dr.dataRefType = HandleDataHandlerSubType; + ok = openMovie (props, prop, movie); + + DisposeHandle (dr.dataRef); } } - return 0; + return ok; } -void AudioCDReader::ejectDisk() +bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, + const bool isControllerVisible) { - ((CDDeviceWrapper*) handle)->cdH->openDrawer (true); + const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); + movieFile = movieFile_; + return ok; } -#if JUCE_USE_CDBURNER - -static IDiscRecorder* enumCDBurners (StringArray* list, int indexToOpen, IDiscMaster** master) +void QuickTimeMovieComponent::goToStart() { - CoInitialize (0); + setPosition (0.0); +} - IDiscMaster* dm; - IDiscRecorder* result = 0; +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + const RectanglePlacement& placement) +{ + int normalWidth, normalHeight; + getMovieNormalSize (normalWidth, normalHeight); - if (SUCCEEDED (CoCreateInstance (CLSID_MSDiscMasterObj, 0, - CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, - IID_IDiscMaster, - (void**) &dm))) + if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) { - if (SUCCEEDED (dm->Open())) + double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; + + placement.applyTo (x, y, w, h, + spaceToFitWithin.getX(), spaceToFitWithin.getY(), + spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); + + if (w > 0 && h > 0) { - IEnumDiscRecorders* drEnum = 0; + setBounds (roundDoubleToInt (x), roundDoubleToInt (y), + roundDoubleToInt (w), roundDoubleToInt (h)); + } + } + else + { + setBounds (spaceToFitWithin); + } +} - if (SUCCEEDED (dm->EnumDiscRecorders (&drEnum))) - { - IDiscRecorder* dr = 0; - DWORD dummy; - int index = 0; +#endif +/********* End of inlined file: juce_win32_QuickTimeMovieComponent.cpp *********/ - while (drEnum->Next (1, &dr, &dummy) == S_OK) - { - if (indexToOpen == index) - { - result = dr; - break; - } - else if (list != 0) - { - BSTR path; +/********* Start of inlined file: juce_win32_WebBrowserComponent.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER - if (SUCCEEDED (dr->GetPath (&path))) - list->add ((const WCHAR*) path); - } +class WebBrowserComponentInternal : public ActiveXControlComponent +{ +public: - ++index; - dr->Release(); - } + WebBrowserComponentInternal() + : browser (0), + connectionPoint (0), + adviseCookie (0) + { + } - drEnum->Release(); + ~WebBrowserComponentInternal() + { + if (connectionPoint != 0) + connectionPoint->Unadvise (adviseCookie); + + if (browser != 0) + browser->Release(); + } + + void createBrowser() + { + createControl (&CLSID_WebBrowser); + browser = (IWebBrowser2*) queryInterface (&IID_IWebBrowser2); + + IConnectionPointContainer* connectionPointContainer = (IConnectionPointContainer*) queryInterface (&IID_IConnectionPointContainer); + + if (connectionPointContainer != 0) + { + connectionPointContainer->FindConnectionPoint (DIID_DWebBrowserEvents2, + &connectionPoint); + + if (connectionPoint != 0) + { + WebBrowserComponent* const owner = dynamic_cast (getParentComponent()); + jassert (owner != 0); + + EventHandler* handler = new EventHandler (owner); + connectionPoint->Advise (handler, &adviseCookie); } + } + } - /*if (redbookFormat != 0) + void goToURL (const String& url, + const StringArray* headers, + const MemoryBlock* postData) + { + if (browser != 0) + { + LPSAFEARRAY sa = 0; + _variant_t flags, frame, postDataVar, headersVar; + + if (headers != 0) + headersVar = (const tchar*) headers->joinIntoString ("\r\n"); + + if (postData != 0 && postData->getSize() > 0) { - IEnumDiscMasterFormats* mfEnum; + LPSAFEARRAY sa = SafeArrayCreateVector (VT_UI1, 0, postData->getSize()); - if (SUCCEEDED (dm->EnumDiscMasterFormats (&mfEnum))) + if (sa != 0) { - IID formatIID; - DWORD dummy; + void* data = 0; + SafeArrayAccessData (sa, &data); + jassert (data != 0); - while (mfEnum->Next (1, &formatIID, &dummy) == S_OK) + if (data != 0) { - } + postData->copyTo (data, 0, postData->getSize()); + SafeArrayUnaccessData (sa); - mfEnum->Release(); + VARIANT postDataVar2; + VariantInit (&postDataVar2); + V_VT (&postDataVar2) = VT_ARRAY | VT_UI1; + V_ARRAY (&postDataVar2) = sa; + + postDataVar = postDataVar2; + } } + } - redbookFormat - }*/ + browser->Navigate ((BSTR) (const OLECHAR*) url, + &flags, &frame, + &postDataVar, &headersVar); - if (master == 0) - dm->Close(); + if (sa != 0) + SafeArrayDestroy (sa); } - - if (master != 0) - *master = dm; - else - dm->Release(); } - return result; -} + IWebBrowser2* browser; -const StringArray AudioCDBurner::findAvailableDevices() -{ - StringArray devs; - enumCDBurners (&devs, -1, 0); - return devs; -} + juce_UseDebuggingNewOperator -AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) -{ - AudioCDBurner* b = new AudioCDBurner (deviceIndex); +private: + IConnectionPoint* connectionPoint; + DWORD adviseCookie; - if (b->internal == 0) - deleteAndZero (b); + class EventHandler : public IDispatch + { + public: + EventHandler (WebBrowserComponent* owner_) + : owner (owner_), + refCount (0) + { + } - return b; -} + ~EventHandler() + { + } -class CDBurnerInfo : public IDiscMasterProgressEvents -{ -public: - CDBurnerInfo() - : refCount (1), - progress (0), - shouldCancel (false), - listener (0) - { - } + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (id == IID_IUnknown || id == IID_IDispatch || id == DIID_DWebBrowserEvents2) + { + AddRef(); + *result = this; + return S_OK; + } - ~CDBurnerInfo() - { - } + *result = 0; + return E_NOINTERFACE; + } - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (result == 0) - return E_POINTER; + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } - if (id == IID_IUnknown || id == IID_IDiscMasterProgressEvents) + HRESULT __stdcall GetTypeInfoCount (UINT __RPC_FAR*) { return E_NOTIMPL; } + HRESULT __stdcall GetTypeInfo (UINT, LCID, ITypeInfo __RPC_FAR *__RPC_FAR*) { return E_NOTIMPL; } + HRESULT __stdcall GetIDsOfNames (REFIID, LPOLESTR __RPC_FAR*, UINT, LCID, DISPID __RPC_FAR*) { return E_NOTIMPL; } + + HRESULT __stdcall Invoke (DISPID dispIdMember, REFIID /*riid*/, LCID /*lcid*/, + WORD /*wFlags*/, DISPPARAMS __RPC_FAR* pDispParams, + VARIANT __RPC_FAR* /*pVarResult*/, EXCEPINFO __RPC_FAR* /*pExcepInfo*/, + UINT __RPC_FAR* /*puArgErr*/) { - AddRef(); - *result = this; - return S_OK; - } + switch (dispIdMember) + { + case DISPID_BEFORENAVIGATE2: + { + VARIANT* const vurl = pDispParams->rgvarg[5].pvarVal; - *result = 0; - return E_NOINTERFACE; - } + String url; - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + if ((vurl->vt & VT_BYREF) != 0) + url = *vurl->pbstrVal; + else + url = vurl->bstrVal; - HRESULT __stdcall QueryCancel (boolean* pbCancel) - { - if (listener != 0 && ! shouldCancel) - shouldCancel = listener->audioCDBurnProgress (progress); + *pDispParams->rgvarg->pboolVal + = owner->pageAboutToLoad (url) ? VARIANT_FALSE + : VARIANT_TRUE; - *pbCancel = shouldCancel; + return S_OK; + } - return S_OK; - } + default: + break; + } - HRESULT __stdcall NotifyBlockProgress (long nCompleted, long nTotal) - { - progress = nCompleted / (float) nTotal; - shouldCancel = listener != 0 && listener->audioCDBurnProgress (progress); + return E_NOTIMPL; + } - return E_NOTIMPL; - } + juce_UseDebuggingNewOperator - HRESULT __stdcall NotifyPnPActivity (void) { return E_NOTIMPL; } - HRESULT __stdcall NotifyAddProgress (long /*nCompletedSteps*/, long /*nTotalSteps*/) { return E_NOTIMPL; } - HRESULT __stdcall NotifyTrackProgress (long /*nCurrentTrack*/, long /*nTotalTracks*/) { return E_NOTIMPL; } - HRESULT __stdcall NotifyPreparingBurn (long /*nEstimatedSeconds*/) { return E_NOTIMPL; } - HRESULT __stdcall NotifyClosingDisc (long /*nEstimatedSeconds*/) { return E_NOTIMPL; } - HRESULT __stdcall NotifyBurnComplete (HRESULT /*status*/) { return E_NOTIMPL; } - HRESULT __stdcall NotifyEraseComplete (HRESULT /*status*/) { return E_NOTIMPL; } + private: + WebBrowserComponent* const owner; + int refCount; + + EventHandler (const EventHandler&); + const EventHandler& operator= (const EventHandler&); + }; +}; + +WebBrowserComponent::WebBrowserComponent() + : browser (0), + blankPageShown (false) +{ + setOpaque (true); + addAndMakeVisible (browser = new WebBrowserComponentInternal()); +} + +WebBrowserComponent::~WebBrowserComponent() +{ + delete browser; +} + +void WebBrowserComponent::goToURL (const String& url, + const StringArray* headers, + const MemoryBlock* postData) +{ + lastURL = url; + + lastHeaders.clear(); + if (headers != 0) + lastHeaders = *headers; - IDiscMaster* discMaster; - IDiscRecorder* discRecorder; - IRedbookDiscMaster* redbook; - AudioCDBurner::BurnProgressListener* listener; - float progress; - bool shouldCancel; + lastPostData.setSize (0); + if (postData != 0) + lastPostData = *postData; -private: - int refCount; -}; + blankPageShown = false; -AudioCDBurner::AudioCDBurner (const int deviceIndex) - : internal (0) + browser->goToURL (url, headers, postData); +} + +void WebBrowserComponent::stop() { - IDiscMaster* discMaster; - IDiscRecorder* dr = enumCDBurners (0, deviceIndex, &discMaster); + if (browser->browser != 0) + browser->browser->Stop(); +} - if (dr != 0) - { - IRedbookDiscMaster* redbook; - HRESULT hr = discMaster->SetActiveDiscMasterFormat (IID_IRedbookDiscMaster, (void**) &redbook); +void WebBrowserComponent::goBack() +{ + lastURL = String::empty; + blankPageShown = false; - hr = discMaster->SetActiveDiscRecorder (dr); + if (browser->browser != 0) + browser->browser->GoBack(); +} - CDBurnerInfo* const info = new CDBurnerInfo(); - internal = info; +void WebBrowserComponent::goForward() +{ + lastURL = String::empty; - info->discMaster = discMaster; - info->discRecorder = dr; - info->redbook = redbook; - } + if (browser->browser != 0) + browser->browser->GoForward(); } -AudioCDBurner::~AudioCDBurner() +void WebBrowserComponent::paint (Graphics& g) { - CDBurnerInfo* const info = (CDBurnerInfo*) internal; + if (browser->browser == 0) + g.fillAll (Colours::white); +} - if (info != 0) +void WebBrowserComponent::checkWindowAssociation() +{ + if (isShowing()) { - info->discRecorder->Close(); - info->redbook->Release(); - info->discRecorder->Release(); - info->discMaster->Release(); + if (browser->browser == 0 && getPeer() != 0) + { + browser->createBrowser(); + reloadLastURL(); + } + else + { + if (blankPageShown) + goBack(); + } + } + else + { + if (browser != 0 && ! blankPageShown) + { + // when the component becomes invisible, some stuff like flash + // carries on playing audio, so we need to force it onto a blank + // page to avoid this.. - info->Release(); + blankPageShown = true; + browser->goToURL ("about:blank", 0, 0); + } } } -bool AudioCDBurner::isDiskPresent() const +void WebBrowserComponent::reloadLastURL() { - CDBurnerInfo* const info = (CDBurnerInfo*) internal; - - HRESULT hr = info->discRecorder->OpenExclusive(); - - long type, flags; - hr = info->discRecorder->QueryMediaType (&type, &flags); + if (lastURL.isNotEmpty()) + { + goToURL (lastURL, &lastHeaders, &lastPostData); + lastURL = String::empty; + } +} - info->discRecorder->Close(); - return hr == S_OK && type != 0 && (flags & MEDIA_WRITABLE) != 0; +void WebBrowserComponent::parentHierarchyChanged() +{ + checkWindowAssociation(); } -int AudioCDBurner::getNumAvailableAudioBlocks() const +void WebBrowserComponent::resized() { - CDBurnerInfo* const info = (CDBurnerInfo*) internal; - long blocksFree = 0; - info->redbook->GetAvailableAudioTrackBlocks (&blocksFree); - return blocksFree; + browser->setSize (getWidth(), getHeight()); } -const String AudioCDBurner::burn (AudioCDBurner::BurnProgressListener* listener, - const bool ejectDiscAfterwards, - const bool performFakeBurnForTesting) +void WebBrowserComponent::visibilityChanged() { - CDBurnerInfo* const info = (CDBurnerInfo*) internal; + checkWindowAssociation(); +} - info->listener = listener; - info->progress = 0; - info->shouldCancel = false; +bool WebBrowserComponent::pageAboutToLoad (const String&) +{ + return true; +} - UINT_PTR cookie; - HRESULT hr = info->discMaster->ProgressAdvise (info, &cookie); +#endif +/********* End of inlined file: juce_win32_WebBrowserComponent.cpp *********/ - hr = info->discMaster->RecordDisc (performFakeBurnForTesting, - ejectDiscAfterwards); +/********* Start of inlined file: juce_win32_OpenGLComponent.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_OPENGL - String error; - if (hr != S_OK) - { - const char* e = "Couldn't open or write to the CD device"; +#define WGL_EXT_FUNCTION_INIT(extType, extFunc) \ + ((extFunc = (extType) wglGetProcAddress (#extFunc)) != 0) - if (hr == IMAPI_E_USERABORT) - e = "User cancelled the write operation"; - else if (hr == IMAPI_E_MEDIUM_NOTPRESENT || hr == IMAPI_E_TRACKOPEN) - e = "No Disk present"; +typedef const char* (WINAPI* PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); - error = e; - } +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_STEREO_ARB 0x2012 +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#define WGL_TYPE_RGBA_ARB 0x202B - info->discMaster->ProgressUnadvise (cookie); - info->listener = 0; +static void getWglExtensions (HDC dc, StringArray& result) throw() +{ + PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0; - return error; + if (WGL_EXT_FUNCTION_INIT (PFNWGLGETEXTENSIONSSTRINGARBPROC, wglGetExtensionsStringARB)) + result.addTokens (String (wglGetExtensionsStringARB (dc)), false); + else + jassertfalse // If this fails, it may be because you didn't activate the openGL context } -bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamples) +class WindowedGLContext : public OpenGLContext { - if (source == 0) - return false; +public: + WindowedGLContext (Component* const component_, + HGLRC contextToShareWith, + const OpenGLPixelFormat& pixelFormat) + : renderContext (0), + nativeWindow (0), + dc (0), + component (component_) + { + jassert (component != 0); - CDBurnerInfo* const info = (CDBurnerInfo*) internal; + createNativeWindow(); - long bytesPerBlock; - HRESULT hr = info->redbook->GetAudioBlockSize (&bytesPerBlock); + // Use a default pixel format that should be supported everywhere + PIXELFORMATDESCRIPTOR pfd; + zerostruct (pfd); + pfd.nSize = sizeof (pfd); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.cColorBits = 24; + pfd.cDepthBits = 16; - const int samplesPerBlock = bytesPerBlock / 4; - bool ok = true; + const int format = ChoosePixelFormat (dc, &pfd); - hr = info->redbook->CreateAudioTrack ((long) numSamples / (bytesPerBlock * 4)); + if (format != 0) + SetPixelFormat (dc, format, &pfd); - byte* const buffer = (byte*) juce_malloc (bytesPerBlock); + renderContext = wglCreateContext (dc); + makeActive(); - AudioSampleBuffer sourceBuffer (2, samplesPerBlock); - int samplesDone = 0; + setPixelFormat (pixelFormat); - source->prepareToPlay (samplesPerBlock, 44100.0); + if (contextToShareWith != 0 && renderContext != 0) + wglShareLists (contextToShareWith, renderContext); + } - while (ok) + ~WindowedGLContext() { - { - AudioSourceChannelInfo info; - info.buffer = &sourceBuffer; - info.numSamples = samplesPerBlock; - info.startSample = 0; - sourceBuffer.clear(); + makeInactive(); - source->getNextAudioBlock (info); - } + wglDeleteContext (renderContext); - zeromem (buffer, bytesPerBlock); + ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); + delete nativeWindow; + } - AudioDataConverters::convertFloatToInt16LE (sourceBuffer.getSampleData (0, 0), - buffer, samplesPerBlock, 4); + bool makeActive() const throw() + { + jassert (renderContext != 0); + return wglMakeCurrent (dc, renderContext) != 0; + } - AudioDataConverters::convertFloatToInt16LE (sourceBuffer.getSampleData (1, 0), - buffer + 2, samplesPerBlock, 4); + bool makeInactive() const throw() + { + return (! isActive()) || (wglMakeCurrent (0, 0) != 0); + } - hr = info->redbook->AddAudioTrackBlocks (buffer, bytesPerBlock); + bool isActive() const throw() + { + return wglGetCurrentContext() == renderContext; + } - if (hr != S_OK) - ok = false; + const OpenGLPixelFormat getPixelFormat() const + { + OpenGLPixelFormat pf; - samplesDone += samplesPerBlock; + makeActive(); + StringArray availableExtensions; + getWglExtensions (dc, availableExtensions); - if (samplesDone >= numSamples) - break; + fillInPixelFormatDetails (GetPixelFormat (dc), pf, availableExtensions); + return pf; } - juce_free (buffer); - - hr = info->redbook->CloseAudioTrack(); + void* getRawContext() const throw() + { + return renderContext; + } - delete source; + bool setPixelFormat (const OpenGLPixelFormat& pixelFormat) + { + makeActive(); - return ok && hr == S_OK; -} + PIXELFORMATDESCRIPTOR pfd; + zerostruct (pfd); + pfd.nSize = sizeof (pfd); + pfd.nVersion = 1; + pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.iLayerType = PFD_MAIN_PLANE; + pfd.cColorBits = (BYTE) (pixelFormat.redBits + pixelFormat.greenBits + pixelFormat.blueBits); + pfd.cRedBits = (BYTE) pixelFormat.redBits; + pfd.cGreenBits = (BYTE) pixelFormat.greenBits; + pfd.cBlueBits = (BYTE) pixelFormat.blueBits; + pfd.cAlphaBits = (BYTE) pixelFormat.alphaBits; + pfd.cDepthBits = (BYTE) pixelFormat.depthBufferBits; + pfd.cStencilBits = (BYTE) pixelFormat.stencilBufferBits; + pfd.cAccumBits = (BYTE) (pixelFormat.accumulationBufferRedBits + pixelFormat.accumulationBufferGreenBits + + pixelFormat.accumulationBufferBlueBits + pixelFormat.accumulationBufferAlphaBits); + pfd.cAccumRedBits = (BYTE) pixelFormat.accumulationBufferRedBits; + pfd.cAccumGreenBits = (BYTE) pixelFormat.accumulationBufferGreenBits; + pfd.cAccumBlueBits = (BYTE) pixelFormat.accumulationBufferBlueBits; + pfd.cAccumAlphaBits = (BYTE) pixelFormat.accumulationBufferAlphaBits; -#endif + int format = 0; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_AudioCDReader.cpp *********/ + PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = 0; -/********* Start of inlined file: juce_win32_DirectSound.cpp *********/ + StringArray availableExtensions; + getWglExtensions (dc, availableExtensions); -extern "C" -{ + if (availableExtensions.contains ("WGL_ARB_pixel_format") + && WGL_EXT_FUNCTION_INIT (PFNWGLCHOOSEPIXELFORMATARBPROC, wglChoosePixelFormatARB)) + { + int attributes[64]; + int n = 0; -// Declare just the minimum number of interfaces for the DSound objects that we need.. -typedef struct typeDSBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; - GUID guid3DAlgorithm; -} DSBUFFERDESC; + attributes[n++] = WGL_DRAW_TO_WINDOW_ARB; + attributes[n++] = GL_TRUE; + attributes[n++] = WGL_SUPPORT_OPENGL_ARB; + attributes[n++] = GL_TRUE; + attributes[n++] = WGL_ACCELERATION_ARB; + attributes[n++] = WGL_FULL_ACCELERATION_ARB; + attributes[n++] = WGL_DOUBLE_BUFFER_ARB; + attributes[n++] = GL_TRUE; + attributes[n++] = WGL_PIXEL_TYPE_ARB; + attributes[n++] = WGL_TYPE_RGBA_ARB; -struct IDirectSoundBuffer; + attributes[n++] = WGL_COLOR_BITS_ARB; + attributes[n++] = pfd.cColorBits; + attributes[n++] = WGL_RED_BITS_ARB; + attributes[n++] = pixelFormat.redBits; + attributes[n++] = WGL_GREEN_BITS_ARB; + attributes[n++] = pixelFormat.greenBits; + attributes[n++] = WGL_BLUE_BITS_ARB; + attributes[n++] = pixelFormat.blueBits; + attributes[n++] = WGL_ALPHA_BITS_ARB; + attributes[n++] = pixelFormat.alphaBits; + attributes[n++] = WGL_DEPTH_BITS_ARB; + attributes[n++] = pixelFormat.depthBufferBits; -#undef INTERFACE -#define INTERFACE IDirectSound -DECLARE_INTERFACE_(IDirectSound, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - STDMETHOD(CreateSoundBuffer) (THIS_ DSBUFFERDESC*, IDirectSoundBuffer**, LPUNKNOWN) PURE; - STDMETHOD(GetCaps) (THIS_ void*) PURE; - STDMETHOD(DuplicateSoundBuffer) (THIS_ IDirectSoundBuffer*, IDirectSoundBuffer**) PURE; - STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE; - STDMETHOD(Compact) (THIS) PURE; - STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE; - STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE; - STDMETHOD(Initialize) (THIS_ const GUID*) PURE; -}; + if (pixelFormat.stencilBufferBits > 0) + { + attributes[n++] = WGL_STENCIL_BITS_ARB; + attributes[n++] = pixelFormat.stencilBufferBits; + } -#undef INTERFACE -#define INTERFACE IDirectSoundBuffer -DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - STDMETHOD(GetCaps) (THIS_ void*) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE; - STDMETHOD(GetVolume) (THIS_ LPLONG) PURE; - STDMETHOD(GetPan) (THIS_ LPLONG) PURE; - STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE; - STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ IDirectSound*, DSBUFFERDESC*) PURE; - STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID*, LPDWORD, LPVOID*, LPDWORD, DWORD) PURE; - STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE; - STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE; - STDMETHOD(SetFormat) (THIS_ const WAVEFORMATEX*) PURE; - STDMETHOD(SetVolume) (THIS_ LONG) PURE; - STDMETHOD(SetPan) (THIS_ LONG) PURE; - STDMETHOD(SetFrequency) (THIS_ DWORD) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(Restore) (THIS) PURE; -}; + attributes[n++] = WGL_ACCUM_RED_BITS_ARB; + attributes[n++] = pixelFormat.accumulationBufferRedBits; + attributes[n++] = WGL_ACCUM_GREEN_BITS_ARB; + attributes[n++] = pixelFormat.accumulationBufferGreenBits; + attributes[n++] = WGL_ACCUM_BLUE_BITS_ARB; + attributes[n++] = pixelFormat.accumulationBufferBlueBits; + attributes[n++] = WGL_ACCUM_ALPHA_BITS_ARB; + attributes[n++] = pixelFormat.accumulationBufferAlphaBits; -typedef struct typeDSCBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -} DSCBUFFERDESC; + if (availableExtensions.contains ("WGL_ARB_multisample") + && pixelFormat.fullSceneAntiAliasingNumSamples > 0) + { + attributes[n++] = WGL_SAMPLE_BUFFERS_ARB; + attributes[n++] = 1; + attributes[n++] = WGL_SAMPLES_ARB; + attributes[n++] = pixelFormat.fullSceneAntiAliasingNumSamples; + } -struct IDirectSoundCaptureBuffer; + attributes[n++] = 0; -#undef INTERFACE -#define INTERFACE IDirectSoundCapture -DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - STDMETHOD(CreateCaptureBuffer) (THIS_ DSCBUFFERDESC*, IDirectSoundCaptureBuffer**, LPUNKNOWN) PURE; - STDMETHOD(GetCaps) (THIS_ void*) PURE; - STDMETHOD(Initialize) (THIS_ const GUID*) PURE; -}; + UINT formatsCount; + const BOOL ok = wglChoosePixelFormatARB (dc, attributes, 0, 1, &format, &formatsCount); + (void) ok; + jassert (ok); + } + else + { + format = ChoosePixelFormat (dc, &pfd); + } -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureBuffer -DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) -{ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - STDMETHOD(GetCaps) (THIS_ void*) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE; - STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ IDirectSoundCapture*, DSCBUFFERDESC*) PURE; - STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID*, LPDWORD, LPVOID*, LPDWORD, DWORD) PURE; - STDMETHOD(Start) (THIS_ DWORD) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; -}; + if (format != 0) + { + makeInactive(); -}; + // win32 can't change the pixel format of a window, so need to delete the + // old one and create a new one.. + jassert (nativeWindow != 0); + ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); + delete nativeWindow; -BEGIN_JUCE_NAMESPACE + createNativeWindow(); -static const String getDSErrorMessage (HRESULT hr) -{ - const char* result = 0; + if (SetPixelFormat (dc, format, &pfd)) + { + wglDeleteContext (renderContext); + renderContext = wglCreateContext (dc); - switch (hr) - { - case MAKE_HRESULT(1, 0x878, 10): - result = "Device already allocated"; - break; - case MAKE_HRESULT(1, 0x878, 30): - result = "Control unavailable"; - break; - case E_INVALIDARG: - result = "Invalid parameter"; - break; - case MAKE_HRESULT(1, 0x878, 50): - result = "Invalid call"; - break; - case E_FAIL: - result = "Generic error"; - break; - case MAKE_HRESULT(1, 0x878, 70): - result = "Priority level error"; - break; - case E_OUTOFMEMORY: - result = "Out of memory"; - break; - case MAKE_HRESULT(1, 0x878, 100): - result = "Bad format"; - break; - case E_NOTIMPL: - result = "Unsupported function"; - break; - case MAKE_HRESULT(1, 0x878, 120): - result = "No driver"; - break; - case MAKE_HRESULT(1, 0x878, 130): - result = "Already initialised"; - break; - case CLASS_E_NOAGGREGATION: - result = "No aggregation"; - break; - case MAKE_HRESULT(1, 0x878, 150): - result = "Buffer lost"; - break; - case MAKE_HRESULT(1, 0x878, 160): - result = "Another app has priority"; - break; - case MAKE_HRESULT(1, 0x878, 170): - result = "Uninitialised"; - break; - case E_NOINTERFACE: - result = "No interface"; - break; - case S_OK: - result = "No error"; - break; + jassert (renderContext != 0); + return renderContext != 0; + } + } - default: - return "Unknown error: " + String ((int) hr); + return false; } - return result; -} - -#define DS_DEBUGGING 1 + void updateWindowPosition (int x, int y, int w, int h, int) + { + SetWindowPos ((HWND) nativeWindow->getNativeHandle(), 0, + x, y, w, h, + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); + } -#ifdef DS_DEBUGGING - #define CATCH JUCE_CATCH_EXCEPTION - #undef log - #define log(a) Logger::writeToLog(a); - #undef logError - #define logError(a) logDSError(a, __LINE__); + void repaint() + { + int x, y, w, h; + nativeWindow->getBounds (x, y, w, h); + nativeWindow->repaint (0, 0, w, h); + } - static void logDSError (HRESULT hr, int lineNum) + void swapBuffers() { - if (hr != S_OK) - { - String error ("DS error at line "); - error << lineNum << T(" - ") << getDSErrorMessage (hr); - log (error); - } + SwapBuffers (dc); } -#else - #define CATCH JUCE_CATCH_ALL - #define log(a) - #define logError(a) -#endif -#define DSOUND_FUNCTION(functionName, params) \ - typedef HRESULT (WINAPI *type##functionName) params; \ - static type##functionName ds##functionName = 0; + bool setSwapInterval (const int numFramesPerSwap) + { + makeActive(); -#define DSOUND_FUNCTION_LOAD(functionName) \ - ds##functionName = (type##functionName) GetProcAddress (h, #functionName); \ - jassert (ds##functionName != 0); + StringArray availableExtensions; + getWglExtensions (dc, availableExtensions); -typedef BOOL (CALLBACK *LPDSENUMCALLBACKW) (LPGUID, LPCWSTR, LPCWSTR, LPVOID); -typedef BOOL (CALLBACK *LPDSENUMCALLBACKA) (LPGUID, LPCSTR, LPCSTR, LPVOID); + PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0; -DSOUND_FUNCTION (DirectSoundCreate, (const GUID*, IDirectSound**, LPUNKNOWN)) -DSOUND_FUNCTION (DirectSoundCaptureCreate, (const GUID*, IDirectSoundCapture**, LPUNKNOWN)) -DSOUND_FUNCTION (DirectSoundEnumerateW, (LPDSENUMCALLBACKW, LPVOID)) -DSOUND_FUNCTION (DirectSoundCaptureEnumerateW, (LPDSENUMCALLBACKW, LPVOID)) + return availableExtensions.contains ("WGL_EXT_swap_control") + && WGL_EXT_FUNCTION_INIT (PFNWGLSWAPINTERVALEXTPROC, wglSwapIntervalEXT) + && wglSwapIntervalEXT (numFramesPerSwap) != FALSE; + } -static void initialiseDSoundFunctions() -{ - if (dsDirectSoundCreate == 0) + int getSwapInterval() const { - HMODULE h = LoadLibraryA ("dsound.dll"); - - DSOUND_FUNCTION_LOAD (DirectSoundCreate) - DSOUND_FUNCTION_LOAD (DirectSoundCaptureCreate) - DSOUND_FUNCTION_LOAD (DirectSoundEnumerateW) - DSOUND_FUNCTION_LOAD (DirectSoundCaptureEnumerateW) - } -} + makeActive(); -class DSoundInternalOutChannel -{ - String name; - LPGUID guid; - int sampleRate, bufferSizeSamples; - float* leftBuffer; - float* rightBuffer; + StringArray availableExtensions; + getWglExtensions (dc, availableExtensions); - IDirectSound* pDirectSound; - IDirectSoundBuffer* pOutputBuffer; - DWORD writeOffset; - int totalBytesPerBuffer; - int bytesPerBuffer; - unsigned int lastPlayCursor; + PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0; -public: - int bitDepth; - bool doneFlag; + if (availableExtensions.contains ("WGL_EXT_swap_control") + && WGL_EXT_FUNCTION_INIT (PFNWGLGETSWAPINTERVALEXTPROC, wglGetSwapIntervalEXT)) + return wglGetSwapIntervalEXT(); - DSoundInternalOutChannel (const String& name_, - LPGUID guid_, - int rate, - int bufferSize, - float* left, - float* right) - : name (name_), - guid (guid_), - sampleRate (rate), - bufferSizeSamples (bufferSize), - leftBuffer (left), - rightBuffer (right), - pDirectSound (0), - pOutputBuffer (0), - bitDepth (16) - { + return 0; } - ~DSoundInternalOutChannel() + void findAlternativeOpenGLPixelFormats (OwnedArray & results) { - close(); - } + jassert (isActive()); - void close() - { - HRESULT hr; + StringArray availableExtensions; + getWglExtensions (dc, availableExtensions); - if (pOutputBuffer != 0) - { - JUCE_TRY - { - log (T("closing dsound out: ") + name); - hr = pOutputBuffer->Stop(); - logError (hr); - } - CATCH + PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; + int numTypes = 0; - JUCE_TRY - { - hr = pOutputBuffer->Release(); - logError (hr); - } - CATCH + if (availableExtensions.contains("WGL_ARB_pixel_format") + && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) + { + int attributes = WGL_NUMBER_PIXEL_FORMATS_ARB; - pOutputBuffer = 0; + if (! wglGetPixelFormatAttribivARB (dc, 1, 0, 1, &attributes, &numTypes)) + jassertfalse + } + else + { + numTypes = DescribePixelFormat (dc, 0, 0, 0); } - if (pDirectSound != 0) + OpenGLPixelFormat pf; + + for (int i = 0; i < numTypes; ++i) { - JUCE_TRY + if (fillInPixelFormatDetails (i + 1, pf, availableExtensions)) { - hr = pDirectSound->Release(); - logError (hr); - } - CATCH + bool alreadyListed = false; + for (int j = results.size(); --j >= 0;) + if (pf == *results.getUnchecked(j)) + alreadyListed = true; - pDirectSound = 0; + if (! alreadyListed) + results.add (new OpenGLPixelFormat (pf)); + } } } - const String open() + void* getNativeWindowHandle() const { - log (T("opening dsound out device: ") + name - + T(" rate=") + String (sampleRate) - + T(" bits=") + String (bitDepth) - + T(" buf=") + String (bufferSizeSamples)); + return nativeWindow != 0 ? nativeWindow->getNativeHandle() : 0; + } - pDirectSound = 0; - pOutputBuffer = 0; - writeOffset = 0; + juce_UseDebuggingNewOperator - String error; - HRESULT hr = E_NOINTERFACE; + HGLRC renderContext; - if (dsDirectSoundCreate != 0) - hr = dsDirectSoundCreate (guid, &pDirectSound, 0); +private: + Win32ComponentPeer* nativeWindow; + Component* const component; + HDC dc; - if (hr == S_OK) - { - bytesPerBuffer = (bufferSizeSamples * (bitDepth >> 2)) & ~15; - totalBytesPerBuffer = (3 * bytesPerBuffer) & ~15; - const int numChannels = 2; + void createNativeWindow() + { + nativeWindow = new Win32ComponentPeer (component, 0); + nativeWindow->dontRepaint = true; + nativeWindow->setVisible (true); - hr = pDirectSound->SetCooperativeLevel (GetDesktopWindow(), 2 /* DSSCL_PRIORITY */); - logError (hr); + HWND hwnd = (HWND) nativeWindow->getNativeHandle(); - if (hr == S_OK) - { - IDirectSoundBuffer* pPrimaryBuffer; + Win32ComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); - DSBUFFERDESC primaryDesc; - zerostruct (primaryDesc); + if (peer != 0) + { + SetParent (hwnd, (HWND) peer->getNativeHandle()); + juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_CHILD, true); + juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_POPUP, false); + } - primaryDesc.dwSize = sizeof (DSBUFFERDESC); - primaryDesc.dwFlags = 1 /* DSBCAPS_PRIMARYBUFFER */; - primaryDesc.dwBufferBytes = 0; - primaryDesc.lpwfxFormat = 0; + dc = GetDC (hwnd); + } - log ("opening dsound out step 2"); - hr = pDirectSound->CreateSoundBuffer (&primaryDesc, &pPrimaryBuffer, 0); - logError (hr); + bool fillInPixelFormatDetails (const int pixelFormatIndex, + OpenGLPixelFormat& result, + const StringArray& availableExtensions) const throw() + { + PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; - if (hr == S_OK) - { - WAVEFORMATEX wfFormat; - wfFormat.wFormatTag = WAVE_FORMAT_PCM; - wfFormat.nChannels = (unsigned short) numChannels; - wfFormat.nSamplesPerSec = sampleRate; - wfFormat.wBitsPerSample = (unsigned short) bitDepth; - wfFormat.nBlockAlign = (unsigned short) (wfFormat.nChannels * wfFormat.wBitsPerSample / 8); - wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; - wfFormat.cbSize = 0; + if (availableExtensions.contains ("WGL_ARB_pixel_format") + && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) + { + int attributes[32]; + int numAttributes = 0; - hr = pPrimaryBuffer->SetFormat (&wfFormat); - logError (hr); + attributes[numAttributes++] = WGL_DRAW_TO_WINDOW_ARB; + attributes[numAttributes++] = WGL_SUPPORT_OPENGL_ARB; + attributes[numAttributes++] = WGL_ACCELERATION_ARB; + attributes[numAttributes++] = WGL_DOUBLE_BUFFER_ARB; + attributes[numAttributes++] = WGL_PIXEL_TYPE_ARB; + attributes[numAttributes++] = WGL_RED_BITS_ARB; + attributes[numAttributes++] = WGL_GREEN_BITS_ARB; + attributes[numAttributes++] = WGL_BLUE_BITS_ARB; + attributes[numAttributes++] = WGL_ALPHA_BITS_ARB; + attributes[numAttributes++] = WGL_DEPTH_BITS_ARB; + attributes[numAttributes++] = WGL_STENCIL_BITS_ARB; + attributes[numAttributes++] = WGL_ACCUM_RED_BITS_ARB; + attributes[numAttributes++] = WGL_ACCUM_GREEN_BITS_ARB; + attributes[numAttributes++] = WGL_ACCUM_BLUE_BITS_ARB; + attributes[numAttributes++] = WGL_ACCUM_ALPHA_BITS_ARB; - if (hr == S_OK) - { - DSBUFFERDESC secondaryDesc; - zerostruct (secondaryDesc); + if (availableExtensions.contains ("WGL_ARB_multisample")) + attributes[numAttributes++] = WGL_SAMPLES_ARB; - secondaryDesc.dwSize = sizeof (DSBUFFERDESC); - secondaryDesc.dwFlags = 0x8000 /* DSBCAPS_GLOBALFOCUS */ - | 0x10000 /* DSBCAPS_GETCURRENTPOSITION2 */; - secondaryDesc.dwBufferBytes = totalBytesPerBuffer; - secondaryDesc.lpwfxFormat = &wfFormat; + int values[32]; + zeromem (values, sizeof (values)); - hr = pDirectSound->CreateSoundBuffer (&secondaryDesc, &pOutputBuffer, 0); - logError (hr); + if (wglGetPixelFormatAttribivARB (dc, pixelFormatIndex, 0, numAttributes, attributes, values)) + { + int n = 0; + bool isValidFormat = (values[n++] == GL_TRUE); // WGL_DRAW_TO_WINDOW_ARB + isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_SUPPORT_OPENGL_ARB + isValidFormat = (values[n++] == WGL_FULL_ACCELERATION_ARB) && isValidFormat; // WGL_ACCELERATION_ARB + isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_DOUBLE_BUFFER_ARB: + isValidFormat = (values[n++] == WGL_TYPE_RGBA_ARB) && isValidFormat; // WGL_PIXEL_TYPE_ARB + result.redBits = values[n++]; // WGL_RED_BITS_ARB + result.greenBits = values[n++]; // WGL_GREEN_BITS_ARB + result.blueBits = values[n++]; // WGL_BLUE_BITS_ARB + result.alphaBits = values[n++]; // WGL_ALPHA_BITS_ARB + result.depthBufferBits = values[n++]; // WGL_DEPTH_BITS_ARB + result.stencilBufferBits = values[n++]; // WGL_STENCIL_BITS_ARB + result.accumulationBufferRedBits = values[n++]; // WGL_ACCUM_RED_BITS_ARB + result.accumulationBufferGreenBits = values[n++]; // WGL_ACCUM_GREEN_BITS_ARB + result.accumulationBufferBlueBits = values[n++]; // WGL_ACCUM_BLUE_BITS_ARB + result.accumulationBufferAlphaBits = values[n++]; // WGL_ACCUM_ALPHA_BITS_ARB + result.fullSceneAntiAliasingNumSamples = (uint8) values[n++]; // WGL_SAMPLES_ARB - if (hr == S_OK) - { - log ("opening dsound out step 3"); + return isValidFormat; + } + else + { + jassertfalse + } + } + else + { + PIXELFORMATDESCRIPTOR pfd; - DWORD dwDataLen; - unsigned char* pDSBuffData; + if (DescribePixelFormat (dc, pixelFormatIndex, sizeof (pfd), &pfd)) + { + result.redBits = pfd.cRedBits; + result.greenBits = pfd.cGreenBits; + result.blueBits = pfd.cBlueBits; + result.alphaBits = pfd.cAlphaBits; + result.depthBufferBits = pfd.cDepthBits; + result.stencilBufferBits = pfd.cStencilBits; + result.accumulationBufferRedBits = pfd.cAccumRedBits; + result.accumulationBufferGreenBits = pfd.cAccumGreenBits; + result.accumulationBufferBlueBits = pfd.cAccumBlueBits; + result.accumulationBufferAlphaBits = pfd.cAccumAlphaBits; + result.fullSceneAntiAliasingNumSamples = 0; - hr = pOutputBuffer->Lock (0, totalBytesPerBuffer, - (LPVOID*) &pDSBuffData, &dwDataLen, 0, 0, 0); - logError (hr); + return true; + } + else + { + jassertfalse + } + } - if (hr == S_OK) - { - zeromem (pDSBuffData, dwDataLen); + return false; + } - hr = pOutputBuffer->Unlock (pDSBuffData, dwDataLen, 0, 0); + WindowedGLContext (const WindowedGLContext&); + const WindowedGLContext& operator= (const WindowedGLContext&); +}; - if (hr == S_OK) - { - hr = pOutputBuffer->SetCurrentPosition (0); +OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, + const OpenGLPixelFormat& pixelFormat, + const OpenGLContext* const contextToShareWith) +{ + WindowedGLContext* c = new WindowedGLContext (component, + contextToShareWith != 0 ? (HGLRC) contextToShareWith->getRawContext() : 0, + pixelFormat); - if (hr == S_OK) - { - hr = pOutputBuffer->Play (0, 0, 1 /* DSBPLAY_LOOPING */); + if (c->renderContext == 0) + deleteAndZero (c); - if (hr == S_OK) - return String::empty; - } - } - } - } - } - } - } - } + return c; +} - error = getDSErrorMessage (hr); - close(); - return error; - } +void* OpenGLComponent::getNativeWindowHandle() const +{ + return context != 0 ? ((WindowedGLContext*) context)->getNativeWindowHandle() : 0; +} - void synchronisePosition() - { - if (pOutputBuffer != 0) - { - DWORD playCursor; - pOutputBuffer->GetCurrentPosition (&playCursor, &writeOffset); - } - } +void juce_glViewport (const int w, const int h) +{ + glViewport (0, 0, w, h); +} + +void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, + OwnedArray & results) +{ + Component tempComp; - bool service() { - if (pOutputBuffer == 0) - return true; + WindowedGLContext wc (component, 0, OpenGLPixelFormat (8, 8, 16, 0)); + wc.makeActive(); + wc.findAlternativeOpenGLPixelFormats (results); + } +} - DWORD playCursor, writeCursor; - HRESULT hr = pOutputBuffer->GetCurrentPosition (&playCursor, &writeCursor); +#endif +/********* End of inlined file: juce_win32_OpenGLComponent.cpp *********/ - if (hr != S_OK) - { - logError (hr); - jassertfalse - return true; - } +/********* Start of inlined file: juce_win32_AudioCDReader.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_USE_CDBURNER - int playWriteGap = writeCursor - playCursor; - if (playWriteGap < 0) - playWriteGap += totalBytesPerBuffer; +//*************************************************************************** +// %%% TARGET STATUS VALUES %%% +//*************************************************************************** +#define STATUS_GOOD 0x00 // Status Good +#define STATUS_CHKCOND 0x02 // Check Condition +#define STATUS_CONDMET 0x04 // Condition Met +#define STATUS_BUSY 0x08 // Busy +#define STATUS_INTERM 0x10 // Intermediate +#define STATUS_INTCDMET 0x14 // Intermediate-condition met +#define STATUS_RESCONF 0x18 // Reservation conflict +#define STATUS_COMTERM 0x22 // Command Terminated +#define STATUS_QFULL 0x28 // Queue full - int bytesEmpty = playCursor - writeOffset; +//*************************************************************************** +// %%% SCSI MISCELLANEOUS EQUATES %%% +//*************************************************************************** +#define MAXLUN 7 // Maximum Logical Unit Id +#define MAXTARG 7 // Maximum Target Id +#define MAX_SCSI_LUNS 64 // Maximum Number of SCSI LUNs +#define MAX_NUM_HA 8 // Maximum Number of SCSI HA's - if (bytesEmpty < 0) - bytesEmpty += totalBytesPerBuffer; +//*************************************************************************** +// %%% Commands for all Device Types %%% +//*************************************************************************** +#define SCSI_CHANGE_DEF 0x40 // Change Definition (Optional) +#define SCSI_COMPARE 0x39 // Compare (O) +#define SCSI_COPY 0x18 // Copy (O) +#define SCSI_COP_VERIFY 0x3A // Copy and Verify (O) +#define SCSI_INQUIRY 0x12 // Inquiry (MANDATORY) +#define SCSI_LOG_SELECT 0x4C // Log Select (O) +#define SCSI_LOG_SENSE 0x4D // Log Sense (O) +#define SCSI_MODE_SEL6 0x15 // Mode Select 6-byte (Device Specific) +#define SCSI_MODE_SEL10 0x55 // Mode Select 10-byte (Device Specific) +#define SCSI_MODE_SEN6 0x1A // Mode Sense 6-byte (Device Specific) +#define SCSI_MODE_SEN10 0x5A // Mode Sense 10-byte (Device Specific) +#define SCSI_READ_BUFF 0x3C // Read Buffer (O) +#define SCSI_REQ_SENSE 0x03 // Request Sense (MANDATORY) +#define SCSI_SEND_DIAG 0x1D // Send Diagnostic (O) +#define SCSI_TST_U_RDY 0x00 // Test Unit Ready (MANDATORY) +#define SCSI_WRITE_BUFF 0x3B // Write Buffer (O) - if (bytesEmpty > (totalBytesPerBuffer - playWriteGap)) - { - writeOffset = writeCursor; - bytesEmpty = totalBytesPerBuffer - playWriteGap; - } +//*************************************************************************** +// %%% Commands Unique to Direct Access Devices %%% +//*************************************************************************** +#define SCSI_COMPARE 0x39 // Compare (O) +#define SCSI_FORMAT 0x04 // Format Unit (MANDATORY) +#define SCSI_LCK_UN_CAC 0x36 // Lock Unlock Cache (O) +#define SCSI_PREFETCH 0x34 // Prefetch (O) +#define SCSI_MED_REMOVL 0x1E // Prevent/Allow medium Removal (O) +#define SCSI_READ6 0x08 // Read 6-byte (MANDATORY) +#define SCSI_READ10 0x28 // Read 10-byte (MANDATORY) +#define SCSI_RD_CAPAC 0x25 // Read Capacity (MANDATORY) +#define SCSI_RD_DEFECT 0x37 // Read Defect Data (O) +#define SCSI_READ_LONG 0x3E // Read Long (O) +#define SCSI_REASS_BLK 0x07 // Reassign Blocks (O) +#define SCSI_RCV_DIAG 0x1C // Receive Diagnostic Results (O) +#define SCSI_RELEASE 0x17 // Release Unit (MANDATORY) +#define SCSI_REZERO 0x01 // Rezero Unit (O) +#define SCSI_SRCH_DAT_E 0x31 // Search Data Equal (O) +#define SCSI_SRCH_DAT_H 0x30 // Search Data High (O) +#define SCSI_SRCH_DAT_L 0x32 // Search Data Low (O) +#define SCSI_SEEK6 0x0B // Seek 6-Byte (O) +#define SCSI_SEEK10 0x2B // Seek 10-Byte (O) +#define SCSI_SEND_DIAG 0x1D // Send Diagnostics (MANDATORY) +#define SCSI_SET_LIMIT 0x33 // Set Limits (O) +#define SCSI_START_STP 0x1B // Start/Stop Unit (O) +#define SCSI_SYNC_CACHE 0x35 // Synchronize Cache (O) +#define SCSI_VERIFY 0x2F // Verify (O) +#define SCSI_WRITE6 0x0A // Write 6-Byte (MANDATORY) +#define SCSI_WRITE10 0x2A // Write 10-Byte (MANDATORY) +#define SCSI_WRT_VERIFY 0x2E // Write and Verify (O) +#define SCSI_WRITE_LONG 0x3F // Write Long (O) +#define SCSI_WRITE_SAME 0x41 // Write Same (O) - if (bytesEmpty >= bytesPerBuffer) - { - LPBYTE lpbuf1 = 0; - LPBYTE lpbuf2 = 0; - DWORD dwSize1 = 0; - DWORD dwSize2 = 0; +//*************************************************************************** +// %%% Commands Unique to Sequential Access Devices %%% +//*************************************************************************** +#define SCSI_ERASE 0x19 // Erase (MANDATORY) +#define SCSI_LOAD_UN 0x1b // Load/Unload (O) +#define SCSI_LOCATE 0x2B // Locate (O) +#define SCSI_RD_BLK_LIM 0x05 // Read Block Limits (MANDATORY) +#define SCSI_READ_POS 0x34 // Read Position (O) +#define SCSI_READ_REV 0x0F // Read Reverse (O) +#define SCSI_REC_BF_DAT 0x14 // Recover Buffer Data (O) +#define SCSI_RESERVE 0x16 // Reserve Unit (MANDATORY) +#define SCSI_REWIND 0x01 // Rewind (MANDATORY) +#define SCSI_SPACE 0x11 // Space (MANDATORY) +#define SCSI_VERIFY_T 0x13 // Verify (Tape) (O) +#define SCSI_WRT_FILE 0x10 // Write Filemarks (MANDATORY) - HRESULT hr = pOutputBuffer->Lock (writeOffset, - bytesPerBuffer, - (void**) &lpbuf1, &dwSize1, - (void**) &lpbuf2, &dwSize2, 0); +//*************************************************************************** +// %%% Commands Unique to Printer Devices %%% +//*************************************************************************** +#define SCSI_PRINT 0x0A // Print (MANDATORY) +#define SCSI_SLEW_PNT 0x0B // Slew and Print (O) +#define SCSI_STOP_PNT 0x1B // Stop Print (O) +#define SCSI_SYNC_BUFF 0x10 // Synchronize Buffer (O) - if (hr == MAKE_HRESULT (1, 0x878, 150)) // DSERR_BUFFERLOST - { - pOutputBuffer->Restore(); +//*************************************************************************** +// %%% Commands Unique to Processor Devices %%% +//*************************************************************************** +#define SCSI_RECEIVE 0x08 // Receive (O) +#define SCSI_SEND 0x0A // Send (O) - hr = pOutputBuffer->Lock (writeOffset, - bytesPerBuffer, - (void**) &lpbuf1, &dwSize1, - (void**) &lpbuf2, &dwSize2, 0); - } +//*************************************************************************** +// %%% Commands Unique to Write-Once Devices %%% +//*************************************************************************** +#define SCSI_MEDIUM_SCN 0x38 // Medium Scan (O) +#define SCSI_SRCHDATE10 0x31 // Search Data Equal 10-Byte (O) +#define SCSI_SRCHDATE12 0xB1 // Search Data Equal 12-Byte (O) +#define SCSI_SRCHDATH10 0x30 // Search Data High 10-Byte (O) +#define SCSI_SRCHDATH12 0xB0 // Search Data High 12-Byte (O) +#define SCSI_SRCHDATL10 0x32 // Search Data Low 10-Byte (O) +#define SCSI_SRCHDATL12 0xB2 // Search Data Low 12-Byte (O) +#define SCSI_SET_LIM_10 0x33 // Set Limits 10-Byte (O) +#define SCSI_SET_LIM_12 0xB3 // Set Limits 10-Byte (O) +#define SCSI_VERIFY10 0x2F // Verify 10-Byte (O) +#define SCSI_VERIFY12 0xAF // Verify 12-Byte (O) +#define SCSI_WRITE12 0xAA // Write 12-Byte (O) +#define SCSI_WRT_VER10 0x2E // Write and Verify 10-Byte (O) +#define SCSI_WRT_VER12 0xAE // Write and Verify 12-Byte (O) - if (hr == S_OK) - { - if (bitDepth == 16) - { - const float gainL = 32767.0f; - const float gainR = 32767.0f; +//*************************************************************************** +// %%% Commands Unique to CD-ROM Devices %%% +//*************************************************************************** +#define SCSI_PLAYAUD_10 0x45 // Play Audio 10-Byte (O) +#define SCSI_PLAYAUD_12 0xA5 // Play Audio 12-Byte 12-Byte (O) +#define SCSI_PLAYAUDMSF 0x47 // Play Audio MSF (O) +#define SCSI_PLAYA_TKIN 0x48 // Play Audio Track/Index (O) +#define SCSI_PLYTKREL10 0x49 // Play Track Relative 10-Byte (O) +#define SCSI_PLYTKREL12 0xA9 // Play Track Relative 12-Byte (O) +#define SCSI_READCDCAP 0x25 // Read CD-ROM Capacity (MANDATORY) +#define SCSI_READHEADER 0x44 // Read Header (O) +#define SCSI_SUBCHANNEL 0x42 // Read Subchannel (O) +#define SCSI_READ_TOC 0x43 // Read TOC (O) - int* dest = (int*)lpbuf1; - const float* left = leftBuffer; - const float* right = rightBuffer; - int samples1 = dwSize1 >> 2; - int samples2 = dwSize2 >> 2; +//*************************************************************************** +// %%% Commands Unique to Scanner Devices %%% +//*************************************************************************** +#define SCSI_GETDBSTAT 0x34 // Get Data Buffer Status (O) +#define SCSI_GETWINDOW 0x25 // Get Window (O) +#define SCSI_OBJECTPOS 0x31 // Object Postion (O) +#define SCSI_SCAN 0x1B // Scan (O) +#define SCSI_SETWINDOW 0x24 // Set Window (MANDATORY) - if (left == 0) - { - while (--samples1 >= 0) - { - int r = roundFloatToInt (gainR * *right++); +//*************************************************************************** +// %%% Commands Unique to Optical Memory Devices %%% +//*************************************************************************** +#define SCSI_UpdateBlk 0x3D // Update Block (O) - if (r < -32768) - r = -32768; - else if (r > 32767) - r = 32767; +//*************************************************************************** +// %%% Commands Unique to Medium Changer Devices %%% +//*************************************************************************** +#define SCSI_EXCHMEDIUM 0xA6 // Exchange Medium (O) +#define SCSI_INITELSTAT 0x07 // Initialize Element Status (O) +#define SCSI_POSTOELEM 0x2B // Position to Element (O) +#define SCSI_REQ_VE_ADD 0xB5 // Request Volume Element Address (O) +#define SCSI_SENDVOLTAG 0xB6 // Send Volume Tag (O) - *dest++ = (r << 16); - } +//*************************************************************************** +// %%% Commands Unique to Communication Devices %%% +//*************************************************************************** +#define SCSI_GET_MSG_6 0x08 // Get Message 6-Byte (MANDATORY) +#define SCSI_GET_MSG_10 0x28 // Get Message 10-Byte (O) +#define SCSI_GET_MSG_12 0xA8 // Get Message 12-Byte (O) +#define SCSI_SND_MSG_6 0x0A // Send Message 6-Byte (MANDATORY) +#define SCSI_SND_MSG_10 0x2A // Send Message 10-Byte (O) +#define SCSI_SND_MSG_12 0xAA // Send Message 12-Byte (O) - dest = (int*)lpbuf2; +//*************************************************************************** +// %%% Request Sense Data Format %%% +//*************************************************************************** +typedef struct { + BYTE ErrorCode; // Error Code (70H or 71H) + BYTE SegmentNum; // Number of current segment descriptor + BYTE SenseKey; // Sense Key(See bit definitions too) + BYTE InfoByte0; // Information MSB + BYTE InfoByte1; // Information MID + BYTE InfoByte2; // Information MID + BYTE InfoByte3; // Information LSB + BYTE AddSenLen; // Additional Sense Length + BYTE ComSpecInf0; // Command Specific Information MSB + BYTE ComSpecInf1; // Command Specific Information MID + BYTE ComSpecInf2; // Command Specific Information MID + BYTE ComSpecInf3; // Command Specific Information LSB + BYTE AddSenseCode; // Additional Sense Code + BYTE AddSenQual; // Additional Sense Code Qualifier + BYTE FieldRepUCode; // Field Replaceable Unit Code + BYTE SenKeySpec15; // Sense Key Specific 15th byte + BYTE SenKeySpec16; // Sense Key Specific 16th byte + BYTE SenKeySpec17; // Sense Key Specific 17th byte + BYTE AddSenseBytes; // Additional Sense Bytes +} SENSE_DATA_FMT; - while (--samples2 >= 0) - { - int r = roundFloatToInt (gainR * *right++); +//*************************************************************************** +// %%% REQUEST SENSE ERROR CODE %%% +//*************************************************************************** +#define SERROR_CURRENT 0x70 // Current Errors +#define SERROR_DEFERED 0x71 // Deferred Errors - if (r < -32768) - r = -32768; - else if (r > 32767) - r = 32767; +//*************************************************************************** +// %%% REQUEST SENSE BIT DEFINITIONS %%% +//*************************************************************************** +#define SENSE_VALID 0x80 // Byte 0 Bit 7 +#define SENSE_FILEMRK 0x80 // Byte 2 Bit 7 +#define SENSE_EOM 0x40 // Byte 2 Bit 6 +#define SENSE_ILI 0x20 // Byte 2 Bit 5 - *dest++ = (r << 16); - } - } - else if (right == 0) - { - while (--samples1 >= 0) - { - int l = roundFloatToInt (gainL * *left++); +//*************************************************************************** +// %%% REQUEST SENSE SENSE KEY DEFINITIONS %%% +//*************************************************************************** +#define KEY_NOSENSE 0x00 // No Sense +#define KEY_RECERROR 0x01 // Recovered Error +#define KEY_NOTREADY 0x02 // Not Ready +#define KEY_MEDIUMERR 0x03 // Medium Error +#define KEY_HARDERROR 0x04 // Hardware Error +#define KEY_ILLGLREQ 0x05 // Illegal Request +#define KEY_UNITATT 0x06 // Unit Attention +#define KEY_DATAPROT 0x07 // Data Protect +#define KEY_BLANKCHK 0x08 // Blank Check +#define KEY_VENDSPEC 0x09 // Vendor Specific +#define KEY_COPYABORT 0x0A // Copy Abort +#define KEY_EQUAL 0x0C // Equal (Search) +#define KEY_VOLOVRFLW 0x0D // Volume Overflow +#define KEY_MISCOMP 0x0E // Miscompare (Search) +#define KEY_RESERVED 0x0F // Reserved - if (l < -32768) - l = -32768; - else if (l > 32767) - l = 32767; +//*************************************************************************** +// %%% PERIPHERAL DEVICE TYPE DEFINITIONS %%% +//*************************************************************************** +#define DTYPE_DASD 0x00 // Disk Device +#define DTYPE_SEQD 0x01 // Tape Device +#define DTYPE_PRNT 0x02 // Printer +#define DTYPE_PROC 0x03 // Processor +#define DTYPE_WORM 0x04 // Write-once read-multiple +#define DTYPE_CROM 0x05 // CD-ROM device +#define DTYPE_SCAN 0x06 // Scanner device +#define DTYPE_OPTI 0x07 // Optical memory device +#define DTYPE_JUKE 0x08 // Medium Changer device +#define DTYPE_COMM 0x09 // Communications device +#define DTYPE_RESL 0x0A // Reserved (low) +#define DTYPE_RESH 0x1E // Reserved (high) +#define DTYPE_UNKNOWN 0x1F // Unknown or no device type - l &= 0xffff; +//*************************************************************************** +// %%% ANSI APPROVED VERSION DEFINITIONS %%% +//*************************************************************************** +#define ANSI_MAYBE 0x0 // Device may or may not be ANSI approved stand +#define ANSI_SCSI1 0x1 // Device complies to ANSI X3.131-1986 (SCSI-1) +#define ANSI_SCSI2 0x2 // Device complies to SCSI-2 +#define ANSI_RESLO 0x3 // Reserved (low) +#define ANSI_RESHI 0x7 // Reserved (high) - *dest++ = l; - } +typedef struct +{ + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + ULONG DataBufferOffset; + ULONG SenseInfoOffset; + UCHAR Cdb[16]; +} SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH; - dest = (int*)lpbuf2; +typedef struct +{ + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + ULONG SenseInfoOffset; + UCHAR Cdb[16]; +} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT; - while (--samples2 >= 0) - { - int l = roundFloatToInt (gainL * *left++); +typedef struct +{ + SCSI_PASS_THROUGH_DIRECT spt; + ULONG Filler; + UCHAR ucSenseBuf[32]; +} SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, *PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER; - if (l < -32768) - l = -32768; - else if (l > 32767) - l = 32767; +typedef struct +{ + ULONG Length; + UCHAR PortNumber; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; +} SCSI_ADDRESS, *PSCSI_ADDRESS; - l &= 0xffff; +#define METHOD_BUFFERED 0 +#define METHOD_IN_DIRECT 1 +#define METHOD_OUT_DIRECT 2 +#define METHOD_NEITHER 3 - *dest++ = l; - } - } - else - { - while (--samples1 >= 0) - { - int l = roundFloatToInt (gainL * *left++); +#define FILE_ANY_ACCESS 0 +#ifndef FILE_READ_ACCESS +#define FILE_READ_ACCESS (0x0001) +#endif +#ifndef FILE_WRITE_ACCESS +#define FILE_WRITE_ACCESS (0x0002) +#endif - if (l < -32768) - l = -32768; - else if (l > 32767) - l = 32767; +#define IOCTL_SCSI_BASE 0x00000004 - l &= 0xffff; +#define SCSI_IOCTL_DATA_OUT 0 +#define SCSI_IOCTL_DATA_IN 1 +#define SCSI_IOCTL_DATA_UNSPECIFIED 2 - int r = roundFloatToInt (gainR * *right++); +#define CTL_CODE2( DevType, Function, Method, Access ) ( \ + ((DevType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ +) - if (r < -32768) - r = -32768; - else if (r > 32767) - r = 32767; +#define IOCTL_SCSI_PASS_THROUGH CTL_CODE2( IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS ) +#define IOCTL_SCSI_GET_CAPABILITIES CTL_CODE2( IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_SCSI_PASS_THROUGH_DIRECT CTL_CODE2( IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS ) +#define IOCTL_SCSI_GET_ADDRESS CTL_CODE2( IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS ) - *dest++ = (r << 16) | l; - } +#define SENSE_LEN 14 +#define SRB_DIR_SCSI 0x00 +#define SRB_POSTING 0x01 +#define SRB_ENABLE_RESIDUAL_COUNT 0x04 +#define SRB_DIR_IN 0x08 +#define SRB_DIR_OUT 0x10 +#define SRB_EVENT_NOTIFY 0x40 +#define RESIDUAL_COUNT_SUPPORTED 0x02 +#define MAX_SRB_TIMEOUT 1080001u +#define DEFAULT_SRB_TIMEOUT 1080001u - dest = (int*)lpbuf2; +#define SC_HA_INQUIRY 0x00 +#define SC_GET_DEV_TYPE 0x01 +#define SC_EXEC_SCSI_CMD 0x02 +#define SC_ABORT_SRB 0x03 +#define SC_RESET_DEV 0x04 +#define SC_SET_HA_PARMS 0x05 +#define SC_GET_DISK_INFO 0x06 +#define SC_RESCAN_SCSI_BUS 0x07 +#define SC_GETSET_TIMEOUTS 0x08 - while (--samples2 >= 0) - { - int l = roundFloatToInt (gainL * *left++); +#define SS_PENDING 0x00 +#define SS_COMP 0x01 +#define SS_ABORTED 0x02 +#define SS_ABORT_FAIL 0x03 +#define SS_ERR 0x04 +#define SS_INVALID_CMD 0x80 +#define SS_INVALID_HA 0x81 +#define SS_NO_DEVICE 0x82 +#define SS_INVALID_SRB 0xE0 +#define SS_OLD_MANAGER 0xE1 +#define SS_BUFFER_ALIGN 0xE1 +#define SS_ILLEGAL_MODE 0xE2 +#define SS_NO_ASPI 0xE3 +#define SS_FAILED_INIT 0xE4 +#define SS_ASPI_IS_BUSY 0xE5 +#define SS_BUFFER_TO_BIG 0xE6 +#define SS_BUFFER_TOO_BIG 0xE6 +#define SS_MISMATCHED_COMPONENTS 0xE7 +#define SS_NO_ADAPTERS 0xE8 +#define SS_INSUFFICIENT_RESOURCES 0xE9 +#define SS_ASPI_IS_SHUTDOWN 0xEA +#define SS_BAD_INSTALL 0xEB - if (l < -32768) - l = -32768; - else if (l > 32767) - l = 32767; +#define HASTAT_OK 0x00 +#define HASTAT_SEL_TO 0x11 +#define HASTAT_DO_DU 0x12 +#define HASTAT_BUS_FREE 0x13 +#define HASTAT_PHASE_ERR 0x14 +#define HASTAT_TIMEOUT 0x09 +#define HASTAT_COMMAND_TIMEOUT 0x0B +#define HASTAT_MESSAGE_REJECT 0x0D +#define HASTAT_BUS_RESET 0x0E +#define HASTAT_PARITY_ERROR 0x0F +#define HASTAT_REQUEST_SENSE_FAILED 0x10 - l &= 0xffff; +#define PACKED +#pragma pack(1) - int r = roundFloatToInt (gainR * *right++); +typedef struct +{ + BYTE SRB_Cmd; + BYTE SRB_Status; + BYTE SRB_HaID; + BYTE SRB_Flags; + DWORD SRB_Hdr_Rsvd; + BYTE HA_Count; + BYTE HA_SCSI_ID; + BYTE HA_ManagerId[16]; + BYTE HA_Identifier[16]; + BYTE HA_Unique[16]; + WORD HA_Rsvd1; + BYTE pad[20]; +} PACKED SRB_HAInquiry, *PSRB_HAInquiry, FAR *LPSRB_HAInquiry; - if (r < -32768) - r = -32768; - else if (r > 32767) - r = 32767; +typedef struct +{ + BYTE SRB_Cmd; + BYTE SRB_Status; + BYTE SRB_HaID; + BYTE SRB_Flags; + DWORD SRB_Hdr_Rsvd; + BYTE SRB_Target; + BYTE SRB_Lun; + BYTE SRB_DeviceType; + BYTE SRB_Rsvd1; + BYTE pad[68]; +} PACKED SRB_GDEVBlock, *PSRB_GDEVBlock, FAR *LPSRB_GDEVBlock; - *dest++ = (r << 16) | l; - } - } - } - else - { - jassertfalse - } +typedef struct +{ + BYTE SRB_Cmd; + BYTE SRB_Status; + BYTE SRB_HaID; + BYTE SRB_Flags; + DWORD SRB_Hdr_Rsvd; + BYTE SRB_Target; + BYTE SRB_Lun; + WORD SRB_Rsvd1; + DWORD SRB_BufLen; + BYTE FAR *SRB_BufPointer; + BYTE SRB_SenseLen; + BYTE SRB_CDBLen; + BYTE SRB_HaStat; + BYTE SRB_TargStat; + VOID FAR *SRB_PostProc; + BYTE SRB_Rsvd2[20]; + BYTE CDBByte[16]; + BYTE SenseArea[SENSE_LEN+2]; +} PACKED SRB_ExecSCSICmd, *PSRB_ExecSCSICmd, FAR *LPSRB_ExecSCSICmd; - writeOffset = (writeOffset + dwSize1 + dwSize2) % totalBytesPerBuffer; +typedef struct +{ + BYTE SRB_Cmd; + BYTE SRB_Status; + BYTE SRB_HaId; + BYTE SRB_Flags; + DWORD SRB_Hdr_Rsvd; +} PACKED SRB, *PSRB, FAR *LPSRB; - pOutputBuffer->Unlock (lpbuf1, dwSize1, lpbuf2, dwSize2); - } - else - { - jassertfalse - logError (hr); - } +#pragma pack() - bytesEmpty -= bytesPerBuffer; +struct CDDeviceInfo +{ + char vendor[9]; + char productId[17]; + char rev[5]; + char vendorSpec[21]; - return true; - } - else - { - return false; - } - } + BYTE ha; + BYTE tgt; + BYTE lun; + char scsiDriveLetter; // will be 0 if not using scsi }; -struct DSoundInternalInChannel +class CDReadBuffer { - String name; - LPGUID guid; - int sampleRate, bufferSizeSamples; - float* leftBuffer; - float* rightBuffer; - - IDirectSound* pDirectSound; - IDirectSoundCapture* pDirectSoundCapture; - IDirectSoundCaptureBuffer* pInputBuffer; - public: - unsigned int readOffset; - int bytesPerBuffer, totalBytesPerBuffer; - int bitDepth; - bool doneFlag; + int startFrame; + int numFrames; + int dataStartOffset; + int dataLength; + BYTE* buffer; + int bufferSize; + int index; + bool wantsIndex; - DSoundInternalInChannel (const String& name_, - LPGUID guid_, - int rate, - int bufferSize, - float* left, - float* right) - : name (name_), - guid (guid_), - sampleRate (rate), - bufferSizeSamples (bufferSize), - leftBuffer (left), - rightBuffer (right), - pDirectSound (0), - pDirectSoundCapture (0), - pInputBuffer (0), - bitDepth (16) + CDReadBuffer (const int numberOfFrames) + : startFrame (0), + numFrames (0), + dataStartOffset (0), + dataLength (0), + index (0), + wantsIndex (false) { + bufferSize = 2352 * numberOfFrames; + buffer = (BYTE*) malloc (bufferSize); } - ~DSoundInternalInChannel() + ~CDReadBuffer() { - close(); + free (buffer); } - void close() + bool isZero() const { - HRESULT hr; - - if (pInputBuffer != 0) - { - JUCE_TRY - { - log (T("closing dsound in: ") + name); - hr = pInputBuffer->Stop(); - logError (hr); - } - CATCH - - JUCE_TRY - { - hr = pInputBuffer->Release(); - logError (hr); - } - CATCH - - pInputBuffer = 0; - } - - if (pDirectSoundCapture != 0) - { - JUCE_TRY - { - hr = pDirectSoundCapture->Release(); - logError (hr); - } - CATCH - - pDirectSoundCapture = 0; - } + BYTE* p = buffer + dataStartOffset; - if (pDirectSound != 0) - { - JUCE_TRY - { - hr = pDirectSound->Release(); - logError (hr); - } - CATCH + for (int i = dataLength; --i >= 0;) + if (*p++ != 0) + return false; - pDirectSound = 0; - } + return true; } +}; - const String open() - { - log (T("opening dsound in device: ") + name - + T(" rate=") + String (sampleRate) + T(" bits=") + String (bitDepth) + T(" buf=") + String (bufferSizeSamples)); - - pDirectSound = 0; - pDirectSoundCapture = 0; - pInputBuffer = 0; - readOffset = 0; - totalBytesPerBuffer = 0; - - String error; - HRESULT hr = E_NOINTERFACE; - - if (dsDirectSoundCaptureCreate != 0) - hr = dsDirectSoundCaptureCreate (guid, &pDirectSoundCapture, 0); +class CDDeviceHandle; - logError (hr); +class CDController +{ +public: + CDController(); + virtual ~CDController(); - if (hr == S_OK) - { - const int numChannels = 2; - bytesPerBuffer = (bufferSizeSamples * (bitDepth >> 2)) & ~15; - totalBytesPerBuffer = (3 * bytesPerBuffer) & ~15; + virtual bool read (CDReadBuffer* t) = 0; + virtual void shutDown(); - WAVEFORMATEX wfFormat; - wfFormat.wFormatTag = WAVE_FORMAT_PCM; - wfFormat.nChannels = (unsigned short)numChannels; - wfFormat.nSamplesPerSec = sampleRate; - wfFormat.wBitsPerSample = (unsigned short)bitDepth; - wfFormat.nBlockAlign = (unsigned short)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); - wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; - wfFormat.cbSize = 0; + bool readAudio (CDReadBuffer* t, CDReadBuffer* overlapBuffer = 0); + int getLastIndex(); - DSCBUFFERDESC captureDesc; - zerostruct (captureDesc); +public: + bool initialised; - captureDesc.dwSize = sizeof (DSCBUFFERDESC); - captureDesc.dwFlags = 0; - captureDesc.dwBufferBytes = totalBytesPerBuffer; - captureDesc.lpwfxFormat = &wfFormat; + CDDeviceHandle* deviceInfo; + int framesToCheck, framesOverlap; - log (T("opening dsound in step 2")); - hr = pDirectSoundCapture->CreateCaptureBuffer (&captureDesc, &pInputBuffer, 0); + void prepare (SRB_ExecSCSICmd& s); + void perform (SRB_ExecSCSICmd& s); + void setPaused (bool paused); +}; - logError (hr); +#pragma pack(1) - if (hr == S_OK) - { - hr = pInputBuffer->Start (1 /* DSCBSTART_LOOPING */); - logError (hr); +struct TOCTRACK +{ + BYTE rsvd; + BYTE ADR; + BYTE trackNumber; + BYTE rsvd2; + BYTE addr[4]; +}; - if (hr == S_OK) - return String::empty; - } - } +struct TOC +{ + WORD tocLen; + BYTE firstTrack; + BYTE lastTrack; + TOCTRACK tracks[100]; +}; - error = getDSErrorMessage (hr); - close(); +#pragma pack() - return error; - } +enum +{ + READTYPE_ANY = 0, + READTYPE_ATAPI1 = 1, + READTYPE_ATAPI2 = 2, + READTYPE_READ6 = 3, + READTYPE_READ10 = 4, + READTYPE_READ_D8 = 5, + READTYPE_READ_D4 = 6, + READTYPE_READ_D4_1 = 7, + READTYPE_READ10_2 = 8 +}; - void synchronisePosition() +class CDDeviceHandle +{ +public: + CDDeviceHandle (const CDDeviceInfo* const device) + : scsiHandle (0), + readType (READTYPE_ANY), + controller (0) { - if (pInputBuffer != 0) - { - DWORD capturePos; - pInputBuffer->GetCurrentPosition (&capturePos, (DWORD*)&readOffset); - } + memcpy (&info, device, sizeof (info)); } - bool service() + ~CDDeviceHandle() { - if (pInputBuffer == 0) - return true; - - DWORD capturePos, readPos; - HRESULT hr = pInputBuffer->GetCurrentPosition (&capturePos, &readPos); - logError (hr); - - if (hr != S_OK) - return true; - - int bytesFilled = readPos - readOffset; - if (bytesFilled < 0) - bytesFilled += totalBytesPerBuffer; - - if (bytesFilled >= bytesPerBuffer) + if (controller != 0) { - LPBYTE lpbuf1 = 0; - LPBYTE lpbuf2 = 0; - DWORD dwsize1 = 0; - DWORD dwsize2 = 0; + controller->shutDown(); + delete controller; + } - HRESULT hr = pInputBuffer->Lock (readOffset, - bytesPerBuffer, - (void**) &lpbuf1, &dwsize1, - (void**) &lpbuf2, &dwsize2, 0); + if (scsiHandle != 0) + CloseHandle (scsiHandle); + } - if (hr == S_OK) - { - if (bitDepth == 16) - { - const float g = 1.0f / 32768.0f; + bool readTOC (TOC* lpToc, bool useMSF); + bool readAudio (CDReadBuffer* buffer, CDReadBuffer* overlapBuffer = 0); + void openDrawer (bool shouldBeOpen); - float* destL = leftBuffer; - float* destR = rightBuffer; - int samples1 = dwsize1 >> 2; - int samples2 = dwsize2 >> 2; + CDDeviceInfo info; + HANDLE scsiHandle; + BYTE readType; - const short* src = (const short*)lpbuf1; +private: + CDController* controller; - if (destL == 0) - { - while (--samples1 >= 0) - { - ++src; - *destR++ = *src++ * g; - } + bool testController (const int readType, + CDController* const newController, + CDReadBuffer* const bufferToUse); +}; - src = (const short*)lpbuf2; +DWORD (*fGetASPI32SupportInfo)(void); +DWORD (*fSendASPI32Command)(LPSRB); - while (--samples2 >= 0) - { - ++src; - *destR++ = *src++ * g; - } - } - else if (destR == 0) - { - while (--samples1 >= 0) - { - *destL++ = *src++ * g; - ++src; - } +static HINSTANCE winAspiLib = 0; +static bool usingScsi = false; +static bool initialised = false; - src = (const short*)lpbuf2; +static bool InitialiseCDRipper() +{ + if (! initialised) + { + initialised = true; - while (--samples2 >= 0) - { - *destL++ = *src++ * g; - ++src; - } - } - else - { - while (--samples1 >= 0) - { - *destL++ = *src++ * g; - *destR++ = *src++ * g; - } + OSVERSIONINFO info; + info.dwOSVersionInfoSize = sizeof (info); + GetVersionEx (&info); - src = (const short*)lpbuf2; + usingScsi = (info.dwPlatformId == VER_PLATFORM_WIN32_NT) && (info.dwMajorVersion > 4); - while (--samples2 >= 0) - { - *destL++ = *src++ * g; - *destR++ = *src++ * g; - } - } - } - else - { - jassertfalse - } + if (! usingScsi) + { + fGetASPI32SupportInfo = 0; + fSendASPI32Command = 0; + winAspiLib = LoadLibrary (_T("WNASPI32.DLL")); - readOffset = (readOffset + dwsize1 + dwsize2) % totalBytesPerBuffer; + if (winAspiLib != 0) + { + fGetASPI32SupportInfo = (DWORD(*)(void)) GetProcAddress (winAspiLib, "GetASPI32SupportInfo"); + fSendASPI32Command = (DWORD(*)(LPSRB)) GetProcAddress (winAspiLib, "SendASPI32Command"); - pInputBuffer->Unlock (lpbuf1, dwsize1, lpbuf2, dwsize2); + if (fGetASPI32SupportInfo == 0 || fSendASPI32Command == 0) + return false; } else { - logError (hr); - jassertfalse + usingScsi = true; } - - bytesFilled -= bytesPerBuffer; - - return true; - } - else - { - return false; } } -}; -class DSoundAudioIODevice : public AudioIODevice, - public Thread + return true; +} + +static void DeinitialiseCDRipper() { -public: - DSoundAudioIODevice (const String& deviceName, - const int outputDeviceIndex_, - const int inputDeviceIndex_) - : AudioIODevice (deviceName, "DirectSound"), - Thread ("Juce DSound"), - isOpen_ (false), - isStarted (false), - outputDeviceIndex (outputDeviceIndex_), - inputDeviceIndex (inputDeviceIndex_), - inChans (4), - outChans (4), - numInputBuffers (0), - numOutputBuffers (0), - totalSamplesOut (0), - sampleRate (0.0), - inputBuffers (0), - outputBuffers (0), - callback (0), - bufferSizeSamples (0) + if (winAspiLib != 0) { - if (outputDeviceIndex_ >= 0) - { - outChannels.add (TRANS("Left")); - outChannels.add (TRANS("Right")); - } - - if (inputDeviceIndex_ >= 0) - { - inChannels.add (TRANS("Left")); - inChannels.add (TRANS("Right")); - } + fGetASPI32SupportInfo = 0; + fSendASPI32Command = 0; + FreeLibrary (winAspiLib); + winAspiLib = 0; } - ~DSoundAudioIODevice() - { - close(); - } + initialised = false; +} - const StringArray getOutputChannelNames() - { - return outChannels; - } +static HANDLE CreateSCSIDeviceHandle (char driveLetter) +{ + TCHAR devicePath[8]; + devicePath[0] = '\\'; + devicePath[1] = '\\'; + devicePath[2] = '.'; + devicePath[3] = '\\'; + devicePath[4] = driveLetter; + devicePath[5] = ':'; + devicePath[6] = 0; - const StringArray getInputChannelNames() - { - return inChannels; - } + OSVERSIONINFO info; + info.dwOSVersionInfoSize = sizeof (info); + GetVersionEx (&info); - int getNumSampleRates() - { - return 4; - } + DWORD flags = GENERIC_READ; - double getSampleRate (int index) - { - const double samps[] = { 44100.0, 48000.0, 88200.0, 96000.0 }; + if ((info.dwPlatformId == VER_PLATFORM_WIN32_NT) && (info.dwMajorVersion > 4)) + flags = GENERIC_READ | GENERIC_WRITE; - return samps [jlimit (0, 3, index)]; - } + HANDLE h = CreateFile (devicePath, flags, FILE_SHARE_WRITE | FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - int getNumBufferSizesAvailable() + if (h == INVALID_HANDLE_VALUE) { - return 50; + flags ^= GENERIC_WRITE; + h = CreateFile (devicePath, flags, FILE_SHARE_WRITE | FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); } - int getBufferSizeSamples (int index) - { - int n = 64; - for (int i = 0; i < index; ++i) - n += (n < 512) ? 32 - : ((n < 1024) ? 64 - : ((n < 2048) ? 128 : 256)); + return h; +} - return n; - } +static DWORD performScsiPassThroughCommand (const LPSRB_ExecSCSICmd srb, + const char driveLetter, + HANDLE& deviceHandle, + const bool retryOnFailure = true) +{ + SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER s; + zerostruct (s); - int getDefaultBufferSize() - { - return 2560; - } + s.spt.Length = sizeof (SCSI_PASS_THROUGH); + s.spt.CdbLength = srb->SRB_CDBLen; - const String open (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate, - int bufferSizeSamples) - { - lastError = openDevice (inputChannels, outputChannels, sampleRate, bufferSizeSamples); - isOpen_ = lastError.isEmpty(); + s.spt.DataIn = (BYTE) ((srb->SRB_Flags & SRB_DIR_IN) + ? SCSI_IOCTL_DATA_IN + : ((srb->SRB_Flags & SRB_DIR_OUT) + ? SCSI_IOCTL_DATA_OUT + : SCSI_IOCTL_DATA_UNSPECIFIED)); - return lastError; - } + s.spt.DataTransferLength = srb->SRB_BufLen; + s.spt.TimeOutValue = 5; + s.spt.DataBuffer = srb->SRB_BufPointer; + s.spt.SenseInfoOffset = offsetof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, ucSenseBuf); - void close() - { - stop(); + memcpy (s.spt.Cdb, srb->CDBByte, srb->SRB_CDBLen); - if (isOpen_) - { - closeDevice(); - isOpen_ = false; - } - } + srb->SRB_Status = SS_ERR; + srb->SRB_TargStat = 0x0004; - bool isOpen() - { - return isOpen_ && isThreadRunning(); - } + DWORD bytesReturned = 0; - int getCurrentBufferSizeSamples() + if (DeviceIoControl (deviceHandle, IOCTL_SCSI_PASS_THROUGH_DIRECT, + &s, sizeof (s), + &s, sizeof (s), + &bytesReturned, 0) != 0) { - return bufferSizeSamples; + srb->SRB_Status = SS_COMP; } - - double getCurrentSampleRate() + else if (retryOnFailure) { - return sampleRate; - } + const DWORD error = GetLastError(); - int getCurrentBitDepth() - { - int i, bits = 256; + if ((error == ERROR_MEDIA_CHANGED) || (error == ERROR_INVALID_HANDLE)) + { + if (error != ERROR_INVALID_HANDLE) + CloseHandle (deviceHandle); - for (i = inChans.size(); --i >= 0;) - bits = jmin (bits, inChans[i]->bitDepth); + deviceHandle = CreateSCSIDeviceHandle (driveLetter); - for (i = outChans.size(); --i >= 0;) - bits = jmin (bits, outChans[i]->bitDepth); + return performScsiPassThroughCommand (srb, driveLetter, deviceHandle, false); + } + } - if (bits > 32) - bits = 16; + return srb->SRB_Status; +} - return bits; - } +// Controller types.. - const BitArray getActiveOutputChannels() const +class ControllerType1 : public CDController +{ +public: + ControllerType1() {} + ~ControllerType1() {} + + bool read (CDReadBuffer* rb) { - return enabledOutputs; - } + if (rb->numFrames * 2352 > rb->bufferSize) + return false; + + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = rb->bufferSize; + s.SRB_BufPointer = rb->buffer; + s.SRB_CDBLen = 12; + s.CDBByte[0] = 0xBE; + s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); + s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); + s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); + s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); + s.CDBByte[9] = (BYTE)((deviceInfo->readType == READTYPE_ATAPI1) ? 0x10 : 0xF0); + perform (s); - const BitArray getActiveInputChannels() const - { - return enabledInputs; - } + if (s.SRB_Status != SS_COMP) + return false; - int getOutputLatencyInSamples() - { - return (int) (getCurrentBufferSizeSamples() * 1.5); + rb->dataLength = rb->numFrames * 2352; + rb->dataStartOffset = 0; + return true; } +}; - int getInputLatencyInSamples() - { - return getOutputLatencyInSamples(); - } +class ControllerType2 : public CDController +{ +public: + ControllerType2() {} + ~ControllerType2() {} - void start (AudioIODeviceCallback* call) + void shutDown() { - if (isOpen_ && call != 0 && ! isStarted) + if (initialised) { - if (! isThreadRunning()) - { - // something gone wrong and the thread's stopped.. - isOpen_ = false; - return; - } - - call->audioDeviceAboutToStart (this); + BYTE bufPointer[] = { 0, 0, 0, 8, 83, 0, 0, 0, 0, 0, 8, 0 }; - const ScopedLock sl (startStopLock); - callback = call; - isStarted = true; + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_EVENT_NOTIFY | SRB_ENABLE_RESIDUAL_COUNT; + s.SRB_BufLen = 0x0C; + s.SRB_BufPointer = bufPointer; + s.SRB_CDBLen = 6; + s.CDBByte[0] = 0x15; + s.CDBByte[4] = 0x0C; + perform (s); } } - void stop() + bool init() { - if (isStarted) + SRB_ExecSCSICmd s; + s.SRB_Status = SS_ERR; + + if (deviceInfo->readType == READTYPE_READ10_2) { - AudioIODeviceCallback* const callbackLocal = callback; + BYTE bufPointer1[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48, 35, 6, 0, 0, 0, 0, 0, 128 }; + BYTE bufPointer2[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48, 1, 6, 32, 7, 0, 0, 0, 0 }; + for (int i = 0; i < 2; ++i) { - const ScopedLock sl (startStopLock); - isStarted = false; + prepare (s); + s.SRB_Flags = SRB_EVENT_NOTIFY; + s.SRB_BufLen = 0x14; + s.SRB_BufPointer = (i == 0) ? bufPointer1 : bufPointer2; + s.SRB_CDBLen = 6; + s.CDBByte[0] = 0x15; + s.CDBByte[1] = 0x10; + s.CDBByte[4] = 0x14; + perform (s); + + if (s.SRB_Status != SS_COMP) + return false; } + } + else + { + BYTE bufPointer[] = { 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 9, 48 }; - if (callbackLocal != 0) - callbackLocal->audioDeviceStopped(); + prepare (s); + s.SRB_Flags = SRB_EVENT_NOTIFY; + s.SRB_BufLen = 0x0C; + s.SRB_BufPointer = bufPointer; + s.SRB_CDBLen = 6; + s.CDBByte[0] = 0x15; + s.CDBByte[4] = 0x0C; + perform (s); } - } - bool isPlaying() - { - return isStarted && isOpen_ && isThreadRunning(); + return s.SRB_Status == SS_COMP; } - const String getLastError() + bool read (CDReadBuffer* rb) { - return lastError; - } - - juce_UseDebuggingNewOperator + if (rb->numFrames * 2352 > rb->bufferSize) + return false; - StringArray inChannels, outChannels; - int outputDeviceIndex, inputDeviceIndex; + if (!initialised) + { + initialised = init(); -private: - bool isOpen_; - bool isStarted; - String lastError; + if (!initialised) + return false; + } - OwnedArray inChans; - OwnedArray outChans; - WaitableEvent startEvent; + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = rb->bufferSize; + s.SRB_BufPointer = rb->buffer; + s.SRB_CDBLen = 10; + s.CDBByte[0] = 0x28; + s.CDBByte[1] = (BYTE)(deviceInfo->info.lun << 5); + s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); + s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); + s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); + s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); + perform (s); - int numInputBuffers, numOutputBuffers, bufferSizeSamples; - int volatile totalSamplesOut; - int64 volatile lastBlockTime; - double sampleRate; - BitArray enabledInputs, enabledOutputs; - float** inputBuffers; - float** outputBuffers; + if (s.SRB_Status != SS_COMP) + return false; - AudioIODeviceCallback* callback; - CriticalSection startStopLock; + rb->dataLength = rb->numFrames * 2352; + rb->dataStartOffset = 0; - DSoundAudioIODevice (const DSoundAudioIODevice&); - const DSoundAudioIODevice& operator= (const DSoundAudioIODevice&); + return true; + } +}; - const String openDevice (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate_, - int bufferSizeSamples_); +class ControllerType3 : public CDController +{ +public: + ControllerType3() {} + ~ControllerType3() {} - void closeDevice() + bool read (CDReadBuffer* rb) { - isStarted = false; - stopThread (5000); + if (rb->numFrames * 2352 > rb->bufferSize) + return false; - inChans.clear(); - outChans.clear(); + if (!initialised) + { + setPaused (false); + initialised = true; + } - int i; - for (i = 0; i < numInputBuffers; ++i) - juce_free (inputBuffers[i]); + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = rb->numFrames * 2352; + s.SRB_BufPointer = rb->buffer; + s.SRB_CDBLen = 12; + s.CDBByte[0] = 0xD8; + s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); + s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); + s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); + s.CDBByte[9] = (BYTE)(rb->numFrames & 0xFF); + perform (s); - delete[] inputBuffers; - inputBuffers = 0; - numInputBuffers = 0; + if (s.SRB_Status != SS_COMP) + return false; - for (i = 0; i < numOutputBuffers; ++i) - juce_free (outputBuffers[i]); + rb->dataLength = rb->numFrames * 2352; + rb->dataStartOffset = 0; - delete[] outputBuffers; - outputBuffers = 0; - numOutputBuffers = 0; + return true; } +}; - void resync() - { - int i; - for (i = outChans.size(); --i >= 0;) - outChans.getUnchecked(i)->close(); - - for (i = inChans.size(); --i >= 0;) - inChans.getUnchecked(i)->close(); +class ControllerType4 : public CDController +{ +public: + ControllerType4() {} + ~ControllerType4() {} - if (threadShouldExit()) - return; + bool selectD4Mode() + { + BYTE bufPointer[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 48 }; - // boost our priority while opening the devices to try to get better sync between them - const int oldThreadPri = GetThreadPriority (GetCurrentThread()); - const int oldProcPri = GetPriorityClass (GetCurrentProcess()); - SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); - SetPriorityClass (GetCurrentProcess(), REALTIME_PRIORITY_CLASS); + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_EVENT_NOTIFY; + s.SRB_CDBLen = 6; + s.SRB_BufLen = 12; + s.SRB_BufPointer = bufPointer; + s.CDBByte[0] = 0x15; + s.CDBByte[1] = 0x10; + s.CDBByte[4] = 0x08; + perform (s); - for (i = outChans.size(); --i >= 0;) - outChans.getUnchecked(i)->open(); + return s.SRB_Status == SS_COMP; + } - for (i = inChans.size(); --i >= 0;) - inChans.getUnchecked(i)->open(); + bool read (CDReadBuffer* rb) + { + if (rb->numFrames * 2352 > rb->bufferSize) + return false; - if (! threadShouldExit()) + if (!initialised) { - sleep (5); + setPaused (true); - for (i = 0; i < outChans.size(); ++i) - outChans.getUnchecked(i)->synchronisePosition(); + if (deviceInfo->readType == READTYPE_READ_D4_1) + selectD4Mode(); - for (i = 0; i < inChans.size(); ++i) - inChans.getUnchecked(i)->synchronisePosition(); + initialised = true; } - SetThreadPriority (GetCurrentThread(), oldThreadPri); - SetPriorityClass (GetCurrentProcess(), oldProcPri); + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = rb->bufferSize; + s.SRB_BufPointer = rb->buffer; + s.SRB_CDBLen = 10; + s.CDBByte[0] = 0xD4; + s.CDBByte[3] = (BYTE)((rb->startFrame >> 16) & 0xFF); + s.CDBByte[4] = (BYTE)((rb->startFrame >> 8) & 0xFF); + s.CDBByte[5] = (BYTE)(rb->startFrame & 0xFF); + s.CDBByte[8] = (BYTE)(rb->numFrames & 0xFF); + perform (s); + + if (s.SRB_Status != SS_COMP) + return false; + + rb->dataLength = rb->numFrames * 2352; + rb->dataStartOffset = 0; + + return true; } +}; -public: - void run() - { - while (! threadShouldExit()) - { - if (wait (100)) - break; - } +CDController::CDController() : initialised (false) +{ +} - const int latencyMs = (int) (bufferSizeSamples * 1000.0 / sampleRate); - const int maxTimeMS = jmax (5, 3 * latencyMs); +CDController::~CDController() +{ +} - while (! threadShouldExit()) - { - int numToDo = 0; - uint32 startTime = Time::getMillisecondCounter(); +void CDController::prepare (SRB_ExecSCSICmd& s) +{ + zerostruct (s); - int i; - for (i = inChans.size(); --i >= 0;) - { - inChans.getUnchecked(i)->doneFlag = false; - ++numToDo; - } + s.SRB_Cmd = SC_EXEC_SCSI_CMD; + s.SRB_HaID = deviceInfo->info.ha; + s.SRB_Target = deviceInfo->info.tgt; + s.SRB_Lun = deviceInfo->info.lun; + s.SRB_SenseLen = SENSE_LEN; +} - for (i = outChans.size(); --i >= 0;) - { - outChans.getUnchecked(i)->doneFlag = false; - ++numToDo; - } +void CDController::perform (SRB_ExecSCSICmd& s) +{ + HANDLE event = CreateEvent (0, TRUE, FALSE, 0); + s.SRB_PostProc = (void*)event; - if (numToDo > 0) - { - const int maxCount = 3; - int count = maxCount; + ResetEvent (event); - for (;;) - { - for (i = inChans.size(); --i >= 0;) - { - DSoundInternalInChannel* const in = inChans.getUnchecked(i); + DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, + deviceInfo->info.scsiDriveLetter, + deviceInfo->scsiHandle) + : fSendASPI32Command ((LPSRB)&s); - if ((! in->doneFlag) && in->service()) - { - in->doneFlag = true; - --numToDo; - } - } + if (status == SS_PENDING) + WaitForSingleObject (event, 4000); - for (i = outChans.size(); --i >= 0;) - { - DSoundInternalOutChannel* const out = outChans.getUnchecked(i); + CloseHandle (event); +} - if ((! out->doneFlag) && out->service()) - { - out->doneFlag = true; - --numToDo; - } - } +void CDController::setPaused (bool paused) +{ + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_EVENT_NOTIFY; + s.SRB_CDBLen = 10; + s.CDBByte[0] = 0x4B; + s.CDBByte[8] = (BYTE) (paused ? 0 : 1); + perform (s); +} - if (numToDo <= 0) - break; +void CDController::shutDown() +{ +} - if (Time::getMillisecondCounter() > startTime + maxTimeMS) - { - resync(); - break; - } +bool CDController::readAudio (CDReadBuffer* rb, CDReadBuffer* overlapBuffer) +{ + if (overlapBuffer != 0) + { + const bool canDoJitter = (overlapBuffer->bufferSize >= 2352 * framesToCheck); + const bool doJitter = canDoJitter && ! overlapBuffer->isZero(); - if (--count <= 0) - { - Sleep (1); - count = maxCount; - } + if (doJitter + && overlapBuffer->startFrame > 0 + && overlapBuffer->numFrames > 0 + && overlapBuffer->dataLength > 0) + { + const int numFrames = rb->numFrames; - if (threadShouldExit()) - return; - } + if (overlapBuffer->startFrame == (rb->startFrame - framesToCheck)) + { + rb->startFrame -= framesOverlap; + + if (framesToCheck < framesOverlap + && numFrames + framesOverlap <= rb->bufferSize / 2352) + rb->numFrames += framesOverlap; } else { - sleep (1); + overlapBuffer->dataLength = 0; + overlapBuffer->startFrame = 0; + overlapBuffer->numFrames = 0; } + } - const ScopedLock sl (startStopLock); + if (! read (rb)) + return false; - if (isStarted) + if (doJitter) + { + const int checkLen = framesToCheck * 2352; + const int maxToCheck = rb->dataLength - checkLen; + + if (overlapBuffer->dataLength == 0 || overlapBuffer->isZero()) + return true; + + BYTE* const p = overlapBuffer->buffer + overlapBuffer->dataStartOffset; + bool found = false; + + for (int i = 0; i < maxToCheck; ++i) { - JUCE_TRY + if (!memcmp (p, rb->buffer + i, checkLen)) { - callback->audioDeviceIOCallback ((const float**) inputBuffers, - numInputBuffers, - outputBuffers, - numOutputBuffers, - bufferSizeSamples); + i += checkLen; + rb->dataStartOffset = i; + rb->dataLength -= i; + rb->startFrame = overlapBuffer->startFrame + framesToCheck; + found = true; + break; } - JUCE_CATCH_EXCEPTION - - totalSamplesOut += bufferSizeSamples; } - else - { - for (i = 0; i < numOutputBuffers; ++i) - if (outputBuffers[i] != 0) - zeromem (outputBuffers[i], bufferSizeSamples * sizeof (float)); - totalSamplesOut = 0; - sleep (1); - } + rb->numFrames = rb->dataLength / 2352; + rb->dataLength = 2352 * rb->numFrames; + + if (!found) + return false; } - } -}; -class DSoundAudioIODeviceType : public AudioIODeviceType -{ -public: - DSoundAudioIODeviceType() - : AudioIODeviceType (T("DirectSound")), - hasScanned (false) - { - initialiseDSoundFunctions(); - } + if (canDoJitter) + { + memcpy (overlapBuffer->buffer, + rb->buffer + rb->dataStartOffset + 2352 * (rb->numFrames - framesToCheck), + 2352 * framesToCheck); - ~DSoundAudioIODeviceType() + overlapBuffer->startFrame = rb->startFrame + rb->numFrames - framesToCheck; + overlapBuffer->numFrames = framesToCheck; + overlapBuffer->dataLength = 2352 * framesToCheck; + overlapBuffer->dataStartOffset = 0; + } + else + { + overlapBuffer->startFrame = 0; + overlapBuffer->numFrames = 0; + overlapBuffer->dataLength = 0; + } + + return true; + } + else { + return read (rb); } +} - void scanForDevices() - { - hasScanned = true; +int CDController::getLastIndex() +{ + char qdata[100]; - outputDeviceNames.clear(); - outputGuids.clear(); - inputDeviceNames.clear(); - inputGuids.clear(); + SRB_ExecSCSICmd s; + prepare (s); + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = sizeof (qdata); + s.SRB_BufPointer = (BYTE*)qdata; + s.SRB_CDBLen = 12; + s.CDBByte[0] = 0x42; + s.CDBByte[1] = (BYTE)(deviceInfo->info.lun << 5); + s.CDBByte[2] = 64; + s.CDBByte[3] = 1; // get current position + s.CDBByte[7] = 0; + s.CDBByte[8] = (BYTE)sizeof (qdata); + perform (s); - if (dsDirectSoundEnumerateW != 0) - { - dsDirectSoundEnumerateW (outputEnumProcW, this); - dsDirectSoundCaptureEnumerateW (inputEnumProcW, this); - } - } + if (s.SRB_Status == SS_COMP) + return qdata[7]; - const StringArray getDeviceNames (const bool wantInputNames) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this + return 0; +} - return wantInputNames ? inputDeviceNames - : outputDeviceNames; - } +bool CDDeviceHandle::readTOC (TOC* lpToc, bool useMSF) +{ + HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - int getDefaultDeviceIndex (const bool /*forInput*/) const + SRB_ExecSCSICmd s; + zerostruct (s); + + s.SRB_Cmd = SC_EXEC_SCSI_CMD; + s.SRB_HaID = info.ha; + s.SRB_Target = info.tgt; + s.SRB_Lun = info.lun; + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = 0x324; + s.SRB_BufPointer = (BYTE*)lpToc; + s.SRB_SenseLen = 0x0E; + s.SRB_CDBLen = 0x0A; + s.SRB_PostProc = (void*)event; + s.CDBByte[0] = 0x43; + s.CDBByte[1] = (BYTE)(useMSF ? 0x02 : 0x00); + s.CDBByte[7] = 0x03; + s.CDBByte[8] = 0x24; + + ResetEvent (event); + DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, info.scsiDriveLetter, scsiHandle) + : fSendASPI32Command ((LPSRB)&s); + + if (status == SS_PENDING) + WaitForSingleObject (event, 4000); + + CloseHandle (event); + return (s.SRB_Status == SS_COMP); +} + +bool CDDeviceHandle::readAudio (CDReadBuffer* const buffer, + CDReadBuffer* const overlapBuffer) +{ + if (controller == 0) { - jassert (hasScanned); // need to call scanForDevices() before doing this - return 0; + testController (READTYPE_ATAPI2, new ControllerType1(), buffer) + || testController (READTYPE_ATAPI1, new ControllerType1(), buffer) + || testController (READTYPE_READ10_2, new ControllerType2(), buffer) + || testController (READTYPE_READ10, new ControllerType2(), buffer) + || testController (READTYPE_READ_D8, new ControllerType3(), buffer) + || testController (READTYPE_READ_D4, new ControllerType4(), buffer) + || testController (READTYPE_READ_D4_1, new ControllerType4(), buffer); } - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this + buffer->index = 0; - DSoundAudioIODevice* const d = dynamic_cast (device); - if (d == 0) - return -1; + if ((controller != 0) + && controller->readAudio (buffer, overlapBuffer)) + { + if (buffer->wantsIndex) + buffer->index = controller->getLastIndex(); - return asInput ? d->inputDeviceIndex - : d->outputDeviceIndex; + return true; } - bool hasSeparateInputsAndOutputs() const { return true; } + return false; +} - AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) +void CDDeviceHandle::openDrawer (bool shouldBeOpen) +{ + if (shouldBeOpen) { - jassert (hasScanned); // need to call scanForDevices() before doing this + if (controller != 0) + { + controller->shutDown(); + delete controller; + controller = 0; + } - const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); - const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); + if (scsiHandle != 0) + { + CloseHandle (scsiHandle); + scsiHandle = 0; + } + } - if (outputIndex >= 0 || inputIndex >= 0) - return new DSoundAudioIODevice (outputDeviceName.isNotEmpty() ? outputDeviceName - : inputDeviceName, - outputIndex, inputIndex); + SRB_ExecSCSICmd s; + zerostruct (s); - return 0; - } + s.SRB_Cmd = SC_EXEC_SCSI_CMD; + s.SRB_HaID = info.ha; + s.SRB_Target = info.tgt; + s.SRB_Lun = info.lun; + s.SRB_SenseLen = SENSE_LEN; + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = 0; + s.SRB_BufPointer = 0; + s.SRB_CDBLen = 12; + s.CDBByte[0] = 0x1b; + s.CDBByte[1] = (BYTE)(info.lun << 5); + s.CDBByte[4] = (BYTE)((shouldBeOpen) ? 2 : 3); - juce_UseDebuggingNewOperator + HANDLE event = CreateEvent (0, TRUE, FALSE, 0); + s.SRB_PostProc = (void*)event; - StringArray outputDeviceNames; - OwnedArray outputGuids; + ResetEvent (event); - StringArray inputDeviceNames; - OwnedArray inputGuids; + DWORD status = (usingScsi) ? performScsiPassThroughCommand ((LPSRB_ExecSCSICmd)&s, info.scsiDriveLetter, scsiHandle) + : fSendASPI32Command ((LPSRB)&s); -private: - bool hasScanned; + if (status == SS_PENDING) + WaitForSingleObject (event, 4000); - BOOL outputEnumProc (LPGUID lpGUID, String desc) - { - desc = desc.trim(); + CloseHandle (event); +} - if (desc.isNotEmpty()) - { - const String origDesc (desc); +bool CDDeviceHandle::testController (const int type, + CDController* const newController, + CDReadBuffer* const rb) +{ + controller = newController; + readType = (BYTE)type; - int n = 2; - while (outputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + controller->deviceInfo = this; + controller->framesToCheck = 1; + controller->framesOverlap = 3; - outputDeviceNames.add (desc); + bool passed = false; - if (lpGUID != 0) - outputGuids.add (new GUID (*lpGUID)); + memset (rb->buffer, 0xcd, rb->bufferSize); + + if (controller->read (rb)) + { + passed = true; + int* p = (int*) (rb->buffer + rb->dataStartOffset); + int wrong = 0; + + for (int i = rb->dataLength / 4; --i >= 0;) + { + if (*p++ == (int) 0xcdcdcdcd) + { + if (++wrong == 4) + { + passed = false; + break; + } + } else - outputGuids.add (0); + { + wrong = 0; + } } - - return TRUE; } - static BOOL CALLBACK outputEnumProcW (LPGUID lpGUID, LPCWSTR description, LPCWSTR, LPVOID object) + if (! passed) { - return ((DSoundAudioIODeviceType*) object) - ->outputEnumProc (lpGUID, String (description)); + controller->shutDown(); + delete controller; + controller = 0; } - static BOOL CALLBACK outputEnumProcA (LPGUID lpGUID, LPCTSTR description, LPCTSTR, LPVOID object) - { - return ((DSoundAudioIODeviceType*) object) - ->outputEnumProc (lpGUID, String (description)); - } + return passed; +} - BOOL CALLBACK inputEnumProc (LPGUID lpGUID, String desc) - { - desc = desc.trim(); +static void GetAspiDeviceInfo (CDDeviceInfo* dev, BYTE ha, BYTE tgt, BYTE lun) +{ + HANDLE event = CreateEvent (0, TRUE, FALSE, 0); - if (desc.isNotEmpty()) - { - const String origDesc (desc); + const int bufSize = 128; + BYTE buffer[bufSize]; + zeromem (buffer, bufSize); - int n = 2; - while (inputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + SRB_ExecSCSICmd s; + zerostruct (s); - inputDeviceNames.add (desc); + s.SRB_Cmd = SC_EXEC_SCSI_CMD; + s.SRB_HaID = ha; + s.SRB_Target = tgt; + s.SRB_Lun = lun; + s.SRB_Flags = SRB_DIR_IN | SRB_EVENT_NOTIFY; + s.SRB_BufLen = bufSize; + s.SRB_BufPointer = buffer; + s.SRB_SenseLen = SENSE_LEN; + s.SRB_CDBLen = 6; + s.SRB_PostProc = (void*)event; + s.CDBByte[0] = SCSI_INQUIRY; + s.CDBByte[4] = 100; - if (lpGUID != 0) - inputGuids.add (new GUID (*lpGUID)); - else - inputGuids.add (0); - } + ResetEvent (event); - return TRUE; - } + if (fSendASPI32Command ((LPSRB)&s) == SS_PENDING) + WaitForSingleObject (event, 4000); - static BOOL CALLBACK inputEnumProcW (LPGUID lpGUID, LPCWSTR description, LPCWSTR, LPVOID object) - { - return ((DSoundAudioIODeviceType*) object) - ->inputEnumProc (lpGUID, String (description)); - } + CloseHandle (event); - static BOOL CALLBACK inputEnumProcA (LPGUID lpGUID, LPCTSTR description, LPCTSTR, LPVOID object) + if (s.SRB_Status == SS_COMP) { - return ((DSoundAudioIODeviceType*) object) - ->inputEnumProc (lpGUID, String (description)); + memcpy (dev->vendor, &buffer[8], 8); + memcpy (dev->productId, &buffer[16], 16); + memcpy (dev->rev, &buffer[32], 4); + memcpy (dev->vendorSpec, &buffer[36], 20); } - - DSoundAudioIODeviceType (const DSoundAudioIODeviceType&); - const DSoundAudioIODeviceType& operator= (const DSoundAudioIODeviceType&); -}; - -AudioIODeviceType* juce_createDefaultAudioIODeviceType() -{ - return new DSoundAudioIODeviceType(); } -const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate_, - int bufferSizeSamples_) +static int FindCDDevices (CDDeviceInfo* const list, + int maxItems) { - closeDevice(); - totalSamplesOut = 0; + int count = 0; - sampleRate = sampleRate_; + if (usingScsi) + { + for (char driveLetter = 'b'; driveLetter <= 'z'; ++driveLetter) + { + TCHAR drivePath[8]; + drivePath[0] = driveLetter; + drivePath[1] = ':'; + drivePath[2] = '\\'; + drivePath[3] = 0; - if (bufferSizeSamples_ <= 0) - bufferSizeSamples_ = 960; // use as a default size if none is set. + if (GetDriveType (drivePath) == DRIVE_CDROM) + { + HANDLE h = CreateSCSIDeviceHandle (driveLetter); - bufferSizeSamples = bufferSizeSamples_ & ~7; + if (h != INVALID_HANDLE_VALUE) + { + BYTE buffer[100], passThroughStruct[1024]; + zeromem (buffer, sizeof (buffer)); + zeromem (passThroughStruct, sizeof (passThroughStruct)); - DSoundAudioIODeviceType dlh; - dlh.scanForDevices(); + PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER p = (PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER)passThroughStruct; - enabledInputs = inputChannels; - enabledInputs.setRange (inChannels.size(), - enabledInputs.getHighestBit() + 1 - inChannels.size(), - false); + p->spt.Length = sizeof (SCSI_PASS_THROUGH); + p->spt.CdbLength = 6; + p->spt.SenseInfoLength = 24; + p->spt.DataIn = SCSI_IOCTL_DATA_IN; + p->spt.DataTransferLength = 100; + p->spt.TimeOutValue = 2; + p->spt.DataBuffer = buffer; + p->spt.SenseInfoOffset = offsetof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, ucSenseBuf); + p->spt.Cdb[0] = 0x12; + p->spt.Cdb[4] = 100; - numInputBuffers = enabledInputs.countNumberOfSetBits(); - inputBuffers = new float* [numInputBuffers + 2]; - zeromem (inputBuffers, sizeof (float*) * numInputBuffers + 2); - int i, numIns = 0; + DWORD bytesReturned = 0; - for (i = 0; i <= enabledInputs.getHighestBit(); i += 2) - { - float* left = 0; - float* right = 0; + if (DeviceIoControl (h, IOCTL_SCSI_PASS_THROUGH_DIRECT, + p, sizeof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER), + p, sizeof (SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER), + &bytesReturned, 0) != 0) + { + zeromem (&list[count], sizeof (CDDeviceInfo)); - if (enabledInputs[i]) - left = inputBuffers[numIns++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); + list[count].scsiDriveLetter = driveLetter; - if (enabledInputs[i + 1]) - right = inputBuffers[numIns++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); + memcpy (list[count].vendor, &buffer[8], 8); + memcpy (list[count].productId, &buffer[16], 16); + memcpy (list[count].rev, &buffer[32], 4); + memcpy (list[count].vendorSpec, &buffer[36], 20); - if (left != 0 || right != 0) - inChans.add (new DSoundInternalInChannel (dlh.inputDeviceNames [inputDeviceIndex], - dlh.inputGuids [inputDeviceIndex], - (int) sampleRate, bufferSizeSamples, - left, right)); - } + zeromem (passThroughStruct, sizeof (passThroughStruct)); + PSCSI_ADDRESS scsiAddr = (PSCSI_ADDRESS)passThroughStruct; - enabledOutputs = outputChannels; - enabledOutputs.setRange (outChannels.size(), - enabledOutputs.getHighestBit() + 1 - outChannels.size(), - false); + scsiAddr->Length = sizeof (SCSI_ADDRESS); - numOutputBuffers = enabledOutputs.countNumberOfSetBits(); - outputBuffers = new float* [numOutputBuffers + 2]; - zeromem (outputBuffers, sizeof (float*) * numOutputBuffers + 2); - int numOuts = 0; + if (DeviceIoControl (h, IOCTL_SCSI_GET_ADDRESS, + 0, 0, scsiAddr, sizeof (SCSI_ADDRESS), + &bytesReturned, 0) != 0) + { + list[count].ha = scsiAddr->PortNumber; + list[count].tgt = scsiAddr->TargetId; + list[count].lun = scsiAddr->Lun; + ++count; + } + } - for (i = 0; i <= enabledOutputs.getHighestBit(); i += 2) + CloseHandle (h); + } + } + } + } + else { - float* left = 0; - float* right = 0; + const DWORD d = fGetASPI32SupportInfo(); + BYTE status = HIBYTE (LOWORD (d)); - if (enabledOutputs[i]) - left = outputBuffers[numOuts++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); + if (status != SS_COMP || status == SS_NO_ADAPTERS) + return 0; - if (enabledOutputs[i + 1]) - right = outputBuffers[numOuts++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); + const int numAdapters = LOBYTE (LOWORD (d)); - if (left != 0 || right != 0) - outChans.add (new DSoundInternalOutChannel (dlh.outputDeviceNames[outputDeviceIndex], - dlh.outputGuids [outputDeviceIndex], - (int) sampleRate, bufferSizeSamples, - left, right)); - } + for (BYTE ha = 0; ha < numAdapters; ++ha) + { + SRB_HAInquiry s; + zerostruct (s); - String error; + s.SRB_Cmd = SC_HA_INQUIRY; + s.SRB_HaID = ha; + fSendASPI32Command ((LPSRB)&s); - // boost our priority while opening the devices to try to get better sync between them - const int oldThreadPri = GetThreadPriority (GetCurrentThread()); - const int oldProcPri = GetPriorityClass (GetCurrentProcess()); - SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); - SetPriorityClass (GetCurrentProcess(), REALTIME_PRIORITY_CLASS); + if (s.SRB_Status == SS_COMP) + { + maxItems = (int)s.HA_Unique[3]; - for (i = 0; i < outChans.size(); ++i) - { - error = outChans[i]->open(); + if (maxItems == 0) + maxItems = 8; - if (error.isNotEmpty()) - { - error = T("Error opening ") + dlh.outputDeviceNames[i] - + T(": \"") + error + T("\""); - break; - } - } + for (BYTE tgt = 0; tgt < maxItems; ++tgt) + { + for (BYTE lun = 0; lun < 8; ++lun) + { + SRB_GDEVBlock sb; + zerostruct (sb); - if (error.isEmpty()) - { - for (i = 0; i < inChans.size(); ++i) - { - error = inChans[i]->open(); + sb.SRB_Cmd = SC_GET_DEV_TYPE; + sb.SRB_HaID = ha; + sb.SRB_Target = tgt; + sb.SRB_Lun = lun; + fSendASPI32Command ((LPSRB) &sb); - if (error.isNotEmpty()) - { - error = T("Error opening ") + dlh.inputDeviceNames[i] - + T(": \"") + error + T("\""); - break; + if (sb.SRB_Status == SS_COMP + && sb.SRB_DeviceType == DTYPE_CROM) + { + zeromem (&list[count], sizeof (CDDeviceInfo)); + + list[count].ha = ha; + list[count].tgt = tgt; + list[count].lun = lun; + + GetAspiDeviceInfo (&(list[count]), ha, tgt, lun); + + ++count; + } + } + } } } } - if (error.isEmpty()) - { - totalSamplesOut = 0; + return count; +} - for (i = 0; i < outChans.size(); ++i) - outChans.getUnchecked(i)->synchronisePosition(); +static int ripperUsers = 0; +static bool initialisedOk = false; - for (i = 0; i < inChans.size(); ++i) - inChans.getUnchecked(i)->synchronisePosition(); +class DeinitialiseTimer : private Timer, + private DeletedAtShutdown +{ + DeinitialiseTimer (const DeinitialiseTimer&); + const DeinitialiseTimer& operator= (const DeinitialiseTimer&); - startThread (9); - sleep (10); +public: + DeinitialiseTimer() + { + startTimer (4000); + } - notify(); + ~DeinitialiseTimer() + { + if (--ripperUsers == 0) + DeinitialiseCDRipper(); } - else + + void timerCallback() { - log (error); + delete this; } - SetThreadPriority (GetCurrentThread(), oldThreadPri); - SetPriorityClass (GetCurrentProcess(), oldProcPri); + juce_UseDebuggingNewOperator +}; - return error; +static void incUserCount() +{ + if (ripperUsers++ == 0) + initialisedOk = InitialiseCDRipper(); } -#undef log +static void decUserCount() +{ + new DeinitialiseTimer(); +} -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_DirectSound.cpp *********/ +struct CDDeviceWrapper +{ + CDDeviceHandle* cdH; + CDReadBuffer* overlapBuffer; + bool jitter; +}; -/********* Start of inlined file: juce_win32_FileChooser.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif +static int getAddressOf (const TOCTRACK* const t) +{ + return (((DWORD)t->addr[0]) << 24) + (((DWORD)t->addr[1]) << 16) + + (((DWORD)t->addr[2]) << 8) + ((DWORD)t->addr[3]); +} + +static int getMSFAddressOf (const TOCTRACK* const t) +{ + return 60 * t->addr[1] + t->addr[2]; +} + +static const int samplesPerFrame = 44100 / 75; +static const int bytesPerFrame = samplesPerFrame * 4; + +const StringArray AudioCDReader::getAvailableCDNames() +{ + StringArray results; + incUserCount(); -#include + if (initialisedOk) + { + CDDeviceInfo list[8]; + const int num = FindCDDevices (list, 8); -BEGIN_JUCE_NAMESPACE + decUserCount(); -#ifdef _MSC_VER - #pragma warning (pop) -#endif + for (int i = 0; i < num; ++i) + { + String s; -static const void* defaultDirPath = 0; -static String returnedString; // need this to get non-existent pathnames from the directory chooser -static Component* currentExtraFileWin = 0; + if (list[i].scsiDriveLetter > 0) + s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": "); -static bool areThereAnyAlwaysOnTopWindows() -{ - for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) - { - Component* c = Desktop::getInstance().getComponent (i); + s << String (list[i].vendor).trim() + << T(" ") << String (list[i].productId).trim() + << T(" ") << String (list[i].rev).trim(); - if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) - return true; + results.add (s); + } } - return false; + return results; } -static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) +static CDDeviceHandle* openHandle (const CDDeviceInfo* const device) { - if (msg == BFFM_INITIALIZED) - { - SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); - } - else if (msg == BFFM_VALIDATEFAILEDW) + SRB_GDEVBlock s; + zerostruct (s); + + s.SRB_Cmd = SC_GET_DEV_TYPE; + s.SRB_HaID = device->ha; + s.SRB_Target = device->tgt; + s.SRB_Lun = device->lun; + + if (usingScsi) { - returnedString = (LPCWSTR) lParam; + HANDLE h = CreateSCSIDeviceHandle (device->scsiDriveLetter); + + if (h != INVALID_HANDLE_VALUE) + { + CDDeviceHandle* cdh = new CDDeviceHandle (device); + cdh->scsiHandle = h; + return cdh; + } } - else if (msg == BFFM_VALIDATEFAILEDA) + else { - returnedString = (const char*) lParam; + if (fSendASPI32Command ((LPSRB)&s) == SS_COMP + && s.SRB_DeviceType == DTYPE_CROM) + { + return new CDDeviceHandle (device); + } } return 0; } -void juce_setWindowStyleBit (HWND h, int styleType, int feature, bool bitIsSet); - -static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) +AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) { - if (currentExtraFileWin != 0) - { - if (uiMsg == WM_INITDIALOG) - { - HWND dialogH = GetParent (hdlg); - jassert (dialogH != 0); - if (dialogH == 0) - dialogH = hdlg; - - RECT r, cr; - GetWindowRect (dialogH, &r); - GetClientRect (dialogH, &cr); - - SetWindowPos (dialogH, 0, - r.left, r.top, - currentExtraFileWin->getWidth() + jmax (150, r.right - r.left), - jmax (150, r.bottom - r.top), - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); + incUserCount(); - currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); - currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); + if (initialisedOk) + { + CDDeviceInfo list[8]; + const int num = FindCDDevices (list, 8); - SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); - } - else if (uiMsg == WM_NOTIFY) + if (((unsigned int) deviceIndex) < (unsigned int) num) { - LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; + CDDeviceHandle* const handle = openHandle (&(list[deviceIndex])); - if (ofn->hdr.code == CDN_SELCHANGE) + if (handle != 0) { - FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); - - if (comp != 0) - { - TCHAR path [MAX_PATH * 2]; - path[0] = 0; - CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); - - const String fn ((const WCHAR*) path); + CDDeviceWrapper* const d = new CDDeviceWrapper(); + d->cdH = handle; + d->overlapBuffer = new CDReadBuffer(3); - comp->selectedFileChanged (File (fn)); - } + return new AudioCDReader (d); } } } + decUserCount(); return 0; } -class FPComponentHolder : public Component +AudioCDReader::AudioCDReader (void* handle_) + : AudioFormatReader (0, T("CD Audio")), + handle (handle_), + indexingEnabled (false), + lastIndex (0), + firstFrameInBuffer (0), + samplesInBuffer (0) { -public: - FPComponentHolder() - { - setVisible (true); - setOpaque (true); - } + jassert (handle_ != 0); - ~FPComponentHolder() - { - } + refreshTrackLengths(); - void paint (Graphics& g) - { - g.fillAll (Colours::lightgrey); - } + sampleRate = 44100.0; + bitsPerSample = 16; + lengthInSamples = getPositionOfTrackStart (numTracks); + numChannels = 2; + usesFloatingPointData = false; -private: - FPComponentHolder (const FPComponentHolder&); - const FPComponentHolder& operator= (const FPComponentHolder&); -}; + buffer.setSize (4 * bytesPerFrame, true); +} -void FileChooser::showPlatformDialog (OwnedArray& results, - const String& title, - const File& currentFileOrDirectory, - const String& filter, - bool selectsDirectory, - bool isSaveDialogue, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, - FilePreviewComponent* extraInfoComponent) +AudioCDReader::~AudioCDReader() { - const int numCharsAvailable = 32768; - MemoryBlock filenameSpace ((numCharsAvailable + 1) * sizeof (WCHAR), true); - WCHAR* const fname = (WCHAR*) filenameSpace.getData(); - int fnameIdx = 0; - - JUCE_TRY - { - // use a modal window as the parent for this dialog box - // to block input from other app windows - const Rectangle mainMon (Desktop::getInstance().getMainMonitorArea()); + CDDeviceWrapper* const device = (CDDeviceWrapper*)handle; - Component w (String::empty); - w.setBounds (mainMon.getX() + mainMon.getWidth() / 4, - mainMon.getY() + mainMon.getHeight() / 4, - 0, 0); - w.setOpaque (true); - w.setAlwaysOnTop (areThereAnyAlwaysOnTopWindows()); - w.addToDesktop (0); + delete device->cdH; + delete device->overlapBuffer; + delete device; - if (extraInfoComponent == 0) - w.enterModalState(); + decUserCount(); +} - String initialDir; +bool AudioCDReader::read (int** destSamples, + int64 startSampleInFile, + int numSamples) +{ + CDDeviceWrapper* const device = (CDDeviceWrapper*)handle; - if (currentFileOrDirectory.isDirectory()) - { - initialDir = currentFileOrDirectory.getFullPathName(); - } - else - { - currentFileOrDirectory.getFileName().copyToBuffer (fname, numCharsAvailable); + bool ok = true; + int offset = 0; - initialDir = currentFileOrDirectory.getParentDirectory().getFullPathName(); - } + if (startSampleInFile < 0) + { + int* l = destSamples[0]; + int* r = destSamples[1]; - if (currentExtraFileWin->isValidComponent()) - { - jassertfalse - return; - } + numSamples += (int) startSampleInFile; + offset -= (int) startSampleInFile; - if (selectsDirectory) + while (++startSampleInFile <= 0) { - LPITEMIDLIST list = 0; - filenameSpace.fillWith (0); - - { - BROWSEINFO bi; - zerostruct (bi); - - bi.hwndOwner = (HWND) w.getWindowHandle(); - bi.pszDisplayName = fname; - bi.lpszTitle = title; - bi.lpfn = browseCallbackProc; -#ifdef BIF_USENEWUI - bi.ulFlags = BIF_USENEWUI | BIF_VALIDATE; -#else - bi.ulFlags = 0x50; -#endif - defaultDirPath = (const WCHAR*) initialDir; + *l++ = 0; - list = SHBrowseForFolder (&bi); + if (r != 0) + *r++ = 0; + } + } - if (! SHGetPathFromIDListW (list, fname)) - { - fname[0] = 0; - returnedString = String::empty; - } - } + while (numSamples > 0) + { + const int bufferStartSample = firstFrameInBuffer * samplesPerFrame; + const int bufferEndSample = bufferStartSample + samplesInBuffer; - LPMALLOC al; - if (list != 0 && SUCCEEDED (SHGetMalloc (&al))) - al->Free (list); + if (startSampleInFile >= bufferStartSample + && startSampleInFile < bufferEndSample) + { + const int toDo = (int) jmin ((int64) numSamples, bufferEndSample - startSampleInFile); - defaultDirPath = 0; + int* const l = destSamples[0] + offset; + int* const r = destSamples[1] + offset; + const short* src = (const short*) buffer.getData(); + src += 2 * (startSampleInFile - bufferStartSample); - if (returnedString.isNotEmpty()) + for (int i = 0; i < toDo; ++i) { - const String stringFName (fname); - - results.add (new File (File (stringFName).getSiblingFile (returnedString))); - returnedString = String::empty; + l[i] = src [i << 1] << 16; - return; + if (r != 0) + r[i] = src [(i << 1) + 1] << 16; } + + offset += toDo; + startSampleInFile += toDo; + numSamples -= toDo; } else { - DWORD flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR | OFN_HIDEREADONLY; - - if (warnAboutOverwritingExistingFiles) - flags |= OFN_OVERWRITEPROMPT; - - if (selectMultipleFiles) - flags |= OFN_ALLOWMULTISELECT; + const int framesInBuffer = buffer.getSize() / bytesPerFrame; + const int frameNeeded = (int) (startSampleInFile / samplesPerFrame); - if (extraInfoComponent != 0) + if (firstFrameInBuffer + framesInBuffer != frameNeeded) { - flags |= OFN_ENABLEHOOK; + device->overlapBuffer->dataLength = 0; + device->overlapBuffer->startFrame = 0; + device->overlapBuffer->numFrames = 0; + device->jitter = false; + } - currentExtraFileWin = new FPComponentHolder(); - currentExtraFileWin->addAndMakeVisible (extraInfoComponent); - currentExtraFileWin->setSize (jlimit (20, 800, extraInfoComponent->getWidth()), - extraInfoComponent->getHeight()); - currentExtraFileWin->addToDesktop (0); + firstFrameInBuffer = frameNeeded; + lastIndex = 0; - currentExtraFileWin->enterModalState(); - } + CDReadBuffer readBuffer (framesInBuffer + 4); + readBuffer.wantsIndex = indexingEnabled; + int i; + for (i = 5; --i >= 0;) { - WCHAR filters [1024]; - zeromem (filters, sizeof (filters)); - filter.copyToBuffer (filters, 1024); - filter.copyToBuffer (filters + filter.length() + 1, - 1022 - filter.length()); + readBuffer.startFrame = frameNeeded; + readBuffer.numFrames = framesInBuffer; - OPENFILENAMEW of; - zerostruct (of); + if (device->cdH->readAudio (&readBuffer, (device->jitter) ? device->overlapBuffer : 0)) + break; + else + device->overlapBuffer->dataLength = 0; + } -#ifdef OPENFILENAME_SIZE_VERSION_400W - of.lStructSize = OPENFILENAME_SIZE_VERSION_400W; -#else - of.lStructSize = sizeof (of); -#endif - of.hwndOwner = (HWND) w.getWindowHandle(); - of.lpstrFilter = filters; - of.nFilterIndex = 1; - of.lpstrFile = fname; - of.nMaxFile = numCharsAvailable; - of.lpstrInitialDir = initialDir; - of.lpstrTitle = title; - of.Flags = flags; + if (i >= 0) + { + memcpy ((char*) buffer.getData(), + readBuffer.buffer + readBuffer.dataStartOffset, + readBuffer.dataLength); - if (extraInfoComponent != 0) - of.lpfnHook = &openCallback; + samplesInBuffer = readBuffer.dataLength >> 2; + lastIndex = readBuffer.index; + } + else + { + int* l = destSamples[0] + offset; + int* r = destSamples[1] + offset; - if (isSaveDialogue) - { - if (! GetSaveFileName (&of)) - fname[0] = 0; - else - fnameIdx = of.nFileOffset; - } - else + while (--numSamples >= 0) { - if (! GetOpenFileName (&of)) - fname[0] = 0; - else - fnameIdx = of.nFileOffset; + *l++ = 0; + + if (r != 0) + *r++ = 0; } + + // sometimes the read fails for just the very last couple of blocks, so + // we'll ignore and errors in the last half-second of the disk.. + ok = startSampleInFile > (trackStarts [numTracks] - 20000); + break; } } } -#if JUCE_CATCH_UNHANDLED_EXCEPTIONS - catch (...) - { - fname[0] = 0; - } -#endif - deleteAndZero (currentExtraFileWin); + return ok; +} - const WCHAR* const files = fname; +bool AudioCDReader::isCDStillPresent() const +{ + TOC toc; + zerostruct (toc); - if (selectMultipleFiles && fnameIdx > 0 && files [fnameIdx - 1] == 0) - { - const WCHAR* filename = files + fnameIdx; + return ((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false); +} - while (*filename != 0) - { - const String filepath (String (files) + T("\\") + String (filename)); - results.add (new File (filepath)); - filename += CharacterFunctions::length (filename) + 1; - } - } - else if (files[0] != 0) - { - results.add (new File (files)); - } +int AudioCDReader::getNumTracks() const +{ + return numTracks; } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_FileChooser.cpp *********/ +int AudioCDReader::getPositionOfTrackStart (int trackNum) const +{ + return (trackNum >= 0 && trackNum <= numTracks) ? trackStarts [trackNum] * samplesPerFrame + : 0; +} -/********* Start of inlined file: juce_win32_Fonts.cpp *********/ +void AudioCDReader::refreshTrackLengths() +{ + zeromem (trackStarts, sizeof (trackStarts)); + zeromem (audioTracks, sizeof (audioTracks)); -BEGIN_JUCE_NAMESPACE + TOC toc; + zerostruct (toc); -static int CALLBACK wfontEnum2 (ENUMLOGFONTEXW* lpelfe, - NEWTEXTMETRICEXW*, - int type, - LPARAM lParam) -{ - if (lpelfe != 0 && type == TRUETYPE_FONTTYPE) + if (((CDDeviceWrapper*)handle)->cdH->readTOC (&toc, false)) { - const String fontName (lpelfe->elfLogFont.lfFaceName); + numTracks = 1 + toc.lastTrack - toc.firstTrack; - ((StringArray*) lParam)->addIfNotAlreadyThere (fontName.removeCharacters (T("@"))); + for (int i = 0; i <= numTracks; ++i) + { + trackStarts[i] = getAddressOf (&toc.tracks[i]); + audioTracks[i] = ((toc.tracks[i].ADR & 4) == 0); + } + } + else + { + numTracks = 0; } - - return 1; } -static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe, - NEWTEXTMETRICEXW*, - int type, - LPARAM lParam) +bool AudioCDReader::isTrackAudio (int trackNum) const { - if (lpelfe != 0 - && ((type & (DEVICE_FONTTYPE | RASTER_FONTTYPE)) == 0)) - { - LOGFONTW lf; - zerostruct (lf); - - lf.lfWeight = FW_DONTCARE; - lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; - lf.lfQuality = DEFAULT_QUALITY; - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf.lfPitchAndFamily = FF_DONTCARE; - - const String fontName (lpelfe->elfLogFont.lfFaceName); - fontName.copyToBuffer (lf.lfFaceName, LF_FACESIZE - 1); - - HDC dc = CreateCompatibleDC (0); - EnumFontFamiliesEx (dc, &lf, - (FONTENUMPROCW) &wfontEnum2, - lParam, 0); - DeleteDC (dc); - } + return (trackNum >= 0 && trackNum <= numTracks) ? audioTracks [trackNum] + : false; +} - return 1; +void AudioCDReader::enableIndexScanning (bool b) +{ + indexingEnabled = b; } -const StringArray Font::findAllTypefaceNames() throw() +int AudioCDReader::getLastIndex() const { - StringArray results; - HDC dc = CreateCompatibleDC (0); + return lastIndex; +} - { - LOGFONTW lf; - zerostruct (lf); +const int framesPerIndexRead = 4; - lf.lfWeight = FW_DONTCARE; - lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; - lf.lfQuality = DEFAULT_QUALITY; - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf.lfPitchAndFamily = FF_DONTCARE; - lf.lfFaceName[0] = 0; +int AudioCDReader::getIndexAt (int samplePos) +{ + CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; - EnumFontFamiliesEx (dc, &lf, - (FONTENUMPROCW) &wfontEnum1, - (LPARAM) &results, 0); - } + const int frameNeeded = samplePos / samplesPerFrame; - DeleteDC (dc); + device->overlapBuffer->dataLength = 0; + device->overlapBuffer->startFrame = 0; + device->overlapBuffer->numFrames = 0; + device->jitter = false; - results.sort (true); - return results; -} + firstFrameInBuffer = 0; + lastIndex = 0; -extern bool juce_IsRunningInWine() throw(); + CDReadBuffer readBuffer (4 + framesPerIndexRead); + readBuffer.wantsIndex = true; -void Font::getDefaultFontNames (String& defaultSans, - String& defaultSerif, - String& defaultFixed) throw() -{ - if (juce_IsRunningInWine()) - { - // If we're running in Wine, then use fonts that might be available on Linux.. - defaultSans = "Bitstream Vera Sans"; - defaultSerif = "Bitstream Vera Serif"; - defaultFixed = "Bitstream Vera Sans Mono"; - } - else + int i; + for (i = 5; --i >= 0;) { - defaultSans = "Verdana"; - defaultSerif = "Times"; - defaultFixed = "Lucida Console"; + readBuffer.startFrame = frameNeeded; + readBuffer.numFrames = framesPerIndexRead; + + if (device->cdH->readAudio (&readBuffer, (false) ? device->overlapBuffer : 0)) + break; } + + if (i >= 0) + return readBuffer.index; + + return -1; } -class FontDCHolder : private DeletedAtShutdown +const Array AudioCDReader::findIndexesInTrack (const int trackNumber) { - HDC dc; - String fontName; - KERNINGPAIR* kps; - int numKPs; - bool bold, italic; - int size; + Array indexes; - FontDCHolder (const FontDCHolder&); - const FontDCHolder& operator= (const FontDCHolder&); + const int trackStart = getPositionOfTrackStart (trackNumber); + const int trackEnd = getPositionOfTrackStart (trackNumber + 1); -public: - HFONT fontH; + bool needToScan = true; - FontDCHolder() throw() - : dc (0), - kps (0), - numKPs (0), - bold (false), - italic (false), - size (0) + if (trackEnd - trackStart > 20 * 44100) { - } + // check the end of the track for indexes before scanning the whole thing + needToScan = false; + int pos = jmax (trackStart, trackEnd - 44100 * 5); + bool seenAnIndex = false; - ~FontDCHolder() throw() - { - if (dc != 0) + while (pos <= trackEnd - samplesPerFrame) { - DeleteDC (dc); - DeleteObject (fontH); - juce_free (kps); - } - - clearSingletonInstance(); - } + const int index = getIndexAt (pos); - juce_DeclareSingleton_SingleThreaded_Minimal (FontDCHolder); + if (index == 0) + { + // lead-out, so skip back a bit if we've not found any indexes yet.. + if (seenAnIndex) + break; - HDC loadFont (const String& fontName_, - const bool bold_, - const bool italic_, - const int size_) throw() - { - if (fontName != fontName_ || bold != bold_ || italic != italic_ || size != size_) - { - fontName = fontName_; - bold = bold_; - italic = italic_; - size = size_; + pos -= 44100 * 5; - if (dc != 0) + if (pos < trackStart) + break; + } + else { - DeleteDC (dc); - DeleteObject (fontH); + if (index > 0) + seenAnIndex = true; - juce_free (kps); - kps = 0; + if (index > 1) + { + needToScan = true; + break; + } + + pos += samplesPerFrame * framesPerIndexRead; } + } + } - fontH = 0; + if (needToScan) + { + CDDeviceWrapper* const device = (CDDeviceWrapper*) handle; - dc = CreateCompatibleDC (0); - SetMapperFlags (dc, 0); - SetMapMode (dc, MM_TEXT); + int pos = trackStart; + int last = -1; - LOGFONTW lfw; - zerostruct (lfw); + while (pos < trackEnd - samplesPerFrame * 10) + { + const int frameNeeded = pos / samplesPerFrame; - lfw.lfCharSet = DEFAULT_CHARSET; - lfw.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lfw.lfOutPrecision = OUT_OUTLINE_PRECIS; - lfw.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; - lfw.lfQuality = PROOF_QUALITY; - lfw.lfItalic = (BYTE) (italic ? TRUE : FALSE); - lfw.lfWeight = bold ? FW_BOLD : FW_NORMAL; - fontName.copyToBuffer (lfw.lfFaceName, LF_FACESIZE - 1); + device->overlapBuffer->dataLength = 0; + device->overlapBuffer->startFrame = 0; + device->overlapBuffer->numFrames = 0; + device->jitter = false; - lfw.lfHeight = size > 0 ? size : -256; - HFONT standardSizedFont = CreateFontIndirect (&lfw); + firstFrameInBuffer = 0; - if (standardSizedFont != 0) - { - if (SelectObject (dc, standardSizedFont) != 0) - { - fontH = standardSizedFont; + CDReadBuffer readBuffer (4); + readBuffer.wantsIndex = true; - if (size == 0) - { - OUTLINETEXTMETRIC otm; - if (GetOutlineTextMetrics (dc, sizeof (otm), &otm) != 0) - { - lfw.lfHeight = -(int) otm.otmEMSquare; - fontH = CreateFontIndirect (&lfw); + int i; + for (i = 5; --i >= 0;) + { + readBuffer.startFrame = frameNeeded; + readBuffer.numFrames = framesPerIndexRead; - SelectObject (dc, fontH); - DeleteObject (standardSizedFont); - } - } - } - else - { - jassertfalse - } + if (device->cdH->readAudio (&readBuffer, (false) ? device->overlapBuffer : 0)) + break; } - else + + if (i < 0) + break; + + if (readBuffer.index > last && readBuffer.index > 1) { - jassertfalse + last = readBuffer.index; + indexes.add (pos); } - } - return dc; - } - - KERNINGPAIR* getKerningPairs (int& numKPs_) throw() - { - if (kps == 0) - { - numKPs = GetKerningPairs (dc, 0, 0); - kps = (KERNINGPAIR*) juce_calloc (sizeof (KERNINGPAIR) * numKPs); - GetKerningPairs (dc, numKPs, kps); + pos += samplesPerFrame * framesPerIndexRead; } - numKPs_ = numKPs; - return kps; + indexes.removeValue (trackStart); } -}; -juce_ImplementSingleton_SingleThreaded (FontDCHolder); + return indexes; +} -static bool addGlyphToTypeface (HDC dc, - juce_wchar character, - Typeface& dest, - bool addKerning) +int AudioCDReader::getCDDBId() { - Path destShape; - GLYPHMETRICS gm; - - float height; - BOOL ok = false; + refreshTrackLengths(); + if (numTracks > 0) { - const WCHAR charToTest[] = { (WCHAR) character, 0 }; - WORD index = 0; + TOC toc; + zerostruct (toc); - if (GetGlyphIndices (dc, charToTest, 1, &index, GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR - && index == 0xffff) + if (((CDDeviceWrapper*) handle)->cdH->readTOC (&toc, true)) { - return false; - } - } + int n = 0; - TEXTMETRIC tm; - ok = GetTextMetrics (dc, &tm); + for (int i = numTracks; --i >= 0;) + { + int j = getMSFAddressOf (&toc.tracks[i]); - height = (float) tm.tmHeight; + while (j > 0) + { + n += (j % 10); + j /= 10; + } + } - if (! ok) - { - dest.addGlyph (character, destShape, 0); - return true; - } + if (n != 0) + { + const int t = getMSFAddressOf (&toc.tracks[numTracks]) + - getMSFAddressOf (&toc.tracks[0]); - const float scaleX = 1.0f / height; - const float scaleY = -1.0f / height; - static const MAT2 identityMatrix = { { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 1 } }; + return ((n % 0xff) << 24) | (t << 8) | numTracks; + } + } + } - const int bufSize = GetGlyphOutline (dc, character, GGO_NATIVE, - &gm, 0, 0, &identityMatrix); + return 0; +} - if (bufSize > 0) - { - char* const data = (char*) juce_malloc (bufSize); +void AudioCDReader::ejectDisk() +{ + ((CDDeviceWrapper*) handle)->cdH->openDrawer (true); +} - GetGlyphOutline (dc, character, GGO_NATIVE, &gm, - bufSize, data, &identityMatrix); +static IDiscRecorder* enumCDBurners (StringArray* list, int indexToOpen, IDiscMaster** master) +{ + CoInitialize (0); - const TTPOLYGONHEADER* pheader = (TTPOLYGONHEADER*) data; + IDiscMaster* dm; + IDiscRecorder* result = 0; - while ((char*) pheader < data + bufSize) + if (SUCCEEDED (CoCreateInstance (CLSID_MSDiscMasterObj, 0, + CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, + IID_IDiscMaster, + (void**) &dm))) + { + if (SUCCEEDED (dm->Open())) { - #define remapX(v) (scaleX * (v).x.value) - #define remapY(v) (scaleY * (v).y.value) - - float x = remapX (pheader->pfxStart); - float y = remapY (pheader->pfxStart); - - destShape.startNewSubPath (x, y); - - const TTPOLYCURVE* curve = (const TTPOLYCURVE*) ((const char*) pheader + sizeof (TTPOLYGONHEADER)); - const char* const curveEnd = ((const char*) pheader) + pheader->cb; + IEnumDiscRecorders* drEnum = 0; - while ((const char*) curve < curveEnd) + if (SUCCEEDED (dm->EnumDiscRecorders (&drEnum))) { - if (curve->wType == TT_PRIM_LINE) + IDiscRecorder* dr = 0; + DWORD dummy; + int index = 0; + + while (drEnum->Next (1, &dr, &dummy) == S_OK) { - for (int i = 0; i < curve->cpfx; ++i) + if (indexToOpen == index) { - x = remapX (curve->apfx [i]); - y = remapY (curve->apfx [i]); - - destShape.lineTo (x, y); + result = dr; + break; } - } - else if (curve->wType == TT_PRIM_QSPLINE) - { - for (int i = 0; i < curve->cpfx - 1; ++i) + else if (list != 0) { - const float x2 = remapX (curve->apfx [i]); - const float y2 = remapY (curve->apfx [i]); - float x3, y3; - - if (i < curve->cpfx - 2) - { - x3 = 0.5f * (x2 + remapX (curve->apfx [i + 1])); - y3 = 0.5f * (y2 + remapY (curve->apfx [i + 1])); - } - else - { - x3 = remapX (curve->apfx [i + 1]); - y3 = remapY (curve->apfx [i + 1]); - } - - destShape.quadraticTo (x2, y2, x3, y3); + BSTR path; - x = x3; - y = y3; + if (SUCCEEDED (dr->GetPath (&path))) + list->add ((const WCHAR*) path); } + + ++index; + dr->Release(); } - curve = (const TTPOLYCURVE*) &(curve->apfx [curve->cpfx]); + drEnum->Release(); } - pheader = (const TTPOLYGONHEADER*) curve; + /*if (redbookFormat != 0) + { + IEnumDiscMasterFormats* mfEnum; - destShape.closeSubPath(); - } + if (SUCCEEDED (dm->EnumDiscMasterFormats (&mfEnum))) + { + IID formatIID; + DWORD dummy; - juce_free (data); - } + while (mfEnum->Next (1, &formatIID, &dummy) == S_OK) + { + } - dest.addGlyph (character, destShape, gm.gmCellIncX / height); + mfEnum->Release(); + } - if (addKerning) - { - int numKPs; - const KERNINGPAIR* const kps = FontDCHolder::getInstance()->getKerningPairs (numKPs); + redbookFormat + }*/ - for (int i = 0; i < numKPs; ++i) - { - if (kps[i].wFirst == character) - { - dest.addKerningPair (kps[i].wFirst, - kps[i].wSecond, - kps[i].iKernAmount / height); - } + if (master == 0) + dm->Close(); } + + if (master != 0) + *master = dm; + else + dm->Release(); } - return true; + return result; } -bool Typeface::findAndAddSystemGlyph (juce_wchar character) throw() +const StringArray AudioCDBurner::findAvailableDevices() { - HDC dc = FontDCHolder::getInstance()->loadFont (getName(), isBold(), isItalic(), 0); - return addGlyphToTypeface (dc, character, *this, true); + StringArray devs; + enumCDBurners (&devs, -1, 0); + return devs; } -/*Image* Typeface::renderGlyphToImage (juce_wchar character, float& topLeftX, float& topLeftY) +AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) { - HDC dc = FontDCHolder::getInstance()->loadFont (getName(), isBold(), isItalic(), hintingSize); - - int bufSize; - GLYPHMETRICS gm; - - const UINT format = GGO_GRAY2_BITMAP; - const int shift = 6; + AudioCDBurner* b = new AudioCDBurner (deviceIndex); - if (wGetGlyphOutlineW != 0) - bufSize = wGetGlyphOutlineW (dc, character, format, &gm, 0, 0, &identityMatrix); - else - bufSize = GetGlyphOutline (dc, character, format, &gm, 0, 0, &identityMatrix); + if (b->internal == 0) + deleteAndZero (b); - Image* im = new Image (Image::SingleChannel, jmax (1, gm.gmBlackBoxX), jmax (1, gm.gmBlackBoxY), true); + return b; +} - if (bufSize > 0) +class CDBurnerInfo : public IDiscMasterProgressEvents +{ +public: + CDBurnerInfo() + : refCount (1), + progress (0), + shouldCancel (false), + listener (0) { - topLeftX = (float) gm.gmptGlyphOrigin.x; - topLeftY = (float) -gm.gmptGlyphOrigin.y; - - uint8* const data = (uint8*) juce_calloc (bufSize); + } - if (wGetGlyphOutlineW != 0) - wGetGlyphOutlineW (dc, character, format, &gm, bufSize, data, &identityMatrix); - else - GetGlyphOutline (dc, character, format, &gm, bufSize, data, &identityMatrix); + ~CDBurnerInfo() + { + } - const int stride = ((gm.gmBlackBoxX + 3) & ~3); + HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + { + if (result == 0) + return E_POINTER; - for (int y = gm.gmBlackBoxY; --y >= 0;) + if (id == IID_IUnknown || id == IID_IDiscMasterProgressEvents) { - for (int x = gm.gmBlackBoxX; --x >= 0;) - { - const int level = data [x + y * stride] << shift; - - if (level > 0) - im->setPixelAt (x, y, Colour ((uint8) 0xff, (uint8) 0xff, (uint8) 0xff, (uint8) jmin (0xff, level))); - } + AddRef(); + *result = this; + return S_OK; } - juce_free (data); + *result = 0; + return E_NOINTERFACE; } - return im; -}*/ - -void Typeface::initialiseTypefaceCharacteristics (const String& fontName, - bool bold, - bool italic, - bool addAllGlyphsToFont) throw() -{ - clear(); - - HDC dc = FontDCHolder::getInstance()->loadFont (fontName, bold, italic, 0); - - float height; - int firstChar, lastChar; + ULONG __stdcall AddRef() { return ++refCount; } + ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + HRESULT __stdcall QueryCancel (boolean* pbCancel) { - TEXTMETRIC tm; - GetTextMetrics (dc, &tm); + if (listener != 0 && ! shouldCancel) + shouldCancel = listener->audioCDBurnProgress (progress); - height = (float) tm.tmHeight; - firstChar = tm.tmFirstChar; - lastChar = tm.tmLastChar; + *pbCancel = shouldCancel; - setAscent (tm.tmAscent / height); - setDefaultCharacter (tm.tmDefaultChar); + return S_OK; } - setName (fontName); - setBold (bold); - setItalic (italic); - - if (addAllGlyphsToFont) + HRESULT __stdcall NotifyBlockProgress (long nCompleted, long nTotal) { - for (int character = firstChar; character <= lastChar; ++character) - addGlyphToTypeface (dc, (juce_wchar) character, *this, false); - - int numKPs; - const KERNINGPAIR* const kps = FontDCHolder::getInstance()->getKerningPairs (numKPs); + progress = nCompleted / (float) nTotal; + shouldCancel = listener != 0 && listener->audioCDBurnProgress (progress); - for (int i = 0; i < numKPs; ++i) - { - addKerningPair (kps[i].wFirst, - kps[i].wSecond, - kps[i].iKernAmount / height); - } + return E_NOTIMPL; } -} -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Fonts.cpp *********/ + HRESULT __stdcall NotifyPnPActivity (void) { return E_NOTIMPL; } + HRESULT __stdcall NotifyAddProgress (long /*nCompletedSteps*/, long /*nTotalSteps*/) { return E_NOTIMPL; } + HRESULT __stdcall NotifyTrackProgress (long /*nCurrentTrack*/, long /*nTotalTracks*/) { return E_NOTIMPL; } + HRESULT __stdcall NotifyPreparingBurn (long /*nEstimatedSeconds*/) { return E_NOTIMPL; } + HRESULT __stdcall NotifyClosingDisc (long /*nEstimatedSeconds*/) { return E_NOTIMPL; } + HRESULT __stdcall NotifyBurnComplete (HRESULT /*status*/) { return E_NOTIMPL; } + HRESULT __stdcall NotifyEraseComplete (HRESULT /*status*/) { return E_NOTIMPL; } -/********* Start of inlined file: juce_win32_Messaging.cpp *********/ + IDiscMaster* discMaster; + IDiscRecorder* discRecorder; + IRedbookDiscMaster* redbook; + AudioCDBurner::BurnProgressListener* listener; + float progress; + bool shouldCancel; -BEGIN_JUCE_NAMESPACE +private: + int refCount; +}; + +AudioCDBurner::AudioCDBurner (const int deviceIndex) + : internal (0) +{ + IDiscMaster* discMaster; + IDiscRecorder* dr = enumCDBurners (0, deviceIndex, &discMaster); -static const unsigned int specialId = WM_APP + 0x4400; -static const unsigned int broadcastId = WM_APP + 0x4403; -static const unsigned int specialCallbackId = WM_APP + 0x4402; + if (dr != 0) + { + IRedbookDiscMaster* redbook; + HRESULT hr = discMaster->SetActiveDiscMasterFormat (IID_IRedbookDiscMaster, (void**) &redbook); -static const TCHAR* const messageWindowName = _T("JUCEWindow"); + hr = discMaster->SetActiveDiscRecorder (dr); -HWND juce_messageWindowHandle = 0; + CDBurnerInfo* const info = new CDBurnerInfo(); + internal = info; -extern long improbableWindowNumber; // defined in windowing.cpp + info->discMaster = discMaster; + info->discRecorder = dr; + info->redbook = redbook; + } +} -static LRESULT CALLBACK juce_MessageWndProc (HWND h, - const UINT message, - const WPARAM wParam, - const LPARAM lParam) throw() +AudioCDBurner::~AudioCDBurner() { - JUCE_TRY - { - if (h == juce_messageWindowHandle) - { - if (message == specialCallbackId) - { - MessageCallbackFunction* const func = (MessageCallbackFunction*) wParam; - return (LRESULT) (*func) ((void*) lParam); - } - else if (message == specialId) - { - // these are trapped early in the dispatch call, but must also be checked - // here in case there are windows modal dialog boxes doing their own - // dispatch loop and not calling our version + CDBurnerInfo* const info = (CDBurnerInfo*) internal; - MessageManager::getInstance()->deliverMessage ((void*) lParam); - return 0; - } - else if (message == broadcastId) - { - String* const messageString = (String*) lParam; - MessageManager::getInstance()->deliverBroadcastMessage (*messageString); - delete messageString; - return 0; - } - else if (message == WM_COPYDATA && ((const COPYDATASTRUCT*) lParam)->dwData == broadcastId) - { - const String messageString ((const juce_wchar*) ((const COPYDATASTRUCT*) lParam)->lpData, - ((const COPYDATASTRUCT*) lParam)->cbData / sizeof (juce_wchar)); + if (info != 0) + { + info->discRecorder->Close(); + info->redbook->Release(); + info->discRecorder->Release(); + info->discMaster->Release(); - PostMessage (juce_messageWindowHandle, broadcastId, 0, (LPARAM) new String (messageString)); - return 0; - } - } + info->Release(); } - JUCE_CATCH_EXCEPTION - - return DefWindowProc (h, message, wParam, lParam); } -bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages) +bool AudioCDBurner::isDiskPresent() const { - MSG m; - - if (returnIfNoPendingMessages && ! PeekMessage (&m, (HWND) 0, 0, 0, 0)) - return false; - - if (GetMessage (&m, (HWND) 0, 0, 0) > 0) - { - if (m.message == specialId - && m.hwnd == juce_messageWindowHandle) - { - MessageManager::getInstance()->deliverMessage ((void*) m.lParam); - } - else - { - if (GetWindowLong (m.hwnd, GWLP_USERDATA) != improbableWindowNumber - && (m.message == WM_LBUTTONDOWN || m.message == WM_RBUTTONDOWN)) - { - // if it's someone else's window being clicked on, and the focus is - // currently on a juce window, pass the kb focus over.. - HWND currentFocus = GetFocus(); + CDBurnerInfo* const info = (CDBurnerInfo*) internal; - if (currentFocus == 0 || GetWindowLong (currentFocus, GWLP_USERDATA) == improbableWindowNumber) - SetFocus (m.hwnd); - } + HRESULT hr = info->discRecorder->OpenExclusive(); - TranslateMessage (&m); - DispatchMessage (&m); - } - } + long type, flags; + hr = info->discRecorder->QueryMediaType (&type, &flags); - return true; + info->discRecorder->Close(); + return hr == S_OK && type != 0 && (flags & MEDIA_WRITABLE) != 0; } -bool juce_postMessageToSystemQueue (void* message) +int AudioCDBurner::getNumAvailableAudioBlocks() const { - return PostMessage (juce_messageWindowHandle, specialId, 0, (LPARAM) message) != 0; + CDBurnerInfo* const info = (CDBurnerInfo*) internal; + long blocksFree = 0; + info->redbook->GetAvailableAudioTrackBlocks (&blocksFree); + return blocksFree; } -void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* callback, - void* userData) +const String AudioCDBurner::burn (AudioCDBurner::BurnProgressListener* listener, + const bool ejectDiscAfterwards, + const bool performFakeBurnForTesting) { - if (MessageManager::getInstance()->isThisTheMessageThread()) - { - return (*callback) (userData); - } - else + CDBurnerInfo* const info = (CDBurnerInfo*) internal; + + info->listener = listener; + info->progress = 0; + info->shouldCancel = false; + + UINT_PTR cookie; + HRESULT hr = info->discMaster->ProgressAdvise (info, &cookie); + + hr = info->discMaster->RecordDisc (performFakeBurnForTesting, + ejectDiscAfterwards); + + String error; + if (hr != S_OK) { - // If a thread has a MessageManagerLock and then tries to call this method, it'll - // deadlock because the message manager is blocked from running, and can't - // call your function.. - jassert (! MessageManager::getInstance()->currentThreadHasLockedMessageManager()); + const char* e = "Couldn't open or write to the CD device"; - return (void*) SendMessage (juce_messageWindowHandle, - specialCallbackId, - (WPARAM) callback, - (LPARAM) userData); + if (hr == IMAPI_E_USERABORT) + e = "User cancelled the write operation"; + else if (hr == IMAPI_E_MEDIUM_NOTPRESENT || hr == IMAPI_E_TRACKOPEN) + e = "No Disk present"; + + error = e; } -} -static BOOL CALLBACK BroadcastEnumWindowProc (HWND hwnd, LPARAM lParam) -{ - if (hwnd != juce_messageWindowHandle) - (reinterpret_cast (lParam))->add ((void*) hwnd); + info->discMaster->ProgressUnadvise (cookie); + info->listener = 0; - return TRUE; + return error; } -void MessageManager::broadcastMessage (const String& value) throw() +bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamples) { - VoidArray windows; - EnumWindows (&BroadcastEnumWindowProc, (LPARAM) &windows); + if (source == 0) + return false; - const String localCopy (value); + CDBurnerInfo* const info = (CDBurnerInfo*) internal; - COPYDATASTRUCT data; - data.dwData = broadcastId; - data.cbData = (localCopy.length() + 1) * sizeof (juce_wchar); - data.lpData = (void*) (const juce_wchar*) localCopy; + long bytesPerBlock; + HRESULT hr = info->redbook->GetAudioBlockSize (&bytesPerBlock); - for (int i = windows.size(); --i >= 0;) - { - HWND hwnd = (HWND) windows.getUnchecked(i); + const int samplesPerBlock = bytesPerBlock / 4; + bool ok = true; - TCHAR windowName [64]; // no need to read longer strings than this - GetWindowText (hwnd, windowName, 64); - windowName [63] = 0; + hr = info->redbook->CreateAudioTrack ((long) numSamples / (bytesPerBlock * 4)); - if (String (windowName) == String (messageWindowName)) - { - DWORD_PTR result; - SendMessageTimeout (hwnd, WM_COPYDATA, - (WPARAM) juce_messageWindowHandle, - (LPARAM) &data, - SMTO_BLOCK | SMTO_ABORTIFHUNG, - 8000, - &result); - } - } -} + byte* const buffer = (byte*) juce_malloc (bytesPerBlock); -static const String getMessageWindowClassName() -{ - // this name has to be different for each app/dll instance because otherwise - // poor old Win32 can get a bit confused (even despite it not being a process-global - // window class). + AudioSampleBuffer sourceBuffer (2, samplesPerBlock); + int samplesDone = 0; - static int number = 0; - if (number == 0) - number = 0x7fffffff & (int) Time::getHighResolutionTicks(); + source->prepareToPlay (samplesPerBlock, 44100.0); - return T("JUCEcs_") + String (number); -} + while (ok) + { + { + AudioSourceChannelInfo info; + info.buffer = &sourceBuffer; + info.numSamples = samplesPerBlock; + info.startSample = 0; + sourceBuffer.clear(); -void MessageManager::doPlatformSpecificInitialisation() -{ - OleInitialize (0); + source->getNextAudioBlock (info); + } - const String className (getMessageWindowClassName()); + zeromem (buffer, bytesPerBlock); - HMODULE hmod = (HMODULE) PlatformUtilities::getCurrentModuleInstanceHandle(); + AudioDataConverters::convertFloatToInt16LE (sourceBuffer.getSampleData (0, 0), + buffer, samplesPerBlock, 4); - WNDCLASSEX wc; - zerostruct (wc); + AudioDataConverters::convertFloatToInt16LE (sourceBuffer.getSampleData (1, 0), + buffer + 2, samplesPerBlock, 4); - wc.cbSize = sizeof (wc); - wc.lpfnWndProc = (WNDPROC) juce_MessageWndProc; - wc.cbWndExtra = 4; - wc.hInstance = hmod; - wc.lpszClassName = className; + hr = info->redbook->AddAudioTrackBlocks (buffer, bytesPerBlock); - RegisterClassEx (&wc); + if (hr != S_OK) + ok = false; - juce_messageWindowHandle = CreateWindow (wc.lpszClassName, - messageWindowName, - 0, 0, 0, 0, 0, 0, 0, - hmod, 0); -} + samplesDone += samplesPerBlock; -void MessageManager::doPlatformSpecificShutdown() -{ - DestroyWindow (juce_messageWindowHandle); - UnregisterClass (getMessageWindowClassName(), 0); - OleUninitialize(); -} + if (samplesDone >= numSamples) + break; + } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Messaging.cpp *********/ + juce_free (buffer); -/********* Start of inlined file: juce_win32_Midi.cpp *********/ + hr = info->redbook->CloseAudioTrack(); -BEGIN_JUCE_NAMESPACE + delete source; + + return ok && hr == S_OK; +} -#if JUCE_MSVC - #pragma warning (disable: 4312) #endif +/********* End of inlined file: juce_win32_AudioCDReader.cpp *********/ -using ::free; +/********* Start of inlined file: juce_win32_Midi.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE static const int midiBufferSize = 1024 * 10; static const int numInHeaders = 32; static const int inBufferSize = 256; static Array activeMidiThreads; +using ::free; + class MidiInThread : public Thread { public: @@ -239543,4243 +249128,3539 @@ void MidiOutput::sendMessageNow (const MidiMessage& message) } } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_win32_Midi.cpp *********/ -/********* Start of inlined file: juce_win32_WebBrowserComponent.cpp *********/ +/********* Start of inlined file: juce_win32_ASIO.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_ASIO -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) +#undef WINDOWS + +// #define ASIO_DEBUGGING + +#ifdef ASIO_DEBUGGING + #define log(a) { Logger::writeToLog (a); DBG (a) } +#else + #define log(a) {} #endif -#include -#include -#include +#ifdef ASIO_DEBUGGING +static void logError (const String& context, long error) +{ + String err ("unknown error"); -#ifdef _MSC_VER - #pragma warning (pop) - #pragma warning (disable: 4312 4244) + if (error == ASE_NotPresent) + err = "Not Present"; + else if (error == ASE_HWMalfunction) + err = "Hardware Malfunction"; + else if (error == ASE_InvalidParameter) + err = "Invalid Parameter"; + else if (error == ASE_InvalidMode) + err = "Invalid Mode"; + else if (error == ASE_SPNotAdvancing) + err = "Sample position not advancing"; + else if (error == ASE_NoClock) + err = "No Clock"; + else if (error == ASE_NoMemory) + err = "Out of memory"; + + log (T("!!error: ") + context + T(" - ") + err); +} +#else + #define logError(a, b) {} #endif -BEGIN_JUCE_NAMESPACE +class ASIOAudioIODevice; +static ASIOAudioIODevice* volatile currentASIODev[3] = { 0, 0, 0 }; -class WebBrowserComponentInternal : public ActiveXControlComponent +static const int maxASIOChannels = 160; + +class JUCE_API ASIOAudioIODevice : public AudioIODevice, + private Timer { public: + Component ourWindow; - WebBrowserComponentInternal() - : browser (0), - connectionPoint (0), - adviseCookie (0) + ASIOAudioIODevice (const String& name_, const CLSID classId_, const int slotNumber) + : AudioIODevice (name_, T("ASIO")), + asioObject (0), + classId (classId_), + currentBitDepth (16), + currentSampleRate (0), + tempBuffer (0), + isOpen_ (false), + isStarted (false), + postOutput (true), + insideControlPanelModalLoop (false), + shouldUsePreferredSize (false) { - } + name = name_; - ~WebBrowserComponentInternal() - { - if (connectionPoint != 0) - connectionPoint->Unadvise (adviseCookie); + ourWindow.addToDesktop (0); + windowHandle = ourWindow.getWindowHandle(); - if (browser != 0) - browser->Release(); + jassert (currentASIODev [slotNumber] == 0); + currentASIODev [slotNumber] = this; + + openDevice(); } - void createBrowser() + ~ASIOAudioIODevice() { - createControl (&CLSID_WebBrowser); - browser = (IWebBrowser2*) queryInterface (&IID_IWebBrowser2); - - IConnectionPointContainer* connectionPointContainer = (IConnectionPointContainer*) queryInterface (&IID_IConnectionPointContainer); - - if (connectionPointContainer != 0) - { - connectionPointContainer->FindConnectionPoint (DIID_DWebBrowserEvents2, - &connectionPoint); + for (int i = 0; i < numElementsInArray (currentASIODev); ++i) + if (currentASIODev[i] == this) + currentASIODev[i] = 0; - if (connectionPoint != 0) - { - WebBrowserComponent* const owner = dynamic_cast (getParentComponent()); - jassert (owner != 0); + close(); + log ("ASIO - exiting"); + removeCurrentDriver(); - EventHandler* handler = new EventHandler (owner); - connectionPoint->Advise (handler, &adviseCookie); - } - } + juce_free (tempBuffer); } - void goToURL (const String& url, - const StringArray* headers, - const MemoryBlock* postData) + void updateSampleRates() { - if (browser != 0) - { - LPSAFEARRAY sa = 0; - _variant_t flags, frame, postDataVar, headersVar; - - if (headers != 0) - headersVar = (const tchar*) headers->joinIntoString ("\r\n"); + // find a list of sample rates.. + const double possibleSampleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; + sampleRates.clear(); - if (postData != 0 && postData->getSize() > 0) + if (asioObject != 0) + { + for (int index = 0; index < numElementsInArray (possibleSampleRates); ++index) { - LPSAFEARRAY sa = SafeArrayCreateVector (VT_UI1, 0, postData->getSize()); + const long err = asioObject->canSampleRate (possibleSampleRates[index]); - if (sa != 0) + if (err == 0) { - void* data = 0; - SafeArrayAccessData (sa, &data); - jassert (data != 0); - - if (data != 0) - { - postData->copyTo (data, 0, postData->getSize()); - SafeArrayUnaccessData (sa); - - VARIANT postDataVar2; - VariantInit (&postDataVar2); - V_VT (&postDataVar2) = VT_ARRAY | VT_UI1; - V_ARRAY (&postDataVar2) = sa; - - postDataVar = postDataVar2; - } + sampleRates.add ((int) possibleSampleRates[index]); + log (T("rate: ") + String ((int) possibleSampleRates[index])); + } + else if (err != ASE_NoClock) + { + logError (T("CanSampleRate"), err); } } - browser->Navigate ((BSTR) (const OLECHAR*) url, - &flags, &frame, - &postDataVar, &headersVar); - - if (sa != 0) - SafeArrayDestroy (sa); - } - } - - IWebBrowser2* browser; - - juce_UseDebuggingNewOperator - -private: - IConnectionPoint* connectionPoint; - DWORD adviseCookie; - - class EventHandler : public IDispatch - { - public: - EventHandler (WebBrowserComponent* owner_) - : owner (owner_), - refCount (0) - { - } - - ~EventHandler() - { - } - - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IDispatch || id == DIID_DWebBrowserEvents2) - { - AddRef(); - *result = this; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall GetTypeInfoCount (UINT __RPC_FAR*) { return E_NOTIMPL; } - HRESULT __stdcall GetTypeInfo (UINT, LCID, ITypeInfo __RPC_FAR *__RPC_FAR*) { return E_NOTIMPL; } - HRESULT __stdcall GetIDsOfNames (REFIID, LPOLESTR __RPC_FAR*, UINT, LCID, DISPID __RPC_FAR*) { return E_NOTIMPL; } - - HRESULT __stdcall Invoke (DISPID dispIdMember, REFIID /*riid*/, LCID /*lcid*/, - WORD /*wFlags*/, DISPPARAMS __RPC_FAR* pDispParams, - VARIANT __RPC_FAR* /*pVarResult*/, EXCEPINFO __RPC_FAR* /*pExcepInfo*/, - UINT __RPC_FAR* /*puArgErr*/) - { - switch (dispIdMember) + if (sampleRates.size() == 0) { - case DISPID_BEFORENAVIGATE2: - { - VARIANT* const vurl = pDispParams->rgvarg[5].pvarVal; - - String url; - - if ((vurl->vt & VT_BYREF) != 0) - url = *vurl->pbstrVal; - else - url = vurl->bstrVal; - - *pDispParams->rgvarg->pboolVal - = owner->pageAboutToLoad (url) ? VARIANT_FALSE - : VARIANT_TRUE; - - return S_OK; - } + double cr = 0; + const long err = asioObject->getSampleRate (&cr); + log (T("No sample rates supported - current rate: ") + String ((int) cr)); - default: - break; + if (err == 0) + sampleRates.add ((int) cr); } - - return E_NOTIMPL; } + } - juce_UseDebuggingNewOperator - - private: - WebBrowserComponent* const owner; - int refCount; - - EventHandler (const EventHandler&); - const EventHandler& operator= (const EventHandler&); - }; -}; - -WebBrowserComponent::WebBrowserComponent() - : browser (0), - blankPageShown (false) -{ - setOpaque (true); - addAndMakeVisible (browser = new WebBrowserComponentInternal()); -} - -WebBrowserComponent::~WebBrowserComponent() -{ - delete browser; -} - -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; - - browser->goToURL (url, headers, postData); -} - -void WebBrowserComponent::stop() -{ - if (browser->browser != 0) - browser->browser->Stop(); -} - -void WebBrowserComponent::goBack() -{ - lastURL = String::empty; - blankPageShown = false; - - if (browser->browser != 0) - browser->browser->GoBack(); -} - -void WebBrowserComponent::goForward() -{ - lastURL = String::empty; + const StringArray getOutputChannelNames() + { + return outputChannelNames; + } - if (browser->browser != 0) - browser->browser->GoForward(); -} + const StringArray getInputChannelNames() + { + return inputChannelNames; + } -void WebBrowserComponent::paint (Graphics& g) -{ - if (browser->browser == 0) - g.fillAll (Colours::white); -} + int getNumSampleRates() + { + return sampleRates.size(); + } -void WebBrowserComponent::checkWindowAssociation() -{ - if (isShowing()) + double getSampleRate (int index) { - if (browser->browser == 0 && getPeer() != 0) - { - browser->createBrowser(); - reloadLastURL(); - } - else - { - if (blankPageShown) - goBack(); - } + return sampleRates [index]; } - else + + int getNumBufferSizesAvailable() { - if (browser != 0 && ! blankPageShown) - { - // when the component becomes invisible, some stuff like flash - // carries on playing audio, so we need to force it onto a blank - // page to avoid this.. + return bufferSizes.size(); + } - blankPageShown = true; - browser->goToURL ("about:blank", 0, 0); - } + int getBufferSizeSamples (int index) + { + return bufferSizes [index]; } -} -void WebBrowserComponent::reloadLastURL() -{ - if (lastURL.isNotEmpty()) + int getDefaultBufferSize() { - goToURL (lastURL, &lastHeaders, &lastPostData); - lastURL = String::empty; + return preferredSize; } -} -void WebBrowserComponent::parentHierarchyChanged() -{ - checkWindowAssociation(); -} + const String open (const BitArray& inputChannels, + const BitArray& outputChannels, + double sr, + int bufferSizeSamples) + { + close(); + currentCallback = 0; -void WebBrowserComponent::moved() -{ -} + if (bufferSizeSamples <= 0) + shouldUsePreferredSize = true; -void WebBrowserComponent::resized() -{ - browser->setSize (getWidth(), getHeight()); -} + if (asioObject == 0 || ! isASIOOpen) + { + log ("Warning: device not open"); + const String err (openDevice()); -void WebBrowserComponent::visibilityChanged() -{ - checkWindowAssociation(); -} + if (asioObject == 0 || ! isASIOOpen) + return err; + } -bool WebBrowserComponent::pageAboutToLoad (const String&) -{ - return true; -} + isStarted = false; + bufferIndex = -1; + long err = 0; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_WebBrowserComponent.cpp *********/ + long newPreferredSize = 0; -/********* Start of inlined file: juce_win32_Windowing.cpp *********/ -#ifdef _MSC_VER - #pragma warning (disable: 4514) - #pragma warning (push) -#endif + // if the preferred size has just changed, assume it's a control panel thing and use it as the new value. + minSize = 0; + maxSize = 0; + newPreferredSize = 0; + granularity = 0; -#include -#include -#include + if (asioObject->getBufferSize (&minSize, &maxSize, &newPreferredSize, &granularity) == 0) + { + if (preferredSize != 0 && newPreferredSize != 0 && newPreferredSize != preferredSize) + shouldUsePreferredSize = true; -#if JUCE_OPENGL - #include -#endif + preferredSize = newPreferredSize; + } -#ifdef _MSC_VER - #pragma warning (pop) - #pragma warning (disable: 4312 4244) -#endif + // unfortunate workaround for certain manufacturers whose drivers crash horribly if you make + // dynamic changes to the buffer size... + shouldUsePreferredSize = shouldUsePreferredSize + || getName().containsIgnoreCase (T("Digidesign")); -#undef GetSystemMetrics // multimon overrides this for some reason and causes a mess.. + if (shouldUsePreferredSize) + { + log ("Using preferred size for buffer.."); -// these are in the windows SDK, but need to be repeated here for GCC.. -#ifndef GET_APPCOMMAND_LPARAM - #define FAPPCOMMAND_MASK 0xF000 - #define GET_APPCOMMAND_LPARAM(lParam) ((short) (HIWORD (lParam) & ~FAPPCOMMAND_MASK)) - #define APPCOMMAND_MEDIA_NEXTTRACK 11 - #define APPCOMMAND_MEDIA_PREVIOUSTRACK 12 - #define APPCOMMAND_MEDIA_STOP 13 - #define APPCOMMAND_MEDIA_PLAY_PAUSE 14 - #define WM_APPCOMMAND 0x0319 -#endif + if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) + { + bufferSizeSamples = preferredSize; + } + else + { + bufferSizeSamples = 1024; + logError ("GetBufferSize1", err); + } -BEGIN_JUCE_NAMESPACE + shouldUsePreferredSize = false; + } -extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp -extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.cpp -extern bool juce_IsRunningInWine() throw(); + int sampleRate = roundDoubleToInt (sr); + currentSampleRate = sampleRate; + currentBlockSizeSamples = bufferSizeSamples; + currentChansOut.clear(); + currentChansIn.clear(); + zeromem (inBuffers, sizeof (inBuffers)); + zeromem (outBuffers, sizeof (outBuffers)); -#ifndef ULW_ALPHA - #define ULW_ALPHA 0x00000002 -#endif + updateSampleRates(); -#ifndef AC_SRC_ALPHA - #define AC_SRC_ALPHA 0x01 -#endif + if (sampleRate == 0 || (sampleRates.size() > 0 && ! sampleRates.contains (sampleRate))) + sampleRate = sampleRates[0]; -#define DEBUG_REPAINT_TIMES 0 + jassert (sampleRate != 0); + if (sampleRate == 0) + sampleRate = 44100; -static HPALETTE palette = 0; -static bool createPaletteIfNeeded = true; -static bool shouldDeactivateTitleBar = true; -static bool screenSaverAllowed = true; + long numSources = 32; + ASIOClockSource clocks[32]; + zeromem (clocks, sizeof (clocks)); + asioObject->getClockSources (clocks, &numSources); + bool isSourceSet = false; -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw(); -#define WM_TRAYNOTIFY WM_USER + 100 + // careful not to remove this loop because it does more than just logging! + int i; + for (i = 0; i < numSources; ++i) + { + String s ("clock: "); + s += clocks[i].name; -using ::abs; + if (clocks[i].isCurrentSource) + { + isSourceSet = true; + s << " (cur)"; + } -typedef BOOL (WINAPI* UpdateLayeredWinFunc) (HWND, HDC, POINT*, SIZE*, HDC, POINT*, COLORREF, BLENDFUNCTION*, DWORD); -static UpdateLayeredWinFunc updateLayeredWindow = 0; + log (s); + } -bool Desktop::canUseSemiTransparentWindows() throw() -{ - if (updateLayeredWindow == 0) - { - if (! juce_IsRunningInWine()) + if (numSources > 1 && ! isSourceSet) { - HMODULE user32Mod = GetModuleHandle (_T("user32.dll")); - updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow"); + log ("setting clock source"); + asioObject->setClockSource (clocks[0].index); + Thread::sleep (20); + } + else + { + if (numSources == 0) + { + log ("ASIO - no clock sources!"); + } } - } - - return updateLayeredWindow != 0; -} - -#undef DefWindowProc -#define DefWindowProc DefWindowProcW - -const int extendedKeyModifier = 0x10000; - -const int KeyPress::spaceKey = VK_SPACE; -const int KeyPress::returnKey = VK_RETURN; -const int KeyPress::escapeKey = VK_ESCAPE; -const int KeyPress::backspaceKey = VK_BACK; -const int KeyPress::deleteKey = VK_DELETE | extendedKeyModifier; -const int KeyPress::insertKey = VK_INSERT | extendedKeyModifier; -const int KeyPress::tabKey = VK_TAB; -const int KeyPress::leftKey = VK_LEFT | extendedKeyModifier; -const int KeyPress::rightKey = VK_RIGHT | extendedKeyModifier; -const int KeyPress::upKey = VK_UP | extendedKeyModifier; -const int KeyPress::downKey = VK_DOWN | extendedKeyModifier; -const int KeyPress::homeKey = VK_HOME | extendedKeyModifier; -const int KeyPress::endKey = VK_END | extendedKeyModifier; -const int KeyPress::pageUpKey = VK_PRIOR | extendedKeyModifier; -const int KeyPress::pageDownKey = VK_NEXT | extendedKeyModifier; -const int KeyPress::F1Key = VK_F1 | extendedKeyModifier; -const int KeyPress::F2Key = VK_F2 | extendedKeyModifier; -const int KeyPress::F3Key = VK_F3 | extendedKeyModifier; -const int KeyPress::F4Key = VK_F4 | extendedKeyModifier; -const int KeyPress::F5Key = VK_F5 | extendedKeyModifier; -const int KeyPress::F6Key = VK_F6 | extendedKeyModifier; -const int KeyPress::F7Key = VK_F7 | extendedKeyModifier; -const int KeyPress::F8Key = VK_F8 | extendedKeyModifier; -const int KeyPress::F9Key = VK_F9 | extendedKeyModifier; -const int KeyPress::F10Key = VK_F10 | extendedKeyModifier; -const int KeyPress::F11Key = VK_F11 | extendedKeyModifier; -const int KeyPress::F12Key = VK_F12 | extendedKeyModifier; -const int KeyPress::F13Key = VK_F13 | extendedKeyModifier; -const int KeyPress::F14Key = VK_F14 | extendedKeyModifier; -const int KeyPress::F15Key = VK_F15 | extendedKeyModifier; -const int KeyPress::F16Key = VK_F16 | extendedKeyModifier; -const int KeyPress::numberPad0 = VK_NUMPAD0 | extendedKeyModifier; -const int KeyPress::numberPad1 = VK_NUMPAD1 | extendedKeyModifier; -const int KeyPress::numberPad2 = VK_NUMPAD2 | extendedKeyModifier; -const int KeyPress::numberPad3 = VK_NUMPAD3 | extendedKeyModifier; -const int KeyPress::numberPad4 = VK_NUMPAD4 | extendedKeyModifier; -const int KeyPress::numberPad5 = VK_NUMPAD5 | extendedKeyModifier; -const int KeyPress::numberPad6 = VK_NUMPAD6 | extendedKeyModifier; -const int KeyPress::numberPad7 = VK_NUMPAD7 | extendedKeyModifier; -const int KeyPress::numberPad8 = VK_NUMPAD8 | extendedKeyModifier; -const int KeyPress::numberPad9 = VK_NUMPAD9 | extendedKeyModifier; -const int KeyPress::numberPadAdd = VK_ADD | extendedKeyModifier; -const int KeyPress::numberPadSubtract = VK_SUBTRACT | extendedKeyModifier; -const int KeyPress::numberPadMultiply = VK_MULTIPLY | extendedKeyModifier; -const int KeyPress::numberPadDivide = VK_DIVIDE | extendedKeyModifier; -const int KeyPress::numberPadSeparator = VK_SEPARATOR | extendedKeyModifier; -const int KeyPress::numberPadDecimalPoint = VK_DECIMAL | extendedKeyModifier; -const int KeyPress::numberPadEquals = 0x92 /*VK_OEM_NEC_EQUAL*/ | extendedKeyModifier; -const int KeyPress::numberPadDelete = VK_DELETE | extendedKeyModifier; -const int KeyPress::playKey = 0x30000; -const int KeyPress::stopKey = 0x30001; -const int KeyPress::fastForwardKey = 0x30002; -const int KeyPress::rewindKey = 0x30003; - -class WindowsBitmapImage : public Image -{ -public: - - HBITMAP hBitmap; - BITMAPV4HEADER bitmapInfo; - HDC hdc; - unsigned char* bitmapData; - - WindowsBitmapImage (const PixelFormat format_, - const int w, const int h, const bool clearImage) - : Image (format_, w, h) - { - jassert (format_ == RGB || format_ == ARGB); - - pixelStride = (format_ == RGB) ? 3 : 4; - - zerostruct (bitmapInfo); - bitmapInfo.bV4Size = sizeof (BITMAPV4HEADER); - bitmapInfo.bV4Width = w; - bitmapInfo.bV4Height = h; - bitmapInfo.bV4Planes = 1; - bitmapInfo.bV4BitCount = (unsigned short) (pixelStride * 8); - if (format_ == ARGB) + double cr = 0; + err = asioObject->getSampleRate (&cr); + if (err == 0) { - bitmapInfo.bV4AlphaMask = 0xff000000; - bitmapInfo.bV4RedMask = 0xff0000; - bitmapInfo.bV4GreenMask = 0xff00; - bitmapInfo.bV4BlueMask = 0xff; - bitmapInfo.bV4V4Compression = BI_BITFIELDS; + currentSampleRate = cr; } else { - bitmapInfo.bV4V4Compression = BI_RGB; + logError ("GetSampleRate", err); + currentSampleRate = 0; } - lineStride = -((w * pixelStride + 3) & ~3); - - HDC dc = GetDC (0); - hdc = CreateCompatibleDC (dc); - ReleaseDC (0, dc); - - SetMapMode (hdc, MM_TEXT); - - hBitmap = CreateDIBSection (hdc, - (BITMAPINFO*) &(bitmapInfo), - DIB_RGB_COLORS, - (void**) &bitmapData, - 0, 0); - - SelectObject (hdc, hBitmap); - - if (format_ == ARGB && clearImage) - zeromem (bitmapData, abs (h * lineStride)); - - imageData = bitmapData - (lineStride * (h - 1)); - } - - ~WindowsBitmapImage() - { - DeleteDC (hdc); - DeleteObject (hBitmap); - imageData = 0; // to stop the base class freeing this - } - - void blitToWindow (HWND hwnd, HDC dc, const bool transparent, - const int x, const int y, - const RectangleList& maskedRegion) throw() - { - static HDRAWDIB hdd = 0; - static bool needToCreateDrawDib = true; + error = String::empty; + needToReset = false; + isReSync = false; + err = 0; + bool buffersCreated = false; - if (needToCreateDrawDib) + if (currentSampleRate != sampleRate) { - needToCreateDrawDib = false; + log (T("ASIO samplerate: ") + String (currentSampleRate) + T(" to ") + String (sampleRate)); + err = asioObject->setSampleRate (sampleRate); - HDC dc = GetDC (0); - const int n = GetDeviceCaps (dc, BITSPIXEL); - ReleaseDC (0, dc); + if (err == ASE_NoClock && numSources > 0) + { + log ("trying to set a clock source.."); + Thread::sleep (10); + err = asioObject->setClockSource (clocks[0].index); + if (err != 0) + { + logError ("SetClock", err); + } - // only open if we're not palettised - if (n > 8) - hdd = DrawDibOpen(); + Thread::sleep (10); + err = asioObject->setSampleRate (sampleRate); + } } - if (createPaletteIfNeeded) + if (err == 0) { - HDC dc = GetDC (0); - const int n = GetDeviceCaps (dc, BITSPIXEL); - ReleaseDC (0, dc); - - if (n <= 8) - palette = CreateHalftonePalette (dc); - - createPaletteIfNeeded = false; - } + currentSampleRate = sampleRate; - if (palette != 0) - { - SelectPalette (dc, palette, FALSE); - RealizePalette (dc); - SetStretchBltMode (dc, HALFTONE); - } + if (needToReset) + { + if (isReSync) + { + log ("Resync request"); + } - SetMapMode (dc, MM_TEXT); + log ("! Resetting ASIO after sample rate change"); + removeCurrentDriver(); - if (transparent) - { - POINT p, pos; - SIZE size; + loadDriver(); + const String error (initDriver()); - RECT windowBounds; - GetWindowRect (hwnd, &windowBounds); + if (error.isNotEmpty()) + { + log (T("ASIOInit: ") + error); + } - p.x = -x; - p.y = -y; - pos.x = windowBounds.left; - pos.y = windowBounds.top; - size.cx = windowBounds.right - windowBounds.left; - size.cy = windowBounds.bottom - windowBounds.top; + needToReset = false; + isReSync = false; + } - BLENDFUNCTION bf; - bf.AlphaFormat = AC_SRC_ALPHA; - bf.BlendFlags = 0; - bf.BlendOp = AC_SRC_OVER; - bf.SourceConstantAlpha = 0xff; + numActiveInputChans = 0; + numActiveOutputChans = 0; - if (! maskedRegion.isEmpty()) + ASIOBufferInfo* info = bufferInfos; + int i; + for (i = 0; i < totalNumInputChans; ++i) { - for (RectangleList::Iterator i (maskedRegion); i.next();) + if (inputChannels[i]) { - const Rectangle& r = *i.getRectangle(); - ExcludeClipRect (hdc, r.getX(), r.getY(), r.getRight(), r.getBottom()); - } - } - - updateLayeredWindow (hwnd, 0, &pos, &size, hdc, &p, 0, &bf, ULW_ALPHA); - } - else - { - int savedDC = 0; + currentChansIn.setBit (i); + info->isInput = 1; + info->channelNum = i; + info->buffers[0] = info->buffers[1] = 0; + ++info; + ++numActiveInputChans; + } + } - if (! maskedRegion.isEmpty()) + for (i = 0; i < totalNumOutputChans; ++i) { - savedDC = SaveDC (dc); - - for (RectangleList::Iterator i (maskedRegion); i.next();) + if (outputChannels[i]) { - const Rectangle& r = *i.getRectangle(); - ExcludeClipRect (dc, r.getX(), r.getY(), r.getRight(), r.getBottom()); + currentChansOut.setBit (i); + info->isInput = 0; + info->channelNum = i; + info->buffers[0] = info->buffers[1] = 0; + ++info; + ++numActiveOutputChans; } } - const int w = getWidth(); - const int h = getHeight(); + const int totalBuffers = numActiveInputChans + numActiveOutputChans; - if (hdd == 0) + callbacks.sampleRateDidChange = &sampleRateChangedCallback; + + if (currentASIODev[0] == this) { - StretchDIBits (dc, - x, y, w, h, - 0, 0, w, h, - bitmapData, (const BITMAPINFO*) &bitmapInfo, - DIB_RGB_COLORS, SRCCOPY); + callbacks.bufferSwitch = &bufferSwitchCallback0; + callbacks.asioMessage = &asioMessagesCallback0; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback0; + } + else if (currentASIODev[1] == this) + { + callbacks.bufferSwitch = &bufferSwitchCallback1; + callbacks.asioMessage = &asioMessagesCallback1; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback1; + } + else if (currentASIODev[2] == this) + { + callbacks.bufferSwitch = &bufferSwitchCallback2; + callbacks.asioMessage = &asioMessagesCallback2; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback2; } else { - DrawDibDraw (hdd, dc, x, y, -1, -1, - (BITMAPINFOHEADER*) &bitmapInfo, bitmapData, - 0, 0, w, h, 0); + jassertfalse } - if (! maskedRegion.isEmpty()) - RestoreDC (dc, savedDC); - } - } - - juce_UseDebuggingNewOperator - -private: - WindowsBitmapImage (const WindowsBitmapImage&); - const WindowsBitmapImage& operator= (const WindowsBitmapImage&); -}; + log ("disposing buffers"); + err = asioObject->disposeBuffers(); -long improbableWindowNumber = 0xf965aa01; // also referenced by messaging.cpp + log (T("creating buffers: ") + String (totalBuffers) + T(", ") + String (currentBlockSizeSamples)); + err = asioObject->createBuffers (bufferInfos, + totalBuffers, + currentBlockSizeSamples, + &callbacks); -static int currentModifiers = 0; -static int modifiersAtLastCallback = 0; + if (err != 0) + { + currentBlockSizeSamples = preferredSize; + logError ("create buffers 2", err); -static void updateKeyModifiers() throw() -{ - currentModifiers &= ~(ModifierKeys::shiftModifier - | ModifierKeys::ctrlModifier - | ModifierKeys::altModifier); + asioObject->disposeBuffers(); + err = asioObject->createBuffers (bufferInfos, + totalBuffers, + currentBlockSizeSamples, + &callbacks); + } - if ((GetKeyState (VK_SHIFT) & 0x8000) != 0) - currentModifiers |= ModifierKeys::shiftModifier; + if (err == 0) + { + buffersCreated = true; - if ((GetKeyState (VK_CONTROL) & 0x8000) != 0) - currentModifiers |= ModifierKeys::ctrlModifier; + juce_free (tempBuffer); - if ((GetKeyState (VK_MENU) & 0x8000) != 0) - currentModifiers |= ModifierKeys::altModifier; + tempBuffer = (float*) juce_calloc (totalBuffers * currentBlockSizeSamples * sizeof (float) + 128); - if ((GetKeyState (VK_RMENU) & 0x8000) != 0) - currentModifiers &= ~(ModifierKeys::ctrlModifier | ModifierKeys::altModifier); -} + int n = 0; + Array types; + currentBitDepth = 16; -void ModifierKeys::updateCurrentModifiers() throw() -{ - currentModifierFlags = currentModifiers; -} + for (i = 0; i < jmin (totalNumInputChans, maxASIOChannels); ++i) + { + if (inputChannels[i]) + { + inBuffers[n] = tempBuffer + (currentBlockSizeSamples * n); -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() -{ - SHORT k = (SHORT) keyCode; + ASIOChannelInfo channelInfo; + zerostruct (channelInfo); - if ((keyCode & extendedKeyModifier) == 0 - && (k >= (SHORT) T('a') && k <= (SHORT) T('z'))) - k += (SHORT) T('A') - (SHORT) T('a'); + channelInfo.channel = i; + channelInfo.isInput = 1; + asioObject->getChannelInfo (&channelInfo); - const SHORT translatedValues[] = { (SHORT) ',', VK_OEM_COMMA, - (SHORT) '+', VK_OEM_PLUS, - (SHORT) '-', VK_OEM_MINUS, - (SHORT) '.', VK_OEM_PERIOD, - (SHORT) ';', VK_OEM_1, - (SHORT) ':', VK_OEM_1, - (SHORT) '/', VK_OEM_2, - (SHORT) '?', VK_OEM_2, - (SHORT) '[', VK_OEM_4, - (SHORT) ']', VK_OEM_6 }; + types.addIfNotAlreadyThere (channelInfo.type); + typeToFormatParameters (channelInfo.type, + inputChannelBitDepths[n], + inputChannelBytesPerSample[n], + inputChannelIsFloat[n], + inputChannelLittleEndian[n]); - for (int i = 0; i < numElementsInArray (translatedValues); i += 2) - if (k == translatedValues [i]) - k = translatedValues [i + 1]; + currentBitDepth = jmax (currentBitDepth, inputChannelBitDepths[n]); - return (GetKeyState (k) & 0x8000) != 0; -} + ++n; + } + } -const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() -{ - updateKeyModifiers(); + jassert (numActiveInputChans == n); + n = 0; - currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + for (i = 0; i < jmin (totalNumOutputChans, maxASIOChannels); ++i) + { + if (outputChannels[i]) + { + outBuffers[n] = tempBuffer + (currentBlockSizeSamples * (numActiveInputChans + n)); - if ((GetKeyState (VK_LBUTTON) & 0x8000) != 0) - currentModifiers |= ModifierKeys::leftButtonModifier; + ASIOChannelInfo channelInfo; + zerostruct (channelInfo); - if ((GetKeyState (VK_RBUTTON) & 0x8000) != 0) - currentModifiers |= ModifierKeys::rightButtonModifier; + channelInfo.channel = i; + channelInfo.isInput = 0; + asioObject->getChannelInfo (&channelInfo); - if ((GetKeyState (VK_MBUTTON) & 0x8000) != 0) - currentModifiers |= ModifierKeys::middleButtonModifier; + types.addIfNotAlreadyThere (channelInfo.type); + typeToFormatParameters (channelInfo.type, + outputChannelBitDepths[n], + outputChannelBytesPerSample[n], + outputChannelIsFloat[n], + outputChannelLittleEndian[n]); - return ModifierKeys (currentModifiers); -} + currentBitDepth = jmax (currentBitDepth, outputChannelBitDepths[n]); -static int64 getMouseEventTime() throw() -{ - static int64 eventTimeOffset = 0; - static DWORD lastMessageTime = 0; - const DWORD thisMessageTime = GetMessageTime(); + ++n; + } + } - if (thisMessageTime < lastMessageTime || lastMessageTime == 0) - { - lastMessageTime = thisMessageTime; - eventTimeOffset = Time::currentTimeMillis() - thisMessageTime; - } + jassert (numActiveOutputChans == n); - return eventTimeOffset + thisMessageTime; -} + for (i = types.size(); --i >= 0;) + { + log (T("channel format: ") + String (types[i])); + } -class Win32ComponentPeer : public ComponentPeer -{ -public: + jassert (n <= totalBuffers); - Win32ComponentPeer (Component* const component, - const int windowStyleFlags) - : ComponentPeer (component, windowStyleFlags), - dontRepaint (false), - fullScreen (false), - isDragging (false), - isMouseOver (false), - hasCreatedCaret (false), - currentWindowIcon (0), - taskBarIcon (0), - dropTarget (0) - { - MessageManager::getInstance() - ->callFunctionOnMessageThread (&createWindowCallback, (void*) this); + for (i = 0; i < numActiveOutputChans; ++i) + { + const int size = currentBlockSizeSamples * (outputChannelBitDepths[i] >> 3); - setTitle (component->getName()); + if (bufferInfos [numActiveInputChans + i].buffers[0] == 0 + || bufferInfos [numActiveInputChans + i].buffers[1] == 0) + { + log ("!! Null buffers"); + } + else + { + zeromem (bufferInfos[numActiveInputChans + i].buffers[0], size); + zeromem (bufferInfos[numActiveInputChans + i].buffers[1], size); + } + } - if ((windowStyleFlags & windowHasDropShadow) != 0 - && Desktop::canUseSemiTransparentWindows()) - { - shadower = component->getLookAndFeel().createDropShadowerForComponent (component); + inputLatency = outputLatency = 0; - if (shadower != 0) - shadower->setOwner (component); - } - else - { - shadower = 0; - } - } + if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0) + { + log ("ASIO - no latencies"); + } + else + { + log (T("ASIO latencies: ") + + String ((int) outputLatency) + + T(", ") + + String ((int) inputLatency)); + } - ~Win32ComponentPeer() - { - setTaskBarIcon (0); - deleteAndZero (shadower); + isOpen_ = true; - // do this before the next bit to avoid messages arriving for this window - // before it's destroyed - SetWindowLongPtr (hwnd, GWLP_USERDATA, 0); + log ("starting ASIO"); + calledback = false; + err = asioObject->start(); - MessageManager::getInstance() - ->callFunctionOnMessageThread (&destroyWindowCallback, (void*) hwnd); + if (err != 0) + { + isOpen_ = false; + log ("ASIO - stop on failure"); + Thread::sleep (10); + asioObject->stop(); + error = "Can't start device"; + Thread::sleep (10); + } + else + { + int count = 300; + while (--count > 0 && ! calledback) + Thread::sleep (10); - if (currentWindowIcon != 0) - DestroyIcon (currentWindowIcon); + isStarted = true; - if (dropTarget != 0) + if (! calledback) + { + error = "Device didn't start correctly"; + log ("ASIO didn't callback - stopping.."); + asioObject->stop(); + } + } + } + else + { + error = "Can't create i/o buffers"; + } + } + else { - dropTarget->Release(); - dropTarget = 0; + error = "Can't set sample rate: "; + error << sampleRate; } - } - - void* getNativeHandle() const - { - return (void*) hwnd; - } - void setVisible (bool shouldBeVisible) - { - ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); + if (error.isNotEmpty()) + { + logError (error, err); - if (shouldBeVisible) - InvalidateRect (hwnd, 0, 0); - else - lastPaintTime = 0; - } + if (asioObject != 0 && buffersCreated) + asioObject->disposeBuffers(); - void setTitle (const String& title) - { - SetWindowText (hwnd, title); - } + Thread::sleep (20); + isStarted = false; + isOpen_ = false; + close(); + } - void setPosition (int x, int y) - { - offsetWithinParent (x, y); - SetWindowPos (hwnd, 0, - x - windowBorder.getLeft(), - y - windowBorder.getTop(), - 0, 0, - SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); - } + needToReset = false; + isReSync = false; - void repaintNowIfTransparent() - { - if (isTransparent() && lastPaintTime > 0 && Time::getMillisecondCounter() > lastPaintTime + 30) - handlePaintMessage(); + return error; } - void updateBorderSize() + void close() { - WINDOWINFO info; - info.cbSize = sizeof (info); + error = String::empty; + stopTimer(); + stop(); - if (GetWindowInfo (hwnd, &info)) + if (isASIOOpen && isOpen_) { - windowBorder = BorderSize (info.rcClient.top - info.rcWindow.top, - info.rcClient.left - info.rcWindow.left, - info.rcWindow.bottom - info.rcClient.bottom, - info.rcWindow.right - info.rcClient.right); - } - } + const ScopedLock sl (callbackLock); - void setSize (int w, int h) - { - SetWindowPos (hwnd, 0, 0, 0, - w + windowBorder.getLeftAndRight(), - h + windowBorder.getTopAndBottom(), - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER); + isOpen_ = false; + isStarted = false; + needToReset = false; + isReSync = false; - updateBorderSize(); + log ("ASIO - stopping"); - repaintNowIfTransparent(); + if (asioObject != 0) + { + Thread::sleep (20); + asioObject->stop(); + Thread::sleep (10); + asioObject->disposeBuffers(); + } + + Thread::sleep (10); + } } - void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) + bool isOpen() { - fullScreen = isNowFullScreen; - offsetWithinParent (x, y); - - SetWindowPos (hwnd, 0, - x - windowBorder.getLeft(), - y - windowBorder.getTop(), - w + windowBorder.getLeftAndRight(), - h + windowBorder.getTopAndBottom(), - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); - - updateBorderSize(); - - repaintNowIfTransparent(); + return isOpen_ || insideControlPanelModalLoop; } - void getBounds (int& x, int& y, int& w, int& h) const + int getCurrentBufferSizeSamples() { - RECT r; - GetWindowRect (hwnd, &r); - - x = r.left; - y = r.top; - w = r.right - x; - h = r.bottom - y; - - HWND parentH = GetParent (hwnd); - if (parentH != 0) - { - GetWindowRect (parentH, &r); - x -= r.left; - y -= r.top; - } - - x += windowBorder.getLeft(); - y += windowBorder.getTop(); - w -= windowBorder.getLeftAndRight(); - h -= windowBorder.getTopAndBottom(); + return currentBlockSizeSamples; } - int getScreenX() const + double getCurrentSampleRate() { - RECT r; - GetWindowRect (hwnd, &r); - return r.left + windowBorder.getLeft(); + return currentSampleRate; } - int getScreenY() const + const BitArray getActiveOutputChannels() const { - RECT r; - GetWindowRect (hwnd, &r); - return r.top + windowBorder.getTop(); + return currentChansOut; } - void relativePositionToGlobal (int& x, int& y) + const BitArray getActiveInputChannels() const { - RECT r; - GetWindowRect (hwnd, &r); - - x += r.left + windowBorder.getLeft(); - y += r.top + windowBorder.getTop(); + return currentChansIn; } - void globalPositionToRelative (int& x, int& y) + int getCurrentBitDepth() { - RECT r; - GetWindowRect (hwnd, &r); - - x -= r.left + windowBorder.getLeft(); - y -= r.top + windowBorder.getTop(); + return currentBitDepth; } - void setMinimised (bool shouldBeMinimised) + int getOutputLatencyInSamples() { - if (shouldBeMinimised != isMinimised()) - ShowWindow (hwnd, shouldBeMinimised ? SW_MINIMIZE : SW_SHOWNORMAL); + return outputLatency + currentBlockSizeSamples / 4; } - bool isMinimised() const + int getInputLatencyInSamples() { - WINDOWPLACEMENT wp; - wp.length = sizeof (WINDOWPLACEMENT); - GetWindowPlacement (hwnd, &wp); - - return wp.showCmd == SW_SHOWMINIMIZED; + return inputLatency + currentBlockSizeSamples / 4; } - void setFullScreen (bool shouldBeFullScreen) + void start (AudioIODeviceCallback* callback) { - setMinimised (false); - - if (fullScreen != shouldBeFullScreen) + if (callback != 0) { - fullScreen = shouldBeFullScreen; - const ComponentDeletionWatcher deletionChecker (component); - - if (! fullScreen) - { - const Rectangle boundsCopy (lastNonFullscreenBounds); - - if (hasTitleBar()) - ShowWindow (hwnd, SW_SHOWNORMAL); - - if (! boundsCopy.isEmpty()) - { - setBounds (boundsCopy.getX(), - boundsCopy.getY(), - boundsCopy.getWidth(), - boundsCopy.getHeight(), - false); - } - } - else - { - if (hasTitleBar()) - ShowWindow (hwnd, SW_SHOWMAXIMIZED); - else - SendMessageW (hwnd, WM_SETTINGCHANGE, 0, 0); - } + callback->audioDeviceAboutToStart (this); - if (! deletionChecker.hasBeenDeleted()) - handleMovedOrResized(); + const ScopedLock sl (callbackLock); + currentCallback = callback; } } - bool isFullScreen() const + void stop() { - if (! hasTitleBar()) - return fullScreen; + AudioIODeviceCallback* const lastCallback = currentCallback; - WINDOWPLACEMENT wp; - wp.length = sizeof (wp); - GetWindowPlacement (hwnd, &wp); + { + const ScopedLock sl (callbackLock); + currentCallback = 0; + } - return wp.showCmd == SW_SHOWMAXIMIZED; + if (lastCallback != 0) + lastCallback->audioDeviceStopped(); } - bool contains (int x, int y, bool trueIfInAChildWindow) const + bool isPlaying() { - RECT r; - GetWindowRect (hwnd, &r); - - POINT p; - p.x = x + r.left + windowBorder.getLeft(); - p.y = y + r.top + windowBorder.getTop(); - - HWND w = WindowFromPoint (p); - - return w == hwnd || (trueIfInAChildWindow && (IsChild (hwnd, w) != 0)); + return isASIOOpen && (currentCallback != 0); } - const BorderSize getFrameSize() const + const String getLastError() { - return windowBorder; + return error; } - bool setAlwaysOnTop (bool alwaysOnTop) + bool hasControlPanel() const { - const bool oldDeactivate = shouldDeactivateTitleBar; - shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); - - SetWindowPos (hwnd, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - - shouldDeactivateTitleBar = oldDeactivate; - - if (shadower != 0) - shadower->componentBroughtToFront (*component); - return true; } - void toFront (bool makeActive) - { - setMinimised (false); - - const bool oldDeactivate = shouldDeactivateTitleBar; - shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); - - MessageManager::getInstance() - ->callFunctionOnMessageThread (makeActive ? &toFrontCallback1 - : &toFrontCallback2, - (void*) hwnd); - - shouldDeactivateTitleBar = oldDeactivate; - - if (! makeActive) - { - // in this case a broughttofront call won't have occured, so do it now.. - handleBroughtToFront(); - } - } - - void toBehind (ComponentPeer* other) + bool showControlPanel() { - Win32ComponentPeer* const otherPeer = dynamic_cast (other); + log ("ASIO - showing control panel"); - jassert (otherPeer != 0); // wrong type of window? + Component modalWindow (String::empty); + modalWindow.setOpaque (true); + modalWindow.addToDesktop (0); + modalWindow.enterModalState(); + bool done = false; - if (otherPeer != 0) + JUCE_TRY { - setMinimised (false); - - SetWindowPos (hwnd, otherPeer->hwnd, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - } - } + close(); + insideControlPanelModalLoop = true; - bool isFocused() const - { - return MessageManager::getInstance() - ->callFunctionOnMessageThread (&getFocusCallback, 0) == (void*) hwnd; - } + const uint32 started = Time::getMillisecondCounter(); - void grabFocus() - { - const bool oldDeactivate = shouldDeactivateTitleBar; - shouldDeactivateTitleBar = ((styleFlags & windowIsTemporary) == 0); + if (asioObject != 0) + { + asioObject->controlPanel(); - MessageManager::getInstance() - ->callFunctionOnMessageThread (&setFocusCallback, (void*) hwnd); + const int spent = (int) Time::getMillisecondCounter() - (int) started; - shouldDeactivateTitleBar = oldDeactivate; - } + log (T("spent: ") + String (spent)); - void textInputRequired (int /*x*/, int /*y*/) - { - if (! hasCreatedCaret) - { - hasCreatedCaret = true; - CreateCaret (hwnd, (HBITMAP) 1, 0, 0); + if (spent > 300) + { + shouldUsePreferredSize = true; + done = true; + } + } } + JUCE_CATCH_ALL - ShowCaret (hwnd); - SetCaretPos (0, 0); - } - - void repaint (int x, int y, int w, int h) - { - const RECT r = { x, y, x + w, y + h }; - InvalidateRect (hwnd, &r, FALSE); + insideControlPanelModalLoop = false; + return done; } - void performAnyPendingRepaintsNow() + void resetRequest() throw() { - MSG m; - if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE)) - DispatchMessage (&m); + needToReset = true; } - static Win32ComponentPeer* getOwnerOfWindow (HWND h) throw() + void resyncRequest() throw() { - if (h != 0 && GetWindowLongPtr (h, GWLP_USERDATA) == improbableWindowNumber) - return (Win32ComponentPeer*) GetWindowLongPtr (h, 8); - - return 0; + needToReset = true; + isReSync = true; } - void setTaskBarIcon (const Image* const image) + void timerCallback() { - if (image != 0) + if (! insideControlPanelModalLoop) { - HICON hicon = createHICONFromImage (*image, TRUE, 0, 0); + stopTimer(); - if (taskBarIcon == 0) - { - taskBarIcon = new NOTIFYICONDATA(); - taskBarIcon->cbSize = sizeof (NOTIFYICONDATA); - taskBarIcon->hWnd = (HWND) hwnd; - taskBarIcon->uID = (int) (pointer_sized_int) hwnd; - taskBarIcon->uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; - taskBarIcon->uCallbackMessage = WM_TRAYNOTIFY; - taskBarIcon->hIcon = hicon; - taskBarIcon->szTip[0] = 0; + // used to cause a reset + log ("! ASIO restart request!"); - Shell_NotifyIcon (NIM_ADD, taskBarIcon); - } - else + if (isOpen_) { - HICON oldIcon = taskBarIcon->hIcon; + AudioIODeviceCallback* const oldCallback = currentCallback; - taskBarIcon->hIcon = hicon; - taskBarIcon->uFlags = NIF_ICON; - Shell_NotifyIcon (NIM_MODIFY, taskBarIcon); + close(); + open (BitArray (currentChansIn), BitArray (currentChansOut), + currentSampleRate, currentBlockSizeSamples); - DestroyIcon (oldIcon); + if (oldCallback != 0) + start (oldCallback); } - - DestroyIcon (hicon); - } - else if (taskBarIcon != 0) - { - taskBarIcon->uFlags = 0; - Shell_NotifyIcon (NIM_DELETE, taskBarIcon); - DestroyIcon (taskBarIcon->hIcon); - deleteAndZero (taskBarIcon); } - } - - void setTaskBarIconToolTip (const String& toolTip) const - { - if (taskBarIcon != 0) + else { - taskBarIcon->uFlags = NIF_TIP; - toolTip.copyToBuffer (taskBarIcon->szTip, sizeof (taskBarIcon->szTip) - 1); - Shell_NotifyIcon (NIM_MODIFY, taskBarIcon); + startTimer (100); } } juce_UseDebuggingNewOperator - bool dontRepaint; - private: - HWND hwnd; - DropShadower* shadower; - bool fullScreen, isDragging, isMouseOver, hasCreatedCaret; - BorderSize windowBorder; - HICON currentWindowIcon; - NOTIFYICONDATA* taskBarIcon; - IDropTarget* dropTarget; - - class TemporaryImage : public Timer - { - public: - TemporaryImage() - : image (0) - { - } + IASIO* volatile asioObject; + ASIOCallbacks callbacks; - ~TemporaryImage() - { - delete image; - } + void* windowHandle; + CLSID classId; + String error; - WindowsBitmapImage* getImage (const bool transparent, const int w, const int h) throw() - { - const Image::PixelFormat format = transparent ? Image::ARGB : Image::RGB; + long totalNumInputChans, totalNumOutputChans; + StringArray inputChannelNames, outputChannelNames; - if (image == 0 || image->getWidth() < w || image->getHeight() < h || image->getFormat() != format) - { - delete image; - image = new WindowsBitmapImage (format, (w + 31) & ~31, (h + 31) & ~31, false); - } + Array sampleRates, bufferSizes; + long inputLatency, outputLatency; + long minSize, maxSize, preferredSize, granularity; - startTimer (3000); - return image; - } + int volatile currentBlockSizeSamples; + int volatile currentBitDepth; + double volatile currentSampleRate; + BitArray currentChansOut, currentChansIn; + AudioIODeviceCallback* volatile currentCallback; + CriticalSection callbackLock; - void timerCallback() - { - stopTimer(); - deleteAndZero (image); - } + ASIOBufferInfo bufferInfos [maxASIOChannels]; + float* inBuffers [maxASIOChannels]; + float* outBuffers [maxASIOChannels]; - private: - WindowsBitmapImage* image; + int inputChannelBitDepths [maxASIOChannels]; + int outputChannelBitDepths [maxASIOChannels]; + int inputChannelBytesPerSample [maxASIOChannels]; + int outputChannelBytesPerSample [maxASIOChannels]; + bool inputChannelIsFloat [maxASIOChannels]; + bool outputChannelIsFloat [maxASIOChannels]; + bool inputChannelLittleEndian [maxASIOChannels]; + bool outputChannelLittleEndian [maxASIOChannels]; - TemporaryImage (const TemporaryImage&); - const TemporaryImage& operator= (const TemporaryImage&); - }; + WaitableEvent event1; + float* tempBuffer; + int volatile bufferIndex, numActiveInputChans, numActiveOutputChans; - TemporaryImage offscreenImageGenerator; + bool isOpen_, isStarted; + bool volatile isASIOOpen; + bool volatile calledback; + bool volatile littleEndian, postOutput, needToReset, isReSync; + bool volatile insideControlPanelModalLoop; + bool volatile shouldUsePreferredSize; - class WindowClassHolder : public DeletedAtShutdown + void removeCurrentDriver() { - public: - WindowClassHolder() - : windowClassName ("JUCE_") + if (asioObject != 0) { - // this name has to be different for each app/dll instance because otherwise - // poor old Win32 can get a bit confused (even despite it not being a process-global - // window class). - windowClassName << (int) (Time::currentTimeMillis() & 0x7fffffff); - - HINSTANCE moduleHandle = (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(); - - TCHAR moduleFile [1024]; - moduleFile[0] = 0; - GetModuleFileName (moduleHandle, moduleFile, 1024); - WORD iconNum = 0; - - WNDCLASSEX wcex; - wcex.cbSize = sizeof (wcex); - wcex.style = CS_OWNDC; - wcex.lpfnWndProc = (WNDPROC) windowProc; - wcex.lpszClassName = windowClassName; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 32; - wcex.hInstance = moduleHandle; - wcex.hIcon = ExtractAssociatedIcon (moduleHandle, moduleFile, &iconNum); - iconNum = 1; - wcex.hIconSm = ExtractAssociatedIcon (moduleHandle, moduleFile, &iconNum); - wcex.hCursor = 0; - wcex.hbrBackground = 0; - wcex.lpszMenuName = 0; - - RegisterClassEx (&wcex); + asioObject->Release(); + asioObject = 0; } + } - ~WindowClassHolder() - { - if (ComponentPeer::getNumPeers() == 0) - UnregisterClass (windowClassName, (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle()); + bool loadDriver() + { + removeCurrentDriver(); - clearSingletonInstance(); + JUCE_TRY + { + if (CoCreateInstance (classId, 0, CLSCTX_INPROC_SERVER, + classId, (void**) &asioObject) == S_OK) + { + return true; + } } + JUCE_CATCH_ALL - String windowClassName; - - juce_DeclareSingleton_SingleThreaded_Minimal (WindowClassHolder); - }; + asioObject = 0; - static void* createWindowCallback (void* userData) - { - ((Win32ComponentPeer*) userData)->createWindow(); - return 0; + return false; } - void createWindow() + const String initDriver() { - DWORD exstyle = WS_EX_ACCEPTFILES; - DWORD type = WS_CLIPSIBLINGS | WS_CLIPCHILDREN; - - if (hasTitleBar()) + if (asioObject != 0) { - type |= WS_OVERLAPPED; - exstyle |= WS_EX_APPWINDOW; + char buffer [256]; + zeromem (buffer, sizeof (buffer)); - if ((styleFlags & windowHasCloseButton) != 0) - { - type |= WS_SYSMENU; - } - else + if (! asioObject->init (windowHandle)) { - // annoyingly, windows won't let you have a min/max button without a close button - jassert ((styleFlags & (windowHasMinimiseButton | windowHasMaximiseButton)) == 0); + asioObject->getErrorMessage (buffer); + return String (buffer, sizeof (buffer) - 1); } - if ((styleFlags & windowIsResizable) != 0) - type |= WS_THICKFRAME; - } - else - { - type |= WS_POPUP | WS_SYSMENU; + // just in case any daft drivers expect this to be called.. + asioObject->getDriverName (buffer); - if ((styleFlags & windowAppearsOnTaskbar) == 0) - exstyle |= WS_EX_TOOLWINDOW; - else - exstyle |= WS_EX_APPWINDOW; + return String::empty; } - if ((styleFlags & windowHasMinimiseButton) != 0) - type |= WS_MINIMIZEBOX; - - if ((styleFlags & windowHasMaximiseButton) != 0) - type |= WS_MAXIMIZEBOX; - - if ((styleFlags & windowIgnoresMouseClicks) != 0) - exstyle |= WS_EX_TRANSPARENT; + return "No Driver"; + } - if ((styleFlags & windowIsSemiTransparent) != 0 - && Desktop::canUseSemiTransparentWindows()) - exstyle |= WS_EX_LAYERED; + const String openDevice() + { + // use this in case the driver starts opening dialog boxes.. + Component modalWindow (String::empty); + modalWindow.setOpaque (true); + modalWindow.addToDesktop (0); + modalWindow.enterModalState(); - hwnd = CreateWindowEx (exstyle, WindowClassHolder::getInstance()->windowClassName, L"", type, 0, 0, 0, 0, 0, 0, 0, 0); + // open the device and get its info.. + log (T("opening ASIO device: ") + getName()); - if (hwnd != 0) - { - SetWindowLongPtr (hwnd, 0, 0); - SetWindowLongPtr (hwnd, 8, (LONG_PTR) this); - SetWindowLongPtr (hwnd, GWLP_USERDATA, improbableWindowNumber); + needToReset = false; + isReSync = false; + outputChannelNames.clear(); + inputChannelNames.clear(); + bufferSizes.clear(); + sampleRates.clear(); + isASIOOpen = false; + isOpen_ = false; + totalNumInputChans = 0; + totalNumOutputChans = 0; + numActiveInputChans = 0; + numActiveOutputChans = 0; + currentCallback = 0; - if (dropTarget == 0) - dropTarget = new JuceDropTarget (this); + error = String::empty; - RegisterDragDrop (hwnd, dropTarget); + if (getName().isEmpty()) + return error; - updateBorderSize(); + long err = 0; - // Calling this function here is (for some reason) necessary to make Windows - // correctly enable the menu items that we specify in the wm_initmenu message. - GetSystemMenu (hwnd, false); - } - else + if (loadDriver()) { - jassertfalse - } - } - - static void* destroyWindowCallback (void* handle) - { - RevokeDragDrop ((HWND) handle); - DestroyWindow ((HWND) handle); - return 0; - } - - static void* toFrontCallback1 (void* h) - { - SetForegroundWindow ((HWND) h); - return 0; - } - - static void* toFrontCallback2 (void* h) - { - SetWindowPos ((HWND) h, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - return 0; - } + if ((error = initDriver()).isEmpty()) + { + numActiveInputChans = 0; + numActiveOutputChans = 0; + totalNumInputChans = 0; + totalNumOutputChans = 0; - static void* setFocusCallback (void* h) - { - SetFocus ((HWND) h); - return 0; - } + if (asioObject != 0 + && (err = asioObject->getChannels (&totalNumInputChans, &totalNumOutputChans)) == 0) + { + log (String ((int) totalNumInputChans) + T(" in, ") + String ((int) totalNumOutputChans) + T(" out")); - static void* getFocusCallback (void*) - { - return (void*) GetFocus(); - } + if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) + { + // find a list of buffer sizes.. + log (String ((int) minSize) + T(" ") + String ((int) maxSize) + T(" ") + String ((int)preferredSize) + T(" ") + String ((int)granularity)); - void offsetWithinParent (int& x, int& y) const - { - if (isTransparent()) - { - HWND parentHwnd = GetParent (hwnd); + if (granularity >= 0) + { + granularity = jmax (1, (int) granularity); - if (parentHwnd != 0) - { - RECT parentRect; - GetWindowRect (parentHwnd, &parentRect); - x += parentRect.left; - y += parentRect.top; - } - } - } + for (int i = jmax (minSize, (int) granularity); i < jmin (6400, maxSize); i += granularity) + bufferSizes.addIfNotAlreadyThere (granularity * (i / granularity)); + } + else if (granularity < 0) + { + for (int i = 0; i < 18; ++i) + { + const int s = (1 << i); - bool isTransparent() const - { - return (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0; - } + if (s >= minSize && s <= maxSize) + bufferSizes.add (s); + } + } - inline bool hasTitleBar() const throw() { return (styleFlags & windowHasTitleBar) != 0; } + if (! bufferSizes.contains (preferredSize)) + bufferSizes.insert (0, preferredSize); - void setIcon (const Image& newIcon) - { - HICON hicon = createHICONFromImage (newIcon, TRUE, 0, 0); + double currentRate = 0; + asioObject->getSampleRate (¤tRate); - if (hicon != 0) - { - SendMessage (hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon); - SendMessage (hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon); + if (currentRate <= 0.0 || currentRate > 192001.0) + { + log ("setting sample rate"); + err = asioObject->setSampleRate (44100.0); + if (err != 0) + { + logError ("setting sample rate", err); + } - if (currentWindowIcon != 0) - DestroyIcon (currentWindowIcon); + asioObject->getSampleRate (¤tRate); + } - currentWindowIcon = hicon; - } - } + currentSampleRate = currentRate; - void handlePaintMessage() - { -#if DEBUG_REPAINT_TIMES - const double paintStart = Time::getMillisecondCounterHiRes(); -#endif - HRGN rgn = CreateRectRgn (0, 0, 0, 0); - const int regionType = GetUpdateRgn (hwnd, rgn, false); + postOutput = (asioObject->outputReady() == 0); + if (postOutput) + { + log ("ASIO outputReady = ok"); + } - PAINTSTRUCT paintStruct; - HDC dc = BeginPaint (hwnd, &paintStruct); // Note this can immediately generate a WM_NCPAINT - // message and become re-entrant, but that's OK + updateSampleRates(); - // if something in a paint handler calls, e.g. a message box, this can become reentrant and - // corrupt the image it's using to paint into, so do a check here. - static bool reentrant = false; - if (reentrant) - { - DeleteObject (rgn); - EndPaint (hwnd, &paintStruct); - return; - } + // ..because cubase does it at this point + inputLatency = outputLatency = 0; + if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0) + { + log ("ASIO - no latencies"); + } - reentrant = true; + log (String ("latencies: ") + + String ((int) inputLatency) + + T(", ") + String ((int) outputLatency)); - // this is the rectangle to update.. - int x = paintStruct.rcPaint.left; - int y = paintStruct.rcPaint.top; - int w = paintStruct.rcPaint.right - x; - int h = paintStruct.rcPaint.bottom - y; + // create some dummy buffers now.. because cubase does.. + numActiveInputChans = 0; + numActiveOutputChans = 0; - const bool transparent = isTransparent(); + ASIOBufferInfo* info = bufferInfos; + int i, numChans = 0; + for (i = 0; i < jmin (2, totalNumInputChans); ++i) + { + info->isInput = 1; + info->channelNum = i; + info->buffers[0] = info->buffers[1] = 0; + ++info; + ++numChans; + } - if (transparent) - { - // it's not possible to have a transparent window with a title bar at the moment! - jassert (! hasTitleBar()); + const int outputBufferIndex = numChans; - RECT r; - GetWindowRect (hwnd, &r); - x = y = 0; - w = r.right - r.left; - h = r.bottom - r.top; - } + for (i = 0; i < jmin (2, totalNumOutputChans); ++i) + { + info->isInput = 0; + info->channelNum = i; + info->buffers[0] = info->buffers[1] = 0; + ++info; + ++numChans; + } - if (w > 0 && h > 0) - { - clearMaskedRegion(); + callbacks.sampleRateDidChange = &sampleRateChangedCallback; - WindowsBitmapImage* const offscreenImage = offscreenImageGenerator.getImage (transparent, w, h); + if (currentASIODev[0] == this) + { + callbacks.bufferSwitch = &bufferSwitchCallback0; + callbacks.asioMessage = &asioMessagesCallback0; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback0; + } + else if (currentASIODev[1] == this) + { + callbacks.bufferSwitch = &bufferSwitchCallback1; + callbacks.asioMessage = &asioMessagesCallback1; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback1; + } + else if (currentASIODev[2] == this) + { + callbacks.bufferSwitch = &bufferSwitchCallback2; + callbacks.asioMessage = &asioMessagesCallback2; + callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback2; + } + else + { + jassertfalse + } - LowLevelGraphicsSoftwareRenderer context (*offscreenImage); + log (T("creating buffers (dummy): ") + String (numChans) + + T(", ") + String ((int) preferredSize)); - RectangleList* const contextClip = context.getRawClipRegion(); - contextClip->clear(); + if (preferredSize > 0) + { + err = asioObject->createBuffers (bufferInfos, numChans, preferredSize, &callbacks); + if (err != 0) + { + logError ("dummy buffers", err); + } + } - context.setOrigin (-x, -y); + long newInps = 0, newOuts = 0; + asioObject->getChannels (&newInps, &newOuts); - bool needToPaintAll = true; + if (totalNumInputChans != newInps || totalNumOutputChans != newOuts) + { + totalNumInputChans = newInps; + totalNumOutputChans = newOuts; - if (regionType == COMPLEXREGION && ! transparent) - { - HRGN clipRgn = CreateRectRgnIndirect (&paintStruct.rcPaint); - CombineRgn (rgn, rgn, clipRgn, RGN_AND); - DeleteObject (clipRgn); + log (String ((int) totalNumInputChans) + T(" in; ") + + String ((int) totalNumOutputChans) + T(" out")); + } - char rgnData [8192]; - const DWORD res = GetRegionData (rgn, sizeof (rgnData), (RGNDATA*) rgnData); + updateSampleRates(); - if (res > 0 && res <= sizeof (rgnData)) - { - const RGNDATAHEADER* const hdr = &(((const RGNDATA*) rgnData)->rdh); + ASIOChannelInfo channelInfo; + channelInfo.type = 0; - if (hdr->iType == RDH_RECTANGLES - && hdr->rcBound.right - hdr->rcBound.left >= w - && hdr->rcBound.bottom - hdr->rcBound.top >= h) - { - needToPaintAll = false; + for (i = 0; i < totalNumInputChans; ++i) + { + zerostruct (channelInfo); + channelInfo.channel = i; + channelInfo.isInput = 1; + asioObject->getChannelInfo (&channelInfo); - const RECT* rects = (const RECT*) (rgnData + sizeof (RGNDATAHEADER)); - int num = ((RGNDATA*) rgnData)->rdh.nCount; + inputChannelNames.add (String (channelInfo.name)); + } - while (--num >= 0) + for (i = 0; i < totalNumOutputChans; ++i) { - // (need to move this one pixel to the left because of a win32 bug) - const int cx = jmax (x, rects->left - 1); - const int cy = rects->top; - const int cw = rects->right - cx; - const int ch = rects->bottom - rects->top; + zerostruct (channelInfo); + channelInfo.channel = i; + channelInfo.isInput = 0; + asioObject->getChannelInfo (&channelInfo); - if (cx + cw - x <= w && cy + ch - y <= h) - { - contextClip->addWithoutMerging (Rectangle (cx - x, cy - y, cw, ch)); - } - else + outputChannelNames.add (String (channelInfo.name)); + + typeToFormatParameters (channelInfo.type, + outputChannelBitDepths[i], + outputChannelBytesPerSample[i], + outputChannelIsFloat[i], + outputChannelLittleEndian[i]); + + if (i < 2) { - needToPaintAll = true; - break; + // clear the channels that are used with the dummy stuff + const int bytesPerBuffer = preferredSize * (outputChannelBitDepths[i] >> 3); + zeromem (bufferInfos [outputBufferIndex + i].buffers[0], bytesPerBuffer); + zeromem (bufferInfos [outputBufferIndex + i].buffers[1], bytesPerBuffer); } - - ++rects; } - } - } - } - if (needToPaintAll) - { - contextClip->clear(); - contextClip->addWithoutMerging (Rectangle (0, 0, w, h)); - } + outputChannelNames.trim(); + inputChannelNames.trim(); + outputChannelNames.appendNumbersToDuplicates (false, true); + inputChannelNames.appendNumbersToDuplicates (false, true); - if (transparent) - { - RectangleList::Iterator i (*contextClip); + // start and stop because cubase does it.. + asioObject->getLatencies (&inputLatency, &outputLatency); - while (i.next()) + if ((err = asioObject->start()) != 0) + { + // ignore an error here, as it might start later after setting other stuff up + logError ("ASIO start", err); + } + + Thread::sleep (100); + asioObject->stop(); + } + else + { + error = "Can't detect buffer sizes"; + } + } + else { - const Rectangle& r = *i.getRectangle(); - offscreenImage->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); + error = "Can't detect asio channels"; } } + } + else + { + error = "No such device"; + } - // if the component's not opaque, this won't draw properly unless the platform can support this - jassert (Desktop::canUseSemiTransparentWindows() || component->isOpaque()); - - updateCurrentModifiers(); + if (error.isNotEmpty()) + { + logError (error, err); - handlePaint (context); + if (asioObject != 0) + asioObject->disposeBuffers(); - if (! dontRepaint) - offscreenImage->blitToWindow (hwnd, dc, transparent, x, y, maskedRegion); + removeCurrentDriver(); + isASIOOpen = false; + } + else + { + isASIOOpen = true; + log ("ASIO device open"); } - DeleteObject (rgn); - EndPaint (hwnd, &paintStruct); - reentrant = false; + isOpen_ = false; + needToReset = false; + isReSync = false; -#ifndef JUCE_GCC //xxx should add this fn for gcc.. - _fpreset(); // because some graphics cards can unmask FP exceptions -#endif + return error; + } - lastPaintTime = Time::getMillisecondCounter(); + void callback (const long index) throw() + { + if (isStarted) + { + bufferIndex = index; + processBuffer(); + } + else + { + if (postOutput && (asioObject != 0)) + asioObject->outputReady(); + } -#if DEBUG_REPAINT_TIMES - const double elapsed = Time::getMillisecondCounterHiRes() - paintStart; - Logger::outputDebugString (T("repaint time: ") + String (elapsed, 2)); -#endif + calledback = true; } - void doMouseMove (const int x, const int y) + void processBuffer() throw() { - static uint32 lastMouseTime = 0; - // this can be set to throttle the mouse-messages to less than a - // certain number per second, as things can get unresponsive - // if each drag or move callback has to do a lot of work. - const int maxMouseMovesPerSecond = 60; + const ASIOBufferInfo* const infos = bufferInfos; + const int bi = bufferIndex; - const int64 mouseEventTime = getMouseEventTime(); + const ScopedLock sl (callbackLock); - if (! isMouseOver) + if (needToReset) { - isMouseOver = true; - - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof (tme); - tme.dwFlags = TME_LEAVE; - tme.hwndTrack = hwnd; - tme.dwHoverTime = 0; + needToReset = false; - if (! TrackMouseEvent (&tme)) + if (isReSync) { - jassertfalse; + log ("! ASIO resync"); + isReSync = false; } - - updateKeyModifiers(); - handleMouseEnter (x, y, mouseEventTime); - } - else if (! isDragging) - { - if (((unsigned int) x) < (unsigned int) component->getWidth() - && ((unsigned int) y) < (unsigned int) component->getHeight()) + else { - RECT r; - GetWindowRect (hwnd, &r); - - POINT p; - p.x = x + r.left + windowBorder.getLeft(); - p.y = y + r.top + windowBorder.getTop(); - - if (WindowFromPoint (p) == hwnd) - { - const uint32 now = Time::getMillisecondCounter(); - - if (now > lastMouseTime + 1000 / maxMouseMovesPerSecond) - { - lastMouseTime = now; - handleMouseMove (x, y, mouseEventTime); - } - } + startTimer (20); } } - else + + if (bi >= 0) { - const uint32 now = Time::getMillisecondCounter(); + const int samps = currentBlockSizeSamples; - if (now > lastMouseTime + 1000 / maxMouseMovesPerSecond) + if (currentCallback != 0) { - lastMouseTime = now; - handleMouseDrag (x, y, mouseEventTime); - } - } - } - - void doMouseDown (const int x, const int y, const WPARAM wParam) - { - if (GetCapture() != hwnd) - SetCapture (hwnd); - - doMouseMove (x, y); - - currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + int i; + for (i = 0; i < numActiveInputChans; ++i) + { + float* const dst = inBuffers[i]; - if ((wParam & MK_LBUTTON) != 0) - currentModifiers |= ModifierKeys::leftButtonModifier; + jassert (dst != 0); - if ((wParam & MK_RBUTTON) != 0) - currentModifiers |= ModifierKeys::rightButtonModifier; + const char* const src = (const char*) (infos[i].buffers[bi]); - if ((wParam & MK_MBUTTON) != 0) - currentModifiers |= ModifierKeys::middleButtonModifier; + if (inputChannelIsFloat[i]) + { + memcpy (dst, src, samps * sizeof (float)); + } + else + { + jassert (dst == tempBuffer + (samps * i)); - updateKeyModifiers(); - isDragging = true; + switch (inputChannelBitDepths[i]) + { + case 16: + convertInt16ToFloat (src, dst, inputChannelBytesPerSample[i], + samps, inputChannelLittleEndian[i]); + break; - handleMouseDown (x, y, getMouseEventTime()); - } + case 24: + convertInt24ToFloat (src, dst, inputChannelBytesPerSample[i], + samps, inputChannelLittleEndian[i]); + break; - void doMouseUp (const int x, const int y, const WPARAM wParam) - { - int numButtons = 0; + case 32: + convertInt32ToFloat (src, dst, inputChannelBytesPerSample[i], + samps, inputChannelLittleEndian[i]); + break; - if ((wParam & MK_LBUTTON) != 0) - ++numButtons; + case 64: + jassertfalse + break; + } + } + } - if ((wParam & MK_RBUTTON) != 0) - ++numButtons; + currentCallback->audioDeviceIOCallback ((const float**) inBuffers, + numActiveInputChans, + outBuffers, + numActiveOutputChans, + samps); - if ((wParam & MK_MBUTTON) != 0) - ++numButtons; + for (i = 0; i < numActiveOutputChans; ++i) + { + float* const src = outBuffers[i]; - const int oldModifiers = currentModifiers; + jassert (src != 0); - // update the currentmodifiers only after the callback, so the callback - // knows which button was released. - currentModifiers &= ~ModifierKeys::allMouseButtonModifiers; + char* const dst = (char*) (infos [numActiveInputChans + i].buffers[bi]); - if ((wParam & MK_LBUTTON) != 0) - currentModifiers |= ModifierKeys::leftButtonModifier; + if (outputChannelIsFloat[i]) + { + memcpy (dst, src, samps * sizeof (float)); + } + else + { + jassert (src == tempBuffer + (samps * (numActiveInputChans + i))); - if ((wParam & MK_RBUTTON) != 0) - currentModifiers |= ModifierKeys::rightButtonModifier; + switch (outputChannelBitDepths[i]) + { + case 16: + convertFloatToInt16 (src, dst, outputChannelBytesPerSample[i], + samps, outputChannelLittleEndian[i]); + break; - if ((wParam & MK_MBUTTON) != 0) - currentModifiers |= ModifierKeys::middleButtonModifier; + case 24: + convertFloatToInt24 (src, dst, outputChannelBytesPerSample[i], + samps, outputChannelLittleEndian[i]); + break; - updateKeyModifiers(); - isDragging = false; + case 32: + convertFloatToInt32 (src, dst, outputChannelBytesPerSample[i], + samps, outputChannelLittleEndian[i]); + break; - // release the mouse capture if the user's not still got a button down - if (numButtons == 0 && hwnd == GetCapture()) - ReleaseCapture(); + case 64: + jassertfalse + break; + } + } + } + } + else + { + for (int i = 0; i < numActiveOutputChans; ++i) + { + const int bytesPerBuffer = samps * (outputChannelBitDepths[i] >> 3); + zeromem (infos[numActiveInputChans + i].buffers[bi], bytesPerBuffer); + } + } + } - handleMouseUp (oldModifiers, x, y, getMouseEventTime()); + if (postOutput) + asioObject->outputReady(); } - void doCaptureChanged() + static ASIOTime* bufferSwitchTimeInfoCallback0 (ASIOTime*, long index, long) throw() { - if (isDragging) - { - RECT wr; - GetWindowRect (hwnd, &wr); - - const DWORD mp = GetMessagePos(); + if (currentASIODev[0] != 0) + currentASIODev[0]->callback (index); - doMouseUp (GET_X_LPARAM (mp) - wr.left - windowBorder.getLeft(), - GET_Y_LPARAM (mp) - wr.top - windowBorder.getTop(), - getMouseEventTime()); - } + return 0; } - void doMouseExit() + static ASIOTime* bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) throw() { - if (isMouseOver) - { - isMouseOver = false; - RECT wr; - GetWindowRect (hwnd, &wr); - - const DWORD mp = GetMessagePos(); + if (currentASIODev[1] != 0) + currentASIODev[1]->callback (index); - handleMouseExit (GET_X_LPARAM (mp) - wr.left - windowBorder.getLeft(), - GET_Y_LPARAM (mp) - wr.top - windowBorder.getTop(), - getMouseEventTime()); - } + return 0; } - void doMouseWheel (const WPARAM wParam, const bool isVertical) + static ASIOTime* bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) throw() { - updateKeyModifiers(); + if (currentASIODev[2] != 0) + currentASIODev[2]->callback (index); - const int amount = jlimit (-1000, 1000, (int) (0.75f * (short) HIWORD (wParam))); + return 0; + } - handleMouseWheel (isVertical ? 0 : amount, - isVertical ? amount : 0, - getMouseEventTime()); + static void bufferSwitchCallback0 (long index, long) throw() + { + if (currentASIODev[0] != 0) + currentASIODev[0]->callback (index); } - void sendModifierKeyChangeIfNeeded() + static void bufferSwitchCallback1 (long index, long) throw() { - if (modifiersAtLastCallback != currentModifiers) - { - modifiersAtLastCallback = currentModifiers; - handleModifierKeysChange(); - } + if (currentASIODev[1] != 0) + currentASIODev[1]->callback (index); } - bool doKeyUp (const WPARAM key) + static void bufferSwitchCallback2 (long index, long) throw() { - updateKeyModifiers(); + if (currentASIODev[2] != 0) + currentASIODev[2]->callback (index); + } - switch (key) - { - case VK_SHIFT: - case VK_CONTROL: - case VK_MENU: - case VK_CAPITAL: - case VK_LWIN: - case VK_RWIN: - case VK_APPS: - case VK_NUMLOCK: - case VK_SCROLL: - case VK_LSHIFT: - case VK_RSHIFT: - case VK_LCONTROL: - case VK_LMENU: - case VK_RCONTROL: - case VK_RMENU: - sendModifierKeyChangeIfNeeded(); - } + static long asioMessagesCallback0 (long selector, long value, void*, double*) throw() + { + return asioMessagesCallback (selector, value, 0); + } - return handleKeyUpOrDown(); + static long asioMessagesCallback1 (long selector, long value, void*, double*) throw() + { + return asioMessagesCallback (selector, value, 1); } - bool doKeyDown (const WPARAM key) + static long asioMessagesCallback2 (long selector, long value, void*, double*) throw() { - updateKeyModifiers(); - bool used = false; + return asioMessagesCallback (selector, value, 2); + } - switch (key) + static long asioMessagesCallback (long selector, long value, const int deviceIndex) throw() + { + switch (selector) { - case VK_SHIFT: - case VK_LSHIFT: - case VK_RSHIFT: - case VK_CONTROL: - case VK_LCONTROL: - case VK_RCONTROL: - case VK_MENU: - case VK_LMENU: - case VK_RMENU: - case VK_LWIN: - case VK_RWIN: - case VK_CAPITAL: - case VK_NUMLOCK: - case VK_SCROLL: - case VK_APPS: - sendModifierKeyChangeIfNeeded(); - break; + case kAsioSelectorSupported: + if (value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + || value == kAsioSupportsInputMonitor) + return 1; + break; - case VK_LEFT: - case VK_RIGHT: - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_HOME: - case VK_END: - case VK_DELETE: - case VK_INSERT: - case VK_F1: - case VK_F2: - case VK_F3: - case VK_F4: - case VK_F5: - case VK_F6: - case VK_F7: - case VK_F8: - case VK_F9: - case VK_F10: - case VK_F11: - case VK_F12: - case VK_F13: - case VK_F14: - case VK_F15: - case VK_F16: - used = handleKeyUpOrDown(); - used = handleKeyPress (extendedKeyModifier | (int) key, 0) || used; - break; + case kAsioBufferSizeChange: + break; - case VK_ADD: - case VK_SUBTRACT: - case VK_MULTIPLY: - case VK_DIVIDE: - case VK_SEPARATOR: - case VK_DECIMAL: - used = handleKeyUpOrDown(); - break; + case kAsioResetRequest: + if (currentASIODev[deviceIndex] != 0) + currentASIODev[deviceIndex]->resetRequest(); - default: - used = handleKeyUpOrDown(); + return 1; - { - MSG msg; + case kAsioResyncRequest: + if (currentASIODev[deviceIndex] != 0) + currentASIODev[deviceIndex]->resyncRequest(); - if (! PeekMessage (&msg, hwnd, WM_CHAR, WM_DEADCHAR, PM_NOREMOVE)) - { - // if there isn't a WM_CHAR or WM_DEADCHAR message pending, we need to - // manually generate the key-press event that matches this key-down. + return 1; - const UINT keyChar = MapVirtualKey (key, 2); - used = handleKeyPress ((int) LOWORD (keyChar), 0) || used; - } - } + case kAsioLatenciesChanged: + return 1; - break; + case kAsioEngineVersion: + return 2; + + case kAsioSupportsTimeInfo: + case kAsioSupportsTimeCode: + return 0; } - return used; + return 0; } - bool doKeyChar (int key, const LPARAM flags) + static void sampleRateChangedCallback (ASIOSampleRate) throw() { - updateKeyModifiers(); - - juce_wchar textChar = (juce_wchar) key; + } - const int virtualScanCode = (flags >> 16) & 0xff; + static void convertInt16ToFloat (const char* src, + float* dest, + const int srcStrideBytes, + int numSamples, + const bool littleEndian) throw() + { + const double g = 1.0 / 32768.0; - if (key >= '0' && key <= '9') + if (littleEndian) { - switch (virtualScanCode) // check for a numeric keypad scan-code + while (--numSamples >= 0) { - case 0x52: - case 0x4f: - case 0x50: - case 0x51: - case 0x4b: - case 0x4c: - case 0x4d: - case 0x47: - case 0x48: - case 0x49: - key = (key - '0') + KeyPress::numberPad0; - break; - default: - break; + *dest++ = (float) (g * (short) littleEndianShort (src)); + src += srcStrideBytes; } } else { - // convert the scan code to an unmodified character code.. - const UINT virtualKey = MapVirtualKey (virtualScanCode, 1); - UINT keyChar = MapVirtualKey (virtualKey, 2); - - keyChar = LOWORD (keyChar); - - if (keyChar != 0) - key = (int) keyChar; - - // avoid sending junk text characters for some control-key combinations - if (textChar < ' ' && (currentModifiers & (ModifierKeys::ctrlModifier | ModifierKeys::altModifier)) != 0) - textChar = 0; + while (--numSamples >= 0) + { + *dest++ = (float) (g * (short) bigEndianShort (src)); + src += srcStrideBytes; + } } - - return handleKeyPress (key, textChar); } - bool doAppCommand (const LPARAM lParam) + static void convertFloatToInt16 (const float* src, + char* dest, + const int dstStrideBytes, + int numSamples, + const bool littleEndian) throw() { - int key = 0; + const double maxVal = (double) 0x7fff; - switch (GET_APPCOMMAND_LPARAM (lParam)) + if (littleEndian) { - case APPCOMMAND_MEDIA_PLAY_PAUSE: - key = KeyPress::playKey; - break; - - case APPCOMMAND_MEDIA_STOP: - key = KeyPress::stopKey; - break; - - case APPCOMMAND_MEDIA_NEXTTRACK: - key = KeyPress::fastForwardKey; - break; - - case APPCOMMAND_MEDIA_PREVIOUSTRACK: - key = KeyPress::rewindKey; - break; + while (--numSamples >= 0) + { + *(uint16*) dest = swapIfBigEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); + dest += dstStrideBytes; + } } - - if (key != 0) + else { - updateKeyModifiers(); - - if (hwnd == GetActiveWindow()) + while (--numSamples >= 0) { - handleKeyPress (key, 0); - return true; + *(uint16*) dest = swapIfLittleEndian ((uint16) (short) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); + dest += dstStrideBytes; } } - - return false; } - class JuceDropTarget : public IDropTarget + static void convertInt24ToFloat (const char* src, + float* dest, + const int srcStrideBytes, + int numSamples, + const bool littleEndian) throw() { - public: - JuceDropTarget (Win32ComponentPeer* const owner_) - : owner (owner_), - refCount (1) - { - } - - virtual ~JuceDropTarget() - { - jassert (refCount == 0); - } + const double g = 1.0 / 0x7fffff; - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + if (littleEndian) { - if (id == IID_IUnknown || id == IID_IDropTarget) + while (--numSamples >= 0) { - AddRef(); - *result = this; - return S_OK; + *dest++ = (float) (g * littleEndian24Bit (src)); + src += srcStrideBytes; } - - *result = 0; - return E_NOINTERFACE; } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + else { - updateFileList (pDataObject); - int x = mousePos.x, y = mousePos.y; - owner->globalPositionToRelative (x, y); - owner->handleFileDragMove (files, x, y); - *pdwEffect = DROPEFFECT_COPY; - return S_OK; + while (--numSamples >= 0) + { + *dest++ = (float) (g * bigEndian24Bit (src)); + src += srcStrideBytes; + } } + } - HRESULT __stdcall DragLeave() - { - owner->handleFileDragExit (files); - return S_OK; - } + static void convertFloatToInt24 (const float* src, + char* dest, + const int dstStrideBytes, + int numSamples, + const bool littleEndian) throw() + { + const double maxVal = (double) 0x7fffff; - HRESULT __stdcall DragOver (DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + if (littleEndian) { - int x = mousePos.x, y = mousePos.y; - owner->globalPositionToRelative (x, y); - owner->handleFileDragMove (files, x, y); - *pdwEffect = DROPEFFECT_COPY; - return S_OK; + while (--numSamples >= 0) + { + littleEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest); + dest += dstStrideBytes; + } } - - HRESULT __stdcall Drop (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect) + else { - updateFileList (pDataObject); - int x = mousePos.x, y = mousePos.y; - owner->globalPositionToRelative (x, y); - owner->handleFileDragDrop (files, x, y); - *pdwEffect = DROPEFFECT_COPY; - return S_OK; + while (--numSamples >= 0) + { + bigEndian24BitToChars ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++)), dest); + dest += dstStrideBytes; + } } + } - private: - Win32ComponentPeer* const owner; - int refCount; - StringArray files; + static void convertInt32ToFloat (const char* src, + float* dest, + const int srcStrideBytes, + int numSamples, + const bool littleEndian) throw() + { + const double g = 1.0 / 0x7fffffff; - void updateFileList (IDataObject* const pDataObject) + if (littleEndian) { - files.clear(); - - FORMATETC format = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; - STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; - - if (pDataObject->GetData (&format, &medium) == S_OK) + while (--numSamples >= 0) { - const SIZE_T totalLen = GlobalSize (medium.hGlobal); - const LPDROPFILES pDropFiles = (const LPDROPFILES) GlobalLock (medium.hGlobal); - unsigned int i = 0; - - if (pDropFiles->fWide) - { - const WCHAR* const fname = (WCHAR*) (((const char*) pDropFiles) + sizeof (DROPFILES)); - - for (;;) - { - unsigned int len = 0; - while (i + len < totalLen && fname [i + len] != 0) - ++len; - - if (len == 0) - break; - - files.add (String (fname + i, len)); - i += len + 1; - } - } - else - { - const char* const fname = ((const char*) pDropFiles) + sizeof (DROPFILES); - - for (;;) - { - unsigned int len = 0; - while (i + len < totalLen && fname [i + len] != 0) - ++len; - - if (len == 0) - break; - - files.add (String (fname + i, len)); - i += len + 1; - } - } - - GlobalUnlock (medium.hGlobal); + *dest++ = (float) (g * (int) littleEndianInt (src)); + src += srcStrideBytes; } } - - JuceDropTarget (const JuceDropTarget&); - const JuceDropTarget& operator= (const JuceDropTarget&); - }; - - void doSettingChange() - { - Desktop::getInstance().refreshMonitorSizes(); - - if (fullScreen && ! isMinimised()) + else { - const Rectangle r (component->getParentMonitorArea()); - - SetWindowPos (hwnd, 0, - r.getX(), r.getY(), r.getWidth(), r.getHeight(), - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSENDCHANGING); + while (--numSamples >= 0) + { + *dest++ = (float) (g * (int) bigEndianInt (src)); + src += srcStrideBytes; + } } } -public: - static LRESULT CALLBACK windowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) - { - Win32ComponentPeer* const peer = getOwnerOfWindow (h); - - if (peer != 0) - return peer->peerWindowProc (h, message, wParam, lParam); - - return DefWindowProc (h, message, wParam, lParam); - } - -private: - LRESULT peerWindowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) + static void convertFloatToInt32 (const float* src, + char* dest, + const int dstStrideBytes, + int numSamples, + const bool littleEndian) throw() { - { - const MessageManagerLock messLock; - - if (isValidPeer (this)) - { - switch (message) - { - case WM_NCHITTEST: - if (hasTitleBar()) - break; - - return HTCLIENT; - - case WM_PAINT: - handlePaintMessage(); - return 0; - - case WM_NCPAINT: - if (wParam != 1) - handlePaintMessage(); - - if (hasTitleBar()) - break; - - return 0; - - case WM_ERASEBKGND: - case WM_NCCALCSIZE: - if (hasTitleBar()) - break; - - return 1; - - case WM_MOUSEMOVE: - doMouseMove (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam)); - return 0; - - case WM_MOUSELEAVE: - doMouseExit(); - return 0; - - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - doMouseDown (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); - return 0; - - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - doMouseUp (GET_X_LPARAM (lParam), GET_Y_LPARAM (lParam), wParam); - return 0; - - case WM_CAPTURECHANGED: - doCaptureChanged(); - return 0; - - case WM_NCMOUSEMOVE: - if (hasTitleBar()) - break; - - return 0; - - case 0x020A: /* WM_MOUSEWHEEL */ - doMouseWheel (wParam, true); - return 0; - - case 0x020E: /* WM_MOUSEHWHEEL */ - doMouseWheel (wParam, false); - return 0; + const double maxVal = (double) 0x7fffffff; - case WM_WINDOWPOSCHANGING: - if ((styleFlags & (windowHasTitleBar | windowIsResizable)) == (windowHasTitleBar | windowIsResizable)) - { - WINDOWPOS* const wp = (WINDOWPOS*) lParam; + if (littleEndian) + { + while (--numSamples >= 0) + { + *(uint32*) dest = swapIfBigEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); + dest += dstStrideBytes; + } + } + else + { + while (--numSamples >= 0) + { + *(uint32*) dest = swapIfLittleEndian ((uint32) roundDoubleToInt (jlimit (-maxVal, maxVal, maxVal * *src++))); + dest += dstStrideBytes; + } + } + } - if ((wp->flags & (SWP_NOMOVE | SWP_NOSIZE)) != (SWP_NOMOVE | SWP_NOSIZE)) - { - if (constrainer != 0) - { - const Rectangle current (component->getX() - windowBorder.getLeft(), - component->getY() - windowBorder.getTop(), - component->getWidth() + windowBorder.getLeftAndRight(), - component->getHeight() + windowBorder.getTopAndBottom()); + static void typeToFormatParameters (const long type, + int& bitDepth, + int& byteStride, + bool& formatIsFloat, + bool& littleEndian) throw() + { + bitDepth = 0; + littleEndian = false; + formatIsFloat = false; - constrainer->checkBounds (wp->x, wp->y, wp->cx, wp->cy, - current, - Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), - wp->y != current.getY() && wp->y + wp->cy == current.getBottom(), - wp->x != current.getX() && wp->x + wp->cx == current.getRight(), - wp->y == current.getY() && wp->y + wp->cy != current.getBottom(), - wp->x == current.getX() && wp->x + wp->cx != current.getRight()); - } - } - } + switch (type) + { + case ASIOSTInt16MSB: + case ASIOSTInt16LSB: + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + bitDepth = 16; break; - return 0; + case ASIOSTFloat32MSB: + case ASIOSTFloat32LSB: + formatIsFloat = true; + bitDepth = 32; break; - case WM_WINDOWPOSCHANGED: - handleMovedOrResized(); + case ASIOSTInt32MSB: + case ASIOSTInt32LSB: + bitDepth = 32; break; - if (dontRepaint) - break; // needed for non-accelerated openGL windows to draw themselves correctly.. - else - return 0; + case ASIOSTInt24MSB: + case ASIOSTInt24LSB: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB24: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + bitDepth = 24; break; - case WM_KEYDOWN: - case WM_SYSKEYDOWN: - if (doKeyDown (wParam)) - return 0; + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + default: + bitDepth = 64; + break; + } - break; + switch (type) + { + case ASIOSTInt16MSB: + case ASIOSTInt32MSB16: + case ASIOSTFloat32MSB: + case ASIOSTFloat64MSB: + case ASIOSTInt32MSB: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt24MSB: + littleEndian = false; break; - case WM_KEYUP: - case WM_SYSKEYUP: - if (doKeyUp (wParam)) - return 0; + case ASIOSTInt16LSB: + case ASIOSTInt32LSB16: + case ASIOSTFloat32LSB: + case ASIOSTFloat64LSB: + case ASIOSTInt32LSB: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + case ASIOSTInt24LSB: + littleEndian = true; break; - break; + default: + break; + } - case WM_CHAR: - if (doKeyChar ((int) wParam, lParam)) - return 0; + switch (type) + { + case ASIOSTInt16LSB: + case ASIOSTInt16MSB: + byteStride = 2; break; - break; + case ASIOSTInt24LSB: + case ASIOSTInt24MSB: + byteStride = 3; break; - case WM_APPCOMMAND: - if (doAppCommand (lParam)) - return TRUE; + case ASIOSTInt32MSB16: + case ASIOSTInt32LSB16: + case ASIOSTInt32MSB: + case ASIOSTInt32MSB18: + case ASIOSTInt32MSB20: + case ASIOSTInt32MSB24: + case ASIOSTInt32LSB: + case ASIOSTInt32LSB18: + case ASIOSTInt32LSB20: + case ASIOSTInt32LSB24: + case ASIOSTFloat32LSB: + case ASIOSTFloat32MSB: + byteStride = 4; break; - break; + case ASIOSTFloat64MSB: + case ASIOSTFloat64LSB: + byteStride = 8; break; - case WM_SETFOCUS: - updateKeyModifiers(); - handleFocusGain(); - break; + default: + break; + } + } +}; - case WM_KILLFOCUS: - if (hasCreatedCaret) - { - hasCreatedCaret = false; - DestroyCaret(); - } +class ASIOAudioIODeviceType : public AudioIODeviceType +{ +public: + ASIOAudioIODeviceType() + : AudioIODeviceType (T("ASIO")), + classIds (2), + hasScanned (false) + { + CoInitialize (0); + } - handleFocusLoss(); - break; + ~ASIOAudioIODeviceType() + { + } - case WM_ACTIVATEAPP: - // Windows does weird things to process priority when you swap apps, - // so this forces an update when the app is brought to the front - if (wParam != FALSE) - juce_repeatLastProcessPriority(); + void scanForDevices() + { + hasScanned = true; - juce_CheckCurrentlyFocusedTopLevelWindow(); - modifiersAtLastCallback = -1; - return 0; + deviceNames.clear(); + classIds.clear(); - case WM_ACTIVATE: - if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE) - { - modifiersAtLastCallback = -1; - updateKeyModifiers(); + HKEY hk = 0; + int index = 0; - if (isMinimised()) - { - component->repaint(); - handleMovedOrResized(); + if (RegOpenKeyA (HKEY_LOCAL_MACHINE, "software\\asio", &hk) == ERROR_SUCCESS) + { + for (;;) + { + char name [256]; - if (! isValidMessageListener()) - return 0; - } + if (RegEnumKeyA (hk, index++, name, 256) == ERROR_SUCCESS) + { + addDriverInfo (name, hk); + } + else + { + break; + } + } - if (LOWORD (wParam) == WA_CLICKACTIVE - && component->isCurrentlyBlockedByAnotherModalComponent()) - { - int mx, my; - component->getMouseXYRelative (mx, my); - Component* const underMouse = component->getComponentAt (mx, my); + RegCloseKey (hk); + } + } - if (underMouse != 0 && underMouse->isCurrentlyBlockedByAnotherModalComponent()) - Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); + const StringArray getDeviceNames (const bool /*wantInputNames*/) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this - return 0; - } + return deviceNames; + } - handleBroughtToFront(); - return 0; - } + int getDefaultDeviceIndex (const bool) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this - break; + for (int i = deviceNames.size(); --i >= 0;) + if (deviceNames[i].containsIgnoreCase (T("asio4all"))) + return i; // asio4all is a safe choice for a default.. - case WM_NCACTIVATE: - // while a temporary window is being shown, prevent Windows from deactivating the - // title bars of our main windows. - if (wParam == 0 && ! shouldDeactivateTitleBar) - wParam = TRUE; // change this and let it get passed to the DefWindowProc. +#if JUCE_DEBUG + if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase (T("digidesign"))) + return 1; // (the digi m-box driver crashes the app when you run + // it in the debugger, which can be a bit annoying) +#endif - break; + return 0; + } - case WM_MOUSEACTIVATE: - if (! component->getMouseClickGrabsKeyboardFocus()) - return MA_NOACTIVATE; + static int findFreeSlot() + { + for (int i = 0; i < numElementsInArray (currentASIODev); ++i) + if (currentASIODev[i] == 0) + return i; - break; + jassertfalse; // unfortunately you can only have a finite number + // of ASIO devices open at the same time.. + return -1; + } - case WM_SHOWWINDOW: - if (wParam != 0) - handleBroughtToFront(); + int getIndexOfDevice (AudioIODevice* d, const bool /*asInput*/) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this - break; + return d == 0 ? -1 : deviceNames.indexOf (d->getName()); + } - case WM_CLOSE: - handleUserClosingWindow(); - return 0; + bool hasSeparateInputsAndOutputs() const { return false; } - case WM_QUIT: - JUCEApplication::quit(); - return 0; + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) + { + jassert (inputDeviceName == outputDeviceName); + (void) inputDeviceName; + jassert (hasScanned); // need to call scanForDevices() before doing this - case WM_TRAYNOTIFY: - if (component->isCurrentlyBlockedByAnotherModalComponent()) - { - if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN - || lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) - { - Component* const current = Component::getCurrentlyModalComponent(); + const int index = deviceNames.indexOf (outputDeviceName); - if (current != 0) - current->inputAttemptWhenModal(); - } - } - else - { - const int oldModifiers = currentModifiers; + if (index >= 0) + { + const int freeSlot = findFreeSlot(); - MouseEvent e (0, 0, ModifierKeys::getCurrentModifiersRealtime(), component, - getMouseEventTime(), 0, 0, getMouseEventTime(), 1, false); + if (freeSlot >= 0) + return new ASIOAudioIODevice (outputDeviceName, *(classIds [index]), freeSlot); + } - if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) - e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::leftButtonModifier); - else if (lParam == WM_RBUTTONDOWN || lParam == WM_RBUTTONDBLCLK) - e.mods = ModifierKeys (e.mods.getRawFlags() | ModifierKeys::rightButtonModifier); + return 0; + } - if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN) - { - SetFocus (hwnd); - SetForegroundWindow (hwnd); + juce_UseDebuggingNewOperator - component->mouseDown (e); - } - else if (lParam == WM_LBUTTONUP || lParam == WM_RBUTTONUP) - { - e.mods = ModifierKeys (oldModifiers); - component->mouseUp (e); - } - else if (lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) - { - e.mods = ModifierKeys (oldModifiers); - component->mouseDoubleClick (e); - } - else if (lParam == WM_MOUSEMOVE) - { - component->mouseMove (e); - } - } +private: + StringArray deviceNames; + OwnedArray classIds; - break; + bool hasScanned; - case WM_SYNCPAINT: - return 0; + static bool checkClassIsOk (const String& classId) + { + HKEY hk = 0; + bool ok = false; - case WM_PALETTECHANGED: - InvalidateRect (h, 0, 0); - break; + if (RegOpenKeyA (HKEY_CLASSES_ROOT, "clsid", &hk) == ERROR_SUCCESS) + { + int index = 0; - case WM_DISPLAYCHANGE: - InvalidateRect (h, 0, 0); - createPaletteIfNeeded = true; - // intentional fall-through... - case WM_SETTINGCHANGE: // note the fall-through in the previous case! - doSettingChange(); - break; + for (;;) + { + char buf [512]; - case WM_INITMENU: - if (! hasTitleBar()) - { - if (isFullScreen()) - { - EnableMenuItem ((HMENU) wParam, SC_RESTORE, MF_BYCOMMAND | MF_ENABLED); - EnableMenuItem ((HMENU) wParam, SC_MOVE, MF_BYCOMMAND | MF_GRAYED); - } - else if (! isMinimised()) - { - EnableMenuItem ((HMENU) wParam, SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED); - } - } - break; + if (RegEnumKeyA (hk, index++, buf, 512) == ERROR_SUCCESS) + { + if (classId.equalsIgnoreCase (buf)) + { + HKEY subKey, pathKey; - case WM_SYSCOMMAND: - switch (wParam & 0xfff0) + if (RegOpenKeyExA (hk, buf, 0, KEY_READ, &subKey) == ERROR_SUCCESS) { - case SC_CLOSE: - if (hasTitleBar()) + if (RegOpenKeyExA (subKey, "InprocServer32", 0, KEY_READ, &pathKey) == ERROR_SUCCESS) { - PostMessage (h, WM_CLOSE, 0, 0); - return 0; - } - break; - - case SC_KEYMENU: - if (hasTitleBar() && h == GetCapture()) - ReleaseCapture(); - - break; + char pathName [600]; + DWORD dtype = REG_SZ; + DWORD dsize = sizeof (pathName); - case SC_MAXIMIZE: - setFullScreen (true); - return 0; + if (RegQueryValueExA (pathKey, 0, 0, &dtype, + (LPBYTE) pathName, &dsize) == ERROR_SUCCESS) + { + OFSTRUCT of; + zerostruct (of); - case SC_MINIMIZE: - if (! hasTitleBar()) - { - setMinimised (true); - return 0; - } - break; + of.cBytes = sizeof (of); - case SC_RESTORE: - if (hasTitleBar()) - { - if (isFullScreen()) - { - setFullScreen (false); - return 0; + ok = (OpenFile (String (pathName), &of, OF_EXIST) != 0); } - } - else - { - if (isMinimised()) - setMinimised (false); - else if (isFullScreen()) - setFullScreen (false); - return 0; + RegCloseKey (pathKey); } - break; - - case SC_MONITORPOWER: - case SC_SCREENSAVE: - if (! screenSaverAllowed) - return 0; - - break; + RegCloseKey (subKey); } break; + } + } + else + { + break; + } + } - case WM_NCLBUTTONDOWN: - case WM_NCRBUTTONDOWN: - case WM_NCMBUTTONDOWN: - if (component->isCurrentlyBlockedByAnotherModalComponent()) - { - Component* const current = Component::getCurrentlyModalComponent(); + RegCloseKey (hk); + } - if (current != 0) - current->inputAttemptWhenModal(); - } + return ok; + } - break; + void addDriverInfo (const String& keyName, HKEY hk) + { + HKEY subKey; - //case WM_IME_STARTCOMPOSITION; - // return 0; + if (RegOpenKeyExA (hk, keyName, 0, KEY_READ, &subKey) == ERROR_SUCCESS) + { + char buf [256]; + DWORD dtype = REG_SZ; + DWORD dsize = sizeof (buf); + zeromem (buf, dsize); - case WM_GETDLGCODE: - return DLGC_WANTALLKEYS; + if (RegQueryValueExA (subKey, "clsid", 0, &dtype, (LPBYTE) buf, &dsize) == ERROR_SUCCESS) + { + if (dsize > 0 && checkClassIsOk (buf)) + { + wchar_t classIdStr [130]; + MultiByteToWideChar (CP_ACP, 0, buf, -1, classIdStr, 128); - default: - break; + String deviceName; + CLSID classId; + + if (CLSIDFromString ((LPOLESTR) classIdStr, &classId) == S_OK) + { + dtype = REG_SZ; + dsize = sizeof (buf); + + if (RegQueryValueExA (subKey, "description", 0, &dtype, (LPBYTE) buf, &dsize) == ERROR_SUCCESS) + deviceName = buf; + else + deviceName = keyName; + + log (T("found ") + deviceName); + deviceNames.add (deviceName); + classIds.add (new CLSID (classId)); + } } + + RegCloseKey (subKey); } } - - // (the message manager lock exits before calling this, to avoid deadlocks if - // this calls into non-juce windows) - return DefWindowProc (h, message, wParam, lParam); } - Win32ComponentPeer (const Win32ComponentPeer&); - const Win32ComponentPeer& operator= (const Win32ComponentPeer&); + ASIOAudioIODeviceType (const ASIOAudioIODeviceType&); + const ASIOAudioIODeviceType& operator= (const ASIOAudioIODeviceType&); }; -ComponentPeer* Component::createNewPeer (int styleFlags, void* /*nativeWindowToAttachTo*/) +AudioIODeviceType* juce_createASIOAudioIODeviceType() { - return new Win32ComponentPeer (this, styleFlags); + return new ASIOAudioIODeviceType(); } -juce_ImplementSingleton_SingleThreaded (Win32ComponentPeer::WindowClassHolder); - -void SystemTrayIconComponent::setIconImage (const Image& newImage) +AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, + void* guid) { - Win32ComponentPeer* const wp = dynamic_cast (getPeer()); - - if (wp != 0) - wp->setTaskBarIcon (&newImage); -} + const int freeSlot = ASIOAudioIODeviceType::findFreeSlot(); -void SystemTrayIconComponent::setIconTooltip (const String& tooltip) -{ - Win32ComponentPeer* const wp = dynamic_cast (getPeer()); + if (freeSlot < 0) + return 0; - if (wp != 0) - wp->setTaskBarIconToolTip (tooltip); + return new ASIOAudioIODevice (name, *(CLSID*) guid, freeSlot); } -void juce_setWindowStyleBit (HWND h, const int styleType, const int feature, const bool bitIsSet) throw() -{ - DWORD val = GetWindowLong (h, styleType); +#undef log - if (bitIsSet) - val |= feature; - else - val &= ~feature; +#endif +/********* End of inlined file: juce_win32_ASIO.cpp *********/ - SetWindowLongPtr (h, styleType, val); - SetWindowPos (h, 0, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER - | SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING); -} +/********* Start of inlined file: juce_win32_DirectSound.cpp *********/ +// (This file gets included by juce_win32_NativeCode.cpp, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE -bool Process::isForegroundProcess() throw() -{ - HWND fg = GetForegroundWindow(); +END_JUCE_NAMESPACE - if (fg == 0) - return true; +extern "C" +{ - DWORD processId = 0; - GetWindowThreadProcessId (fg, &processId); +// Declare just the minimum number of interfaces for the DSound objects that we need.. +typedef struct typeDSBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; + GUID guid3DAlgorithm; +} DSBUFFERDESC; - return processId == GetCurrentProcessId(); -} +struct IDirectSoundBuffer; -void Desktop::getMousePosition (int& x, int& y) throw() +#undef INTERFACE +#define INTERFACE IDirectSound +DECLARE_INTERFACE_(IDirectSound, IUnknown) { - POINT mousePos; - GetCursorPos (&mousePos); - x = mousePos.x; - y = mousePos.y; -} + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(CreateSoundBuffer) (THIS_ DSBUFFERDESC*, IDirectSoundBuffer**, LPUNKNOWN) PURE; + STDMETHOD(GetCaps) (THIS_ void*) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ IDirectSoundBuffer*, IDirectSoundBuffer**) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE; + STDMETHOD(Initialize) (THIS_ const GUID*) PURE; +}; -void Desktop::setMousePosition (int x, int y) throw() +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer +DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) { - SetCursorPos (x, y); -} + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(GetCaps) (THIS_ void*) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE; + STDMETHOD(GetVolume) (THIS_ LPLONG) PURE; + STDMETHOD(GetPan) (THIS_ LPLONG) PURE; + STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ IDirectSound*, DSBUFFERDESC*) PURE; + STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID*, LPDWORD, LPVOID*, LPDWORD, DWORD) PURE; + STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE; + STDMETHOD(SetFormat) (THIS_ const WAVEFORMATEX*) PURE; + STDMETHOD(SetVolume) (THIS_ LONG) PURE; + STDMETHOD(SetPan) (THIS_ LONG) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(Restore) (THIS) PURE; +}; -void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() +typedef struct typeDSCBUFFERDESC { - screenSaverAllowed = isEnabled; -} + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSCBUFFERDESC; -bool Desktop::isScreenSaverEnabled() throw() +struct IDirectSoundCaptureBuffer; + +#undef INTERFACE +#define INTERFACE IDirectSoundCapture +DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) { - return screenSaverAllowed; -} + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(CreateCaptureBuffer) (THIS_ DSCBUFFERDESC*, IDirectSoundCaptureBuffer**, LPUNKNOWN) PURE; + STDMETHOD(GetCaps) (THIS_ void*) PURE; + STDMETHOD(Initialize) (THIS_ const GUID*) PURE; +}; -static BOOL CALLBACK enumMonitorsProc (HMONITOR, HDC, LPRECT r, LPARAM userInfo) +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) { - Array * const monitorCoords = (Array *) userInfo; + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(GetCaps) (THIS_ void*) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ IDirectSoundCapture*, DSCBUFFERDESC*) PURE; + STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID*, LPDWORD, LPVOID*, LPDWORD, DWORD) PURE; + STDMETHOD(Start) (THIS_ DWORD) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; +}; - monitorCoords->add (Rectangle (r->left, r->top, r->right - r->left, r->bottom - r->top)); +}; - return TRUE; -} +BEGIN_JUCE_NAMESPACE -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() +static const String getDSErrorMessage (HRESULT hr) { - EnumDisplayMonitors (0, 0, &enumMonitorsProc, (LPARAM) &monitorCoords); - - // make sure the first in the list is the main monitor - for (int i = 1; i < monitorCoords.size(); ++i) - if (monitorCoords[i].getX() == 0 && monitorCoords[i].getY() == 0) - monitorCoords.swap (i, 0); + const char* result = 0; - if (monitorCoords.size() == 0) + switch (hr) { - RECT r; - GetWindowRect (GetDesktopWindow(), &r); + case MAKE_HRESULT(1, 0x878, 10): + result = "Device already allocated"; + break; + case MAKE_HRESULT(1, 0x878, 30): + result = "Control unavailable"; + break; + case E_INVALIDARG: + result = "Invalid parameter"; + break; + case MAKE_HRESULT(1, 0x878, 50): + result = "Invalid call"; + break; + case E_FAIL: + result = "Generic error"; + break; + case MAKE_HRESULT(1, 0x878, 70): + result = "Priority level error"; + break; + case E_OUTOFMEMORY: + result = "Out of memory"; + break; + case MAKE_HRESULT(1, 0x878, 100): + result = "Bad format"; + break; + case E_NOTIMPL: + result = "Unsupported function"; + break; + case MAKE_HRESULT(1, 0x878, 120): + result = "No driver"; + break; + case MAKE_HRESULT(1, 0x878, 130): + result = "Already initialised"; + break; + case CLASS_E_NOAGGREGATION: + result = "No aggregation"; + break; + case MAKE_HRESULT(1, 0x878, 150): + result = "Buffer lost"; + break; + case MAKE_HRESULT(1, 0x878, 160): + result = "Another app has priority"; + break; + case MAKE_HRESULT(1, 0x878, 170): + result = "Uninitialised"; + break; + case E_NOINTERFACE: + result = "No interface"; + break; + case S_OK: + result = "No error"; + break; - monitorCoords.add (Rectangle (r.left, r.top, r.right - r.left, r.bottom - r.top)); + default: + return "Unknown error: " + String ((int) hr); } - if (clipToWorkArea) - { - // clip the main monitor to the active non-taskbar area - RECT r; - SystemParametersInfo (SPI_GETWORKAREA, 0, &r, 0); - - Rectangle& screen = monitorCoords.getReference (0); - - screen.setPosition (jmax (screen.getX(), r.left), - jmax (screen.getY(), r.top)); - - screen.setSize (jmin (screen.getRight(), r.right) - screen.getX(), - jmin (screen.getBottom(), r.bottom) - screen.getY()); - } + return result; } -static Image* createImageFromHBITMAP (HBITMAP bitmap) throw() -{ - Image* im = 0; +#define DS_DEBUGGING 1 - if (bitmap != 0) - { - BITMAP bm; +#ifdef DS_DEBUGGING + #define CATCH JUCE_CATCH_EXCEPTION + #undef log + #define log(a) Logger::writeToLog(a); + #undef logError + #define logError(a) logDSError(a, __LINE__); - if (GetObject (bitmap, sizeof (BITMAP), &bm) - && bm.bmWidth > 0 && bm.bmHeight > 0) + static void logDSError (HRESULT hr, int lineNum) + { + if (hr != S_OK) { - HDC tempDC = GetDC (0); - HDC dc = CreateCompatibleDC (tempDC); - ReleaseDC (0, tempDC); - - SelectObject (dc, bitmap); - - im = new Image (Image::ARGB, bm.bmWidth, bm.bmHeight, true); - - for (int y = bm.bmHeight; --y >= 0;) - { - for (int x = bm.bmWidth; --x >= 0;) - { - COLORREF col = GetPixel (dc, x, y); - - im->setPixelAt (x, y, Colour ((uint8) GetRValue (col), - (uint8) GetGValue (col), - (uint8) GetBValue (col))); - } - } - - DeleteDC (dc); + String error ("DS error at line "); + error << lineNum << T(" - ") << getDSErrorMessage (hr); + log (error); } } +#else + #define CATCH JUCE_CATCH_ALL + #define log(a) + #define logError(a) +#endif - return im; -} - -static Image* createImageFromHICON (HICON icon) throw() -{ - ICONINFO info; - - if (GetIconInfo (icon, &info)) - { - Image* const mask = createImageFromHBITMAP (info.hbmMask); - - if (mask == 0) - return 0; +#define DSOUND_FUNCTION(functionName, params) \ + typedef HRESULT (WINAPI *type##functionName) params; \ + static type##functionName ds##functionName = 0; - Image* const image = createImageFromHBITMAP (info.hbmColor); +#define DSOUND_FUNCTION_LOAD(functionName) \ + ds##functionName = (type##functionName) GetProcAddress (h, #functionName); \ + jassert (ds##functionName != 0); - if (image == 0) - return mask; +typedef BOOL (CALLBACK *LPDSENUMCALLBACKW) (LPGUID, LPCWSTR, LPCWSTR, LPVOID); +typedef BOOL (CALLBACK *LPDSENUMCALLBACKA) (LPGUID, LPCSTR, LPCSTR, LPVOID); - for (int y = image->getHeight(); --y >= 0;) - { - for (int x = image->getWidth(); --x >= 0;) - { - const float brightness = mask->getPixelAt (x, y).getBrightness(); +DSOUND_FUNCTION (DirectSoundCreate, (const GUID*, IDirectSound**, LPUNKNOWN)) +DSOUND_FUNCTION (DirectSoundCaptureCreate, (const GUID*, IDirectSoundCapture**, LPUNKNOWN)) +DSOUND_FUNCTION (DirectSoundEnumerateW, (LPDSENUMCALLBACKW, LPVOID)) +DSOUND_FUNCTION (DirectSoundCaptureEnumerateW, (LPDSENUMCALLBACKW, LPVOID)) - if (brightness > 0.0f) - image->multiplyAlphaAt (x, y, 1.0f - brightness); - } - } +static void initialiseDSoundFunctions() +{ + if (dsDirectSoundCreate == 0) + { + HMODULE h = LoadLibraryA ("dsound.dll"); - delete mask; - return image; + DSOUND_FUNCTION_LOAD (DirectSoundCreate) + DSOUND_FUNCTION_LOAD (DirectSoundCaptureCreate) + DSOUND_FUNCTION_LOAD (DirectSoundEnumerateW) + DSOUND_FUNCTION_LOAD (DirectSoundCaptureEnumerateW) } - - return 0; } -static HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY) throw() +class DSoundInternalOutChannel { - HBITMAP mask = CreateBitmap (image.getWidth(), image.getHeight(), 1, 1, 0); + String name; + LPGUID guid; + int sampleRate, bufferSizeSamples; + float* leftBuffer; + float* rightBuffer; - ICONINFO info; - info.fIcon = isIcon; - info.xHotspot = hotspotX; - info.yHotspot = hotspotY; - info.hbmMask = mask; - HICON hi = 0; + IDirectSound* pDirectSound; + IDirectSoundBuffer* pOutputBuffer; + DWORD writeOffset; + int totalBytesPerBuffer; + int bytesPerBuffer; + unsigned int lastPlayCursor; - if (SystemStats::getOperatingSystemType() >= SystemStats::WinXP) - { - WindowsBitmapImage bitmap (Image::ARGB, image.getWidth(), image.getHeight(), true); - Graphics g (bitmap); - g.drawImageAt (&image, 0, 0); +public: + int bitDepth; + bool doneFlag; - info.hbmColor = bitmap.hBitmap; - hi = CreateIconIndirect (&info); + DSoundInternalOutChannel (const String& name_, + LPGUID guid_, + int rate, + int bufferSize, + float* left, + float* right) + : name (name_), + guid (guid_), + sampleRate (rate), + bufferSizeSamples (bufferSize), + leftBuffer (left), + rightBuffer (right), + pDirectSound (0), + pOutputBuffer (0), + bitDepth (16) + { } - else + + ~DSoundInternalOutChannel() { - HBITMAP colour = CreateCompatibleBitmap (GetDC (0), image.getWidth(), image.getHeight()); + close(); + } - HDC colDC = CreateCompatibleDC (GetDC (0)); - HDC alphaDC = CreateCompatibleDC (GetDC (0)); - SelectObject (colDC, colour); - SelectObject (alphaDC, mask); + void close() + { + HRESULT hr; - for (int y = image.getHeight(); --y >= 0;) + if (pOutputBuffer != 0) { - for (int x = image.getWidth(); --x >= 0;) + JUCE_TRY { - const Colour c (image.getPixelAt (x, y)); + log (T("closing dsound out: ") + name); + hr = pOutputBuffer->Stop(); + logError (hr); + } + CATCH - SetPixel (colDC, x, y, COLORREF (c.getRed() | (c.getGreen() << 8) | (c.getBlue() << 16))); - SetPixel (alphaDC, x, y, COLORREF (0xffffff - (c.getAlpha() | (c.getAlpha() << 8) | (c.getAlpha() << 16)))); + JUCE_TRY + { + hr = pOutputBuffer->Release(); + logError (hr); } + CATCH + + pOutputBuffer = 0; } - DeleteDC (colDC); - DeleteDC (alphaDC); + if (pDirectSound != 0) + { + JUCE_TRY + { + hr = pDirectSound->Release(); + logError (hr); + } + CATCH - info.hbmColor = colour; - hi = CreateIconIndirect (&info); - DeleteObject (colour); + pDirectSound = 0; + } } - DeleteObject (mask); - return hi; -} + const String open() + { + log (T("opening dsound out device: ") + name + + T(" rate=") + String (sampleRate) + + T(" bits=") + String (bitDepth) + + T(" buf=") + String (bufferSizeSamples)); -Image* juce_createIconForFile (const File& file) -{ - Image* image = 0; + pDirectSound = 0; + pOutputBuffer = 0; + writeOffset = 0; - TCHAR filename [1024]; - file.getFullPathName().copyToBuffer (filename, 1023); - WORD iconNum = 0; + String error; + HRESULT hr = E_NOINTERFACE; - HICON icon = ExtractAssociatedIcon ((HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(), - filename, &iconNum); + if (dsDirectSoundCreate != 0) + hr = dsDirectSoundCreate (guid, &pDirectSound, 0); - if (icon != 0) - { - image = createImageFromHICON (icon); - DestroyIcon (icon); - } + if (hr == S_OK) + { + bytesPerBuffer = (bufferSizeSamples * (bitDepth >> 2)) & ~15; + totalBytesPerBuffer = (3 * bytesPerBuffer) & ~15; + const int numChannels = 2; - return image; -} + hr = pDirectSound->SetCooperativeLevel (GetDesktopWindow(), 2 /* DSSCL_PRIORITY */); + logError (hr); -void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() -{ - const int maxW = GetSystemMetrics (SM_CXCURSOR); - const int maxH = GetSystemMetrics (SM_CYCURSOR); + if (hr == S_OK) + { + IDirectSoundBuffer* pPrimaryBuffer; - const Image* im = ℑ - Image* newIm = 0; + DSBUFFERDESC primaryDesc; + zerostruct (primaryDesc); - if (image.getWidth() > maxW || image.getHeight() > maxH) - { - im = newIm = image.createCopy (maxW, maxH); + primaryDesc.dwSize = sizeof (DSBUFFERDESC); + primaryDesc.dwFlags = 1 /* DSBCAPS_PRIMARYBUFFER */; + primaryDesc.dwBufferBytes = 0; + primaryDesc.lpwfxFormat = 0; - hotspotX = (hotspotX * maxW) / image.getWidth(); - hotspotY = (hotspotY * maxH) / image.getHeight(); - } + log ("opening dsound out step 2"); + hr = pDirectSound->CreateSoundBuffer (&primaryDesc, &pPrimaryBuffer, 0); + logError (hr); - void* cursorH = 0; + if (hr == S_OK) + { + WAVEFORMATEX wfFormat; + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = (unsigned short) numChannels; + wfFormat.nSamplesPerSec = sampleRate; + wfFormat.wBitsPerSample = (unsigned short) bitDepth; + wfFormat.nBlockAlign = (unsigned short) (wfFormat.nChannels * wfFormat.wBitsPerSample / 8); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; - const SystemStats::OperatingSystemType os = SystemStats::getOperatingSystemType(); + hr = pPrimaryBuffer->SetFormat (&wfFormat); + logError (hr); - if (os == SystemStats::WinXP) - { - cursorH = (void*) createHICONFromImage (*im, FALSE, hotspotX, hotspotY); - } - else - { - const int stride = (maxW + 7) >> 3; - uint8* const andPlane = (uint8*) juce_calloc (stride * maxH); - uint8* const xorPlane = (uint8*) juce_calloc (stride * maxH); - int index = 0; + if (hr == S_OK) + { + DSBUFFERDESC secondaryDesc; + zerostruct (secondaryDesc); - for (int y = 0; y < maxH; ++y) - { - for (int x = 0; x < maxW; ++x) - { - const unsigned char bit = (unsigned char) (1 << (7 - (x & 7))); + secondaryDesc.dwSize = sizeof (DSBUFFERDESC); + secondaryDesc.dwFlags = 0x8000 /* DSBCAPS_GLOBALFOCUS */ + | 0x10000 /* DSBCAPS_GETCURRENTPOSITION2 */; + secondaryDesc.dwBufferBytes = totalBytesPerBuffer; + secondaryDesc.lpwfxFormat = &wfFormat; - const Colour pixelColour (im->getPixelAt (x, y)); + hr = pDirectSound->CreateSoundBuffer (&secondaryDesc, &pOutputBuffer, 0); + logError (hr); - if (pixelColour.getAlpha() < 127) - andPlane [index + (x >> 3)] |= bit; - else if (pixelColour.getBrightness() >= 0.5f) - xorPlane [index + (x >> 3)] |= bit; - } + if (hr == S_OK) + { + log ("opening dsound out step 3"); - index += stride; - } + DWORD dwDataLen; + unsigned char* pDSBuffData; - cursorH = CreateCursor (0, hotspotX, hotspotY, maxW, maxH, andPlane, xorPlane); + hr = pOutputBuffer->Lock (0, totalBytesPerBuffer, + (LPVOID*) &pDSBuffData, &dwDataLen, 0, 0, 0); + logError (hr); - juce_free (andPlane); - juce_free (xorPlane); - } + if (hr == S_OK) + { + zeromem (pDSBuffData, dwDataLen); - delete newIm; - return cursorH; -} + hr = pOutputBuffer->Unlock (pDSBuffData, dwDataLen, 0, 0); -void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() -{ - if (cursorHandle != 0 && ! isStandard) - DestroyCursor ((HCURSOR) cursorHandle); -} + if (hr == S_OK) + { + hr = pOutputBuffer->SetCurrentPosition (0); -void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() -{ - LPCTSTR cursorName = IDC_ARROW; + if (hr == S_OK) + { + hr = pOutputBuffer->Play (0, 0, 1 /* DSBPLAY_LOOPING */); - switch (type) - { - case MouseCursor::NormalCursor: - cursorName = IDC_ARROW; - break; + if (hr == S_OK) + return String::empty; + } + } + } + } + } + } + } + } - case MouseCursor::NoCursor: - return 0; + error = getDSErrorMessage (hr); + close(); + return error; + } - case MouseCursor::DraggingHandCursor: + void synchronisePosition() { - static void* dragHandCursor = 0; - - if (dragHandCursor == 0) + if (pOutputBuffer != 0) { - static const 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 }; - - Image* const image = ImageFileFormat::loadFrom ((const char*) dragHandData, sizeof (dragHandData)); - dragHandCursor = juce_createMouseCursorFromImage (*image, 8, 7); - delete image; + DWORD playCursor; + pOutputBuffer->GetCurrentPosition (&playCursor, &writeOffset); } - - return dragHandCursor; } - case MouseCursor::WaitCursor: - cursorName = IDC_WAIT; - break; + bool service() + { + if (pOutputBuffer == 0) + return true; - case MouseCursor::IBeamCursor: - cursorName = IDC_IBEAM; - break; + DWORD playCursor, writeCursor; + HRESULT hr = pOutputBuffer->GetCurrentPosition (&playCursor, &writeCursor); - case MouseCursor::PointingHandCursor: - cursorName = MAKEINTRESOURCE(32649); - break; + if (hr != S_OK) + { + logError (hr); + jassertfalse + return true; + } - case MouseCursor::LeftRightResizeCursor: - case MouseCursor::LeftEdgeResizeCursor: - case MouseCursor::RightEdgeResizeCursor: - cursorName = IDC_SIZEWE; - break; + int playWriteGap = writeCursor - playCursor; + if (playWriteGap < 0) + playWriteGap += totalBytesPerBuffer; - case MouseCursor::UpDownResizeCursor: - case MouseCursor::TopEdgeResizeCursor: - case MouseCursor::BottomEdgeResizeCursor: - cursorName = IDC_SIZENS; - break; + int bytesEmpty = playCursor - writeOffset; - case MouseCursor::TopLeftCornerResizeCursor: - case MouseCursor::BottomRightCornerResizeCursor: - cursorName = IDC_SIZENWSE; - break; + if (bytesEmpty < 0) + bytesEmpty += totalBytesPerBuffer; - case MouseCursor::TopRightCornerResizeCursor: - case MouseCursor::BottomLeftCornerResizeCursor: - cursorName = IDC_SIZENESW; - break; + if (bytesEmpty > (totalBytesPerBuffer - playWriteGap)) + { + writeOffset = writeCursor; + bytesEmpty = totalBytesPerBuffer - playWriteGap; + } - case MouseCursor::UpDownLeftRightResizeCursor: - cursorName = IDC_SIZEALL; - break; + if (bytesEmpty >= bytesPerBuffer) + { + LPBYTE lpbuf1 = 0; + LPBYTE lpbuf2 = 0; + DWORD dwSize1 = 0; + DWORD dwSize2 = 0; - case MouseCursor::CrosshairCursor: - cursorName = IDC_CROSS; - break; + HRESULT hr = pOutputBuffer->Lock (writeOffset, + bytesPerBuffer, + (void**) &lpbuf1, &dwSize1, + (void**) &lpbuf2, &dwSize2, 0); - case MouseCursor::CopyingCursor: - // can't seem to find one of these in the win32 list.. - break; - } + if (hr == MAKE_HRESULT (1, 0x878, 150)) // DSERR_BUFFERLOST + { + pOutputBuffer->Restore(); - HCURSOR cursorH = LoadCursor (0, cursorName); + hr = pOutputBuffer->Lock (writeOffset, + bytesPerBuffer, + (void**) &lpbuf1, &dwSize1, + (void**) &lpbuf2, &dwSize2, 0); + } - if (cursorH == 0) - cursorH = LoadCursor (0, IDC_ARROW); + if (hr == S_OK) + { + if (bitDepth == 16) + { + const float gainL = 32767.0f; + const float gainR = 32767.0f; - return (void*) cursorH; -} + int* dest = (int*)lpbuf1; + const float* left = leftBuffer; + const float* right = rightBuffer; + int samples1 = dwSize1 >> 2; + int samples2 = dwSize2 >> 2; -void MouseCursor::showInWindow (ComponentPeer*) const throw() -{ - SetCursor ((HCURSOR) getHandle()); -} + if (left == 0) + { + while (--samples1 >= 0) + { + int r = roundFloatToInt (gainR * *right++); -void MouseCursor::showInAllWindows() const throw() -{ - showInWindow (0); -} + if (r < -32768) + r = -32768; + else if (r > 32767) + r = 32767; -class JuceDropSource : public IDropSource -{ - int refCount; + *dest++ = (r << 16); + } -public: - JuceDropSource() - : refCount (1) - { - } + dest = (int*)lpbuf2; - virtual ~JuceDropSource() - { - jassert (refCount == 0); - } + while (--samples2 >= 0) + { + int r = roundFloatToInt (gainR * *right++); - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IDropSource) - { - AddRef(); - *result = this; - return S_OK; - } + if (r < -32768) + r = -32768; + else if (r > 32767) + r = 32767; - *result = 0; - return E_NOINTERFACE; - } + *dest++ = (r << 16); + } + } + else if (right == 0) + { + while (--samples1 >= 0) + { + int l = roundFloatToInt (gainL * *left++); - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + if (l < -32768) + l = -32768; + else if (l > 32767) + l = 32767; - HRESULT __stdcall QueryContinueDrag (BOOL escapePressed, DWORD keys) - { - if (escapePressed) - return DRAGDROP_S_CANCEL; + l &= 0xffff; - if ((keys & (MK_LBUTTON | MK_RBUTTON)) == 0) - return DRAGDROP_S_DROP; + *dest++ = l; + } - return S_OK; - } + dest = (int*)lpbuf2; - HRESULT __stdcall GiveFeedback (DWORD) - { - return DRAGDROP_S_USEDEFAULTCURSORS; - } -}; + while (--samples2 >= 0) + { + int l = roundFloatToInt (gainL * *left++); -class JuceEnumFormatEtc : public IEnumFORMATETC -{ -public: - JuceEnumFormatEtc (const FORMATETC* const format_) - : refCount (1), - format (format_), - index (0) - { - } + if (l < -32768) + l = -32768; + else if (l > 32767) + l = 32767; - virtual ~JuceEnumFormatEtc() - { - jassert (refCount == 0); - } + l &= 0xffff; - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IEnumFORMATETC) - { - AddRef(); - *result = this; - return S_OK; - } + *dest++ = l; + } + } + else + { + while (--samples1 >= 0) + { + int l = roundFloatToInt (gainL * *left++); - *result = 0; - return E_NOINTERFACE; - } + if (l < -32768) + l = -32768; + else if (l > 32767) + l = 32767; - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + l &= 0xffff; - HRESULT __stdcall Clone (IEnumFORMATETC** result) - { - if (result == 0) - return E_POINTER; + int r = roundFloatToInt (gainR * *right++); - JuceEnumFormatEtc* const newOne = new JuceEnumFormatEtc (format); - newOne->index = index; + if (r < -32768) + r = -32768; + else if (r > 32767) + r = 32767; - *result = newOne; - return S_OK; - } + *dest++ = (r << 16) | l; + } - HRESULT __stdcall Next (ULONG celt, LPFORMATETC lpFormatEtc, ULONG* pceltFetched) - { - if (pceltFetched != 0) - *pceltFetched = 0; - else if (celt != 1) - return S_FALSE; + dest = (int*)lpbuf2; - if (index == 0 && celt > 0 && lpFormatEtc != 0) - { - copyFormatEtc (lpFormatEtc [0], *format); - ++index; + while (--samples2 >= 0) + { + int l = roundFloatToInt (gainL * *left++); - if (pceltFetched != 0) - *pceltFetched = 1; + if (l < -32768) + l = -32768; + else if (l > 32767) + l = 32767; - return S_OK; - } + l &= 0xffff; - return S_FALSE; - } + int r = roundFloatToInt (gainR * *right++); - HRESULT __stdcall Skip (ULONG celt) - { - if (index + (int) celt >= 1) - return S_FALSE; + if (r < -32768) + r = -32768; + else if (r > 32767) + r = 32767; - index += celt; - return S_OK; - } + *dest++ = (r << 16) | l; + } + } + } + else + { + jassertfalse + } - HRESULT __stdcall Reset() - { - index = 0; - return S_OK; - } + writeOffset = (writeOffset + dwSize1 + dwSize2) % totalBytesPerBuffer; -private: - int refCount; - const FORMATETC* const format; - int index; + pOutputBuffer->Unlock (lpbuf1, dwSize1, lpbuf2, dwSize2); + } + else + { + jassertfalse + logError (hr); + } - static void copyFormatEtc (FORMATETC& dest, const FORMATETC& source) - { - dest = source; + bytesEmpty -= bytesPerBuffer; - if (source.ptd != 0) + return true; + } + else { - dest.ptd = (DVTARGETDEVICE*) CoTaskMemAlloc (sizeof (DVTARGETDEVICE)); - *(dest.ptd) = *(source.ptd); + return false; } } - - JuceEnumFormatEtc (const JuceEnumFormatEtc&); - const JuceEnumFormatEtc& operator= (const JuceEnumFormatEtc&); }; -class JuceDataObject : public IDataObject +struct DSoundInternalInChannel { - JuceDropSource* const dropSource; - const FORMATETC* const format; - const STGMEDIUM* const medium; - int refCount; + String name; + LPGUID guid; + int sampleRate, bufferSizeSamples; + float* leftBuffer; + float* rightBuffer; - JuceDataObject (const JuceDataObject&); - const JuceDataObject& operator= (const JuceDataObject&); + IDirectSound* pDirectSound; + IDirectSoundCapture* pDirectSoundCapture; + IDirectSoundCaptureBuffer* pInputBuffer; public: - JuceDataObject (JuceDropSource* const dropSource_, - const FORMATETC* const format_, - const STGMEDIUM* const medium_) - : dropSource (dropSource_), - format (format_), - medium (medium_), - refCount (1) + unsigned int readOffset; + int bytesPerBuffer, totalBytesPerBuffer; + int bitDepth; + bool doneFlag; + + DSoundInternalInChannel (const String& name_, + LPGUID guid_, + int rate, + int bufferSize, + float* left, + float* right) + : name (name_), + guid (guid_), + sampleRate (rate), + bufferSizeSamples (bufferSize), + leftBuffer (left), + rightBuffer (right), + pDirectSound (0), + pDirectSoundCapture (0), + pInputBuffer (0), + bitDepth (16) { } - virtual ~JuceDataObject() + ~DSoundInternalInChannel() { - jassert (refCount == 0); + close(); } - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + void close() { - if (id == IID_IUnknown || id == IID_IDataObject) + HRESULT hr; + + if (pInputBuffer != 0) { - AddRef(); - *result = this; - return S_OK; - } + JUCE_TRY + { + log (T("closing dsound in: ") + name); + hr = pInputBuffer->Stop(); + logError (hr); + } + CATCH - *result = 0; - return E_NOINTERFACE; - } + JUCE_TRY + { + hr = pInputBuffer->Release(); + logError (hr); + } + CATCH - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { jassert (refCount > 0); const int r = --refCount; if (r == 0) delete this; return r; } + pInputBuffer = 0; + } - HRESULT __stdcall GetData (FORMATETC __RPC_FAR* pFormatEtc, STGMEDIUM __RPC_FAR* pMedium) - { - if (pFormatEtc->tymed == format->tymed - && pFormatEtc->cfFormat == format->cfFormat - && pFormatEtc->dwAspect == format->dwAspect) + if (pDirectSoundCapture != 0) { - pMedium->tymed = format->tymed; - pMedium->pUnkForRelease = 0; - - if (format->tymed == TYMED_HGLOBAL) + JUCE_TRY { - const SIZE_T len = GlobalSize (medium->hGlobal); - void* const src = GlobalLock (medium->hGlobal); - void* const dst = GlobalAlloc (GMEM_FIXED, len); - - memcpy (dst, src, len); + hr = pDirectSoundCapture->Release(); + logError (hr); + } + CATCH - GlobalUnlock (medium->hGlobal); + pDirectSoundCapture = 0; + } - pMedium->hGlobal = dst; - return S_OK; + if (pDirectSound != 0) + { + JUCE_TRY + { + hr = pDirectSound->Release(); + logError (hr); } - } + CATCH - return DV_E_FORMATETC; + pDirectSound = 0; + } } - HRESULT __stdcall QueryGetData (FORMATETC __RPC_FAR* f) + const String open() { - if (f == 0) - return E_INVALIDARG; + log (T("opening dsound in device: ") + name + + T(" rate=") + String (sampleRate) + T(" bits=") + String (bitDepth) + T(" buf=") + String (bufferSizeSamples)); - if (f->tymed == format->tymed - && f->cfFormat == format->cfFormat - && f->dwAspect == format->dwAspect) - return S_OK; + pDirectSound = 0; + pDirectSoundCapture = 0; + pInputBuffer = 0; + readOffset = 0; + totalBytesPerBuffer = 0; - return DV_E_FORMATETC; - } + String error; + HRESULT hr = E_NOINTERFACE; - HRESULT __stdcall GetCanonicalFormatEtc (FORMATETC __RPC_FAR*, FORMATETC __RPC_FAR* pFormatEtcOut) - { - pFormatEtcOut->ptd = 0; - return E_NOTIMPL; - } + if (dsDirectSoundCaptureCreate != 0) + hr = dsDirectSoundCaptureCreate (guid, &pDirectSoundCapture, 0); - HRESULT __stdcall EnumFormatEtc (DWORD direction, IEnumFORMATETC __RPC_FAR *__RPC_FAR *result) - { - if (result == 0) - return E_POINTER; + logError (hr); - if (direction == DATADIR_GET) + if (hr == S_OK) { - *result = new JuceEnumFormatEtc (format); - return S_OK; - } - - *result = 0; - return E_NOTIMPL; - } + const int numChannels = 2; + bytesPerBuffer = (bufferSizeSamples * (bitDepth >> 2)) & ~15; + totalBytesPerBuffer = (3 * bytesPerBuffer) & ~15; - HRESULT __stdcall GetDataHere (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*) { return DATA_E_FORMATETC; } - HRESULT __stdcall SetData (FORMATETC __RPC_FAR*, STGMEDIUM __RPC_FAR*, BOOL) { return E_NOTIMPL; } - HRESULT __stdcall DAdvise (FORMATETC __RPC_FAR*, DWORD, IAdviseSink __RPC_FAR*, DWORD __RPC_FAR*) { return OLE_E_ADVISENOTSUPPORTED; } - HRESULT __stdcall DUnadvise (DWORD) { return E_NOTIMPL; } - HRESULT __stdcall EnumDAdvise (IEnumSTATDATA __RPC_FAR *__RPC_FAR *) { return OLE_E_ADVISENOTSUPPORTED; } -}; + WAVEFORMATEX wfFormat; + wfFormat.wFormatTag = WAVE_FORMAT_PCM; + wfFormat.nChannels = (unsigned short)numChannels; + wfFormat.nSamplesPerSec = sampleRate; + wfFormat.wBitsPerSample = (unsigned short)bitDepth; + wfFormat.nBlockAlign = (unsigned short)(wfFormat.nChannels * (wfFormat.wBitsPerSample / 8)); + wfFormat.nAvgBytesPerSec = wfFormat.nSamplesPerSec * wfFormat.nBlockAlign; + wfFormat.cbSize = 0; -static HDROP createHDrop (const StringArray& fileNames) throw() -{ - int totalChars = 0; - for (int i = fileNames.size(); --i >= 0;) - totalChars += fileNames[i].length() + 1; + DSCBUFFERDESC captureDesc; + zerostruct (captureDesc); - HDROP hDrop = (HDROP) GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, - sizeof (DROPFILES) - + sizeof (WCHAR) * (totalChars + 2)); + captureDesc.dwSize = sizeof (DSCBUFFERDESC); + captureDesc.dwFlags = 0; + captureDesc.dwBufferBytes = totalBytesPerBuffer; + captureDesc.lpwfxFormat = &wfFormat; - if (hDrop != 0) - { - LPDROPFILES pDropFiles = (LPDROPFILES) GlobalLock (hDrop); - pDropFiles->pFiles = sizeof (DROPFILES); + log (T("opening dsound in step 2")); + hr = pDirectSoundCapture->CreateCaptureBuffer (&captureDesc, &pInputBuffer, 0); - pDropFiles->fWide = true; + logError (hr); - WCHAR* fname = (WCHAR*) (((char*) pDropFiles) + sizeof (DROPFILES)); + if (hr == S_OK) + { + hr = pInputBuffer->Start (1 /* DSCBSTART_LOOPING */); + logError (hr); - for (int i = 0; i < fileNames.size(); ++i) - { - fileNames[i].copyToBuffer (fname, 2048); - fname += fileNames[i].length() + 1; + if (hr == S_OK) + return String::empty; + } } - *fname = 0; + error = getDSErrorMessage (hr); + close(); - GlobalUnlock (hDrop); + return error; } - return hDrop; -} + void synchronisePosition() + { + if (pInputBuffer != 0) + { + DWORD capturePos; + pInputBuffer->GetCurrentPosition (&capturePos, (DWORD*)&readOffset); + } + } -static bool performDragDrop (FORMATETC* const format, STGMEDIUM* const medium, const DWORD whatToDo) throw() -{ - JuceDropSource* const source = new JuceDropSource(); - JuceDataObject* const data = new JuceDataObject (source, format, medium); + bool service() + { + if (pInputBuffer == 0) + return true; - DWORD effect; - const HRESULT res = DoDragDrop (data, source, whatToDo, &effect); + DWORD capturePos, readPos; + HRESULT hr = pInputBuffer->GetCurrentPosition (&capturePos, &readPos); + logError (hr); - data->Release(); - source->Release(); + if (hr != S_OK) + return true; - return res == DRAGDROP_S_DROP; -} + int bytesFilled = readPos - readOffset; + if (bytesFilled < 0) + bytesFilled += totalBytesPerBuffer; -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMove) -{ - FORMATETC format = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; - STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; + if (bytesFilled >= bytesPerBuffer) + { + LPBYTE lpbuf1 = 0; + LPBYTE lpbuf2 = 0; + DWORD dwsize1 = 0; + DWORD dwsize2 = 0; - medium.hGlobal = createHDrop (files); + HRESULT hr = pInputBuffer->Lock (readOffset, + bytesPerBuffer, + (void**) &lpbuf1, &dwsize1, + (void**) &lpbuf2, &dwsize2, 0); - return performDragDrop (&format, &medium, canMove ? (DROPEFFECT_COPY | DROPEFFECT_MOVE) - : DROPEFFECT_COPY); -} + if (hr == S_OK) + { + if (bitDepth == 16) + { + const float g = 1.0f / 32768.0f; -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) -{ - FORMATETC format = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; - STGMEDIUM medium = { TYMED_HGLOBAL, { 0 }, 0 }; + float* destL = leftBuffer; + float* destR = rightBuffer; + int samples1 = dwsize1 >> 2; + int samples2 = dwsize2 >> 2; - const int numChars = text.length(); + const short* src = (const short*)lpbuf1; - medium.hGlobal = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, (numChars + 2) * sizeof (WCHAR)); - char* d = (char*) GlobalLock (medium.hGlobal); + if (destL == 0) + { + while (--samples1 >= 0) + { + ++src; + *destR++ = *src++ * g; + } - text.copyToBuffer ((WCHAR*) d, numChars + 1); - format.cfFormat = CF_UNICODETEXT; + src = (const short*)lpbuf2; - GlobalUnlock (medium.hGlobal); + while (--samples2 >= 0) + { + ++src; + *destR++ = *src++ * g; + } + } + else if (destR == 0) + { + while (--samples1 >= 0) + { + *destL++ = *src++ * g; + ++src; + } - return performDragDrop (&format, &medium, DROPEFFECT_COPY | DROPEFFECT_MOVE); -} + src = (const short*)lpbuf2; -#if JUCE_OPENGL + while (--samples2 >= 0) + { + *destL++ = *src++ * g; + ++src; + } + } + else + { + while (--samples1 >= 0) + { + *destL++ = *src++ * g; + *destR++ = *src++ * g; + } -#define WGL_EXT_FUNCTION_INIT(extType, extFunc) \ - ((extFunc = (extType) wglGetProcAddress (#extFunc)) != 0) + src = (const short*)lpbuf2; -typedef const char* (WINAPI* PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); -typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); + while (--samples2 >= 0) + { + *destL++ = *src++ * g; + *destR++ = *src++ * g; + } + } + } + else + { + jassertfalse + } -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_STEREO_ARB 0x2012 -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 -#define WGL_TYPE_RGBA_ARB 0x202B + readOffset = (readOffset + dwsize1 + dwsize2) % totalBytesPerBuffer; -static void getWglExtensions (HDC dc, StringArray& result) throw() -{ - PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0; + pInputBuffer->Unlock (lpbuf1, dwsize1, lpbuf2, dwsize2); + } + else + { + logError (hr); + jassertfalse + } - if (WGL_EXT_FUNCTION_INIT (PFNWGLGETEXTENSIONSSTRINGARBPROC, wglGetExtensionsStringARB)) - result.addTokens (String (wglGetExtensionsStringARB (dc)), false); - else - jassertfalse // If this fails, it may be because you didn't activate the openGL context -} + bytesFilled -= bytesPerBuffer; -class WindowedGLContext : public OpenGLContext + return true; + } + else + { + return false; + } + } +}; + +class DSoundAudioIODevice : public AudioIODevice, + public Thread { public: - WindowedGLContext (Component* const component_, - HGLRC contextToShareWith, - const OpenGLPixelFormat& pixelFormat) - : renderContext (0), - nativeWindow (0), - dc (0), - component (component_) + DSoundAudioIODevice (const String& deviceName, + const int outputDeviceIndex_, + const int inputDeviceIndex_) + : AudioIODevice (deviceName, "DirectSound"), + Thread ("Juce DSound"), + isOpen_ (false), + isStarted (false), + outputDeviceIndex (outputDeviceIndex_), + inputDeviceIndex (inputDeviceIndex_), + inChans (4), + outChans (4), + numInputBuffers (0), + numOutputBuffers (0), + totalSamplesOut (0), + sampleRate (0.0), + inputBuffers (0), + outputBuffers (0), + callback (0), + bufferSizeSamples (0) { - jassert (component != 0); - - createNativeWindow(); - - // Use a default pixel format that should be supported everywhere - PIXELFORMATDESCRIPTOR pfd; - zerostruct (pfd); - pfd.nSize = sizeof (pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 24; - pfd.cDepthBits = 16; - - const int format = ChoosePixelFormat (dc, &pfd); - - if (format != 0) - SetPixelFormat (dc, format, &pfd); - - renderContext = wglCreateContext (dc); - makeActive(); - - setPixelFormat (pixelFormat); + if (outputDeviceIndex_ >= 0) + { + outChannels.add (TRANS("Left")); + outChannels.add (TRANS("Right")); + } - if (contextToShareWith != 0 && renderContext != 0) - wglShareLists (contextToShareWith, renderContext); + if (inputDeviceIndex_ >= 0) + { + inChannels.add (TRANS("Left")); + inChannels.add (TRANS("Right")); + } } - ~WindowedGLContext() + ~DSoundAudioIODevice() { - makeInactive(); - - wglDeleteContext (renderContext); - - ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); - delete nativeWindow; + close(); } - bool makeActive() const throw() + const StringArray getOutputChannelNames() { - jassert (renderContext != 0); - return wglMakeCurrent (dc, renderContext) != 0; + return outChannels; } - bool makeInactive() const throw() + const StringArray getInputChannelNames() { - return (! isActive()) || (wglMakeCurrent (0, 0) != 0); + return inChannels; } - bool isActive() const throw() + int getNumSampleRates() { - return wglGetCurrentContext() == renderContext; + return 4; } - const OpenGLPixelFormat getPixelFormat() const + double getSampleRate (int index) { - OpenGLPixelFormat pf; - - makeActive(); - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); + const double samps[] = { 44100.0, 48000.0, 88200.0, 96000.0 }; - fillInPixelFormatDetails (GetPixelFormat (dc), pf, availableExtensions); - return pf; + return samps [jlimit (0, 3, index)]; } - void* getRawContext() const throw() + int getNumBufferSizesAvailable() { - return renderContext; + return 50; } - bool setPixelFormat (const OpenGLPixelFormat& pixelFormat) + int getBufferSizeSamples (int index) { - makeActive(); - - PIXELFORMATDESCRIPTOR pfd; - zerostruct (pfd); - pfd.nSize = sizeof (pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.iLayerType = PFD_MAIN_PLANE; - pfd.cColorBits = pixelFormat.redBits + pixelFormat.greenBits + pixelFormat.blueBits; - pfd.cRedBits = pixelFormat.redBits; - pfd.cGreenBits = pixelFormat.greenBits; - pfd.cBlueBits = pixelFormat.blueBits; - pfd.cAlphaBits = pixelFormat.alphaBits; - pfd.cDepthBits = pixelFormat.depthBufferBits; - pfd.cStencilBits = pixelFormat.stencilBufferBits; - pfd.cAccumBits = pixelFormat.accumulationBufferRedBits + pixelFormat.accumulationBufferGreenBits - + pixelFormat.accumulationBufferBlueBits + pixelFormat.accumulationBufferAlphaBits; - pfd.cAccumRedBits = pixelFormat.accumulationBufferRedBits; - pfd.cAccumGreenBits = pixelFormat.accumulationBufferGreenBits; - pfd.cAccumBlueBits = pixelFormat.accumulationBufferBlueBits; - pfd.cAccumAlphaBits = pixelFormat.accumulationBufferAlphaBits; - - int format = 0; - - PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = 0; - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - if (availableExtensions.contains ("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLCHOOSEPIXELFORMATARBPROC, wglChoosePixelFormatARB)) - { - int attributes[64]; - int n = 0; - - attributes[n++] = WGL_DRAW_TO_WINDOW_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_SUPPORT_OPENGL_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_ACCELERATION_ARB; - attributes[n++] = WGL_FULL_ACCELERATION_ARB; - attributes[n++] = WGL_DOUBLE_BUFFER_ARB; - attributes[n++] = GL_TRUE; - attributes[n++] = WGL_PIXEL_TYPE_ARB; - attributes[n++] = WGL_TYPE_RGBA_ARB; - - attributes[n++] = WGL_COLOR_BITS_ARB; - attributes[n++] = pfd.cColorBits; - attributes[n++] = WGL_RED_BITS_ARB; - attributes[n++] = pixelFormat.redBits; - attributes[n++] = WGL_GREEN_BITS_ARB; - attributes[n++] = pixelFormat.greenBits; - attributes[n++] = WGL_BLUE_BITS_ARB; - attributes[n++] = pixelFormat.blueBits; - attributes[n++] = WGL_ALPHA_BITS_ARB; - attributes[n++] = pixelFormat.alphaBits; - attributes[n++] = WGL_DEPTH_BITS_ARB; - attributes[n++] = pixelFormat.depthBufferBits; - - if (pixelFormat.stencilBufferBits > 0) - { - attributes[n++] = WGL_STENCIL_BITS_ARB; - attributes[n++] = pixelFormat.stencilBufferBits; - } - - attributes[n++] = WGL_ACCUM_RED_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferRedBits; - attributes[n++] = WGL_ACCUM_GREEN_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferGreenBits; - attributes[n++] = WGL_ACCUM_BLUE_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferBlueBits; - attributes[n++] = WGL_ACCUM_ALPHA_BITS_ARB; - attributes[n++] = pixelFormat.accumulationBufferAlphaBits; - - if (availableExtensions.contains ("WGL_ARB_multisample") - && pixelFormat.fullSceneAntiAliasingNumSamples > 0) - { - attributes[n++] = WGL_SAMPLE_BUFFERS_ARB; - attributes[n++] = 1; - attributes[n++] = WGL_SAMPLES_ARB; - attributes[n++] = pixelFormat.fullSceneAntiAliasingNumSamples; - } - - attributes[n++] = 0; + int n = 64; + for (int i = 0; i < index; ++i) + n += (n < 512) ? 32 + : ((n < 1024) ? 64 + : ((n < 2048) ? 128 : 256)); - UINT formatsCount; - const BOOL ok = wglChoosePixelFormatARB (dc, attributes, 0, 1, &format, &formatsCount); - (void) ok; - jassert (ok); - } - else - { - format = ChoosePixelFormat (dc, &pfd); - } + return n; + } - if (format != 0) - { - makeInactive(); + int getDefaultBufferSize() + { + return 2560; + } - // win32 can't change the pixel format of a window, so need to delete the - // old one and create a new one.. - jassert (nativeWindow != 0); - ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); - delete nativeWindow; + const String open (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate, + int bufferSizeSamples) + { + lastError = openDevice (inputChannels, outputChannels, sampleRate, bufferSizeSamples); + isOpen_ = lastError.isEmpty(); - createNativeWindow(); + return lastError; + } - if (SetPixelFormat (dc, format, &pfd)) - { - wglDeleteContext (renderContext); - renderContext = wglCreateContext (dc); + void close() + { + stop(); - jassert (renderContext != 0); - return renderContext != 0; - } + if (isOpen_) + { + closeDevice(); + isOpen_ = false; } - - return false; } - void updateWindowPosition (int x, int y, int w, int h, int) + bool isOpen() { - SetWindowPos ((HWND) nativeWindow->getNativeHandle(), 0, - x, y, w, h, - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER); + return isOpen_ && isThreadRunning(); } - void repaint() + int getCurrentBufferSizeSamples() { - int x, y, w, h; - nativeWindow->getBounds (x, y, w, h); - nativeWindow->repaint (0, 0, w, h); + return bufferSizeSamples; } - void swapBuffers() + double getCurrentSampleRate() { - SwapBuffers (dc); + return sampleRate; } - bool setSwapInterval (const int numFramesPerSwap) + int getCurrentBitDepth() { - makeActive(); + int i, bits = 256; - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); + for (i = inChans.size(); --i >= 0;) + bits = jmin (bits, inChans[i]->bitDepth); - PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0; + for (i = outChans.size(); --i >= 0;) + bits = jmin (bits, outChans[i]->bitDepth); - return availableExtensions.contains ("WGL_EXT_swap_control") - && WGL_EXT_FUNCTION_INIT (PFNWGLSWAPINTERVALEXTPROC, wglSwapIntervalEXT) - && wglSwapIntervalEXT (numFramesPerSwap) != FALSE; + if (bits > 32) + bits = 16; + + return bits; } - int getSwapInterval() const + const BitArray getActiveOutputChannels() const { - makeActive(); - - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); - - PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0; - - if (availableExtensions.contains ("WGL_EXT_swap_control") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETSWAPINTERVALEXTPROC, wglGetSwapIntervalEXT)) - return wglGetSwapIntervalEXT(); - - return 0; + return enabledOutputs; } - void findAlternativeOpenGLPixelFormats (OwnedArray & results) + const BitArray getActiveInputChannels() const { - jassert (isActive()); + return enabledInputs; + } - StringArray availableExtensions; - getWglExtensions (dc, availableExtensions); + int getOutputLatencyInSamples() + { + return (int) (getCurrentBufferSizeSamples() * 1.5); + } - PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; - int numTypes = 0; + int getInputLatencyInSamples() + { + return getOutputLatencyInSamples(); + } - if (availableExtensions.contains("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) + void start (AudioIODeviceCallback* call) + { + if (isOpen_ && call != 0 && ! isStarted) { - int attributes = WGL_NUMBER_PIXEL_FORMATS_ARB; + if (! isThreadRunning()) + { + // something gone wrong and the thread's stopped.. + isOpen_ = false; + return; + } - if (! wglGetPixelFormatAttribivARB (dc, 1, 0, 1, &attributes, &numTypes)) - jassertfalse - } - else - { - numTypes = DescribePixelFormat (dc, 0, 0, 0); - } + call->audioDeviceAboutToStart (this); - OpenGLPixelFormat pf; + const ScopedLock sl (startStopLock); + callback = call; + isStarted = true; + } + } - for (int i = 0; i < numTypes; ++i) + void stop() + { + if (isStarted) { - if (fillInPixelFormatDetails (i + 1, pf, availableExtensions)) - { - bool alreadyListed = false; - for (int j = results.size(); --j >= 0;) - if (pf == *results.getUnchecked(j)) - alreadyListed = true; + AudioIODeviceCallback* const callbackLocal = callback; - if (! alreadyListed) - results.add (new OpenGLPixelFormat (pf)); + { + const ScopedLock sl (startStopLock); + isStarted = false; } + + if (callbackLocal != 0) + callbackLocal->audioDeviceStopped(); } } + bool isPlaying() + { + return isStarted && isOpen_ && isThreadRunning(); + } + + const String getLastError() + { + return lastError; + } + juce_UseDebuggingNewOperator - HGLRC renderContext; + StringArray inChannels, outChannels; + int outputDeviceIndex, inputDeviceIndex; private: - Win32ComponentPeer* nativeWindow; - Component* const component; - HDC dc; + bool isOpen_; + bool isStarted; + String lastError; - void createNativeWindow() + OwnedArray inChans; + OwnedArray outChans; + WaitableEvent startEvent; + + int numInputBuffers, numOutputBuffers, bufferSizeSamples; + int volatile totalSamplesOut; + int64 volatile lastBlockTime; + double sampleRate; + BitArray enabledInputs, enabledOutputs; + float** inputBuffers; + float** outputBuffers; + + AudioIODeviceCallback* callback; + CriticalSection startStopLock; + + DSoundAudioIODevice (const DSoundAudioIODevice&); + const DSoundAudioIODevice& operator= (const DSoundAudioIODevice&); + + const String openDevice (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate_, + int bufferSizeSamples_); + + void closeDevice() { - nativeWindow = new Win32ComponentPeer (component, 0); - nativeWindow->dontRepaint = true; - nativeWindow->setVisible (true); + isStarted = false; + stopThread (5000); - HWND hwnd = (HWND) nativeWindow->getNativeHandle(); + inChans.clear(); + outChans.clear(); - Win32ComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); + int i; + for (i = 0; i < numInputBuffers; ++i) + juce_free (inputBuffers[i]); - if (peer != 0) - { - SetParent (hwnd, (HWND) peer->getNativeHandle()); - juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_CHILD, true); - juce_setWindowStyleBit (hwnd, GWL_STYLE, WS_POPUP, false); - } + delete[] inputBuffers; + inputBuffers = 0; + numInputBuffers = 0; - dc = GetDC (hwnd); + for (i = 0; i < numOutputBuffers; ++i) + juce_free (outputBuffers[i]); + + delete[] outputBuffers; + outputBuffers = 0; + numOutputBuffers = 0; } - bool fillInPixelFormatDetails (const int pixelFormatIndex, - OpenGLPixelFormat& result, - const StringArray& availableExtensions) const throw() + void resync() { - PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = 0; - - if (availableExtensions.contains ("WGL_ARB_pixel_format") - && WGL_EXT_FUNCTION_INIT (PFNWGLGETPIXELFORMATATTRIBIVARBPROC, wglGetPixelFormatAttribivARB)) + if (! threadShouldExit()) { - int attributes[32]; - int numAttributes = 0; + sleep (5); - attributes[numAttributes++] = WGL_DRAW_TO_WINDOW_ARB; - attributes[numAttributes++] = WGL_SUPPORT_OPENGL_ARB; - attributes[numAttributes++] = WGL_ACCELERATION_ARB; - attributes[numAttributes++] = WGL_DOUBLE_BUFFER_ARB; - attributes[numAttributes++] = WGL_PIXEL_TYPE_ARB; - attributes[numAttributes++] = WGL_RED_BITS_ARB; - attributes[numAttributes++] = WGL_GREEN_BITS_ARB; - attributes[numAttributes++] = WGL_BLUE_BITS_ARB; - attributes[numAttributes++] = WGL_ALPHA_BITS_ARB; - attributes[numAttributes++] = WGL_DEPTH_BITS_ARB; - attributes[numAttributes++] = WGL_STENCIL_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_RED_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_GREEN_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_BLUE_BITS_ARB; - attributes[numAttributes++] = WGL_ACCUM_ALPHA_BITS_ARB; + int i; + for (i = 0; i < outChans.size(); ++i) + outChans.getUnchecked(i)->synchronisePosition(); - if (availableExtensions.contains ("WGL_ARB_multisample")) - attributes[numAttributes++] = WGL_SAMPLES_ARB; + for (i = 0; i < inChans.size(); ++i) + inChans.getUnchecked(i)->synchronisePosition(); + } + } - int values[32]; - zeromem (values, sizeof (values)); +public: + void run() + { + while (! threadShouldExit()) + { + if (wait (100)) + break; + } - if (wglGetPixelFormatAttribivARB (dc, pixelFormatIndex, 0, numAttributes, attributes, values)) - { - int n = 0; - bool isValidFormat = (values[n++] == GL_TRUE); // WGL_DRAW_TO_WINDOW_ARB - isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_SUPPORT_OPENGL_ARB - isValidFormat = (values[n++] == WGL_FULL_ACCELERATION_ARB) && isValidFormat; // WGL_ACCELERATION_ARB - isValidFormat = (values[n++] == GL_TRUE) && isValidFormat; // WGL_DOUBLE_BUFFER_ARB: - isValidFormat = (values[n++] == WGL_TYPE_RGBA_ARB) && isValidFormat; // WGL_PIXEL_TYPE_ARB - result.redBits = values[n++]; // WGL_RED_BITS_ARB - result.greenBits = values[n++]; // WGL_GREEN_BITS_ARB - result.blueBits = values[n++]; // WGL_BLUE_BITS_ARB - result.alphaBits = values[n++]; // WGL_ALPHA_BITS_ARB - result.depthBufferBits = values[n++]; // WGL_DEPTH_BITS_ARB - result.stencilBufferBits = values[n++]; // WGL_STENCIL_BITS_ARB - result.accumulationBufferRedBits = values[n++]; // WGL_ACCUM_RED_BITS_ARB - result.accumulationBufferGreenBits = values[n++]; // WGL_ACCUM_GREEN_BITS_ARB - result.accumulationBufferBlueBits = values[n++]; // WGL_ACCUM_BLUE_BITS_ARB - result.accumulationBufferAlphaBits = values[n++]; // WGL_ACCUM_ALPHA_BITS_ARB - result.fullSceneAntiAliasingNumSamples = values[n++]; // WGL_SAMPLES_ARB + const int latencyMs = (int) (bufferSizeSamples * 1000.0 / sampleRate); + const int maxTimeMS = jmax (5, 3 * latencyMs); - return isValidFormat; - } - else - { - jassertfalse - } - } - else + while (! threadShouldExit()) { - PIXELFORMATDESCRIPTOR pfd; + int numToDo = 0; + uint32 startTime = Time::getMillisecondCounter(); - if (DescribePixelFormat (dc, pixelFormatIndex, sizeof (pfd), &pfd)) + int i; + for (i = inChans.size(); --i >= 0;) { - result.redBits = pfd.cRedBits; - result.greenBits = pfd.cGreenBits; - result.blueBits = pfd.cBlueBits; - result.alphaBits = pfd.cAlphaBits; - result.depthBufferBits = pfd.cDepthBits; - result.stencilBufferBits = pfd.cStencilBits; - result.accumulationBufferRedBits = pfd.cAccumRedBits; - result.accumulationBufferGreenBits = pfd.cAccumGreenBits; - result.accumulationBufferBlueBits = pfd.cAccumBlueBits; - result.accumulationBufferAlphaBits = pfd.cAccumAlphaBits; - result.fullSceneAntiAliasingNumSamples = 0; - - return true; + inChans.getUnchecked(i)->doneFlag = false; + ++numToDo; } - else + + for (i = outChans.size(); --i >= 0;) { - jassertfalse + outChans.getUnchecked(i)->doneFlag = false; + ++numToDo; } - } - return false; - } + if (numToDo > 0) + { + const int maxCount = 3; + int count = maxCount; - WindowedGLContext (const WindowedGLContext&); - const WindowedGLContext& operator= (const WindowedGLContext&); -}; + for (;;) + { + for (i = inChans.size(); --i >= 0;) + { + DSoundInternalInChannel* const in = inChans.getUnchecked(i); -OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, - const OpenGLPixelFormat& pixelFormat, - const OpenGLContext* const contextToShareWith) -{ - WindowedGLContext* c = new WindowedGLContext (component, - contextToShareWith != 0 ? (HGLRC) contextToShareWith->getRawContext() : 0, - pixelFormat); + if ((! in->doneFlag) && in->service()) + { + in->doneFlag = true; + --numToDo; + } + } - if (c->renderContext == 0) - deleteAndZero (c); + for (i = outChans.size(); --i >= 0;) + { + DSoundInternalOutChannel* const out = outChans.getUnchecked(i); - return c; -} + if ((! out->doneFlag) && out->service()) + { + out->doneFlag = true; + --numToDo; + } + } -void juce_glViewport (const int w, const int h) -{ - glViewport (0, 0, w, h); -} + if (numToDo <= 0) + break; -void OpenGLPixelFormat::getAvailablePixelFormats (Component* component, - OwnedArray & results) -{ - Component tempComp; + if (Time::getMillisecondCounter() > startTime + maxTimeMS) + { + resync(); + break; + } - { - WindowedGLContext wc (component, 0, OpenGLPixelFormat (8, 8, 16, 0)); - wc.makeActive(); - wc.findAlternativeOpenGLPixelFormats (results); - } -} + if (--count <= 0) + { + Sleep (1); + count = maxCount; + } -#endif + if (threadShouldExit()) + return; + } + } + else + { + sleep (1); + } -class JuceIStorage : public IStorage -{ - int refCount; + const ScopedLock sl (startStopLock); -public: - JuceIStorage() : refCount (1) {} + if (isStarted) + { + JUCE_TRY + { + callback->audioDeviceIOCallback ((const float**) inputBuffers, + numInputBuffers, + outputBuffers, + numOutputBuffers, + bufferSizeSamples); + } + JUCE_CATCH_EXCEPTION - virtual ~JuceIStorage() - { - jassert (refCount == 0); - } + totalSamplesOut += bufferSizeSamples; + } + else + { + for (i = 0; i < numOutputBuffers; ++i) + if (outputBuffers[i] != 0) + zeromem (outputBuffers[i], bufferSizeSamples * sizeof (float)); - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) - { - if (id == IID_IUnknown || id == IID_IStorage) - { - AddRef(); - *result = this; - return S_OK; + totalSamplesOut = 0; + sleep (1); + } } - - *result = 0; - return E_NOINTERFACE; } - - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall CreateStream (const WCHAR*, DWORD, DWORD, DWORD, IStream**) { return E_NOTIMPL; } - HRESULT __stdcall OpenStream (const WCHAR*, void*, DWORD, DWORD, IStream**) { return E_NOTIMPL; } - HRESULT __stdcall CreateStorage (const WCHAR*, DWORD, DWORD, DWORD, IStorage**) { return E_NOTIMPL; } - HRESULT __stdcall OpenStorage (const WCHAR*, IStorage*, DWORD, SNB, DWORD, IStorage**) { return E_NOTIMPL; } - HRESULT __stdcall CopyTo (DWORD, IID const*, SNB, IStorage*) { return E_NOTIMPL; } - HRESULT __stdcall MoveElementTo (const OLECHAR*,IStorage*, const OLECHAR*, DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Commit (DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Revert() { return E_NOTIMPL; } - HRESULT __stdcall EnumElements (DWORD, void*, DWORD, IEnumSTATSTG**) { return E_NOTIMPL; } - HRESULT __stdcall DestroyElement (const OLECHAR*) { return E_NOTIMPL; } - HRESULT __stdcall RenameElement (const WCHAR*, const WCHAR*) { return E_NOTIMPL; } - HRESULT __stdcall SetElementTimes (const WCHAR*, FILETIME const*, FILETIME const*, FILETIME const*) { return E_NOTIMPL; } - HRESULT __stdcall SetClass (REFCLSID) { return S_OK; } - HRESULT __stdcall SetStateBits (DWORD, DWORD) { return E_NOTIMPL; } - HRESULT __stdcall Stat (STATSTG*, DWORD) { return E_NOTIMPL; } - - juce_UseDebuggingNewOperator }; -class JuceOleInPlaceFrame : public IOleInPlaceFrame +class DSoundAudioIODeviceType : public AudioIODeviceType { - int refCount; - HWND window; - public: - JuceOleInPlaceFrame (HWND window_) - : refCount (1), - window (window_) + DSoundAudioIODeviceType() + : AudioIODeviceType (T("DirectSound")), + hasScanned (false) { + initialiseDSoundFunctions(); } - virtual ~JuceOleInPlaceFrame() + ~DSoundAudioIODeviceType() { - jassert (refCount == 0); } - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + void scanForDevices() { - if (id == IID_IUnknown || id == IID_IOleInPlaceFrame) + hasScanned = true; + + outputDeviceNames.clear(); + outputGuids.clear(); + inputDeviceNames.clear(); + inputGuids.clear(); + + if (dsDirectSoundEnumerateW != 0) { - AddRef(); - *result = this; - return S_OK; + dsDirectSoundEnumerateW (outputEnumProcW, this); + dsDirectSoundCaptureEnumerateW (inputEnumProcW, this); } - - *result = 0; - return E_NOINTERFACE; } - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } - - HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } - HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall GetBorder (LPRECT) { return E_NOTIMPL; } - HRESULT __stdcall RequestBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetBorderSpace (LPCBORDERWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetActiveObject (IOleInPlaceActiveObject*, LPCOLESTR) { return S_OK; } - HRESULT __stdcall InsertMenus (HMENU, LPOLEMENUGROUPWIDTHS) { return E_NOTIMPL; } - HRESULT __stdcall SetMenu (HMENU, HOLEMENU, HWND) { return S_OK; } - HRESULT __stdcall RemoveMenus (HMENU) { return E_NOTIMPL; } - HRESULT __stdcall SetStatusText (LPCOLESTR) { return S_OK; } - HRESULT __stdcall EnableModeless (BOOL) { return S_OK; } - HRESULT __stdcall TranslateAccelerator(LPMSG, WORD) { return E_NOTIMPL; } - - juce_UseDebuggingNewOperator -}; - -class JuceIOleInPlaceSite : public IOleInPlaceSite -{ - int refCount; - HWND window; - JuceOleInPlaceFrame* frame; - -public: - JuceIOleInPlaceSite (HWND window_) - : refCount (1), - window (window_) + const StringArray getDeviceNames (const bool wantInputNames) const { - frame = new JuceOleInPlaceFrame (window); + jassert (hasScanned); // need to call scanForDevices() before doing this + + return wantInputNames ? inputDeviceNames + : outputDeviceNames; } - virtual ~JuceIOleInPlaceSite() + int getDefaultDeviceIndex (const bool /*forInput*/) const { - jassert (refCount == 0); - frame->Release(); + jassert (hasScanned); // need to call scanForDevices() before doing this + return 0; } - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + int getIndexOfDevice (AudioIODevice* device, const bool asInput) const { - if (id == IID_IUnknown || id == IID_IOleInPlaceSite) - { - AddRef(); - *result = this; - return S_OK; - } + jassert (hasScanned); // need to call scanForDevices() before doing this - *result = 0; - return E_NOINTERFACE; - } + DSoundAudioIODevice* const d = dynamic_cast (device); + if (d == 0) + return -1; - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + return asInput ? d->inputDeviceIndex + : d->outputDeviceIndex; + } - HRESULT __stdcall GetWindow (HWND* lphwnd) { *lphwnd = window; return S_OK; } - HRESULT __stdcall ContextSensitiveHelp (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall CanInPlaceActivate() { return S_OK; } - HRESULT __stdcall OnInPlaceActivate() { return S_OK; } - HRESULT __stdcall OnUIActivate() { return S_OK; } + bool hasSeparateInputsAndOutputs() const { return true; } - HRESULT __stdcall GetWindowContext (LPOLEINPLACEFRAME* lplpFrame, LPOLEINPLACEUIWINDOW* lplpDoc, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO lpFrameInfo) + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) { - frame->AddRef(); - *lplpFrame = frame; - *lplpDoc = 0; - lpFrameInfo->fMDIApp = FALSE; - lpFrameInfo->hwndFrame = window; - lpFrameInfo->haccel = 0; - lpFrameInfo->cAccelEntries = 0; - return S_OK; - } + jassert (hasScanned); // need to call scanForDevices() before doing this - HRESULT __stdcall Scroll (SIZE) { return E_NOTIMPL; } - HRESULT __stdcall OnUIDeactivate (BOOL) { return S_OK; } - HRESULT __stdcall OnInPlaceDeactivate() { return S_OK; } - HRESULT __stdcall DiscardUndoState() { return E_NOTIMPL; } - HRESULT __stdcall DeactivateAndUndo() { return E_NOTIMPL; } - HRESULT __stdcall OnPosRectChange (LPCRECT) { return S_OK; } + const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); + const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); + + if (outputIndex >= 0 || inputIndex >= 0) + return new DSoundAudioIODevice (outputDeviceName.isNotEmpty() ? outputDeviceName + : inputDeviceName, + outputIndex, inputIndex); + + return 0; + } juce_UseDebuggingNewOperator -}; -class JuceIOleClientSite : public IOleClientSite -{ - int refCount; - JuceIOleInPlaceSite* inplaceSite; + StringArray outputDeviceNames; + OwnedArray outputGuids; -public: - JuceIOleClientSite (HWND window) - : refCount (1) - { - inplaceSite = new JuceIOleInPlaceSite (window); - } + StringArray inputDeviceNames; + OwnedArray inputGuids; - virtual ~JuceIOleClientSite() - { - jassert (refCount == 0); - inplaceSite->Release(); - } +private: + bool hasScanned; - HRESULT __stdcall QueryInterface (REFIID id, void __RPC_FAR* __RPC_FAR* result) + BOOL outputEnumProc (LPGUID lpGUID, String desc) { - if (id == IID_IUnknown || id == IID_IOleClientSite) - { - AddRef(); - *result = this; - return S_OK; - } - else if (id == IID_IOleInPlaceSite) - { - inplaceSite->AddRef(); - *result = inplaceSite; - return S_OK; - } - - *result = 0; - return E_NOINTERFACE; - } + desc = desc.trim(); - ULONG __stdcall AddRef() { return ++refCount; } - ULONG __stdcall Release() { const int r = --refCount; if (r == 0) delete this; return r; } + if (desc.isNotEmpty()) + { + const String origDesc (desc); - HRESULT __stdcall SaveObject() { return E_NOTIMPL; } - HRESULT __stdcall GetMoniker (DWORD, DWORD, IMoniker**) { return E_NOTIMPL; } - HRESULT __stdcall GetContainer (LPOLECONTAINER* ppContainer) { *ppContainer = 0; return E_NOINTERFACE; } - HRESULT __stdcall ShowObject() { return S_OK; } - HRESULT __stdcall OnShowWindow (BOOL) { return E_NOTIMPL; } - HRESULT __stdcall RequestNewObjectLayout() { return E_NOTIMPL; } + int n = 2; + while (outputDeviceNames.contains (desc)) + desc = origDesc + T(" (") + String (n++) + T(")"); - juce_UseDebuggingNewOperator -}; + outputDeviceNames.add (desc); -class ActiveXControlData : public ComponentMovementWatcher -{ - ActiveXControlComponent* const owner; - bool wasShowing; + if (lpGUID != 0) + outputGuids.add (new GUID (*lpGUID)); + else + outputGuids.add (0); + } -public: - HWND controlHWND; - IStorage* storage; - IOleClientSite* clientSite; - IOleObject* control; + return TRUE; + } - ActiveXControlData (HWND hwnd, - ActiveXControlComponent* const owner_) - : ComponentMovementWatcher (owner_), - owner (owner_), - wasShowing (owner_ != 0 && owner_->isShowing()), - controlHWND (0), - storage (new JuceIStorage()), - clientSite (new JuceIOleClientSite (hwnd)), - control (0) + static BOOL CALLBACK outputEnumProcW (LPGUID lpGUID, LPCWSTR description, LPCWSTR, LPVOID object) { + return ((DSoundAudioIODeviceType*) object) + ->outputEnumProc (lpGUID, String (description)); } - ~ActiveXControlData() + static BOOL CALLBACK outputEnumProcA (LPGUID lpGUID, LPCTSTR description, LPCTSTR, LPVOID object) { - if (control != 0) - { - control->Close (OLECLOSE_NOSAVE); - control->Release(); - } - - clientSite->Release(); - storage->Release(); + return ((DSoundAudioIODeviceType*) object) + ->outputEnumProc (lpGUID, String (description)); } - void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) + BOOL CALLBACK inputEnumProc (LPGUID lpGUID, String desc) { - Component* const topComp = owner->getTopLevelComponent(); + desc = desc.trim(); - if (topComp->getPeer() != 0) + if (desc.isNotEmpty()) { - int x = 0, y = 0; - owner->relativePositionToOtherComponent (topComp, x, y); - - owner->setControlBounds (Rectangle (x, y, owner->getWidth(), owner->getHeight())); - } - } + const String origDesc (desc); - void componentPeerChanged() - { - const bool isShowingNow = owner->isShowing(); + int n = 2; + while (inputDeviceNames.contains (desc)) + desc = origDesc + T(" (") + String (n++) + T(")"); - if (wasShowing != isShowingNow) - { - wasShowing = isShowingNow; + inputDeviceNames.add (desc); - owner->setControlVisible (isShowingNow); + if (lpGUID != 0) + inputGuids.add (new GUID (*lpGUID)); + else + inputGuids.add (0); } + + return TRUE; } - void componentVisibilityChanged (Component&) + static BOOL CALLBACK inputEnumProcW (LPGUID lpGUID, LPCWSTR description, LPCWSTR, LPVOID object) { - componentPeerChanged(); + return ((DSoundAudioIODeviceType*) object) + ->inputEnumProc (lpGUID, String (description)); } - static bool doesWindowMatch (const ActiveXControlComponent* const ax, HWND hwnd) + static BOOL CALLBACK inputEnumProcA (LPGUID lpGUID, LPCTSTR description, LPCTSTR, LPVOID object) { - return ((ActiveXControlData*) ax->control) != 0 - && ((ActiveXControlData*) ax->control)->controlHWND == hwnd; + return ((DSoundAudioIODeviceType*) object) + ->inputEnumProc (lpGUID, String (description)); } -}; -static VoidArray activeXComps; + DSoundAudioIODeviceType (const DSoundAudioIODeviceType&); + const DSoundAudioIODeviceType& operator= (const DSoundAudioIODeviceType&); +}; -static HWND getHWND (const ActiveXControlComponent* const component) +AudioIODeviceType* juce_createDefaultAudioIODeviceType() { - HWND hwnd = 0; - - const IID iid = IID_IOleWindow; - IOleWindow* const window = (IOleWindow*) component->queryInterface (&iid); - - if (window != 0) - { - window->GetWindow (&hwnd); - window->Release(); - } - - return hwnd; + return new DSoundAudioIODeviceType(); } -static void offerActiveXMouseEventToPeer (ComponentPeer* const peer, HWND hwnd, UINT message, LPARAM lParam) +const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate_, + int bufferSizeSamples_) { - RECT activeXRect, peerRect; - GetWindowRect (hwnd, &activeXRect); - GetWindowRect ((HWND) peer->getNativeHandle(), &peerRect); + closeDevice(); + totalSamplesOut = 0; - const int mx = GET_X_LPARAM (lParam) + activeXRect.left - peerRect.left; - const int my = GET_Y_LPARAM (lParam) + activeXRect.top - peerRect.top; - const int64 mouseEventTime = getMouseEventTime(); + sampleRate = sampleRate_; - const int oldModifiers = currentModifiers; - ModifierKeys::getCurrentModifiersRealtime(); // to update the mouse button flags + if (bufferSizeSamples_ <= 0) + bufferSizeSamples_ = 960; // use as a default size if none is set. - switch (message) - { - case WM_MOUSEMOVE: - if (ModifierKeys (currentModifiers).isAnyMouseButtonDown()) - peer->handleMouseDrag (mx, my, mouseEventTime); - else - peer->handleMouseMove (mx, my, mouseEventTime); - break; + bufferSizeSamples = bufferSizeSamples_ & ~7; - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - peer->handleMouseDown (mx, my, mouseEventTime); - break; + DSoundAudioIODeviceType dlh; + dlh.scanForDevices(); - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - peer->handleMouseUp (oldModifiers, mx, my, mouseEventTime); - break; + enabledInputs = inputChannels; + enabledInputs.setRange (inChannels.size(), + enabledInputs.getHighestBit() + 1 - inChannels.size(), + false); - default: - break; - } -} + numInputBuffers = enabledInputs.countNumberOfSetBits(); + inputBuffers = new float* [numInputBuffers + 2]; + zeromem (inputBuffers, sizeof (float*) * numInputBuffers + 2); + int i, numIns = 0; -// intercepts events going to an activeX control, so we can sneakily use the mouse events -static LRESULT CALLBACK activeXHookWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - for (int i = activeXComps.size(); --i >= 0;) + for (i = 0; i <= enabledInputs.getHighestBit(); i += 2) { - const ActiveXControlComponent* const ax = (const ActiveXControlComponent*) activeXComps.getUnchecked(i); + float* left = 0; + float* right = 0; - if (ActiveXControlData::doesWindowMatch (ax, hwnd)) - { - switch (message) - { - case WM_MOUSEMOVE: - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - case WM_LBUTTONDBLCLK: - case WM_MBUTTONDBLCLK: - case WM_RBUTTONDBLCLK: - if (ax->isShowing()) - { - ComponentPeer* const peer = ax->getPeer(); + if (enabledInputs[i]) + left = inputBuffers[numIns++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); - if (peer != 0) - { - offerActiveXMouseEventToPeer (peer, hwnd, message, lParam); + if (enabledInputs[i + 1]) + right = inputBuffers[numIns++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); - if (! ax->areMouseEventsAllowed()) - return 0; - } - } - break; + if (left != 0 || right != 0) + inChans.add (new DSoundInternalInChannel (dlh.inputDeviceNames [inputDeviceIndex], + dlh.inputGuids [inputDeviceIndex], + (int) sampleRate, bufferSizeSamples, + left, right)); + } - default: - break; - } + enabledOutputs = outputChannels; + enabledOutputs.setRange (outChannels.size(), + enabledOutputs.getHighestBit() + 1 - outChannels.size(), + false); - return CallWindowProc ((WNDPROC) (ax->originalWndProc), hwnd, message, wParam, lParam); - } - } + numOutputBuffers = enabledOutputs.countNumberOfSetBits(); + outputBuffers = new float* [numOutputBuffers + 2]; + zeromem (outputBuffers, sizeof (float*) * numOutputBuffers + 2); + int numOuts = 0; - return DefWindowProc (hwnd, message, wParam, lParam); -} + for (i = 0; i <= enabledOutputs.getHighestBit(); i += 2) + { + float* left = 0; + float* right = 0; -ActiveXControlComponent::ActiveXControlComponent() - : originalWndProc (0), - control (0), - mouseEventsAllowed (true) -{ - activeXComps.add (this); -} + if (enabledOutputs[i]) + left = outputBuffers[numOuts++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); -ActiveXControlComponent::~ActiveXControlComponent() -{ - deleteControl(); - activeXComps.removeValue (this); -} + if (enabledOutputs[i + 1]) + right = outputBuffers[numOuts++] = (float*) juce_calloc ((bufferSizeSamples + 16) * sizeof (float)); -void ActiveXControlComponent::paint (Graphics& g) -{ - if (control == 0) - g.fillAll (Colours::lightgrey); -} + if (left != 0 || right != 0) + outChans.add (new DSoundInternalOutChannel (dlh.outputDeviceNames[outputDeviceIndex], + dlh.outputGuids [outputDeviceIndex], + (int) sampleRate, bufferSizeSamples, + left, right)); + } -bool ActiveXControlComponent::createControl (const void* controlIID) -{ - deleteControl(); - ComponentPeer* const peer = getPeer(); + String error; - // the component must have already been added to a real window when you call this! - jassert (dynamic_cast (peer) != 0); + // boost our priority while opening the devices to try to get better sync between them + const int oldThreadPri = GetThreadPriority (GetCurrentThread()); + const int oldProcPri = GetPriorityClass (GetCurrentProcess()); + SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); + SetPriorityClass (GetCurrentProcess(), REALTIME_PRIORITY_CLASS); - if (dynamic_cast (peer) != 0) + for (i = 0; i < outChans.size(); ++i) { - int x = 0, y = 0; - relativePositionToOtherComponent (getTopLevelComponent(), x, y); - - HWND hwnd = (HWND) peer->getNativeHandle(); + error = outChans[i]->open(); - ActiveXControlData* const info = new ActiveXControlData (hwnd, this); + if (error.isNotEmpty()) + { + error = T("Error opening ") + dlh.outputDeviceNames[i] + + T(": \"") + error + T("\""); + break; + } + } - HRESULT hr; - if ((hr = OleCreate (*(const IID*) controlIID, IID_IOleObject, 1 /*OLERENDER_DRAW*/, 0, - info->clientSite, info->storage, - (void**) &(info->control))) == S_OK) + if (error.isEmpty()) + { + for (i = 0; i < inChans.size(); ++i) { - info->control->SetHostNames (L"Juce", 0); + error = inChans[i]->open(); - if (OleSetContainedObject (info->control, TRUE) == S_OK) + if (error.isNotEmpty()) { - RECT rect; - rect.left = x; - rect.top = y; - rect.right = x + getWidth(); - rect.bottom = y + getHeight(); - - if (info->control->DoVerb (OLEIVERB_SHOW, 0, info->clientSite, 0, hwnd, &rect) == S_OK) - { - control = info; - setControlBounds (Rectangle (x, y, getWidth(), getHeight())); - - info->controlHWND = getHWND (this); - - if (info->controlHWND != 0) - { - originalWndProc = (void*) GetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC); - SetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); - } - - return true; - } + error = T("Error opening ") + dlh.inputDeviceNames[i] + + T(": \"") + error + T("\""); + break; } } - - delete info; } - return false; -} + if (error.isEmpty()) + { + totalSamplesOut = 0; -void ActiveXControlComponent::deleteControl() -{ - ActiveXControlData* const info = (ActiveXControlData*) control; + for (i = 0; i < outChans.size(); ++i) + outChans.getUnchecked(i)->synchronisePosition(); - if (info != 0) - { - delete info; - control = 0; - originalWndProc = 0; - } -} + for (i = 0; i < inChans.size(); ++i) + inChans.getUnchecked(i)->synchronisePosition(); -void* ActiveXControlComponent::queryInterface (const void* iid) const -{ - ActiveXControlData* const info = (ActiveXControlData*) control; + startThread (9); + sleep (10); - void* result = 0; + notify(); + } + else + { + log (error); + } - if (info != 0 && info->control != 0 - && info->control->QueryInterface (*(const IID*) iid, &result) == S_OK) - return result; + SetThreadPriority (GetCurrentThread(), oldThreadPri); + SetPriorityClass (GetCurrentProcess(), oldProcPri); - return 0; + return error; } -void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const -{ - HWND hwnd = ((ActiveXControlData*) control)->controlHWND; +#undef log - if (hwnd != 0) - MoveWindow (hwnd, newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight(), TRUE); -} +#endif +/********* End of inlined file: juce_win32_DirectSound.cpp *********/ -void ActiveXControlComponent::setControlVisible (const bool shouldBeVisible) const -{ - HWND hwnd = ((ActiveXControlData*) control)->controlHWND; +#endif - if (hwnd != 0) - ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); -} +// Auto-link the other win32 libs that are needed by library calls.. +#if defined (JUCE_DLL_BUILD) && JUCE_MSVC -void ActiveXControlComponent::setMouseEventsAllowed (const bool eventsCanReachControl) -{ - mouseEventsAllowed = eventsCanReachControl; -} +/********* Start of inlined file: juce_win32_AutoLinkLibraries.h *********/ +// Auto-links to various win32 libs that are needed by library calls.. +#pragma comment(lib, "kernel32.lib") +#pragma comment(lib, "user32.lib") +#pragma comment(lib, "shell32.lib") +#pragma comment(lib, "gdi32.lib") +#pragma comment(lib, "vfw32.lib") +#pragma comment(lib, "comdlg32.lib") +#pragma comment(lib, "winmm.lib") +#pragma comment(lib, "wininet.lib") +#pragma comment(lib, "ole32.lib") +#pragma comment(lib, "advapi32.lib") +#pragma comment(lib, "ws2_32.lib") +#pragma comment(lib, "comsupp.lib") -END_JUCE_NAMESPACE -/********* End of inlined file: juce_win32_Windowing.cpp *********/ +#if JUCE_OPENGL + #pragma comment(lib, "OpenGL32.Lib") + #pragma comment(lib, "GlU32.Lib") +#endif + +#if JUCE_QUICKTIME + #pragma comment (lib, "QTMLClient.lib") +#endif +/********* End of inlined file: juce_win32_AutoLinkLibraries.h *********/ #endif +END_JUCE_NAMESPACE +/********* End of inlined file: juce_win32_NativeCode.cpp *********/ + /********* Start of inlined file: juce_win32_AutoLinkLibraries.h *********/ // Auto-links to various win32 libs that are needed by library calls.. #pragma comment(lib, "kernel32.lib") @@ -243824,6 +252705,202 @@ END_JUCE_NAMESPACE #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) + +/* + 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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 *********/ + /* 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) @@ -244865,338 +253942,381 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE -// we'll borrow the mac's socket-based http streaming code.. - -/********* Start of inlined file: juce_mac_HTTPStream.h *********/ -// (This file gets included by the mac + linux networking code) - -/** A HTTP input stream that uses sockets. -*/ -class JUCE_HTTPSocketStream +int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() { -public: + int numResults = 0; - JUCE_HTTPSocketStream() - : readPosition (0), - socketHandle (-1), - levelsOfRedirection (0), - timeoutSeconds (15) + const int s = socket (AF_INET, SOCK_DGRAM, 0); + if (s != -1) { - } + char buf [1024]; + struct ifconf ifc; + ifc.ifc_len = sizeof (buf); + ifc.ifc_buf = buf; + ioctl (s, SIOCGIFCONF, &ifc); - ~JUCE_HTTPSocketStream() - { - closeSocket(); - } + for (unsigned int i = 0; i < ifc.ifc_len / sizeof (struct ifreq); ++i) + { + struct ifreq ifr; + strcpy (ifr.ifr_name, ifc.ifc_req[i].ifr_name); - bool open (const String& url, - const String& headers, - const MemoryBlock& postData, - const bool isPost, - URL::OpenStreamProgressCallback* callback, - void* callbackContext, - int timeOutMs) - { - closeSocket(); + if (ioctl (s, SIOCGIFFLAGS, &ifr) == 0 + && (ifr.ifr_flags & IFF_LOOPBACK) == 0 + && ioctl (s, SIOCGIFHWADDR, &ifr) == 0 + && numResults < maxNum) + { + int64 a = 0; + for (int j = 6; --j >= 0;) + a = (a << 8) | (uint8) ifr.ifr_hwaddr.sa_data[j]; - uint32 timeOutTime = Time::getMillisecondCounter(); + *addresses++ = a; + ++numResults; + } + } - if (timeOutMs == 0) - timeOutTime += 60000; - else if (timeOutMs < 0) - timeOutTime = 0xffffffff; - else - timeOutTime += timeOutMs; + close (s); + } - String hostName, hostPath; - int hostPort; + return numResults; +} - if (! decomposeURL (url, hostName, hostPath, hostPort)) - return false; +bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, + const String& emailSubject, + const String& bodyText, + const StringArray& filesToAttach) +{ + jassertfalse // xxx todo - const struct hostent* host = 0; - int port = 0; + return false; +} - String proxyName, proxyPath; - int proxyPort = 0; +/** A HTTP input stream that uses sockets. + */ +class JUCE_HTTPSocketStream + { + public: - String proxyURL (getenv ("http_proxy")); - if (proxyURL.startsWithIgnoreCase (T("http://"))) + JUCE_HTTPSocketStream() + : readPosition (0), + socketHandle (-1), + levelsOfRedirection (0), + timeoutSeconds (15) { - if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort)) - return false; - - host = gethostbyname ((const char*) proxyName.toUTF8()); - port = proxyPort; } - else + + ~JUCE_HTTPSocketStream() { - host = gethostbyname ((const char*) hostName.toUTF8()); - port = hostPort; + closeSocket(); } - if (host == 0) - return false; + bool open (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) + { + closeSocket(); - struct sockaddr_in address; - zerostruct (address); - memcpy ((void*) &address.sin_addr, (const void*) host->h_addr, host->h_length); - address.sin_family = host->h_addrtype; - address.sin_port = htons (port); + uint32 timeOutTime = Time::getMillisecondCounter(); - socketHandle = socket (host->h_addrtype, SOCK_STREAM, 0); + if (timeOutMs == 0) + timeOutTime += 60000; + else if (timeOutMs < 0) + timeOutTime = 0xffffffff; + else + timeOutTime += timeOutMs; - if (socketHandle == -1) - return false; + String hostName, hostPath; + int hostPort; - int receiveBufferSize = 16384; - setsockopt (socketHandle, SOL_SOCKET, SO_RCVBUF, (char*) &receiveBufferSize, sizeof (receiveBufferSize)); - setsockopt (socketHandle, SOL_SOCKET, SO_KEEPALIVE, 0, 0); + if (! decomposeURL (url, hostName, hostPath, hostPort)) + return false; -#if JUCE_MAC - setsockopt (socketHandle, SOL_SOCKET, SO_NOSIGPIPE, 0, 0); -#endif + const struct hostent* host = 0; + int port = 0; - if (connect (socketHandle, (struct sockaddr*) &address, sizeof (address)) == -1) - { - closeSocket(); - return false; - } + String proxyName, proxyPath; + int proxyPort = 0; - const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, - proxyName, proxyPort, - hostPath, url, - headers, postData, - isPost)); - int totalHeaderSent = 0; + String proxyURL (getenv ("http_proxy")); + if (proxyURL.startsWithIgnoreCase (T("http://"))) + { + if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort)) + return false; - while (totalHeaderSent < requestHeader.getSize()) - { - if (Time::getMillisecondCounter() > timeOutTime) + host = gethostbyname ((const char*) proxyName.toUTF8()); + port = proxyPort; + } + else { - closeSocket(); - return false; + host = gethostbyname ((const char*) hostName.toUTF8()); + port = hostPort; } - const int numToSend = jmin (1024, requestHeader.getSize() - totalHeaderSent); + if (host == 0) + return false; - if (send (socketHandle, - ((const char*) requestHeader.getData()) + totalHeaderSent, - numToSend, 0) - != numToSend) - { - closeSocket(); + struct sockaddr_in address; + zerostruct (address); + memcpy ((void*) &address.sin_addr, (const void*) host->h_addr, host->h_length); + address.sin_family = host->h_addrtype; + address.sin_port = htons (port); + + socketHandle = socket (host->h_addrtype, SOCK_STREAM, 0); + + if (socketHandle == -1) return false; - } - totalHeaderSent += numToSend; + int receiveBufferSize = 16384; + setsockopt (socketHandle, SOL_SOCKET, SO_RCVBUF, (char*) &receiveBufferSize, sizeof (receiveBufferSize)); + setsockopt (socketHandle, SOL_SOCKET, SO_KEEPALIVE, 0, 0); + +#if JUCE_MAC + setsockopt (socketHandle, SOL_SOCKET, SO_NOSIGPIPE, 0, 0); +#endif - if (callback != 0 && ! callback (callbackContext, totalHeaderSent, requestHeader.getSize())) + if (connect (socketHandle, (struct sockaddr*) &address, sizeof (address)) == -1) { closeSocket(); return false; } - } - const String responseHeader (readResponse (timeOutTime)); + const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, + proxyName, proxyPort, + hostPath, url, + headers, postData, + isPost)); + int totalHeaderSent = 0; - if (responseHeader.isNotEmpty()) - { - //DBG (responseHeader); + while (totalHeaderSent < requestHeader.getSize()) + { + if (Time::getMillisecondCounter() > timeOutTime) + { + closeSocket(); + return false; + } - StringArray lines; - lines.addLines (responseHeader); + const int numToSend = jmin (1024, requestHeader.getSize() - totalHeaderSent); - // NB - using charToString() here instead of just T(" "), because that was - // causing a mysterious gcc internal compiler error... - const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) - .substring (0, 3) - .getIntValue(); + if (send (socketHandle, + ((const char*) requestHeader.getData()) + totalHeaderSent, + numToSend, 0) + != numToSend) + { + closeSocket(); + return false; + } - //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); - //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); + totalHeaderSent += numToSend; - String location (findHeaderItem (lines, T("Location:"))); + if (callback != 0 && ! callback (callbackContext, totalHeaderSent, requestHeader.getSize())) + { + closeSocket(); + return false; + } + } - if (statusCode >= 300 && statusCode < 400 - && location.isNotEmpty()) - { - if (! location.startsWithIgnoreCase (T("http://"))) - location = T("http://") + location; + const String responseHeader (readResponse (timeOutTime)); - if (levelsOfRedirection++ < 3) - return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); - } - else + if (responseHeader.isNotEmpty()) { - levelsOfRedirection = 0; - return true; - } - } + //DBG (responseHeader); - closeSocket(); - return false; - } + StringArray lines; + lines.addLines (responseHeader); - int read (void* buffer, int bytesToRead) - { - fd_set readbits; - FD_ZERO (&readbits); - FD_SET (socketHandle, &readbits); + // NB - using charToString() here instead of just T(" "), because that was + // causing a mysterious gcc internal compiler error... + const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) + .substring (0, 3) + .getIntValue(); - struct timeval tv; - tv.tv_sec = timeoutSeconds; - tv.tv_usec = 0; + //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); + //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); - if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) - return 0; // (timeout) + String location (findHeaderItem (lines, T("Location:"))); - const int bytesRead = jmax (0, recv (socketHandle, buffer, bytesToRead, MSG_WAITALL)); - readPosition += bytesRead; - return bytesRead; - } + if (statusCode >= 300 && statusCode < 400 + && location.isNotEmpty()) + { + if (! location.startsWithIgnoreCase (T("http://"))) + location = T("http://") + location; - int readPosition; + if (levelsOfRedirection++ < 3) + return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); + } + else + { + levelsOfRedirection = 0; + return true; + } + } - juce_UseDebuggingNewOperator + closeSocket(); + return false; + } -private: - int socketHandle, levelsOfRedirection; - const int timeoutSeconds; + int read (void* buffer, int bytesToRead) + { + fd_set readbits; + FD_ZERO (&readbits); + FD_SET (socketHandle, &readbits); - void closeSocket() - { - if (socketHandle >= 0) - close (socketHandle); + struct timeval tv; + tv.tv_sec = timeoutSeconds; + tv.tv_usec = 0; - socketHandle = -1; - } + if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) + return 0; // (timeout) - const MemoryBlock createRequestHeader (const String& hostName, - const int hostPort, - const String& proxyName, - const int proxyPort, - const String& hostPath, - const String& originalURL, - const String& headers, - const MemoryBlock& postData, - const bool isPost) - { - String header (isPost ? "POST " : "GET "); + const int bytesRead = jmax (0, recv (socketHandle, buffer, bytesToRead, MSG_WAITALL)); + readPosition += bytesRead; + return bytesRead; + } + + int readPosition; + + juce_UseDebuggingNewOperator - if (proxyName.isEmpty()) + private: + int socketHandle, levelsOfRedirection; + const int timeoutSeconds; + + void closeSocket() { - header << hostPath << " HTTP/1.0\r\nHost: " - << hostName << ':' << hostPort; + if (socketHandle >= 0) + close (socketHandle); + + socketHandle = -1; } - else + + const MemoryBlock createRequestHeader (const String& hostName, + const int hostPort, + const String& proxyName, + const int proxyPort, + const String& hostPath, + const String& originalURL, + const String& headers, + const MemoryBlock& postData, + const bool isPost) { - header << originalURL << " HTTP/1.0\r\nHost: " - << proxyName << ':' << proxyPort; - } + String header (isPost ? "POST " : "GET "); - header << "\r\nUser-Agent: JUCE/" - << JUCE_MAJOR_VERSION << '.' << JUCE_MINOR_VERSION - << "\r\nConnection: Close\r\nContent-Length: " - << postData.getSize() << "\r\n" - << headers << "\r\n"; + if (proxyName.isEmpty()) + { + header << hostPath << " HTTP/1.0\r\nHost: " + << hostName << ':' << hostPort; + } + else + { + header << originalURL << " HTTP/1.0\r\nHost: " + << proxyName << ':' << proxyPort; + } - MemoryBlock mb; - mb.append (header.toUTF8(), (int) strlen (header.toUTF8())); - mb.append (postData.getData(), postData.getSize()); + header << "\r\nUser-Agent: JUCE/" + << JUCE_MAJOR_VERSION << '.' << JUCE_MINOR_VERSION + << "\r\nConnection: Close\r\nContent-Length: " + << postData.getSize() << "\r\n" + << headers << "\r\n"; - return mb; - } + MemoryBlock mb; + mb.append (header.toUTF8(), (int) strlen (header.toUTF8())); + mb.append (postData.getData(), postData.getSize()); - const String readResponse (const uint32 timeOutTime) - { - int bytesRead = 0, numConsecutiveLFs = 0; - MemoryBlock buffer (1024, true); + return mb; + } - while (numConsecutiveLFs < 2 && bytesRead < 32768 - && Time::getMillisecondCounter() <= timeOutTime) + const String readResponse (const uint32 timeOutTime) { - fd_set readbits; - FD_ZERO (&readbits); - FD_SET (socketHandle, &readbits); - - struct timeval tv; - tv.tv_sec = timeoutSeconds; - tv.tv_usec = 0; + int bytesRead = 0, numConsecutiveLFs = 0; + MemoryBlock buffer (1024, true); - if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) - return String::empty; // (timeout) + while (numConsecutiveLFs < 2 && bytesRead < 32768 + && Time::getMillisecondCounter() <= timeOutTime) + { + fd_set readbits; + FD_ZERO (&readbits); + FD_SET (socketHandle, &readbits); - buffer.ensureSize (bytesRead + 8, true); - char* const dest = (char*) buffer.getData() + bytesRead; + struct timeval tv; + tv.tv_sec = timeoutSeconds; + tv.tv_usec = 0; - if (recv (socketHandle, dest, 1, 0) == -1) - return String::empty; + if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) + return String::empty; // (timeout) - const char lastByte = *dest; - ++bytesRead; + buffer.ensureSize (bytesRead + 8, true); + char* const dest = (char*) buffer.getData() + bytesRead; - if (lastByte == '\n') - ++numConsecutiveLFs; - else if (lastByte != '\r') - numConsecutiveLFs = 0; - } + if (recv (socketHandle, dest, 1, 0) == -1) + return String::empty; - const String header (String::fromUTF8 ((const uint8*) buffer.getData())); + const char lastByte = *dest; + ++bytesRead; - if (header.startsWithIgnoreCase (T("HTTP/"))) - return header.trimEnd(); + if (lastByte == '\n') + ++numConsecutiveLFs; + else if (lastByte != '\r') + numConsecutiveLFs = 0; + } - return String::empty; - } + const String header (String::fromUTF8 ((const uint8*) buffer.getData())); - static bool decomposeURL (const String& url, - String& host, String& path, int& port) - { - if (! url.startsWithIgnoreCase (T("http://"))) - return false; + if (header.startsWithIgnoreCase (T("HTTP/"))) + return header.trimEnd(); - const int nextSlash = url.indexOfChar (7, '/'); - int nextColon = url.indexOfChar (7, ':'); - if (nextColon > nextSlash && nextSlash > 0) - nextColon = -1; + return String::empty; + } - if (nextColon >= 0) + static bool decomposeURL (const String& url, + String& host, String& path, int& port) { - host = url.substring (7, nextColon); + if (! url.startsWithIgnoreCase (T("http://"))) + return false; - if (nextSlash >= 0) - port = url.substring (nextColon + 1, nextSlash).getIntValue(); + const int nextSlash = url.indexOfChar (7, '/'); + int nextColon = url.indexOfChar (7, ':'); + if (nextColon > nextSlash && nextSlash > 0) + nextColon = -1; + + if (nextColon >= 0) + { + host = url.substring (7, nextColon); + + if (nextSlash >= 0) + port = url.substring (nextColon + 1, nextSlash).getIntValue(); + else + port = url.substring (nextColon + 1).getIntValue(); + } else - port = url.substring (nextColon + 1).getIntValue(); - } - else - { - port = 80; + { + port = 80; + + if (nextSlash >= 0) + host = url.substring (7, nextSlash); + else + host = url.substring (7); + } if (nextSlash >= 0) - host = url.substring (7, nextSlash); + path = url.substring (nextSlash); else - host = url.substring (7); - } + path = T("/"); - if (nextSlash >= 0) - path = url.substring (nextSlash); - else - path = T("/"); - - return true; - } + return true; + } - static const String findHeaderItem (const StringArray& lines, const String& itemName) - { - for (int i = 0; i < lines.size(); ++i) - if (lines[i].startsWithIgnoreCase (itemName)) - return lines[i].substring (itemName.length()).trim(); + static const String findHeaderItem (const StringArray& lines, const String& itemName) + { + for (int i = 0; i < lines.size(); ++i) + if (lines[i].startsWithIgnoreCase (itemName)) + return lines[i].substring (itemName.length()).trim(); - return String::empty; - } -}; + return String::empty; + } + }; bool juce_isOnLine() { @@ -245248,55 +254368,6 @@ int juce_seekInInternetFile (void* handle, int newPosition) return 0; } -/********* End of inlined file: juce_mac_HTTPStream.h *********/ - -int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() -{ - int numResults = 0; - - const int s = socket (AF_INET, SOCK_DGRAM, 0); - if (s != -1) - { - char buf [1024]; - struct ifconf ifc; - ifc.ifc_len = sizeof (buf); - ifc.ifc_buf = buf; - ioctl (s, SIOCGIFCONF, &ifc); - - for (unsigned int i = 0; i < ifc.ifc_len / sizeof (struct ifreq); ++i) - { - struct ifreq ifr; - strcpy (ifr.ifr_name, ifc.ifc_req[i].ifr_name); - - if (ioctl (s, SIOCGIFFLAGS, &ifr) == 0 - && (ifr.ifr_flags & IFF_LOOPBACK) == 0 - && ioctl (s, SIOCGIFHWADDR, &ifr) == 0 - && numResults < maxNum) - { - int64 a = 0; - for (int j = 6; --j >= 0;) - a = (a << 8) | (uint8) ifr.ifr_hwaddr.sa_data[j]; - - *addresses++ = a; - ++numResults; - } - } - - close (s); - } - - return numResults; -} - -bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, - const String& emailSubject, - const String& bodyText, - const StringArray& filesToAttach) -{ - jassertfalse // xxx todo - - return false; -} END_JUCE_NAMESPACE /********* End of inlined file: juce_linux_Network.cpp *********/ @@ -245589,9 +254660,9 @@ void juce_setCurrentThreadName (const String& /*name*/) throw() { } -int Thread::getCurrentThreadId() throw() +int64 Thread::getCurrentThreadId() throw() { - return (int) pthread_self(); + return pthread_self(); } /* @@ -245752,17 +254823,17 @@ void Process::lowerPrivilege() } #if JUCE_BUILD_GUI_CLASSES -void* Process::loadDynamicLibrary (const String& name) +void* PlatformUtilities::loadDynamicLibrary (const String& name) { return dlopen ((const char*) name.toUTF8(), RTLD_LOCAL | RTLD_NOW); } -void Process::freeDynamicLibrary (void* handle) +void PlatformUtilities::freeDynamicLibrary (void* handle) { dlclose(handle); } -void* Process::getProcedureEntryPoint (void* libraryHandle, const String& procedureName) +void* PlatformUtilities::getProcedureEntryPoint (void* libraryHandle, const String& procedureName) { return dlsym (libraryHandle, (const char*) procedureName); } @@ -245775,6 +254846,202 @@ END_JUCE_NAMESPACE /********* 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. +*/ + +/** 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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES #if JUCE_ALSA @@ -246830,6 +256097,202 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_linux_FileChooser.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES BEGIN_JUCE_NAMESPACE @@ -246855,6 +256318,202 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_linux_Fonts.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES /* Got a build error here? You'll need to install the freetype library... @@ -247452,6 +257111,202 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_linux_Messaging.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES #include @@ -247839,6 +257694,202 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_linux_Midi.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES #if JUCE_ALSA @@ -248279,6 +258330,8 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE +#if JUCE_WEB_BROWSER + /* Sorry.. This class isn't implemented on Linux! */ @@ -248352,10 +258405,6 @@ void WebBrowserComponent::parentHierarchyChanged() checkWindowAssociation(); } -void WebBrowserComponent::moved() -{ -} - void WebBrowserComponent::resized() { } @@ -248370,11 +258419,208 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) return true; } +#endif END_JUCE_NAMESPACE /********* End of inlined file: juce_linux_WebBrowserComponent.cpp *********/ /********* Start of inlined file: juce_linux_Windowing.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 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 + +/** Disabling this will avoid linking to any UI code. This is handy for + writing command-line utilities, e.g. on linux boxes which don't have some + of the UI libraries installed. + + (On mac and windows, this won't generally make much difference to the build). +*/ +#ifndef JUCE_BUILD_GUI_CLASSES + #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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_BUILD_GUI_CLASSES #include @@ -248763,6 +259009,59 @@ static bool isShmAvailable() throw() } #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; + + 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; +} + +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); + + 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; +} + class XBitmapImage : public Image { public: @@ -249005,6 +259304,7 @@ public: checkMessageManagerIsLocked deleteTaskBarIcon(); + deleteIconPixmaps(); destroyWindow(); @@ -249406,7 +259706,7 @@ public: void setIcon (const Image& newIcon) { const int dataSize = newIcon.getWidth() * newIcon.getHeight() + 2; - uint32* const data = (uint32*) juce_malloc (dataSize); + uint32* const data = (uint32*) juce_malloc (dataSize * sizeof (uint32)); int index = 0; data[index++] = newIcon.getWidth(); @@ -249421,9 +259721,46 @@ public: 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); + } - juce_free (data); + 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); + } } void handleWindowMessage (XEvent* event) @@ -249965,6 +260302,14 @@ public: // For more recent KDE's... trayAtom = XInternAtom (display, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", false); XChangeProperty (display, windowH, trayAtom, XA_WINDOW, 32, PropModeReplace, (unsigned char*) &windowH, 1); + + // a minimum size must be specified for GNOME and Xfce, otherwise the icon is displayed with a width of 1 + XSizeHints* hints = XAllocSizeHints(); + hints->flags = PMinSize; + hints->min_width = 22; + hints->min_height = 22; + XSetWMNormalHints (display, windowH, hints); + XFree (hints); } void deleteTaskBarIcon() @@ -250963,7 +261308,7 @@ void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hot uint8* const maskPlane = (uint8*) juce_calloc (stride * cursorH); uint8* const sourcePlane = (uint8*) juce_calloc (stride * cursorH); - bool msbfirst = (BitmapBitOrder (display) == MSBFirst); + const bool msbfirst = (BitmapBitOrder (display) == MSBFirst); for (int y = cursorH; --y >= 0;) { @@ -251394,167 +261739,1105 @@ const String SystemClipboard::getTextFromClipboard() throw() XFree (clipData); } - if (bytesLeft == 0) - break; + if (bytesLeft == 0) + break; + } + + return returnData; +} + +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +{ + jassertfalse // not implemented! + return false; +} + +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +{ + jassertfalse // not implemented! + return false; +} + +void SystemTrayIconComponent::setIconImage (const Image& newImage) +{ + if (! isOnDesktop ()) + addToDesktop (0); + + LinuxComponentPeer* const wp = dynamic_cast (getPeer()); + + if (wp != 0) + { + wp->setTaskBarIcon (newImage); + + setVisible (true); + toFront (false); + repaint(); + } +} + +void SystemTrayIconComponent::paint (Graphics& g) +{ + LinuxComponentPeer* const wp = dynamic_cast (getPeer()); + + if (wp != 0) + { + const Image* const image = wp->getTaskbarIcon(); + + if (image != 0) + { + g.drawImageWithin (image, 0, 0, getWidth(), getHeight(), + RectanglePlacement::xLeft | RectanglePlacement::yTop | RectanglePlacement::onlyReduceInSize, + false); + } + } +} + +void SystemTrayIconComponent::setIconTooltip (const String& tooltip) +{ + // xxx not yet implemented! +} + +void PlatformUtilities::beep() +{ + fprintf (stdout, "\a"); + fflush (stdout); +} + +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) +{ + // 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); + + 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 + +#endif +/********* End of inlined file: juce_linux_Windowing.cpp *********/ + +#endif + +#endif + +//============================================================================== +#if JUCE_MAC + +/********* Start of inlined file: juce_mac_NativeCode.mm *********/ +/* + 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. +*/ + +BEGIN_JUCE_NAMESPACE + +#undef Point + +#define JUCE_INCLUDED_FILE 1 + +// Now include the actual code files.. + +/********* Start of inlined file: juce_mac_Strings.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +static const String nsStringToJuce (NSString* s) +{ + return String::fromUTF8 ((uint8*) [s UTF8String]); +} + +static NSString* juceStringToNS (const String& s) +{ + return [NSString stringWithUTF8String: (const char*) s.toUTF8()]; +} + +static const String convertUTF16ToString (const UniChar* utf16) +{ + String s; + + while (*utf16 != 0) + s += (juce_wchar) *utf16++; + + return s; +} + +const String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) +{ + String result; + + if (cfString != 0) + { +#if JUCE_STRINGS_ARE_UNICODE + CFRange range = { 0, CFStringGetLength (cfString) }; + UniChar* const u = (UniChar*) juce_malloc (sizeof (UniChar) * (range.length + 1)); + + CFStringGetCharacters (cfString, range, u); + u[range.length] = 0; + + result = convertUTF16ToString (u); + + juce_free (u); +#else + const int len = CFStringGetLength (cfString); + char* buffer = (char*) juce_malloc (len + 1); + CFStringGetCString (cfString, buffer, len + 1, CFStringGetSystemEncoding()); + result = buffer; + juce_free (buffer); +#endif + } + + return result; +} + +CFStringRef PlatformUtilities::juceStringToCFString (const String& s) +{ +#if JUCE_STRINGS_ARE_UNICODE + const int len = s.length(); + const juce_wchar* t = (const juce_wchar*) s; + + UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); + + for (int i = 0; i <= len; ++i) + temp[i] = t[i]; + + CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); + juce_free (temp); + + return result; + +#else + return CFStringCreateWithCString (kCFAllocatorDefault, + (const char*) s, + CFStringGetSystemEncoding()); +#endif +} + +const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) +{ + UnicodeMapping map; + + map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, + kUnicodeNoSubset, + kTextEncodingDefaultFormat); + + map.otherEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, + kUnicodeCanonicalCompVariant, + kTextEncodingDefaultFormat); + + map.mappingVersion = kUnicodeUseLatestMapping; + + UnicodeToTextInfo conversionInfo = 0; + String result; + + if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr) + { + const int len = s.length(); + + UniChar* const tempIn = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); + UniChar* const tempOut = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); + + for (int i = 0; i <= len; ++i) + tempIn[i] = s[i]; + + ByteCount bytesRead = 0; + ByteCount outputBufferSize = 0; + + if (ConvertFromUnicodeToText (conversionInfo, + len * sizeof (UniChar), tempIn, + kUnicodeDefaultDirectionMask, + 0, 0, 0, 0, + len * sizeof (UniChar), &bytesRead, + &outputBufferSize, tempOut) == noErr) + { + result.preallocateStorage (bytesRead / sizeof (UniChar) + 2); + + tchar* t = const_cast ((const tchar*) result); + + int i; + for (i = 0; i < bytesRead / sizeof (UniChar); ++i) + t[i] = (tchar) tempOut[i]; + + t[i] = 0; + } + + juce_free (tempIn); + juce_free (tempOut); + + DisposeUnicodeToTextInfo (&conversionInfo); + } + + return result; +} + +void SystemClipboard::copyTextToClipboard (const String& text) throw() +{ + [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject: NSStringPboardType] + owner: nil]; + + [[NSPasteboard generalPasteboard] setString: juceStringToNS (text) + forType: NSStringPboardType]; +} + +const String SystemClipboard::getTextFromClipboard() throw() +{ + NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; + + return text == 0 ? String::empty + : nsStringToJuce (text); +} + +#endif +/********* End of inlined file: juce_mac_Strings.mm *********/ + +/********* Start of inlined file: juce_mac_SystemStats.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +static int64 highResTimerFrequency; + +#if JUCE_INTEL + +static void juce_getCpuVendor (char* const v) throw() +{ + int vendor[4]; + zerostruct (vendor); + int dummy = 0; + + asm ("mov %%ebx, %%esi \n\t" + "cpuid \n\t" + "xchg %%esi, %%ebx" + : "=a" (dummy), "=S" (vendor[0]), "=c" (vendor[2]), "=d" (vendor[1]) : "a" (0)); + + memcpy (v, vendor, 16); +} + +static unsigned int getCPUIDWord (unsigned int& familyModel, unsigned int& extFeatures) throw() +{ + unsigned int cpu = 0; + unsigned int ext = 0; + unsigned int family = 0; + unsigned int dummy = 0; + + asm ("mov %%ebx, %%esi \n\t" + "cpuid \n\t" + "xchg %%esi, %%ebx" + : "=a" (family), "=S" (ext), "=c" (dummy), "=d" (cpu) : "a" (1)); + + familyModel = family; + extFeatures = ext; + return cpu; +} + +struct CPUFlags +{ + bool hasMMX : 1; + bool hasSSE : 1; + bool hasSSE2 : 1; + bool has3DNow : 1; +}; + +static CPUFlags cpuFlags; + +#endif + +void SystemStats::initialiseStats() throw() +{ + static bool initialised = false; + + if (! initialised) + { + initialised = true; + + NSApplicationLoad(); + [NSApplication sharedApplication]; + +#if JUCE_INTEL + { + unsigned int familyModel, extFeatures; + const unsigned int features = getCPUIDWord (familyModel, extFeatures); + + cpuFlags.hasMMX = ((features & (1 << 23)) != 0); + cpuFlags.hasSSE = ((features & (1 << 25)) != 0); + cpuFlags.hasSSE2 = ((features & (1 << 26)) != 0); + cpuFlags.has3DNow = ((extFeatures & (1 << 31)) != 0); + } +#endif + + highResTimerFrequency = (int64) AudioGetHostClockFrequency(); + + String s (SystemStats::getJUCEVersion()); + + rlimit lim; + getrlimit (RLIMIT_NOFILE, &lim); + lim.rlim_cur = lim.rlim_max = RLIM_INFINITY; + setrlimit (RLIMIT_NOFILE, &lim); + } +} + +static const String getCpuInfo (const char* key, bool lastOne = false) throw() +{ + String info; + char buf [256]; + + FILE* f = fopen ("/proc/cpuinfo", "r"); + + while (f != 0 && fgets (buf, sizeof(buf), f)) + { + if (strncmp (buf, key, strlen (key)) == 0) + { + char* p = buf; + + while (*p && *p != '\n') + ++p; + + if (*p != 0) + *p = 0; + + p = buf; + + while (*p != 0 && *p != ':') + ++p; + + if (*p != 0 && *(p + 1) != 0) + info = p + 2; + + if (! lastOne) + break; + } + } + + fclose (f); + return info; +} + +SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() +{ + return MacOSX; +} + +const String SystemStats::getOperatingSystemName() throw() +{ + return T("Mac OS X"); +} + +bool SystemStats::isOperatingSystem64Bit() throw() +{ +#if JUCE_64BIT + return true; +#else + //xxx not sure how to find this out?.. + return false; +#endif +} + +int SystemStats::getMemorySizeInMegabytes() throw() +{ +#if MACOS_10_4_OR_EARLIER + long bytes; + if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr) + return (int) (((unsigned long) bytes) / (1024 * 1024)); + + return 0; +#else + return (int) ([[NSProcessInfo processInfo] physicalMemory] / (1024 * 1024)); +#endif +} + +bool SystemStats::hasMMX() throw() +{ +#if JUCE_INTEL + return cpuFlags.hasMMX; +#else + return false; +#endif +} + +bool SystemStats::hasSSE() throw() +{ +#if JUCE_INTEL + return cpuFlags.hasSSE; +#else + return false; +#endif +} + +bool SystemStats::hasSSE2() throw() +{ +#if JUCE_INTEL + return cpuFlags.hasSSE2; +#else + return false; +#endif +} + +bool SystemStats::has3DNow() throw() +{ +#if JUCE_INTEL + return cpuFlags.has3DNow; +#else + return false; +#endif +} + +const String SystemStats::getCpuVendor() throw() +{ +#if JUCE_INTEL + char v [16]; + juce_getCpuVendor (v); + return String (v, 16); +#else + return String::empty; +#endif +} + +int SystemStats::getCpuSpeedInMegaherz() throw() +{ +#if MACOS_10_4_OR_EARLIER + return GetCPUSpeed(); +#else + return roundDoubleToInt (getCpuInfo ("cpu MHz").getDoubleValue()); +#endif +} + +int SystemStats::getNumCpus() throw() +{ +#if MACOS_10_4_OR_EARLIER + return MPProcessors(); +#else + return [[NSProcessInfo processInfo] activeProcessorCount]; +#endif +} + +static int64 juce_getMicroseconds() throw() +{ + UnsignedWide t; + Microseconds (&t); + return (((int64) t.hi) << 32) | t.lo; +} + +uint32 juce_millisecondsSinceStartup() throw() +{ + return (uint32) (juce_getMicroseconds() / 1000); +} + +double Time::getMillisecondCounterHiRes() throw() +{ + // xxx might be more accurate to use a scaled AudioGetCurrentHostTime? + return juce_getMicroseconds() * 0.001; +} + +int64 Time::getHighResolutionTicks() throw() +{ + return (int64) AudioGetCurrentHostTime(); +} + +int64 Time::getHighResolutionTicksPerSecond() throw() +{ + return highResTimerFrequency; +} + +int64 SystemStats::getClockCycleCounter() throw() +{ + jassertfalse + return 0; +} + +bool Time::setSystemTimeToThisTime() const throw() +{ + jassertfalse + return false; +} + +int SystemStats::getPageSize() throw() +{ + return NSPageSize(); +} + +void PlatformUtilities::fpuReset() +{ +} + +#endif +/********* End of inlined file: juce_mac_SystemStats.mm *********/ + +/********* Start of inlined file: juce_mac_Network.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE + +static bool getEthernetIterator (io_iterator_t* matchingServices) throw() +{ + mach_port_t masterPort; + + if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS) + { + CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass); + + if (dict != 0) + { + CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault, + 0, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + if (propDict != 0) + { + CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue); + + CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict); + CFRelease (propDict); + } + } + + return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS; + } + + return false; +} + +int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() +{ + int numResults = 0; + io_iterator_t it; + + if (getEthernetIterator (&it)) + { + io_object_t i; + + while ((i = IOIteratorNext (it)) != 0) + { + io_object_t controller; + + if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS) + { + CFTypeRef data = IORegistryEntryCreateCFProperty (controller, + CFSTR (kIOMACAddress), + kCFAllocatorDefault, + 0); + if (data != 0) + { + UInt8 addr [kIOEthernetAddressSize]; + zeromem (addr, sizeof (addr)); + + CFDataGetBytes ((CFDataRef) data, CFRangeMake (0, sizeof (addr)), addr); + CFRelease (data); + + int64 a = 0; + for (int i = 6; --i >= 0;) + a = (a << 8) | addr[i]; + + if (! littleEndian) + a = (int64) swapByteOrder ((uint64) a); + + if (numResults < maxNum) + { + *addresses++ = a; + ++numResults; + } + } + + IOObjectRelease (controller); + } + + IOObjectRelease (i); + } + + IOObjectRelease (it); + } + + return numResults; +} + +bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, + const String& emailSubject, + const String& bodyText, + const StringArray& filesToAttach) +{ + const ScopedAutoReleasePool pool; + + String script; + script << "tell application \"Mail\"\r\n" + "set newMessage to make new outgoing message with properties {subject:\"" + << emailSubject.replace (T("\""), T("\\\"")) + << "\", content:\"" + << bodyText.replace (T("\""), T("\\\"")) + << "\" & return & return}\r\n" + "tell newMessage\r\n" + "set visible to true\r\n" + "set sender to \"sdfsdfsdfewf\"\r\n" + "make new to recipient at end of to recipients with properties {address:\"" + << targetEmailAddress + << "\"}\r\n"; + + for (int i = 0; i < filesToAttach.size(); ++i) + { + script << "tell content\r\n" + "make new attachment with properties {file name:\"" + << filesToAttach[i].replace (T("\""), T("\\\"")) + << "\"} at after the last paragraph\r\n" + "end tell\r\n"; + } + + script << "end tell\r\n" + "end tell\r\n"; + + NSAppleScript* s = [[NSAppleScript alloc] + initWithSource: juceStringToNS (script)]; + NSDictionary* error = 0; + const bool ok = [s executeAndReturnError: &error] != nil; + [s release]; + + return ok; +} + +END_JUCE_NAMESPACE + +using namespace JUCE_NAMESPACE; + +@interface JuceURLConnection : NSObject +{ + NSURLRequest* request; + NSURLConnection* connection; + NSMutableData* data; + Thread* runLoopThread; + bool initialised, hasFailed, hasFinished; + int position; + NSLock* dataLock; +} + +- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req withCallback: (URL::OpenStreamProgressCallback*) callback withContext: (void*) context; +- (void) dealloc; +- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response; +- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error; +- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) data; +- (void) connectionDidFinishLoading: (NSURLConnection*) connection; + +- (BOOL) isOpen; +- (int) read: (char*) dest numBytes: (int) num; +- (int) readPosition; +- (void) stop; +- (void) createConnection; + +@end + +class JuceURLConnectionMessageThread : public Thread +{ + JuceURLConnection* owner; + +public: + JuceURLConnectionMessageThread (JuceURLConnection* owner_) + : Thread (T("http connection")), + owner (owner_) + { + startThread(); + } + + ~JuceURLConnectionMessageThread() + { + stopThread (10000); + } + + void run() + { + [owner createConnection]; + + while (! threadShouldExit()) + { + const ScopedAutoReleasePool pool; + [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; + } + } +}; + +@implementation JuceURLConnection + +- (JuceURLConnection*) initWithRequest: (NSURLRequest*) req + withCallback: (URL::OpenStreamProgressCallback*) callback + withContext: (void*) context; +{ + [super init]; + request = req; + [request retain]; + data = [[NSMutableData data] retain]; + dataLock = [[NSLock alloc] init]; + connection = 0; + initialised = false; + hasFailed = false; + hasFinished = false; + + runLoopThread = new JuceURLConnectionMessageThread (self); + + while (runLoopThread->isThreadRunning() && ! initialised) + { + if (callback != 0) + callback (context, -1, [[request HTTPBody] length]); + + Thread::sleep (1); + } + + return self; +} + +- (void) dealloc +{ + [self stop]; + + delete runLoopThread; + [connection release]; + [data release]; + [dataLock release]; + [request release]; + [super dealloc]; +} + +- (void) createConnection +{ + connection = [[NSURLConnection alloc] initWithRequest: request + delegate: self]; + + if (connection == nil) + runLoopThread->signalThreadShouldExit(); +} + +- (void) connection: (NSURLConnection*) connection didReceiveResponse: (NSURLResponse*) response +{ + [dataLock lock]; + [data setLength: 0]; + [dataLock unlock]; + initialised = true; +} + +- (void) connection: (NSURLConnection*) connection didFailWithError: (NSError*) error +{ + NSLog ([error description]); + hasFailed = true; + initialised = true; + runLoopThread->signalThreadShouldExit(); +} + +- (void) connection: (NSURLConnection*) connection didReceiveData: (NSData*) newData +{ + [dataLock lock]; + [data appendData: newData]; + [dataLock unlock]; + initialised = true; +} + +- (void) connectionDidFinishLoading: (NSURLConnection*) connection +{ + hasFinished = true; + initialised = true; + runLoopThread->signalThreadShouldExit(); +} + +- (BOOL) isOpen +{ + return connection != 0 && ! hasFailed; +} + +- (int) readPosition +{ + return position; +} + +- (int) read: (char*) dest numBytes: (int) numNeeded +{ + int numDone = 0; + + while (numNeeded > 0) + { + int available = jmin (numNeeded, [data length]); + + if (available > 0) + { + [dataLock lock]; + [data getBytes: dest length: available]; + [data replaceBytesInRange: NSMakeRange (0, available) withBytes: nil length: 0]; + [dataLock unlock]; + + numDone += available; + numNeeded -= available; + dest += available; + } + else + { + if (hasFailed || hasFinished) + break; + + Thread::sleep (1); + } + } + + position += numDone; + return numDone; +} + +- (void) stop +{ + [connection cancel]; + runLoopThread->stopThread (10000); +} + +@end +BEGIN_JUCE_NAMESPACE + +bool juce_isOnLine() +{ + return true; +} + +void* juce_openInternetFile (const String& url, + const String& headers, + const MemoryBlock& postData, + const bool isPost, + URL::OpenStreamProgressCallback* callback, + void* callbackContext, + int timeOutMs) +{ + const ScopedAutoReleasePool pool; + + NSMutableURLRequest* req = [NSMutableURLRequest + requestWithURL: [NSURL URLWithString: juceStringToNS (url)] + cachePolicy: NSURLRequestUseProtocolCachePolicy + timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)]; + + if (req == nil) + return 0; + + [req setHTTPMethod: isPost ? @"POST" : @"GET"]; + //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; + + StringArray headerLines; + headerLines.addLines (headers); + headerLines.removeEmptyStrings (true); + + for (int i = 0; i < headerLines.size(); ++i) + { + const String key (headerLines[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); + const String value (headerLines[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); + + if (key.isNotEmpty() && value.isNotEmpty()) + [req addValue: juceStringToNS (value) forHTTPHeaderField: juceStringToNS (key)]; + } + + if (isPost && postData.getSize() > 0) + { + [req setHTTPBody: [NSData dataWithBytes: postData.getData() + length: postData.getSize()]]; + } + + JuceURLConnection* const s = [[JuceURLConnection alloc] initWithRequest: req + withCallback: callback + withContext: callbackContext]; + + if ([s isOpen]) + return s; + + [s release]; + return 0; +} + +void juce_closeInternetFile (void* handle) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + { + const ScopedAutoReleasePool pool; + [s stop]; + [s release]; + } +} + +int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + { + const ScopedAutoReleasePool pool; + return [s read: (char*) buffer numBytes: bytesToRead]; + } + + return 0; +} + +int juce_seekInInternetFile (void* handle, int newPosition) +{ + JuceURLConnection* const s = (JuceURLConnection*) handle; + + if (s != 0) + return [s readPosition]; + + return 0; +} + +#endif +/********* End of inlined file: juce_mac_Network.mm *********/ + +/********* Start of inlined file: juce_mac_Threads.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, 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! +*/ + +void JUCE_API juce_threadEntryPoint (void*); + +void* threadEntryProc (void* userData) throw() +{ + const ScopedAutoReleasePool pool; + juce_threadEntryPoint (userData); + return 0; +} + +void* juce_createThread (void* userData) throw() +{ + pthread_t handle = 0; + + if (pthread_create (&handle, 0, threadEntryProc, userData) == 0) + { + pthread_detach (handle); + return (void*) handle; } - return returnData; + return 0; } -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) +void juce_killThread (void* handle) throw() { - jassertfalse // not implemented! - return false; + if (handle != 0) + pthread_cancel ((pthread_t) handle); } -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) +void juce_setCurrentThreadName (const String& /*name*/) throw() { - jassertfalse // not implemented! - return false; } -void SystemTrayIconComponent::setIconImage (const Image& newImage) +int64 Thread::getCurrentThreadId() throw() { - if (! isOnDesktop ()) - addToDesktop (0); - - LinuxComponentPeer* const wp = dynamic_cast (getPeer()); - - if (wp != 0) - { - wp->setTaskBarIcon (newImage); - - setVisible (true); - toFront (false); - repaint(); - } + return (int64) pthread_self(); } -void SystemTrayIconComponent::paint (Graphics& g) +void juce_setThreadPriority (void* handle, int priority) throw() { - LinuxComponentPeer* const wp = dynamic_cast (getPeer()); - - if (wp != 0) - { - const Image* const image = wp->getTaskbarIcon(); + if (handle == 0) + handle = (void*) pthread_self(); - if (image != 0) - g.drawImageAt (image, 0, 0, false); - } + struct sched_param param; + int policy; + pthread_getschedparam ((pthread_t) handle, &policy, ¶m); + param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11); + pthread_setschedparam ((pthread_t) handle, policy, ¶m); } -void SystemTrayIconComponent::setIconTooltip (const String& tooltip) +void Thread::yield() throw() { - // xxx not yet implemented! + sched_yield(); } -void PlatformUtilities::beep() +void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) throw() { - fprintf (stdout, "\a"); - fflush (stdout); + // xxx + jassertfalse } -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) +bool Process::isForegroundProcess() throw() { - // 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); - - return true; + return [NSApp isActive]; } -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; +void Process::raisePrivilege() +{ + jassertfalse +} -END_JUCE_NAMESPACE +void Process::lowerPrivilege() +{ + jassertfalse +} -#endif -/********* End of inlined file: juce_linux_Windowing.cpp *********/ +void Process::terminate() +{ + exit (0); +} -#endif +void Process::setPriority (ProcessPriority p) +{ + // xxx +} #endif - -//============================================================================== -#if JUCE_MAC - -/********* Start of inlined file: juce_mac_Files.cpp *********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE - -/* - Note that a lot of methods that you'd expect to find in this file actually - live in juce_posix_SharedCode.h! -*/ +/********* End of inlined file: juce_mac_Threads.mm *********/ /********* Start of inlined file: juce_posix_SharedCode.h *********/ /* @@ -251968,139 +263251,17 @@ void InterProcessLock::exit() throw() } /********* End of inlined file: juce_posix_SharedCode.h *********/ -static File executableFile; - -void PlatformUtilities::copyToStr255 (Str255& d, const String& s) -{ - unsigned char* t = (unsigned char*) d; - t[0] = jmin (254, s.length()); - s.copyToBuffer ((char*) t + 1, 254); -} - -void PlatformUtilities::copyToStr63 (Str63& d, const String& s) -{ - unsigned char* t = (unsigned char*) d; - t[0] = jmin (62, s.length()); - s.copyToBuffer ((char*) t + 1, 62); -} - -const String PlatformUtilities::cfStringToJuceString (CFStringRef cfString) -{ - String result; - - if (cfString != 0) - { -#if JUCE_STRINGS_ARE_UNICODE - CFRange range = { 0, CFStringGetLength (cfString) }; - UniChar* const u = (UniChar*) juce_malloc (sizeof (UniChar) * (range.length + 1)); - - CFStringGetCharacters (cfString, range, u); - u[range.length] = 0; - - result = convertUTF16ToString (u); - - juce_free (u); -#else - const int len = CFStringGetLength (cfString); - char* buffer = (char*) juce_malloc (len + 1); - CFStringGetCString (cfString, buffer, len + 1, CFStringGetSystemEncoding()); - result = buffer; - juce_free (buffer); -#endif - } - - return result; -} - -CFStringRef PlatformUtilities::juceStringToCFString (const String& s) -{ -#if JUCE_STRINGS_ARE_UNICODE - const int len = s.length(); - const juce_wchar* t = (const juce_wchar*) s; - - UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); - - for (int i = 0; i <= len; ++i) - temp[i] = t[i]; - - CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); - juce_free (temp); - - return result; - -#else - return CFStringCreateWithCString (kCFAllocatorDefault, - (const char*) s, - CFStringGetSystemEncoding()); -#endif -} - -const String PlatformUtilities::convertUTF16ToString (const UniChar* utf16) -{ - String s; - - while (*utf16 != 0) - s += (juce_wchar) *utf16++; - - return s; -} - -const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) -{ - UnicodeMapping map; - - map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, - kUnicodeNoSubset, - kTextEncodingDefaultFormat); - - map.otherEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, - kUnicodeCanonicalCompVariant, - kTextEncodingDefaultFormat); - - map.mappingVersion = kUnicodeUseLatestMapping; - - UnicodeToTextInfo conversionInfo = 0; - String result; - - if (CreateUnicodeToTextInfo (&map, &conversionInfo) == noErr) - { - const int len = s.length(); - - UniChar* const tempIn = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); - UniChar* const tempOut = (UniChar*) juce_calloc (sizeof (UniChar) * len + 4); - - for (int i = 0; i <= len; ++i) - tempIn[i] = s[i]; - - ByteCount bytesRead = 0; - ByteCount outputBufferSize = 0; - - if (ConvertFromUnicodeToText (conversionInfo, - len * sizeof (UniChar), tempIn, - kUnicodeDefaultDirectionMask, - 0, 0, 0, 0, - len * sizeof (UniChar), &bytesRead, - &outputBufferSize, tempOut) == noErr) - { - result.preallocateStorage (bytesRead / sizeof (UniChar) + 2); - - tchar* t = const_cast ((const tchar*) result); - - int i; - for (i = 0; i < bytesRead / sizeof (UniChar); ++i) - t[i] = (tchar) tempOut[i]; - - t[i] = 0; - } - - juce_free (tempIn); - juce_free (tempOut); +/********* Start of inlined file: juce_mac_Files.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - DisposeUnicodeToTextInfo (&conversionInfo); - } +/* + Note that a lot of methods that you'd expect to find in this file actually + live in juce_posix_SharedCode.h! +*/ - return result; -} +static File executableFile; const unsigned int macTimeToUnixTimeDiff = 0x7c25be90; @@ -252216,80 +263377,13 @@ bool juce_setFileReadOnly (const String& fileName, bool isReadOnly) throw() bool juce_copyFile (const String& src, const String& dst) throw() { - const File destFile (dst); - - if (! destFile.create()) - return false; - - FSRef srcRef, dstRef; - - if (! (PlatformUtilities::makeFSRefFromPath (&srcRef, src) - && PlatformUtilities::makeFSRefFromPath (&dstRef, dst))) - { - return false; - } - - int okForks = 0; - - CatPositionRec iter; - iter.initialize = 0; - HFSUniStr255 forkName; - - // can't just copy the data because this is a bloody Mac, so we need to copy each - // fork separately... - while (FSIterateForks (&srcRef, &iter, &forkName, 0, 0) == noErr) - { - SInt16 srcForkNum = 0, dstForkNum = 0; - OSErr err = FSOpenFork (&srcRef, forkName.length, forkName.unicode, fsRdPerm, &srcForkNum); - - if (err == noErr) - { - err = FSOpenFork (&dstRef, forkName.length, forkName.unicode, fsRdWrPerm, &dstForkNum); - - if (err == noErr) - { - MemoryBlock buf (32768); - SInt64 pos = 0; - - for (;;) - { - ByteCount bytesRead = 0; - err = FSReadFork (srcForkNum, fsFromStart, pos, buf.getSize(), (char*) buf, &bytesRead); - - if (bytesRead > 0) - { - err = FSWriteFork (dstForkNum, fsFromStart, pos, bytesRead, (const char*) buf, &bytesRead); - pos += bytesRead; - } - - if (err != noErr) - { - if (err == eofErr) - ++okForks; - - break; - } - } - - FSFlushFork (dstForkNum); - FSCloseFork (dstForkNum); - } - - FSCloseFork (srcForkNum); - } - } - - if (okForks > 0) // some files seem to be ok even if not all their forks get copied.. - { - // copy permissions.. - struct stat info; - if (juce_stat (src, info)) - chmod (dst.toUTF8(), info.st_mode & 0777); - - return true; - } + const ScopedAutoReleasePool pool; + NSFileManager* fm = [NSFileManager defaultManager]; - return false; + return [fm fileExistsAtPath: juceStringToNS (src)] + && [fm copyPath: juceStringToNS (src) + toPath: juceStringToNS (dst) + handler: nil]; } const StringArray juce_getFileSystemRoots() throw() @@ -252362,15 +263456,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) switch (type) { case userHomeDirectory: - resultPath = getenv ("HOME"); - - if (resultPath == 0) - { - struct passwd* const pw = getpwuid (getuid()); - if (pw != 0) - resultPath = pw->pw_dir; - } - + resultPath = nsStringToJuce (NSHomeDirectory()); break; case userDocumentsDirectory: @@ -252440,26 +263526,12 @@ void juce_setCurrentExecutableFileName (const String& filename) throw() void juce_setCurrentExecutableFileNameFromBundleId (const String& bundleId) throw() { - CFStringRef bundleIdStringRef = PlatformUtilities::juceStringToCFString (bundleId); - CFBundleRef bundleRef = CFBundleGetBundleWithIdentifier (bundleIdStringRef); - CFRelease (bundleIdStringRef); + const ScopedAutoReleasePool pool; - if (bundleRef != 0) - { - CFURLRef exeURLRef = CFBundleCopyExecutableURL (bundleRef); - - if (exeURLRef != 0) - { - CFStringRef pathStringRef = CFURLCopyFileSystemPath (exeURLRef, kCFURLPOSIXPathStyle); - CFRelease (exeURLRef); + NSBundle* b = [NSBundle bundleWithIdentifier: juceStringToNS (bundleId)]; - if (pathStringRef != 0) - { - juce_setCurrentExecutableFileName (PlatformUtilities::cfStringToJuceString (pathStringRef)); - CFRelease (pathStringRef); - } - } - } + if (b != nil) + executableFile = nsStringToJuce ([b executablePath]); } const File File::getCurrentWorkingDirectory() throw() @@ -252617,77 +263689,40 @@ bool juce_launchExecutable (const String& pathAndArguments) throw() bool juce_launchFile (const String& fileName, const String& parameters) throw() { - bool ok = false; + const ScopedAutoReleasePool pool; - if (fileName.startsWithIgnoreCase (T("http:")) - || fileName.startsWithIgnoreCase (T("https:")) - || fileName.startsWithIgnoreCase (T("ftp:")) - || fileName.startsWithIgnoreCase (T("file:"))) - { - CFStringRef urlString = PlatformUtilities::juceStringToCFString (fileName); + if (parameters.isEmpty()) + return [[NSWorkspace sharedWorkspace] openFile: juceStringToNS (fileName)]; - if (urlString != 0) - { - CFURLRef url = CFURLCreateWithString (kCFAllocatorDefault, - urlString, 0); - CFRelease (urlString); + bool ok = false; - if (url != 0) - { - ok = (LSOpenCFURLRef (url, 0) == noErr); - CFRelease (url); - } - } - } - else + FSRef ref; + if (PlatformUtilities::makeFSRefFromPath (&ref, fileName)) { - FSRef ref; - if (PlatformUtilities::makeFSRefFromPath (&ref, fileName)) + if (PlatformUtilities::isBundle (fileName)) { - if (juce_isDirectory (fileName) && parameters.isNotEmpty()) - { - // if we're launching a bundled app with a document.. - StringArray docs; - docs.addTokens (parameters, true); - FSRef* docRefs = new FSRef [docs.size()]; - - for (int i = 0; i < docs.size(); ++i) - PlatformUtilities::makeFSRefFromPath (docRefs + i, docs[i]); + NSMutableArray* urls = [NSMutableArray array]; - LSLaunchFSRefSpec ors; - ors.appRef = &ref; - ors.numDocs = docs.size(); - ors.itemRefs = docRefs; - ors.passThruParams = 0; - ors.launchFlags = kLSLaunchDefaults; - ors.asyncRefCon = 0; + StringArray docs; + docs.addTokens (parameters, true); + for (int i = 0; i < docs.size(); ++i) + [urls addObject: juceStringToNS (docs[i])]; - FSRef actual; - ok = (LSOpenFromRefSpec (&ors, &actual) == noErr); - - delete docRefs; - } - else - { - if (parameters.isNotEmpty()) - ok = juce_launchExecutable (T("\"") + fileName + T("\" ") + parameters); - else - ok = (LSOpenFSRef (&ref, 0) == noErr); - } + ok = [[NSWorkspace sharedWorkspace] openURLs: urls + withAppBundleIdentifier: [[NSBundle bundleWithPath: juceStringToNS (fileName)] bundleIdentifier] + options: nil + additionalEventParamDescriptor: nil + launchIdentifiers: nil]; + } + else + { + ok = juce_launchExecutable (T("\"") + fileName + T("\" ") + parameters); } } return ok; } -bool PlatformUtilities::makeFSSpecFromPath (FSSpec* fs, const String& path) -{ - FSRef ref; - - return makeFSRefFromPath (&ref, path) - && FSGetCatalogInfo (&ref, kFSCatInfoNone, 0, 0, fs, 0) == noErr; -} - bool PlatformUtilities::makeFSRefFromPath (FSRef* destFSRef, const String& path) { return FSPathMakeRef ((const UInt8*) path.toUTF8(), destFSRef, 0) == noErr; @@ -252708,585 +263743,239 @@ const String PlatformUtilities::makePathFromFSRef (FSRef* file) OSType PlatformUtilities::getTypeOfFile (const String& filename) { - FSRef fs; - if (makeFSRefFromPath (&fs, filename)) - { - LSItemInfoRecord info; - - if (LSCopyItemInfoForRef (&fs, kLSRequestTypeCreator, &info) == noErr) - return info.filetype; - } - - return 0; + const ScopedAutoReleasePool pool; + return NSHFSTypeCodeFromFileType (NSHFSTypeOfFile (juceStringToNS (filename))); } bool PlatformUtilities::isBundle (const String& filename) { - FSRef fs; - if (makeFSRefFromPath (&fs, filename)) - { - LSItemInfoRecord info; - - if (LSCopyItemInfoForRef (&fs, kLSItemInfoIsPackage, &info) == noErr) - return (info.flags & kLSItemInfoIsPackage) != 0; - } - - return false; + const ScopedAutoReleasePool pool; + return [[NSWorkspace sharedWorkspace] isFilePackageAtPath: juceStringToNS (filename)]; } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_Files.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 +/********* End of inlined file: juce_mac_Files.mm *********/ -BEGIN_JUCE_NAMESPACE - -struct NamedPipeInternal -{ - String pipeInName, pipeOutName; - int pipeIn, pipeOut; - - bool volatile createdPipe, blocked, stopReadOperation; +/********* Start of inlined file: juce_mac_MiscUtilities.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - static void signalHandler (int) {} -}; - -void NamedPipe::cancelPendingReads() +ScopedAutoReleasePool::ScopedAutoReleasePool() { - while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) - { - NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - - intern->stopReadOperation = true; - - char buffer [1] = { 0 }; - ::write (intern->pipeIn, buffer, 1); - - int timeout = 2000; - while (intern->blocked && --timeout >= 0) - Thread::sleep (2); - - intern->stopReadOperation = false; - } + pool = [[NSAutoreleasePool alloc] init]; } -void NamedPipe::close() +ScopedAutoReleasePool::~ScopedAutoReleasePool() { - 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; - } + [((NSAutoreleasePool*) pool) release]; } -bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) +void PlatformUtilities::beep() { - 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; + NSBeep(); } -int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) +bool AlertWindow::showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel) { - 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; + const ScopedAutoReleasePool pool; + return NSRunAlertPanel (juceStringToNS (title), + juceStringToNS (bodyText), + @"Ok", + isOkCancel ? @"Cancel" : nil, + nil) == 0; } -int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) +bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) { - 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 (files.size() == 0) + return false; - if (numWritten <= 0) - { - bytesWritten = -1; - break; - } + Component* sourceComp = Component::getComponentUnderMouse(); - bytesWritten += numWritten; - p += bytesWritten; - } + if (sourceComp == 0) + { + jassertfalse // this method must be called in response to a + // component's mouseDrag event! + return false; } - return bytesWritten; -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_NamedPipe.cpp *********/ + const ScopedAutoReleasePool pool; -/********* Start of inlined file: juce_mac_SystemStats.mm *********/ + NSView* view = (NSView*) sourceComp->getWindowHandle(); -/********* Start of inlined file: juce_mac_NativeHeaders.h *********/ -#ifndef __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ -#define __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ + if (view == 0) + return false; -#include + NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; + [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] + owner: nil]; -BEGIN_JUCE_NAMESPACE + NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4]; + for (int i = 0; i < files.size(); ++i) + [filesArray addObject: juceStringToNS (files[i])]; -class AutoPool -{ -public: - AutoPool() { pool = [[NSAutoreleasePool alloc] init]; } - ~AutoPool() { [pool release]; } + [pboard setPropertyList: filesArray + forType: NSFilenamesPboardType]; -private: - NSAutoreleasePool* pool; -}; + NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow] + fromView: nil]; + dragPosition.x -= 16; + dragPosition.y -= 16; -END_JUCE_NAMESPACE + [view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])] + at: dragPosition + offset: NSMakeSize (0, 0) + event: [[view window] currentEvent] + pasteboard: pboard + source: view + slideBack: YES]; -static const JUCE_NAMESPACE::String nsStringToJuce (NSString* s) -{ - return JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [s UTF8String]); + return true; } -static NSString* juceStringToNS (const JUCE_NAMESPACE::String& s) +bool DragAndDropContainer::performExternalDragDropOfText (const String& text) { - return [NSString stringWithUTF8String: (const char*) s.toUTF8()]; + jassertfalse // not implemented! + return false; } -#endif -/********* End of inlined file: juce_mac_NativeHeaders.h *********/ - -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE - -static int64 highResTimerFrequency; - -#if JUCE_INTEL - -static void juce_getCpuVendor (char* const v) throw() +bool Desktop::canUseSemiTransparentWindows() throw() { - int vendor[4]; - zerostruct (vendor); - int dummy = 0; - - asm ("mov %%ebx, %%esi \n\t" - "cpuid \n\t" - "xchg %%esi, %%ebx" - : "=a" (dummy), "=S" (vendor[0]), "=c" (vendor[2]), "=d" (vendor[1]) : "a" (0)); - - memcpy (v, vendor, 16); + return true; } -static unsigned int getCPUIDWord (unsigned int& familyModel, unsigned int& extFeatures) throw() +void Desktop::getMousePosition (int& x, int& y) throw() { - unsigned int cpu = 0; - unsigned int ext = 0; - unsigned int family = 0; - unsigned int dummy = 0; - - asm ("mov %%ebx, %%esi \n\t" - "cpuid \n\t" - "xchg %%esi, %%ebx" - : "=a" (family), "=S" (ext), "=c" (dummy), "=d" (cpu) : "a" (1)); - - familyModel = family; - extFeatures = ext; - return cpu; + const ScopedAutoReleasePool pool; + const NSPoint p ([NSEvent mouseLocation]); + x = roundFloatToInt (p.x); + y = roundFloatToInt ([[NSScreen mainScreen] frame].size.height - p.y); } -struct CPUFlags +void Desktop::setMousePosition (int x, int y) throw() { - bool hasMMX : 1; - bool hasSSE : 1; - bool hasSSE2 : 1; - bool has3DNow : 1; -}; - -static CPUFlags cpuFlags; + // this rubbish needs to be done around the warp call, to avoid causing a + // bizarre glitch.. + CGAssociateMouseAndMouseCursorPosition (false); + CGSetLocalEventsSuppressionInterval (0); -#endif + CGPoint pos = { x, y }; + CGWarpMouseCursorPosition (pos); -void Logger::outputDebugString (const String& text) throw() -{ - String withLineFeed (text + T("\n")); - const char* const utf8 = withLineFeed.toUTF8(); - fwrite (utf8, strlen (utf8), 1, stdout); + CGAssociateMouseAndMouseCursorPosition (true); } -void Logger::outputDebugPrintf (const tchar* format, ...) throw() +#if MACOS_10_4_OR_EARLIER +class ScreenSaverDefeater : public Timer, + public DeletedAtShutdown { - String text; - va_list args; - va_start (args, format); - text.vprintf(format, args); - outputDebugString (text); -} +public: + ScreenSaverDefeater() throw() + { + startTimer (10000); + timerCallback(); + } -int SystemStats::getMemorySizeInMegabytes() throw() -{ - long bytes; - if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr) - return (int) (((unsigned long) bytes) / (1024 * 1024)); + ~ScreenSaverDefeater() {} - return 0; -} + void timerCallback() + { + if (Process::isForegroundProcess()) + UpdateSystemActivity (UsrActivity); + } +}; -SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() +static ScreenSaverDefeater* screenSaverDefeater = 0; + +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() { - return MacOSX; + if (screenSaverDefeater == 0) + screenSaverDefeater = new ScreenSaverDefeater(); } -const String SystemStats::getOperatingSystemName() throw() +bool Desktop::isScreenSaverEnabled() throw() { - return T("Mac OS X"); + return screenSaverDefeater == 0; } -bool SystemStats::isOperatingSystem64Bit() throw() -{ -#if JUCE_64BIT - return true; #else - //xxx not sure how to find this out?.. - return false; -#endif -} -void SystemStats::initialiseStats() throw() -{ - static bool initialised = false; +static IOPMAssertionID screenSaverDisablerID = 0; - if (! initialised) +void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() +{ + if (isEnabled) { - initialised = true; - - //[NSApplication sharedApplication]; - NSApplicationLoad(); - -#if JUCE_INTEL + if (screenSaverDisablerID != 0) { - unsigned int familyModel, extFeatures; - const unsigned int features = getCPUIDWord (familyModel, extFeatures); - - cpuFlags.hasMMX = ((features & (1 << 23)) != 0); - cpuFlags.hasSSE = ((features & (1 << 25)) != 0); - cpuFlags.hasSSE2 = ((features & (1 << 26)) != 0); - cpuFlags.has3DNow = ((extFeatures & (1 << 31)) != 0); + IOPMAssertionRelease (screenSaverDisablerID); + screenSaverDisablerID = 0; + } + } + else + { + if (screenSaverDisablerID == 0) + { + IOPMAssertionCreate (kIOPMAssertionTypeNoIdleSleep, + kIOPMAssertionLevelOn, &screenSaverDisablerID); } -#endif - - highResTimerFrequency = (int64) AudioGetHostClockFrequency(); - - String s (SystemStats::getJUCEVersion()); - - rlimit lim; - getrlimit (RLIMIT_NOFILE, &lim); - lim.rlim_cur = lim.rlim_max = RLIM_INFINITY; - setrlimit (RLIMIT_NOFILE, &lim); } } -bool SystemStats::hasMMX() throw() -{ -#if JUCE_INTEL - return cpuFlags.hasMMX; -#else - return false; -#endif -} - -bool SystemStats::hasSSE() throw() -{ -#if JUCE_INTEL - return cpuFlags.hasSSE; -#else - return false; -#endif -} - -bool SystemStats::hasSSE2() throw() -{ -#if JUCE_INTEL - return cpuFlags.hasSSE2; -#else - return false; -#endif -} - -bool SystemStats::has3DNow() throw() +bool Desktop::isScreenSaverEnabled() throw() { -#if JUCE_INTEL - return cpuFlags.has3DNow; -#else - return false; -#endif + return screenSaverDisablerID == 0; } -const String SystemStats::getCpuVendor() throw() -{ -#if JUCE_INTEL - char v [16]; - juce_getCpuVendor (v); - return String (v, 16); -#else - return String::empty; #endif -} - -int SystemStats::getCpuSpeedInMegaherz() throw() -{ - return GetCPUSpeed(); -} - -int SystemStats::getNumCpus() throw() -{ - return MPProcessors(); -} - -static int64 juce_getMicroseconds() throw() -{ - UnsignedWide t; - Microseconds (&t); - return (((int64) t.hi) << 32) | t.lo; -} - -uint32 juce_millisecondsSinceStartup() throw() -{ - return (uint32) (juce_getMicroseconds() / 1000); -} - -double Time::getMillisecondCounterHiRes() throw() -{ - // xxx might be more accurate to use a scaled AudioGetCurrentHostTime? - return juce_getMicroseconds() * 0.001; -} - -int64 Time::getHighResolutionTicks() throw() -{ - return (int64) AudioGetCurrentHostTime(); -} - -int64 Time::getHighResolutionTicksPerSecond() throw() -{ - return highResTimerFrequency; -} - -int64 SystemStats::getClockCycleCounter() throw() -{ - jassertfalse - return 0; -} - -bool Time::setSystemTimeToThisTime() const throw() -{ - jassertfalse - return false; -} - -int SystemStats::getPageSize() throw() -{ - jassertfalse - return 512; //xxx -} - -void PlatformUtilities::fpuReset() -{ -} - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_SystemStats.mm *********/ -/********* Start of inlined file: juce_mac_Threads.cpp *********/ - -#include -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE - -/* - Note that a lot of methods that you'd expect to find in this file actually - live in juce_posix_SharedCode.h! -*/ - -void JUCE_API juce_threadEntryPoint (void*); - -void* threadEntryProc (void* userData) throw() -{ - juce_threadEntryPoint (userData); - return 0; -} - -void* juce_createThread (void* userData) throw() +void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() { - pthread_t handle = 0; + const ScopedAutoReleasePool pool; + monitorCoords.clear(); + NSArray* screens = [NSScreen screens]; + const float mainScreenBottom = [[NSScreen mainScreen] frame].size.height; - if (pthread_create (&handle, 0, threadEntryProc, userData) == 0) + for (int i = 0; i < [screens count]; ++i) { - pthread_detach (handle); - return (void*) handle; - } - - return 0; -} + NSScreen* s = (NSScreen*) [screens objectAtIndex: i]; -void juce_killThread (void* handle) throw() -{ - if (handle != 0) - pthread_cancel ((pthread_t) handle); -} + NSRect r = clipToWorkArea ? [s visibleFrame] + : [s frame]; -void juce_setCurrentThreadName (const String& /*name*/) throw() -{ -} + monitorCoords.add (Rectangle ((int) r.origin.x, + (int) (mainScreenBottom - (r.origin.y + r.size.height)), + (int) r.size.width, + (int) r.size.height)); + } -int Thread::getCurrentThreadId() throw() -{ - return (int) pthread_self(); + jassert (monitorCoords.size() > 0); } -void juce_setThreadPriority (void* handle, int priority) throw() -{ - if (handle == 0) - handle = (void*) pthread_self(); +#endif +/********* End of inlined file: juce_mac_MiscUtilities.mm *********/ - struct sched_param param; - int policy; - pthread_getschedparam ((pthread_t) handle, &policy, ¶m); - param.sched_priority = jlimit (1, 127, 1 + (priority * 126) / 11); - pthread_setschedparam ((pthread_t) handle, policy, ¶m); -} +/********* Start of inlined file: juce_mac_Debugging.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -void Thread::yield() throw() +void Logger::outputDebugString (const String& text) throw() { - sched_yield(); + const ScopedAutoReleasePool pool; + NSLog (juceStringToNS (text + T("\n"))); } -void Thread::setCurrentThreadAffinityMask (const uint32 affinityMask) throw() +void Logger::outputDebugPrintf (const tchar* format, ...) throw() { - // xxx - jassertfalse + String text; + va_list args; + va_start (args, format); + text.vprintf(format, args); + outputDebugString (text); } bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw() @@ -253310,2924 +263999,3115 @@ bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw() return juce_isRunningUnderDebugger(); } -void Process::raisePrivilege() -{ - jassertfalse -} +#endif +/********* End of inlined file: juce_mac_Debugging.mm *********/ -void Process::lowerPrivilege() -{ - jassertfalse -} +#if ! JUCE_ONLY_BUILD_CORE_LIBRARY -void Process::terminate() -{ - exit (0); -} +/********* Start of inlined file: juce_mac_NSViewComponentPeer.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -void Process::setPriority (ProcessPriority p) -{ - // xxx -} +class NSViewComponentPeer; -void* Process::loadDynamicLibrary (const String& name) -{ - // xxx needs to use bundles +static int currentModifiers = 0; - FSSpec fs; - if (PlatformUtilities::makeFSSpecFromPath (&fs, name)) - { - CFragConnectionID connID; - Ptr mainPtr; - Str255 errorMessage; - Str63 nm; - PlatformUtilities::copyToStr63 (nm, name); +END_JUCE_NAMESPACE - const OSErr err = GetDiskFragment (&fs, 0, kCFragGoesToEOF, nm, kReferenceCFrag, &connID, &mainPtr, errorMessage); - if (err == noErr) - return (void*)connID; - } +static void updateModifiers (NSEvent* e); - return 0; -} +using namespace JUCE_NAMESPACE; -void Process::freeDynamicLibrary (void* handle) +@interface JuceNSView : NSView { - if (handle != 0) - CloseConnection ((CFragConnectionID*)&handle); +@public + NSViewComponentPeer* owner; } -void* Process::getProcedureEntryPoint (void* h, const String& procedureName) -{ - if (h != 0) - { - CFragSymbolClass cl; - Ptr ptr; - Str255 name; - PlatformUtilities::copyToStr255 (name, procedureName); - - if (FindSymbol ((CFragConnectionID) h, name, &ptr, &cl) == noErr) - { - return ptr; - } - } +- (JuceNSView*) initWithOwner: (NSViewComponentPeer*) owner withFrame: (NSRect) frame; +- (void) dealloc; - return 0; -} +- (BOOL) isOpaque; +- (void) drawRect: (NSRect) r; + +- (void) mouseDown: (NSEvent*) ev; +- (void) mouseUp: (NSEvent*) ev; +- (void) mouseDragged: (NSEvent*) ev; +- (void) mouseMoved: (NSEvent*) ev; +- (void) mouseEntered: (NSEvent*) ev; +- (void) mouseExited: (NSEvent*) ev; +- (void) rightMouseDown: (NSEvent*) ev; +- (void) rightMouseDragged: (NSEvent*) ev; +- (void) rightMouseUp: (NSEvent*) ev; +- (void) scrollWheel: (NSEvent*) ev; +- (BOOL) acceptsFirstMouse: (NSEvent*) ev; +- (void) frameChanged: (NSNotification*) n; + +- (void) keyDown: (NSEvent*) ev; +- (void) keyUp: (NSEvent*) ev; +- (void) flagsChanged: (NSEvent*) ev; +#if MACOS_10_4_OR_EARLIER +- (BOOL) performKeyEquivalent: (NSEvent*) ev; +#endif + +- (BOOL) becomeFirstResponder; +- (BOOL) resignFirstResponder; + +- (NSArray*) getSupportedDragTypes; +- (BOOL) sendDragCallback: (int) type sender: (id ) sender; +- (NSDragOperation) draggingEntered: (id ) sender; +- (NSDragOperation) draggingUpdated: (id ) sender; +- (void) draggingEnded: (id ) sender; +- (void) draggingExited: (id ) sender; +- (BOOL) prepareForDragOperation: (id ) sender; +- (BOOL) performDragOperation: (id ) sender; +- (void) concludeDragOperation: (id ) sender; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_Threads.cpp *********/ +@end -/********* Start of inlined file: juce_mac_Network.mm *********/ +@interface JuceNSWindow : NSWindow +{ + NSViewComponentPeer* owner; +} -#include -#include -#include -#include +- (void) setOwner: (NSViewComponentPeer*) owner; +- (BOOL) canBecomeKeyWindow; +- (BOOL) windowShouldClose: (id) window; -#include -#include -#include -#include -#include -#include +@end BEGIN_JUCE_NAMESPACE -/********* Start of inlined file: juce_mac_HTTPStream.h *********/ -// (This file gets included by the mac + linux networking code) - -/** A HTTP input stream that uses sockets. -*/ -class JUCE_HTTPSocketStream +class NSViewComponentPeer : public ComponentPeer { public: + NSViewComponentPeer (Component* const component, + const int windowStyleFlags, + NSView* viewToAttachTo); + + ~NSViewComponentPeer(); + + void* getNativeHandle() const; + void setVisible (bool shouldBeVisible); + void setTitle (const String& title); + void setPosition (int x, int y); + void setSize (int w, int h); + void setBounds (int x, int y, int w, int h, const bool isNowFullScreen); + void getBounds (int& x, int& y, int& w, int& h, const bool global) const; + void getBounds (int& x, int& y, int& w, int& h) const; + int getScreenX() const; + int getScreenY() const; + void relativePositionToGlobal (int& x, int& y); + void globalPositionToRelative (int& x, int& y); + void setMinimised (bool shouldBeMinimised); + bool isMinimised() const; + void setFullScreen (bool shouldBeFullScreen); + bool isFullScreen() const; + bool contains (int x, int y, bool trueIfInAChildWindow) const; + const BorderSize getFrameSize() const; + bool setAlwaysOnTop (bool alwaysOnTop); + void toFront (bool makeActiveWindow); + void toBehind (ComponentPeer* other); + void setIcon (const Image& newIcon); + bool handleKeyEvent (NSEvent* ev, bool isKeyDown); + + void viewFocusGain(); + void viewFocusLoss(); + bool isFocused() const; + void grabFocus(); + void textInputRequired (int x, int y); + + void repaint (int x, int y, int w, int h); + void performAnyPendingRepaintsNow(); - JUCE_HTTPSocketStream() - : readPosition (0), - socketHandle (-1), - levelsOfRedirection (0), - timeoutSeconds (15) - { - } + juce_UseDebuggingNewOperator - ~JUCE_HTTPSocketStream() - { - closeSocket(); - } + NSWindow* window; + JuceNSView* view; + bool isSharedWindow, fullScreen; +}; - bool open (const String& url, - const String& headers, - const MemoryBlock& postData, - const bool isPost, - URL::OpenStreamProgressCallback* callback, - void* callbackContext, - int timeOutMs) +class JuceNSImage +{ +public: + JuceNSImage (const int width, const int height, const bool hasAlpha) + : juceImage (hasAlpha ? Image::ARGB : Image::RGB, + width, height, hasAlpha) { - closeSocket(); - - uint32 timeOutTime = Time::getMillisecondCounter(); - - if (timeOutMs == 0) - timeOutTime += 60000; - else if (timeOutMs < 0) - timeOutTime = 0xffffffff; - else - timeOutTime += timeOutMs; + lineStride = 0; + pixelStride = 0; + imageData = juceImage.lockPixelDataReadWrite (0, 0, width, height, + lineStride, pixelStride); - String hostName, hostPath; - int hostPort; + imageRep = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes: &imageData + pixelsWide: width + pixelsHigh: height + bitsPerSample: 8 + samplesPerPixel: pixelStride + hasAlpha: hasAlpha + isPlanar: NO + colorSpaceName: NSCalibratedRGBColorSpace + bitmapFormat: /*NSAlphaFirstBitmapFormat*/ (NSBitmapFormat) 0 + bytesPerRow: lineStride + bitsPerPixel: 8 * pixelStride ]; - if (! decomposeURL (url, hostName, hostPath, hostPort)) - return false; + juceImage.releasePixelDataReadWrite (imageData); + } - const struct hostent* host = 0; - int port = 0; + ~JuceNSImage() + { + [imageRep release]; + } - String proxyName, proxyPath; - int proxyPort = 0; + Image& getJuceImage() throw() { return juceImage; } - String proxyURL (getenv ("http_proxy")); - if (proxyURL.startsWithIgnoreCase (T("http://"))) + void draw (const float x, const float y, + const RectangleList& clip, + const int originX, const int originY) const + { + // Our data is BGRA and the damned image rep only takes RGBA, so + // we need to byte-swap the active areas if there's an alpha channel... + if (juceImage.hasAlphaChannel()) { - if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort)) - return false; + RectangleList::Iterator iter (clip); + while (iter.next()) + { + const Rectangle* const r = iter.getRectangle(); - host = gethostbyname ((const char*) proxyName.toUTF8()); - port = proxyPort; - } - else - { - host = gethostbyname ((const char*) hostName.toUTF8()); - port = hostPort; + swapRGBOrder (r->getX() + originX, + r->getY() + originY, + r->getWidth(), + r->getHeight()); + } } - if (host == 0) - return false; + NSPoint p; + p.x = x; + p.y = y; + [imageRep drawAtPoint: p]; + } - struct sockaddr_in address; - zerostruct (address); - memcpy ((void*) &address.sin_addr, (const void*) host->h_addr, host->h_length); - address.sin_family = host->h_addrtype; - address.sin_port = htons (port); + void drawNSImage (NSImage* imageToDraw) + { + const ScopedAutoReleasePool pool; - socketHandle = socket (host->h_addrtype, SOCK_STREAM, 0); + [NSGraphicsContext setCurrentContext: + [NSGraphicsContext graphicsContextWithBitmapImageRep: imageRep]]; - if (socketHandle == -1) - return false; + [imageToDraw drawAtPoint: NSZeroPoint + fromRect: NSMakeRect (0, 0, [imageToDraw size].width, [imageToDraw size].height) + operation: NSCompositeSourceOver + fraction: 1.0f]; - int receiveBufferSize = 16384; - setsockopt (socketHandle, SOL_SOCKET, SO_RCVBUF, (char*) &receiveBufferSize, sizeof (receiveBufferSize)); - setsockopt (socketHandle, SOL_SOCKET, SO_KEEPALIVE, 0, 0); + [[NSGraphicsContext currentContext] flushGraphics]; -#if JUCE_MAC - setsockopt (socketHandle, SOL_SOCKET, SO_NOSIGPIPE, 0, 0); -#endif + if (juceImage.hasAlphaChannel()) + swapRGBOrder (0, 0, juceImage.getWidth(), juceImage.getHeight()); + } - if (connect (socketHandle, (struct sockaddr*) &address, sizeof (address)) == -1) - { - closeSocket(); - return false; - } +private: + Image juceImage; + NSBitmapImageRep* imageRep; + uint8* imageData; + int pixelStride, lineStride; + + void swapRGBOrder (const int x, const int y, const int w, int h) const + { + jassert (Rectangle (0, 0, juceImage.getWidth(), juceImage.getHeight()) + .contains (Rectangle (x, y, w, h))); - const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, - proxyName, proxyPort, - hostPath, url, - headers, postData, - isPost)); - int totalHeaderSent = 0; + uint8* start = imageData + x * pixelStride + y * lineStride; - while (totalHeaderSent < requestHeader.getSize()) + while (--h >= 0) { - if (Time::getMillisecondCounter() > timeOutTime) + uint8* p = start; + start += lineStride; + + for (int i = w; --i >= 0;) { - closeSocket(); - return false; + const uint8 temp = p[0]; + p[0] = p[2]; + p[2] = temp; + + p += pixelStride; } + } + } +}; - const int numToSend = jmin (1024, requestHeader.getSize() - totalHeaderSent); +static ComponentPeer* currentlyFocusedPeer = 0; +static VoidArray keysCurrentlyDown; - if (send (socketHandle, - ((const char*) requestHeader.getData()) + totalHeaderSent, - numToSend, 0) - != numToSend) - { - closeSocket(); - return false; - } +bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() +{ + if (keysCurrentlyDown.contains ((void*) keyCode)) + return true; - totalHeaderSent += numToSend; + if (keyCode >= 'A' && keyCode <= 'Z' + && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toLowerCase ((tchar) keyCode))) + return true; - if (callback != 0 && ! callback (callbackContext, totalHeaderSent, requestHeader.getSize())) - { - closeSocket(); - return false; - } - } + if (keyCode >= 'a' && keyCode <= 'z' + && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toUpperCase ((tchar) keyCode))) + return true; - const String responseHeader (readResponse (timeOutTime)); + return false; +} - if (responseHeader.isNotEmpty()) - { - //DBG (responseHeader); +static int getKeyCodeFromEvent (NSEvent* ev) +{ + String unicode (nsStringToJuce ([ev characters])); + String unmodified (nsStringToJuce ([ev charactersIgnoringModifiers])); + int keyCode = unmodified[0]; - StringArray lines; - lines.addLines (responseHeader); + if (keyCode == 0x19) // (backwards-tab) + keyCode = 9; - // NB - using charToString() here instead of just T(" "), because that was - // causing a mysterious gcc internal compiler error... - const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) - .substring (0, 3) - .getIntValue(); + return keyCode; +} - //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); - //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); +static void updateKeysDown (NSEvent* ev, bool isKeyDown) +{ + updateModifiers (ev); + int keyCode = getKeyCodeFromEvent (ev); - String location (findHeaderItem (lines, T("Location:"))); + if (keyCode != 0) + { + if (isKeyDown) + keysCurrentlyDown.addIfNotAlreadyThere ((void*) keyCode); + else + keysCurrentlyDown.removeValue ((void*) keyCode); + } +} - if (statusCode >= 300 && statusCode < 400 - && location.isNotEmpty()) - { - if (! location.startsWithIgnoreCase (T("http://"))) - location = T("http://") + location; +const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() +{ + return ModifierKeys (currentModifiers); +} - if (levelsOfRedirection++ < 3) - return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); - } - else - { - levelsOfRedirection = 0; - return true; - } - } +void ModifierKeys::updateCurrentModifiers() throw() +{ + currentModifierFlags = currentModifiers; +} - closeSocket(); - return false; - } +END_JUCE_NAMESPACE - int read (void* buffer, int bytesToRead) - { - fd_set readbits; - FD_ZERO (&readbits); - FD_SET (socketHandle, &readbits); +@implementation JuceNSView - struct timeval tv; - tv.tv_sec = timeoutSeconds; - tv.tv_usec = 0; +- (JuceNSView*) initWithOwner: (NSViewComponentPeer*) owner_ + withFrame: (NSRect) frame +{ + [super initWithFrame: frame]; + owner = owner_; - if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) - return 0; // (timeout) + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector (frameChanged:) + name: NSViewFrameDidChangeNotification + object: self]; - const int bytesRead = jmax (0, recv (socketHandle, buffer, bytesToRead, MSG_WAITALL)); - readPosition += bytesRead; - return bytesRead; + if (! owner_->isSharedWindow) + { + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector (frameChanged:) + name: NSWindowDidMoveNotification + object: owner_->window]; } - int readPosition; - - juce_UseDebuggingNewOperator + [self registerForDraggedTypes: [self getSupportedDragTypes]]; -private: - int socketHandle, levelsOfRedirection; - const int timeoutSeconds; + return self; +} - void closeSocket() - { - if (socketHandle >= 0) - close (socketHandle); +- (void) dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver: self]; + [super dealloc]; +} - socketHandle = -1; - } +- (void) drawRect: (NSRect) r +{ + if (r.size.width < 1.0f || r.size.height < 1.0f || owner == 0) + return; - const MemoryBlock createRequestHeader (const String& hostName, - const int hostPort, - const String& proxyName, - const int proxyPort, - const String& hostPath, - const String& originalURL, - const String& headers, - const MemoryBlock& postData, - const bool isPost) - { - String header (isPost ? "POST " : "GET "); + const float y = [self frame].size.height - (r.origin.y + r.size.height); - if (proxyName.isEmpty()) - { - header << hostPath << " HTTP/1.0\r\nHost: " - << hostName << ':' << hostPort; - } - else - { - header << originalURL << " HTTP/1.0\r\nHost: " - << proxyName << ':' << proxyPort; - } + JuceNSImage temp ((int) (r.size.width + 0.5f), + (int) (r.size.height + 0.5f), + ! owner->getComponent()->isOpaque()); - header << "\r\nUser-Agent: JUCE/" - << JUCE_MAJOR_VERSION << '.' << JUCE_MINOR_VERSION - << "\r\nConnection: Close\r\nContent-Length: " - << postData.getSize() << "\r\n" - << headers << "\r\n"; + LowLevelGraphicsSoftwareRenderer context (temp.getJuceImage()); + const int originX = -roundFloatToInt (r.origin.x); + const int originY = -roundFloatToInt (y); + context.setOrigin (originX, originY); - MemoryBlock mb; - mb.append (header.toUTF8(), (int) strlen (header.toUTF8())); - mb.append (postData.getData(), postData.getSize()); + const NSRect* rects = 0; + NSInteger numRects = 0; + [self getRectsBeingDrawn: &rects count: &numRects]; - return mb; + RectangleList clip; + for (int i = 0; i < numRects; ++i) + { + clip.addWithoutMerging (Rectangle (roundFloatToInt (rects[i].origin.x), + roundFloatToInt ([self frame].size.height - (rects[i].origin.y + rects[i].size.height)), + roundFloatToInt (rects[i].size.width), + roundFloatToInt (rects[i].size.height))); } - const String readResponse (const uint32 timeOutTime) + if (context.reduceClipRegion (clip)) { - int bytesRead = 0, numConsecutiveLFs = 0; - MemoryBlock buffer (1024, true); - - while (numConsecutiveLFs < 2 && bytesRead < 32768 - && Time::getMillisecondCounter() <= timeOutTime) - { - fd_set readbits; - FD_ZERO (&readbits); - FD_SET (socketHandle, &readbits); + owner->handlePaint (context); + temp.draw (r.origin.x, r.origin.y, clip, originX, originY); + } +} - struct timeval tv; - tv.tv_sec = timeoutSeconds; - tv.tv_usec = 0; +- (BOOL) isOpaque +{ + if (owner == 0) + return true; - if (select (socketHandle + 1, &readbits, 0, 0, &tv) <= 0) - return String::empty; // (timeout) + if (! owner->getComponent()->isValidComponent()) + return false; - buffer.ensureSize (bytesRead + 8, true); - char* const dest = (char*) buffer.getData() + bytesRead; + return owner->getComponent()->isOpaque(); +} - if (recv (socketHandle, dest, 1, 0) == -1) - return String::empty; +static int64 getMouseTime (NSEvent* e) { return (int64) [e timestamp] * 1000.0; } - const char lastByte = *dest; - ++bytesRead; +static void getMousePos (NSEvent* e, NSView* view, int& x, int& y) +{ + NSPoint p = [view convertPoint: [e locationInWindow] fromView: nil]; + x = roundFloatToInt (p.x); + y = roundFloatToInt ([view frame].size.height - p.y); +} - if (lastByte == '\n') - ++numConsecutiveLFs; - else if (lastByte != '\r') - numConsecutiveLFs = 0; - } +static void updateModifiers (NSEvent* e) +{ + int m = currentModifiers & ~(ModifierKeys::shiftModifier | ModifierKeys::ctrlModifier + | ModifierKeys::altModifier | ModifierKeys::commandModifier); - const String header (String::fromUTF8 ((const uint8*) buffer.getData())); + if ((e.modifierFlags & NSShiftKeyMask) != 0) + m |= ModifierKeys::shiftModifier; - if (header.startsWithIgnoreCase (T("HTTP/"))) - return header.trimEnd(); + if ((e.modifierFlags & NSControlKeyMask) != 0) + m |= ModifierKeys::ctrlModifier; - return String::empty; - } + if ((e.modifierFlags & NSAlternateKeyMask) != 0) + m |= ModifierKeys::altModifier; - static bool decomposeURL (const String& url, - String& host, String& path, int& port) - { - if (! url.startsWithIgnoreCase (T("http://"))) - return false; + if ((e.modifierFlags & NSCommandKeyMask) != 0) + m |= ModifierKeys::commandModifier; - const int nextSlash = url.indexOfChar (7, '/'); - int nextColon = url.indexOfChar (7, ':'); - if (nextColon > nextSlash && nextSlash > 0) - nextColon = -1; + currentModifiers = m; +} - if (nextColon >= 0) - { - host = url.substring (7, nextColon); +static int getModifierForButtonNumber (const int num) throw() +{ + return num == 0 ? ModifierKeys::leftButtonModifier + : (num == 1 ? ModifierKeys::rightButtonModifier + : (num == 2 ? ModifierKeys::middleButtonModifier : 0)); +} - if (nextSlash >= 0) - port = url.substring (nextColon + 1, nextSlash).getIntValue(); - else - port = url.substring (nextColon + 1).getIntValue(); - } - else - { - port = 80; +- (void) mouseDown: (NSEvent*) ev +{ + updateModifiers (ev); + currentModifiers |= getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); - if (nextSlash >= 0) - host = url.substring (7, nextSlash); - else - host = url.substring (7); - } + if (owner != 0) + owner->handleMouseDown (x, y, getMouseTime (ev)); +} - if (nextSlash >= 0) - path = url.substring (nextSlash); - else - path = T("/"); +- (void) mouseUp: (NSEvent*) ev +{ + const int oldMods = currentModifiers; + updateModifiers (ev); + currentModifiers &= ~getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); - return true; - } + if (owner != 0) + owner->handleMouseUp (oldMods, x, y, getMouseTime (ev)); +} - static const String findHeaderItem (const StringArray& lines, const String& itemName) - { - for (int i = 0; i < lines.size(); ++i) - if (lines[i].startsWithIgnoreCase (itemName)) - return lines[i].substring (itemName.length()).trim(); +- (void) mouseDragged: (NSEvent*) ev +{ + updateModifiers (ev); + currentModifiers |= getModifierForButtonNumber ([ev buttonNumber]); + int x, y; + getMousePos (ev, self, x, y); - return String::empty; - } -}; + if (owner != 0) + owner->handleMouseDrag (x, y, getMouseTime (ev)); +} -bool juce_isOnLine() +- (void) mouseMoved: (NSEvent*) ev { - return true; + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); + + if (owner != 0) + owner->handleMouseMove (x, y, getMouseTime (ev)); } -void* juce_openInternetFile (const String& url, - const String& headers, - const MemoryBlock& postData, - const bool isPost, - URL::OpenStreamProgressCallback* callback, - void* callbackContext, - int timeOutMs) +- (void) mouseEntered: (NSEvent*) ev { - JUCE_HTTPSocketStream* const s = new JUCE_HTTPSocketStream(); - - if (s->open (url, headers, postData, isPost, - callback, callbackContext, timeOutMs)) - return s; + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); - delete s; - return 0; + if (owner != 0) + owner->handleMouseEnter (x, y, getMouseTime (ev)); } -void juce_closeInternetFile (void* handle) +- (void) mouseExited: (NSEvent*) ev { - JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + updateModifiers (ev); + int x, y; + getMousePos (ev, self, x, y); - if (s != 0) - delete s; + if (owner != 0) + owner->handleMouseExit (x, y, getMouseTime (ev)); } -int juce_readFromInternetFile (void* handle, void* buffer, int bytesToRead) +- (void) rightMouseDown: (NSEvent*) ev { - JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + [self mouseDown: ev]; +} - if (s != 0) - return s->read (buffer, bytesToRead); +- (void) rightMouseDragged: (NSEvent*) ev +{ + [self mouseDragged: ev]; +} - return 0; +- (void) rightMouseUp: (NSEvent*) ev +{ + [self mouseUp: ev]; } -int juce_seekInInternetFile (void* handle, int newPosition) +- (void) scrollWheel: (NSEvent*) ev { - JUCE_HTTPSocketStream* const s = (JUCE_HTTPSocketStream*) handle; + updateModifiers (ev); - if (s != 0) - return s->readPosition; + if (owner != 0) + owner->handleMouseWheel (roundFloatToInt ([ev deltaX] * 10.0f), + roundFloatToInt ([ev deltaY] * 10.0f), + getMouseTime (ev)); +} - return 0; +- (BOOL) acceptsFirstMouse: (NSEvent*) ev +{ + return YES; } -/********* End of inlined file: juce_mac_HTTPStream.h *********/ -static bool GetEthernetIterator (io_iterator_t* matchingServices) throw() +- (void) frameChanged: (NSNotification*) n { - mach_port_t masterPort; + if (owner != 0) + owner->handleMovedOrResized(); +} - if (IOMasterPort (MACH_PORT_NULL, &masterPort) == KERN_SUCCESS) +- (void) keyDown: (NSEvent*) ev +{ + bool used = false; + + if (owner != 0) { - CFMutableDictionaryRef dict = IOServiceMatching (kIOEthernetInterfaceClass); + updateKeysDown (ev, true); + used = owner->handleKeyEvent (ev, true); - if (dict != 0) + if ((ev.modifierFlags & NSCommandKeyMask) != 0) { - CFMutableDictionaryRef propDict = CFDictionaryCreateMutable (kCFAllocatorDefault, - 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - if (propDict != 0) - { - CFDictionarySetValue (propDict, CFSTR (kIOPrimaryInterface), kCFBooleanTrue); - - CFDictionarySetValue (dict, CFSTR (kIOPropertyMatchKey), propDict); - CFRelease (propDict); - } + // for command keys, the key-up event is thrown away, so simulate one.. + updateKeysDown (ev, false); + used = owner->handleKeyEvent (ev, false) || used; } - - return IOServiceGetMatchingServices (masterPort, dict, matchingServices) == KERN_SUCCESS; } - return false; + if (! used) + [super keyDown: ev]; } -int SystemStats::getMACAddresses (int64* addresses, int maxNum, const bool littleEndian) throw() +- (void) keyUp: (NSEvent*) ev { - int numResults = 0; - io_iterator_t it; - - if (GetEthernetIterator (&it)) - { - io_object_t i; + updateKeysDown (ev, false); - while ((i = IOIteratorNext (it)) != 0) - { - io_object_t controller; + if (owner == 0 || ! owner->handleKeyEvent (ev, false)) + [super keyUp: ev]; +} - if (IORegistryEntryGetParentEntry (i, kIOServicePlane, &controller) == KERN_SUCCESS) - { - CFTypeRef data = IORegistryEntryCreateCFProperty (controller, - CFSTR (kIOMACAddress), - kCFAllocatorDefault, - 0); - if (data != 0) - { - UInt8 addr [kIOEthernetAddressSize]; - zeromem (addr, sizeof (addr)); +- (void) flagsChanged: (NSEvent*) ev +{ + updateModifiers (ev); - CFDataGetBytes ((CFDataRef) data, CFRangeMake (0, sizeof (addr)), addr); - CFRelease (data); + if (owner != 0) + owner->handleModifierKeysChange(); +} - int64 a = 0; - for (int i = 6; --i >= 0;) - a = (a << 8) | addr[i]; +#if MACOS_10_4_OR_EARLIER +- (BOOL) performKeyEquivalent: (NSEvent*) ev +{ + if (owner != 0) + { + updateKeysDown (ev, true); + const bool used1 = owner->handleKeyEvent (ev, true); + updateKeysDown (ev, false); + const bool used2 = owner->handleKeyEvent (ev, false); - if (! littleEndian) - a = (int64) swapByteOrder ((uint64) a); + if (used1 || used2) + return true; + } - if (numResults < maxNum) - { - *addresses++ = a; - ++numResults; - } - } + return [super performKeyEquivalent: ev]; +} +#endif - IOObjectRelease (controller); - } +- (BOOL) becomeFirstResponder +{ + if (owner != 0) + owner->viewFocusGain(); - IOObjectRelease (i); - } + return true; +} - IOObjectRelease (it); - } +- (BOOL) resignFirstResponder +{ + if (owner != 0) + owner->viewFocusLoss(); - return numResults; + return true; } -bool PlatformUtilities::launchEmailWithAttachments (const String& targetEmailAddress, - const String& emailSubject, - const String& bodyText, - const StringArray& filesToAttach) +- (NSArray*) getSupportedDragTypes { - const AutoPool pool; + return [NSArray arrayWithObjects: NSFilenamesPboardType, /*NSFilesPromisePboardType, NSStringPboardType,*/ nil]; +} - String script; - script << "tell application \"Mail\"\r\n" - "set newMessage to make new outgoing message with properties {subject:\"" - << emailSubject.replace (T("\""), T("\\\"")) - << "\", content:\"" - << bodyText.replace (T("\""), T("\\\"")) - << "\" & return & return}\r\n" - "tell newMessage\r\n" - "set visible to true\r\n" - "set sender to \"sdfsdfsdfewf\"\r\n" - "make new to recipient at end of to recipients with properties {address:\"" - << targetEmailAddress - << "\"}\r\n"; +- (BOOL) sendDragCallback: (int) type sender: (id ) sender +{ + NSString* bestType + = [[sender draggingPasteboard] availableTypeFromArray: [self getSupportedDragTypes]]; - for (int i = 0; i < filesToAttach.size(); ++i) - { - script << "tell content\r\n" - "make new attachment with properties {file name:\"" - << filesToAttach[i].replace (T("\""), T("\\\"")) - << "\"} at after the last paragraph\r\n" - "end tell\r\n"; - } + if (bestType == nil) + return false; - script << "end tell\r\n" - "end tell\r\n"; + NSPoint p = [self convertPoint: [sender draggingLocation] fromView: nil]; + int x = (int) p.x; + int y = (int) ([self frame].size.height - p.y); - NSAppleScript* s = [[NSAppleScript alloc] - initWithSource: [NSString stringWithUTF8String: (const char*) script.toUTF8()]]; - NSDictionary* error = 0; - const bool ok = [s executeAndReturnError: &error] != nil; - [s release]; + StringArray files; - return ok; -} + id list = [[sender draggingPasteboard] propertyListForType: bestType]; + if (list == nil) + return false; -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_Network.mm *********/ + if ([list isKindOfClass: [NSArray class]]) + { + NSArray* items = (NSArray*) list; -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY + for (int i = 0; i < [items count]; ++i) + files.add (nsStringToJuce ((NSString*) [items objectAtIndex: i])); + } -/********* Start of inlined file: juce_mac_AudioCDBurner.mm *********/ + if (files.size() == 0) + return false; -#if JUCE_USE_CDBURNER + if (type == 0) + owner->handleFileDragMove (files, x, y); + else if (type == 1) + owner->handleFileDragExit (files); + else if (type == 2) + owner->handleFileDragDrop (files, x, y); -#import + return true; +} -BEGIN_JUCE_NAMESPACE +- (NSDragOperation) draggingEntered: (id ) sender +{ + if ([self sendDragCallback: 0 sender: sender]) + return NSDragOperationCopy | NSDragOperationMove | NSDragOperationGeneric; + else + return NSDragOperationNone; +} -END_JUCE_NAMESPACE +- (NSDragOperation) draggingUpdated: (id ) sender +{ + if ([self sendDragCallback: 0 sender: sender]) + return NSDragOperationCopy | NSDragOperationMove | NSDragOperationGeneric; + else + return NSDragOperationNone; +} -@interface OpenDiskDevice : NSObject +- (void) draggingEnded: (id ) sender { - DRDevice* device; + [self sendDragCallback: 1 sender: sender]; +} - NSMutableArray* tracks; +- (void) draggingExited: (id ) sender +{ + [self sendDragCallback: 1 sender: sender]; } -- (OpenDiskDevice*) initWithDevice: (DRDevice*) device; -- (void) dealloc; -- (bool) isDiskPresent; -- (int) getNumAvailableAudioBlocks; -- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; -- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error - ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; -@end +- (BOOL) prepareForDragOperation: (id ) sender +{ + return YES; +} -@interface AudioTrackProducer : NSObject +- (BOOL) performDragOperation: (id ) sender { - JUCE_NAMESPACE::AudioSource* source; - int readPosition, lengthInFrames; + return [self sendDragCallback: 2 sender: sender]; } -- (AudioTrackProducer*) init: (int) lengthInFrames; -- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; -- (void) dealloc; -- (void) setupTrackProperties: (DRTrack*) track; +- (void) concludeDragOperation: (id ) sender +{ +} -- (void) cleanupTrackAfterBurn: (DRTrack*) track; -- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track; -- (uint64_t) estimateLengthOfTrack:(DRTrack*)track; -- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn - toMedia:(NSDictionary*)mediaInfo; -- (BOOL) prepareTrackForVerification:(DRTrack*)track; -- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags; -- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags; @end -@implementation OpenDiskDevice +@implementation JuceNSWindow -- (OpenDiskDevice*) initWithDevice: (DRDevice*) device_ +- (void) setOwner: (NSViewComponentPeer*) owner_ { - [super init]; - - device = device_; - tracks = [[NSMutableArray alloc] init]; - return self; + owner = owner_; } -- (void) dealloc +- (BOOL) canBecomeKeyWindow { - [tracks release]; - [super dealloc]; + // If runnin as a plugin, let the component decide whether it's + // going to allow the window to get focused. + return JUCEApplication::getInstance() != 0 + || (ComponentPeer::isValidPeer (owner) + && owner->getComponent()->getWantsKeyboardFocus()); } -- (bool) isDiskPresent +- (BOOL) windowShouldClose: (id) window { - return [device isValid] - && [[[device status] objectForKey: DRDeviceMediaStateKey] - isEqualTo: DRDeviceMediaStateMediaPresent]; -} + if (! ComponentPeer::isValidPeer (owner)) + return YES; -- (int) getNumAvailableAudioBlocks -{ - return [[[[device status] objectForKey: DRDeviceMediaInfoKey] - objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; + owner->handleUserClosingWindow(); + return NO; } -- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ -{ - AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; - DRTrack* t = [[DRTrack alloc] initWithProducer: p]; - [p setupTrackProperties: t]; - - [tracks addObject: t]; +@end - [t release]; - [p release]; -} +BEGIN_JUCE_NAMESPACE -- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error - ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting +NSViewComponentPeer::NSViewComponentPeer (Component* const component, + const int windowStyleFlags, + NSView* viewToAttachTo) + : ComponentPeer (component, windowStyleFlags), + view (0), + window (0) { - DRBurn* burn = [DRBurn burnForDevice: device]; + NSRect r; + r.origin.x = 0; + r.origin.y = 0; + r.size.width = (float) component->getWidth(); + r.size.height = (float) component->getHeight(); - if (! [device acquireExclusiveAccess]) + view = [[JuceNSView alloc] initWithOwner: this withFrame: r]; + [view setPostsFrameChangedNotifications: YES]; + + if (viewToAttachTo != 0) { - *error = "Couldn't open or write to the CD device"; - return; + window = [viewToAttachTo window]; + [viewToAttachTo addSubview: view]; + isSharedWindow = true; } + else + { + isSharedWindow = false; + r.origin.x = (float) component->getX(); + r.origin.y = (float) component->getY(); - [device acquireMediaReservation]; - - NSMutableDictionary* d = [[burn properties] mutableCopy]; - [d autorelease]; - [d setObject: [NSNumber numberWithBool: peformFakeBurnForTesting] forKey: DRBurnTestingKey]; - [d setObject: [NSNumber numberWithBool: false] forKey: DRBurnVerifyDiscKey]; - [d setObject: (shouldEject ? DRBurnCompletionActionEject : DRBurnCompletionActionMount) - forKey: DRBurnCompletionActionKey]; - [burn setProperties: d]; + unsigned int style = 0; + if ((windowStyleFlags & windowHasTitleBar) == 0) + style = NSBorderlessWindowMask; + else + style = NSTitledWindowMask; - [burn writeLayout: tracks]; + if ((windowStyleFlags & windowHasMinimiseButton) != 0) + style |= NSMiniaturizableWindowMask; - for (;;) - { - JUCE_NAMESPACE::Thread::sleep (300); - float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; + if ((windowStyleFlags & windowHasCloseButton) != 0) + style |= NSClosableWindowMask; -NSLog ([[burn status] description]); + if ((windowStyleFlags & windowIsResizable) != 0) + style |= NSResizableWindowMask; - if (listener != 0 && listener->audioCDBurnProgress (progress)) - { - [burn abort]; - *error = "User cancelled the write operation"; - break; - } + window = [[JuceNSWindow alloc] initWithContentRect: r + styleMask: style + backing: NSBackingStoreBuffered + defer: YES ]; - if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateFailed]) - { - *error = "Write operation failed"; - break; - } - else if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateDone]) - { - break; - } + [((JuceNSWindow*) window) setOwner: this]; + [window setDelegate: window]; + [window setOpaque: component->isOpaque()]; + [window setHasShadow: ((windowStyleFlags & windowHasDropShadow) != 0)]; - NSString* err = (NSString*) [[[burn status] objectForKey: DRErrorStatusKey] - objectForKey: DRErrorStatusErrorStringKey]; + if (component->isAlwaysOnTop()) + [window setLevel: NSFloatingWindowLevel]; - if ([err length] > 0) - { - *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); - break; - } + [window setContentView: view]; + [window setAutodisplay: YES]; + [window setAcceptsMouseMovedEvents: YES]; + [window setReleasedWhenClosed: YES]; + [window setExcludedFromWindowsMenu: (windowStyleFlags & windowIsTemporary) != 0]; + [window setIgnoresMouseEvents: (windowStyleFlags & windowIgnoresMouseClicks) != 0]; } - [device releaseMediaReservation]; - [device releaseExclusiveAccess]; -} -@end - -@implementation AudioTrackProducer - -- (AudioTrackProducer*) init: (int) lengthInFrames_ -{ - lengthInFrames = lengthInFrames_; - readPosition = 0; - return self; + setVisible (component->isVisible()); } -- (void) setupTrackProperties: (DRTrack*) track +NSViewComponentPeer::~NSViewComponentPeer() { - NSMutableDictionary* p = [[track properties] mutableCopy]; - [p setObject:[DRMSF msfWithFrames: lengthInFrames] forKey: DRTrackLengthKey]; - [p setObject:[NSNumber numberWithUnsignedShort:2352] forKey: DRBlockSizeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRDataFormKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRBlockTypeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRTrackModeKey]; - [p setObject:[NSNumber numberWithInt:0] forKey: DRSessionFormatKey]; + view->owner = 0; + [view removeFromSuperview]; + [view release]; - [track setProperties: p]; - [p release]; + if (! isSharedWindow) + [window close]; } -- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples +void* NSViewComponentPeer::getNativeHandle() const { - AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; - - if (s != nil) - s->source = source_; - - return s; + return view; } -- (void) dealloc +void NSViewComponentPeer::setVisible (bool shouldBeVisible) { - if (source != 0) + if (isSharedWindow) { - source->releaseResources(); - delete source; + [view setHidden: ! shouldBeVisible]; + } + else + { + if (shouldBeVisible) + [window orderFront: nil]; + else + [window orderOut: nil]; } - - [super dealloc]; } -- (void) cleanupTrackAfterBurn: (DRTrack*) track +void NSViewComponentPeer::setTitle (const String& title) { -} + const ScopedAutoReleasePool pool; -- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track -{ - return true; + if (! isSharedWindow) + [window setTitle: juceStringToNS (title)]; } -- (uint64_t) estimateLengthOfTrack:(DRTrack*)track +void NSViewComponentPeer::setPosition (int x, int y) { - return lengthInFrames; + setBounds (x, y, component->getWidth(), component->getHeight(), false); } -- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn - toMedia:(NSDictionary*)mediaInfo +void NSViewComponentPeer::setSize (int w, int h) { - if (source != 0) - source->prepareToPlay (44100 / 75, 44100); - - readPosition = 0; - return true; + setBounds (component->getX(), component->getY(), w, h, false); } -- (BOOL) prepareTrackForVerification:(DRTrack*)track +void NSViewComponentPeer::setBounds (int x, int y, int w, int h, const bool isNowFullScreen) { - if (source != 0) - source->prepareToPlay (44100 / 75, 44100); + fullScreen = isNowFullScreen; + w = jmax (0, w); + h = jmax (0, h); - return true; -} + NSRect r; + r.origin.x = (float) x; + r.origin.y = (float) y; + r.size.width = (float) w; + r.size.height = (float) h; -- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags -{ - if (source != 0) + if (isSharedWindow) { - const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); - - if (numSamples > 0) - { - JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); + r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height); - JUCE_NAMESPACE::AudioSourceChannelInfo info; - info.buffer = &tempBuffer; - info.startSample = 0; - info.numSamples = numSamples; + if ([view frame].size.width != r.size.width + || [view frame].size.height != r.size.height) + [view setNeedsDisplay: true]; - source->getNextAudioBlock (info); + [view setFrame: r]; + } + else + { + r.origin.y = [[NSScreen mainScreen] frame].size.height - (r.origin.y + r.size.height); + [window setFrame: r + display: true]; + } +} - JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), - buffer, numSamples, 4); - JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), - buffer + 2, numSamples, 4); +void NSViewComponentPeer::getBounds (int& x, int& y, int& w, int& h, const bool global) const +{ + NSRect r = [view frame]; - readPosition += numSamples; - } + if (global && [view window] != 0) + { + r = [view convertRect: r toView: nil]; - return numSamples * 4; + NSRect wr = [[view window] frame]; + r.origin.x += wr.origin.x; + r.origin.y += wr.origin.y; + y = (int) ([[NSScreen mainScreen] frame].size.height - r.origin.y - r.size.height); + } + else + { + y = (int) ([[view superview] frame].size.height - r.origin.y - r.size.height); } - return 0; + x = (int) r.origin.x; + w = (int) r.size.width; + h = (int) r.size.height; } -- (uint32_t) producePreGapForTrack:(DRTrack*)track - intoBuffer:(char*)buffer length:(uint32_t)bufferLength - atAddress:(uint64_t)address blockSize:(uint32_t)blockSize - ioFlags:(uint32_t*)flags +void NSViewComponentPeer::getBounds (int& x, int& y, int& w, int& h) const { - zeromem (buffer, bufferLength); - return bufferLength; + getBounds (x, y, w, h, ! isSharedWindow); } -- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer - length:(uint32_t)bufferLength atAddress:(uint64_t)address - blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags +int NSViewComponentPeer::getScreenX() const { - return true; + int x, y, w, h; + getBounds (x, y, w, h, true); + return x; } -@end - -BEGIN_JUCE_NAMESPACE - -AudioCDBurner::AudioCDBurner (const int deviceIndex) - : internal (0) +int NSViewComponentPeer::getScreenY() const { - const AutoPool pool; - OpenDiskDevice* dev = [[OpenDiskDevice alloc] initWithDevice: [[DRDevice devices] objectAtIndex: deviceIndex]]; - - internal = (void*) dev; + int x, y, w, h; + getBounds (x, y, w, h, true); + return y; } -AudioCDBurner::~AudioCDBurner() +void NSViewComponentPeer::relativePositionToGlobal (int& x, int& y) { - const AutoPool pool; - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - if (dev != 0) - [dev release]; + int wx, wy, ww, wh; + getBounds (wx, wy, ww, wh, true); + x += wx; + y += wy; } -AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) +void NSViewComponentPeer::globalPositionToRelative (int& x, int& y) { - const AutoPool pool; - AudioCDBurner* b = new AudioCDBurner (deviceIndex); - - if (b->internal == 0) - deleteAndZero (b); + int wx, wy, ww, wh; + getBounds (wx, wy, ww, wh, true); + x -= wx; + y -= wy; +} - return b; +void NSViewComponentPeer::setMinimised (bool shouldBeMinimised) +{ + if (! isSharedWindow) + { + if (shouldBeMinimised) + [window miniaturize: nil]; + else + [window deminiaturize: nil]; + } } -static NSArray* findDiskBurnerDevices() +bool NSViewComponentPeer::isMinimised() const { - NSMutableArray* results = [NSMutableArray array]; - NSArray* devs = [DRDevice devices]; + return window != 0 && [window isMiniaturized]; +} - if (devs != 0) +void NSViewComponentPeer::setFullScreen (bool shouldBeFullScreen) +{ + if (! isSharedWindow) { - int num = [devs count]; - int i; - for (i = 0; i < num; ++i) + Rectangle r (lastNonFullscreenBounds); + + setMinimised (false); + + if (fullScreen != shouldBeFullScreen) { - NSDictionary* dic = [[devs objectAtIndex: i] info]; - NSString* name = [dic valueForKey: DRDeviceProductNameKey]; - if (name != nil) - [results addObject: name]; + if (shouldBeFullScreen) + r = Desktop::getInstance().getMainMonitorArea(); + + // (can't call the component's setBounds method because that'll reset our fullscreen flag) + if (r != getComponent()->getBounds() && ! r.isEmpty()) + setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); } } +} - return results; +bool NSViewComponentPeer::isFullScreen() const +{ + return fullScreen; } -const StringArray AudioCDBurner::findAvailableDevices() +bool NSViewComponentPeer::contains (int x, int y, bool trueIfInAChildWindow) const { - const AutoPool pool; - NSArray* names = findDiskBurnerDevices(); - StringArray s; + if (((unsigned int) x) >= (unsigned int) component->getWidth() + || ((unsigned int) y) >= (unsigned int) component->getHeight()) + return false; - for (int i = 0; i < [names count]; ++i) - s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); + NSPoint p; + p.x = (float) x; + p.y = (float) y; - return s; + NSView* v = [view hitTest: p]; + + if (trueIfInAChildWindow) + return v != nil; + + return v == view; } -bool AudioCDBurner::isDiskPresent() const +const BorderSize NSViewComponentPeer::getFrameSize() const { - OpenDiskDevice* dev = (OpenDiskDevice*) internal; + BorderSize b; - return dev != 0 && [dev isDiskPresent]; + if (! isSharedWindow) + { + NSRect v = [view convertRect: [view frame] toView: nil]; + NSRect w = [window frame]; + + b.setTop ((int) (w.size.height - (v.origin.y + v.size.height))); + b.setBottom ((int) v.origin.y); + b.setLeft ((int) v.origin.x); + b.setRight ((int) (w.size.width - (v.origin.x + v.size.width))); + } + + return b; } -int AudioCDBurner::getNumAvailableAudioBlocks() const +bool NSViewComponentPeer::setAlwaysOnTop (bool alwaysOnTop) { - OpenDiskDevice* dev = (OpenDiskDevice*) internal; + if (! isSharedWindow) + { + [window setLevel: alwaysOnTop ? NSFloatingWindowLevel + : NSNormalWindowLevel]; + } - return [dev getNumAvailableAudioBlocks]; + return true; } -bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) +void NSViewComponentPeer::toFront (bool makeActiveWindow) { - const AutoPool pool; - OpenDiskDevice* dev = (OpenDiskDevice*) internal; - - if (dev != 0) + if (isSharedWindow) { - [dev addSourceTrack: source numSamples: numSamps]; - return true; + [[view superview] addSubview: view + positioned: NSWindowAbove + relativeTo: nil]; } - return false; + if (window != 0) + { + if (makeActiveWindow) + [window makeKeyAndOrderFront: nil]; + else + [window orderFront: nil]; + } } -const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, - const bool ejectDiscAfterwards, - const bool peformFakeBurnForTesting) +void NSViewComponentPeer::toBehind (ComponentPeer* other) { - const AutoPool pool; - JUCE_NAMESPACE::String error ("Couldn't open or write to the CD device"); - - OpenDiskDevice* dev = (OpenDiskDevice*) internal; + NSViewComponentPeer* o = (NSViewComponentPeer*) other; - if (dev != 0) + if (isSharedWindow) { - error = JUCE_NAMESPACE::String::empty; - [dev burn: listener - errorString: &error - ejectAfterwards: ejectDiscAfterwards - isFake: peformFakeBurnForTesting]; + [[view superview] addSubview: view + positioned: NSWindowBelow + relativeTo: o->view]; + } + else + { + [window orderWindow: NSWindowBelow + relativeTo: o->window != 0 ? [o->window windowNumber] + : nil ]; } - - return error; } -END_JUCE_NAMESPACE +void NSViewComponentPeer::setIcon (const Image& /*newIcon*/) +{ + // to do.. +} -#endif -/********* End of inlined file: juce_mac_AudioCDBurner.mm *********/ +void NSViewComponentPeer::viewFocusGain() +{ + const MessageManagerLock messLock; -/********* Start of inlined file: juce_mac_CoreAudio.cpp *********/ + if (currentlyFocusedPeer != this) + { + if (ComponentPeer::isValidPeer (currentlyFocusedPeer)) + currentlyFocusedPeer->handleFocusLoss(); -#include + currentlyFocusedPeer = this; -BEGIN_JUCE_NAMESPACE + handleFocusGain(); + } +} -#ifndef JUCE_COREAUDIO_ERROR_LOGGING_ENABLED - #define JUCE_COREAUDIO_ERROR_LOGGING_ENABLED 1 -#endif +void NSViewComponentPeer::viewFocusLoss() +{ + if (currentlyFocusedPeer == this) + { + currentlyFocusedPeer = 0; + handleFocusLoss(); + } +} -#undef log -#if JUCE_COREAUDIO_LOGGING_ENABLED - #define log(a) Logger::writeToLog (a) -#else - #define log(a) -#endif +void juce_HandleProcessFocusChange() +{ + keysCurrentlyDown.clear(); -#undef OK -#if JUCE_COREAUDIO_ERROR_LOGGING_ENABLED - static bool logAnyErrors_CoreAudio (const OSStatus err, const int lineNum) - { - if (err == noErr) - return true; + if (NSViewComponentPeer::isValidPeer (currentlyFocusedPeer)) + { + if (Process::isForegroundProcess()) + currentlyFocusedPeer->handleFocusGain(); + else + currentlyFocusedPeer->handleFocusLoss(); + } +} - Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); - jassertfalse - return false; - } +bool NSViewComponentPeer::isFocused() const +{ + return window != 0 && [window isKeyWindow]; +} - #define OK(a) logAnyErrors_CoreAudio (a, __LINE__) -#else - #define OK(a) (a == noErr) -#endif +void NSViewComponentPeer::grabFocus() +{ + if (window != 0) + { + [window makeKeyWindow]; + [window makeFirstResponder: view]; + } +} -static const int maxNumChans = 96; +void NSViewComponentPeer::textInputRequired (int /*x*/, int /*y*/) +{ +} -class CoreAudioInternal : public Timer +bool NSViewComponentPeer::handleKeyEvent (NSEvent* ev, bool isKeyDown) { -public: + String unicode (nsStringToJuce ([ev characters])); + String unmodified (nsStringToJuce ([ev charactersIgnoringModifiers])); + int keyCode = getKeyCodeFromEvent (ev); - CoreAudioInternal (AudioDeviceID id) - : deviceID (id), - started (false), - audioBuffer (0), - numInputChans (0), - numOutputChans (0), - callbacksAllowed (true), - numInputChannelInfos (0), - numOutputChannelInfos (0), - inputLatency (0), - outputLatency (0), - callback (0), - inputDevice (0), - isSlaveDevice (false) - { - sampleRate = 0; - bufferSize = 512; + //DBG ("unicode: " + unicode + " " + String::toHexString ((int) unicode[0])); + //DBG ("unmodified: " + unmodified + " " + String::toHexString ((int) unmodified[0])); - if (deviceID == 0) + if (unicode.isNotEmpty() || keyCode != 0) + { + if (isKeyDown) { - error = TRANS("can't open device"); + bool used = false; + + while (unicode.length() > 0) + { + juce_wchar textCharacter = unicode[0]; + unicode = unicode.substring (1); + + used = handleKeyUpOrDown() || used; + used = handleKeyPress (keyCode, textCharacter) || used; + } + + return used; } else { - updateDetailsFromDevice(); - - AudioDeviceAddPropertyListener (deviceID, - kAudioPropertyWildcardChannel, - kAudioPropertyWildcardSection, - kAudioPropertyWildcardPropertyID, - deviceListenerProc, this); + if (handleKeyUpOrDown()) + return true; } } - ~CoreAudioInternal() - { - AudioDeviceRemovePropertyListener (deviceID, - kAudioPropertyWildcardChannel, - kAudioPropertyWildcardSection, - kAudioPropertyWildcardPropertyID, - deviceListenerProc); + return false; +} - stop (false); +void NSViewComponentPeer::repaint (int x, int y, int w, int h) +{ + [view setNeedsDisplayInRect: + NSMakeRect ((float) x, (float) ([view frame].size.height - (y + h)), + (float) w, (float) h)]; +} - juce_free (audioBuffer); - delete inputDevice; - } +void NSViewComponentPeer::performAnyPendingRepaintsNow() +{ + [view displayIfNeeded]; +} - void setTempBufferSize (const int numChannels, const int numSamples) - { - juce_free (audioBuffer); +ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) +{ + return new NSViewComponentPeer (this, styleFlags, (NSView*) windowToAttachTo); +} - audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float)); +static Image* NSImageToJuceImage (NSImage* image) +{ + JuceNSImage juceIm ((int) [image size].width, + (int) [image size].height, + true); - zeromem (tempInputBuffers, sizeof (tempInputBuffers)); - zeromem (tempOutputBuffers, sizeof (tempOutputBuffers)); + juceIm.drawNSImage (image); + return juceIm.getJuceImage().createCopy(); +} - int count = 0; - int i; - for (i = 0; i < numInputChans; ++i) - tempInputBuffers[i] = audioBuffer + count++ * numSamples; +Image* juce_createIconForFile (const File& file) +{ + const ScopedAutoReleasePool pool; - for (i = 0; i < numOutputChans; ++i) - tempOutputBuffers[i] = audioBuffer + count++ * numSamples; - } + NSImage* im = [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (file.getFullPathName())]; + return NSImageToJuceImage (im); +} - // returns the number of actual available channels - void fillInChannelInfo (bool input) - { - int chanNum = 0, activeChans = 0; - UInt32 size; +const int KeyPress::spaceKey = ' '; +const int KeyPress::returnKey = 0x0d; +const int KeyPress::escapeKey = 0x1b; +const int KeyPress::backspaceKey = 0x7f; +const int KeyPress::leftKey = NSLeftArrowFunctionKey; +const int KeyPress::rightKey = NSRightArrowFunctionKey; +const int KeyPress::upKey = NSUpArrowFunctionKey; +const int KeyPress::downKey = NSDownArrowFunctionKey; +const int KeyPress::pageUpKey = NSPageUpFunctionKey; +const int KeyPress::pageDownKey = NSPageDownFunctionKey; +const int KeyPress::endKey = NSEndFunctionKey; +const int KeyPress::homeKey = NSHomeFunctionKey; +const int KeyPress::deleteKey = NSDeleteFunctionKey; +const int KeyPress::insertKey = -1; +const int KeyPress::tabKey = 9; +const int KeyPress::F1Key = NSF1FunctionKey; +const int KeyPress::F2Key = NSF2FunctionKey; +const int KeyPress::F3Key = NSF3FunctionKey; +const int KeyPress::F4Key = NSF4FunctionKey; +const int KeyPress::F5Key = NSF5FunctionKey; +const int KeyPress::F6Key = NSF6FunctionKey; +const int KeyPress::F7Key = NSF7FunctionKey; +const int KeyPress::F8Key = NSF8FunctionKey; +const int KeyPress::F9Key = NSF9FunctionKey; +const int KeyPress::F10Key = NSF10FunctionKey; +const int KeyPress::F11Key = NSF1FunctionKey; +const int KeyPress::F12Key = NSF12FunctionKey; +const int KeyPress::F13Key = NSF13FunctionKey; +const int KeyPress::F14Key = NSF14FunctionKey; +const int KeyPress::F15Key = NSF15FunctionKey; +const int KeyPress::F16Key = NSF16FunctionKey; +const int KeyPress::numberPad0 = 0x30020; +const int KeyPress::numberPad1 = 0x30021; +const int KeyPress::numberPad2 = 0x30022; +const int KeyPress::numberPad3 = 0x30023; +const int KeyPress::numberPad4 = 0x30024; +const int KeyPress::numberPad5 = 0x30025; +const int KeyPress::numberPad6 = 0x30026; +const int KeyPress::numberPad7 = 0x30027; +const int KeyPress::numberPad8 = 0x30028; +const int KeyPress::numberPad9 = 0x30029; +const int KeyPress::numberPadAdd = 0x3002a; +const int KeyPress::numberPadSubtract = 0x3002b; +const int KeyPress::numberPadMultiply = 0x3002c; +const int KeyPress::numberPadDivide = 0x3002d; +const int KeyPress::numberPadSeparator = 0x3002e; +const int KeyPress::numberPadDecimalPoint = 0x3002f; +const int KeyPress::numberPadEquals = 0x30030; +const int KeyPress::numberPadDelete = 0x30031; +const int KeyPress::playKey = 0x30000; +const int KeyPress::stopKey = 0x30001; +const int KeyPress::fastForwardKey = 0x30002; +const int KeyPress::rewindKey = 0x30003; - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) - { - AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); +#endif +/********* End of inlined file: juce_mac_NSViewComponentPeer.mm *********/ - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) - { - const int numStreams = bufList->mNumberBuffers; +/********* Start of inlined file: juce_mac_MouseCursor.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - for (int i = 0; i < numStreams; ++i) - { - const AudioBuffer& b = bufList->mBuffers[i]; +static NSImage* juceImageToNSImage (const Image& image) +{ + const ScopedAutoReleasePool pool; + int lineStride, pixelStride; + const uint8* pixels = image.lockPixelDataReadOnly (0, 0, image.getWidth(), image.getHeight(), + lineStride, pixelStride); - for (unsigned int j = 0; j < b.mNumberChannels; ++j) - { - if (input) - { - if (activeInputChans[chanNum]) - { - inputChannelInfo [activeChans].sourceChannelNum = chanNum; - inputChannelInfo [activeChans].streamNum = i; - inputChannelInfo [activeChans].dataOffsetSamples = j; - inputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; - ++activeChans; - numInputChannelInfos = activeChans; - } + NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes: NULL + pixelsWide: image.getWidth() + pixelsHigh: image.getHeight() + bitsPerSample: 8 + samplesPerPixel: image.hasAlphaChannel() ? 4 : 3 + hasAlpha: image.hasAlphaChannel() + isPlanar: NO + colorSpaceName: NSCalibratedRGBColorSpace + bitmapFormat: (NSBitmapFormat) 0 + bytesPerRow: lineStride + bitsPerPixel: pixelStride * 8]; - inChanNames.add (T("input ") + String (chanNum + 1)); - } - else - { - if (activeOutputChans[chanNum]) - { - outputChannelInfo [activeChans].sourceChannelNum = chanNum; - outputChannelInfo [activeChans].streamNum = i; - outputChannelInfo [activeChans].dataOffsetSamples = j; - outputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; - ++activeChans; - numOutputChannelInfos = activeChans; - } + unsigned char* newData = [rep bitmapData]; + memcpy (newData, pixels, lineStride * image.getHeight()); + image.releasePixelDataReadOnly (pixels); - outChanNames.add (T("output ") + String (chanNum + 1)); - } + NSImage* im = [[NSImage alloc] init]; + [im addRepresentation: rep]; + [rep release]; - ++chanNum; - } - } - } + return im; +} - juce_free (bufList); - } - } +void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() +{ + NSImage* im = juceImageToNSImage (image); + NSCursor* c = [[NSCursor alloc] initWithImage: im + hotSpot: NSMakePoint (hotspotX, hotspotY)]; + [im release]; - void updateDetailsFromDevice() - { - stopTimer(); + return (void*) c; +} - if (deviceID == 0) - return; +static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() +{ + Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); + jassert (im != 0); - const ScopedLock sl (callbackLock); + if (im == 0) + return 0; - Float64 sr; - UInt32 size = sizeof (Float64); - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyNominalSampleRate, &size, &sr))) - sampleRate = sr; + void* const curs = juce_createMouseCursorFromImage (*im, + (int) (hx * im->getWidth()), + (int) (hy * im->getHeight())); + delete im; + return curs; +} - UInt32 framesPerBuf; - size = sizeof (framesPerBuf); +static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) +{ + File f ("/System/Library/Frameworks/WebKit.framework/Frameworks/WebCore.framework/Resources"); - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf))) - { - bufferSize = framesPerBuf; + MemoryBlock mb; + if (f.getChildFile (filename).loadFileAsData (mb)) + return juce_cursorFromData ((const unsigned char*) mb.getData(), mb.getSize(), hx, hy); - if (bufferSize > 0) - setTempBufferSize (numInputChans + numOutputChans, bufferSize); - } + return 0; +} - bufferSizes.clear(); +void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() +{ + const ScopedAutoReleasePool pool; + NSCursor* c = 0; - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, 0))) - { - AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); + switch (type) + { + case MouseCursor::NormalCursor: + c = [NSCursor arrowCursor]; + break; - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, ranges))) - { - bufferSizes.add ((int) ranges[0].mMinimum); + case MouseCursor::NoCursor: + { + Image blank (Image::ARGB, 8, 8, true); + return juce_createMouseCursorFromImage (blank, 0, 0); + } - for (int i = 32; i < 8192; i += 32) - { - for (int j = size / sizeof (AudioValueRange); --j >= 0;) - { - if (i >= ranges[j].mMinimum && i <= ranges[j].mMaximum) - { - bufferSizes.addIfNotAlreadyThere (i); - break; - } - } - } + case MouseCursor::DraggingHandCursor: + c = [NSCursor openHandCursor]; + break; - if (bufferSize > 0) - bufferSizes.addIfNotAlreadyThere (bufferSize); - } + case MouseCursor::CopyingCursor: + return juce_cursorFromWebKitFile ("copyCursor.png", 0, 0); - juce_free (ranges); - } + case MouseCursor::WaitCursor: + c = [NSCursor arrowCursor]; // avoid this on the mac, let the OS provide the beachball + break; + //return juce_cursorFromWebKitFile ("waitCursor.png", 0.5f, 0.5f); - if (bufferSizes.size() == 0 && bufferSize > 0) - bufferSizes.add (bufferSize); + case MouseCursor::IBeamCursor: + c = [NSCursor IBeamCursor]; + break; - sampleRates.clear(); - const double possibleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; - String rates; + case MouseCursor::PointingHandCursor: + c = [NSCursor pointingHandCursor]; + break; - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, 0))) - { - AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); + case MouseCursor::LeftRightResizeCursor: + c = [NSCursor resizeLeftRightCursor]; + break; - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, ranges))) - { - for (int i = 0; i < numElementsInArray (possibleRates); ++i) - { - bool ok = false; + case MouseCursor::LeftEdgeResizeCursor: + c = [NSCursor resizeLeftCursor]; + break; - for (int j = size / sizeof (AudioValueRange); --j >= 0;) - if (possibleRates[i] >= ranges[j].mMinimum - 2 && possibleRates[i] <= ranges[j].mMaximum + 2) - ok = true; + case MouseCursor::RightEdgeResizeCursor: + c = [NSCursor resizeRightCursor]; + break; - if (ok) - { - sampleRates.add (possibleRates[i]); - rates << possibleRates[i] << T(" "); - } - } - } + case MouseCursor::UpDownResizeCursor: + case MouseCursor::TopEdgeResizeCursor: + case MouseCursor::BottomEdgeResizeCursor: + return juce_cursorFromWebKitFile ("northSouthResizeCursor.png", 0.5f, 0.5f); - juce_free (ranges); - } + case MouseCursor::TopLeftCornerResizeCursor: + case MouseCursor::BottomRightCornerResizeCursor: + return juce_cursorFromWebKitFile ("northWestSouthEastResizeCursor.png", 0.5f, 0.5f); - if (sampleRates.size() == 0 && sampleRate > 0) - { - sampleRates.add (sampleRate); - rates << sampleRate; - } + case MouseCursor::TopRightCornerResizeCursor: + case MouseCursor::BottomLeftCornerResizeCursor: + return juce_cursorFromWebKitFile ("northEastSouthWestResizeCursor.png", 0.5f, 0.5f); - log (T("sr: ") + rates); + case MouseCursor::UpDownLeftRightResizeCursor: + return juce_cursorFromWebKitFile ("moveCursor.png", 0.5f, 0.5f); - inputLatency = 0; - outputLatency = 0; - UInt32 lat; - size = sizeof (UInt32); - if (AudioDeviceGetProperty (deviceID, 0, true, kAudioDevicePropertyLatency, &size, &lat) == noErr) - inputLatency = (int) lat; + case MouseCursor::CrosshairCursor: + c = [NSCursor crosshairCursor]; + break; + } - if (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyLatency, &size, &lat) == noErr) - outputLatency = (int) lat; + [c retain]; + return (void*) c; +} - log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); +void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() +{ + NSCursor* c = (NSCursor*) cursorHandle; + [c release]; +} - inChanNames.clear(); - outChanNames.clear(); +void MouseCursor::showInAllWindows() const throw() +{ + showInWindow (0); +} - zeromem (inputChannelInfo, sizeof (inputChannelInfo)); - zeromem (outputChannelInfo, sizeof (outputChannelInfo)); +void MouseCursor::showInWindow (ComponentPeer*) const throw() +{ + NSCursor* const c = (NSCursor*) getHandle(); + [c set]; +} - fillInChannelInfo (true); - fillInChannelInfo (false); - } +#endif +/********* End of inlined file: juce_mac_MouseCursor.mm *********/ - const StringArray getSources (bool input) - { - StringArray s; - int num = 0; - OSType* types = getAllDataSourcesForDevice (deviceID, input, num); +/********* Start of inlined file: juce_mac_NSViewComponent.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - if (types != 0) - { - for (int i = 0; i < num; ++i) - { - AudioValueTranslation avt; - char buffer[256]; +class NSViewComponentInternal : public ComponentMovementWatcher +{ + Component* const owner; + NSViewComponentPeer* currentPeer; + bool wasShowing; - avt.mInputData = (void*) &(types[i]); - avt.mInputDataSize = sizeof (UInt32); - avt.mOutputData = buffer; - avt.mOutputDataSize = 256; +public: + NSView* view; - UInt32 transSize = sizeof (avt); - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSourceNameForID, &transSize, &avt))) - { - DBG (buffer); - s.add (buffer); - } - } + NSViewComponentInternal (NSView* view_, Component* const owner_) + : ComponentMovementWatcher (owner_), + owner (owner_), + wasShowing (false), + currentPeer (0), + view (view_) + { + [view retain]; - juce_free (types); - } + if (owner_->isShowing()) + componentPeerChanged(); + } - return s; + ~NSViewComponentInternal() + { + [view removeFromSuperview]; + [view release]; } - int getCurrentSourceIndex (bool input) const + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) { - OSType currentSourceID = 0; - UInt32 size = 0; - int result = -1; + Component* const topComp = owner->getTopLevelComponent(); - if (deviceID != 0 - && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, 0))) + if (topComp->getPeer() != 0) { - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, ¤tSourceID))) - { - int num = 0; - OSType* const types = getAllDataSourcesForDevice (deviceID, input, num); + int x = 0, y = 0; + owner->relativePositionToOtherComponent (topComp, x, y); - if (types != 0) - { - for (int i = 0; i < num; ++i) - { - if (types[num] == currentSourceID) - { - result = i; - break; - } - } + NSRect r; + r.origin.x = (float) x; + r.origin.y = (float) y; + r.size.width = (float) owner->getWidth(); + r.size.height = (float) owner->getHeight(); + r.origin.y = [[view superview] frame].size.height - (r.origin.y + r.size.height); - juce_free (types); - } - } + [view setFrame: r]; } - - return result; } - void setCurrentSourceIndex (int index, bool input) + void componentPeerChanged() { - if (deviceID != 0) + NSViewComponentPeer* const peer = dynamic_cast (owner->getPeer()); + + if (currentPeer != peer) { - int num = 0; - OSType* types = getAllDataSourcesForDevice (deviceID, input, num); + [view removeFromSuperview]; + currentPeer = peer; - if (types != 0) + if (peer != 0) { - if (((unsigned int) index) < num) - { - OSType typeId = types[index]; - AudioDeviceSetProperty (deviceID, 0, 0, input, kAudioDevicePropertyDataSource, sizeof (typeId), &typeId); - } - - juce_free (types); + [peer->view addSubview: view]; + componentMovedOrResized (false, false); } } + + [view setHidden: ! owner->isShowing()]; } - const String reopen (const BitArray& inputChannels, - const BitArray& outputChannels, - double newSampleRate, - int bufferSizeSamples) + void componentVisibilityChanged (Component&) { - error = String::empty; - log ("CoreAudio reopen"); - callbacksAllowed = false; - stopTimer(); + componentPeerChanged(); + } - stop (false); + juce_UseDebuggingNewOperator - activeInputChans = inputChannels; - activeOutputChans = outputChannels; +private: + NSViewComponentInternal (const NSViewComponentInternal&); + const NSViewComponentInternal& operator= (const NSViewComponentInternal&); +}; - activeInputChans.setRange (inChanNames.size(), - activeInputChans.getHighestBit() + 1 - inChanNames.size(), - false); +NSViewComponent::NSViewComponent() + : info (0) +{ +} - activeOutputChans.setRange (outChanNames.size(), - activeOutputChans.getHighestBit() + 1 - outChanNames.size(), - false); +NSViewComponent::~NSViewComponent() +{ + delete info; +} - numInputChans = activeInputChans.countNumberOfSetBits(); - numOutputChans = activeOutputChans.countNumberOfSetBits(); +void NSViewComponent::setView (void* view) +{ + if (view != getView()) + { + deleteAndZero (info); - // set sample rate - Float64 sr = newSampleRate; - UInt32 size = sizeof (sr); - OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyNominalSampleRate, size, &sr)); - OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyNominalSampleRate, size, &sr)); + if (view != 0) + info = new NSViewComponentInternal ((NSView*) view, this); + } +} - // change buffer size - UInt32 framesPerBuf = bufferSizeSamples; - size = sizeof (framesPerBuf); +void* NSViewComponent::getView() const +{ + return info == 0 ? 0 : info->view; +} - OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); - OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); +void NSViewComponent::paint (Graphics& g) +{ +} - // wait for the changes to happen (on some devices) - int i = 30; - while (--i >= 0) - { - updateDetailsFromDevice(); +#endif +/********* End of inlined file: juce_mac_NSViewComponent.mm *********/ - if (sampleRate == newSampleRate && bufferSizeSamples == bufferSize) - break; +/********* Start of inlined file: juce_mac_AppleRemote.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE - Thread::sleep (100); - } +AppleRemoteDevice::AppleRemoteDevice() + : device (0), + queue (0), + remoteId (0) +{ +} - if (i < 0) - error = "Couldn't change sample rate/buffer size"; +AppleRemoteDevice::~AppleRemoteDevice() +{ + stop(); +} - if (sampleRates.size() == 0) - error = "Device has no available sample-rates"; +static io_object_t getAppleRemoteDevice() throw() +{ + CFMutableDictionaryRef dict = IOServiceMatching ("AppleIRController"); - if (bufferSizes.size() == 0) - error = "Device has no available buffer-sizes"; + io_iterator_t iter = 0; + io_object_t iod = 0; - if (inputDevice != 0 && error.isEmpty()) - error = inputDevice->reopen (inputChannels, - outputChannels, - newSampleRate, - bufferSizeSamples); + if (IOServiceGetMatchingServices (kIOMasterPortDefault, dict, &iter) == kIOReturnSuccess + && iter != 0) + { + iod = IOIteratorNext (iter); + } - callbacksAllowed = true; + IOObjectRelease (iter); + return iod; +} - return error; - } +static bool createAppleRemoteInterface (io_object_t iod, void** device) throw() +{ + jassert (*device == 0); + io_name_t classname; - bool start (AudioIODeviceCallback* cb) + if (IOObjectGetClass (iod, classname) == kIOReturnSuccess) { - if (! started) + IOCFPlugInInterface** cfPlugInInterface = 0; + SInt32 score = 0; + + if (IOCreatePlugInInterfaceForService (iod, + kIOHIDDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, + &cfPlugInInterface, + &score) == kIOReturnSuccess) { - callback = 0; + HRESULT hr = (*cfPlugInInterface)->QueryInterface (cfPlugInInterface, + CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), + device); - if (deviceID != 0) - { - if (OK (AudioDeviceAddIOProc (deviceID, audioIOProc, (void*) this))) - { - if (OK (AudioDeviceStart (deviceID, audioIOProc))) - { - started = true; - } - else - { - OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); - } - } - } - } + (void) hr; - if (started) - { - const ScopedLock sl (callbackLock); - callback = cb; + (*cfPlugInInterface)->Release (cfPlugInInterface); } - - if (inputDevice != 0) - return started && inputDevice->start (cb); - else - return started; } - void stop (bool leaveInterruptRunning) - { - callbackLock.enter(); - callback = 0; - callbackLock.exit(); - - if (started - && (deviceID != 0) - && ! leaveInterruptRunning) - { - OK (AudioDeviceStop (deviceID, audioIOProc)); - OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); - started = false; + return *device != 0; +} - callbackLock.enter(); - callbackLock.exit(); +bool AppleRemoteDevice::start (const bool inExclusiveMode) throw() +{ + if (queue != 0) + return true; - // wait until it's definately stopped calling back.. - for (int i = 40; --i >= 0;) - { - Thread::sleep (50); + stop(); - UInt32 running = 0; - UInt32 size = sizeof (running); - OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyDeviceIsRunning, &size, &running)); - if (running == 0) - break; - } + bool result = false; + io_object_t iod = getAppleRemoteDevice(); - callbackLock.enter(); - callbackLock.exit(); - } + if (iod != 0) + { + if (createAppleRemoteInterface (iod, &device) && open (inExclusiveMode)) + result = true; + else + stop(); - if (inputDevice != 0) - inputDevice->stop (leaveInterruptRunning); + IOObjectRelease (iod); } - double getSampleRate() const + return result; +} + +void AppleRemoteDevice::stop() throw() +{ + if (queue != 0) { - return sampleRate; + (*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue); + (*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue); + (*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue); + queue = 0; } - int getBufferSize() const + if (device != 0) { - return bufferSize; + (*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device); + (*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device); + device = 0; } +} - void audioCallback (const AudioBufferList* inInputData, - AudioBufferList* outOutputData) - { - int i; - const ScopedLock sl (callbackLock); +bool AppleRemoteDevice::isActive() const throw() +{ + return queue != 0; +} - if (callback != 0) - { - if (inputDevice == 0) - { - for (i = numInputChans; --i >= 0;) - { - const CallbackDetailsForChannel& info = inputChannelInfo[i]; - float* dest = tempInputBuffers [info.sourceChannelNum]; - const float* src = ((const float*) inInputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; +static void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*) +{ + if (result == kIOReturnSuccess) + ((AppleRemoteDevice*) target)->handleCallbackInternal(); +} - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest++ = *src; - src += stride; - } - } - } - } +bool AppleRemoteDevice::open (const bool openInExclusiveMode) throw() +{ +#if ! MACOS_10_2_OR_EARLIER + Array cookies; - if (! isSlaveDevice) - { - if (inputDevice == 0) - { - callback->audioDeviceIOCallback ((const float**) tempInputBuffers, - numInputChans, - tempOutputBuffers, - numOutputChans, - bufferSize); - } - else - { - jassert (inputDevice->bufferSize == bufferSize); + CFArrayRef elements; + IOHIDDeviceInterface122** const device122 = (IOHIDDeviceInterface122**) device; - callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers, - inputDevice->numInputChans, - tempOutputBuffers, - numOutputChans, - bufferSize); - } + if ((*device122)->copyMatchingElements (device122, 0, &elements) != kIOReturnSuccess) + return false; - for (i = numOutputChans; --i >= 0;) - { - const CallbackDetailsForChannel& info = outputChannelInfo[i]; - const float* src = tempOutputBuffers [i]; - float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; + for (int i = 0; i < CFArrayGetCount (elements); ++i) + { + CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest = *src++; - dest += stride; - } - } - } - } - } - else - { - for (i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) - { - const CallbackDetailsForChannel& info = outputChannelInfo[i]; - float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) - + info.dataOffsetSamples; - const int stride = info.dataStrideSamples; + // get the cookie + CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); - if (stride != 0) // if this is zero, info is invalid - { - for (int j = bufferSize; --j >= 0;) - { - *dest = 0.0f; - dest += stride; - } - } - } - } - } + if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID()) + continue; - // called by callbacks - void deviceDetailsChanged() - { - if (callbacksAllowed) - startTimer (100); + long number; + if (! CFNumberGetValue ((CFNumberRef) object, kCFNumberLongType, &number)) + continue; + + cookies.add ((int) number); } - void timerCallback() - { - stopTimer(); - log ("CoreAudio device changed callback"); + CFRelease (elements); - const double oldSampleRate = sampleRate; - const int oldBufferSize = bufferSize; - updateDetailsFromDevice(); + if ((*(IOHIDDeviceInterface**) device) + ->open ((IOHIDDeviceInterface**) device, + openInExclusiveMode ? kIOHIDOptionsTypeSeizeDevice + : kIOHIDOptionsTypeNone) == KERN_SUCCESS) + { + queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); - if (oldBufferSize != bufferSize || oldSampleRate != sampleRate) + if (queue != 0) { - callbacksAllowed = false; - stop (false); - updateDetailsFromDevice(); - callbacksAllowed = true; - } - } + (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); - CoreAudioInternal* getRelatedDevice() const - { - UInt32 size = 0; - CoreAudioInternal* result = 0; + for (int i = 0; i < cookies.size(); ++i) + { + IOHIDElementCookie cookie = (IOHIDElementCookie) cookies.getUnchecked(i); + (*(IOHIDQueueInterface**) queue)->addElement ((IOHIDQueueInterface**) queue, cookie, 0); + } - if (deviceID != 0 - && AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, 0) == noErr - && size > 0) - { - AudioDeviceID* devs = (AudioDeviceID*) juce_calloc (size); + CFRunLoopSourceRef eventSource; - if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, devs))) + if ((*(IOHIDQueueInterface**) queue) + ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) { - for (unsigned int i = 0; i < size / sizeof (AudioDeviceID); ++i) + if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, + appleRemoteQueueCallback, this, 0) == KERN_SUCCESS) { - if (devs[i] != deviceID && devs[i] != 0) - { - result = new CoreAudioInternal (devs[i]); - - if (result->error.isEmpty()) - { - const bool thisIsInput = inChanNames.size() > 0 && outChanNames.size() == 0; - const bool otherIsInput = result->inChanNames.size() > 0 && result->outChanNames.size() == 0; + CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); - if (thisIsInput != otherIsInput - || (inChanNames.size() + outChanNames.size() == 0) - || (result->inChanNames.size() + result->outChanNames.size()) == 0) - break; - } + (*(IOHIDQueueInterface**) queue)->start ((IOHIDQueueInterface**) queue); - deleteAndZero (result); - } + return true; } } - - juce_free (devs); } - - return result; } +#endif - juce_UseDebuggingNewOperator - - String error; - int inputLatency, outputLatency; - BitArray activeInputChans, activeOutputChans; - StringArray inChanNames, outChanNames; - Array sampleRates; - Array bufferSizes; - AudioIODeviceCallback* callback; - - CoreAudioInternal* inputDevice; - bool isSlaveDevice; - -private: - CriticalSection callbackLock; - AudioDeviceID deviceID; - bool started; - double sampleRate; - int bufferSize; - float* audioBuffer; - int numInputChans, numOutputChans; - bool callbacksAllowed; - - struct CallbackDetailsForChannel - { - int sourceChannelNum; - int streamNum; - int dataOffsetSamples; - int dataStrideSamples; - }; - - int numInputChannelInfos, numOutputChannelInfos; - CallbackDetailsForChannel inputChannelInfo [maxNumChans]; - CallbackDetailsForChannel outputChannelInfo [maxNumChans]; - float* tempInputBuffers [maxNumChans]; - float* tempOutputBuffers [maxNumChans]; + return false; +} - CoreAudioInternal (const CoreAudioInternal&); - const CoreAudioInternal& operator= (const CoreAudioInternal&); +void AppleRemoteDevice::handleCallbackInternal() +{ +#if ! MACOS_10_2_OR_EARLIER + int totalValues = 0; + AbsoluteTime nullTime = { 0, 0 }; + char cookies [12]; + int numCookies = 0; - static OSStatus audioIOProc (AudioDeviceID inDevice, - const AudioTimeStamp* inNow, - const AudioBufferList* inInputData, - const AudioTimeStamp* inInputTime, - AudioBufferList* outOutputData, - const AudioTimeStamp* inOutputTime, - void* device) + while (numCookies < numElementsInArray (cookies)) { - ((CoreAudioInternal*) device)->audioCallback (inInputData, outOutputData); - return noErr; - } + IOHIDEventStruct e; - static OSStatus deviceListenerProc (AudioDeviceID inDevice, - UInt32 inLine, - Boolean isInput, - AudioDevicePropertyID inPropertyID, - void* inClientData) - { - CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; + if ((*(IOHIDQueueInterface**) queue)->getNextEvent ((IOHIDQueueInterface**) queue, &e, nullTime, 0) != kIOReturnSuccess) + break; - switch (inPropertyID) + if ((int) e.elementCookie == 19) { - case kAudioDevicePropertyBufferSize: - case kAudioDevicePropertyBufferFrameSize: - case kAudioDevicePropertyNominalSampleRate: - case kAudioDevicePropertyStreamFormat: - case kAudioDevicePropertyDeviceIsAlive: - intern->deviceDetailsChanged(); - break; - - case kAudioDevicePropertyBufferSizeRange: - case kAudioDevicePropertyVolumeScalar: - case kAudioDevicePropertyMute: - case kAudioDevicePropertyPlayThru: - case kAudioDevicePropertyDataSource: - case kAudioDevicePropertyDeviceIsRunning: - break; + remoteId = e.value; + buttonPressed (switched, false); + } + else + { + totalValues += e.value; + cookies [numCookies++] = (char) (pointer_sized_int) e.elementCookie; } - - return noErr; } - static OSType* getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, int& num) + cookies [numCookies++] = 0; + //DBG (String::toHexString ((uint8*) cookies, numCookies, 1) + " " + String (totalValues)); + + static const char buttonPatterns[] = { - OSType* types = 0; - UInt32 size = 0; - num = 0; + 0x1f, 0x14, 0x12, 0x1f, 0x14, 0x12, 0, + 0x1f, 0x15, 0x12, 0x1f, 0x15, 0x12, 0, + 0x1f, 0x1d, 0x1c, 0x12, 0, + 0x1f, 0x1e, 0x1c, 0x12, 0, + 0x1f, 0x16, 0x12, 0x1f, 0x16, 0x12, 0, + 0x1f, 0x17, 0x12, 0x1f, 0x17, 0x12, 0, + 0x1f, 0x12, 0x04, 0x02, 0, + 0x1f, 0x12, 0x03, 0x02, 0, + 0x1f, 0x12, 0x1f, 0x12, 0, + 0x23, 0x1f, 0x12, 0x23, 0x1f, 0x12, 0, + 19, 0 + }; - if (deviceID != 0 - && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, 0))) - { - types = (OSType*) juce_calloc (size); + int buttonNum = (int) menuButton; + int i = 0; - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, types))) - { - num = size / sizeof (OSType); - } - else - { - juce_free (types); - types = 0; - } + while (i < numElementsInArray (buttonPatterns)) + { + if (strcmp (cookies, buttonPatterns + i) == 0) + { + buttonPressed ((ButtonType) buttonNum, totalValues > 0); + break; } - return types; + i += strlen (buttonPatterns + i) + 1; + ++buttonNum; } -}; +#endif +} -class CoreAudioIODevice : public AudioIODevice +#endif +/********* End of inlined file: juce_mac_AppleRemote.mm *********/ + +/********* Start of inlined file: juce_mac_OpenGLComponent.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_OPENGL + +class WindowedGLContext : public OpenGLContext { public: - CoreAudioIODevice (const String& deviceName, - AudioDeviceID inputDeviceId, - const int inputIndex_, - AudioDeviceID outputDeviceId, - const int outputIndex_) - : AudioIODevice (deviceName, "CoreAudio"), - inputIndex (inputIndex_), - outputIndex (outputIndex_), - isOpen_ (false), - isStarted (false) + WindowedGLContext (Component* const component, + const OpenGLPixelFormat& pixelFormat_, + NSOpenGLContext* sharedContext) + : renderContext (0), + pixelFormat (pixelFormat_) { - internal = 0; - CoreAudioInternal* device = 0; + jassert (component != 0); - if (outputDeviceId == 0 || outputDeviceId == inputDeviceId) - { - jassert (inputDeviceId != 0); + NSOpenGLPixelFormatAttribute attribs [64]; + int n = 0; + attribs[n++] = NSOpenGLPFADoubleBuffer; + attribs[n++] = NSOpenGLPFAAccelerated; + attribs[n++] = NSOpenGLPFAColorSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.redBits, + pixelFormat.greenBits, + pixelFormat.blueBits); + attribs[n++] = NSOpenGLPFAAlphaSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits; + attribs[n++] = NSOpenGLPFADepthSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits; + attribs[n++] = NSOpenGLPFAStencilSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits; + attribs[n++] = NSOpenGLPFAAccumSize; + attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.accumulationBufferRedBits, + pixelFormat.accumulationBufferGreenBits, + pixelFormat.accumulationBufferBlueBits, + pixelFormat.accumulationBufferAlphaBits); - device = new CoreAudioInternal (inputDeviceId); - lastError = device->error; + // xxx not sure how to do fullSceneAntiAliasingNumSamples.. - if (lastError.isNotEmpty()) - deleteAndZero (device); - } - else - { - device = new CoreAudioInternal (outputDeviceId); - lastError = device->error; + attribs[n++] = NSOpenGLPFASampleBuffers; + attribs[n++] = (NSOpenGLPixelFormatAttribute) 1; + attribs[n++] = NSOpenGLPFAClosestPolicy; + attribs[n++] = NSOpenGLPFANoRecovery; + attribs[n++] = (NSOpenGLPixelFormatAttribute) 0; - if (lastError.isNotEmpty()) - { - deleteAndZero (device); - } - else if (inputDeviceId != 0) - { - CoreAudioInternal* secondDevice = new CoreAudioInternal (inputDeviceId); - lastError = device->error; + NSOpenGLPixelFormat* format + = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; - if (lastError.isNotEmpty()) - { - delete secondDevice; - } - else - { - device->inputDevice = secondDevice; - secondDevice->isSlaveDevice = true; - } - } - } + NSOpenGLView* view + = [[NSOpenGLView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) + pixelFormat: format]; - internal = device; + renderContext = [view openGLContext]; + [format release]; - AudioHardwareAddPropertyListener (kAudioPropertyWildcardPropertyID, - hardwareListenerProc, internal); + viewHolder = new NSViewComponentInternal (view, component); } - ~CoreAudioIODevice() + ~WindowedGLContext() { - AudioHardwareRemovePropertyListener (kAudioPropertyWildcardPropertyID, - hardwareListenerProc); + makeInactive(); + [renderContext setView: nil]; + delete viewHolder; + } - delete internal; + bool makeActive() const throw() + { + jassert (renderContext != 0); + [renderContext makeCurrentContext]; + return renderContext != 0; } - const StringArray getOutputChannelNames() + bool makeInactive() const throw() { - return internal->outChanNames; + if (! isActive()) + [NSOpenGLContext clearCurrentContext]; + + return true; } - const StringArray getInputChannelNames() + bool isActive() const throw() { - if (internal->inputDevice != 0) - return internal->inputDevice->inChanNames; - else - return internal->inChanNames; + return [NSOpenGLContext currentContext] == renderContext; } - int getNumSampleRates() + const OpenGLPixelFormat getPixelFormat() const { return pixelFormat; } + void* getRawContext() const throw() { return renderContext; } + + void updateWindowPosition (int x, int y, int w, int h, int outerWindowHeight) { - return internal->sampleRates.size(); } - double getSampleRate (int index) + void swapBuffers() { - return internal->sampleRates [index]; + glFlush(); + [renderContext flushBuffer]; } - int getNumBufferSizesAvailable() + bool setSwapInterval (const int numFramesPerSwap) { - return internal->bufferSizes.size(); + [renderContext setValues: (const GLint*) &numFramesPerSwap + forParameter: NSOpenGLCPSwapInterval]; + return true; } - int getBufferSizeSamples (int index) + int getSwapInterval() const { - return internal->bufferSizes [index]; + GLint numFrames = 0; + [renderContext getValues: &numFrames + forParameter: NSOpenGLCPSwapInterval]; + return numFrames; } - int getDefaultBufferSize() + void repaint() { - for (int i = 0; i < getNumBufferSizesAvailable(); ++i) - if (getBufferSizeSamples(i) >= 512) - return getBufferSizeSamples(i); + // we need to invalidate the juce view that holds this gl view, to make it + // cause a repaint callback + NSView* v = (NSView*) viewHolder->view; + NSRect r = [v frame]; - return 512; + // bit of a bodge here.. if we only invalidate the area of the gl component, + // it's completely covered by the NSOpenGLView, so the OS throws away the + // repaint message, thus never causing our paint() callback, and never repainting + // the comp. So invalidating just a little bit around the edge helps.. + [[v superview] setNeedsDisplayInRect: NSInsetRect (r, -2.0f, -2.0f)]; } - const String open (const BitArray& inputChannels, - const BitArray& outputChannels, - double sampleRate, - int bufferSizeSamples) - { - isOpen_ = true; + void* getNativeWindowHandle() const { return viewHolder->view; } - if (bufferSizeSamples <= 0) - bufferSizeSamples = getDefaultBufferSize(); + juce_UseDebuggingNewOperator - internal->reopen (inputChannels, outputChannels, sampleRate, bufferSizeSamples); - lastError = internal->error; - return lastError; - } + NSOpenGLContext* renderContext; - void close() - { - isOpen_ = false; - } +private: + OpenGLPixelFormat pixelFormat; + NSViewComponentInternal* viewHolder; - bool isOpen() - { - return isOpen_; - } + WindowedGLContext (const WindowedGLContext&); + const WindowedGLContext& operator= (const WindowedGLContext&); +}; - int getCurrentBufferSizeSamples() - { - return internal != 0 ? internal->getBufferSize() : 512; - } +OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, + const OpenGLPixelFormat& pixelFormat, + const OpenGLContext* const contextToShareWith) +{ + WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, + contextToShareWith != 0 ? (NSOpenGLContext*) contextToShareWith->getRawContext() : 0); - double getCurrentSampleRate() - { - return internal != 0 ? internal->getSampleRate() : 0; - } + if (c->renderContext == 0) + deleteAndZero (c); - int getCurrentBitDepth() - { - return 32; // no way to find out, so just assume it's high.. - } + return c; +} - const BitArray getActiveOutputChannels() const - { - return internal != 0 ? internal->activeOutputChans : BitArray(); - } +void* OpenGLComponent::getNativeWindowHandle() const +{ + return context != 0 ? ((WindowedGLContext*) context)->getNativeWindowHandle() + : 0; +} - const BitArray getActiveInputChannels() const +void juce_glViewport (const int w, const int h) +{ + glViewport (0, 0, w, h); +} + +void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, + OwnedArray & results) +{ +/* GLint attribs [64]; + int n = 0; + attribs[n++] = AGL_RGBA; + attribs[n++] = AGL_DOUBLEBUFFER; + attribs[n++] = AGL_ACCELERATED; + attribs[n++] = AGL_NO_RECOVERY; + attribs[n++] = AGL_NONE; + + AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); + + while (p != 0) { - BitArray chans; + OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); + pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); + pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); + pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); + pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); + pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); + pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); + pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); + pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); + pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); + pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); - if (internal != 0) - { - chans = internal->activeInputChans; + results.add (pf); - if (internal->inputDevice != 0) - chans.orWith (internal->inputDevice->activeInputChans); - } + p = aglNextPixelFormat (p); + }*/ - return chans; - } + //jassertfalse //xxx can't see how you do this in cocoa! +} - int getOutputLatencyInSamples() - { - if (internal == 0) - return 0; +#endif +/********* End of inlined file: juce_mac_OpenGLComponent.mm *********/ - // this seems like a good guess at getting the latency right - comparing - // this with a round-trip measurement, it gets it to within a few millisecs - // for the built-in mac soundcard - return internal->outputLatency + internal->getBufferSize() * 2; +/********* Start of inlined file: juce_mac_MainMenu.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +class JuceMainMenuHandler; + +END_JUCE_NAMESPACE +using namespace JUCE_NAMESPACE; + +@interface JuceMenuCallback : NSObject +{ + JuceMainMenuHandler* owner; +} + +- (JuceMenuCallback*) initWithOwner: (JuceMainMenuHandler*) owner_; +- (void) dealloc; +- (void) menuItemInvoked: (id) menu; + +@end +BEGIN_JUCE_NAMESPACE + +class JuceMainMenuHandler : private MenuBarModelListener, + private DeletedAtShutdown +{ +public: + static JuceMainMenuHandler* instance; + + JuceMainMenuHandler() throw() + : currentModel (0) + { + callback = [[JuceMenuCallback alloc] initWithOwner: this]; } - int getInputLatencyInSamples() + ~JuceMainMenuHandler() throw() { - if (internal == 0) - return 0; + setMenu (0); - return internal->inputLatency + internal->getBufferSize() * 2; + jassert (instance == this); + instance = 0; + + [callback release]; } - void start (AudioIODeviceCallback* callback) + void setMenu (MenuBarModel* const newMenuBarModel) throw() { - if (internal != 0 && ! isStarted) + if (currentModel != newMenuBarModel) { - if (callback != 0) - callback->audioDeviceAboutToStart (this); + if (currentModel != 0) + currentModel->removeListener (this); - isStarted = true; - internal->start (callback); + currentModel = newMenuBarModel; + + if (currentModel != 0) + currentModel->addListener (this); + + menuBarItemsChanged (0); } } - void stop() + void addSubMenu (NSMenu* parent, const PopupMenu& child, + const String& name, int& menuId, int& tag) { - if (isStarted && internal != 0) - { - AudioIODeviceCallback* const lastCallback = internal->callback; + NSMenuItem* item = [parent addItemWithTitle: juceStringToNS (name) + action: nil + keyEquivalent: @""]; + [item setTag: tag]; - isStarted = false; - internal->stop (true); + NSMenu* sub = createMenu (child, name, menuId, tag); - if (lastCallback != 0) - lastCallback->audioDeviceStopped(); - } + [parent setSubmenu: sub forItem: item]; + [sub setAutoenablesItems: false]; + [sub release]; } - bool isPlaying() + void menuBarItemsChanged (MenuBarModel*) { - if (internal->callback == 0) - isStarted = false; + NSMenu* menuBar = [NSApp mainMenu]; + while ([menuBar numberOfItems] > 1) + [menuBar removeItemAtIndex: 1]; - return isStarted; + if (currentModel != 0) + { + const StringArray menuNames (currentModel->getMenuBarNames()); + int menuId = 1; + + for (int i = 0; i < menuNames.size(); ++i) + { + const PopupMenu menu (currentModel->getMenuForIndex (i, menuNames [i])); + addSubMenu (menuBar, menu, menuNames [i], menuId, i); + } + } } - const String getLastError() + static void flashMenuBar (NSMenu* menu) { - return lastError; - } + const unichar f35Key = NSF35FunctionKey; + NSString* f35String = [NSString stringWithCharacters: &f35Key length: 1]; - int inputIndex, outputIndex; + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"x" + action: nil + keyEquivalent: f35String]; + [item setTarget: nil]; + [menu insertItem: item atIndex: [menu numberOfItems]]; + [item release]; - juce_UseDebuggingNewOperator + NSEvent* f35Event = [NSEvent keyEventWithType: NSKeyDown + location: NSZeroPoint + modifierFlags: NSCommandKeyMask + timestamp: 0 + windowNumber: 0 + context: [NSGraphicsContext currentContext] + characters: f35String + charactersIgnoringModifiers: f35String + isARepeat: NO + keyCode: 0]; -private: - CoreAudioInternal* internal; - bool isOpen_, isStarted; - String lastError; + [menu performKeyEquivalent: f35Event]; + [menu removeItem: item]; + } - static OSStatus hardwareListenerProc (AudioHardwarePropertyID inPropertyID, void* inClientData) + void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) { - CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; + NSMenuItem* item = [[NSApp mainMenu] itemWithTag: info.commandID]; - switch (inPropertyID) + if (item != 0) + flashMenuBar ([item menu]); + } + + void invoke (const int commandId, ApplicationCommandManager* const commandManager, const int topLevelIndex) const + { + if (currentModel != 0) { - case kAudioHardwarePropertyDevices: - intern->deviceDetailsChanged(); - break; + if (commandManager != 0) + { + ApplicationCommandTarget::InvocationInfo info (commandId); + info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu; - case kAudioHardwarePropertyDefaultOutputDevice: - case kAudioHardwarePropertyDefaultInputDevice: - case kAudioHardwarePropertyDefaultSystemOutputDevice: - break; - } + commandManager->invoke (info, true); + } - return noErr; + currentModel->menuItemSelected (commandId, topLevelIndex); + } } - CoreAudioIODevice (const CoreAudioIODevice&); - const CoreAudioIODevice& operator= (const CoreAudioIODevice&); -}; - -class CoreAudioIODeviceType : public AudioIODeviceType -{ -public: + MenuBarModel* currentModel; - CoreAudioIODeviceType() - : AudioIODeviceType (T("CoreAudio")), - hasScanned (false) - { - } +private: + JuceMenuCallback* callback; - ~CoreAudioIODeviceType() + NSMenu* createMenu (const PopupMenu menu, + const String& menuName, + int& id, + const int topLevelIndex) { - } + NSMenu* m = [[NSMenu alloc] initWithTitle: juceStringToNS (menuName)]; - void scanForDevices() - { - hasScanned = true; + [m setAutoenablesItems: false]; - inputDeviceNames.clear(); - outputDeviceNames.clear(); - inputIds.clear(); - outputIds.clear(); + PopupMenu::MenuItemIterator iter (menu); - UInt32 size; - if (OK (AudioHardwareGetPropertyInfo (kAudioHardwarePropertyDevices, &size, 0))) + while (iter.next()) { - AudioDeviceID* const devs = (AudioDeviceID*) juce_calloc (size); + NSString* text = juceStringToNS (iter.itemName.upToFirstOccurrenceOf (T(""), false, true)); - if (OK (AudioHardwareGetProperty (kAudioHardwarePropertyDevices, &size, devs))) + if (iter.isSeparator) { - static bool alreadyLogged = false; - const int num = size / sizeof (AudioDeviceID); - for (int i = 0; i < num; ++i) - { - char name[1024]; - size = sizeof (name); - if (OK (AudioDeviceGetProperty (devs[i], 0, false, kAudioDevicePropertyDeviceName, &size, name))) - { - const String nameString (String::fromUTF8 ((const uint8*) name, strlen (name))); + [m addItem: [NSMenuItem separatorItem]]; + } + else if (iter.isSectionHeader) + { + NSMenuItem* item = [m addItemWithTitle: text + action: nil + keyEquivalent: @""]; - if (! alreadyLogged) - log (T("CoreAudio device: ") + nameString); + [item setEnabled: iter.isEnabled]; + } + else if (iter.subMenu != 0) + { + NSMenuItem* item = [m addItemWithTitle: text + action: nil + keyEquivalent: @""]; - const int numIns = getNumChannels (devs[i], true); - const int numOuts = getNumChannels (devs[i], false); + [item setTag: iter.itemId]; + [item setEnabled: iter.isEnabled]; - if (numIns > 0) - { - inputDeviceNames.add (nameString); - inputIds.add (devs[i]); - } + NSMenu* sub = createMenu (*iter.subMenu, iter.itemName, id, topLevelIndex); + [m setSubmenu: sub forItem: item]; + [sub release]; + } + else + { + NSMenuItem* item = [m addItemWithTitle: text + action: @selector (menuItemInvoked:) + keyEquivalent: @""]; - if (numOuts > 0) - { - outputDeviceNames.add (nameString); - outputIds.add (devs[i]); - } + [item setTag: iter.itemId]; + [item setEnabled: iter.isEnabled]; + [item setState: iter.isTicked ? NSOnState : NSOffState]; + [item setTarget: (id) callback]; + + NSMutableArray* info = [NSMutableArray arrayWithObject: [NSNumber numberWithUnsignedLongLong: (pointer_sized_int) (void*) iter.commandManager]]; + [info addObject: [NSNumber numberWithInt: topLevelIndex]]; + [item setRepresentedObject: info]; + + if (iter.commandManager != 0) + { + const Array keyPresses (iter.commandManager->getKeyMappings() + ->getKeyPressesAssignedToCommand (iter.itemId)); + + if (keyPresses.size() > 0) + { + const KeyPress& kp = keyPresses.getReference(0); + + juce_wchar key = kp.getTextCharacter(); + + if (kp.getKeyCode() == KeyPress::backspaceKey) + key = NSBackspaceCharacter; + else if (kp.getKeyCode() == KeyPress::deleteKey) + key = NSDeleteCharacter; + else if (key == 0) + key = (juce_wchar) kp.getKeyCode(); + + unsigned int mods = 0; + if (kp.getModifiers().isShiftDown()) + mods |= NSShiftKeyMask; + if (kp.getModifiers().isCtrlDown()) + mods |= NSControlKeyMask; + if (kp.getModifiers().isAltDown()) + mods |= NSAlternateKeyMask; + if (kp.getModifiers().isCommandDown()) + mods |= NSCommandKeyMask; + + [item setKeyEquivalent: juceStringToNS (String::charToString (key))]; + [item setKeyEquivalentModifierMask: mods]; } } - - alreadyLogged = true; } - - juce_free (devs); } - inputDeviceNames.appendNumbersToDuplicates (false, true); - outputDeviceNames.appendNumbersToDuplicates (false, true); + [m update]; + return m; } +}; - const StringArray getDeviceNames (const bool wantInputNames) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this +JuceMainMenuHandler* JuceMainMenuHandler::instance = 0; - if (wantInputNames) - return inputDeviceNames; - else - return outputDeviceNames; - } +END_JUCE_NAMESPACE +@implementation JuceMenuCallback - int getDefaultDeviceIndex (const bool forInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this +- (JuceMenuCallback*) initWithOwner: (JuceMainMenuHandler*) owner_ +{ + [super init]; + owner = owner_; + return self; +} - AudioDeviceID deviceID; - UInt32 size = sizeof (deviceID); +- (void) dealloc +{ + [super dealloc]; +} - // if they're asking for any input channels at all, use the default input, so we - // get the built-in mic rather than the built-in output with no inputs.. - if (AudioHardwareGetProperty (forInput ? kAudioHardwarePropertyDefaultInputDevice - : kAudioHardwarePropertyDefaultOutputDevice, - &size, &deviceID) == noErr) - { - if (forInput) - { - for (int i = inputIds.size(); --i >= 0;) - if (inputIds[i] == deviceID) - return i; - } - else - { - for (int i = outputIds.size(); --i >= 0;) - if (outputIds[i] == deviceID) - return i; - } - } +- (void) menuItemInvoked: (id) menu +{ + NSMenuItem* item = (NSMenuItem*) menu; - return 0; + if ([[item representedObject] isKindOfClass: [NSArray class]]) + { + NSArray* info = (NSArray*) [item representedObject]; + + owner->invoke ([item tag], + (ApplicationCommandManager*) (pointer_sized_int) + [((NSNumber*) [info objectAtIndex: 0]) unsignedLongLongValue], + (int) [((NSNumber*) [info objectAtIndex: 1]) intValue]); } +} - int getIndexOfDevice (AudioIODevice* device, const bool asInput) const - { - jassert (hasScanned); // need to call scanForDevices() before doing this +@end - CoreAudioIODevice* const d = dynamic_cast (device); - if (d == 0) - return -1; +BEGIN_JUCE_NAMESPACE - return asInput ? d->inputIndex - : d->outputIndex; +void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel) throw() +{ + if (getMacMainMenu() != newMenuBarModel) + { + if (newMenuBarModel == 0) + { + delete JuceMainMenuHandler::instance; + jassert (JuceMainMenuHandler::instance == 0); // should be zeroed in the destructor + } + else + { + if (JuceMainMenuHandler::instance == 0) + JuceMainMenuHandler::instance = new JuceMainMenuHandler(); + + JuceMainMenuHandler::instance->setMenu (newMenuBarModel); + } } +} - bool hasSeparateInputsAndOutputs() const { return true; } +MenuBarModel* MenuBarModel::getMacMainMenu() throw() +{ + return JuceMainMenuHandler::instance != 0 + ? JuceMainMenuHandler::instance->currentModel : 0; +} - AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) - { - jassert (hasScanned); // need to call scanForDevices() before doing this +static NSMenu* createStandardAppMenu (const String& appName) +{ + NSMenu* menu = [[NSMenu alloc] initWithTitle: @"Apple"]; + NSMenuItem* item; - const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); - const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); + // xxx should allow the 'about' and 'preferences' items to be turned on programatically... +/* item = [menu addItemWithTitle: juceStringToNS ("About " + appName)] + action: @selector(orderFrontStandardAboutPanel:) keyEquivalent: @""]; + [item setTarget: NSApp]; + [menu addItem: [NSMenuItem separatorItem]]; +*/ - String deviceName (outputDeviceName); - if (deviceName.isEmpty()) - deviceName = inputDeviceName; +/* item = [menu addItemWithTitle: NSLocalizedString (@"Preferences...", nil) + action: nil keyEquivalent: @","]; + [menu addItem: [NSMenuItem separatorItem]]; +*/ - if (index >= 0) - return new CoreAudioIODevice (deviceName, - inputIds [inputIndex], - inputIndex, - outputIds [outputIndex], - outputIndex); + // Services... + item = [menu addItemWithTitle: NSLocalizedString (@"Services", nil) + action: nil keyEquivalent: @""]; + NSMenu* servicesMenu = [[NSMenu alloc] initWithTitle: @"Services"]; + [menu setSubmenu: servicesMenu forItem: item]; + [NSApp setServicesMenu: servicesMenu]; + [servicesMenu release]; + [menu addItem: [NSMenuItem separatorItem]]; - return 0; - } + // Hide + Show stuff... + item = [menu addItemWithTitle: juceStringToNS ("Hide " + appName) + action: @selector (hide:) keyEquivalent: @"h"]; + [item setTarget: NSApp]; - juce_UseDebuggingNewOperator + item = [menu addItemWithTitle: NSLocalizedString (@"Hide Others", nil) + action: @selector (hideOtherApplications:) keyEquivalent: @"h"]; + [item setKeyEquivalentModifierMask: NSCommandKeyMask | NSAlternateKeyMask]; + [item setTarget: NSApp]; -private: - StringArray inputDeviceNames, outputDeviceNames; - Array inputIds, outputIds; + item = [menu addItemWithTitle: NSLocalizedString (@"Show All", nil) + action: @selector (unhideAllApplications:) keyEquivalent: @""]; + [item setTarget: NSApp]; + [menu addItem: [NSMenuItem separatorItem]]; - bool hasScanned; + // Quit item.... + item = [menu addItemWithTitle: juceStringToNS ("Quit " + appName) + action: @selector (terminate:) keyEquivalent: @"q"]; + [item setTarget: NSApp]; - static int getNumChannels (AudioDeviceID deviceID, bool input) - { - int total = 0; - UInt32 size; + return menu; +} - if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) - { - AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); +// Since our app has no NIB, this initialises a standard app menu... +void initialiseMainMenu() +{ + if (JUCEApplication::getInstance() != 0) // only needed in an app + { + const ScopedAutoReleasePool pool; - if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) - { - const int numStreams = bufList->mNumberBuffers; + NSMenu* mainMenu = [[NSMenu alloc] initWithTitle: @"MainMenu"]; + NSMenuItem* item = [mainMenu addItemWithTitle: @"Apple" action: nil keyEquivalent: @""]; - for (int i = 0; i < numStreams; ++i) - { - const AudioBuffer& b = bufList->mBuffers[i]; - total += b.mNumberChannels; - } - } + NSMenu* appMenu = createStandardAppMenu (JUCEApplication::getInstance()->getApplicationName()); - juce_free (bufList); - } + [NSApp performSelector: @selector (setAppleMenu:) withObject: appMenu]; + [mainMenu setSubmenu: appMenu forItem: item]; - return total; + [NSApp setMainMenu: mainMenu]; + [appMenu release]; + [mainMenu release]; } +} - CoreAudioIODeviceType (const CoreAudioIODeviceType&); - const CoreAudioIODeviceType& operator= (const CoreAudioIODeviceType&); -}; +#endif +/********* End of inlined file: juce_mac_MainMenu.mm *********/ -AudioIODeviceType* juce_createDefaultAudioIODeviceType() +/********* Start of inlined file: juce_mac_FileChooser.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE + +END_JUCE_NAMESPACE +using namespace JUCE_NAMESPACE; + +@interface JuceFileChooserDelegate : NSObject { - return new CoreAudioIODeviceType(); + StringArray* filters; } -#undef log - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_CoreAudio.cpp *********/ +- (JuceFileChooserDelegate*) initWithFilters: (StringArray*) filters_; +- (void) dealloc; +- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename; -/********* Start of inlined file: juce_mac_CoreMidi.cpp *********/ -#include +@end -BEGIN_JUCE_NAMESPACE +@implementation JuceFileChooserDelegate +- (JuceFileChooserDelegate*) initWithFilters: (StringArray*) filters_ +{ + [super init]; + filters = filters_; + return self; +} -#undef log -#define log(a) Logger::writeToLog(a) +- (void) dealloc +{ + delete filters; + [super dealloc]; +} -static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) +- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename { - if (err == noErr) - return true; + const String fname (nsStringToJuce (filename)); - log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); - jassertfalse - return false; + for (int i = filters->size(); --i >= 0;) + if (fname.matchesWildcard ((*filters)[i], true)) + return true; + + return File (fname).isDirectory(); } +@end -#undef OK -#define OK(a) logAnyErrorsMidi(a, __LINE__) +BEGIN_JUCE_NAMESPACE -static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) +void FileChooser::showPlatformDialog (OwnedArray& results, + const String& title, + const File& currentFileOrDirectory, + const String& filter, + bool selectsDirectory, + bool isSaveDialogue, + bool warnAboutOverwritingExistingFiles, + bool selectMultipleFiles, + FilePreviewComponent* extraInfoComponent) { - String result; - CFStringRef str = 0; + const ScopedAutoReleasePool pool; - MIDIObjectGetStringProperty (endpoint, kMIDIPropertyName, &str); + StringArray* filters = new StringArray(); + filters->addTokens (filter.replaceCharacters (T(",:"), T(";;")), T(";"), 0); + filters->trim(); + filters->removeEmptyStrings(); - if (str != 0) - { - result = PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - str = 0; - } + JuceFileChooserDelegate* delegate = [[JuceFileChooserDelegate alloc] initWithFilters: filters]; + [delegate autorelease]; - MIDIEntityRef entity = 0; - MIDIEndpointGetEntity (endpoint, &entity); + NSSavePanel* panel = isSaveDialogue ? [NSSavePanel savePanel] + : [NSOpenPanel openPanel]; - if (entity == 0) - return result; // probably virtual + [panel setTitle: juceStringToNS (title)]; - if (result.isEmpty()) + if (! isSaveDialogue) { - // endpoint name has zero length - try the entity - MIDIObjectGetStringProperty (entity, kMIDIPropertyName, &str); - - if (str != 0) - { - result += PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - str = 0; - } + NSOpenPanel* openPanel = (NSOpenPanel*) panel; + [openPanel setCanChooseDirectories: selectsDirectory]; + [openPanel setCanChooseFiles: ! selectsDirectory]; + [openPanel setAllowsMultipleSelection: selectMultipleFiles]; } - // now consider the device's name - MIDIDeviceRef device = 0; - MIDIEntityGetDevice (entity, &device); - if (device == 0) - return result; + [panel setDelegate: delegate]; - MIDIObjectGetStringProperty (device, kMIDIPropertyName, &str); + String directory, filename; - if (str != 0) + if (currentFileOrDirectory.isDirectory()) { - const String s (PlatformUtilities::cfStringToJuceString (str)); - CFRelease (str); + directory = currentFileOrDirectory.getFullPathName(); + } + else + { + directory = currentFileOrDirectory.getParentDirectory().getFullPathName(); + filename = currentFileOrDirectory.getFileName(); + } - // if an external device has only one entity, throw away - // the endpoint name and just use the device name - if (isExternal && MIDIDeviceGetNumberOfEntities (device) < 2) + if ([panel runModalForDirectory: juceStringToNS (directory) + file: juceStringToNS (filename)] + == NSOKButton) + { + if (isSaveDialogue) { - result = s; + results.add (new File (nsStringToJuce ([panel filename]))); } - else if (! result.startsWithIgnoreCase (s)) + else { - // prepend the device name to the entity name - result = (s + T(" ") + result).trimEnd(); + NSOpenPanel* openPanel = (NSOpenPanel*) panel; + NSArray* urls = [openPanel filenames]; + for (int i = 0; i < [urls count]; ++i) + { + NSString* f = [urls objectAtIndex: i]; + results.add (new File (nsStringToJuce (f))); + } } } - return result; + [panel setDelegate: nil]; } -static const String getConnectedEndpointName (MIDIEndpointRef endpoint) -{ - String result; +#endif +/********* End of inlined file: juce_mac_FileChooser.mm *********/ - // Does the endpoint have connections? - CFDataRef connections = 0; - int numConnections = 0; +/********* Start of inlined file: juce_mac_QuickTimeMovieComponent.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_QUICKTIME - MIDIObjectGetDataProperty (endpoint, kMIDIPropertyConnectionUniqueID, &connections); +#define theMovie ((QTMovie*) movie) - if (connections != 0) - { - numConnections = CFDataGetLength (connections) / sizeof (MIDIUniqueID); +QuickTimeMovieComponent::QuickTimeMovieComponent() + : movie (0) +{ + setOpaque (true); + setVisible (true); - if (numConnections > 0) - { - const SInt32* pid = reinterpret_cast (CFDataGetBytePtr (connections)); + QTMovieView* view = [[QTMovieView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f)]; + setView (view); +} - for (int i = 0; i < numConnections; ++i, ++pid) - { - MIDIUniqueID uid = EndianS32_BtoN (*pid); - MIDIObjectRef connObject; - MIDIObjectType connObjectType; - OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); +QuickTimeMovieComponent::~QuickTimeMovieComponent() +{ + closeMovie(); + setView (0); +} - if (err == noErr) - { - String s; +bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() +{ + return true; +} - if (connObjectType == kMIDIObjectType_ExternalSource - || connObjectType == kMIDIObjectType_ExternalDestination) - { - // Connected to an external device's endpoint (10.3 and later). - s = getEndpointName (static_cast (connObject), true); - } - else - { - // Connected to an external device (10.2) (or something else, catch-all) - CFStringRef str = 0; - MIDIObjectGetStringProperty (connObject, kMIDIPropertyName, &str); +bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, + const bool controllerVisible) +{ + closeMovie(); - if (str != 0) - { - s = PlatformUtilities::cfStringToJuceString (str); - CFRelease (str); - } - } + if (getPeer() == 0) + { + // To open a movie, this component must be visible inside a functioning window, so that + // the QT control can be assigned to the window. + jassertfalse + return false; + } - if (s.isNotEmpty()) - { - if (result.isNotEmpty()) - result += (", "); + FileInputStream* const fin = dynamic_cast (movieStream); - result += s; - } - } - } - } + if (fin != 0) + { + movieFile = fin->getFile(); + movie = [QTMovie movieWithFile: juceStringToNS (movieFile.getFullPathName()) + error: nil]; + } + else + { + MemoryBlock temp; + movieStream->readIntoMemoryBlock (temp); - CFRelease (connections); + movie = [QTMovie movieWithData: [NSData dataWithBytes: temp.getData() + length: temp.getSize()] + error: nil]; } - if (result.isNotEmpty()) - return result; + [theMovie retain]; + QTMovieView* view = (QTMovieView*) getView(); + [view setMovie: theMovie]; + [view setControllerVisible: controllerVisible]; + setLooping (looping); - // Here, either the endpoint had no connections, or we failed to obtain names for any of them. - return getEndpointName (endpoint, false); + return movie != nil; } -const StringArray MidiOutput::getDevices() +void QuickTimeMovieComponent::closeMovie() { - StringArray s; - - const ItemCount num = MIDIGetNumberOfDestinations(); - for (ItemCount i = 0; i < num; ++i) - { - MIDIEndpointRef dest = MIDIGetDestination (i); - - if (dest != 0) - { - String name (getConnectedEndpointName (dest)); + stop(); + QTMovieView* view = (QTMovieView*) getView(); + [view setMovie: nil]; + [theMovie release]; + movie = 0; + movieFile = File::nonexistent; +} - if (name.isEmpty()) - name = ""; +bool QuickTimeMovieComponent::isMovieOpen() const +{ + return movie != nil; +} - s.add (name); - } - else - { - s.add (""); - } - } +const File QuickTimeMovieComponent::getCurrentMovieFile() const +{ + return movieFile; +} - return s; +void QuickTimeMovieComponent::play() +{ + [theMovie play]; } -int MidiOutput::getDefaultDeviceIndex() +void QuickTimeMovieComponent::stop() { - return 0; + [theMovie stop]; } -static MIDIClientRef globalMidiClient; -static bool hasGlobalClientBeenCreated = false; +bool QuickTimeMovieComponent::isPlaying() const +{ + return movie != 0 && [theMovie rate] != 0; +} -static bool makeSureClientExists() +void QuickTimeMovieComponent::setPosition (const double seconds) { - if (! hasGlobalClientBeenCreated) + if (movie != 0) { - String name (T("JUCE")); + QTTime t; + t.timeValue = (uint64) (100000.0 * seconds); + t.timeScale = 100000; + t.flags = 0; - if (JUCEApplication::getInstance() != 0) - name = JUCEApplication::getInstance()->getApplicationName(); + [theMovie setCurrentTime: t]; + } +} - CFStringRef appName = PlatformUtilities::juceStringToCFString (name); +double QuickTimeMovieComponent::getPosition() const +{ + if (movie == 0) + return 0.0; - hasGlobalClientBeenCreated = OK (MIDIClientCreate (appName, 0, 0, &globalMidiClient)); - CFRelease (appName); - } + QTTime t = [theMovie currentTime]; + return t.timeValue / (double) t.timeScale; +} - return hasGlobalClientBeenCreated; +void QuickTimeMovieComponent::setSpeed (const float newSpeed) +{ + [theMovie setRate: newSpeed]; } -struct MidiPortAndEndpoint +double QuickTimeMovieComponent::getMovieDuration() const { - MIDIPortRef port; - MIDIEndpointRef endPoint; -}; + if (movie == 0) + return 0.0; -MidiOutput* MidiOutput::openDevice (int index) + QTTime t = [theMovie duration]; + return t.timeValue / (double) t.timeScale; +} + +void QuickTimeMovieComponent::setLooping (const bool shouldLoop) { - MidiOutput* mo = 0; + looping = shouldLoop; - if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfDestinations()) - { - MIDIEndpointRef endPoint = MIDIGetDestination (index); + [theMovie setAttribute: [NSNumber numberWithBool: shouldLoop] + forKey: QTMovieLoopsAttribute]; +} - CFStringRef pname; - if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) - { - log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); +bool QuickTimeMovieComponent::isLooping() const +{ + return looping; +} - if (makeSureClientExists()) - { - MIDIPortRef port; +void QuickTimeMovieComponent::setMovieVolume (const float newVolume) +{ + [theMovie setVolume: newVolume]; +} - if (OK (MIDIOutputPortCreate (globalMidiClient, pname, &port))) - { - MidiPortAndEndpoint* mpe = new MidiPortAndEndpoint(); - mpe->port = port; - mpe->endPoint = endPoint; +float QuickTimeMovieComponent::getMovieVolume() const +{ + return movie != 0 ? [theMovie volume] : 0.0f; +} - mo = new MidiOutput(); - mo->internal = (void*)mpe; - } - } +void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const +{ + width = 0; + height = 0; - CFRelease (pname); - } + if (movie != 0) + { + NSSize s = [[theMovie attributeForKey: QTMovieNaturalSizeAttribute] sizeValue]; + width = s.width; + height = s.height; } - - return mo; } -MidiOutput::~MidiOutput() +void QuickTimeMovieComponent::paint (Graphics& g) { - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; - MIDIPortDispose (mpe->port); - delete mpe; + if (movie == 0) + g.fillAll (Colours::black); } -void MidiOutput::reset() +bool QuickTimeMovieComponent::isControllerVisible() const { + return controllerVisible; } -bool MidiOutput::getVolume (float& leftVol, float& rightVol) +bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, + const bool isControllerVisible) { - return false; + const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); + movieFile = movieFile_; + return ok; } -void MidiOutput::setVolume (float leftVol, float rightVol) +void QuickTimeMovieComponent::goToStart() { + setPosition (0.0); } -void MidiOutput::sendMessageNow (const MidiMessage& message) +void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, + const RectanglePlacement& placement) { - MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; + int normalWidth, normalHeight; + getMovieNormalSize (normalWidth, normalHeight); - if (message.isSysEx()) + if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) { - MIDIPacketList* const packets = (MIDIPacketList*) juce_malloc (32 + message.getRawDataSize()); - packets->numPackets = 1; - packets->packet[0].timeStamp = 0; - packets->packet[0].length = message.getRawDataSize(); - memcpy (packets->packet[0].data, message.getRawData(), message.getRawDataSize()); + double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; - MIDISend (mpe->port, mpe->endPoint, packets); - juce_free (packets); + placement.applyTo (x, y, w, h, + spaceToFitWithin.getX(), spaceToFitWithin.getY(), + spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); + + if (w > 0 && h > 0) + { + setBounds (roundDoubleToInt (x), roundDoubleToInt (y), + roundDoubleToInt (w), roundDoubleToInt (h)); + } } else { - MIDIPacketList packets; - packets.numPackets = 1; - packets.packet[0].timeStamp = 0; - packets.packet[0].length = message.getRawDataSize(); - *(int*) (packets.packet[0].data) = *(const int*) message.getRawData(); - - MIDISend (mpe->port, mpe->endPoint, &packets); + setBounds (spaceToFitWithin); } } -const StringArray MidiInput::getDevices() +#if ! (JUCE_MAC && JUCE_64BIT) + +bool juce_OpenQuickTimeMovieFromStream (InputStream* movieStream, Movie& result, Handle& dataHandle) { - StringArray s; + if (movieStream == 0) + return false; - const ItemCount num = MIDIGetNumberOfSources(); - for (ItemCount i = 0; i < num; ++i) - { - MIDIEndpointRef source = MIDIGetSource (i); + QTMovie* movie = nil; - if (source != 0) - { - String name (getConnectedEndpointName (source)); + FileInputStream* const fin = dynamic_cast (movieStream); - if (name.isEmpty()) - name = ""; + if (fin != 0) + { + movie = [QTMovie movieWithFile: juceStringToNS (fin->getFile().getFullPathName()) + error: nil]; + } + else + { + MemoryBlock temp; + movieStream->readIntoMemoryBlock (temp); - s.add (name); - } - else - { - s.add (""); - } + movie = [QTMovie movieWithData: [NSData dataWithBytes: temp.getData() + length: temp.getSize()] + error: nil]; } - return s; + if (movie != nil) + result = [movie quickTimeMovie]; + + return movie != nil; } -int MidiInput::getDefaultDeviceIndex() +#endif + +#endif +/********* End of inlined file: juce_mac_QuickTimeMovieComponent.mm *********/ + +/********* Start of inlined file: juce_mac_AudioCDBurner.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_USE_CDBURNER + +END_JUCE_NAMESPACE + +@interface OpenDiskDevice : NSObject { - return 0; + DRDevice* device; + + NSMutableArray* tracks; } -struct MidiPortAndCallback +- (OpenDiskDevice*) initWithDevice: (DRDevice*) device; +- (void) dealloc; +- (bool) isDiskPresent; +- (int) getNumAvailableAudioBlocks; +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) numSamples_; +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error + ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting; +@end + +@interface AudioTrackProducer : NSObject { - MidiInput* input; - MIDIPortRef port; - MIDIEndpointRef endPoint; - MidiInputCallback* callback; - MemoryBlock pendingData; - int pendingBytes; - double pendingDataTime; - bool active; -}; + JUCE_NAMESPACE::AudioSource* source; + int readPosition, lengthInFrames; +} -static CriticalSection callbackLock; -static VoidArray activeCallbacks; +- (AudioTrackProducer*) init: (int) lengthInFrames; +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source numSamples: (int) lengthInSamples; +- (void) dealloc; +- (void) setupTrackProperties: (DRTrack*) track; -static void processSysex (MidiPortAndCallback* const mpe, const uint8*& d, int& size, const double time) -{ - if (*d == 0xf0) - { - mpe->pendingBytes = 0; - mpe->pendingDataTime = time; - } +- (void) cleanupTrackAfterBurn: (DRTrack*) track; +- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track; +- (uint64_t) estimateLengthOfTrack:(DRTrack*)track; +- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn + toMedia:(NSDictionary*)mediaInfo; +- (BOOL) prepareTrackForVerification:(DRTrack*)track; +- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer + length:(uint32_t)bufferLength atAddress:(uint64_t)address + blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; +- (uint32_t) producePreGapForTrack:(DRTrack*)track + intoBuffer:(char*)buffer length:(uint32_t)bufferLength + atAddress:(uint64_t)address blockSize:(uint32_t)blockSize + ioFlags:(uint32_t*)flags; +- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer + length:(uint32_t)bufferLength atAddress:(uint64_t)address + blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags; +- (uint32_t) producePreGapForTrack:(DRTrack*)track + intoBuffer:(char*)buffer length:(uint32_t)bufferLength + atAddress:(uint64_t)address blockSize:(uint32_t)blockSize + ioFlags:(uint32_t*)flags; +@end - mpe->pendingData.ensureSize (mpe->pendingBytes + size, false); - uint8* totalMessage = (uint8*) mpe->pendingData.getData(); +@implementation OpenDiskDevice - uint8* dest = totalMessage + mpe->pendingBytes; +- (OpenDiskDevice*) initWithDevice: (DRDevice*) device_ +{ + [super init]; - while (size > 0) - { - if (mpe->pendingBytes > 0 && *d >= 0x80) - { - if (*d >= 0xfa || *d == 0xf8) - { - mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time)); - ++d; - --size; - } - else - { - if (*d == 0xf7) - { - *dest++ = *d++; - mpe->pendingBytes++; - --size; - } + device = device_; + tracks = [[NSMutableArray alloc] init]; + return self; +} - break; - } - } - else - { - *dest++ = *d++; - mpe->pendingBytes++; - --size; - } - } +- (void) dealloc +{ + [tracks release]; + [super dealloc]; +} - if (totalMessage [mpe->pendingBytes - 1] == 0xf7) - { - mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (totalMessage, - mpe->pendingBytes, - mpe->pendingDataTime)); - mpe->pendingBytes = 0; - } - else - { - mpe->callback->handlePartialSysexMessage (mpe->input, - totalMessage, - mpe->pendingBytes, - mpe->pendingDataTime); - } +- (bool) isDiskPresent +{ + return [device isValid] + && [[[device status] objectForKey: DRDeviceMediaStateKey] + isEqualTo: DRDeviceMediaStateMediaPresent]; } -static void midiInputProc (const MIDIPacketList* pktlist, - void* readProcRefCon, - void* srcConnRefCon) +- (int) getNumAvailableAudioBlocks { - double time = Time::getMillisecondCounterHiRes() * 0.001; - const double originalTime = time; + return [[[[device status] objectForKey: DRDeviceMediaInfoKey] + objectForKey: DRDeviceMediaBlocksFreeKey] intValue]; +} - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) readProcRefCon; - const ScopedLock sl (callbackLock); +- (void) addSourceTrack: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) numSamples_ +{ + AudioTrackProducer* p = [[AudioTrackProducer alloc] initWithAudioSource: source_ numSamples: numSamples_]; + DRTrack* t = [[DRTrack alloc] initWithProducer: p]; + [p setupTrackProperties: t]; - if (activeCallbacks.contains (mpe) && mpe->active) + [tracks addObject: t]; + + [t release]; + [p release]; +} + +- (void) burn: (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener*) listener errorString: (JUCE_NAMESPACE::String*) error + ejectAfterwards: (bool) shouldEject isFake: (bool) peformFakeBurnForTesting +{ + DRBurn* burn = [DRBurn burnForDevice: device]; + + if (! [device acquireExclusiveAccess]) { - const MIDIPacket* packet = &pktlist->packet[0]; + *error = "Couldn't open or write to the CD device"; + return; + } - for (unsigned int i = 0; i < pktlist->numPackets; ++i) - { - const uint8* d = (const uint8*) (packet->data); - int size = packet->length; + [device acquireMediaReservation]; - while (size > 0) - { - time = originalTime; + NSMutableDictionary* d = [[burn properties] mutableCopy]; + [d autorelease]; + [d setObject: [NSNumber numberWithBool: peformFakeBurnForTesting] forKey: DRBurnTestingKey]; + [d setObject: [NSNumber numberWithBool: false] forKey: DRBurnVerifyDiscKey]; + [d setObject: (shouldEject ? DRBurnCompletionActionEject : DRBurnCompletionActionMount) + forKey: DRBurnCompletionActionKey]; + [burn setProperties: d]; - if (mpe->pendingBytes > 0 || d[0] == 0xf0) - { - processSysex (mpe, d, size, time); - } - else - { - int used = 0; - const MidiMessage m (d, size, used, 0, time); + [burn writeLayout: tracks]; - if (used <= 0) - { - jassertfalse // malformed midi message - break; - } - else - { - mpe->callback->handleIncomingMidiMessage (mpe->input, m); - } + for (;;) + { + JUCE_NAMESPACE::Thread::sleep (300); + float progress = [[[burn status] objectForKey: DRStatusPercentCompleteKey] floatValue]; - size -= used; - d += used; - } - } +NSLog ([[burn status] description]); - packet = MIDIPacketNext (packet); + if (listener != 0 && listener->audioCDBurnProgress (progress)) + { + [burn abort]; + *error = "User cancelled the write operation"; + break; } - } -} -MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) -{ - MidiInput* mi = 0; + if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateFailed]) + { + *error = "Write operation failed"; + break; + } + else if ([[[burn status] objectForKey: DRStatusStateKey] isEqualTo: DRStatusStateDone]) + { + break; + } - if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfSources()) - { - MIDIEndpointRef endPoint = MIDIGetSource (index); + NSString* err = (NSString*) [[[burn status] objectForKey: DRErrorStatusKey] + objectForKey: DRErrorStatusErrorStringKey]; - if (endPoint != 0) + if ([err length] > 0) { - CFStringRef pname; + *error = JUCE_NAMESPACE::String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [err UTF8String]); + break; + } + } - if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) - { - log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); + [device releaseMediaReservation]; + [device releaseExclusiveAccess]; +} +@end - if (makeSureClientExists()) - { - MIDIPortRef port; +@implementation AudioTrackProducer - MidiPortAndCallback* const mpe = new MidiPortAndCallback(); - mpe->active = false; +- (AudioTrackProducer*) init: (int) lengthInFrames_ +{ + lengthInFrames = lengthInFrames_; + readPosition = 0; + return self; +} - if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpe, &port))) - { - if (OK (MIDIPortConnectSource (port, endPoint, 0))) - { - mpe->port = port; - mpe->endPoint = endPoint; - mpe->callback = callback; - mpe->pendingBytes = 0; - mpe->pendingData.ensureSize (128); +- (void) setupTrackProperties: (DRTrack*) track +{ + NSMutableDictionary* p = [[track properties] mutableCopy]; + [p setObject:[DRMSF msfWithFrames: lengthInFrames] forKey: DRTrackLengthKey]; + [p setObject:[NSNumber numberWithUnsignedShort:2352] forKey: DRBlockSizeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRDataFormKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRBlockTypeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRTrackModeKey]; + [p setObject:[NSNumber numberWithInt:0] forKey: DRSessionFormatKey]; - mi = new MidiInput (getDevices() [index]); - mpe->input = mi; - mi->internal = (void*) mpe; + [track setProperties: p]; + [p release]; +} - const ScopedLock sl (callbackLock); - activeCallbacks.add (mpe); - } - else - { - OK (MIDIPortDispose (port)); - delete mpe; - } - } - else - { - delete mpe; - } - } - } +- (AudioTrackProducer*) initWithAudioSource: (JUCE_NAMESPACE::AudioSource*) source_ numSamples: (int) lengthInSamples +{ + AudioTrackProducer* s = [self init: (lengthInSamples + 587) / 588]; - CFRelease (pname); - } - } + if (s != nil) + s->source = source_; - return mi; + return s; } -MidiInput::MidiInput (const String& name_) - : name (name_) +- (void) dealloc { + if (source != 0) + { + source->releaseResources(); + delete source; + } + + [super dealloc]; } -MidiInput::~MidiInput() +- (void) cleanupTrackAfterBurn: (DRTrack*) track { - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - mpe->active = false; +} - callbackLock.enter(); - activeCallbacks.removeValue (mpe); - callbackLock.exit(); +- (BOOL) cleanupTrackAfterVerification: (DRTrack*) track +{ + return true; +} - OK (MIDIPortDisconnectSource (mpe->port, mpe->endPoint)); - OK (MIDIPortDispose (mpe->port)); - delete mpe; +- (uint64_t) estimateLengthOfTrack: (DRTrack*) track +{ + return lengthInFrames; } -void MidiInput::start() +- (BOOL) prepareTrack: (DRTrack*) track forBurn: (DRBurn*) burn + toMedia: (NSDictionary*) mediaInfo { - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - const ScopedLock sl (callbackLock); - mpe->active = true; + if (source != 0) + source->prepareToPlay (44100 / 75, 44100); + + readPosition = 0; + return true; } -void MidiInput::stop() +- (BOOL) prepareTrackForVerification: (DRTrack*) track { - MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; - const ScopedLock sl (callbackLock); - mpe->active = false; + if (source != 0) + source->prepareToPlay (44100 / 75, 44100); + + return true; } -#undef log +- (uint32_t) produceDataForTrack: (DRTrack*) track intoBuffer: (char*) buffer + length: (uint32_t) bufferLength atAddress: (uint64_t) address + blockSize: (uint32_t) blockSize ioFlags: (uint32_t*) flags +{ + if (source != 0) + { + const int numSamples = JUCE_NAMESPACE::jmin (bufferLength / 4, (lengthInFrames * (44100 / 75)) - readPosition); -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_CoreMidi.cpp *********/ + if (numSamples > 0) + { + JUCE_NAMESPACE::AudioSampleBuffer tempBuffer (2, numSamples); -/********* Start of inlined file: juce_mac_FileChooser.mm *********/ + JUCE_NAMESPACE::AudioSourceChannelInfo info; + info.buffer = &tempBuffer; + info.startSample = 0; + info.numSamples = numSamples; -#include + source->getNextAudioBlock (info); -BEGIN_JUCE_NAMESPACE + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (0), + buffer, numSamples, 4); + JUCE_NAMESPACE::AudioDataConverters::convertFloatToInt16LE (tempBuffer.getSampleData (1), + buffer + 2, numSamples, 4); -END_JUCE_NAMESPACE + readPosition += numSamples; + } -@interface JuceFileChooserDelegate : NSObject + return numSamples * 4; + } + + return 0; +} + +- (uint32_t) producePreGapForTrack: (DRTrack*) track + intoBuffer: (char*) buffer length: (uint32_t) bufferLength + atAddress: (uint64_t) address blockSize: (uint32_t) blockSize + ioFlags: (uint32_t*) flags { - JUCE_NAMESPACE::StringArray* filters; + zeromem (buffer, bufferLength); + return bufferLength; } -- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_; -- (void) dealloc; -- (BOOL) panel: (id) sender shouldShowFilename: (NSString*) filename; +- (BOOL) verifyDataForTrack: (DRTrack*) track inBuffer: (const char*) buffer + length: (uint32_t) bufferLength atAddress: (uint64_t) address + blockSize: (uint32_t) blockSize ioFlags: (uint32_t*) flags +{ + return true; +} @end -@implementation JuceFileChooserDelegate -- (JuceFileChooserDelegate*) initWithFilters: (JUCE_NAMESPACE::StringArray*) filters_ +BEGIN_JUCE_NAMESPACE + +AudioCDBurner::AudioCDBurner (const int deviceIndex) + : internal (0) { - [super init]; - filters = filters_; - return self; + OpenDiskDevice* dev = [[OpenDiskDevice alloc] initWithDevice: [[DRDevice devices] objectAtIndex: deviceIndex]]; + + internal = (void*) dev; } -- (void) dealloc +AudioCDBurner::~AudioCDBurner() { - delete filters; - [super dealloc]; + OpenDiskDevice* dev = (OpenDiskDevice*) internal; + + if (dev != 0) + [dev release]; } -- (BOOL) panel:(id) sender shouldShowFilename: (NSString*) filename +AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex) { - const JUCE_NAMESPACE::String fname (nsStringToJuce (filename)); + AudioCDBurner* b = new AudioCDBurner (deviceIndex); - for (int i = filters->size(); --i >= 0;) - { - const JUCE_NAMESPACE::String wildcard ((*filters)[i]); + if (b->internal == 0) + deleteAndZero (b); - if (fnmatch (wildcard.toLowerCase().toUTF8(), - fname.toLowerCase().toUTF8(), 0) == 0) - return true; + return b; +} + +static NSArray* findDiskBurnerDevices() +{ + NSMutableArray* results = [NSMutableArray array]; + NSArray* devs = [DRDevice devices]; + + if (devs != 0) + { + int num = [devs count]; + int i; + for (i = 0; i < num; ++i) + { + NSDictionary* dic = [[devs objectAtIndex: i] info]; + NSString* name = [dic valueForKey: DRDeviceProductNameKey]; + if (name != nil) + [results addObject: name]; + } } - return JUCE_NAMESPACE::File (fname).isDirectory(); + return results; } -@end -BEGIN_JUCE_NAMESPACE +const StringArray AudioCDBurner::findAvailableDevices() +{ + NSArray* names = findDiskBurnerDevices(); + StringArray s; -void FileChooser::showPlatformDialog (OwnedArray& results, - const String& title, - const File& currentFileOrDirectory, - const String& filter, - bool selectsDirectory, - bool isSaveDialogue, - bool warnAboutOverwritingExistingFiles, - bool selectMultipleFiles, - FilePreviewComponent* extraInfoComponent) + for (int i = 0; i < [names count]; ++i) + s.add (String::fromUTF8 ((JUCE_NAMESPACE::uint8*) [[names objectAtIndex: i] UTF8String])); + + return s; +} + +bool AudioCDBurner::isDiskPresent() const { - const AutoPool pool; + OpenDiskDevice* dev = (OpenDiskDevice*) internal; - StringArray* filters = new StringArray(); - filters->addTokens (filter.replaceCharacters (T(",:"), T(";;")), T(";"), 0); - filters->trim(); - filters->removeEmptyStrings(); + return dev != 0 && [dev isDiskPresent]; +} - JuceFileChooserDelegate* delegate = [[JuceFileChooserDelegate alloc] initWithFilters: filters]; - [delegate autorelease]; +int AudioCDBurner::getNumAvailableAudioBlocks() const +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; - NSSavePanel* panel = isSaveDialogue ? [NSSavePanel savePanel] - : [NSOpenPanel openPanel]; + return [dev getNumAvailableAudioBlocks]; +} - [panel setTitle: juceStringToNS (title)]; +bool AudioCDBurner::addAudioTrack (AudioSource* source, int numSamps) +{ + OpenDiskDevice* dev = (OpenDiskDevice*) internal; - if (! isSaveDialogue) + if (dev != 0) { - NSOpenPanel* openPanel = (NSOpenPanel*) panel; - [openPanel setCanChooseDirectories: selectsDirectory]; - [openPanel setCanChooseFiles: ! selectsDirectory]; - [openPanel setAllowsMultipleSelection: selectMultipleFiles]; + [dev addSourceTrack: source numSamples: numSamps]; + return true; } - [panel setDelegate: delegate]; + return false; +} - String directory, filename; +const String AudioCDBurner::burn (JUCE_NAMESPACE::AudioCDBurner::BurnProgressListener* listener, + const bool ejectDiscAfterwards, + const bool peformFakeBurnForTesting) +{ + String error ("Couldn't open or write to the CD device"); - if (currentFileOrDirectory.isDirectory()) - { - directory = currentFileOrDirectory.getFullPathName(); - } - else - { - directory = currentFileOrDirectory.getParentDirectory().getFullPathName(); - filename = currentFileOrDirectory.getFileName(); - } + OpenDiskDevice* dev = (OpenDiskDevice*) internal; - if ([panel runModalForDirectory: juceStringToNS (directory) - file: juceStringToNS (filename)] - == NSOKButton) + if (dev != 0) { - if (isSaveDialogue) - { - results.add (new File (nsStringToJuce ([panel filename]))); - } - else - { - NSOpenPanel* openPanel = (NSOpenPanel*) panel; - NSArray* urls = [openPanel filenames]; - for (int i = 0; i < [urls count]; ++i) - { - NSString* f = [urls objectAtIndex: i]; - results.add (new File (nsStringToJuce (f))); - } - } + error = String::empty; + [dev burn: listener + errorString: &error + ejectAfterwards: ejectDiscAfterwards + isFake: peformFakeBurnForTesting]; } - [panel setDelegate: nil]; + return error; } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_FileChooser.mm *********/ - -/********* Start of inlined file: juce_mac_Fonts.mm *********/ - -#include +#endif +/********* End of inlined file: juce_mac_AudioCDBurner.mm *********/ -BEGIN_JUCE_NAMESPACE +/********* Start of inlined file: juce_mac_Fonts.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE static OSStatus pascal CubicMoveTo (const Float32Point *pt, void* callBackDataPtr) @@ -256721,21 +267601,13 @@ void Font::getDefaultFontNames (String& defaultSans, String& defaultSerif, Strin defaultFixed = "Monaco"; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_mac_Fonts.mm *********/ -/********* Start of inlined file: juce_mac_Messaging.mm *********/ - -#include - -BEGIN_JUCE_NAMESPACE - -#undef Point - -extern void juce_HandleProcessFocusChange(); -extern void juce_maximiseAllMinimisedWindows(); -extern void juce_InvokeMainMenuCommand (const HICommand& command); -extern void juce_MainMenuAboutToBeUsed(); +/********* Start of inlined file: juce_mac_MessageManager.mm *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE struct CallbackMessagePayload { @@ -256746,13 +267618,13 @@ struct CallbackMessagePayload }; END_JUCE_NAMESPACE - -#if JUCE_COCOA - -NSString* juceMessageName = 0; +using namespace JUCE_NAMESPACE; @interface JuceAppDelegate : NSObject -id oldDelegate; +{ + id oldDelegate; +} + - (JuceAppDelegate*) init; - (void) dealloc; - (BOOL) application: (NSApplication*) theApplication openFile: (NSString*) filename; @@ -256761,7 +267633,7 @@ id oldDelegate; - (void) applicationDidBecomeActive: (NSNotification*) aNotification; - (void) applicationDidResignActive: (NSNotification*) aNotification; - (void) applicationWillUnhide: (NSNotification*) aNotification; -- (void) customEvent: (NSNotification*) aNotification; +- (void) customEvent: (id) data; - (void) performCallback: (id) info; @end @@ -256773,7 +267645,7 @@ id oldDelegate; NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) + if (JUCEApplication::getInstance() != 0) { oldDelegate = [NSApp delegate]; [NSApp setDelegate: self]; @@ -256792,9 +267664,6 @@ id oldDelegate; } - [center addObserver: self selector: @selector (customEvent:) - name: juceMessageName object: nil]; - return self; } @@ -256803,23 +267672,27 @@ id oldDelegate; if (oldDelegate != 0) [NSApp setDelegate: oldDelegate]; - [[NSNotificationCenter defaultCenter] removeObserver: self]; [super dealloc]; } - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication*) app { - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - JUCE_NAMESPACE::JUCEApplication::getInstance()->systemRequestedQuit(); + if (JUCEApplication::getInstance() != 0) + { + JUCEApplication::getInstance()->systemRequestedQuit(); + + if (! MessageManager::getInstance()->hasStopMessageBeenSent()) + return NSTerminateCancel; + } - return NSTerminateLater; + return NSTerminateNow; } - (BOOL) application: (NSApplication*) app openFile: (NSString*) filename { - if (JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) + if (JUCEApplication::getInstance() != 0) { - JUCE_NAMESPACE::JUCEApplication::getInstance()->anotherInstanceStarted (nsStringToJuce (filename)); + JUCEApplication::getInstance()->anotherInstanceStarted (nsStringToJuce (filename)); return YES; } @@ -256828,41 +267701,44 @@ id oldDelegate; - (void) application: (NSApplication*) sender openFiles: (NSArray*) filenames { - JUCE_NAMESPACE::StringArray files; + StringArray files; for (int i = 0; i < [filenames count]; ++i) files.add (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - if (files.size() > 0 && JUCE_NAMESPACE::JUCEApplication::getInstance() != 0) - JUCE_NAMESPACE::JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); + if (files.size() > 0 && JUCEApplication::getInstance() != 0) + JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); } - (void) applicationDidBecomeActive: (NSNotification*) aNotification { - JUCE_NAMESPACE::juce_HandleProcessFocusChange(); + juce_HandleProcessFocusChange(); } - (void) applicationDidResignActive: (NSNotification*) aNotification { - JUCE_NAMESPACE::juce_HandleProcessFocusChange(); + juce_HandleProcessFocusChange(); } - (void) applicationWillUnhide: (NSNotification*) aNotification { - JUCE_NAMESPACE::juce_maximiseAllMinimisedWindows(); + juce_HandleProcessFocusChange(); } -- (void) customEvent: (NSNotification*) n +- (void) customEvent: (id) n { + NSData* data = (NSData*) n; void* message = 0; - [((NSData*) [n object]) getBytes: &message length: sizeof (message)]; + [data getBytes: &message length: sizeof (message)]; if (message != 0) - JUCE_NAMESPACE::MessageManager::getInstance()->deliverMessage (message); + MessageManager::getInstance()->deliverMessage (message); + + [data release]; } - (void) performCallback: (id) info { - JUCE_NAMESPACE::CallbackMessagePayload* pl = (JUCE_NAMESPACE::CallbackMessagePayload*) info; + CallbackMessagePayload* pl = (CallbackMessagePayload*) info; if (pl != 0) { @@ -256872,269 +267748,76 @@ id oldDelegate; } @end -#endif BEGIN_JUCE_NAMESPACE -#if JUCE_COCOA static JuceAppDelegate* juceAppDelegate = 0; -#else -static int kJUCEClass = FOUR_CHAR_CODE ('JUCE'); -const int kJUCEKind = 1; -const int kCallbackKind = 2; - -static pascal OSStatus EventHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - void* event = 0; - GetEventParameter (theEvent, 'mess', typeVoidPtr, 0, sizeof (void*), 0, &event); - - if (event != 0) - MessageManager::getInstance()->deliverMessage (event); - - return noErr; -} - -static pascal OSStatus CallbackHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - CallbackMessagePayload* pl = 0; - GetEventParameter (theEvent, 'mess', typeVoidPtr, 0, sizeof(pl), 0, &pl); - - if (pl != 0) - { - pl->result = (*pl->function) (pl->parameter); - pl->hasBeenExecuted = true; - } - - return noErr; -} - -static pascal OSStatus MouseClickHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) +void MessageManager::runDispatchLoop() { - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof(::Point), 0, &where); - WindowRef window; - if (FindWindow (where, &window) == inMenuBar) - { - // turn off the wait cursor before going in here.. - const int oldTimeBeforeWaitCursor = MessageManager::getInstance()->getTimeBeforeShowingWaitCursor(); - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); + const ScopedAutoReleasePool pool; + MessageManagerLock mml; - if (Component::getCurrentlyModalComponent() != 0) - Component::getCurrentlyModalComponent()->inputAttemptWhenModal(); + // must only be called by the message thread! + jassert (isThisTheMessageThread()); - juce_MainMenuAboutToBeUsed(); - MenuSelect (where); - HiliteMenu (0); - - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (oldTimeBeforeWaitCursor); - return noErr; - } - - return eventNotHandledErr; + [NSApp run]; } -static pascal OSErr QuitAppleEventHandler (const AppleEvent *appleEvt, AppleEvent* reply, long refcon) +void MessageManager::stopDispatchLoop() { - if (JUCEApplication::getInstance() != 0) - JUCEApplication::getInstance()->systemRequestedQuit(); - - return noErr; + quitMessagePosted = true; + [NSApp stop: nil]; } -static pascal OSErr OpenDocEventHandler (const AppleEvent *appleEvt, AppleEvent* reply, long refcon) +bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) { - AEDescList docs; - StringArray files; - - if (AEGetParamDesc (appleEvt, keyDirectObject, typeAEList, &docs) == noErr) - { - long num; - if (AECountItems (&docs, &num) == noErr) - { - for (int i = 1; i <= num; ++i) - { - FSRef file; - AEKeyword keyword; - DescType type; - Size size; - - if (AEGetNthPtr (&docs, i, typeFSRef, &keyword, &type, - &file, sizeof (file), &size) == noErr) - { - const String path (PlatformUtilities::makePathFromFSRef (&file)); - - if (path.isNotEmpty()) - files.add (path.quoted()); - } - } - - if (files.size() > 0 - && JUCEApplication::getInstance() != 0) - { - JUCE_TRY - { - JUCEApplication::getInstance() - ->anotherInstanceStarted (files.joinIntoString (T(" "))); - } - JUCE_CATCH_ALL - } - } - - AEDisposeDesc (&docs); - }; - - return noErr; -} + const ScopedAutoReleasePool pool; + jassert (isThisTheMessageThread()); // must only be called by the message thread -static pascal OSStatus AppEventHandlerProc (EventHandlerCallRef, EventRef theEvent, void* userData) -{ - const UInt32 eventClass = GetEventClass (theEvent); + uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor; + NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow: millisecondsToRunFor * 0.001]; - if (eventClass == kEventClassCommand) + while (Time::getMillisecondCounter() < endTime) { - HICommand command; - - if (GetEventParameter (theEvent, kEventParamHICommand, typeHICommand, 0, sizeof (command), 0, &command) == noErr - || GetEventParameter (theEvent, kEventParamDirectObject, typeHICommand, 0, sizeof (command), 0, &command) == noErr) - { - if (command.commandID == kHICommandQuit) - { - if (JUCEApplication::getInstance() != 0) - JUCEApplication::getInstance()->systemRequestedQuit(); + const ScopedAutoReleasePool pool; - return noErr; - } - else if (command.commandID == kHICommandMaximizeAll - || command.commandID == kHICommandMaximizeWindow - || command.commandID == kHICommandBringAllToFront) - { - juce_maximiseAllMinimisedWindows(); - return noErr; - } - else - { - juce_InvokeMainMenuCommand (command); - } - } - } - else if (eventClass == kEventClassApplication) - { - if (GetEventKind (theEvent) == kEventAppFrontSwitched) - { - juce_HandleProcessFocusChange(); - } - else if (GetEventKind (theEvent) == kEventAppShown) - { - // this seems to blank the windows, so we need to do a repaint.. - for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) - { - Component* const c = Desktop::getInstance().getComponent (i); + [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode + beforeDate: endDate]; - if (c != 0) - c->repaint(); - } - } + NSEvent* e = [NSApp nextEventMatchingMask: NSAnyEventMask + untilDate: endDate + inMode: NSDefaultRunLoopMode + dequeue: YES]; + [NSApp sendEvent: e]; } - return eventNotHandledErr; + return ! quitMessagePosted; } -static EventQueueRef mainQueue; -static EventHandlerRef juceEventHandler = 0; -static EventHandlerRef callbackEventHandler = 0; - -#endif - void MessageManager::doPlatformSpecificInitialisation() { - static bool initialised = false; - - if (! initialised) - { - initialised = true; - -#if JUCE_COCOA - // if we're linking a Juce app to one or more dynamic libraries, we'll need different values - // for this so each module doesn't interfere with the others. - UnsignedWide t; - Microseconds (&t); - kJUCEClass ^= t.lo; - - juceMessageName = juceStringToNS ("juce_" + String::toHexString ((int) t.lo)); - + if (juceAppDelegate == 0) juceAppDelegate = [[JuceAppDelegate alloc] init]; -#else - mainQueue = GetMainEventQueue(); -#endif - } - -#if ! JUCE_COCOA - const EventTypeSpec type1 = { kJUCEClass, kJUCEKind }; - InstallApplicationEventHandler (NewEventHandlerUPP (EventHandlerProc), 1, &type1, 0, &juceEventHandler); - - const EventTypeSpec type2 = { kJUCEClass, kCallbackKind }; - InstallApplicationEventHandler (NewEventHandlerUPP (CallbackHandlerProc), 1, &type2, 0, &callbackEventHandler); - - // only do this stuff if we're running as an application rather than a library.. - if (JUCEApplication::getInstance() != 0) - { - const EventTypeSpec type3 = { kEventClassMouse, kEventMouseDown }; - InstallApplicationEventHandler (NewEventHandlerUPP (MouseClickHandlerProc), 1, &type3, 0, 0); - - const EventTypeSpec type4[] = { { kEventClassApplication, kEventAppShown }, - { kEventClassApplication, kEventAppFrontSwitched }, - { kEventClassCommand, kEventProcessCommand } }; - - InstallApplicationEventHandler (NewEventHandlerUPP (AppEventHandlerProc), 3, type4, 0, 0); - AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerUPP (QuitAppleEventHandler), 0, false); - - AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerUPP (OpenDocEventHandler), 0, false); - } -#endif + initialiseMainMenu(); } void MessageManager::doPlatformSpecificShutdown() { - if (juceEventHandler != 0) - { - RemoveEventHandler (juceEventHandler); - juceEventHandler = 0; - } - - if (callbackEventHandler != 0) - { - RemoveEventHandler (callbackEventHandler); - callbackEventHandler = 0; - } + [[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget: juceAppDelegate]; + [[NSNotificationCenter defaultCenter] removeObserver: juceAppDelegate]; + [juceAppDelegate release]; + juceAppDelegate = 0; } bool juce_postMessageToSystemQueue (void* message) { -#if JUCE_COCOA - [[NSNotificationCenter defaultCenter] postNotificationName: juceMessageName - object: [NSData dataWithBytes: &message - length: (int) sizeof (message)]]; - + [juceAppDelegate performSelectorOnMainThread: @selector (customEvent:) + withObject: (id) [[NSData alloc] initWithBytes: &message + length: (int) sizeof (message)] + waitUntilDone: NO]; return true; - -#else - jassert (mainQueue == GetMainEventQueue()); - - EventRef event; - if (CreateEvent (0, kJUCEClass, kJUCEKind, 0, kEventAttributeUserEvent, &event) == noErr) - { - SetEventParameter (event, 'mess', typeVoidPtr, sizeof (void*), &message); - const bool ok = PostEventToQueue (mainQueue, event, kEventPriorityStandard) == noErr; - ReleaseEvent (event); - return ok; - } - - return false; -#endif } void MessageManager::broadcastMessage (const String& value) throw() @@ -257156,48 +267839,21 @@ void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* call cmp.result = 0; cmp.hasBeenExecuted = false; -#if JUCE_COCOA [juceAppDelegate performSelectorOnMainThread: @selector (performCallback:) withObject: (id) &cmp waitUntilDone: YES]; return cmp.result; - -#else - jassert (mainQueue == GetMainEventQueue()); - - EventRef event; - if (CreateEvent (0, kJUCEClass, kCallbackKind, 0, kEventAttributeUserEvent, &event) == noErr) - { - void* v = &cmp; - SetEventParameter (event, 'mess', typeVoidPtr, sizeof (void*), &v); - - if (PostEventToQueue (mainQueue, event, kEventPriorityStandard) == noErr) - { - while (! cmp.hasBeenExecuted) - Thread::yield(); - - return cmp.result; - } - } - - return 0; -#endif } } -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_Messaging.mm *********/ +#endif +/********* End of inlined file: juce_mac_MessageManager.mm *********/ /********* Start of inlined file: juce_mac_WebBrowserComponent.mm *********/ - -#include -#include -#include -#include -#include - -BEGIN_JUCE_NAMESPACE +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#if JUCE_INCLUDED_FILE && JUCE_WEB_BROWSER END_JUCE_NAMESPACE @@ -257206,7 +267862,7 @@ END_JUCE_NAMESPACE JUCE_NAMESPACE::WebBrowserComponent* ownerComponent; } -- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; +- (DownloadClickDetector*) initWithWebBrowserOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent; - (void) webView: (WebView*) webView decidePolicyForNavigationAction: (NSDictionary*) actionInformation request: (NSURLRequest*) request @@ -257216,7 +267872,7 @@ END_JUCE_NAMESPACE @implementation DownloadClickDetector -- (DownloadClickDetector*) initWithOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ +- (DownloadClickDetector*) initWithWebBrowserOwner: (JUCE_NAMESPACE::WebBrowserComponent*) ownerComponent_ { [super init]; ownerComponent = ownerComponent_; @@ -257237,138 +267893,57 @@ END_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE -class WebBrowserComponentInternal : public Timer +class WebBrowserComponentInternal : public NSViewComponent { public: - WebBrowserComponentInternal (WebBrowserComponent* owner_) - : owner (owner_), - view (0), - webView (0) + WebBrowserComponentInternal (WebBrowserComponent* owner) { - HIWebViewCreate (&view); - - ComponentPeer* const peer = owner_->getPeer(); - jassert (peer != 0); - - if (view != 0 && peer != 0) - { - WindowRef parentWindow = (WindowRef) peer->getNativeHandle(); + webView = [[WebView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) + frameName: @"" + groupName: @""]; + setView (webView); - WindowAttributes attributes; - GetWindowAttributes (parentWindow, &attributes); - - HIViewRef parentView = 0; - - if ((attributes & kWindowCompositingAttribute) != 0) - { - HIViewRef root = HIViewGetRoot (parentWindow); - HIViewFindByID (root, kHIViewWindowContentID, &parentView); - - if (parentView == 0) - parentView = root; - } - else - { - GetRootControl (parentWindow, (ControlRef*) &parentView); - - if (parentView == 0) - CreateRootControl (parentWindow, (ControlRef*) &parentView); - } - - HIViewAddSubview (parentView, view); - updateBounds(); - show(); - - webView = HIWebViewGetWebView (view); - - clickListener = [[DownloadClickDetector alloc] initWithOwner: owner_]; - [webView setPolicyDelegate: clickListener]; - } - - startTimer (500); + clickListener = [[DownloadClickDetector alloc] initWithWebBrowserOwner: owner]; + [webView setPolicyDelegate: clickListener]; } ~WebBrowserComponentInternal() { [webView setPolicyDelegate: nil]; [clickListener release]; - - if (view != 0) - CFRelease (view); - } - - // Horrific bodge-workaround for the fact that the webview somehow hangs onto key - // focus when you pop up a new window, no matter what that window does to - // try to grab focus for itself. This catches such a situation and forces - // focus away from the webview, then back to the place it should be.. - void timerCallback() - { - WindowRef viewWindow = HIViewGetWindow (view); - WindowRef focusedWindow = GetUserFocusWindow(); - - if (focusedWindow != viewWindow) - { - if (HIViewSubtreeContainsFocus (view)) - { - HIViewAdvanceFocus (HIViewGetRoot (viewWindow), 0); - HIViewAdvanceFocus (HIViewGetRoot (focusedWindow), 0); - } - } - } - - void show() - { - HIViewSetVisible (view, true); - } - - void hide() - { - HIViewSetVisible (view, false); + setView (0); } void goToURL (const String& url, const StringArray* headers, const MemoryBlock* postData) { - char** headerNamesAsChars = 0; - char** headerValuesAsChars = 0; - int numHeaders = 0; + NSMutableURLRequest* r + = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: juceStringToNS (url)] + cachePolicy: NSURLRequestUseProtocolCachePolicy + timeoutInterval: 30.0]; - if (headers != 0) + if (postData != 0 && postData->getSize() > 0) { - numHeaders = headers->size(); - - headerNamesAsChars = (char**) juce_malloc (sizeof (char*) * numHeaders); - headerValuesAsChars = (char**) juce_malloc (sizeof (char*) * numHeaders); + [r setHTTPMethod: @"POST"]; + [r setHTTPBody: [NSData dataWithBytes: postData->getData() + length: postData->getSize()]]; + } - int i; - for (i = 0; i < numHeaders; ++i) + if (headers != 0) + { + for (int i = 0; i < headers->size(); ++i) { const String headerName ((*headers)[i].upToFirstOccurrenceOf (T(":"), false, false).trim()); - headerNamesAsChars[i] = (char*) juce_calloc (headerName.copyToUTF8 (0)); - headerName.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerNamesAsChars[i]); - const String headerValue ((*headers)[i].fromFirstOccurrenceOf (T(":"), false, false).trim()); - headerValuesAsChars[i] = (char*) juce_calloc (headerValue.copyToUTF8 (0)); - headerValue.copyToUTF8 ((JUCE_NAMESPACE::uint8*) headerValuesAsChars[i]); - } - } - - sendWebViewToURL ((const char*) url.toUTF8(), - (const char**) headerNamesAsChars, - (const char**) headerValuesAsChars, - numHeaders, - postData != 0 ? (const char*) postData->getData() : 0, - postData != 0 ? postData->getSize() : 0); - for (int i = 0; i < numHeaders; ++i) - { - juce_free (headerNamesAsChars[i]); - juce_free (headerValuesAsChars[i]); + [r setValue: juceStringToNS (headerValue) + forHTTPHeaderField: juceStringToNS (headerName)]; + } } - juce_free (headerNamesAsChars); - juce_free (headerValuesAsChars); + stop(); + [[webView mainFrame] loadRequest: r]; } void goBack() @@ -257386,66 +267961,23 @@ public: [webView stopLoading: nil]; } - void updateBounds() - { - HIRect r; - r.origin.x = (float) owner->getScreenX() - owner->getTopLevelComponent()->getScreenX(); - r.origin.y = (float) owner->getScreenY() - owner->getTopLevelComponent()->getScreenY(); - r.size.width = (float) owner->getWidth(); - r.size.height = (float) owner->getHeight(); - HIViewSetFrame (view, &r); - } - private: - WebBrowserComponent* const owner; - HIViewRef view; WebView* webView; DownloadClickDetector* clickListener; - - void sendWebViewToURL (const char* utf8URL, - const char** headerNames, - const char** headerValues, - int numHeaders, - const char* postData, - int postDataSize) - { - NSMutableURLRequest* r = [NSMutableURLRequest - requestWithURL: [NSURL URLWithString: [NSString stringWithUTF8String: utf8URL]] - cachePolicy: NSURLRequestUseProtocolCachePolicy - timeoutInterval: 30.0]; - - if (postDataSize > 0) - { - [ r setHTTPMethod: @"POST"]; - [ r setHTTPBody: [NSData dataWithBytes: postData length: postDataSize]]; - } - - int i; - for (i = 0; i < numHeaders; ++i) - { - [ r setValue: [NSString stringWithUTF8String: headerValues[i]] - forHTTPHeaderField: [NSString stringWithUTF8String: headerNames[i]]]; - } - - [[webView mainFrame] stopLoading ]; - [[webView mainFrame] loadRequest: r]; - } - - WebBrowserComponentInternal (const WebBrowserComponentInternal&); - const WebBrowserComponentInternal& operator= (const WebBrowserComponentInternal&); }; WebBrowserComponent::WebBrowserComponent() : browser (0), - associatedWindow (0), blankPageShown (false) { setOpaque (true); + + addAndMakeVisible (browser = new WebBrowserComponentInternal (this)); } WebBrowserComponent::~WebBrowserComponent() { - deleteBrowser(); + deleteAndZero (browser); } void WebBrowserComponent::goToURL (const String& url, @@ -257464,95 +267996,52 @@ void WebBrowserComponent::goToURL (const String& url, blankPageShown = false; - if (browser != 0) - browser->goToURL (url, headers, postData); + browser->goToURL (url, headers, postData); } void WebBrowserComponent::stop() { - if (browser != 0) - browser->stop(); + browser->stop(); } void WebBrowserComponent::goBack() { lastURL = String::empty; blankPageShown = false; - - if (browser != 0) - browser->goBack(); + browser->goBack(); } void WebBrowserComponent::goForward() { lastURL = String::empty; - - if (browser != 0) - browser->goForward(); + browser->goForward(); } void WebBrowserComponent::paint (Graphics& g) { - if (browser == 0) - g.fillAll (Colours::white); } void WebBrowserComponent::checkWindowAssociation() { - void* const window = getWindowHandle(); + // when the component becomes invisible, some stuff like flash + // carries on playing audio, so we need to force it onto a blank + // page to avoid this, (and send it back when it's made visible again). - if (window != associatedWindow - || (browser == 0 && window != 0)) + if (isShowing()) { - associatedWindow = window; - - deleteBrowser(); - createBrowser(); + if (blankPageShown) + goBack(); } - - if (browser != 0) + else { - if (associatedWindow != 0 && isShowing()) - { - browser->show(); - - if (blankPageShown) - goBack(); - } - else + if (! blankPageShown) { - if (! blankPageShown) - { - // when the component becomes invisible, some stuff like flash - // carries on playing audio, so we need to force it onto a blank - // page to avoid this.. - - blankPageShown = true; - browser->goToURL ("about:blank", 0, 0); - } - - browser->hide(); + blankPageShown = true; + browser->goToURL ("about:blank", 0, 0); } } } -void WebBrowserComponent::createBrowser() -{ - deleteBrowser(); - - if (isShowing()) - { - WebInitForCarbon(); - browser = new WebBrowserComponentInternal (this); - reloadLastURL(); - } -} - -void WebBrowserComponent::deleteBrowser() -{ - deleteAndZero (browser); -} - void WebBrowserComponent::reloadLastURL() { if (lastURL.isNotEmpty()) @@ -257562,25 +268051,14 @@ void WebBrowserComponent::reloadLastURL() } } -void WebBrowserComponent::updateBrowserPosition() -{ - if (getPeer() != 0 && browser != 0) - browser->updateBounds(); -} - void WebBrowserComponent::parentHierarchyChanged() { checkWindowAssociation(); } -void WebBrowserComponent::moved() -{ - updateBrowserPosition(); -} - void WebBrowserComponent::resized() { - updateBrowserPosition(); + browser->setSize (getWidth(), getHeight()); } void WebBrowserComponent::visibilityChanged() @@ -257593,3452 +268071,2015 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) return true; } -END_JUCE_NAMESPACE +#endif /********* End of inlined file: juce_mac_WebBrowserComponent.mm *********/ -/********* Start of inlined file: juce_mac_Windowing.mm *********/ - -#include -#include -#include -#include -#include -#include +/********* Start of inlined file: juce_mac_CoreAudio.cpp *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -#if JUCE_OPENGL -#include +#ifndef JUCE_COREAUDIO_ERROR_LOGGING_ENABLED + #define JUCE_COREAUDIO_ERROR_LOGGING_ENABLED 1 #endif -BEGIN_JUCE_NAMESPACE - -#undef Point - -const WindowRegionCode windowRegionToUse = kWindowContentRgn; - -static HIObjectClassRef viewClassRef = 0; -static CFStringRef juceHiViewClassNameCFString = 0; -static ComponentPeer* juce_currentMouseTrackingPeer = 0; - -static VoidArray keysCurrentlyDown; - -bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() -{ - if (keysCurrentlyDown.contains ((void*) keyCode)) - return true; - - if (keyCode >= 'A' && keyCode <= 'Z' - && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toLowerCase ((tchar) keyCode))) - return true; - - if (keyCode >= 'a' && keyCode <= 'z' - && keysCurrentlyDown.contains ((void*) (int) CharacterFunctions::toUpperCase ((tchar) keyCode))) - return true; - - return false; -} - -static VoidArray minimisedWindows; - -static void setWindowMinimised (WindowRef ref, const bool isMinimised) -{ - if (isMinimised != minimisedWindows.contains (ref)) - CollapseWindow (ref, isMinimised); -} - -void juce_maximiseAllMinimisedWindows() -{ - const VoidArray minWin (minimisedWindows); - - for (int i = minWin.size(); --i >= 0;) - setWindowMinimised ((WindowRef) (minWin[i]), false); -} - -class HIViewComponentPeer; -static HIViewComponentPeer* currentlyFocusedPeer = 0; - -static int currentModifiers = 0; - -static void updateModifiers (EventRef theEvent) -{ - currentModifiers &= ~ (ModifierKeys::shiftModifier | ModifierKeys::ctrlModifier - | ModifierKeys::altModifier | ModifierKeys::commandModifier); - - UInt32 m; - - if (theEvent != 0) - GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, 0, sizeof(m), 0, &m); - else - m = GetCurrentEventKeyModifiers(); - - if ((m & (shiftKey | rightShiftKey)) != 0) - currentModifiers |= ModifierKeys::shiftModifier; - - if ((m & (controlKey | rightControlKey)) != 0) - currentModifiers |= ModifierKeys::ctrlModifier; - - if ((m & (optionKey | rightOptionKey)) != 0) - currentModifiers |= ModifierKeys::altModifier; - - if ((m & cmdKey) != 0) - currentModifiers |= ModifierKeys::commandModifier; -} - -void ModifierKeys::updateCurrentModifiers() throw() -{ - currentModifierFlags = currentModifiers; -} - -static int64 getEventTime (EventRef event) -{ - const int64 millis = (int64) (1000.0 * (event != 0 ? GetEventTime (event) - : GetCurrentEventTime())); - - static int64 offset = 0; - if (offset == 0) - offset = Time::currentTimeMillis() - millis; - - return offset + millis; -} - -class MacBitmapImage : public Image -{ -public: - - CGColorSpaceRef colourspace; - CGDataProviderRef provider; - - MacBitmapImage (const PixelFormat format_, - const int w, const int h, const bool clearImage) - : Image (format_, w, h) - { - jassert (format_ == RGB || format_ == ARGB); - - pixelStride = (format_ == RGB) ? 3 : 4; - - lineStride = (w * pixelStride + 3) & ~3; - const int imageSize = lineStride * h; - - if (clearImage) - imageData = (uint8*) juce_calloc (imageSize); - else - imageData = (uint8*) juce_malloc (imageSize); - - //colourspace = CGColorSpaceCreateWithName (kCGColorSpaceUserRGB); - - CMProfileRef prof; - CMGetSystemProfile (&prof); - colourspace = CGColorSpaceCreateWithPlatformColorSpace (prof); - provider = CGDataProviderCreateWithData (0, imageData, h * lineStride, 0); - CMCloseProfile (prof); - } - - MacBitmapImage::~MacBitmapImage() - { - CGDataProviderRelease (provider); - CGColorSpaceRelease (colourspace); - - juce_free (imageData); - imageData = 0; // to stop the base class freeing this - } - - void blitToContext (CGContextRef context, const float dx, const float dy) - { - CGImageRef tempImage = CGImageCreate (getWidth(), getHeight(), - 8, pixelStride << 3, lineStride, colourspace, -#if MACOS_10_3_OR_EARLIER || JUCE_BIG_ENDIAN - hasAlphaChannel() ? kCGImageAlphaPremultipliedFirst - : kCGImageAlphaNone, +#undef log +#if JUCE_COREAUDIO_LOGGING_ENABLED + #define log(a) Logger::writeToLog (a) #else - hasAlphaChannel() ? kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst - : kCGImageAlphaNone, -#endif - provider, 0, false, - kCGRenderingIntentDefault); - - HIRect r; - r.origin.x = dx; - r.origin.y = dy; - r.size.width = (float) getWidth(); - r.size.height = (float) getHeight(); - - HIViewDrawCGImage (context, &r, tempImage); - - CGImageRelease (tempImage); - } - - juce_UseDebuggingNewOperator -}; - -class MouseCheckTimer : private Timer, - private DeletedAtShutdown -{ -public: - MouseCheckTimer() - : lastX (0), - lastY (0) - { - lastPeerUnderMouse = 0; - resetMouseMoveChecker(); - -#if ! MACOS_10_2_OR_EARLIER - // Just putting this in here because it's a convenient object that'll get deleted at shutdown - CGDisplayRegisterReconfigurationCallback (&displayChangeCallback, 0); -#endif - } - - ~MouseCheckTimer() - { -#if ! MACOS_10_2_OR_EARLIER - CGDisplayRemoveReconfigurationCallback (&displayChangeCallback, 0); + #define log(a) #endif - clearSingletonInstance(); - } - - juce_DeclareSingleton_SingleThreaded_Minimal (MouseCheckTimer) - - bool hasEverHadAMouseMove; - - void moved (HIViewComponentPeer* const peer) - { - if (hasEverHadAMouseMove) - startTimer (200); - - lastPeerUnderMouse = peer; - } - - void resetMouseMoveChecker() - { - hasEverHadAMouseMove = false; - startTimer (1000 / 16); - } - - void timerCallback(); +#undef OK +#if JUCE_COREAUDIO_ERROR_LOGGING_ENABLED + static bool logAnyErrors_CoreAudio (const OSStatus err, const int lineNum) + { + if (err == noErr) + return true; -private: - HIViewComponentPeer* lastPeerUnderMouse; - int lastX, lastY; + Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + jassertfalse + return false; + } -#if ! MACOS_10_2_OR_EARLIER - static void displayChangeCallback (CGDirectDisplayID, CGDisplayChangeSummaryFlags flags, void*) - { - Desktop::getInstance().refreshMonitorSizes(); - } + #define OK(a) logAnyErrors_CoreAudio (a, __LINE__) +#else + #define OK(a) (a == noErr) #endif -}; -juce_ImplementSingleton_SingleThreaded (MouseCheckTimer) - -#if JUCE_QUICKTIME -extern void OfferMouseClickToQuickTime (WindowRef window, ::Point where, long when, long modifiers, - Component* topLevelComp); -#endif +static const int maxNumChans = 96; -class HIViewComponentPeer : public ComponentPeer, - private Timer +class CoreAudioInternal : public Timer { public: - HIViewComponentPeer (Component* const component, - const int windowStyleFlags, - HIViewRef viewToAttachTo) - : ComponentPeer (component, windowStyleFlags), - fullScreen (false), - isCompositingWindow (false), - windowRef (0), - viewRef (0) + CoreAudioInternal (AudioDeviceID id) + : deviceID (id), + started (false), + audioBuffer (0), + numInputChans (0), + numOutputChans (0), + callbacksAllowed (true), + numInputChannelInfos (0), + numOutputChannelInfos (0), + inputLatency (0), + outputLatency (0), + callback (0), +#if ! MACOS_10_4_OR_EARLIER + audioProcID (0), +#endif + inputDevice (0), + isSlaveDevice (false) { - repainter = new RepaintManager (this); - - eventHandlerRef = 0; + sampleRate = 0; + bufferSize = 512; - if (viewToAttachTo != 0) + if (deviceID == 0) { - isSharedWindow = true; + error = TRANS("can't open device"); } else { - isSharedWindow = false; - - WindowRef newWindow = createNewWindow (windowStyleFlags); - - GetRootControl (newWindow, (ControlRef*) &viewToAttachTo); - jassert (viewToAttachTo != 0); - - HIViewRef growBox = 0; - HIViewFindByID (HIViewGetRoot (newWindow), kHIViewWindowGrowBoxID, &growBox); - - if (growBox != 0) - HIGrowBoxViewSetTransparent (growBox, true); - } - - createNewHIView(); - - HIViewAddSubview (viewToAttachTo, viewRef); - HIViewSetVisible (viewRef, component->isVisible()); - - setTitle (component->getName()); - - if (component->isVisible() && ! isSharedWindow) - { - ShowWindow (windowRef); - ActivateWindow (windowRef, component->getWantsKeyboardFocus()); - } - } - - ~HIViewComponentPeer() - { - minimisedWindows.removeValue (windowRef); - - if (IsValidWindowPtr (windowRef)) - { - if (! isSharedWindow) - { - CFRelease (viewRef); - viewRef = 0; - - DisposeWindow (windowRef); - } - else - { - if (eventHandlerRef != 0) - RemoveEventHandler (eventHandlerRef); - - CFRelease (viewRef); - viewRef = 0; - } - - windowRef = 0; - } - - if (currentlyFocusedPeer == this) - currentlyFocusedPeer = 0; - - delete repainter; - } - - void* getNativeHandle() const - { - return windowRef; - } - - void setVisible (bool shouldBeVisible) - { - HIViewSetVisible (viewRef, shouldBeVisible); - - if ((! isSharedWindow) && IsValidWindowPtr (windowRef)) - { - if (shouldBeVisible) - ShowWindow (windowRef); - else - HideWindow (windowRef); - - resizeViewToFitWindow(); - - // If nothing else is focused, then grab the focus too - if (shouldBeVisible - && Component::getCurrentlyFocusedComponent() == 0 - && Process::isForegroundProcess()) - { - component->toFront (true); - } - } - } - - void setTitle (const String& title) - { - if ((! isSharedWindow) && IsValidWindowPtr (windowRef)) - { - CFStringRef t = PlatformUtilities::juceStringToCFString (title); - SetWindowTitleWithCFString (windowRef, t); - CFRelease (t); - } - } - - void setPosition (int x, int y) - { - if (isSharedWindow) - { - HIViewPlaceInSuperviewAt (viewRef, x, y); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - r.right += x - r.left; - r.bottom += y - r.top; - r.left = x; - r.top = y; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void setSize (int w, int h) - { - w = jmax (0, w); - h = jmax (0, h); - - if (w != getComponent()->getWidth() - || h != getComponent()->getHeight()) - { - repainter->repaint (0, 0, w, h); - } - - if (isSharedWindow) - { - HIRect r; - HIViewGetFrame (viewRef, &r); - r.size.width = (float) w; - r.size.height = (float) h; - HIViewSetFrame (viewRef, &r); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - r.right = r.left + w; - r.bottom = r.top + h; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void setBounds (int x, int y, int w, int h, const bool isNowFullScreen) - { - fullScreen = isNowFullScreen; - w = jmax (0, w); - h = jmax (0, h); - - if (w != getComponent()->getWidth() - || h != getComponent()->getHeight()) - { - repainter->repaint (0, 0, w, h); - } - - if (isSharedWindow) - { - HIRect r; - r.origin.x = (float) x; - r.origin.y = (float) y; - r.size.width = (float) w; - r.size.height = (float) h; - HIViewSetFrame (viewRef, &r); - } - else if (IsValidWindowPtr (windowRef)) - { - Rect r; - r.left = x; - r.top = y; - r.right = x + w; - r.bottom = y + h; - SetWindowBounds (windowRef, windowRegionToUse, &r); - } - } - - void getBounds (int& x, int& y, int& w, int& h, const bool global) const - { - HIRect hiViewPos; - HIViewGetFrame (viewRef, &hiViewPos); - - if (global) - { - HIViewRef content = 0; - HIViewFindByID (HIViewGetRoot (windowRef), kHIViewWindowContentID, &content); - HIPoint p = { 0.0f, 0.0f }; - HIViewConvertPoint (&p, viewRef, content); - - x = (int) p.x; - y = (int) p.y; - - if (IsValidWindowPtr (windowRef)) - { - Rect windowPos; - GetWindowBounds (windowRef, kWindowContentRgn, &windowPos); + updateDetailsFromDevice(); - x += windowPos.left; - y += windowPos.top; - } - } - else - { - x = (int) hiViewPos.origin.x; - y = (int) hiViewPos.origin.y; + AudioDeviceAddPropertyListener (deviceID, + kAudioPropertyWildcardChannel, + kAudioPropertyWildcardSection, + kAudioPropertyWildcardPropertyID, + deviceListenerProc, this); } - - w = (int) hiViewPos.size.width; - h = (int) hiViewPos.size.height; } - void getBounds (int& x, int& y, int& w, int& h) const + ~CoreAudioInternal() { - getBounds (x, y, w, h, ! isSharedWindow); - } + AudioDeviceRemovePropertyListener (deviceID, + kAudioPropertyWildcardChannel, + kAudioPropertyWildcardSection, + kAudioPropertyWildcardPropertyID, + deviceListenerProc); - int getScreenX() const - { - int x, y, w, h; - getBounds (x, y, w, h, true); - return x; - } + stop (false); - int getScreenY() const - { - int x, y, w, h; - getBounds (x, y, w, h, true); - return y; + juce_free (audioBuffer); + delete inputDevice; } - void relativePositionToGlobal (int& x, int& y) + void setTempBufferSize (const int numChannels, const int numSamples) { - int wx, wy, ww, wh; - getBounds (wx, wy, ww, wh, true); + juce_free (audioBuffer); - x += wx; - y += wy; - } + audioBuffer = (float*) juce_calloc (32 + numChannels * numSamples * sizeof (float)); - void globalPositionToRelative (int& x, int& y) - { - int wx, wy, ww, wh; - getBounds (wx, wy, ww, wh, true); + zeromem (tempInputBuffers, sizeof (tempInputBuffers)); + zeromem (tempOutputBuffers, sizeof (tempOutputBuffers)); - x -= wx; - y -= wy; - } + int count = 0; + int i; + for (i = 0; i < numInputChans; ++i) + tempInputBuffers[i] = audioBuffer + count++ * numSamples; - void setMinimised (bool shouldBeMinimised) - { - if (! isSharedWindow) - setWindowMinimised (windowRef, shouldBeMinimised); + for (i = 0; i < numOutputChans; ++i) + tempOutputBuffers[i] = audioBuffer + count++ * numSamples; } - bool isMinimised() const + // returns the number of actual available channels + void fillInChannelInfo (bool input) { - return minimisedWindows.contains (windowRef); - } + int chanNum = 0, activeChans = 0; + UInt32 size; - void setFullScreen (bool shouldBeFullScreen) - { - if (! isSharedWindow) + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) { - Rectangle r (lastNonFullscreenBounds); - - setMinimised (false); + AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); - if (fullScreen != shouldBeFullScreen) + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) { - if (shouldBeFullScreen) - r = Desktop::getInstance().getMainMonitorArea(); - - // (can't call the component's setBounds method because that'll reset our fullscreen flag) - if (r != getComponent()->getBounds() && ! r.isEmpty()) - setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen); - } - } - } - - bool isFullScreen() const - { - return fullScreen; - } - - bool contains (int x, int y, bool trueIfInAChildWindow) const - { - if (((unsigned int) x) >= (unsigned int) component->getWidth() - || ((unsigned int) y) >= (unsigned int) component->getHeight() - || ! IsValidWindowPtr (windowRef)) - return false; - - Rect r; - GetWindowBounds (windowRef, windowRegionToUse, &r); - - ::Point p; - p.h = r.left + x; - p.v = r.top + y; - - WindowRef ref2 = 0; - FindWindow (p, &ref2); - - if (windowRef != ref2) - return false; - - if (trueIfInAChildWindow) - return true; - - HIPoint p2; - p2.x = (float) x; - p2.y = (float) y; - HIViewRef hit; - - HIViewGetSubviewHit (viewRef, &p2, true, &hit); - return hit == 0 || hit == viewRef; - } + const int numStreams = bufList->mNumberBuffers; - const BorderSize getFrameSize() const - { - return BorderSize(); - } + for (int i = 0; i < numStreams; ++i) + { + const AudioBuffer& b = bufList->mBuffers[i]; - bool setAlwaysOnTop (bool alwaysOnTop) - { - // can't do this so return false and let the component create a new window - return false; - } + for (unsigned int j = 0; j < b.mNumberChannels; ++j) + { + if (input) + { + if (activeInputChans[chanNum]) + { + inputChannelInfo [activeChans].sourceChannelNum = chanNum; + inputChannelInfo [activeChans].streamNum = i; + inputChannelInfo [activeChans].dataOffsetSamples = j; + inputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; + ++activeChans; + numInputChannelInfos = activeChans; + } - void toFront (bool makeActiveWindow) - { - makeActiveWindow = makeActiveWindow - && component->isValidComponent() - && (component->getWantsKeyboardFocus() - || component->isCurrentlyModal()); + inChanNames.add (T("input ") + String (chanNum + 1)); + } + else + { + if (activeOutputChans[chanNum]) + { + outputChannelInfo [activeChans].sourceChannelNum = chanNum; + outputChannelInfo [activeChans].streamNum = i; + outputChannelInfo [activeChans].dataOffsetSamples = j; + outputChannelInfo [activeChans].dataStrideSamples = b.mNumberChannels; + ++activeChans; + numOutputChannelInfos = activeChans; + } - if (windowRef != FrontWindow() - || (makeActiveWindow && ! IsWindowActive (windowRef)) - || ! Process::isForegroundProcess()) - { - if (! Process::isForegroundProcess()) - { - ProcessSerialNumber psn; - GetCurrentProcess (&psn); - SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly); - } + outChanNames.add (T("output ") + String (chanNum + 1)); + } - if (IsValidWindowPtr (windowRef)) - { - if (makeActiveWindow) - { - SelectWindow (windowRef); - SetUserFocusWindow (windowRef); - HIViewAdvanceFocus (viewRef, 0); - } - else - { - BringToFront (windowRef); + ++chanNum; + } } - - handleBroughtToFront(); } - } - } - - void toBehind (ComponentPeer* other) - { - HIViewComponentPeer* const otherWindow = dynamic_cast (other); - if (other != 0 && windowRef != 0 && otherWindow->windowRef != 0) - { - if (windowRef == otherWindow->windowRef) - { - HIViewSetZOrder (viewRef, kHIViewZOrderBelow, otherWindow->viewRef); - } - else - { - SendBehind (windowRef, otherWindow->windowRef); - } + juce_free (bufList); } } - void setIcon (const Image& /*newIcon*/) - { - // to do.. - } - - void viewFocusGain() + void updateDetailsFromDevice() { - const MessageManagerLock messLock; - - if (currentlyFocusedPeer != this) - { - if (ComponentPeer::isValidPeer (currentlyFocusedPeer)) - currentlyFocusedPeer->handleFocusLoss(); - - currentlyFocusedPeer = this; - - handleFocusGain(); - } - } + stopTimer(); - void viewFocusLoss() - { - if (currentlyFocusedPeer == this) - { - currentlyFocusedPeer = 0; - handleFocusLoss(); - } - } + if (deviceID == 0) + return; - bool isFocused() const - { - return windowRef == GetUserFocusWindow() - && HIViewSubtreeContainsFocus (viewRef); - } + const ScopedLock sl (callbackLock); - void grabFocus() - { - if ((! isFocused()) && IsValidWindowPtr (windowRef)) - { - SetUserFocusWindow (windowRef); - HIViewAdvanceFocus (viewRef, 0); - } - } + Float64 sr; + UInt32 size = sizeof (Float64); + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyNominalSampleRate, &size, &sr))) + sampleRate = sr; - void textInputRequired (int /*x*/, int /*y*/) - { - } + UInt32 framesPerBuf; + size = sizeof (framesPerBuf); - void repaint (int x, int y, int w, int h) - { - if (Rectangle::intersectRectangles (x, y, w, h, - 0, 0, - getComponent()->getWidth(), - getComponent()->getHeight())) + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSize, &size, &framesPerBuf))) { - if ((getStyleFlags() & windowRepaintedExplictly) == 0) - { - if (isCompositingWindow) - { -#if MACOS_10_3_OR_EARLIER - RgnHandle rgn = NewRgn(); - SetRectRgn (rgn, x, y, x + w, y + h); - HIViewSetNeedsDisplayInRegion (viewRef, rgn, true); - DisposeRgn (rgn); -#else - HIRect r; - r.origin.x = x; - r.origin.y = y; - r.size.width = w; - r.size.height = h; - - HIViewSetNeedsDisplayInRect (viewRef, &r, true); -#endif - } - else - { - if (! isTimerRunning()) - startTimer (20); - } - } + bufferSize = framesPerBuf; - repainter->repaint (x, y, w, h); + if (bufferSize > 0) + setTempBufferSize (numInputChans + numOutputChans, bufferSize); } - } - - void timerCallback() - { - performAnyPendingRepaintsNow(); - } - void performAnyPendingRepaintsNow() - { - stopTimer(); + bufferSizes.clear(); - if (component->isVisible()) + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, 0))) { -#if MACOS_10_2_OR_EARLIER - if (! isCompositingWindow) - { - Rect w; - GetWindowBounds (windowRef, windowRegionToUse, &w); - - const int offsetInWindowX = component->getScreenX() - getScreenX(); - const int offsetInWindowY = component->getScreenY() - getScreenY(); + AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); - for (RectangleList::Iterator i (repainter->getRegionsNeedingRepaint()); i.next();) - { - const Rectangle& r = *i.getRectangle(); - w.left = offsetInWindowX + r.getX(); - w.top = offsetInWindowY + r.getY(); - w.right = offsetInWindowX + r.getRight(); - w.bottom = offsetInWindowY + r.getBottom(); - InvalWindowRect (windowRef, &w); - } - } - else + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyBufferFrameSizeRange, &size, ranges))) { - EventRef theEvent; - - EventTypeSpec eventTypes[1]; - eventTypes[0].eventClass = kEventClassControl; - eventTypes[0].eventKind = kEventControlDraw; + bufferSizes.add ((int) ranges[0].mMinimum); - int n = 3; - while (--n >= 0 - && ReceiveNextEvent (1, eventTypes, kEventDurationNoWait, true, &theEvent) == noErr) + for (int i = 32; i < 8192; i += 32) { - if (GetEventClass (theEvent) == kEventClassAppleEvent) - { - EventRecord eventRec; - if (ConvertEventRefToEventRecord (theEvent, &eventRec)) - AEProcessAppleEvent (&eventRec); - } - else + for (int j = size / sizeof (AudioValueRange); --j >= 0;) { - EventTargetRef theTarget = GetEventDispatcherTarget(); - SendEventToEventTarget (theEvent, theTarget); + if (i >= ranges[j].mMinimum && i <= ranges[j].mMaximum) + { + bufferSizes.addIfNotAlreadyThere (i); + break; + } } - - ReleaseEvent (theEvent); } - } -#else - if (HIViewGetNeedsDisplay (viewRef) || repainter->isRepaintNeeded()) - HIViewRender (viewRef); -#endif - } - } - juce_UseDebuggingNewOperator - - WindowRef windowRef; - HIViewRef viewRef; - -private: - EventHandlerRef eventHandlerRef; - bool fullScreen, isSharedWindow, isCompositingWindow; - StringArray dragAndDropFiles; - - class RepaintManager : public Timer - { -public: - RepaintManager (HIViewComponentPeer* const peer_) - : peer (peer_), - image (0) - { - } - - ~RepaintManager() - { - delete image; - } + if (bufferSize > 0) + bufferSizes.addIfNotAlreadyThere (bufferSize); + } - void timerCallback() - { - stopTimer(); - deleteAndZero (image); + juce_free (ranges); } - void repaint (int x, int y, int w, int h) - { - regionsNeedingRepaint.add (x, y, w, h); - } + if (bufferSizes.size() == 0 && bufferSize > 0) + bufferSizes.add (bufferSize); - bool isRepaintNeeded() const throw() - { - return ! regionsNeedingRepaint.isEmpty(); - } + sampleRates.clear(); + const double possibleRates[] = { 44100.0, 48000.0, 88200.0, 96000.0, 176400.0, 192000.0 }; + String rates; - void repaintAnyRemainingRegions() + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, 0))) { - // if any regions have been invaldated during the paint callback, - // we need to repaint them explicitly because the mac throws this - // stuff away - for (RectangleList::Iterator i (regionsNeedingRepaint); i.next();) - { - const Rectangle& r = *i.getRectangle(); - peer->repaint (r.getX(), r.getY(), r.getWidth(), r.getHeight()); - } - } + AudioValueRange* ranges = (AudioValueRange*) juce_calloc (size); - void paint (CGContextRef cgContext, int x, int y, int w, int h) - { - if (w > 0 && h > 0) + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, &size, ranges))) { - bool refresh = false; - int imW = image != 0 ? image->getWidth() : 0; - int imH = image != 0 ? image->getHeight() : 0; - - if (imW < w || imH < h) - { - imW = jmin (peer->getComponent()->getWidth(), (w + 31) & ~31); - imH = jmin (peer->getComponent()->getHeight(), (h + 31) & ~31); - - delete image; - image = new MacBitmapImage (peer->getComponent()->isOpaque() ? Image::RGB - : Image::ARGB, - imW, imH, false); - - refresh = true; - } - else if (imageX > x || imageY > y - || imageX + imW < x + w - || imageY + imH < y + h) - { - refresh = true; - } - - if (refresh) - { - regionsNeedingRepaint.clear(); - regionsNeedingRepaint.addWithoutMerging (Rectangle (x, y, imW, imH)); - imageX = x; - imageY = y; - } - - LowLevelGraphicsSoftwareRenderer context (*image); - context.setOrigin (-imageX, -imageY); - - if (context.reduceClipRegion (regionsNeedingRepaint)) - { - regionsNeedingRepaint.clear(); - - if (! peer->getComponent()->isOpaque()) - { - for (RectangleList::Iterator i (*context.getRawClipRegion()); i.next();) - { - const Rectangle& r = *i.getRectangle(); - image->clear (r.getX(), r.getY(), r.getWidth(), r.getHeight()); - } - } - - regionsNeedingRepaint.clear(); - peer->clearMaskedRegion(); - peer->handlePaint (context); - } - else - { - regionsNeedingRepaint.clear(); - } - - if (! peer->maskedRegion.isEmpty()) + for (int i = 0; i < numElementsInArray (possibleRates); ++i) { - RectangleList total (Rectangle (x, y, w, h)); - total.subtract (peer->maskedRegion); + bool ok = false; - CGRect* rects = (CGRect*) juce_malloc (sizeof (CGRect) * total.getNumRectangles()); - int n = 0; + for (int j = size / sizeof (AudioValueRange); --j >= 0;) + if (possibleRates[i] >= ranges[j].mMinimum - 2 && possibleRates[i] <= ranges[j].mMaximum + 2) + ok = true; - for (RectangleList::Iterator i (total); i.next();) + if (ok) { - const Rectangle& r = *i.getRectangle(); - rects[n].origin.x = (int) r.getX(); - rects[n].origin.y = (int) r.getY(); - rects[n].size.width = roundFloatToInt (r.getWidth()); - rects[n++].size.height = roundFloatToInt (r.getHeight()); + sampleRates.add (possibleRates[i]); + rates << possibleRates[i] << T(" "); } - - CGContextClipToRects (cgContext, rects, n); - juce_free (rects); } - - if (peer->isSharedWindow) - { - CGRect clip; - clip.origin.x = x; - clip.origin.y = y; - clip.size.width = jmin (w, peer->getComponent()->getWidth() - x); - clip.size.height = jmin (h, peer->getComponent()->getHeight() - y); - - CGContextClipToRect (cgContext, clip); - } - - image->blitToContext (cgContext, imageX, imageY); } - startTimer (3000); + juce_free (ranges); } - private: - HIViewComponentPeer* const peer; - MacBitmapImage* image; - int imageX, imageY; - RectangleList regionsNeedingRepaint; - - RepaintManager (const RepaintManager&); - const RepaintManager& operator= (const RepaintManager&); - }; - - RepaintManager* repainter; - - friend class RepaintManager; - - static OSStatus handleFrameRepaintEvent (EventHandlerCallRef myHandler, - EventRef theEvent, - void* userData) - { - // don't draw the frame.. - return noErr; - } - - OSStatus handleKeyEvent (EventRef theEvent, juce_wchar textCharacter) - { - updateModifiers (theEvent); - - UniChar unicodeChars [4]; - zeromem (unicodeChars, sizeof (unicodeChars)); - GetEventParameter (theEvent, kEventParamKeyUnicodes, typeUnicodeText, 0, sizeof (unicodeChars), 0, unicodeChars); - - int keyCode = (int) (unsigned int) unicodeChars[0]; - - UInt32 rawKey = 0; - GetEventParameter (theEvent, kEventParamKeyCode, typeUInt32, 0, sizeof (UInt32), 0, &rawKey); - - if ((currentModifiers & ModifierKeys::ctrlModifier) != 0 - && keyCode >= 1 && keyCode <= 26) - { - keyCode += ('A' - 1); - } - else + if (sampleRates.size() == 0 && sampleRate > 0) { - static const int keyTranslations[] = - { - 0, 's', 'd', 'f', 'h', 'g', 'z', 'x', 'c', 'v', 0xa7, 'b', - 'q', 'w', 'e', 'r', 'y', 't', '1', '2', '3', '4', '6', '5', - '=', '9', '7', '-', '8', '0', ']', 'o', 'u', '[', 'i', 'p', - KeyPress::returnKey, 'l', 'j', '\'', 'k', ';', '\\', ',', '/', - 'n', 'm', '.', 0, KeyPress::spaceKey, '`', KeyPress::backspaceKey, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, KeyPress::numberPadDecimalPoint, - 0, KeyPress::numberPadMultiply, 0, KeyPress::numberPadAdd, - 0, KeyPress::numberPadDelete, 0, 0, 0, KeyPress::numberPadDivide, KeyPress::returnKey, - 0, KeyPress::numberPadSubtract, 0, 0, KeyPress::numberPadEquals, KeyPress::numberPad0, - KeyPress::numberPad1, KeyPress::numberPad2, KeyPress::numberPad3, - KeyPress::numberPad4, KeyPress::numberPad5, KeyPress::numberPad6, - KeyPress::numberPad7, 0, KeyPress::numberPad8, KeyPress::numberPad9, - 0, 0, 0, KeyPress::F5Key, KeyPress::F6Key, KeyPress::F7Key, KeyPress::F3Key, - KeyPress::F8Key, KeyPress::F9Key, 0, KeyPress::F11Key, 0, KeyPress::F13Key, - KeyPress::F16Key, KeyPress::F14Key, 0, KeyPress::F10Key, 0, KeyPress::F12Key, - 0, KeyPress::F15Key, 0, KeyPress::homeKey, KeyPress::pageUpKey, 0, KeyPress::F4Key, - KeyPress::endKey, KeyPress::F2Key, KeyPress::pageDownKey, KeyPress::F1Key, - KeyPress::leftKey, KeyPress::rightKey, KeyPress::downKey, KeyPress::upKey, 0 - }; - - if (((unsigned int) rawKey) < (unsigned int) numElementsInArray (keyTranslations) - && keyTranslations [rawKey] != 0) - { - keyCode = keyTranslations [rawKey]; - } - - if ((rawKey == 0 && textCharacter != 0) - || (CharacterFunctions::isLetterOrDigit ((juce_wchar) keyCode) - && CharacterFunctions::isLetterOrDigit (textCharacter))) // correction for azerty-type layouts.. - { - keyCode = CharacterFunctions::toLowerCase (textCharacter); - } + sampleRates.add (sampleRate); + rates << sampleRate; } - if ((currentModifiers & (ModifierKeys::commandModifier | ModifierKeys::ctrlModifier)) != 0) - textCharacter = 0; - - static juce_wchar lastTextCharacter = 0; - - switch (GetEventKind (theEvent)) - { - case kEventRawKeyDown: - { - keysCurrentlyDown.addIfNotAlreadyThere ((void*) keyCode); - lastTextCharacter = textCharacter; - - const bool used1 = handleKeyUpOrDown(); - const bool used2 = handleKeyPress (keyCode, textCharacter); - - if (used1 || used2) - return noErr; - - break; - } - - case kEventRawKeyUp: - keysCurrentlyDown.removeValue ((void*) keyCode); - lastTextCharacter = 0; - if (handleKeyUpOrDown()) - return noErr; - - break; - - case kEventRawKeyRepeat: - if (handleKeyPress (keyCode, lastTextCharacter)) - return noErr; - - break; - - case kEventRawKeyModifiersChanged: - handleModifierKeysChange(); - break; - - default: - jassertfalse - break; - } + log (T("sr: ") + rates); - return eventNotHandledErr; - } + inputLatency = 0; + outputLatency = 0; + UInt32 lat; + size = sizeof (UInt32); + if (AudioDeviceGetProperty (deviceID, 0, true, kAudioDevicePropertyLatency, &size, &lat) == noErr) + inputLatency = (int) lat; - OSStatus handleTextInputEvent (EventRef theEvent) - { - UInt32 numBytesRequired = 0; - GetEventParameter (theEvent, kEventParamTextInputSendText, typeUnicodeText, 0, 0, &numBytesRequired, 0); + if (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyLatency, &size, &lat) == noErr) + outputLatency = (int) lat; - MemoryBlock buffer (numBytesRequired, true); - UniChar* const uc = (UniChar*) buffer.getData(); - GetEventParameter (theEvent, kEventParamTextInputSendText, typeUnicodeText, 0, numBytesRequired, &numBytesRequired, uc); + log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); - EventRef originalEvent; - GetEventParameter (theEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, 0, sizeof (originalEvent), 0, &originalEvent); + inChanNames.clear(); + outChanNames.clear(); - OSStatus res = noErr; - for (int i = 0; i < numBytesRequired / sizeof (UniChar); ++i) - res = handleKeyEvent (originalEvent, (juce_wchar) uc[i]); + zeromem (inputChannelInfo, sizeof (inputChannelInfo)); + zeromem (outputChannelInfo, sizeof (outputChannelInfo)); - return res; + fillInChannelInfo (true); + fillInChannelInfo (false); } - OSStatus handleMouseEvent (EventHandlerCallRef callRef, EventRef theEvent) + const StringArray getSources (bool input) { - MouseCheckTimer::getInstance()->moved (this); - - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof (::Point), 0, &where); - int x = where.h; - int y = where.v; - globalPositionToRelative (x, y); - - int64 time = getEventTime (theEvent); + StringArray s; + int num = 0; + OSType* types = getAllDataSourcesForDevice (deviceID, input, num); - switch (GetEventKind (theEvent)) + if (types != 0) { - case kEventMouseMoved: - MouseCheckTimer::getInstance()->hasEverHadAMouseMove = true; - updateModifiers (theEvent); - handleMouseMove (x, y, time); - break; - - case kEventMouseDragged: - updateModifiers (theEvent); - handleMouseDrag (x, y, time); - break; - - case kEventMouseDown: - { - if (! Process::isForegroundProcess()) - { - ProcessSerialNumber psn; - GetCurrentProcess (&psn); - SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly); - - toFront (true); - } - -#if JUCE_QUICKTIME - { - long mods; - GetEventParameter (theEvent, kEventParamKeyModifiers, typeUInt32, 0, sizeof (mods), 0, &mods); - - ::Point where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeQDPoint, 0, sizeof (::Point), 0, &where); - - OfferMouseClickToQuickTime (windowRef, where, EventTimeToTicks (GetEventTime (theEvent)), mods, component); - } -#endif - - if (component->isBroughtToFrontOnMouseClick() - && ! component->isCurrentlyBlockedByAnotherModalComponent()) - { - //ActivateWindow (windowRef, true); - SelectWindow (windowRef); - } - - EventMouseButton button; - GetEventParameter (theEvent, kEventParamMouseButton, typeMouseButton, 0, sizeof (EventMouseButton), 0, &button); - - // need to clear all these flags because sometimes the mac can swallow (right) mouse-up events and - // this makes a button get stuck down. Since there's no other way to tell what buttons are down, - // this is all I can think of doing about it.. - currentModifiers &= ~(ModifierKeys::leftButtonModifier | ModifierKeys::rightButtonModifier | ModifierKeys::middleButtonModifier); - - if (button == kEventMouseButtonPrimary) - currentModifiers |= ModifierKeys::leftButtonModifier; - else if (button == kEventMouseButtonSecondary) - currentModifiers |= ModifierKeys::rightButtonModifier; - else if (button == kEventMouseButtonTertiary) - currentModifiers |= ModifierKeys::middleButtonModifier; - - updateModifiers (theEvent); - - juce_currentMouseTrackingPeer = this; // puts the message dispatcher into mouse-tracking mode.. - handleMouseDown (x, y, time); - break; - } - - case kEventMouseUp: - { - const int oldModifiers = currentModifiers; - - EventMouseButton button; - GetEventParameter (theEvent, kEventParamMouseButton, typeMouseButton, 0, sizeof (EventMouseButton), 0, &button); - - if (button == kEventMouseButtonPrimary) - currentModifiers &= ~ModifierKeys::leftButtonModifier; - else if (button == kEventMouseButtonSecondary) - currentModifiers &= ~ModifierKeys::rightButtonModifier; - - updateModifiers (theEvent); - - juce_currentMouseTrackingPeer = 0; - handleMouseUp (oldModifiers, x, y, time); - break; - } - - case kEventMouseWheelMoved: + for (int i = 0; i < num; ++i) { - EventMouseWheelAxis axis; - GetEventParameter (theEvent, kEventParamMouseWheelAxis, typeMouseWheelAxis, 0, sizeof (axis), 0, &axis); - - SInt32 delta; - GetEventParameter (theEvent, kEventParamMouseWheelDelta, - typeLongInteger, 0, sizeof (delta), 0, &delta); - - updateModifiers (theEvent); - - handleMouseWheel (axis == kEventMouseWheelAxisX ? delta * 10 : 0, - axis == kEventMouseWheelAxisX ? 0 : delta * 10, - time); - - break; - } - } - - return noErr; - } - - void doDragDropEnter (EventRef theEvent) - { - updateDragAndDropFileList (theEvent); - - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragMove (dragAndDropFiles, x, y); - } - } - - void doDragDropMove (EventRef theEvent) - { - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragMove (dragAndDropFiles, x, y); - } - } + AudioValueTranslation avt; + char buffer[256]; - void doDragDropExit (EventRef theEvent) - { - if (dragAndDropFiles.size() > 0) - handleFileDragExit (dragAndDropFiles); - } + avt.mInputData = (void*) &(types[i]); + avt.mInputDataSize = sizeof (UInt32); + avt.mOutputData = buffer; + avt.mOutputDataSize = 256; - void doDragDrop (EventRef theEvent) - { - updateDragAndDropFileList (theEvent); + UInt32 transSize = sizeof (avt); + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSourceNameForID, &transSize, &avt))) + { + DBG (buffer); + s.add (buffer); + } + } - if (dragAndDropFiles.size() > 0) - { - int x, y; - component->getMouseXYRelative (x, y); - handleFileDragDrop (dragAndDropFiles, x, y); + juce_free (types); } + + return s; } - void updateDragAndDropFileList (EventRef theEvent) + int getCurrentSourceIndex (bool input) const { - dragAndDropFiles.clear(); + OSType currentSourceID = 0; + UInt32 size = 0; + int result = -1; - DragRef dragRef; - if (GetEventParameter (theEvent, kEventParamDragRef, typeDragRef, 0, sizeof (dragRef), 0, &dragRef) == noErr) + if (deviceID != 0 + && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, 0))) { - UInt16 numItems = 0; - if (CountDragItems (dragRef, &numItems) == noErr) + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSource, &size, ¤tSourceID))) { - for (int i = 0; i < (int) numItems; ++i) - { - DragItemRef ref; + int num = 0; + OSType* const types = getAllDataSourcesForDevice (deviceID, input, num); - if (GetDragItemReferenceNumber (dragRef, i + 1, &ref) == noErr) + if (types != 0) + { + for (int i = 0; i < num; ++i) { - const FlavorType flavorType = kDragFlavorTypeHFS; - - Size size = 0; - if (GetFlavorDataSize (dragRef, ref, flavorType, &size) == noErr) + if (types[num] == currentSourceID) { - void* data = juce_calloc (size); - - if (GetFlavorData (dragRef, ref, flavorType, data, &size, 0) == noErr) - { - HFSFlavor* f = (HFSFlavor*) data; - FSRef fsref; - - if (FSpMakeFSRef (&f->fileSpec, &fsref) == noErr) - { - const String path (PlatformUtilities::makePathFromFSRef (&fsref)); - - if (path.isNotEmpty()) - dragAndDropFiles.add (path); - } - } - - juce_free (data); + result = i; + break; } } - } - dragAndDropFiles.trim(); - dragAndDropFiles.removeEmptyStrings(); + juce_free (types); + } } } + + return result; } - void resizeViewToFitWindow() + void setCurrentSourceIndex (int index, bool input) { - HIRect r; - - if (isSharedWindow) - { - HIViewGetFrame (viewRef, &r); - r.size.width = (float) component->getWidth(); - r.size.height = (float) component->getHeight(); - } - else + if (deviceID != 0) { - r.origin.x = 0; - r.origin.y = 0; + int num = 0; + OSType* types = getAllDataSourcesForDevice (deviceID, input, num); - Rect w; - GetWindowBounds (windowRef, windowRegionToUse, &w); + if (types != 0) + { + if (((unsigned int) index) < num) + { + OSType typeId = types[index]; + AudioDeviceSetProperty (deviceID, 0, 0, input, kAudioDevicePropertyDataSource, sizeof (typeId), &typeId); + } - r.size.width = (float) (w.right - w.left); - r.size.height = (float) (w.bottom - w.top); + juce_free (types); + } } - - HIViewSetFrame (viewRef, &r); - -#if MACOS_10_3_OR_EARLIER - component->repaint(); -#endif } - OSStatus hiViewDraw (EventRef theEvent) + const String reopen (const BitArray& inputChannels, + const BitArray& outputChannels, + double newSampleRate, + int bufferSizeSamples) { - CGContextRef context = 0; - GetEventParameter (theEvent, kEventParamCGContextRef, typeCGContextRef, 0, sizeof (CGContextRef), 0, &context); + error = String::empty; + log ("CoreAudio reopen"); + callbacksAllowed = false; + stopTimer(); - CGrafPtr oldPort; - CGrafPtr port = 0; + stop (false); - if (context == 0) - { - GetEventParameter (theEvent, kEventParamGrafPort, typeGrafPtr, 0, sizeof (CGrafPtr), 0, &port); + activeInputChans = inputChannels; + activeOutputChans = outputChannels; - GetPort (&oldPort); - SetPort (port); + activeInputChans.setRange (inChanNames.size(), + activeInputChans.getHighestBit() + 1 - inChanNames.size(), + false); - if (port != 0) - QDBeginCGContext (port, &context); + activeOutputChans.setRange (outChanNames.size(), + activeOutputChans.getHighestBit() + 1 - outChanNames.size(), + false); - if (! isCompositingWindow) - { - Rect bounds; - GetWindowBounds (windowRef, windowRegionToUse, &bounds); - CGContextTranslateCTM (context, 0, bounds.bottom - bounds.top); - CGContextScaleCTM (context, 1.0, -1.0); - } + numInputChans = activeInputChans.countNumberOfSetBits(); + numOutputChans = activeOutputChans.countNumberOfSetBits(); - if (isSharedWindow) - { - // NB - Had terrible problems trying to correctly get the position - // of this view relative to the window, and this seems wrong, but - // works better than any other method I've tried.. - HIRect hiViewPos; - HIViewGetFrame (viewRef, &hiViewPos); - CGContextTranslateCTM (context, hiViewPos.origin.x, hiViewPos.origin.y); - } - } + // set sample rate + Float64 sr = newSampleRate; + UInt32 size = sizeof (sr); + OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyNominalSampleRate, size, &sr)); + OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyNominalSampleRate, size, &sr)); -#if MACOS_10_2_OR_EARLIER - RgnHandle rgn = 0; - GetEventParameter (theEvent, kEventParamRgnHandle, typeQDRgnHandle, 0, sizeof (RgnHandle), 0, &rgn); + // change buffer size + UInt32 framesPerBuf = bufferSizeSamples; + size = sizeof (framesPerBuf); - CGRect clip; + OK (AudioDeviceSetProperty (deviceID, 0, 0, false, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); + OK (AudioDeviceSetProperty (deviceID, 0, 0, true, kAudioDevicePropertyBufferFrameSize, size, &framesPerBuf)); - // (avoid doing this in plugins because of some strange redraw bugs..) - if (rgn != 0 && JUCEApplication::getInstance() != 0) - { - Rect bounds; - GetRegionBounds (rgn, &bounds); - clip.origin.x = bounds.left; - clip.origin.y = bounds.top; - clip.size.width = bounds.right - bounds.left; - clip.size.height = bounds.bottom - bounds.top; - } - else + // wait for the changes to happen (on some devices) + int i = 30; + while (--i >= 0) { - HIViewGetBounds (viewRef, &clip); - clip.origin.x = 0; - clip.origin.y = 0; - } -#else - CGRect clip (CGContextGetClipBoundingBox (context)); -#endif - - clip = CGRectIntegral (clip); + updateDetailsFromDevice(); - if (clip.origin.x < 0) - { - clip.size.width += clip.origin.x; - clip.origin.x = 0; - } + if (sampleRate == newSampleRate && bufferSizeSamples == bufferSize) + break; - if (clip.origin.y < 0) - { - clip.size.height += clip.origin.y; - clip.origin.y = 0; + Thread::sleep (100); } - if (! component->isOpaque()) - CGContextClearRect (context, clip); + if (i < 0) + error = "Couldn't change sample rate/buffer size"; - repainter->paint (context, - (int) clip.origin.x, (int) clip.origin.y, - (int) clip.size.width, (int) clip.size.height); + if (sampleRates.size() == 0) + error = "Device has no available sample-rates"; - if (port != 0) - { - CGContextFlush (context); - QDEndCGContext (port, &context); + if (bufferSizes.size() == 0) + error = "Device has no available buffer-sizes"; - SetPort (oldPort); - } + if (inputDevice != 0 && error.isEmpty()) + error = inputDevice->reopen (inputChannels, + outputChannels, + newSampleRate, + bufferSizeSamples); - repainter->repaintAnyRemainingRegions(); + callbacksAllowed = true; - return noErr; + return error; } - OSStatus handleWindowClassEvent (EventRef theEvent) + bool start (AudioIODeviceCallback* cb) { - switch (GetEventKind (theEvent)) + if (! started) { - case kEventWindowBoundsChanged: - resizeViewToFitWindow(); - break; // allow other handlers in the event chain to also get a look at the events + callback = 0; - case kEventWindowBoundsChanging: - if ((styleFlags & (windowIsResizable | windowHasTitleBar)) == (windowIsResizable | windowHasTitleBar)) + if (deviceID != 0) { - UInt32 atts = 0; - GetEventParameter (theEvent, kEventParamAttributes, typeUInt32, - 0, sizeof (UInt32), 0, &atts); - - if ((atts & (kWindowBoundsChangeUserDrag | kWindowBoundsChangeUserResize)) != 0) +#if MACOS_10_4_OR_EARLIER + if (OK (AudioDeviceAddIOProc (deviceID, audioIOProc, (void*) this))) +#else + if (OK (AudioDeviceCreateIOProcID (deviceID, audioIOProc, (void*) this, &audioProcID))) +#endif { - if (component->isCurrentlyBlockedByAnotherModalComponent()) + if (OK (AudioDeviceStart (deviceID, audioIOProc))) { - Component* const modal = Component::getCurrentlyModalComponent(); - if (modal != 0) - { - static uint32 lastDragTime = 0; - const uint32 now = Time::currentTimeMillis(); - - if (now > lastDragTime + 1000) - { - lastDragTime = now; - modal->inputAttemptWhenModal(); - } - - const Rectangle currentRect (getComponent()->getBounds()); - Rect current; - current.left = currentRect.getX(); - current.top = currentRect.getY(); - current.right = currentRect.getRight(); - current.bottom = currentRect.getBottom(); - - // stop the window getting dragged.. - SetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - sizeof (Rect), ¤t); - - return noErr; - } + started = true; } - - if ((atts & kWindowBoundsChangeUserResize) != 0 - && constrainer != 0 && ! isSharedWindow) + else { - Rect current; - GetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - 0, sizeof (Rect), 0, ¤t); - - int x = current.left; - int y = current.top; - int w = current.right - current.left; - int h = current.bottom - current.top; - - const Rectangle currentRect (getComponent()->getBounds()); - - constrainer->checkBounds (x, y, w, h, currentRect, - Desktop::getInstance().getAllMonitorDisplayAreas().getBounds(), - y != currentRect.getY() && y + h == currentRect.getBottom(), - x != currentRect.getX() && x + w == currentRect.getRight(), - y == currentRect.getY() && y + h != currentRect.getBottom(), - x == currentRect.getX() && x + w != currentRect.getRight()); - - current.left = x; - current.top = y; - current.right = x + w; - current.bottom = y + h; - - SetEventParameter (theEvent, kEventParamCurrentBounds, typeQDRectangle, - sizeof (Rect), ¤t); - - return noErr; +#if MACOS_10_4_OR_EARLIER + OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); +#else + OK (AudioDeviceDestroyIOProcID (deviceID, audioProcID)); + audioProcID = 0; +#endif } } } - break; + } - case kEventWindowFocusAcquired: - keysCurrentlyDown.clear(); + if (started) + { + const ScopedLock sl (callbackLock); + callback = cb; + } - if ((! isSharedWindow) || HIViewSubtreeContainsFocus (viewRef)) - viewFocusGain(); + if (inputDevice != 0) + return started && inputDevice->start (cb); + else + return started; + } - break; // allow other handlers in the event chain to also get a look at the events + void stop (bool leaveInterruptRunning) + { + callbackLock.enter(); + callback = 0; + callbackLock.exit(); - case kEventWindowFocusRelinquish: - keysCurrentlyDown.clear(); - viewFocusLoss(); + if (started + && (deviceID != 0) + && ! leaveInterruptRunning) + { + OK (AudioDeviceStop (deviceID, audioIOProc)); - break; // allow other handlers in the event chain to also get a look at the events +#if MACOS_10_4_OR_EARLIER + OK (AudioDeviceRemoveIOProc (deviceID, audioIOProc)); +#else + OK (AudioDeviceDestroyIOProcID (deviceID, audioProcID)); + audioProcID = 0; +#endif + started = false; - case kEventWindowCollapsed: - minimisedWindows.addIfNotAlreadyThere (windowRef); - handleMovedOrResized(); - break; // allow other handlers in the event chain to also get a look at the events + callbackLock.enter(); + callbackLock.exit(); - case kEventWindowExpanded: - minimisedWindows.removeValue (windowRef); - handleMovedOrResized(); - break; // allow other handlers in the event chain to also get a look at the events + // wait until it's definately stopped calling back.. + for (int i = 40; --i >= 0;) + { + Thread::sleep (50); - case kEventWindowShown: - break; // allow other handlers in the event chain to also get a look at the events + UInt32 running = 0; + UInt32 size = sizeof (running); + OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyDeviceIsRunning, &size, &running)); + if (running == 0) + break; + } - case kEventWindowClose: - if (isSharedWindow) - break; // break to let the OS delete the window + callbackLock.enter(); + callbackLock.exit(); + } - handleUserClosingWindow(); - return noErr; // avoids letting the OS to delete the window, we'll do that ourselves. + if (inputDevice != 0) + inputDevice->stop (leaveInterruptRunning); + } - default: - break; - } + double getSampleRate() const + { + return sampleRate; + } - return eventNotHandledErr; + int getBufferSize() const + { + return bufferSize; } - OSStatus handleWindowEventForPeer (EventHandlerCallRef callRef, EventRef theEvent) + void audioCallback (const AudioBufferList* inInputData, + AudioBufferList* outOutputData) { - switch (GetEventClass (theEvent)) + int i; + const ScopedLock sl (callbackLock); + + if (callback != 0) { - case kEventClassMouse: + if (inputDevice == 0) { - static HIViewComponentPeer* lastMouseDownPeer = 0; + for (i = numInputChans; --i >= 0;) + { + const CallbackDetailsForChannel& info = inputChannelInfo[i]; + float* dest = tempInputBuffers [info.sourceChannelNum]; + const float* src = ((const float*) inInputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; - const UInt32 eventKind = GetEventKind (theEvent); - HIViewRef view = 0; + if (stride != 0) // if this is zero, info is invalid + { + for (int j = bufferSize; --j >= 0;) + { + *dest++ = *src; + src += stride; + } + } + } + } - if (eventKind == kEventMouseDragged) + if (! isSlaveDevice) + { + if (inputDevice == 0) { - view = viewRef; + callback->audioDeviceIOCallback ((const float**) tempInputBuffers, + numInputChans, + tempOutputBuffers, + numOutputChans, + bufferSize); } else { - HIViewGetViewForMouseEvent (HIViewGetRoot (windowRef), theEvent, &view); + jassert (inputDevice->bufferSize == bufferSize); + + callback->audioDeviceIOCallback ((const float**) inputDevice->tempInputBuffers, + inputDevice->numInputChans, + tempOutputBuffers, + numOutputChans, + bufferSize); + } + + for (i = numOutputChans; --i >= 0;) + { + const CallbackDetailsForChannel& info = outputChannelInfo[i]; + const float* src = tempOutputBuffers [i]; + float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; - if (view != viewRef) + if (stride != 0) // if this is zero, info is invalid { - if ((eventKind == kEventMouseUp - || eventKind == kEventMouseExited) - && ComponentPeer::isValidPeer (lastMouseDownPeer)) + for (int j = bufferSize; --j >= 0;) { - return lastMouseDownPeer->handleMouseEvent (callRef, theEvent); + *dest = *src++; + dest += stride; } - - return eventNotHandledErr; } } + } + } + else + { + for (i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) + { + const CallbackDetailsForChannel& info = outputChannelInfo[i]; + float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) + + info.dataOffsetSamples; + const int stride = info.dataStrideSamples; - if (eventKind == kEventMouseDown - || eventKind == kEventMouseDragged - || eventKind == kEventMouseEntered) + if (stride != 0) // if this is zero, info is invalid { - lastMouseDownPeer = this; + for (int j = bufferSize; --j >= 0;) + { + *dest = 0.0f; + dest += stride; + } } - - return handleMouseEvent (callRef, theEvent); } - break; - - case kEventClassWindow: - return handleWindowClassEvent (theEvent); - - case kEventClassKeyboard: - if (isFocused()) - return handleKeyEvent (theEvent, 0); - - break; - - case kEventClassTextInput: - if (isFocused()) - return handleTextInputEvent (theEvent); - - break; - - default: - break; } - - return eventNotHandledErr; } - static pascal OSStatus handleWindowEvent (EventHandlerCallRef callRef, EventRef theEvent, void* userData) + // called by callbacks + void deviceDetailsChanged() { - MessageManager::delayWaitCursor(); - - HIViewComponentPeer* const peer = (HIViewComponentPeer*) userData; - - const MessageManagerLock messLock; - - if (ComponentPeer::isValidPeer (peer)) - return peer->handleWindowEventForPeer (callRef, theEvent); - - return eventNotHandledErr; + if (callbacksAllowed) + startTimer (100); } - static pascal OSStatus hiViewEventHandler (EventHandlerCallRef myHandler, EventRef theEvent, void* userData) + void timerCallback() { - MessageManager::delayWaitCursor(); + stopTimer(); + log ("CoreAudio device changed callback"); - const UInt32 eventKind = GetEventKind (theEvent); - const UInt32 eventClass = GetEventClass (theEvent); + const double oldSampleRate = sampleRate; + const int oldBufferSize = bufferSize; + updateDetailsFromDevice(); - if (eventClass == kEventClassHIObject) + if (oldBufferSize != bufferSize || oldSampleRate != sampleRate) { - switch (eventKind) - { - case kEventHIObjectConstruct: - { - void* data = juce_calloc (sizeof (void*)); - SetEventParameter (theEvent, kEventParamHIObjectInstance, - typeVoidPtr, sizeof (void*), &data); - - return noErr; - } - - case kEventHIObjectInitialize: - GetEventParameter (theEvent, 'peer', typeVoidPtr, 0, sizeof (void*), 0, (void**) userData); - return noErr; + callbacksAllowed = false; + stop (false); + updateDetailsFromDevice(); + callbacksAllowed = true; + } + } - case kEventHIObjectDestruct: - juce_free (userData); - return noErr; + CoreAudioInternal* getRelatedDevice() const + { + UInt32 size = 0; + CoreAudioInternal* result = 0; - default: - break; - } - } - else if (eventClass == kEventClassControl) + if (deviceID != 0 + && AudioDeviceGetPropertyInfo (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, 0) == noErr + && size > 0) { - HIViewComponentPeer* const peer = *(HIViewComponentPeer**) userData; - const MessageManagerLock messLock; - - if (! ComponentPeer::isValidPeer (peer)) - return eventNotHandledErr; + AudioDeviceID* devs = (AudioDeviceID*) juce_calloc (size); - switch (eventKind) + if (OK (AudioDeviceGetProperty (deviceID, 0, false, kAudioDevicePropertyRelatedDevices, &size, devs))) { - case kEventControlDraw: - return peer->hiViewDraw (theEvent); - - case kEventControlBoundsChanged: - { - HIRect bounds; - HIViewGetBounds (peer->viewRef, &bounds); - peer->repaint (0, 0, roundFloatToInt (bounds.size.width), roundFloatToInt (bounds.size.height)); - - peer->handleMovedOrResized(); - return noErr; - } - - case kEventControlHitTest: + for (unsigned int i = 0; i < size / sizeof (AudioDeviceID); ++i) { - HIPoint where; - GetEventParameter (theEvent, kEventParamMouseLocation, typeHIPoint, 0, sizeof (HIPoint), 0, &where); - - HIRect bounds; - HIViewGetBounds (peer->viewRef, &bounds); + if (devs[i] != deviceID && devs[i] != 0) + { + result = new CoreAudioInternal (devs[i]); - ControlPartCode part = kControlNoPart; + if (result->error.isEmpty()) + { + const bool thisIsInput = inChanNames.size() > 0 && outChanNames.size() == 0; + const bool otherIsInput = result->inChanNames.size() > 0 && result->outChanNames.size() == 0; - if (CGRectContainsPoint (bounds, where)) - part = 1; + if (thisIsInput != otherIsInput + || (inChanNames.size() + outChanNames.size() == 0) + || (result->inChanNames.size() + result->outChanNames.size()) == 0) + break; + } - SetEventParameter (theEvent, kEventParamControlPart, typeControlPartCode, sizeof (ControlPartCode), &part); - return noErr; + deleteAndZero (result); + } } - break; + } - case kEventControlSetFocusPart: - { - ControlPartCode desiredFocus; - if (GetEventParameter (theEvent, kEventParamControlPart, typeControlPartCode, 0, sizeof (ControlPartCode), 0, &desiredFocus) != noErr) - break; + juce_free (devs); + } - if (desiredFocus == kControlNoPart) - peer->viewFocusLoss(); - else - peer->viewFocusGain(); + return result; + } - return noErr; - } - break; + juce_UseDebuggingNewOperator - case kEventControlDragEnter: - { -#if MACOS_10_2_OR_EARLIER - enum { kEventParamControlWouldAcceptDrop = 'cldg' }; + String error; + int inputLatency, outputLatency; + BitArray activeInputChans, activeOutputChans; + StringArray inChanNames, outChanNames; + Array sampleRates; + Array bufferSizes; + AudioIODeviceCallback* callback; +#if ! MACOS_10_4_OR_EARLIER + AudioDeviceIOProcID audioProcID; #endif - Boolean accept = true; - SetEventParameter (theEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof (accept), &accept); - peer->doDragDropEnter (theEvent); - return noErr; - } + CoreAudioInternal* inputDevice; + bool isSlaveDevice; - case kEventControlDragWithin: - peer->doDragDropMove (theEvent); - return noErr; +private: + CriticalSection callbackLock; + AudioDeviceID deviceID; + bool started; + double sampleRate; + int bufferSize; + float* audioBuffer; + int numInputChans, numOutputChans; + bool callbacksAllowed; - case kEventControlDragLeave: - peer->doDragDropExit (theEvent); - return noErr; + struct CallbackDetailsForChannel + { + int sourceChannelNum; + int streamNum; + int dataOffsetSamples; + int dataStrideSamples; + }; - case kEventControlDragReceive: - peer->doDragDrop (theEvent); - return noErr; + int numInputChannelInfos, numOutputChannelInfos; + CallbackDetailsForChannel inputChannelInfo [maxNumChans]; + CallbackDetailsForChannel outputChannelInfo [maxNumChans]; + float* tempInputBuffers [maxNumChans]; + float* tempOutputBuffers [maxNumChans]; - case kEventControlOwningWindowChanged: - return peer->ownerWindowChanged (theEvent); + CoreAudioInternal (const CoreAudioInternal&); + const CoreAudioInternal& operator= (const CoreAudioInternal&); -#if ! MACOS_10_2_OR_EARLIER - case kEventControlGetFrameMetrics: - { - CallNextEventHandler (myHandler, theEvent); - HIViewFrameMetrics metrics; - GetEventParameter (theEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, 0, sizeof (metrics), 0, &metrics); - metrics.top = metrics.bottom = 0; - SetEventParameter (theEvent, kEventParamControlFrameMetrics, typeControlFrameMetrics, sizeof (metrics), &metrics); - return noErr; - } -#endif + static OSStatus audioIOProc (AudioDeviceID inDevice, + const AudioTimeStamp* inNow, + const AudioBufferList* inInputData, + const AudioTimeStamp* inInputTime, + AudioBufferList* outOutputData, + const AudioTimeStamp* inOutputTime, + void* device) + { + ((CoreAudioInternal*) device)->audioCallback (inInputData, outOutputData); + return noErr; + } - case kEventControlInitialize: - { - UInt32 features = kControlSupportsDragAndDrop - | kControlSupportsFocus - | kControlHandlesTracking - | kControlSupportsEmbedding - | (1 << 8) /*kHIViewFeatureGetsFocusOnClick*/; + static OSStatus deviceListenerProc (AudioDeviceID inDevice, + UInt32 inLine, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData) + { + CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; - SetEventParameter (theEvent, kEventParamControlFeatures, typeUInt32, sizeof (UInt32), &features); - return noErr; - } + switch (inPropertyID) + { + case kAudioDevicePropertyBufferSize: + case kAudioDevicePropertyBufferFrameSize: + case kAudioDevicePropertyNominalSampleRate: + case kAudioDevicePropertyStreamFormat: + case kAudioDevicePropertyDeviceIsAlive: + intern->deviceDetailsChanged(); + break; - default: - break; - } + case kAudioDevicePropertyBufferSizeRange: + case kAudioDevicePropertyVolumeScalar: + case kAudioDevicePropertyMute: + case kAudioDevicePropertyPlayThru: + case kAudioDevicePropertyDataSource: + case kAudioDevicePropertyDeviceIsRunning: + break; } - return eventNotHandledErr; + return noErr; } - WindowRef createNewWindow (const int windowStyleFlags) + static OSType* getAllDataSourcesForDevice (AudioDeviceID deviceID, const bool input, int& num) { - jassert (windowRef == 0); - - static ToolboxObjectClassRef customWindowClass = 0; + OSType* types = 0; + UInt32 size = 0; + num = 0; - if (customWindowClass == 0) + if (deviceID != 0 + && OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, 0))) { - // Register our window class - const EventTypeSpec customTypes[] = { { kEventClassWindow, kEventWindowDrawFrame } }; - - UnsignedWide t; - Microseconds (&t); - const String randomString ((int) (t.lo & 0x7ffffff)); - const String juceWindowClassName (T("JUCEWindowClass_") + randomString); - CFStringRef juceWindowClassNameCFString = PlatformUtilities::juceStringToCFString (juceWindowClassName); - - RegisterToolboxObjectClass (juceWindowClassNameCFString, - 0, 1, customTypes, - NewEventHandlerUPP (handleFrameRepaintEvent), - 0, &customWindowClass); + types = (OSType*) juce_calloc (size); - CFRelease (juceWindowClassNameCFString); + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyDataSources, &size, types))) + { + num = size / sizeof (OSType); + } + else + { + juce_free (types); + types = 0; + } } - Rect pos; - pos.left = getComponent()->getX(); - pos.top = getComponent()->getY(); - pos.right = getComponent()->getRight(); - pos.bottom = getComponent()->getBottom(); - - int attributes = kWindowStandardHandlerAttribute | kWindowCompositingAttribute; - if ((windowStyleFlags & windowHasDropShadow) == 0) - attributes |= kWindowNoShadowAttribute; - - if ((windowStyleFlags & windowIgnoresMouseClicks) != 0) - attributes |= kWindowIgnoreClicksAttribute; - -#if ! MACOS_10_3_OR_EARLIER - if ((windowStyleFlags & windowIsTemporary) != 0) - attributes |= kWindowDoesNotCycleAttribute; -#endif + return types; + } +}; - WindowRef newWindow = 0; +class CoreAudioIODevice : public AudioIODevice +{ +public: + CoreAudioIODevice (const String& deviceName, + AudioDeviceID inputDeviceId, + const int inputIndex_, + AudioDeviceID outputDeviceId, + const int outputIndex_) + : AudioIODevice (deviceName, "CoreAudio"), + inputIndex (inputIndex_), + outputIndex (outputIndex_), + isOpen_ (false), + isStarted (false) + { + internal = 0; + CoreAudioInternal* device = 0; - if ((windowStyleFlags & windowHasTitleBar) == 0) + if (outputDeviceId == 0 || outputDeviceId == inputDeviceId) { - attributes |= kWindowCollapseBoxAttribute; + jassert (inputDeviceId != 0); - WindowDefSpec customWindowSpec; - customWindowSpec.defType = kWindowDefObjectClass; - customWindowSpec.u.classRef = customWindowClass; + device = new CoreAudioInternal (inputDeviceId); + lastError = device->error; - CreateCustomWindow (&customWindowSpec, - ((windowStyleFlags & windowIsTemporary) != 0) ? kUtilityWindowClass : - (getComponent()->isAlwaysOnTop() ? kUtilityWindowClass - : kDocumentWindowClass), - attributes, - &pos, - &newWindow); + if (lastError.isNotEmpty()) + deleteAndZero (device); } else { - if ((windowStyleFlags & windowHasCloseButton) != 0) - attributes |= kWindowCloseBoxAttribute; - - if ((windowStyleFlags & windowHasMinimiseButton) != 0) - attributes |= kWindowCollapseBoxAttribute; - - if ((windowStyleFlags & windowHasMaximiseButton) != 0) - attributes |= kWindowFullZoomAttribute; - - if ((windowStyleFlags & windowIsResizable) != 0) - attributes |= kWindowResizableAttribute | kWindowLiveResizeAttribute; - - CreateNewWindow (kDocumentWindowClass, attributes, &pos, &newWindow); - } - - jassert (newWindow != 0); - if (newWindow != 0) - { - HideWindow (newWindow); - - SetAutomaticControlDragTrackingEnabledForWindow (newWindow, true); - - if (! getComponent()->isOpaque()) - SetWindowAlpha (newWindow, 0.9999999f); // to fool it into giving the window an alpha-channel - } - - return newWindow; - } - - OSStatus ownerWindowChanged (EventRef theEvent) - { - WindowRef newWindow = 0; - GetEventParameter (theEvent, kEventParamControlCurrentOwningWindow, typeWindowRef, 0, sizeof (newWindow), 0, &newWindow); + device = new CoreAudioInternal (outputDeviceId); + lastError = device->error; - if (windowRef != newWindow) - { - if (eventHandlerRef != 0) + if (lastError.isNotEmpty()) { - RemoveEventHandler (eventHandlerRef); - eventHandlerRef = 0; + deleteAndZero (device); } - - windowRef = newWindow; - - if (windowRef != 0) + else if (inputDeviceId != 0) { - const EventTypeSpec eventTypes[] = - { - { kEventClassWindow, kEventWindowBoundsChanged }, - { kEventClassWindow, kEventWindowBoundsChanging }, - { kEventClassWindow, kEventWindowFocusAcquired }, - { kEventClassWindow, kEventWindowFocusRelinquish }, - { kEventClassWindow, kEventWindowCollapsed }, - { kEventClassWindow, kEventWindowExpanded }, - { kEventClassWindow, kEventWindowShown }, - { kEventClassWindow, kEventWindowClose }, - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassMouse, kEventMouseDragged }, - { kEventClassMouse, kEventMouseEntered }, - { kEventClassMouse, kEventMouseExited }, - { kEventClassMouse, kEventMouseWheelMoved }, - { kEventClassKeyboard, kEventRawKeyUp }, - { kEventClassKeyboard, kEventRawKeyRepeat }, - { kEventClassKeyboard, kEventRawKeyModifiersChanged }, - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } - }; - - static EventHandlerUPP handleWindowEventUPP = 0; - - if (handleWindowEventUPP == 0) - handleWindowEventUPP = NewEventHandlerUPP (handleWindowEvent); - - InstallWindowEventHandler (windowRef, handleWindowEventUPP, - GetEventTypeCount (eventTypes), eventTypes, - (void*) this, (EventHandlerRef*) &eventHandlerRef); - - WindowAttributes attributes; - GetWindowAttributes (windowRef, &attributes); - -#if MACOS_10_3_OR_EARLIER - isCompositingWindow = ((attributes & kWindowCompositingAttribute) != 0); -#else - isCompositingWindow = HIViewIsCompositingEnabled (viewRef); -#endif - - SetAutomaticControlDragTrackingEnabledForWindow (newWindow, true); + CoreAudioInternal* secondDevice = new CoreAudioInternal (inputDeviceId); + lastError = device->error; - MouseCheckTimer::getInstance()->resetMouseMoveChecker(); + if (lastError.isNotEmpty()) + { + delete secondDevice; + } + else + { + device->inputDevice = secondDevice; + secondDevice->isSlaveDevice = true; + } } } - resizeViewToFitWindow(); - return noErr; + internal = device; + + AudioHardwareAddPropertyListener (kAudioPropertyWildcardPropertyID, + hardwareListenerProc, internal); } - void createNewHIView() + ~CoreAudioIODevice() { - jassert (viewRef == 0); + AudioHardwareRemovePropertyListener (kAudioPropertyWildcardPropertyID, + hardwareListenerProc); - if (viewClassRef == 0) - { - // Register our HIView class - EventTypeSpec viewEvents[] = - { - { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassControl, kEventControlInitialize }, - { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlBoundsChanged }, - { kEventClassControl, kEventControlSetFocusPart }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlDragEnter }, - { kEventClassControl, kEventControlDragLeave }, - { kEventClassControl, kEventControlDragWithin }, - { kEventClassControl, kEventControlDragReceive }, - { kEventClassControl, kEventControlOwningWindowChanged } - }; + delete internal; + } - UnsignedWide t; - Microseconds (&t); - const String randomString ((int) (t.lo & 0x7ffffff)); - const String juceHiViewClassName (T("JUCEHIViewClass_") + randomString); - juceHiViewClassNameCFString = PlatformUtilities::juceStringToCFString (juceHiViewClassName); + const StringArray getOutputChannelNames() + { + return internal->outChanNames; + } - HIObjectRegisterSubclass (juceHiViewClassNameCFString, - kHIViewClassID, 0, - NewEventHandlerUPP (hiViewEventHandler), - GetEventTypeCount (viewEvents), - viewEvents, 0, - &viewClassRef); - } + const StringArray getInputChannelNames() + { + if (internal->inputDevice != 0) + return internal->inputDevice->inChanNames; + else + return internal->inChanNames; + } + + int getNumSampleRates() + { + return internal->sampleRates.size(); + } - EventRef event; - CreateEvent (0, kEventClassHIObject, kEventHIObjectInitialize, GetCurrentEventTime(), kEventAttributeNone, &event); + double getSampleRate (int index) + { + return internal->sampleRates [index]; + } - void* thisPointer = this; - SetEventParameter (event, 'peer', typeVoidPtr, sizeof (void*), &thisPointer); + int getNumBufferSizesAvailable() + { + return internal->bufferSizes.size(); + } - HIObjectCreate (juceHiViewClassNameCFString, event, (HIObjectRef*) &viewRef); + int getBufferSizeSamples (int index) + { + return internal->bufferSizes [index]; + } - SetControlDragTrackingEnabled (viewRef, true); + int getDefaultBufferSize() + { + for (int i = 0; i < getNumBufferSizesAvailable(); ++i) + if (getBufferSizeSamples(i) >= 512) + return getBufferSizeSamples(i); - if (isSharedWindow) - { - setBounds (component->getX(), component->getY(), - component->getWidth(), component->getHeight(), false); - } + return 512; } -}; -bool juce_isHIViewCreatedByJuce (HIViewRef view) -{ - return juceHiViewClassNameCFString != 0 - && HIObjectIsOfClass ((HIObjectRef) view, juceHiViewClassNameCFString); -} + const String open (const BitArray& inputChannels, + const BitArray& outputChannels, + double sampleRate, + int bufferSizeSamples) + { + isOpen_ = true; -bool juce_isWindowCreatedByJuce (WindowRef window) -{ - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - if (ComponentPeer::getPeer(i)->getNativeHandle() == window) - return true; + if (bufferSizeSamples <= 0) + bufferSizeSamples = getDefaultBufferSize(); - return false; -} + internal->reopen (inputChannels, outputChannels, sampleRate, bufferSizeSamples); + lastError = internal->error; + return lastError; + } -static void trackNextMouseEvent() -{ - UInt32 mods; - MouseTrackingResult result; - ::Point where; + void close() + { + isOpen_ = false; + } - if (TrackMouseLocationWithOptions ((GrafPtr) -1, 0, 0.01, //kEventDurationForever, - &where, &mods, &result) != noErr - || ! ComponentPeer::isValidPeer (juce_currentMouseTrackingPeer)) + bool isOpen() { - juce_currentMouseTrackingPeer = 0; - return; + return isOpen_; } - if (result == kMouseTrackingTimedOut) - return; + int getCurrentBufferSizeSamples() + { + return internal != 0 ? internal->getBufferSize() : 512; + } -#if MACOS_10_3_OR_EARLIER - const int x = where.h - juce_currentMouseTrackingPeer->getScreenX(); - const int y = where.v - juce_currentMouseTrackingPeer->getScreenY(); -#else - HIPoint p; - p.x = where.h; - p.y = where.v; - HIPointConvert (&p, kHICoordSpaceScreenPixel, 0, - kHICoordSpaceView, ((HIViewComponentPeer*) juce_currentMouseTrackingPeer)->viewRef); - const int x = p.x; - const int y = p.y; -#endif + double getCurrentSampleRate() + { + return internal != 0 ? internal->getSampleRate() : 0; + } - if (result == kMouseTrackingMouseDragged) + int getCurrentBitDepth() { - updateModifiers (0); - juce_currentMouseTrackingPeer->handleMouseDrag (x, y, getEventTime (0)); + return 32; // no way to find out, so just assume it's high.. + } - if (! ComponentPeer::isValidPeer (juce_currentMouseTrackingPeer)) - { - juce_currentMouseTrackingPeer = 0; - return; - } + const BitArray getActiveOutputChannels() const + { + return internal != 0 ? internal->activeOutputChans : BitArray(); } - else if (result == kMouseTrackingMouseUp - || result == kMouseTrackingUserCancelled - || result == kMouseTrackingMouseMoved) + + const BitArray getActiveInputChannels() const { - ComponentPeer* const oldPeer = juce_currentMouseTrackingPeer; - juce_currentMouseTrackingPeer = 0; + BitArray chans; - if (ComponentPeer::isValidPeer (oldPeer)) + if (internal != 0) { - const int oldModifiers = currentModifiers; - currentModifiers &= ~(ModifierKeys::leftButtonModifier | ModifierKeys::rightButtonModifier | ModifierKeys::middleButtonModifier); - updateModifiers (0); + chans = internal->activeInputChans; - oldPeer->handleMouseUp (oldModifiers, x, y, getEventTime (0)); + if (internal->inputDevice != 0) + chans.orWith (internal->inputDevice->activeInputChans); } - } -} - -bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages) -{ - if (juce_currentMouseTrackingPeer != 0) - trackNextMouseEvent(); -/* [[NSRunLoop mainRunLoop] acceptInputForMode: NSDefaultRunLoopMode - beforeDate: returnIfNoPendingMessages - ? [[NSDate date] addTimeInterval: 0.01] - : [NSDate distantFuture]]; -*/ - EventRef theEvent; + return chans; + } - if (ReceiveNextEvent (0, 0, (returnIfNoPendingMessages) ? kEventDurationNoWait - : kEventDurationForever, - true, &theEvent) == noErr) + int getOutputLatencyInSamples() { - if (GetEventClass (theEvent) == kEventClassAppleEvent) - { - EventRecord eventRec; - if (ConvertEventRefToEventRecord (theEvent, &eventRec)) - AEProcessAppleEvent (&eventRec); - } - else - { - EventTargetRef theTarget = GetEventDispatcherTarget(); - SendEventToEventTarget (theEvent, theTarget); - } + if (internal == 0) + return 0; - ReleaseEvent (theEvent); - return true; + // this seems like a good guess at getting the latency right - comparing + // this with a round-trip measurement, it gets it to within a few millisecs + // for the built-in mac soundcard + return internal->outputLatency + internal->getBufferSize() * 2; } - return false; -} - -ComponentPeer* Component::createNewPeer (int styleFlags, void* windowToAttachTo) -{ - return new HIViewComponentPeer (this, styleFlags, (HIViewRef) windowToAttachTo); -} + int getInputLatencyInSamples() + { + if (internal == 0) + return 0; -void MouseCheckTimer::timerCallback() -{ - if (ModifierKeys::getCurrentModifiersRealtime().isAnyMouseButtonDown()) - return; + return internal->inputLatency + internal->getBufferSize() * 2; + } - if (Process::isForegroundProcess()) + void start (AudioIODeviceCallback* callback) { - bool stillOver = false; - int x = 0, y = 0, w = 0, h = 0; - int mx = 0, my = 0; - const bool validWindow = ComponentPeer::isValidPeer (lastPeerUnderMouse); - - if (validWindow) + if (internal != 0 && ! isStarted) { - lastPeerUnderMouse->getBounds (x, y, w, h, true); - Desktop::getMousePosition (mx, my); - - stillOver = (mx >= x && my >= y && mx < x + w && my < y + h); - - if (stillOver) - { - // check if it's over an embedded HIView - int rx = mx, ry = my; - lastPeerUnderMouse->globalPositionToRelative (rx, ry); - HIPoint hipoint; - hipoint.x = rx; - hipoint.y = ry; - - HIViewRef root; - GetRootControl ((WindowRef) lastPeerUnderMouse->getNativeHandle(), &root); + if (callback != 0) + callback->audioDeviceAboutToStart (this); - HIViewRef hitview; - if (HIViewGetSubviewHit (root, &hipoint, true, &hitview) == noErr && hitview != 0) - { - stillOver = HIObjectIsOfClass ((HIObjectRef) hitview, juceHiViewClassNameCFString); - } - } + isStarted = true; + internal->start (callback); } + } - if (! stillOver) + void stop() + { + if (isStarted && internal != 0) { - // mouse is outside our windows so set a normal cursor (only - // if we're running as an app, not a plugin) - if (JUCEApplication::getInstance() != 0) - SetThemeCursor (kThemeArrowCursor); + AudioIODeviceCallback* const lastCallback = internal->callback; - if (validWindow) - lastPeerUnderMouse->handleMouseExit (mx - x, my - y, Time::currentTimeMillis()); + isStarted = false; + internal->stop (true); - if (hasEverHadAMouseMove) - stopTimer(); + if (lastCallback != 0) + lastCallback->audioDeviceStopped(); } + } - if ((! hasEverHadAMouseMove) && validWindow - && (mx != lastX || my != lastY)) - { - lastX = mx; - lastY = my; + bool isPlaying() + { + if (internal->callback == 0) + isStarted = false; - if (stillOver) - lastPeerUnderMouse->handleMouseMove (mx - x, my - y, Time::currentTimeMillis()); - } + return isStarted; } -} - -// called from juce_Messaging.cpp -void juce_HandleProcessFocusChange() -{ - keysCurrentlyDown.clear(); - if (HIViewComponentPeer::isValidPeer (currentlyFocusedPeer)) + const String getLastError() { - if (Process::isForegroundProcess()) - currentlyFocusedPeer->handleFocusGain(); - else - currentlyFocusedPeer->handleFocusLoss(); + return lastError; } -} - -static bool performDrag (DragRef drag) -{ - EventRecord event; - event.what = mouseDown; - event.message = 0; - event.when = TickCount(); - int x, y; - Desktop::getMousePosition (x, y); - event.where.h = x; - event.where.v = y; - - event.modifiers = GetCurrentKeyModifiers(); - - RgnHandle rgn = NewRgn(); - RgnHandle rgn2 = NewRgn(); - SetRectRgn (rgn, - event.where.h - 8, event.where.v - 8, - event.where.h + 8, event.where.v + 8); - CopyRgn (rgn, rgn2); - InsetRgn (rgn2, 1, 1); - DiffRgn (rgn, rgn2, rgn); - DisposeRgn (rgn2); - - bool result = TrackDrag (drag, &event, rgn) == noErr; - - DisposeRgn (rgn); - return result; -} + int inputIndex, outputIndex; -bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& files, const bool canMoveFiles) -{ - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - ComponentPeer::getPeer (i)->performAnyPendingRepaintsNow(); + juce_UseDebuggingNewOperator - DragRef drag; - bool result = false; +private: + CoreAudioInternal* internal; + bool isOpen_, isStarted; + String lastError; - if (NewDrag (&drag) == noErr) + static OSStatus hardwareListenerProc (AudioHardwarePropertyID inPropertyID, void* inClientData) { - for (int i = 0; i < files.size(); ++i) - { - HFSFlavor hfsData; + CoreAudioInternal* const intern = (CoreAudioInternal*) inClientData; - if (PlatformUtilities::makeFSSpecFromPath (&hfsData.fileSpec, files[i])) - { - FInfo info; - if (FSpGetFInfo (&hfsData.fileSpec, &info) == noErr) - { - hfsData.fileType = info.fdType; - hfsData.fileCreator = info.fdCreator; - hfsData.fdFlags = info.fdFlags; + switch (inPropertyID) + { + case kAudioHardwarePropertyDevices: + intern->deviceDetailsChanged(); + break; - AddDragItemFlavor (drag, i + 1, kDragFlavorTypeHFS, &hfsData, sizeof (hfsData), 0); - result = true; - } - } + case kAudioHardwarePropertyDefaultOutputDevice: + case kAudioHardwarePropertyDefaultInputDevice: + case kAudioHardwarePropertyDefaultSystemOutputDevice: + break; } - SetDragAllowableActions (drag, canMoveFiles ? kDragActionAll - : kDragActionCopy, false); - - if (result) - result = performDrag (drag); - - DisposeDrag (drag); + return noErr; } - return result; -} - -bool DragAndDropContainer::performExternalDragDropOfText (const String& text) -{ - jassertfalse // not implemented! - return false; -} + CoreAudioIODevice (const CoreAudioIODevice&); + const CoreAudioIODevice& operator= (const CoreAudioIODevice&); +}; -bool Process::isForegroundProcess() throw() +class CoreAudioIODeviceType : public AudioIODeviceType { - ProcessSerialNumber psn, front; - GetCurrentProcess (&psn); - GetFrontProcess (&front); - - Boolean b; - return (SameProcess (&psn, &front, &b) == noErr) && b; -} +public: -bool Desktop::canUseSemiTransparentWindows() throw() -{ - return true; -} + CoreAudioIODeviceType() + : AudioIODeviceType (T("CoreAudio")), + hasScanned (false) + { + } -void Desktop::getMousePosition (int& x, int& y) throw() -{ - CGrafPtr currentPort; - GetPort (¤tPort); + ~CoreAudioIODeviceType() + { + } - if (! IsValidPort (currentPort)) + void scanForDevices() { - WindowRef front = FrontWindow(); + hasScanned = true; - if (front != 0) - { - SetPortWindowPort (front); - } - else + inputDeviceNames.clear(); + outputDeviceNames.clear(); + inputIds.clear(); + outputIds.clear(); + + UInt32 size; + if (OK (AudioHardwareGetPropertyInfo (kAudioHardwarePropertyDevices, &size, 0))) { - x = y = 0; - return; - } - } + AudioDeviceID* const devs = (AudioDeviceID*) juce_calloc (size); - ::Point p; - GetMouse (&p); - LocalToGlobal (&p); - x = p.h; - y = p.v; + if (OK (AudioHardwareGetProperty (kAudioHardwarePropertyDevices, &size, devs))) + { + static bool alreadyLogged = false; + const int num = size / sizeof (AudioDeviceID); + for (int i = 0; i < num; ++i) + { + char name[1024]; + size = sizeof (name); + if (OK (AudioDeviceGetProperty (devs[i], 0, false, kAudioDevicePropertyDeviceName, &size, name))) + { + const String nameString (String::fromUTF8 ((const uint8*) name, strlen (name))); - SetPort (currentPort); -} + if (! alreadyLogged) + log (T("CoreAudio device: ") + nameString); -void Desktop::setMousePosition (int x, int y) throw() -{ - // this rubbish needs to be done around the warp call, to avoid causing a - // bizarre glitch.. - CGAssociateMouseAndMouseCursorPosition (false); - CGSetLocalEventsSuppressionInterval (0); + const int numIns = getNumChannels (devs[i], true); + const int numOuts = getNumChannels (devs[i], false); - CGPoint pos = { x, y }; - CGWarpMouseCursorPosition (pos); + if (numIns > 0) + { + inputDeviceNames.add (nameString); + inputIds.add (devs[i]); + } - CGAssociateMouseAndMouseCursorPosition (true); -} + if (numOuts > 0) + { + outputDeviceNames.add (nameString); + outputIds.add (devs[i]); + } + } + } -const ModifierKeys ModifierKeys::getCurrentModifiersRealtime() throw() -{ - return ModifierKeys (currentModifiers); -} + alreadyLogged = true; + } -class ScreenSaverDefeater : public Timer, - public DeletedAtShutdown -{ -public: - ScreenSaverDefeater() throw() - { - startTimer (10000); - timerCallback(); - } + juce_free (devs); + } - ~ScreenSaverDefeater() - { + inputDeviceNames.appendNumbersToDuplicates (false, true); + outputDeviceNames.appendNumbersToDuplicates (false, true); } - void timerCallback() + const StringArray getDeviceNames (const bool wantInputNames) const { - if (Process::isForegroundProcess()) - UpdateSystemActivity (UsrActivity); - } -}; - -static ScreenSaverDefeater* screenSaverDefeater = 0; - -void Desktop::setScreenSaverEnabled (const bool isEnabled) throw() -{ - if (screenSaverDefeater == 0) - screenSaverDefeater = new ScreenSaverDefeater(); -} - -bool Desktop::isScreenSaverEnabled() throw() -{ - return screenSaverDefeater == 0; -} - -void juce_updateMultiMonitorInfo (Array & monitorCoords, const bool clipToWorkArea) throw() -{ - int mainMonitorIndex = 0; - CGDirectDisplayID mainDisplayID = CGMainDisplayID(); + jassert (hasScanned); // need to call scanForDevices() before doing this - CGDisplayCount count = 0; - CGDirectDisplayID disps [8]; + if (wantInputNames) + return inputDeviceNames; + else + return outputDeviceNames; + } - if (CGGetOnlineDisplayList (numElementsInArray (disps), disps, &count) == noErr) + int getDefaultDeviceIndex (const bool forInput) const { - for (int i = 0; i < count; ++i) - { - if (mainDisplayID == disps[i]) - mainMonitorIndex = monitorCoords.size(); + jassert (hasScanned); // need to call scanForDevices() before doing this - GDHandle hGDevice; + AudioDeviceID deviceID; + UInt32 size = sizeof (deviceID); - if (clipToWorkArea - && DMGetGDeviceByDisplayID ((DisplayIDType) disps[i], &hGDevice, false) == noErr) + // if they're asking for any input channels at all, use the default input, so we + // get the built-in mic rather than the built-in output with no inputs.. + if (AudioHardwareGetProperty (forInput ? kAudioHardwarePropertyDefaultInputDevice + : kAudioHardwarePropertyDefaultOutputDevice, + &size, &deviceID) == noErr) + { + if (forInput) { - Rect rect; - GetAvailableWindowPositioningBounds (hGDevice, &rect); - - monitorCoords.add (Rectangle (rect.left, - rect.top, - rect.right - rect.left, - rect.bottom - rect.top)); + for (int i = inputIds.size(); --i >= 0;) + if (inputIds[i] == deviceID) + return i; } else { - const CGRect r (CGDisplayBounds (disps[i])); - - monitorCoords.add (Rectangle ((int) r.origin.x, - (int) r.origin.y, - (int) r.size.width, - (int) r.size.height)); + for (int i = outputIds.size(); --i >= 0;) + if (outputIds[i] == deviceID) + return i; } } - } - - // make sure the first in the list is the main monitor - if (mainMonitorIndex > 0) - monitorCoords.swap (mainMonitorIndex, 0); - - jassert (monitorCoords.size() > 0); - - if (monitorCoords.size() == 0) - monitorCoords.add (Rectangle (0, 0, 1024, 768)); -} - -static NSImage* juceImageToNSImage (const Image& image) -{ - int lineStride, pixelStride; - const uint8* pixels = image.lockPixelDataReadOnly (0, 0, image.getWidth(), image.getHeight(), - lineStride, pixelStride); - - NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes: NULL - pixelsWide: image.getWidth() - pixelsHigh: image.getHeight() - bitsPerSample: 8 - samplesPerPixel: image.hasAlphaChannel() ? 4 : 3 - hasAlpha: image.hasAlphaChannel() - isPlanar: NO - colorSpaceName: NSCalibratedRGBColorSpace - bitmapFormat: (NSBitmapFormat) 0 - bytesPerRow: lineStride - bitsPerPixel: pixelStride * 8]; - - unsigned char* newData = [rep bitmapData]; - memcpy (newData, pixels, lineStride * image.getHeight()); - image.releasePixelDataReadOnly (pixels); - - NSImage* im = [[NSImage alloc] init]; - [im addRepresentation: rep]; - [rep release]; - - return im; -} - -void* juce_createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) throw() -{ - NSImage* im = juceImageToNSImage (image); - [im autorelease]; - - NSPoint hs; - hs.x = (int) hotspotX; - hs.y = (int) hotspotY; - - NSCursor* c = [[NSCursor alloc] initWithImage: im hotSpot: hs]; - return (void*) c; -} - -static void* juce_cursorFromData (const unsigned char* data, const int size, float hx, float hy) throw() -{ - Image* const im = ImageFileFormat::loadFrom ((const char*) data, size); - jassert (im != 0); - if (im == 0) return 0; + } - void* const curs = juce_createMouseCursorFromImage (*im, - (int) (hx * im->getWidth()), - (int) (hy * im->getHeight())); - delete im; - return curs; -} - -static void* juce_cursorFromWebKitFile (const char* filename, float hx, float hy) -{ - File f ("/System/Library/Frameworks/WebKit.framework/Frameworks/WebCore.framework/Resources"); + int getIndexOfDevice (AudioIODevice* device, const bool asInput) const + { + jassert (hasScanned); // need to call scanForDevices() before doing this - MemoryBlock mb; - if (f.getChildFile (filename).loadFileAsData (mb)) - return juce_cursorFromData ((const unsigned char*) mb.getData(), mb.getSize(), hx, hy); + CoreAudioIODevice* const d = dynamic_cast (device); + if (d == 0) + return -1; - return 0; -} + return asInput ? d->inputIndex + : d->outputIndex; + } -void* juce_createStandardMouseCursor (MouseCursor::StandardCursorType type) throw() -{ - NSCursor* c = 0; + bool hasSeparateInputsAndOutputs() const { return true; } - switch (type) + AudioIODevice* createDevice (const String& outputDeviceName, + const String& inputDeviceName) { - case MouseCursor::NormalCursor: - c = [NSCursor arrowCursor]; - break; - - case MouseCursor::NoCursor: - { - Image blank (Image::ARGB, 8, 8, true); - return juce_createMouseCursorFromImage (blank, 0, 0); - } - - case MouseCursor::DraggingHandCursor: - c = [NSCursor openHandCursor]; - break; + jassert (hasScanned); // need to call scanForDevices() before doing this - case MouseCursor::CopyingCursor: - return juce_cursorFromWebKitFile ("copyCursor.png", 0, 0); + const int inputIndex = inputDeviceNames.indexOf (inputDeviceName); + const int outputIndex = outputDeviceNames.indexOf (outputDeviceName); - case MouseCursor::WaitCursor: - c = [NSCursor arrowCursor]; // avoid this on the mac, let the OS provide the beachball - break; - //return juce_cursorFromWebKitFile ("waitCursor.png", 0.5f, 0.5f); + String deviceName (outputDeviceName); + if (deviceName.isEmpty()) + deviceName = inputDeviceName; - case MouseCursor::IBeamCursor: - c = [NSCursor IBeamCursor]; - break; + if (index >= 0) + return new CoreAudioIODevice (deviceName, + inputIds [inputIndex], + inputIndex, + outputIds [outputIndex], + outputIndex); - case MouseCursor::PointingHandCursor: - c = [NSCursor pointingHandCursor]; - break; + return 0; + } - case MouseCursor::LeftRightResizeCursor: - c = [NSCursor resizeLeftRightCursor]; - break; + juce_UseDebuggingNewOperator - case MouseCursor::LeftEdgeResizeCursor: - c = [NSCursor resizeLeftCursor]; - break; +private: + StringArray inputDeviceNames, outputDeviceNames; + Array inputIds, outputIds; - case MouseCursor::RightEdgeResizeCursor: - c = [NSCursor resizeRightCursor]; - break; + bool hasScanned; - case MouseCursor::UpDownResizeCursor: - case MouseCursor::TopEdgeResizeCursor: - case MouseCursor::BottomEdgeResizeCursor: - return juce_cursorFromWebKitFile ("northSouthResizeCursor.png", 0.5f, 0.5f); + static int getNumChannels (AudioDeviceID deviceID, bool input) + { + int total = 0; + UInt32 size; - case MouseCursor::TopLeftCornerResizeCursor: - case MouseCursor::BottomRightCornerResizeCursor: - return juce_cursorFromWebKitFile ("northWestSouthEastResizeCursor.png", 0.5f, 0.5f); + if (OK (AudioDeviceGetPropertyInfo (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, 0))) + { + AudioBufferList* const bufList = (AudioBufferList*) juce_calloc (size); - case MouseCursor::TopRightCornerResizeCursor: - case MouseCursor::BottomLeftCornerResizeCursor: - return juce_cursorFromWebKitFile ("northEastSouthWestResizeCursor.png", 0.5f, 0.5f); + if (OK (AudioDeviceGetProperty (deviceID, 0, input, kAudioDevicePropertyStreamConfiguration, &size, bufList))) + { + const int numStreams = bufList->mNumberBuffers; - case MouseCursor::UpDownLeftRightResizeCursor: - return juce_cursorFromWebKitFile ("moveCursor.png", 0.5f, 0.5f); + for (int i = 0; i < numStreams; ++i) + { + const AudioBuffer& b = bufList->mBuffers[i]; + total += b.mNumberChannels; + } + } - case MouseCursor::CrosshairCursor: - c = [NSCursor crosshairCursor]; - break; + juce_free (bufList); + } + + return total; } - [c retain]; - return (void*) c; -} + CoreAudioIODeviceType (const CoreAudioIODeviceType&); + const CoreAudioIODeviceType& operator= (const CoreAudioIODeviceType&); +}; -void juce_deleteMouseCursor (void* const cursorHandle, const bool isStandard) throw() +AudioIODeviceType* juce_createDefaultAudioIODeviceType() { - NSCursor* c = (NSCursor*) cursorHandle; - [c release]; + return new CoreAudioIODeviceType(); } -void MouseCursor::showInAllWindows() const throw() -{ - showInWindow (0); -} +#undef log -void MouseCursor::showInWindow (ComponentPeer*) const throw() -{ - NSCursor* const c = (NSCursor*) getHandle(); +#endif +/********* End of inlined file: juce_mac_CoreAudio.cpp *********/ - if (c != 0) - [c set]; -} +/********* Start of inlined file: juce_mac_CoreMidi.cpp *********/ +// (This file gets included by juce_mac_NativeCode.mm, rather than being +// compiled on its own). +#ifdef JUCE_INCLUDED_FILE -Image* juce_createIconForFile (const File& file) +#undef log +#define log(a) Logger::writeToLog(a) + +static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) { - return 0; + if (err == noErr) + return true; + + log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + jassertfalse + return false; } -class MainMenuHandler; -static MainMenuHandler* mainMenu = 0; +#undef OK +#define OK(a) logAnyErrorsMidi(a, __LINE__) -class MainMenuHandler : private MenuBarModelListener, - private DeletedAtShutdown +static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) { -public: - MainMenuHandler() throw() - : currentModel (0) - { - } - - ~MainMenuHandler() throw() - { - setMenu (0); + String result; + CFStringRef str = 0; - jassert (mainMenu == this); - mainMenu = 0; - } + MIDIObjectGetStringProperty (endpoint, kMIDIPropertyName, &str); - void setMenu (MenuBarModel* const newMenuBarModel) throw() + if (str != 0) { - if (currentModel != newMenuBarModel) - { - if (currentModel != 0) - currentModel->removeListener (this); - - currentModel = newMenuBarModel; + result = PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + str = 0; + } - if (currentModel != 0) - currentModel->addListener (this); + MIDIEntityRef entity = 0; + MIDIEndpointGetEntity (endpoint, &entity); - menuBarItemsChanged (0); - } - } + if (entity == 0) + return result; // probably virtual - void menuBarItemsChanged (MenuBarModel*) + if (result.isEmpty()) { - ClearMenuBar(); + // endpoint name has zero length - try the entity + MIDIObjectGetStringProperty (entity, kMIDIPropertyName, &str); - if (currentModel != 0) + if (str != 0) { - int menuId = 1000; - const StringArray menuNames (currentModel->getMenuBarNames()); - - for (int i = 0; i < menuNames.size(); ++i) - { - const PopupMenu menu (currentModel->getMenuForIndex (i, menuNames [i])); - - MenuRef m = createMenu (menu, menuNames [i], menuId, i); - - InsertMenu (m, 0); - CFRelease (m); - } + result += PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + str = 0; } } - void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) + // now consider the device's name + MIDIDeviceRef device = 0; + MIDIEntityGetDevice (entity, &device); + if (device == 0) + return result; + + MIDIObjectGetStringProperty (device, kMIDIPropertyName, &str); + + if (str != 0) { - MenuRef menu = 0; - MenuItemIndex index = 0; - GetIndMenuItemWithCommandID (0, info.commandID, 1, &menu, &index); + const String s (PlatformUtilities::cfStringToJuceString (str)); + CFRelease (str); - if (menu != 0) + // if an external device has only one entity, throw away + // the endpoint name and just use the device name + if (isExternal && MIDIDeviceGetNumberOfEntities (device) < 2) + { + result = s; + } + else if (! result.startsWithIgnoreCase (s)) { - FlashMenuBar (GetMenuID (menu)); - FlashMenuBar (GetMenuID (menu)); + // prepend the device name to the entity name + result = (s + T(" ") + result).trimEnd(); } } - void invoke (const int commandId, ApplicationCommandManager* const commandManager, const int topLevelIndex) const - { - if (currentModel != 0) - { - if (commandManager != 0) - { - ApplicationCommandTarget::InvocationInfo info (commandId); - info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu; + return result; +} - commandManager->invoke (info, true); - } +static const String getConnectedEndpointName (MIDIEndpointRef endpoint) +{ + String result; - currentModel->menuItemSelected (commandId, topLevelIndex); - } - } + // Does the endpoint have connections? + CFDataRef connections = 0; + int numConnections = 0; - MenuBarModel* currentModel; + MIDIObjectGetDataProperty (endpoint, kMIDIPropertyConnectionUniqueID, &connections); -private: - static MenuRef createMenu (const PopupMenu menu, - const String& menuName, - int& id, - const int topLevelIndex) + if (connections != 0) { - MenuRef m = 0; + numConnections = CFDataGetLength (connections) / sizeof (MIDIUniqueID); - if (CreateNewMenu (id++, kMenuAttrAutoDisable, &m) == noErr) + if (numConnections > 0) { - CFStringRef name = PlatformUtilities::juceStringToCFString (menuName); - SetMenuTitleWithCFString (m, name); - CFRelease (name); - - PopupMenu::MenuItemIterator iter (menu); + const SInt32* pid = reinterpret_cast (CFDataGetBytePtr (connections)); - while (iter.next()) + for (int i = 0; i < numConnections; ++i, ++pid) { - MenuItemIndex index = 0; - - int flags = kMenuAttrAutoDisable | kMenuItemAttrIgnoreMeta | kMenuItemAttrNotPreviousAlternate; - if (! iter.isEnabled) - flags |= kMenuItemAttrDisabled; - - CFStringRef text = PlatformUtilities::juceStringToCFString (iter.itemName.upToFirstOccurrenceOf (T(""), false, true)); - - if (iter.isSeparator) - { - AppendMenuItemTextWithCFString (m, text, kMenuItemAttrSeparator, 0, &index); - } - else if (iter.isSectionHeader) - { - AppendMenuItemTextWithCFString (m, text, kMenuItemAttrSectionHeader, 0, &index); - } - else if (iter.subMenu != 0) - { - AppendMenuItemTextWithCFString (m, text, flags, id++, &index); + MIDIUniqueID uid = EndianS32_BtoN (*pid); + MIDIObjectRef connObject; + MIDIObjectType connObjectType; + OSStatus err = MIDIObjectFindByUniqueID (uid, &connObject, &connObjectType); - MenuRef sub = createMenu (*iter.subMenu, iter.itemName, id, topLevelIndex); - SetMenuItemHierarchicalMenu (m, index, sub); - CFRelease (sub); - } - else + if (err == noErr) { - AppendMenuItemTextWithCFString (m, text, flags, iter.itemId, &index); - - if (iter.isTicked) - CheckMenuItem (m, index, true); - - SetMenuItemProperty (m, index, 'juce', 'apcm', sizeof (void*), &iter.commandManager); - SetMenuItemProperty (m, index, 'juce', 'topi', sizeof (int), &topLevelIndex); + String s; - if (iter.commandManager != 0) + if (connObjectType == kMIDIObjectType_ExternalSource + || connObjectType == kMIDIObjectType_ExternalDestination) + { + // Connected to an external device's endpoint (10.3 and later). + s = getEndpointName (static_cast (connObject), true); + } + else { - const Array keyPresses (iter.commandManager->getKeyMappings() - ->getKeyPressesAssignedToCommand (iter.itemId)); + // Connected to an external device (10.2) (or something else, catch-all) + CFStringRef str = 0; + MIDIObjectGetStringProperty (connObject, kMIDIPropertyName, &str); - if (keyPresses.size() > 0) + if (str != 0) { - const KeyPress& kp = keyPresses.getReference(0); - int mods = 0; - - if (kp.getModifiers().isShiftDown()) - mods |= kMenuShiftModifier; - if (kp.getModifiers().isCtrlDown()) - mods |= kMenuControlModifier; - if (kp.getModifiers().isAltDown()) - mods |= kMenuOptionModifier; - if (! kp.getModifiers().isCommandDown()) - mods |= kMenuNoCommandModifier; - - tchar keyCode = (tchar) kp.getKeyCode(); - - if (kp.getKeyCode() >= KeyPress::numberPad0 - && kp.getKeyCode() <= KeyPress::numberPad9) - { - keyCode = (tchar) ((T('0') - KeyPress::numberPad0) + kp.getKeyCode()); - } - - SetMenuItemCommandKey (m, index, true, 255); - - if (CharacterFunctions::isLetterOrDigit (keyCode) - || CharacterFunctions::indexOfChar (T(",.;/\\'[]=-+_<>?{}\":"), keyCode, false) >= 0) - { - SetMenuItemModifiers (m, index, mods); - SetMenuItemCommandKey (m, index, false, CharacterFunctions::toUpperCase (keyCode)); - } - else - { - const SInt16 glyph = getGlyphForKeyCode (kp.getKeyCode()); + s = PlatformUtilities::cfStringToJuceString (str); + CFRelease (str); + } + } - if (glyph != 0) - { - SetMenuItemModifiers (m, index, mods); - SetMenuItemKeyGlyph (m, index, glyph); - } - } + if (s.isNotEmpty()) + { + if (result.isNotEmpty()) + result += (", "); - // if we set the key glyph to be a text char, and enable virtual - // key triggering, it stops the menu automatically triggering the callback - ChangeMenuItemAttributes (m, index, kMenuItemAttrUseVirtualKey, 0); - } + result += s; } } - - CFRelease (text); } } - return m; + CFRelease (connections); } - static SInt16 getGlyphForKeyCode (const int keyCode) throw() - { - if (keyCode == KeyPress::spaceKey) - return kMenuSpaceGlyph; - else if (keyCode == KeyPress::returnKey) - return kMenuReturnGlyph; - else if (keyCode == KeyPress::escapeKey) - return kMenuEscapeGlyph; - else if (keyCode == KeyPress::backspaceKey) - return kMenuDeleteLeftGlyph; - else if (keyCode == KeyPress::leftKey) - return kMenuLeftArrowGlyph; - else if (keyCode == KeyPress::rightKey) - return kMenuRightArrowGlyph; - else if (keyCode == KeyPress::upKey) - return kMenuUpArrowGlyph; - else if (keyCode == KeyPress::downKey) - return kMenuDownArrowGlyph; - else if (keyCode == KeyPress::pageUpKey) - return kMenuPageUpGlyph; - else if (keyCode == KeyPress::pageDownKey) - return kMenuPageDownGlyph; - else if (keyCode == KeyPress::endKey) - return kMenuSoutheastArrowGlyph; - else if (keyCode == KeyPress::homeKey) - return kMenuNorthwestArrowGlyph; - else if (keyCode == KeyPress::deleteKey) - return kMenuDeleteRightGlyph; - else if (keyCode == KeyPress::tabKey) - return kMenuTabRightGlyph; - else if (keyCode == KeyPress::F1Key) - return kMenuF1Glyph; - else if (keyCode == KeyPress::F2Key) - return kMenuF2Glyph; - else if (keyCode == KeyPress::F3Key) - return kMenuF3Glyph; - else if (keyCode == KeyPress::F4Key) - return kMenuF4Glyph; - else if (keyCode == KeyPress::F5Key) - return kMenuF5Glyph; - else if (keyCode == KeyPress::F6Key) - return kMenuF6Glyph; - else if (keyCode == KeyPress::F7Key) - return kMenuF7Glyph; - else if (keyCode == KeyPress::F8Key) - return kMenuF8Glyph; - else if (keyCode == KeyPress::F9Key) - return kMenuF9Glyph; - else if (keyCode == KeyPress::F10Key) - return kMenuF10Glyph; - else if (keyCode == KeyPress::F11Key) - return kMenuF11Glyph; - else if (keyCode == KeyPress::F12Key) - return kMenuF12Glyph; - else if (keyCode == KeyPress::F13Key) - return kMenuF13Glyph; - else if (keyCode == KeyPress::F14Key) - return kMenuF14Glyph; - else if (keyCode == KeyPress::F15Key) - return kMenuF15Glyph; + if (result.isNotEmpty()) + return result; - return 0; - } -}; + // Here, either the endpoint had no connections, or we failed to obtain names for any of them. + return getEndpointName (endpoint, false); +} -void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel) throw() +const StringArray MidiOutput::getDevices() { - if (getMacMainMenu() != newMenuBarModel) + StringArray s; + + const ItemCount num = MIDIGetNumberOfDestinations(); + for (ItemCount i = 0; i < num; ++i) { - if (newMenuBarModel == 0) + MIDIEndpointRef dest = MIDIGetDestination (i); + + if (dest != 0) { - delete mainMenu; - jassert (mainMenu == 0); // should be zeroed in the destructor + String name (getConnectedEndpointName (dest)); + + if (name.isEmpty()) + name = ""; + + s.add (name); } else { - if (mainMenu == 0) - mainMenu = new MainMenuHandler(); - - mainMenu->setMenu (newMenuBarModel); + s.add (""); } } -} -MenuBarModel* MenuBarModel::getMacMainMenu() throw() -{ - return mainMenu != 0 ? mainMenu->currentModel : 0; + return s; } -// these functions are called externally from the message handling code -void juce_MainMenuAboutToBeUsed() +int MidiOutput::getDefaultDeviceIndex() { - // force an update of the items just before the menu appears.. - if (mainMenu != 0) - mainMenu->menuBarItemsChanged (0); + return 0; } -void juce_InvokeMainMenuCommand (const HICommand& command) +static MIDIClientRef globalMidiClient; +static bool hasGlobalClientBeenCreated = false; + +static bool makeSureClientExists() { - if (mainMenu != 0) + if (! hasGlobalClientBeenCreated) { - ApplicationCommandManager* commandManager = 0; - int topLevelIndex = 0; + String name (T("JUCE")); - if (GetMenuItemProperty (command.menu.menuRef, command.menu.menuItemIndex, - 'juce', 'apcm', sizeof (commandManager), 0, &commandManager) == noErr - && GetMenuItemProperty (command.menu.menuRef, command.menu.menuItemIndex, - 'juce', 'topi', sizeof (topLevelIndex), 0, &topLevelIndex) == noErr) - { - mainMenu->invoke (command.commandID, commandManager, topLevelIndex); - } + if (JUCEApplication::getInstance() != 0) + name = JUCEApplication::getInstance()->getApplicationName(); + + CFStringRef appName = PlatformUtilities::juceStringToCFString (name); + + hasGlobalClientBeenCreated = OK (MIDIClientCreate (appName, 0, 0, &globalMidiClient)); + CFRelease (appName); } -} -void PlatformUtilities::beep() -{ - SysBeep (30); + return hasGlobalClientBeenCreated; } -void SystemClipboard::copyTextToClipboard (const String& text) throw() +struct MidiPortAndEndpoint { - ClearCurrentScrap(); - ScrapRef ref; - GetCurrentScrap (&ref); - - const int len = text.length(); - const int numBytes = sizeof (UniChar) * len; - UniChar* const temp = (UniChar*) juce_calloc (numBytes); + MIDIPortRef port; + MIDIEndpointRef endPoint; +}; - for (int i = 0; i < len; ++i) - temp[i] = (UniChar) text[i]; +MidiOutput* MidiOutput::openDevice (int index) +{ + MidiOutput* mo = 0; - PutScrapFlavor (ref, - kScrapFlavorTypeUnicode, - kScrapFlavorMaskNone, - numBytes, - temp); + if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfDestinations()) + { + MIDIEndpointRef endPoint = MIDIGetDestination (index); - juce_free (temp); -} + CFStringRef pname; + if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) + { + log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); -const String SystemClipboard::getTextFromClipboard() throw() -{ - String result; + if (makeSureClientExists()) + { + MIDIPortRef port; - ScrapRef ref; - GetCurrentScrap (&ref); - Size size = 0; + if (OK (MIDIOutputPortCreate (globalMidiClient, pname, &port))) + { + MidiPortAndEndpoint* mpe = new MidiPortAndEndpoint(); + mpe->port = port; + mpe->endPoint = endPoint; - if (GetScrapFlavorSize (ref, kScrapFlavorTypeUnicode, &size) == noErr - && size > 0) - { - void* const data = juce_calloc (size + 8); + mo = new MidiOutput(); + mo->internal = (void*)mpe; + } + } - if (GetScrapFlavorData (ref, kScrapFlavorTypeUnicode, &size, data) == noErr) - { - result = PlatformUtilities::convertUTF16ToString ((UniChar*) data); + CFRelease (pname); } - - juce_free (data); } - return result; + return mo; } -bool AlertWindow::showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel) +MidiOutput::~MidiOutput() { - Str255 tit, txt; - PlatformUtilities::copyToStr255 (tit, title); - PlatformUtilities::copyToStr255 (txt, bodyText); - - AlertStdAlertParamRec ar; - ar.movable = true; - ar.helpButton = false; - ar.filterProc = 0; - ar.defaultText = (const unsigned char*)-1; - ar.cancelText = (const unsigned char*)((isOkCancel) ? -1 : 0); - ar.otherText = 0; - ar.defaultButton = kAlertStdAlertOKButton; - ar.cancelButton = 0; - ar.position = kWindowDefaultPosition; - - SInt16 result; - StandardAlert (kAlertNoteAlert, tit, txt, &ar, &result); - return result == kAlertStdAlertOKButton; + MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; + MIDIPortDispose (mpe->port); + delete mpe; } -const int KeyPress::spaceKey = ' '; -const int KeyPress::returnKey = kReturnCharCode; -const int KeyPress::escapeKey = kEscapeCharCode; -const int KeyPress::backspaceKey = kBackspaceCharCode; -const int KeyPress::leftKey = kLeftArrowCharCode; -const int KeyPress::rightKey = kRightArrowCharCode; -const int KeyPress::upKey = kUpArrowCharCode; -const int KeyPress::downKey = kDownArrowCharCode; -const int KeyPress::pageUpKey = kPageUpCharCode; -const int KeyPress::pageDownKey = kPageDownCharCode; -const int KeyPress::endKey = kEndCharCode; -const int KeyPress::homeKey = kHomeCharCode; -const int KeyPress::deleteKey = kDeleteCharCode; -const int KeyPress::insertKey = -1; -const int KeyPress::tabKey = kTabCharCode; -const int KeyPress::F1Key = 0x10110; -const int KeyPress::F2Key = 0x10111; -const int KeyPress::F3Key = 0x10112; -const int KeyPress::F4Key = 0x10113; -const int KeyPress::F5Key = 0x10114; -const int KeyPress::F6Key = 0x10115; -const int KeyPress::F7Key = 0x10116; -const int KeyPress::F8Key = 0x10117; -const int KeyPress::F9Key = 0x10118; -const int KeyPress::F10Key = 0x10119; -const int KeyPress::F11Key = 0x1011a; -const int KeyPress::F12Key = 0x1011b; -const int KeyPress::F13Key = 0x1011c; -const int KeyPress::F14Key = 0x1011d; -const int KeyPress::F15Key = 0x1011e; -const int KeyPress::F16Key = 0x1011f; -const int KeyPress::numberPad0 = 0x30020; -const int KeyPress::numberPad1 = 0x30021; -const int KeyPress::numberPad2 = 0x30022; -const int KeyPress::numberPad3 = 0x30023; -const int KeyPress::numberPad4 = 0x30024; -const int KeyPress::numberPad5 = 0x30025; -const int KeyPress::numberPad6 = 0x30026; -const int KeyPress::numberPad7 = 0x30027; -const int KeyPress::numberPad8 = 0x30028; -const int KeyPress::numberPad9 = 0x30029; -const int KeyPress::numberPadAdd = 0x3002a; -const int KeyPress::numberPadSubtract = 0x3002b; -const int KeyPress::numberPadMultiply = 0x3002c; -const int KeyPress::numberPadDivide = 0x3002d; -const int KeyPress::numberPadSeparator = 0x3002e; -const int KeyPress::numberPadDecimalPoint = 0x3002f; -const int KeyPress::numberPadEquals = 0x30030; -const int KeyPress::numberPadDelete = 0x30031; -const int KeyPress::playKey = 0x30000; -const int KeyPress::stopKey = 0x30001; -const int KeyPress::fastForwardKey = 0x30002; -const int KeyPress::rewindKey = 0x30003; - -AppleRemoteDevice::AppleRemoteDevice() - : device (0), - queue (0), - remoteId (0) +void MidiOutput::reset() { } -AppleRemoteDevice::~AppleRemoteDevice() +bool MidiOutput::getVolume (float& leftVol, float& rightVol) { - stop(); + return false; } -static io_object_t getAppleRemoteDevice() throw() +void MidiOutput::setVolume (float leftVol, float rightVol) { - CFMutableDictionaryRef dict = IOServiceMatching ("AppleIRController"); +} - io_iterator_t iter = 0; - io_object_t iod = 0; +void MidiOutput::sendMessageNow (const MidiMessage& message) +{ + MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*)internal; - if (IOServiceGetMatchingServices (kIOMasterPortDefault, dict, &iter) == kIOReturnSuccess - && iter != 0) + if (message.isSysEx()) { - iod = IOIteratorNext (iter); + MIDIPacketList* const packets = (MIDIPacketList*) juce_malloc (32 + message.getRawDataSize()); + packets->numPackets = 1; + packets->packet[0].timeStamp = 0; + packets->packet[0].length = message.getRawDataSize(); + memcpy (packets->packet[0].data, message.getRawData(), message.getRawDataSize()); + + MIDISend (mpe->port, mpe->endPoint, packets); + juce_free (packets); } + else + { + MIDIPacketList packets; + packets.numPackets = 1; + packets.packet[0].timeStamp = 0; + packets.packet[0].length = message.getRawDataSize(); + *(int*) (packets.packet[0].data) = *(const int*) message.getRawData(); - IOObjectRelease (iter); - return iod; + MIDISend (mpe->port, mpe->endPoint, &packets); + } } -static bool createAppleRemoteInterface (io_object_t iod, void** device) throw() +const StringArray MidiInput::getDevices() { - jassert (*device == 0); - io_name_t classname; + StringArray s; - if (IOObjectGetClass (iod, classname) == kIOReturnSuccess) + const ItemCount num = MIDIGetNumberOfSources(); + for (ItemCount i = 0; i < num; ++i) { - IOCFPlugInInterface** cfPlugInInterface = 0; - SInt32 score = 0; + MIDIEndpointRef source = MIDIGetSource (i); - if (IOCreatePlugInInterfaceForService (iod, - kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, - &cfPlugInInterface, - &score) == kIOReturnSuccess) + if (source != 0) { - HRESULT hr = (*cfPlugInInterface)->QueryInterface (cfPlugInInterface, - CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), - device); + String name (getConnectedEndpointName (source)); - (void) hr; + if (name.isEmpty()) + name = ""; - (*cfPlugInInterface)->Release (cfPlugInInterface); + s.add (name); + } + else + { + s.add (""); } } - return *device != 0; + return s; } -bool AppleRemoteDevice::start (const bool inExclusiveMode) throw() +int MidiInput::getDefaultDeviceIndex() { - if (queue != 0) - return true; + return 0; +} - stop(); +struct MidiPortAndCallback +{ + MidiInput* input; + MIDIPortRef port; + MIDIEndpointRef endPoint; + MidiInputCallback* callback; + MemoryBlock pendingData; + int pendingBytes; + double pendingDataTime; + bool active; +}; - bool result = false; - io_object_t iod = getAppleRemoteDevice(); +static CriticalSection callbackLock; +static VoidArray activeCallbacks; - if (iod != 0) +static void processSysex (MidiPortAndCallback* const mpe, const uint8*& d, int& size, const double time) +{ + if (*d == 0xf0) { - if (createAppleRemoteInterface (iod, &device) && open (inExclusiveMode)) - result = true; - else - stop(); - - IOObjectRelease (iod); + mpe->pendingBytes = 0; + mpe->pendingDataTime = time; } - return result; -} + mpe->pendingData.ensureSize (mpe->pendingBytes + size, false); + uint8* totalMessage = (uint8*) mpe->pendingData.getData(); -void AppleRemoteDevice::stop() throw() -{ - if (queue != 0) + uint8* dest = totalMessage + mpe->pendingBytes; + + while (size > 0) { - (*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue); - (*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue); - (*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue); - queue = 0; + if (mpe->pendingBytes > 0 && *d >= 0x80) + { + if (*d >= 0xfa || *d == 0xf8) + { + mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time)); + ++d; + --size; + } + else + { + if (*d == 0xf7) + { + *dest++ = *d++; + mpe->pendingBytes++; + --size; + } + + break; + } + } + else + { + *dest++ = *d++; + mpe->pendingBytes++; + --size; + } } - if (device != 0) + if (totalMessage [mpe->pendingBytes - 1] == 0xf7) { - (*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device); - (*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device); - device = 0; + mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (totalMessage, + mpe->pendingBytes, + mpe->pendingDataTime)); + mpe->pendingBytes = 0; + } + else + { + mpe->callback->handlePartialSysexMessage (mpe->input, + totalMessage, + mpe->pendingBytes, + mpe->pendingDataTime); } } -bool AppleRemoteDevice::isActive() const throw() -{ - return queue != 0; -} - -static void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*) +static void midiInputProc (const MIDIPacketList* pktlist, + void* readProcRefCon, + void* srcConnRefCon) { - if (result == kIOReturnSuccess) - ((AppleRemoteDevice*) target)->handleCallbackInternal(); -} + double time = Time::getMillisecondCounterHiRes() * 0.001; + const double originalTime = time; -bool AppleRemoteDevice::open (const bool openInExclusiveMode) throw() -{ -#if ! MACOS_10_2_OR_EARLIER - Array cookies; + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) readProcRefCon; + const ScopedLock sl (callbackLock); - CFArrayRef elements; - IOHIDDeviceInterface122** const device122 = (IOHIDDeviceInterface122**) device; + if (activeCallbacks.contains (mpe) && mpe->active) + { + const MIDIPacket* packet = &pktlist->packet[0]; - if ((*device122)->copyMatchingElements (device122, 0, &elements) != kIOReturnSuccess) - return false; + for (unsigned int i = 0; i < pktlist->numPackets; ++i) + { + const uint8* d = (const uint8*) (packet->data); + int size = packet->length; - for (int i = 0; i < CFArrayGetCount (elements); ++i) - { - CFDictionaryRef element = (CFDictionaryRef) CFArrayGetValueAtIndex (elements, i); + while (size > 0) + { + time = originalTime; - // get the cookie - CFTypeRef object = CFDictionaryGetValue (element, CFSTR (kIOHIDElementCookieKey)); + if (mpe->pendingBytes > 0 || d[0] == 0xf0) + { + processSysex (mpe, d, size, time); + } + else + { + int used = 0; + const MidiMessage m (d, size, used, 0, time); - if (object == 0 || CFGetTypeID (object) != CFNumberGetTypeID()) - continue; + if (used <= 0) + { + jassertfalse // malformed midi message + break; + } + else + { + mpe->callback->handleIncomingMidiMessage (mpe->input, m); + } - long number; - if (! CFNumberGetValue ((CFNumberRef) object, kCFNumberLongType, &number)) - continue; + size -= used; + d += used; + } + } - cookies.add ((int) number); + packet = MIDIPacketNext (packet); + } } +} - CFRelease (elements); +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) +{ + MidiInput* mi = 0; - if ((*(IOHIDDeviceInterface**) device) - ->open ((IOHIDDeviceInterface**) device, - openInExclusiveMode ? kIOHIDOptionsTypeSeizeDevice - : kIOHIDOptionsTypeNone) == KERN_SUCCESS) + if (((unsigned int) index) < (unsigned int) MIDIGetNumberOfSources()) { - queue = (*(IOHIDDeviceInterface**) device)->allocQueue ((IOHIDDeviceInterface**) device); + MIDIEndpointRef endPoint = MIDIGetSource (index); - if (queue != 0) + if (endPoint != 0) { - (*(IOHIDQueueInterface**) queue)->create ((IOHIDQueueInterface**) queue, 0, 12); + CFStringRef pname; - for (int i = 0; i < cookies.size(); ++i) + if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - IOHIDElementCookie cookie = (IOHIDElementCookie) cookies.getUnchecked(i); - (*(IOHIDQueueInterface**) queue)->addElement ((IOHIDQueueInterface**) queue, cookie, 0); - } - - CFRunLoopSourceRef eventSource; + log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); - if ((*(IOHIDQueueInterface**) queue) - ->createAsyncEventSource ((IOHIDQueueInterface**) queue, &eventSource) == KERN_SUCCESS) - { - if ((*(IOHIDQueueInterface**) queue)->setEventCallout ((IOHIDQueueInterface**) queue, - appleRemoteQueueCallback, this, 0) == KERN_SUCCESS) + if (makeSureClientExists()) { - CFRunLoopAddSource (CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode); + MIDIPortRef port; - (*(IOHIDQueueInterface**) queue)->start ((IOHIDQueueInterface**) queue); + MidiPortAndCallback* const mpe = new MidiPortAndCallback(); + mpe->active = false; - return true; + if (OK (MIDIInputPortCreate (globalMidiClient, pname, midiInputProc, mpe, &port))) + { + if (OK (MIDIPortConnectSource (port, endPoint, 0))) + { + mpe->port = port; + mpe->endPoint = endPoint; + mpe->callback = callback; + mpe->pendingBytes = 0; + mpe->pendingData.ensureSize (128); + + mi = new MidiInput (getDevices() [index]); + mpe->input = mi; + mi->internal = (void*) mpe; + + const ScopedLock sl (callbackLock); + activeCallbacks.add (mpe); + } + else + { + OK (MIDIPortDispose (port)); + delete mpe; + } + } + else + { + delete mpe; + } } } + + CFRelease (pname); } } -#endif - return false; + return mi; } -void AppleRemoteDevice::handleCallbackInternal() +MidiInput::MidiInput (const String& name_) + : name (name_) { - int totalValues = 0; - AbsoluteTime nullTime = { 0, 0 }; - char cookies [12]; - int numCookies = 0; +} - while (numCookies < numElementsInArray (cookies)) - { - IOHIDEventStruct e; +MidiInput::~MidiInput() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + mpe->active = false; - if ((*(IOHIDQueueInterface**) queue)->getNextEvent ((IOHIDQueueInterface**) queue, &e, nullTime, 0) != kIOReturnSuccess) - break; + callbackLock.enter(); + activeCallbacks.removeValue (mpe); + callbackLock.exit(); - if ((int) e.elementCookie == 19) - { - remoteId = e.value; - buttonPressed (switched, false); - } - else - { - totalValues += e.value; - cookies [numCookies++] = (char) (pointer_sized_int) e.elementCookie; - } - } + OK (MIDIPortDisconnectSource (mpe->port, mpe->endPoint)); + OK (MIDIPortDispose (mpe->port)); + delete mpe; +} - cookies [numCookies++] = 0; +void MidiInput::start() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + const ScopedLock sl (callbackLock); + mpe->active = true; +} - static const char buttonPatterns[] = - { - 14, 7, 6, 5, 14, 7, 6, 5, 0, - 14, 8, 6, 5, 14, 8, 6, 5, 0, - 14, 12, 11, 6, 5, 0, - 14, 13, 11, 6, 5, 0, - 14, 9, 6, 5, 14, 9, 6, 5, 0, - 14, 10, 6, 5, 14, 10, 6, 5, 0, - 14, 6, 5, 4, 2, 0, - 14, 6, 5, 3, 2, 0, - 14, 6, 5, 14, 6, 5, 0, - 18, 14, 6, 5, 18, 14, 6, 5, 0, - 19, 0 - }; +void MidiInput::stop() +{ + MidiPortAndCallback* const mpe = (MidiPortAndCallback*) internal; + const ScopedLock sl (callbackLock); + mpe->active = false; +} - int buttonNum = (int) menuButton; - int i = 0; +#undef log - while (i < numElementsInArray (buttonPatterns)) - { - if (strcmp (cookies, buttonPatterns + i) == 0) - { - buttonPressed ((ButtonType) buttonNum, totalValues > 0); - break; - } +#endif +/********* End of inlined file: juce_mac_CoreMidi.cpp *********/ - i += strlen (buttonPatterns + i) + 1; - ++buttonNum; - } -} +#endif -#if JUCE_OPENGL +END_JUCE_NAMESPACE +/********* End of inlined file: juce_mac_NativeCode.mm *********/ -class WindowedGLContext : public OpenGLContext -{ -public: - WindowedGLContext (Component* const component, - const OpenGLPixelFormat& pixelFormat_, - AGLContext sharedContext) - : renderContext (0), - pixelFormat (pixelFormat_) - { - jassert (component != 0); +/********* Start of inlined file: juce_mac_NamedPipe.cpp *********/ - HIViewComponentPeer* const peer = dynamic_cast (component->getTopLevelComponent()->getPeer()); - if (peer == 0) - return; +#include +#include +#include - GLint attribs [64]; - int n = 0; - attribs[n++] = AGL_RGBA; - attribs[n++] = AGL_DOUBLEBUFFER; - attribs[n++] = AGL_ACCELERATED; - attribs[n++] = AGL_RED_SIZE; - attribs[n++] = pixelFormat.redBits; - attribs[n++] = AGL_GREEN_SIZE; - attribs[n++] = pixelFormat.greenBits; - attribs[n++] = AGL_BLUE_SIZE; - attribs[n++] = pixelFormat.blueBits; - attribs[n++] = AGL_ALPHA_SIZE; - attribs[n++] = pixelFormat.alphaBits; - attribs[n++] = AGL_DEPTH_SIZE; - attribs[n++] = pixelFormat.depthBufferBits; - attribs[n++] = AGL_STENCIL_SIZE; - attribs[n++] = pixelFormat.stencilBufferBits; - attribs[n++] = AGL_ACCUM_RED_SIZE; - attribs[n++] = pixelFormat.accumulationBufferRedBits; - attribs[n++] = AGL_ACCUM_GREEN_SIZE; - attribs[n++] = pixelFormat.accumulationBufferGreenBits; - attribs[n++] = AGL_ACCUM_BLUE_SIZE; - attribs[n++] = pixelFormat.accumulationBufferBlueBits; - attribs[n++] = AGL_ACCUM_ALPHA_SIZE; - attribs[n++] = pixelFormat.accumulationBufferAlphaBits; +// As well as being for the mac, this file is included by the linux build. - // xxx not sure how to do fullSceneAntiAliasingNumSamples.. +#if ! JUCE_MAC + #include + #include + #include +#endif - attribs[n++] = AGL_SAMPLE_BUFFERS_ARB; - attribs[n++] = 1; - attribs[n++] = AGL_SAMPLES_ARB; - attribs[n++] = 4; - attribs[n++] = AGL_CLOSEST_POLICY; - attribs[n++] = AGL_NO_RECOVERY; - attribs[n++] = AGL_NONE; +BEGIN_JUCE_NAMESPACE - renderContext = aglCreateContext (aglChoosePixelFormat (0, 0, attribs), - sharedContext); +struct NamedPipeInternal +{ + String pipeInName, pipeOutName; + int pipeIn, pipeOut; - aglSetDrawable (renderContext, GetWindowPort (peer->windowRef)); - } + bool volatile createdPipe, blocked, stopReadOperation; - ~WindowedGLContext() - { - makeInactive(); - aglSetDrawable (renderContext, 0); - aglDestroyContext (renderContext); - } + static void signalHandler (int) {} +}; - bool makeActive() const throw() +void NamedPipe::cancelPendingReads() +{ + while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) { - jassert (renderContext != 0); + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - return aglSetCurrentContext (renderContext); - } + intern->stopReadOperation = true; - bool makeInactive() const throw() - { - return (! isActive()) || aglSetCurrentContext (0); - } + char buffer [1] = { 0 }; + ::write (intern->pipeIn, buffer, 1); - bool isActive() const throw() - { - return aglGetCurrentContext() == renderContext; - } + int timeout = 2000; + while (intern->blocked && --timeout >= 0) + Thread::sleep (2); - const OpenGLPixelFormat getPixelFormat() const - { - return pixelFormat; + intern->stopReadOperation = false; } +} - void* getRawContext() const throw() - { - return renderContext; - } +void NamedPipe::close() +{ + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - void updateWindowPosition (int x, int y, int w, int h, int outerWindowHeight) + if (intern != 0) { - GLint bufferRect[4]; - bufferRect[0] = x; - bufferRect[1] = outerWindowHeight - (y + h); - bufferRect[2] = w; - bufferRect[3] = h; + internal = 0; - aglSetInteger (renderContext, AGL_BUFFER_RECT, bufferRect); - aglEnable (renderContext, AGL_BUFFER_RECT); - } + if (intern->pipeIn != -1) + ::close (intern->pipeIn); - void swapBuffers() - { - aglSwapBuffers (renderContext); - } + if (intern->pipeOut != -1) + ::close (intern->pipeOut); - bool setSwapInterval (const int numFramesPerSwap) - { - return aglSetInteger (renderContext, AGL_SWAP_INTERVAL, (const GLint*) &numFramesPerSwap); + if (intern->createdPipe) + { + unlink (intern->pipeInName); + unlink (intern->pipeOutName); + } + + delete intern; } +} - int getSwapInterval() const +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) { - GLint numFrames = 0; - aglGetInteger (renderContext, AGL_SWAP_INTERVAL, &numFrames); - return numFrames; + if ((mkfifo (intern->pipeInName, 0666) && errno != EEXIST) + || (mkfifo (intern->pipeOutName, 0666) && errno != EEXIST)) + { + delete intern; + internal = 0; + + return false; + } } - void repaint() + 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; - juce_UseDebuggingNewOperator + if (intern->pipeIn == -1) + { + if (intern->createdPipe) + intern->pipeIn = ::open (intern->pipeInName, O_RDWR); + else + intern->pipeIn = ::open (intern->pipeOutName, O_RDWR); - AGLContext renderContext; + if (intern->pipeIn == -1) + { + intern->blocked = false; + return -1; + } + } -private: - OpenGLPixelFormat pixelFormat; + bytesRead = 0; - WindowedGLContext (const WindowedGLContext&); - const WindowedGLContext& operator= (const WindowedGLContext&); -}; + char* p = (char*) destBuffer; -OpenGLContext* OpenGLContext::createContextForWindow (Component* const component, - const OpenGLPixelFormat& pixelFormat, - const OpenGLContext* const contextToShareWith) -{ - WindowedGLContext* c = new WindowedGLContext (component, pixelFormat, - contextToShareWith != 0 ? (AGLContext) contextToShareWith->getRawContext() : 0); + while (bytesRead < maxBytesToRead) + { + const int bytesThisTime = maxBytesToRead - bytesRead; + const int numRead = ::read (intern->pipeIn, p, bytesThisTime); - if (c->renderContext == 0) - deleteAndZero (c); + if (numRead <= 0 || intern->stopReadOperation) + { + bytesRead = -1; + break; + } - return c; -} + bytesRead += numRead; + p += bytesRead; + } -void juce_glViewport (const int w, const int h) -{ - glViewport (0, 0, w, h); -} + intern->blocked = false; + } -static int getAGLAttribute (AGLPixelFormat p, const GLint attrib) -{ - GLint result = 0; - aglDescribePixelFormat (p, attrib, &result); - return result; + return bytesRead; } -void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, - OwnedArray & results) +int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) { - GLint attribs [64]; - int n = 0; - attribs[n++] = AGL_RGBA; - attribs[n++] = AGL_DOUBLEBUFFER; - attribs[n++] = AGL_ACCELERATED; - attribs[n++] = AGL_NO_RECOVERY; - attribs[n++] = AGL_NONE; - - AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); + int bytesWritten = -1; + NamedPipeInternal* const intern = (NamedPipeInternal*) internal; - while (p != 0) + if (intern != 0) { - OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); - pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); - pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); - pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); - pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); - pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); - pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); - pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); - pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); - pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); - pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); + if (intern->pipeOut == -1) + { + if (intern->createdPipe) + intern->pipeOut = ::open (intern->pipeOutName, O_WRONLY); + else + intern->pipeOut = ::open (intern->pipeInName, O_WRONLY); - results.add (pf); + if (intern->pipeOut == -1) + { + return -1; + } + } - p = aglNextPixelFormat (p); + 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; + } } -} -#endif + return bytesWritten; +} END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_Windowing.mm *********/ - -#endif +/********* End of inlined file: juce_mac_NamedPipe.cpp *********/ #endif diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 91be5ad365..d2d32d1689 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__ +#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. @@ -196,12 +196,16 @@ /** Enabling this builds support for VST audio plugins. @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU */ -//#define JUCE_PLUGINHOST_VST 1 +#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 */ -#define JUCE_PLUGINHOST_AU 1 +#ifndef JUCE_PLUGINHOST_AU +// #define JUCE_PLUGINHOST_AU 1 +#endif /** Disabling this will avoid linking to any UI code. This is handy for writing command-line utilities, e.g. on linux boxes which don't have some @@ -213,6 +217,36 @@ #define JUCE_BUILD_GUI_CLASSES 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 + +/* 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). @@ -334,6 +368,10 @@ #if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4) #define MACOS_10_3_OR_EARLIER 1 #endif + + #if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) + #define MACOS_10_4_OR_EARLIER 1 + #endif #endif #if JUCE_LINUX @@ -2471,2014 +2509,1273 @@ BEGIN_JUCE_NAMESPACE #ifndef __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ #define __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ -#ifndef __JUCE_ATOMIC_JUCEHEADER__ +#ifndef __JUCE_SINGLETON_JUCEHEADER__ -/********* Start of inlined file: juce_Atomic.h *********/ -#ifndef __JUCE_ATOMIC_JUCEHEADER__ -#define __JUCE_ATOMIC_JUCEHEADER__ +/********* Start of inlined file: juce_Singleton.h *********/ +#ifndef __JUCE_SINGLETON_JUCEHEADER__ +#define __JUCE_SINGLETON_JUCEHEADER__ -// Atomic increment/decrement operations.. +/********* Start of inlined file: juce_ScopedLock.h *********/ +#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ +#define __JUCE_SCOPEDLOCK_JUCEHEADER__ -#if JUCE_MAC && ! DOXYGEN +/********* Start of inlined file: juce_CriticalSection.h *********/ +#ifndef __JUCE_CRITICALSECTION_JUCEHEADER__ +#define __JUCE_CRITICALSECTION_JUCEHEADER__ - #if ! MACOS_10_3_OR_EARLIER +/** + Prevents multiple threads from accessing shared objects at the same time. - forcedinline void atomicIncrement (int& variable) throw() { OSAtomicIncrement32 ((int32_t*) &variable); } - forcedinline int atomicIncrementAndReturn (int& variable) throw() { return OSAtomicIncrement32 ((int32_t*) &variable); } - forcedinline void atomicDecrement (int& variable) throw() { OSAtomicDecrement32 ((int32_t*) &variable); } - forcedinline int atomicDecrementAndReturn (int& variable) throw() { return OSAtomicDecrement32 ((int32_t*) &variable); } - #else + @see ScopedLock, Thread, InterProcessLock +*/ +class JUCE_API CriticalSection +{ +public: - forcedinline void atomicIncrement (int& variable) throw() { OTAtomicAdd32 (1, (SInt32*) &variable); } - forcedinline int atomicIncrementAndReturn (int& variable) throw() { return OTAtomicAdd32 (1, (SInt32*) &variable); } - forcedinline void atomicDecrement (int& variable) throw() { OTAtomicAdd32 (-1, (SInt32*) &variable); } - forcedinline int atomicDecrementAndReturn (int& variable) throw() { return OTAtomicAdd32 (-1, (SInt32*) &variable); } - #endif + /** + Creates a CriticalSection object + */ + CriticalSection() throw(); -#elif JUCE_GCC + /** Destroys a CriticalSection object. - #if JUCE_USE_GCC_ATOMIC_INTRINSICS - forcedinline void atomicIncrement (int& variable) throw() { __sync_add_and_fetch (&variable, 1); } - forcedinline int atomicIncrementAndReturn (int& variable) throw() { return __sync_add_and_fetch (&variable, 1); } - forcedinline void atomicDecrement (int& variable) throw() { __sync_add_and_fetch (&variable, -1); } - forcedinline int atomicDecrementAndReturn (int& variable) throw() { return __sync_add_and_fetch (&variable, -1); } - #else + If the critical section is deleted whilst locked, its subsequent behaviour + is unpredictable. + */ + ~CriticalSection() throw(); - /** Increments an integer in a thread-safe way. */ - forcedinline void atomicIncrement (int& variable) throw() - { - __asm__ __volatile__ ( - #if JUCE_64BIT - "lock incl (%%rax)" - : - : "a" (&variable) - : "cc", "memory"); - #else - "lock incl %0" - : "=m" (variable) - : "m" (variable)); - #endif - } + /** Locks this critical section. - /** Increments an integer in a thread-safe way and returns the incremented value. */ - forcedinline int atomicIncrementAndReturn (int& variable) throw() - { - int result; + If the lock is currently held by another thread, this will wait until it + becomes free. - __asm__ __volatile__ ( - #if JUCE_64BIT - "lock xaddl %%ebx, (%%rax) \n\ - incl %%ebx" - : "=b" (result) - : "a" (&variable), "b" (1) - : "cc", "memory"); - #else - "lock xaddl %%eax, (%%ecx) \n\ - incl %%eax" - : "=a" (result) - : "c" (&variable), "a" (1) - : "memory"); - #endif + If the lock is already held by the caller thread, the method returns immediately. - return result; - } + @see exit, ScopedLock + */ + void enter() const throw(); - /** Decrememts an integer in a thread-safe way. */ - forcedinline void atomicDecrement (int& variable) throw() - { - __asm__ __volatile__ ( - #if JUCE_64BIT - "lock decl (%%rax)" - : - : "a" (&variable) - : "cc", "memory"); - #else - "lock decl %0" - : "=m" (variable) - : "m" (variable)); - #endif - } + /** Attempts to lock this critical section without blocking. - /** Decrememts an integer in a thread-safe way and returns the incremented value. */ - forcedinline int atomicDecrementAndReturn (int& variable) throw() - { - int result; + This method behaves identically to CriticalSection::enter, except that the caller thread + does not wait if the lock is currently held by another thread but returns false immediately. - __asm__ __volatile__ ( - #if JUCE_64BIT - "lock xaddl %%ebx, (%%rax) \n\ - decl %%ebx" - : "=b" (result) - : "a" (&variable), "b" (-1) - : "cc", "memory"); - #else - "lock xaddl %%eax, (%%ecx) \n\ - decl %%eax" - : "=a" (result) - : "c" (&variable), "a" (-1) - : "memory"); - #endif - return result; - } - #endif + @returns false if the lock is currently held by another thread, true otherwise. + @see enter + */ + bool tryEnter() const throw(); -#elif JUCE_USE_INTRINSICS + /** Releases the lock. - #pragma intrinsic (_InterlockedIncrement) - #pragma intrinsic (_InterlockedDecrement) + If the caller thread hasn't got the lock, this can have unpredictable results. - /** Increments an integer in a thread-safe way. */ - forcedinline void __fastcall atomicIncrement (int& variable) throw() - { - _InterlockedIncrement (reinterpret_cast (&variable)); - } + If the enter() method has been called multiple times by the thread, each + call must be matched by a call to exit() before other threads will be allowed + to take over the lock. - /** Increments an integer in a thread-safe way and returns the incremented value. */ - forcedinline int __fastcall atomicIncrementAndReturn (int& variable) throw() - { - return _InterlockedIncrement (reinterpret_cast (&variable)); - } + @see enter, ScopedLock + */ + void exit() const throw(); - /** Decrememts an integer in a thread-safe way. */ - forcedinline void __fastcall atomicDecrement (int& variable) throw() - { - _InterlockedDecrement (reinterpret_cast (&variable)); - } + juce_UseDebuggingNewOperator - /** Decrememts an integer in a thread-safe way and returns the incremented value. */ - forcedinline int __fastcall atomicDecrementAndReturn (int& variable) throw() - { - return _InterlockedDecrement (reinterpret_cast (&variable)); - } +private: + +#if JUCE_WIN32 + #if JUCE_64BIT + // To avoid including windows.h in the public Juce includes, we'll just allocate a + // block of memory here that's big enough to be used internally as a windows critical + // section object. + uint8 internal [44]; + #else + uint8 internal [24]; + #endif #else + mutable pthread_mutex_t internal; +#endif - /** Increments an integer in a thread-safe way. */ - forcedinline void __fastcall atomicIncrement (int& variable) throw() - { - __asm { - mov ecx, dword ptr [variable] - lock inc dword ptr [ecx] - } - } + CriticalSection (const CriticalSection&); + const CriticalSection& operator= (const CriticalSection&); +}; - /** Increments an integer in a thread-safe way and returns the incremented value. */ - forcedinline int __fastcall atomicIncrementAndReturn (int& variable) throw() - { - int result; +/** + A class that can be used in place of a real CriticalSection object. - __asm { - mov ecx, dword ptr [variable] - mov eax, 1 - lock xadd dword ptr [ecx], eax - inc eax - mov result, eax - } + This is currently used by some templated array classes, and should get + optimised out by the compiler. - return result; - } + @see Array, OwnedArray, ReferenceCountedArray +*/ +class JUCE_API DummyCriticalSection +{ +public: + forcedinline DummyCriticalSection() throw() {} + forcedinline ~DummyCriticalSection() throw() {} - /** Decrememts an integer in a thread-safe way. */ - forcedinline void __fastcall atomicDecrement (int& variable) throw() - { - __asm { - mov ecx, dword ptr [variable] - lock dec dword ptr [ecx] - } - } + forcedinline void enter() const throw() {} + forcedinline void exit() const throw() {} +}; - /** Decrememts an integer in a thread-safe way and returns the incremented value. */ - forcedinline int __fastcall atomicDecrementAndReturn (int& variable) throw() +#endif // __JUCE_CRITICALSECTION_JUCEHEADER__ +/********* End of inlined file: juce_CriticalSection.h *********/ + +/** + Automatically locks and unlocks a CriticalSection object. + + Use one of these as a local variable to control access to a CriticalSection. + + e.g. @code + + CriticalSection myCriticalSection; + + for (;;) { - int result; + const ScopedLock myScopedLock (myCriticalSection); + // myCriticalSection is now locked - __asm { - mov ecx, dword ptr [variable] - mov eax, -1 - lock xadd dword ptr [ecx], eax - dec eax - mov result, eax - } + ...do some stuff... - return result; + // myCriticalSection gets unlocked here. } -#endif + @endcode -#endif // __JUCE_ATOMIC_JUCEHEADER__ -/********* End of inlined file: juce_Atomic.h *********/ + @see CriticalSection, ScopedUnlock +*/ +class JUCE_API ScopedLock +{ +public: -#endif -#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ + /** Creates a ScopedLock. -#endif -#ifndef __JUCE_FILELOGGER_JUCEHEADER__ + As soon as it is created, this will lock the CriticalSection, and + when the ScopedLock object is deleted, the CriticalSection will + be unlocked. -/********* Start of inlined file: juce_FileLogger.h *********/ -#ifndef __JUCE_FILELOGGER_JUCEHEADER__ -#define __JUCE_FILELOGGER_JUCEHEADER__ + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! Best just to use it + as a local stack object, rather than creating one with the new() operator. + */ + inline ScopedLock (const CriticalSection& lock) throw() : lock_ (lock) { lock.enter(); } -/********* Start of inlined file: juce_File.h *********/ -#ifndef __JUCE_FILE_JUCEHEADER__ -#define __JUCE_FILE_JUCEHEADER__ + /** Destructor. -/********* Start of inlined file: juce_OwnedArray.h *********/ -#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ -#define __JUCE_OWNEDARRAY_JUCEHEADER__ + The CriticalSection will be unlocked when the destructor is called. -/********* Start of inlined file: juce_ArrayAllocationBase.h *********/ -#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ -#define __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! + */ + inline ~ScopedLock() throw() { lock_.exit(); } -/** The default size of chunk in which arrays increase their storage. +private: - Used by ArrayAllocationBase and its subclasses. -*/ -const int juceDefaultArrayGranularity = 8; + const CriticalSection& lock_; + + ScopedLock (const ScopedLock&); + const ScopedLock& operator= (const ScopedLock&); +}; /** - Implements some basic array storage allocation functions. + Automatically unlocks and re-locks a CriticalSection object. - This class isn't really for public use - it's used by the other - array classes, but might come in handy for some purposes. + This is the reverse of a ScopedLock object - instead of locking the critical + section for the lifetime of this object, it unlocks it. - @see Array, OwnedArray, ReferenceCountedArray -*/ -template -class ArrayAllocationBase -{ -protected: + Make sure you don't try to unlock critical sections that aren't actually locked! - /** Creates an empty array. + e.g. @code - @param granularity_ this is the size of increment by which the internal storage - will be increased. - */ - ArrayAllocationBase (const int granularity_) throw() - : elements (0), - numAllocated (0), - granularity (granularity_) - { - } + CriticalSection myCriticalSection; - /** Destructor. */ - ~ArrayAllocationBase() throw() + for (;;) { - delete[] elements; - } - - /** Changes the amount of storage allocated. + const ScopedLock myScopedLock (myCriticalSection); + // myCriticalSection is now locked - This will retain any data currently held in the array, and either add or - remove extra space at the end. + ... do some stuff with it locked .. - @param numElements the number of elements that are needed - */ - void setAllocatedSize (const int numElements) throw() - { - if (numAllocated != numElements) + while (xyz) { - if (numElements > 0) - { - ElementType* const newElements = new ElementType [numElements]; - - const int itemsToRetain = jmin (numElements, numAllocated); - - for (int i = 0; i < itemsToRetain; ++i) - newElements[i] = elements[i]; + ... do some stuff with it locked .. - delete[] elements; - elements = newElements; + const ScopedUnlock unlocker (myCriticalSection); - } - else if (elements != 0) - { - delete[] elements; - elements = 0; - } + // myCriticalSection is now unlocked for the remainder of this block, + // and re-locked at the end. - numAllocated = numElements; + ...do some stuff with it unlocked ... } + + // myCriticalSection gets unlocked here. } + @endcode - /** Increases the amount of storage allocated if it is less than a given amount. + @see CriticalSection, ScopedLock +*/ +class ScopedUnlock +{ +public: - This will retain any data currently held in the array, but will add - extra space at the end to make sure there it's at least as big as the size - passed in. If it's already bigger, no action is taken. + /** Creates a ScopedUnlock. - @param minNumElements the minimum number of elements that are needed + As soon as it is created, this will unlock the CriticalSection, and + when the ScopedLock object is deleted, the CriticalSection will + be re-locked. + + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! Best just to use it + as a local stack object, rather than creating one with the new() operator. */ - void ensureAllocatedSize (int minNumElements) throw() - { - if (minNumElements > numAllocated) - { - // for arrays with small granularity that get big, start - // increasing the size in bigger jumps - if (minNumElements > (granularity << 6)) - { - minNumElements += (minNumElements / granularity); - if (minNumElements > (granularity << 8)) - minNumElements += granularity << 6; - else - minNumElements += granularity << 5; - } + inline ScopedUnlock (const CriticalSection& lock) throw() : lock_ (lock) { lock.exit(); } - setAllocatedSize (granularity * (minNumElements / granularity + 1)); - } - } + /** Destructor. - ElementType* elements; - int numAllocated, granularity; + The CriticalSection will be unlocked when the destructor is called. + + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! + */ + inline ~ScopedUnlock() throw() { lock_.enter(); } private: - ArrayAllocationBase (const ArrayAllocationBase&); - const ArrayAllocationBase& operator= (const ArrayAllocationBase&); -}; -#endif // __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ -/********* End of inlined file: juce_ArrayAllocationBase.h *********/ + const CriticalSection& lock_; -/********* Start of inlined file: juce_ElementComparator.h *********/ -#ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ -#define __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ + ScopedUnlock (const ScopedLock&); + const ScopedUnlock& operator= (const ScopedUnlock&); +}; + +#endif // __JUCE_SCOPEDLOCK_JUCEHEADER__ +/********* End of inlined file: juce_ScopedLock.h *********/ /** - Sorts a range of elements in an array. + Macro to declare member variables and methods for a singleton class. - The comparator object that is passed-in must define a public method with the following - signature: - @code - int compareElements (ElementType first, ElementType second); - @endcode + To use this, add the line juce_DeclareSingleton (MyClass, allowOnlyOneInstance) + to the class's definition. - ..and this method must return: - - a value of < 0 if the first comes before the second - - a value of 0 if the two objects are equivalent - - a value of > 0 if the second comes before the first + If allowOnlyOneInstance == true, it won't allow the object to be created + more than once in the process's lifetime. - To improve performance, the compareElements() method can be declared as static or const. + Then put a macro juce_ImplementSingleton (MyClass) along with the class's + implementation code. - @param comparator an object which defines a compareElements() method - @param array the array to sort - @param firstElement the index of the first element of the range to be sorted - @param lastElement the index of the last element in the range that needs - sorting (this is inclusive) - @param retainOrderOfEquivalentItems if true, the order of items that the - comparator deems the same will be maintained - this will be - a slower algorithm than if they are allowed to be moved around. + Clients can then call the static MyClass::getInstance() to get a pointer to the + singleton, or MyClass::getInstanceWithoutCreating() which may return 0 if no instance + is currently extant - @see sortArrayRetainingOrder -*/ -template -static void sortArray (ElementComparator& comparator, - ElementType* const array, - int firstElement, - int lastElement, - const bool retainOrderOfEquivalentItems) -{ - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + it's a very good idea to also add the call clearSingletonInstance() to the + destructor of the class, in case it is deleted by other means than deleteInstance() - if (lastElement > firstElement) - { - if (retainOrderOfEquivalentItems) + e.g. @code + + class MySingleton { - for (int i = firstElement; i < lastElement; ++i) + public: + MySingleton() { - if (comparator.compareElements (array[i], array [i + 1]) > 0) - { - const ElementType temp = array [i]; - array [i] = array[i + 1]; - array [i + 1] = temp; - - if (i > firstElement) - i -= 2; - } } - } - else - { - int fromStack[30], toStack[30]; - int stackIndex = 0; - - for (;;) - { - const int size = (lastElement - firstElement) + 1; - - if (size <= 8) - { - int j = lastElement; - int maxIndex; - - while (j > firstElement) - { - maxIndex = firstElement; - for (int k = firstElement + 1; k <= j; ++k) - if (comparator.compareElements (array[k], array [maxIndex]) > 0) - maxIndex = k; - - const ElementType temp = array [maxIndex]; - array [maxIndex] = array[j]; - array [j] = temp; - - --j; - } - } - else - { - const int mid = firstElement + (size >> 1); - ElementType temp = array [mid]; - array [mid] = array [firstElement]; - array [firstElement] = temp; - - int i = firstElement; - int j = lastElement + 1; - - for (;;) - { - while (++i <= lastElement - && comparator.compareElements (array[i], array [firstElement]) <= 0) - {} - - while (--j > firstElement - && comparator.compareElements (array[j], array [firstElement]) >= 0) - {} - - if (j < i) - break; - - temp = array[i]; - array[i] = array[j]; - array[j] = temp; - } - - temp = array [firstElement]; - array [firstElement] = array[j]; - array [j] = temp; - - if (j - 1 - firstElement >= lastElement - i) - { - if (firstElement + 1 < j) - { - fromStack [stackIndex] = firstElement; - toStack [stackIndex] = j - 1; - ++stackIndex; - } - - if (i < lastElement) - { - firstElement = i; - continue; - } - } - else - { - if (i < lastElement) - { - fromStack [stackIndex] = i; - toStack [stackIndex] = lastElement; - ++stackIndex; - } - - if (firstElement + 1 < j) - { - lastElement = j - 1; - continue; - } - } - } - - if (--stackIndex < 0) - break; - - jassert (stackIndex < numElementsInArray (fromStack)); - - firstElement = fromStack [stackIndex]; - lastElement = toStack [stackIndex]; - } - } - } -} - -/** - Searches a sorted array of elements, looking for the index at which a specified value - should be inserted for it to be in the correct order. - - The comparator object that is passed-in must define a public method with the following - signature: - @code - int compareElements (ElementType first, ElementType second); - @endcode - - ..and this method must return: - - a value of < 0 if the first comes before the second - - a value of 0 if the two objects are equivalent - - a value of > 0 if the second comes before the first - - To improve performance, the compareElements() method can be declared as static or const. - - @param comparator an object which defines a compareElements() method - @param array the array to search - @param newElement the value that is going to be inserted - @param firstElement the index of the first element to search - @param lastElement the index of the last element in the range (this is non-inclusive) -*/ -template -static int findInsertIndexInSortedArray (ElementComparator& comparator, - ElementType* const array, - const ElementType newElement, - int firstElement, - int lastElement) -{ - jassert (firstElement <= lastElement); - - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused - - while (firstElement < lastElement) - { - if (comparator.compareElements (newElement, array [firstElement]) == 0) - { - ++firstElement; - break; - } - else - { - const int halfway = (firstElement + lastElement) >> 1; - - if (halfway == firstElement) - { - if (comparator.compareElements (newElement, array [halfway]) >= 0) - ++firstElement; - - break; - } - else if (comparator.compareElements (newElement, array [halfway]) >= 0) - { - firstElement = halfway; - } - else - { - lastElement = halfway; - } - } - } - - return firstElement; -} - -/** - A simple ElementComparator class that can be used to sort an array of - integer primitive objects. - - Example: @code - Array myArray; - - IntegerElementComparator sorter; - myArray.sort (sorter); - @endcode - - For floating point values, see the FloatElementComparator class instead. - - @see FloatElementComparator, ElementComparator -*/ -template -class IntegerElementComparator -{ -public: - static int compareElements (const ElementType first, - const ElementType second) throw() - { - return first - second; - } -}; - -/** - A simple ElementComparator class that can be used to sort an array of numeric - double or floating point primitive objects. - - Example: @code - Array myArray; - - FloatElementComparator sorter; - myArray.sort (sorter); - @endcode - - For integer values, see the IntegerElementComparator class instead. - - @see IntegerElementComparator, ElementComparator -*/ -template -class FloatElementComparator -{ -public: - static int compareElements (const ElementType first, - const ElementType second) throw() - { - return (first < second) ? -1 - : ((first == second) ? 0 - : 1); - } -}; - -#endif // __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ -/********* End of inlined file: juce_ElementComparator.h *********/ - -/********* Start of inlined file: juce_CriticalSection.h *********/ -#ifndef __JUCE_CRITICALSECTION_JUCEHEADER__ -#define __JUCE_CRITICALSECTION_JUCEHEADER__ - -/** - Prevents multiple threads from accessing shared objects at the same time. - - @see ScopedLock, Thread, InterProcessLock -*/ -class JUCE_API CriticalSection -{ -public: - - /** - Creates a CriticalSection object - */ - CriticalSection() throw(); - - /** Destroys a CriticalSection object. - - If the critical section is deleted whilst locked, its subsequent behaviour - is unpredictable. - */ - ~CriticalSection() throw(); - - /** Locks this critical section. - - If the lock is currently held by another thread, this will wait until it - becomes free. - - If the lock is already held by the caller thread, the method returns immediately. - - @see exit, ScopedLock - */ - void enter() const throw(); - - /** Attempts to lock this critical section without blocking. - - This method behaves identically to CriticalSection::enter, except that the caller thread - does not wait if the lock is currently held by another thread but returns false immediately. - - @returns false if the lock is currently held by another thread, true otherwise. - @see enter - */ - bool tryEnter() const throw(); - - /** Releases the lock. - - If the caller thread hasn't got the lock, this can have unpredictable results. - - If the enter() method has been called multiple times by the thread, each - call must be matched by a call to exit() before other threads will be allowed - to take over the lock. - - @see enter, ScopedLock - */ - void exit() const throw(); - - juce_UseDebuggingNewOperator - -private: - -#if JUCE_WIN32 - #if JUCE_64BIT - // To avoid including windows.h in the public Juce includes, we'll just allocate a - // block of memory here that's big enough to be used internally as a windows critical - // section object. - uint8 internal [44]; - #else - uint8 internal [24]; - #endif -#else - mutable pthread_mutex_t internal; -#endif - - CriticalSection (const CriticalSection&); - const CriticalSection& operator= (const CriticalSection&); -}; - -/** - A class that can be used in place of a real CriticalSection object. - - This is currently used by some templated array classes, and should get - optimised out by the compiler. - - @see Array, OwnedArray, ReferenceCountedArray -*/ -class JUCE_API DummyCriticalSection -{ -public: - forcedinline DummyCriticalSection() throw() {} - forcedinline ~DummyCriticalSection() throw() {} - - forcedinline void enter() const throw() {} - forcedinline void exit() const throw() {} -}; - -#endif // __JUCE_CRITICALSECTION_JUCEHEADER__ -/********* End of inlined file: juce_CriticalSection.h *********/ - -/** An array designed for holding objects. - - This holds a list of pointers to objects, and will automatically - delete the objects when they are removed from the array, or when the - array is itself deleted. - - Declare it in the form: OwnedArray - - ..and then add new objects, e.g. myOwnedArray.add (new MyObjectClass()); - - After adding objects, they are 'owned' by the array and will be deleted when - removed or replaced. - - To make all the array's methods thread-safe, pass in "CriticalSection" as the templated - TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. - - @see Array, ReferenceCountedArray, StringArray, CriticalSection -*/ -template - -class OwnedArray : private ArrayAllocationBase -{ -public: - - /** Creates an empty array. - - @param granularity this is the size of increment by which the internal storage - used by the array will grow. Only change it from the default if you know the - array is going to be very big and needs to be able to grow efficiently. - - @see ArrayAllocationBase - */ - OwnedArray (const int granularity = juceDefaultArrayGranularity) throw() - : ArrayAllocationBase (granularity), - numUsed (0) - { - } - - /** Deletes the array and also deletes any objects inside it. - - To get rid of the array without deleting its objects, use its - clear (false) method before deleting it. - */ - ~OwnedArray() - { - clear (true); - } - - /** Clears the array, optionally deleting the objects inside it first. */ - void clear (const bool deleteObjects = true) - { - lock.enter(); - - if (deleteObjects) - { - while (numUsed > 0) - delete this->elements [--numUsed]; - } - - this->setAllocatedSize (0); - numUsed = 0; - lock.exit(); - } - - /** Returns the number of items currently in the array. - @see operator[] - */ - inline int size() const throw() - { - return numUsed; - } - - /** Returns a pointer to the object at this index in the array. - - If the index is out-of-range, this will return a null pointer, (and - it could be null anyway, because it's ok for the array to hold null - pointers as well as objects). - - @see getUnchecked - */ - inline ObjectClass* operator[] (const int index) const throw() - { - lock.enter(); - ObjectClass* const result = (((unsigned int) index) < (unsigned int) numUsed) - ? this->elements [index] - : (ObjectClass*) 0; - lock.exit(); - - return result; - } - - /** Returns a pointer to the object at this index in the array, without checking whether the index is in-range. - - This is a faster and less safe version of operator[] which doesn't check the index passed in, so - it can be used when you're sure the index if always going to be legal. - */ - inline ObjectClass* getUnchecked (const int index) const throw() - { - lock.enter(); - jassert (((unsigned int) index) < (unsigned int) numUsed); - ObjectClass* const result = this->elements [index]; - lock.exit(); - - return result; - } - - /** Returns a pointer to the first object in the array. - - This will return a null pointer if the array's empty. - @see getLast - */ - inline ObjectClass* getFirst() const throw() - { - lock.enter(); - ObjectClass* const result = (numUsed > 0) ? this->elements [0] - : (ObjectClass*) 0; - lock.exit(); - return result; - } - - /** Returns a pointer to the last object in the array. - - This will return a null pointer if the array's empty. - @see getFirst - */ - inline ObjectClass* getLast() const throw() - { - lock.enter(); - ObjectClass* const result = (numUsed > 0) ? this->elements [numUsed - 1] - : (ObjectClass*) 0; - lock.exit(); - - return result; - } - - /** Finds the index of an object which might be in the array. - - @param objectToLookFor the object to look for - @returns the index at which the object was found, or -1 if it's not found - */ - int indexOf (const ObjectClass* const objectToLookFor) const throw() - { - int result = -1; - - lock.enter(); - ObjectClass* const* e = this->elements; - - for (int i = numUsed; --i >= 0;) - { - if (objectToLookFor == *e) - { - result = (int) (e - this->elements); - break; - } - - ++e; - } - - lock.exit(); - return result; - } - - /** Returns true if the array contains a specified object. - - @param objectToLookFor the object to look for - @returns true if the object is in the array - */ - bool contains (const ObjectClass* const objectToLookFor) const throw() - { - lock.enter(); - - ObjectClass* const* e = this->elements; - int i = numUsed; - - while (i >= 4) - { - if (objectToLookFor == *e - || objectToLookFor == *++e - || objectToLookFor == *++e - || objectToLookFor == *++e) - { - lock.exit(); - return true; - } - - i -= 4; - ++e; - } - - while (i > 0) - { - if (objectToLookFor == *e) - { - lock.exit(); - return true; - } - - --i; - ++e; - } - - lock.exit(); - return false; - } - - /** Appends a new object to the end of the array. - - Note that the this object will be deleted by the OwnedArray when it - is removed, so be careful not to delete it somewhere else. - - Also be careful not to add the same object to the array more than once, - as this will obviously cause deletion of dangling pointers. - - @param newObject the new object to add to the array - @see set, insert, addIfNotAlreadyThere, addSorted - */ - void add (const ObjectClass* const newObject) throw() - { - lock.enter(); - this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = const_cast (newObject); - lock.exit(); - } - - /** Inserts a new object into the array at the given index. - - Note that the this object will be deleted by the OwnedArray when it - is removed, so be careful not to delete it somewhere else. - - If the index is less than 0 or greater than the size of the array, the - element will be added to the end of the array. - Otherwise, it will be inserted into the array, moving all the later elements - along to make room. - - Be careful not to add the same object to the array more than once, - as this will obviously cause deletion of dangling pointers. - - @param indexToInsertAt the index at which the new element should be inserted - @param newObject the new object to add to the array - @see add, addSorted, addIfNotAlreadyThere, set - */ - void insert (int indexToInsertAt, - const ObjectClass* const newObject) throw() - { - if (indexToInsertAt >= 0) - { - lock.enter(); - - if (indexToInsertAt > numUsed) - indexToInsertAt = numUsed; - - this->ensureAllocatedSize (numUsed + 1); - - ObjectClass** const e = this->elements + indexToInsertAt; - const int numToMove = numUsed - indexToInsertAt; - - if (numToMove > 0) - memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); - - *e = const_cast (newObject); - ++numUsed; - - lock.exit(); - } - else - { - add (newObject); - } - } - - /** Appends a new object at the end of the array as long as the array doesn't - already contain it. - - If the array already contains a matching object, nothing will be done. - - @param newObject the new object to add to the array - */ - void addIfNotAlreadyThere (const ObjectClass* const newObject) throw() - { - lock.enter(); - - if (! contains (newObject)) - add (newObject); - - lock.exit(); - } - - /** Replaces an object in the array with a different one. - - If the index is less than zero, this method does nothing. - If the index is beyond the end of the array, the new object is added to the end of the array. - - Be careful not to add the same object to the array more than once, - as this will obviously cause deletion of dangling pointers. - - @param indexToChange the index whose value you want to change - @param newObject the new value to set for this index. - @param deleteOldElement whether to delete the object that's being replaced with the new one - @see add, insert, remove - */ - void set (const int indexToChange, - const ObjectClass* const newObject, - const bool deleteOldElement = true) - { - if (indexToChange >= 0) - { - ObjectClass* toDelete = 0; - lock.enter(); - - if (indexToChange < numUsed) - { - if (deleteOldElement) - toDelete = this->elements [indexToChange]; - - if (toDelete == newObject) - toDelete = 0; - else - this->elements [indexToChange] = const_cast (newObject); - } - else - { - this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = const_cast (newObject); - } - - lock.exit(); - - delete toDelete; - } - } - - /** Inserts a new object into the array assuming that the array is sorted. - - This will use a comparator to find the position at which the new object - should go. If the array isn't sorted, the behaviour of this - method will be unpredictable. - - @param comparator the comparator to use to compare the elements - see the sort method - for details about this object's structure - @param newObject the new object to insert to the array - @see add, sort, indexOfSorted - */ - template - void addSorted (ElementComparator& comparator, - ObjectClass* const newObject) throw() - { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused - lock.enter(); - insert (findInsertIndexInSortedArray (comparator, this->elements, newObject, 0, numUsed), newObject); - lock.exit(); - } - - /** Finds the index of an object in the array, assuming that the array is sorted. - - This will use a comparator to do a binary-chop to find the index of the given - element, if it exists. If the array isn't sorted, the behaviour of this - method will be unpredictable. - - @param comparator the comparator to use to compare the elements - see the sort() - method for details about the form this object should take - @param objectToLookFor the object to search for - @returns the index of the element, or -1 if it's not found - @see addSorted, sort - */ - template - int indexOfSorted (ElementComparator& comparator, - const ObjectClass* const objectToLookFor) const throw() - { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused - lock.enter(); - - int start = 0; - int end = numUsed; - - for (;;) - { - if (start >= end) - { - lock.exit(); - return -1; - } - else if (comparator.compareElements (objectToLookFor, this->elements [start]) == 0) - { - lock.exit(); - return start; - } - else - { - const int halfway = (start + end) >> 1; - - if (halfway == start) - { - lock.exit(); - return -1; - } - else if (comparator.compareElements (objectToLookFor, this->elements [halfway]) >= 0) - start = halfway; - else - end = halfway; - } - } - } - - /** Removes an object from the array. - - This will remove the object at a given index (optionally also - deleting it) and move back all the subsequent objects to close the gap. - If the index passed in is out-of-range, nothing will happen. - - @param indexToRemove the index of the element to remove - @param deleteObject whether to delete the object that is removed - @see removeObject, removeRange - */ - void remove (const int indexToRemove, - const bool deleteObject = true) - { - lock.enter(); - ObjectClass* toDelete = 0; - - if (((unsigned int) indexToRemove) < (unsigned int) numUsed) - { - ObjectClass** const e = this->elements + indexToRemove; - - if (deleteObject) - toDelete = *e; - - --numUsed; - const int numToShift = numUsed - indexToRemove; - - if (numToShift > 0) - memmove (e, e + 1, numToShift * sizeof (ObjectClass*)); - - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); - } - - lock.exit(); - - delete toDelete; - } - - /** Removes a specified object from the array. - - If the item isn't found, no action is taken. - - @param objectToRemove the object to try to remove - @param deleteObject whether to delete the object (if it's found) - @see remove, removeRange - */ - void removeObject (const ObjectClass* const objectToRemove, - const bool deleteObject = true) - { - lock.enter(); - ObjectClass** e = this->elements; - - for (int i = numUsed; --i >= 0;) - { - if (objectToRemove == *e) - { - remove ((int) (e - this->elements), deleteObject); - break; - } - - ++e; - } - - lock.exit(); - } - - /** Removes a range of objects from the array. - - This will remove a set of objects, starting from the given index, - and move any subsequent elements down to close the gap. - - If the range extends beyond the bounds of the array, it will - be safely clipped to the size of the array. - - @param startIndex the index of the first object to remove - @param numberToRemove how many objects should be removed - @param deleteObjects whether to delete the objects that get removed - @see remove, removeObject - */ - void removeRange (int startIndex, - const int numberToRemove, - const bool deleteObjects = true) - { - lock.enter(); - const int endIndex = jlimit (0, numUsed, startIndex + numberToRemove); - startIndex = jlimit (0, numUsed, startIndex); - - if (endIndex > startIndex) - { - if (deleteObjects) - { - for (int i = startIndex; i < endIndex; ++i) - { - delete this->elements [i]; - this->elements [i] = 0; // (in case one of the destructors accesses this array and hits a dangling pointer) - } - } - - const int rangeSize = endIndex - startIndex; - ObjectClass** e = this->elements + startIndex; - int numToShift = numUsed - endIndex; - numUsed -= rangeSize; - - while (--numToShift >= 0) - { - *e = e [rangeSize]; - ++e; - } - - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); - } - - lock.exit(); - } - - /** Removes the last n objects from the array. - - @param howManyToRemove how many objects to remove from the end of the array - @param deleteObjects whether to also delete the objects that are removed - @see remove, removeObject, removeRange - */ - void removeLast (int howManyToRemove = 1, - const bool deleteObjects = true) - { - lock.enter(); - - if (howManyToRemove >= numUsed) - { - clear (deleteObjects); - } - else - { - while (--howManyToRemove >= 0) - remove (numUsed - 1, deleteObjects); - } - - lock.exit(); - } - - /** Swaps a pair of objects in the array. - - If either of the indexes passed in is out-of-range, nothing will happen, - otherwise the two objects at these positions will be exchanged. - */ - void swap (const int index1, - const int index2) throw() - { - lock.enter(); - - if (((unsigned int) index1) < (unsigned int) numUsed - && ((unsigned int) index2) < (unsigned int) numUsed) - { - swapVariables (this->elements [index1], - this->elements [index2]); - } - - lock.exit(); - } - - /** Moves one of the objects to a different position. - - This will move the object to a specified index, shuffling along - any intervening elements as required. - - So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling - move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. - @param currentIndex the index of the object to be moved. If this isn't a - valid index, then nothing will be done - @param newIndex the index at which you'd like this object to end up. If this - is less than zero, it will be moved to the end of the array - */ - void move (const int currentIndex, - int newIndex) throw() - { - if (currentIndex != newIndex) - { - lock.enter(); - - if (((unsigned int) currentIndex) < (unsigned int) numUsed) + ~MySingleton() { - if (((unsigned int) newIndex) >= (unsigned int) numUsed) - newIndex = numUsed - 1; - - ObjectClass* const value = this->elements [currentIndex]; - - if (newIndex > currentIndex) - { - memmove (this->elements + currentIndex, - this->elements + currentIndex + 1, - (newIndex - currentIndex) * sizeof (ObjectClass*)); - } - else - { - memmove (this->elements + newIndex + 1, - this->elements + newIndex, - (currentIndex - newIndex) * sizeof (ObjectClass*)); - } - - this->elements [newIndex] = value; + // this ensures that no dangling pointers are left when the + // singleton is deleted. + clearSingletonInstance(); } - lock.exit(); - } - } - - /** This swaps the contents of this array with those of another array. - - If you need to exchange two arrays, this is vastly quicker than using copy-by-value - because it just swaps their internal pointers. - */ - template - void swapWithArray (OtherArrayType& otherArray) throw() - { - lock.enter(); - otherArray.lock.enter(); - swapVariables (this->numUsed, otherArray.numUsed); - swapVariables (this->elements, otherArray.elements); - swapVariables (this->numAllocated, otherArray.numAllocated); - otherArray.lock.exit(); - lock.exit(); - } + juce_DeclareSingleton (MySingleton, false) + }; - /** Reduces the amount of storage being used by the array. + juce_ImplementSingleton (MySingleton) - Arrays typically allocate slightly more storage than they need, and after - removing elements, they may have quite a lot of unused space allocated. - This method will reduce the amount of allocated storage to a minimum. - */ - void minimiseStorageOverheads() throw() - { - lock.enter(); + // example of usage: + MySingleton* m = MySingleton::getInstance(); // creates the singleton if there isn't already one. - if (numUsed == 0) - { - this->setAllocatedSize (0); - } - else - { - const int newAllocation = this->granularity * (numUsed / this->granularity + 1); + ... - if (newAllocation < this->numAllocated) - this->setAllocatedSize (newAllocation); - } + MySingleton::deleteInstance(); // safely deletes the singleton (if it's been created). - lock.exit(); - } + @endcode - /** Increases the array's internal storage to hold a minimum number of elements. + If you know that your object will only be created and deleted by a single thread, you + can use the slightly more efficient juce_DeclareSingleton_SingleThreaded() macro instead + of this one. - Calling this before adding a large known number of elements means that - the array won't have to keep dynamically resizing itself as the elements - are added, and it'll therefore be more efficient. - */ - void ensureStorageAllocated (const int minNumElements) throw() - { - this->ensureAllocatedSize (minNumElements); + @see juce_ImplementSingleton, juce_DeclareSingleton_SingleThreaded +*/ +#define juce_DeclareSingleton(classname, allowOnlyOneInstance) \ +\ + static classname* _singletonInstance; \ + static JUCE_NAMESPACE::CriticalSection _singletonLock; \ +\ + static classname* getInstance() \ + { \ + if (_singletonInstance == 0) \ + {\ + const JUCE_NAMESPACE::ScopedLock sl (_singletonLock); \ +\ + if (_singletonInstance == 0) \ + { \ + static bool alreadyInside = false; \ + static bool createdOnceAlready = false; \ +\ + const bool problem = alreadyInside || ((allowOnlyOneInstance) && createdOnceAlready); \ + jassert (! problem); \ + if (! problem) \ + { \ + createdOnceAlready = true; \ + alreadyInside = true; \ + classname* newObject = new classname(); /* (use a stack variable to avoid setting the newObject value before the class has finished its constructor) */ \ + alreadyInside = false; \ +\ + _singletonInstance = newObject; \ + } \ + } \ + } \ +\ + return _singletonInstance; \ + } \ +\ + static inline classname* getInstanceWithoutCreating() throw() \ + { \ + return _singletonInstance; \ + } \ +\ + static void deleteInstance() \ + { \ + const JUCE_NAMESPACE::ScopedLock sl (_singletonLock); \ + if (_singletonInstance != 0) \ + { \ + classname* const old = _singletonInstance; \ + _singletonInstance = 0; \ + delete old; \ + } \ + } \ +\ + void clearSingletonInstance() throw() \ + { \ + if (_singletonInstance == this) \ + _singletonInstance = 0; \ } - /** Sorts the elements in the array. +/** This is a counterpart to the juce_DeclareSingleton macro. - This will use a comparator object to sort the elements into order. The object - passed must have a method of the form: - @code - int compareElements (ElementType first, ElementType second); - @endcode + After adding the juce_DeclareSingleton to the class definition, this macro has + to be used in the cpp file. +*/ +#define juce_ImplementSingleton(classname) \ +\ + classname* classname::_singletonInstance = 0; \ + JUCE_NAMESPACE::CriticalSection classname::_singletonLock; - ..and this method must return: - - a value of < 0 if the first comes before the second - - a value of 0 if the two objects are equivalent - - a value of > 0 if the second comes before the first +/** + Macro to declare member variables and methods for a singleton class. - To improve performance, the compareElements() method can be declared as static or const. + This is exactly the same as juce_DeclareSingleton, but doesn't use a critical + section to make access to it thread-safe. If you know that your object will + only ever be created or deleted by a single thread, then this is a + more efficient version to use. - @param comparator the comparator to use for comparing elements. - @param retainOrderOfEquivalentItems if this is true, then items - which the comparator says are equivalent will be - kept in the order in which they currently appear - in the array. This is slower to perform, but may - be important in some cases. If it's false, a faster - algorithm is used, but equivalent elements may be - rearranged. - @see sortArray, indexOfSorted - */ - template - void sort (ElementComparator& comparator, - const bool retainOrderOfEquivalentItems = false) const throw() - { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + See the documentation for juce_DeclareSingleton for more information about + how to use it, the only difference being that you have to use + juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton. - lock.enter(); - sortArray (comparator, this->elements, 0, size() - 1, retainOrderOfEquivalentItems); - lock.exit(); + @see juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton, juce_DeclareSingleton_SingleThreaded_Minimal +*/ +#define juce_DeclareSingleton_SingleThreaded(classname, allowOnlyOneInstance) \ +\ + static classname* _singletonInstance; \ +\ + static classname* getInstance() \ + { \ + if (_singletonInstance == 0) \ + { \ + static bool alreadyInside = false; \ + static bool createdOnceAlready = false; \ +\ + const bool problem = alreadyInside || ((allowOnlyOneInstance) && createdOnceAlready); \ + jassert (! problem); \ + if (! problem) \ + { \ + createdOnceAlready = true; \ + alreadyInside = true; \ + classname* newObject = new classname(); /* (use a stack variable to avoid setting the newObject value before the class has finished its constructor) */ \ + alreadyInside = false; \ +\ + _singletonInstance = newObject; \ + } \ + } \ +\ + return _singletonInstance; \ + } \ +\ + static inline classname* getInstanceWithoutCreating() throw() \ + { \ + return _singletonInstance; \ + } \ +\ + static void deleteInstance() \ + { \ + if (_singletonInstance != 0) \ + { \ + classname* const old = _singletonInstance; \ + _singletonInstance = 0; \ + delete old; \ + } \ + } \ +\ + void clearSingletonInstance() throw() \ + { \ + if (_singletonInstance == this) \ + _singletonInstance = 0; \ } - /** Locks the array's CriticalSection. - - Of course if the type of section used is a DummyCriticalSection, this won't - have any effect. +/** + Macro to declare member variables and methods for a singleton class. - @see unlockArray - */ - void lockArray() const throw() - { - lock.enter(); - } + This is like juce_DeclareSingleton_SingleThreaded, but doesn't do any checking + for recursion or repeated instantiation. It's intended for use as a lightweight + version of a singleton, where you're using it in very straightforward + circumstances and don't need the extra checking. - /** Unlocks the array's CriticalSection. + Juce use the normal juce_ImplementSingleton_SingleThreaded as the counterpart + to this declaration, as you would with juce_DeclareSingleton_SingleThreaded. - Of course if the type of section used is a DummyCriticalSection, this won't - have any effect. + See the documentation for juce_DeclareSingleton for more information about + how to use it, the only difference being that you have to use + juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton. - @see lockArray - */ - void unlockArray() const throw() - { - lock.exit(); + @see juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton +*/ +#define juce_DeclareSingleton_SingleThreaded_Minimal(classname) \ +\ + static classname* _singletonInstance; \ +\ + static classname* getInstance() \ + { \ + if (_singletonInstance == 0) \ + _singletonInstance = new classname(); \ +\ + return _singletonInstance; \ + } \ +\ + static inline classname* getInstanceWithoutCreating() throw() \ + { \ + return _singletonInstance; \ + } \ +\ + static void deleteInstance() \ + { \ + if (_singletonInstance != 0) \ + { \ + classname* const old = _singletonInstance; \ + _singletonInstance = 0; \ + delete old; \ + } \ + } \ +\ + void clearSingletonInstance() throw() \ + { \ + if (_singletonInstance == this) \ + _singletonInstance = 0; \ } - juce_UseDebuggingNewOperator - -private: - int numUsed; - TypeOfCriticalSectionToUse lock; - - // disallow copy constructor and assignment - OwnedArray (const OwnedArray&); - const OwnedArray& operator= (const OwnedArray&); -}; - -#endif // __JUCE_OWNEDARRAY_JUCEHEADER__ -/********* End of inlined file: juce_OwnedArray.h *********/ +/** This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro. -/********* Start of inlined file: juce_Time.h *********/ -#ifndef __JUCE_TIME_JUCEHEADER__ -#define __JUCE_TIME_JUCEHEADER__ + After adding juce_DeclareSingleton_SingleThreaded or juce_DeclareSingleton_SingleThreaded_Minimal + to the class definition, this macro has to be used somewhere in the cpp file. +*/ +#define juce_ImplementSingleton_SingleThreaded(classname) \ +\ + classname* classname::_singletonInstance = 0; -/********* Start of inlined file: juce_RelativeTime.h *********/ -#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ -#define __JUCE_RELATIVETIME_JUCEHEADER__ +#endif // __JUCE_SINGLETON_JUCEHEADER__ +/********* End of inlined file: juce_Singleton.h *********/ -/** A relative measure of time. +#endif +#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ - The time is stored as a number of seconds, at double-precision floating - point accuracy, and may be positive or negative. +/********* Start of inlined file: juce_SystemStats.h *********/ +#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ +#define __JUCE_SYSTEMSTATS_JUCEHEADER__ - If you need an absolute time, (i.e. a date + time), see the Time class. +/** + Contains methods for finding out about the current hardware and OS configuration. */ -class JUCE_API RelativeTime +class JUCE_API SystemStats { public: - /** Creates a RelativeTime. + /** Returns the current version of JUCE, - @param seconds the number of seconds, which may be +ve or -ve. - @see milliseconds, minutes, hours, days, weeks - */ - explicit RelativeTime (const double seconds = 0.0) throw(); + (just in case you didn't already know at compile-time.) - /** Copies another relative time. */ - RelativeTime (const RelativeTime& other) throw(); + See also the JUCE_VERSION, JUCE_MAJOR_VERSION and JUCE_MINOR_VERSION macros. + */ + static const String getJUCEVersion() throw(); - /** Copies another relative time. */ - const RelativeTime& operator= (const RelativeTime& other) throw(); + /** The set of possible results of the getOperatingSystemType() method. + */ + enum OperatingSystemType + { + UnknownOS = 0, - /** Destructor. */ - ~RelativeTime() throw(); + MacOSX = 0x1000, + Linux = 0x2000, - /** Creates a new RelativeTime object representing a number of milliseconds. + Win95 = 0x4001, + Win98 = 0x4002, + WinNT351 = 0x4103, + WinNT40 = 0x4104, + Win2000 = 0x4105, + WinXP = 0x4106, + WinVista = 0x4107, - @see minutes, hours, days, weeks - */ - static const RelativeTime milliseconds (const int milliseconds) throw(); + Windows = 0x4000, /**< To test whether any version of Windows is running, + you can use the expression ((getOperatingSystemType() & Windows) != 0). */ + WindowsNT = 0x0100, /**< To test whether the platform is Windows NT or later (i.e. not Win95 or 98), + you can use the expression ((getOperatingSystemType() & WindowsNT) != 0). */ + }; - /** Creates a new RelativeTime object representing a number of milliseconds. + /** Returns the type of operating system we're running on. - @see minutes, hours, days, weeks + @returns one of the values from the OperatingSystemType enum. + @see getOperatingSystemName */ - static const RelativeTime milliseconds (const int64 milliseconds) throw(); + static OperatingSystemType getOperatingSystemType() throw(); - /** Creates a new RelativeTime object representing a number of minutes. + /** Returns the name of the type of operating system we're running on. - @see milliseconds, hours, days, weeks + @returns a string describing the OS type. + @see getOperatingSystemType */ - static const RelativeTime minutes (const double numberOfMinutes) throw(); - - /** Creates a new RelativeTime object representing a number of hours. + static const String getOperatingSystemName() throw(); - @see milliseconds, minutes, days, weeks + /** Returns true if the OS is 64-bit, or false for a 32-bit OS. */ - static const RelativeTime hours (const double numberOfHours) throw(); - - /** Creates a new RelativeTime object representing a number of days. + static bool isOperatingSystem64Bit() throw(); - @see milliseconds, minutes, hours, weeks - */ - static const RelativeTime days (const double numberOfDays) throw(); + // CPU and memory information.. - /** Creates a new RelativeTime object representing a number of weeks. + /** Returns the approximate CPU speed. - @see milliseconds, minutes, hours, days + @returns the speed in megahertz, e.g. 1500, 2500, 32000 (depending on + what year you're reading this...) */ - static const RelativeTime weeks (const double numberOfWeeks) throw(); + static int getCpuSpeedInMegaherz() throw(); - /** Returns the number of milliseconds this time represents. + /** Returns a string to indicate the CPU vendor. - @see milliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks + Might not be known on some systems. */ - int64 inMilliseconds() const throw(); - - /** Returns the number of seconds this time represents. + static const String getCpuVendor() throw(); - @see inMilliseconds, inMinutes, inHours, inDays, inWeeks - */ - double inSeconds() const throw() { return seconds; } + /** Checks whether Intel MMX instructions are available. */ + static bool hasMMX() throw(); - /** Returns the number of minutes this time represents. + /** Checks whether Intel SSE instructions are available. */ + static bool hasSSE() throw(); - @see inMilliseconds, inSeconds, inHours, inDays, inWeeks - */ - double inMinutes() const throw(); + /** Checks whether Intel SSE2 instructions are available. */ + static bool hasSSE2() throw(); - /** Returns the number of hours this time represents. + /** Checks whether AMD 3DNOW instructions are available. */ + static bool has3DNow() throw(); - @see inMilliseconds, inSeconds, inMinutes, inDays, inWeeks + /** Returns the number of CPUs. */ - double inHours() const throw(); - - /** Returns the number of days this time represents. + static int getNumCpus() throw(); - @see inMilliseconds, inSeconds, inMinutes, inHours, inWeeks - */ - double inDays() const throw(); + /** Returns a clock-cycle tick counter, if available. - /** Returns the number of weeks this time represents. + If the machine can do it, this will return a tick-count + where each tick is one cpu clock cycle - used for profiling + code. - @see inMilliseconds, inSeconds, inMinutes, inHours, inDays + @returns the tick count, or zero if not available. */ - double inWeeks() const throw(); - - /** Returns a readable textual description of the time. - - The exact format of the string returned will depend on - the magnitude of the time - e.g. + static int64 getClockCycleCounter() throw(); - "1 min 4 secs", "1 hr 45 mins", "2 weeks 5 days", "140 ms" + /** Finds out how much RAM is in the machine. - so that only the two most significant units are printed. + @returns the approximate number of megabytes of memory, or zero if + something goes wrong when finding out. + */ + static int getMemorySizeInMegabytes() throw(); - The returnValueForZeroTime value is the result that is returned if the - length is zero. Depending on your application you might want to use this - to return something more relevant like "empty" or "0 secs", etc. + /** Returns the system page-size. - @see inMilliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks + This is only used by programmers with beards. */ - const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw(); - - /** Compares two RelativeTimes. */ - bool operator== (const RelativeTime& other) const throw(); - /** Compares two RelativeTimes. */ - bool operator!= (const RelativeTime& other) const throw(); + static int getPageSize() throw(); - /** Compares two RelativeTimes. */ - bool operator> (const RelativeTime& other) const throw(); - /** Compares two RelativeTimes. */ - bool operator< (const RelativeTime& other) const throw(); - /** Compares two RelativeTimes. */ - bool operator>= (const RelativeTime& other) const throw(); - /** Compares two RelativeTimes. */ - bool operator<= (const RelativeTime& other) const throw(); + /** Returns a list of MAC addresses found on this machine. - /** Adds another RelativeTime to this one and returns the result. */ - const RelativeTime operator+ (const RelativeTime& timeToAdd) const throw(); - /** Subtracts another RelativeTime from this one and returns the result. */ - const RelativeTime operator- (const RelativeTime& timeToSubtract) const throw(); + @param addresses an array into which the MAC addresses should be copied + @param maxNum the number of elements in this array + @param littleEndian the endianness of the numbers to return. Note that + the default values of this parameter are different on + Mac/PC to avoid breaking old software that was written + before this parameter was added (when the two systems + defaulted to using different endiannesses). In newer + software you probably want to specify an explicit value + for this. + @returns the number of MAC addresses that were found + */ + static int getMACAddresses (int64* addresses, int maxNum, +#if JUCE_MAC + const bool littleEndian = true) throw(); +#else + const bool littleEndian = false) throw(); +#endif - /** Adds a number of seconds to this RelativeTime and returns the result. */ - const RelativeTime operator+ (const double secondsToAdd) const throw(); - /** Subtracts a number of seconds from this RelativeTime and returns the result. */ - const RelativeTime operator- (const double secondsToSubtract) const throw(); + // not-for-public-use platform-specific method gets called at startup to initialise things. + static void initialiseStats() throw(); +}; - /** Adds another RelativeTime to this one. */ - const RelativeTime& operator+= (const RelativeTime& timeToAdd) throw(); - /** Subtracts another RelativeTime from this one. */ - const RelativeTime& operator-= (const RelativeTime& timeToSubtract) throw(); +#endif // __JUCE_SYSTEMSTATS_JUCEHEADER__ +/********* End of inlined file: juce_SystemStats.h *********/ - /** Adds a number of seconds to this time. */ - const RelativeTime& operator+= (const double secondsToAdd) throw(); +#endif +#ifndef __JUCE_MATHSFUNCTIONS_JUCEHEADER__ - /** Subtracts a number of seconds from this time. */ - const RelativeTime& operator-= (const double secondsToSubtract) throw(); +#endif +#ifndef __JUCE_PLATFORMDEFS_JUCEHEADER__ - juce_UseDebuggingNewOperator +#endif +#ifndef __JUCE_ATOMIC_JUCEHEADER__ -private: - double seconds; -}; +/********* Start of inlined file: juce_Atomic.h *********/ +#ifndef __JUCE_ATOMIC_JUCEHEADER__ +#define __JUCE_ATOMIC_JUCEHEADER__ -#endif // __JUCE_RELATIVETIME_JUCEHEADER__ -/********* End of inlined file: juce_RelativeTime.h *********/ +// Atomic increment/decrement operations.. -/** - Holds an absolute date and time. +#if JUCE_MAC && ! DOXYGEN - Internally, the time is stored at millisecond precision. + #if ! MACOS_10_3_OR_EARLIER - @see RelativeTime -*/ -class JUCE_API Time -{ -public: + forcedinline void atomicIncrement (int& variable) throw() { OSAtomicIncrement32 ((int32_t*) &variable); } + forcedinline int atomicIncrementAndReturn (int& variable) throw() { return OSAtomicIncrement32 ((int32_t*) &variable); } + forcedinline void atomicDecrement (int& variable) throw() { OSAtomicDecrement32 ((int32_t*) &variable); } + forcedinline int atomicDecrementAndReturn (int& variable) throw() { return OSAtomicDecrement32 ((int32_t*) &variable); } + #else - /** Creates a Time object. + forcedinline void atomicIncrement (int& variable) throw() { OTAtomicAdd32 (1, (SInt32*) &variable); } + forcedinline int atomicIncrementAndReturn (int& variable) throw() { return OTAtomicAdd32 (1, (SInt32*) &variable); } + forcedinline void atomicDecrement (int& variable) throw() { OTAtomicAdd32 (-1, (SInt32*) &variable); } + forcedinline int atomicDecrementAndReturn (int& variable) throw() { return OTAtomicAdd32 (-1, (SInt32*) &variable); } + #endif - This default constructor creates a time of 1st January 1970, (which is - represented internally as 0ms). +#elif JUCE_GCC - To create a time object representing the current time, use getCurrentTime(). + #if JUCE_USE_GCC_ATOMIC_INTRINSICS + forcedinline void atomicIncrement (int& variable) throw() { __sync_add_and_fetch (&variable, 1); } + forcedinline int atomicIncrementAndReturn (int& variable) throw() { return __sync_add_and_fetch (&variable, 1); } + forcedinline void atomicDecrement (int& variable) throw() { __sync_add_and_fetch (&variable, -1); } + forcedinline int atomicDecrementAndReturn (int& variable) throw() { return __sync_add_and_fetch (&variable, -1); } + #else - @see getCurrentTime - */ - Time() throw(); + /** Increments an integer in a thread-safe way. */ + forcedinline void atomicIncrement (int& variable) throw() + { + __asm__ __volatile__ ( + #if JUCE_64BIT + "lock incl (%%rax)" + : + : "a" (&variable) + : "cc", "memory"); + #else + "lock incl %0" + : "=m" (variable) + : "m" (variable)); + #endif + } - /** Creates a copy of another Time object. */ - Time (const Time& other) throw(); + /** Increments an integer in a thread-safe way and returns the incremented value. */ + forcedinline int atomicIncrementAndReturn (int& variable) throw() + { + int result; - /** Creates a time based on a number of milliseconds. + __asm__ __volatile__ ( + #if JUCE_64BIT + "lock xaddl %%ebx, (%%rax) \n\ + incl %%ebx" + : "=b" (result) + : "a" (&variable), "b" (1) + : "cc", "memory"); + #else + "lock xaddl %%eax, (%%ecx) \n\ + incl %%eax" + : "=a" (result) + : "c" (&variable), "a" (1) + : "memory"); + #endif - The internal millisecond count is set to 0 (1st January 1970). To create a - time object set to the current time, use getCurrentTime(). + return result; + } - @param millisecondsSinceEpoch the number of milliseconds since the unix - 'epoch' (midnight Jan 1st 1970). - @see getCurrentTime, currentTimeMillis - */ - Time (const int64 millisecondsSinceEpoch) throw(); + /** Decrememts an integer in a thread-safe way. */ + forcedinline void atomicDecrement (int& variable) throw() + { + __asm__ __volatile__ ( + #if JUCE_64BIT + "lock decl (%%rax)" + : + : "a" (&variable) + : "cc", "memory"); + #else + "lock decl %0" + : "=m" (variable) + : "m" (variable)); + #endif + } - /** Creates a time from a set of date components. + /** Decrememts an integer in a thread-safe way and returns the incremented value. */ + forcedinline int atomicDecrementAndReturn (int& variable) throw() + { + int result; - The timezone is assumed to be whatever the system is using as its locale. + __asm__ __volatile__ ( + #if JUCE_64BIT + "lock xaddl %%ebx, (%%rax) \n\ + decl %%ebx" + : "=b" (result) + : "a" (&variable), "b" (-1) + : "cc", "memory"); + #else + "lock xaddl %%eax, (%%ecx) \n\ + decl %%eax" + : "=a" (result) + : "c" (&variable), "a" (-1) + : "memory"); + #endif + return result; + } + #endif - @param year the year, in 4-digit format, e.g. 2004 - @param month the month, in the range 0 to 11 - @param day the day of the month, in the range 1 to 31 - @param hours hours in 24-hour clock format, 0 to 23 - @param minutes minutes 0 to 59 - @param seconds seconds 0 to 59 - @param milliseconds milliseconds 0 to 999 - @param useLocalTime if true, encode using the current machine's local time; if - false, it will always work in GMT. - */ - Time (const int year, - const int month, - const int day, - const int hours, - const int minutes, - const int seconds = 0, - const int milliseconds = 0, - const bool useLocalTime = true) throw(); +#elif JUCE_USE_INTRINSICS - /** Destructor. */ - ~Time() throw(); + #pragma intrinsic (_InterlockedIncrement) + #pragma intrinsic (_InterlockedDecrement) - /** Copies this time from another one. */ - const Time& operator= (const Time& other) throw(); + /** Increments an integer in a thread-safe way. */ + forcedinline void __fastcall atomicIncrement (int& variable) throw() + { + _InterlockedIncrement (reinterpret_cast (&variable)); + } - /** Returns a Time object that is set to the current system time. + /** Increments an integer in a thread-safe way and returns the incremented value. */ + forcedinline int __fastcall atomicIncrementAndReturn (int& variable) throw() + { + return _InterlockedIncrement (reinterpret_cast (&variable)); + } - @see currentTimeMillis - */ - static const Time JUCE_CALLTYPE getCurrentTime() throw(); + /** Decrememts an integer in a thread-safe way. */ + forcedinline void __fastcall atomicDecrement (int& variable) throw() + { + _InterlockedDecrement (reinterpret_cast (&variable)); + } - /** Returns the time as a number of milliseconds. + /** Decrememts an integer in a thread-safe way and returns the incremented value. */ + forcedinline int __fastcall atomicDecrementAndReturn (int& variable) throw() + { + return _InterlockedDecrement (reinterpret_cast (&variable)); + } +#else - @returns the number of milliseconds this Time object represents, since - midnight jan 1st 1970. - @see getMilliseconds - */ - int64 toMilliseconds() const throw() { return millisSinceEpoch; } + /** Increments an integer in a thread-safe way. */ + forcedinline void __fastcall atomicIncrement (int& variable) throw() + { + __asm { + mov ecx, dword ptr [variable] + lock inc dword ptr [ecx] + } + } - /** Returns the year. + /** Increments an integer in a thread-safe way and returns the incremented value. */ + forcedinline int __fastcall atomicIncrementAndReturn (int& variable) throw() + { + int result; - A 4-digit format is used, e.g. 2004. - */ - int getYear() const throw(); + __asm { + mov ecx, dword ptr [variable] + mov eax, 1 + lock xadd dword ptr [ecx], eax + inc eax + mov result, eax + } - /** Returns the number of the month. + return result; + } - The value returned is in the range 0 to 11. - @see getMonthName - */ - int getMonth() const throw(); + /** Decrememts an integer in a thread-safe way. */ + forcedinline void __fastcall atomicDecrement (int& variable) throw() + { + __asm { + mov ecx, dword ptr [variable] + lock dec dword ptr [ecx] + } + } - /** Returns the name of the month. + /** Decrememts an integer in a thread-safe way and returns the incremented value. */ + forcedinline int __fastcall atomicDecrementAndReturn (int& variable) throw() + { + int result; - @param threeLetterVersion if true, it'll be a 3-letter abbreviation, e.g. "Jan"; if false - it'll return the long form, e.g. "January" - @see getMonth - */ - const String getMonthName (const bool threeLetterVersion) const throw(); + __asm { + mov ecx, dword ptr [variable] + mov eax, -1 + lock xadd dword ptr [ecx], eax + dec eax + mov result, eax + } - /** Returns the day of the month. + return result; + } +#endif - The value returned is in the range 1 to 31. - */ - int getDayOfMonth() const throw(); +#endif // __JUCE_ATOMIC_JUCEHEADER__ +/********* End of inlined file: juce_Atomic.h *********/ - /** Returns the number of the day of the week. +#endif +#ifndef __JUCE_LOGGER_JUCEHEADER__ - The value returned is in the range 0 to 6 (0 = sunday, 1 = monday, etc). - */ - int getDayOfWeek() const throw(); +#endif +#ifndef __JUCE_FILELOGGER_JUCEHEADER__ - /** Returns the name of the weekday. +/********* Start of inlined file: juce_FileLogger.h *********/ +#ifndef __JUCE_FILELOGGER_JUCEHEADER__ +#define __JUCE_FILELOGGER_JUCEHEADER__ - @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if - false, it'll return the full version, e.g. "Tuesday". - */ - const String getWeekdayName (const bool threeLetterVersion) const throw(); +/********* Start of inlined file: juce_File.h *********/ +#ifndef __JUCE_FILE_JUCEHEADER__ +#define __JUCE_FILE_JUCEHEADER__ - /** Returns the number of hours since midnight. +/********* Start of inlined file: juce_OwnedArray.h *********/ +#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ +#define __JUCE_OWNEDARRAY_JUCEHEADER__ - This is in 24-hour clock format, in the range 0 to 23. +/********* Start of inlined file: juce_ArrayAllocationBase.h *********/ +#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ +#define __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ - @see getHoursInAmPmFormat, isAfternoon - */ - int getHours() const throw(); +/** The default size of chunk in which arrays increase their storage. - /** Returns true if the time is in the afternoon. + Used by ArrayAllocationBase and its subclasses. +*/ +const int juceDefaultArrayGranularity = 8; - So it returns true for "PM", false for "AM". +/** + Implements some basic array storage allocation functions. - @see getHoursInAmPmFormat, getHours - */ - bool isAfternoon() const throw(); + This class isn't really for public use - it's used by the other + array classes, but might come in handy for some purposes. - /** Returns the hours in 12-hour clock format. + @see Array, OwnedArray, ReferenceCountedArray +*/ +template +class ArrayAllocationBase +{ +protected: - This will return a value 1 to 12 - use isAfternoon() to find out - whether this is in the afternoon or morning. + /** Creates an empty array. - @see getHours, isAfternoon + @param granularity_ this is the size of increment by which the internal storage + will be increased. */ - int getHoursInAmPmFormat() const throw(); - - /** Returns the number of minutes, 0 to 59. */ - int getMinutes() const throw(); + ArrayAllocationBase (const int granularity_) throw() + : elements (0), + numAllocated (0), + granularity (granularity_) + { + } - /** Returns the number of seconds, 0 to 59. */ - int getSeconds() const throw(); + /** Destructor. */ + ~ArrayAllocationBase() throw() + { + delete[] elements; + } - /** Returns the number of milliseconds, 0 to 999. + /** Changes the amount of storage allocated. - Unlike toMilliseconds(), this just returns the position within the - current second rather than the total number since the epoch. + This will retain any data currently held in the array, and either add or + remove extra space at the end. - @see toMilliseconds + @param numElements the number of elements that are needed */ - int getMilliseconds() const throw(); + void setAllocatedSize (const int numElements) throw() + { + if (numAllocated != numElements) + { + if (numElements > 0) + { + ElementType* const newElements = new ElementType [numElements]; - /** Returns true if the local timezone uses a daylight saving correction. */ - bool isDaylightSavingTime() const throw(); + const int itemsToRetain = jmin (numElements, numAllocated); - /** Returns a 3-character string to indicate the local timezone. */ - const String getTimeZone() const throw(); + for (int i = 0; i < itemsToRetain; ++i) + newElements[i] = elements[i]; - /** Quick way of getting a string version of a date and time. + delete[] elements; + elements = newElements; - For a more powerful way of formatting the date and time, see the formatted() method. + } + else if (elements != 0) + { + delete[] elements; + elements = 0; + } - @param includeDate whether to include the date in the string - @param includeTime whether to include the time in the string - @param includeSeconds if the time is being included, this provides an option not to include - the seconds in it - @param use24HourClock if the time is being included, sets whether to use am/pm or 24 - hour notation. - @see formatted + numAllocated = numElements; + } + } + + /** Increases the amount of storage allocated if it is less than a given amount. + + This will retain any data currently held in the array, but will add + extra space at the end to make sure there it's at least as big as the size + passed in. If it's already bigger, no action is taken. + + @param minNumElements the minimum number of elements that are needed */ - const String toString (const bool includeDate, - const bool includeTime, - const bool includeSeconds = true, - const bool use24HourClock = false) const throw(); + void ensureAllocatedSize (int minNumElements) throw() + { + if (minNumElements > numAllocated) + { + // for arrays with small granularity that get big, start + // increasing the size in bigger jumps + if (minNumElements > (granularity << 6)) + { + minNumElements += (minNumElements / granularity); + if (minNumElements > (granularity << 8)) + minNumElements += granularity << 6; + else + minNumElements += granularity << 5; + } - /** Converts this date/time to a string with a user-defined format. + setAllocatedSize (granularity * (minNumElements / granularity + 1)); + } + } - This uses the C strftime() function to format this time as a string. To save you - looking it up, these are the escape codes that strftime uses (other codes might - work on some platforms and not others, but these are the common ones): + ElementType* elements; + int numAllocated, granularity; - %a is replaced by the locale's abbreviated weekday name. - %A is replaced by the locale's full weekday name. - %b is replaced by the locale's abbreviated month name. - %B is replaced by the locale's full month name. - %c is replaced by the locale's appropriate date and time representation. - %d is replaced by the day of the month as a decimal number [01,31]. - %H is replaced by the hour (24-hour clock) as a decimal number [00,23]. - %I is replaced by the hour (12-hour clock) as a decimal number [01,12]. - %j is replaced by the day of the year as a decimal number [001,366]. - %m is replaced by the month as a decimal number [01,12]. - %M is replaced by the minute as a decimal number [00,59]. - %p is replaced by the locale's equivalent of either a.m. or p.m. - %S is replaced by the second as a decimal number [00,61]. - %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. - %w is replaced by the weekday as a decimal number [0,6], with 0 representing Sunday. - %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0. - %x is replaced by the locale's appropriate date representation. - %X is replaced by the locale's appropriate time representation. - %y is replaced by the year without century as a decimal number [00,99]. - %Y is replaced by the year with century as a decimal number. - %Z is replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. - %% is replaced by %. +private: + ArrayAllocationBase (const ArrayAllocationBase&); + const ArrayAllocationBase& operator= (const ArrayAllocationBase&); +}; - @see toString - */ - const String formatted (const tchar* const format) const throw(); +#endif // __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ +/********* End of inlined file: juce_ArrayAllocationBase.h *********/ - /** Adds a RelativeTime to this time and returns the result. */ - const Time operator+ (const RelativeTime& delta) const throw() { return Time (millisSinceEpoch + delta.inMilliseconds()); } +/********* Start of inlined file: juce_ElementComparator.h *********/ +#ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ +#define __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ - /** Subtracts a RelativeTime from this time and returns the result. */ - const Time operator- (const RelativeTime& delta) const throw() { return Time (millisSinceEpoch - delta.inMilliseconds()); } +/** + Sorts a range of elements in an array. - /** Returns the relative time difference between this time and another one. */ - const RelativeTime operator- (const Time& other) const throw() { return RelativeTime::milliseconds (millisSinceEpoch - other.millisSinceEpoch); } + The comparator object that is passed-in must define a public method with the following + signature: + @code + int compareElements (ElementType first, ElementType second); + @endcode - /** Compares two Time objects. */ - bool operator== (const Time& other) const throw() { return millisSinceEpoch == other.millisSinceEpoch; } + ..and this method must return: + - a value of < 0 if the first comes before the second + - a value of 0 if the two objects are equivalent + - a value of > 0 if the second comes before the first - /** Compares two Time objects. */ - bool operator!= (const Time& other) const throw() { return millisSinceEpoch != other.millisSinceEpoch; } + To improve performance, the compareElements() method can be declared as static or const. - /** Compares two Time objects. */ - bool operator< (const Time& other) const throw() { return millisSinceEpoch < other.millisSinceEpoch; } + @param comparator an object which defines a compareElements() method + @param array the array to sort + @param firstElement the index of the first element of the range to be sorted + @param lastElement the index of the last element in the range that needs + sorting (this is inclusive) + @param retainOrderOfEquivalentItems if true, the order of items that the + comparator deems the same will be maintained - this will be + a slower algorithm than if they are allowed to be moved around. - /** Compares two Time objects. */ - bool operator<= (const Time& other) const throw() { return millisSinceEpoch <= other.millisSinceEpoch; } + @see sortArrayRetainingOrder +*/ +template +static void sortArray (ElementComparator& comparator, + ElementType* const array, + int firstElement, + int lastElement, + const bool retainOrderOfEquivalentItems) +{ + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused + + if (lastElement > firstElement) + { + if (retainOrderOfEquivalentItems) + { + for (int i = firstElement; i < lastElement; ++i) + { + if (comparator.compareElements (array[i], array [i + 1]) > 0) + { + const ElementType temp = array [i]; + array [i] = array[i + 1]; + array [i + 1] = temp; - /** Compares two Time objects. */ - bool operator> (const Time& other) const throw() { return millisSinceEpoch > other.millisSinceEpoch; } + if (i > firstElement) + i -= 2; + } + } + } + else + { + int fromStack[30], toStack[30]; + int stackIndex = 0; - /** Compares two Time objects. */ - bool operator>= (const Time& other) const throw() { return millisSinceEpoch >= other.millisSinceEpoch; } + for (;;) + { + const int size = (lastElement - firstElement) + 1; - /** Tries to set the computer's clock. + if (size <= 8) + { + int j = lastElement; + int maxIndex; - @returns true if this succeeds, although depending on the system, the - application might not have sufficient privileges to do this. - */ - bool setSystemTimeToThisTime() const throw(); + while (j > firstElement) + { + maxIndex = firstElement; + for (int k = firstElement + 1; k <= j; ++k) + if (comparator.compareElements (array[k], array [maxIndex]) > 0) + maxIndex = k; - /** Returns the name of a day of the week. + const ElementType temp = array [maxIndex]; + array [maxIndex] = array[j]; + array [j] = temp; - @param dayNumber the day, 0 to 6 (0 = sunday, 1 = monday, etc) - @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if - false, it'll return the full version, e.g. "Tuesday". - */ - static const String getWeekdayName (int dayNumber, - const bool threeLetterVersion) throw(); + --j; + } + } + else + { + const int mid = firstElement + (size >> 1); + ElementType temp = array [mid]; + array [mid] = array [firstElement]; + array [firstElement] = temp; - /** Returns the name of one of the months. + int i = firstElement; + int j = lastElement + 1; - @param monthNumber the month, 0 to 11 - @param threeLetterVersion if true, it'll be a 3-letter abbreviation, e.g. "Jan"; if false - it'll return the long form, e.g. "January" - */ - static const String getMonthName (int monthNumber, - const bool threeLetterVersion) throw(); + for (;;) + { + while (++i <= lastElement + && comparator.compareElements (array[i], array [firstElement]) <= 0) + {} - // Static methods for getting system timers directly.. + while (--j > firstElement + && comparator.compareElements (array[j], array [firstElement]) >= 0) + {} - /** Returns the current system time. + if (j < i) + break; - Returns the number of milliseconds since midnight jan 1st 1970. + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } - Should be accurate to within a few millisecs, depending on platform, - hardware, etc. - */ - static int64 currentTimeMillis() throw(); + temp = array [firstElement]; + array [firstElement] = array[j]; + array [j] = temp; - /** Returns the number of millisecs since system startup. + if (j - 1 - firstElement >= lastElement - i) + { + if (firstElement + 1 < j) + { + fromStack [stackIndex] = firstElement; + toStack [stackIndex] = j - 1; + ++stackIndex; + } - Should be accurate to within a few millisecs, depending on platform, - hardware, etc. + if (i < lastElement) + { + firstElement = i; + continue; + } + } + else + { + if (i < lastElement) + { + fromStack [stackIndex] = i; + toStack [stackIndex] = lastElement; + ++stackIndex; + } - @see getApproximateMillisecondCounter - */ - static uint32 getMillisecondCounter() throw(); + if (firstElement + 1 < j) + { + lastElement = j - 1; + continue; + } + } + } - /** Returns the number of millisecs since system startup. + if (--stackIndex < 0) + break; - Same as getMillisecondCounter(), but returns a more accurate value, using - the high-res timer. + jassert (stackIndex < numElementsInArray (fromStack)); - @see getMillisecondCounter - */ - static double getMillisecondCounterHiRes() throw(); + firstElement = fromStack [stackIndex]; + lastElement = toStack [stackIndex]; + } + } + } +} - /** Waits until the getMillisecondCounter() reaches a given value. +/** + Searches a sorted array of elements, looking for the index at which a specified value + should be inserted for it to be in the correct order. - This will make the thread sleep as efficiently as it can while it's waiting. - */ - static void waitForMillisecondCounter (const uint32 targetTime) throw(); + The comparator object that is passed-in must define a public method with the following + signature: + @code + int compareElements (ElementType first, ElementType second); + @endcode - /** Less-accurate but faster version of getMillisecondCounter(). + ..and this method must return: + - a value of < 0 if the first comes before the second + - a value of 0 if the two objects are equivalent + - a value of > 0 if the second comes before the first - This will return the last value that getMillisecondCounter() returned, so doesn't - need to make a system call, but is less accurate - it shouldn't be more than - 100ms away from the correct time, though, so is still accurate enough for a - lot of purposes. + To improve performance, the compareElements() method can be declared as static or const. - @see getMillisecondCounter - */ - static uint32 getApproximateMillisecondCounter() throw(); + @param comparator an object which defines a compareElements() method + @param array the array to search + @param newElement the value that is going to be inserted + @param firstElement the index of the first element to search + @param lastElement the index of the last element in the range (this is non-inclusive) +*/ +template +static int findInsertIndexInSortedArray (ElementComparator& comparator, + ElementType* const array, + const ElementType newElement, + int firstElement, + int lastElement) +{ + jassert (firstElement <= lastElement); - // High-resolution timers.. + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused - /** Returns the current high-resolution counter's tick-count. + while (firstElement < lastElement) + { + if (comparator.compareElements (newElement, array [firstElement]) == 0) + { + ++firstElement; + break; + } + else + { + const int halfway = (firstElement + lastElement) >> 1; - This is a similar idea to getMillisecondCounter(), but with a higher - resolution. + if (halfway == firstElement) + { + if (comparator.compareElements (newElement, array [halfway]) >= 0) + ++firstElement; - @see getHighResolutionTicksPerSecond, highResolutionTicksToSeconds, - secondsToHighResolutionTicks - */ - static int64 getHighResolutionTicks() throw(); + break; + } + else if (comparator.compareElements (newElement, array [halfway]) >= 0) + { + firstElement = halfway; + } + else + { + lastElement = halfway; + } + } + } - /** Returns the resolution of the high-resolution counter in ticks per second. + return firstElement; +} - @see getHighResolutionTicks, highResolutionTicksToSeconds, - secondsToHighResolutionTicks - */ - static int64 getHighResolutionTicksPerSecond() throw(); +/** + A simple ElementComparator class that can be used to sort an array of + integer primitive objects. - /** Converts a number of high-resolution ticks into seconds. + Example: @code + Array myArray; - @see getHighResolutionTicks, getHighResolutionTicksPerSecond, - secondsToHighResolutionTicks - */ - static double highResolutionTicksToSeconds (const int64 ticks) throw(); + IntegerElementComparator sorter; + myArray.sort (sorter); + @endcode - /** Converts a number seconds into high-resolution ticks. + For floating point values, see the FloatElementComparator class instead. - @see getHighResolutionTicks, getHighResolutionTicksPerSecond, - highResolutionTicksToSeconds - */ - static int64 secondsToHighResolutionTicks (const double seconds) throw(); + @see FloatElementComparator, ElementComparator +*/ +template +class IntegerElementComparator +{ +public: + static int compareElements (const ElementType first, + const ElementType second) throw() + { + return first - second; + } +}; -private: +/** + A simple ElementComparator class that can be used to sort an array of numeric + double or floating point primitive objects. - int64 millisSinceEpoch; -}; + Example: @code + Array myArray; -#endif // __JUCE_TIME_JUCEHEADER__ -/********* End of inlined file: juce_Time.h *********/ + FloatElementComparator sorter; + myArray.sort (sorter); + @endcode -/********* Start of inlined file: juce_StringArray.h *********/ -#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ -#define __JUCE_STRINGARRAY_JUCEHEADER__ + For integer values, see the IntegerElementComparator class instead. -/********* Start of inlined file: juce_VoidArray.h *********/ -#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ -#define __JUCE_VOIDARRAY_JUCEHEADER__ + @see IntegerElementComparator, ElementComparator +*/ +template +class FloatElementComparator +{ +public: + static int compareElements (const ElementType first, + const ElementType second) throw() + { + return (first < second) ? -1 + : ((first == second) ? 0 + : 1); + } +}; -/********* Start of inlined file: juce_Array.h *********/ -#ifndef __JUCE_ARRAY_JUCEHEADER__ -#define __JUCE_ARRAY_JUCEHEADER__ +#endif // __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ +/********* End of inlined file: juce_ElementComparator.h *********/ -/** - Holds a list of primitive objects, such as ints, doubles, or pointers. +/** An array designed for holding objects. - Examples of arrays are: Array or Array + This holds a list of pointers to objects, and will automatically + delete the objects when they are removed from the array, or when the + array is itself deleted. - Note that when holding pointers to objects, the array doesn't take any ownership - of the objects - for doing this, see the OwnedArray class or the ReferenceCountedArray class. + Declare it in the form: OwnedArray - If you're using a class or struct as the element type, it must be - capable of being copied or moved with a straightforward memcpy, rather than - needing construction and destruction code. + ..and then add new objects, e.g. myOwnedArray.add (new MyObjectClass()); - For holding lists of strings, use the specialised class StringArray. + After adding objects, they are 'owned' by the array and will be deleted when + removed or replaced. To make all the array's methods thread-safe, pass in "CriticalSection" as the templated TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. - @see OwnedArray, ReferenceCountedArray, StringArray, CriticalSection + @see Array, ReferenceCountedArray, StringArray, CriticalSection */ -template -class Array : private ArrayAllocationBase +template + +class OwnedArray : private ArrayAllocationBase { public: @@ -4490,255 +3787,124 @@ public: @see ArrayAllocationBase */ - Array (const int granularity = juceDefaultArrayGranularity) throw() - : ArrayAllocationBase (granularity), - numUsed (0) - { - } - - /** Creates a copy of another array. - @param other the array to copy - */ - Array (const Array& other) throw() - : ArrayAllocationBase (other.granularity) - { - other.lockArray(); - numUsed = other.numUsed; - this->setAllocatedSize (other.numUsed); - memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); - other.unlockArray(); - } - - /** Initalises from a null-terminated C array of values. - - @param values the array to copy from - */ - Array (const ElementType* values) throw() - : ArrayAllocationBase (juceDefaultArrayGranularity), - numUsed (0) - { - while (*values != 0) - add (*values++); - } - - /** Initalises from a C array of values. - - @param values the array to copy from - @param numValues the number of values in the array - */ - Array (const ElementType* values, int numValues) throw() - : ArrayAllocationBase (juceDefaultArrayGranularity), - numUsed (numValues) + OwnedArray (const int granularity = juceDefaultArrayGranularity) throw() + : ArrayAllocationBase (granularity), + numUsed (0) { - this->setAllocatedSize (numValues); - memcpy (this->elements, values, numValues * sizeof (ElementType)); } - /** Destructor. */ - ~Array() throw() - { - } + /** Deletes the array and also deletes any objects inside it. - /** Copies another array. - @param other the array to copy + To get rid of the array without deleting its objects, use its + clear (false) method before deleting it. */ - const Array & operator= (const Array & other) throw() + ~OwnedArray() { - if (this != &other) - { - other.lockArray(); - lock.enter(); - - this->granularity = other.granularity; - this->ensureAllocatedSize (other.size()); - numUsed = other.numUsed; - memcpy (this->elements, other.elements, this->numUsed * sizeof (ElementType)); - minimiseStorageOverheads(); - - lock.exit(); - other.unlockArray(); - } - - return *this; + clear (true); } - /** Compares this array to another one. - Two arrays are considered equal if they both contain the same set of - elements, in the same order. - @param other the other array to compare with - */ - template - bool operator== (const OtherArrayType& other) const throw() + /** Clears the array, optionally deleting the objects inside it first. */ + void clear (const bool deleteObjects = true) { lock.enter(); - if (this->numUsed != other.numUsed) - { - lock.exit(); - return false; - } - - for (int i = numUsed; --i >= 0;) + if (deleteObjects) { - if (this->elements [i] != other.elements [i]) - { - lock.exit(); - return false; - } + while (numUsed > 0) + delete this->elements [--numUsed]; } - lock.exit(); - return true; - } - - /** Compares this array to another one. - Two arrays are considered equal if they both contain the same set of - elements, in the same order. - @param other the other array to compare with - */ - template - bool operator!= (const OtherArrayType& other) const throw() - { - return ! operator== (other); - } - - /** Removes all elements from the array. - This will remove all the elements, and free any storage that the array is - using. To clear the array without freeing the storage, use the clearQuick() - method instead. - - @see clearQuick - */ - void clear() throw() - { - lock.enter(); this->setAllocatedSize (0); numUsed = 0; lock.exit(); } - /** Removes all elements from the array without freeing the array's allocated storage. - - @see clear - */ - void clearQuick() throw() - { - lock.enter(); - numUsed = 0; - lock.exit(); - } - - /** Returns the current number of elements in the array. + /** Returns the number of items currently in the array. + @see operator[] */ inline int size() const throw() { return numUsed; } - /** Returns one of the elements in the array. - If the index passed in is beyond the range of valid elements, this - will return zero. + /** Returns a pointer to the object at this index in the array. - If you're certain that the index will always be a valid element, you - can call getUnchecked() instead, which is faster. + If the index is out-of-range, this will return a null pointer, (and + it could be null anyway, because it's ok for the array to hold null + pointers as well as objects). - @param index the index of the element being requested (0 is the first element in the array) - @see getUnchecked, getFirst, getLast + @see getUnchecked */ - inline ElementType operator[] (const int index) const throw() + inline ObjectClass* operator[] (const int index) const throw() { lock.enter(); - const ElementType result = (((unsigned int) index) < (unsigned int) numUsed) - ? this->elements [index] - : ElementType(); + ObjectClass* const result = (((unsigned int) index) < (unsigned int) numUsed) + ? this->elements [index] + : (ObjectClass*) 0; lock.exit(); return result; } - /** Returns one of the elements in the array, without checking the index passed in. - - Unlike the operator[] method, this will try to return an element without - checking that the index is within the bounds of the array, so should only - be used when you're confident that it will always be a valid index. + /** Returns a pointer to the object at this index in the array, without checking whether the index is in-range. - @param index the index of the element being requested (0 is the first element in the array) - @see operator[], getFirst, getLast + This is a faster and less safe version of operator[] which doesn't check the index passed in, so + it can be used when you're sure the index if always going to be legal. */ - inline ElementType getUnchecked (const int index) const throw() + inline ObjectClass* getUnchecked (const int index) const throw() { lock.enter(); jassert (((unsigned int) index) < (unsigned int) numUsed); - const ElementType result = this->elements [index]; + ObjectClass* const result = this->elements [index]; lock.exit(); return result; } - /** Returns a direct reference to one of the elements in the array, without checking the index passed in. - - This is like getUnchecked, but returns a direct reference to the element, so that - you can alter it directly. Obviously this can be dangerous, so only use it when - absolutely necessary. - - @param index the index of the element being requested (0 is the first element in the array) - @see operator[], getFirst, getLast - */ - inline ElementType& getReference (const int index) const throw() - { - lock.enter(); - jassert (((unsigned int) index) < (unsigned int) numUsed); - ElementType& result = this->elements [index]; - lock.exit(); - return result; - } - - /** Returns the first element in the array, or 0 if the array is empty. + /** Returns a pointer to the first object in the array. - @see operator[], getUnchecked, getLast + This will return a null pointer if the array's empty. + @see getLast */ - inline ElementType getFirst() const throw() + inline ObjectClass* getFirst() const throw() { - lock.enter(); - const ElementType result = (numUsed > 0) ? this->elements [0] - : ElementType(); + lock.enter(); + ObjectClass* const result = (numUsed > 0) ? this->elements [0] + : (ObjectClass*) 0; lock.exit(); - return result; } - /** Returns the last element in the array, or 0 if the array is empty. + /** Returns a pointer to the last object in the array. - @see operator[], getUnchecked, getFirst + This will return a null pointer if the array's empty. + @see getFirst */ - inline ElementType getLast() const throw() + inline ObjectClass* getLast() const throw() { lock.enter(); - const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1] - : ElementType(); + ObjectClass* const result = (numUsed > 0) ? this->elements [numUsed - 1] + : (ObjectClass*) 0; lock.exit(); return result; } - /** Finds the index of the first element which matches the value passed in. - - This will search the array for the given object, and return the index - of its first occurrence. If the object isn't found, the method will return -1. + /** Finds the index of an object which might be in the array. - @param elementToLookFor the value or object to look for - @returns the index of the object, or -1 if it's not found + @param objectToLookFor the object to look for + @returns the index at which the object was found, or -1 if it's not found */ - int indexOf (const ElementType elementToLookFor) const throw() + int indexOf (const ObjectClass* const objectToLookFor) const throw() { int result = -1; lock.enter(); - const ElementType* e = this->elements; + ObjectClass* const* e = this->elements; for (int i = numUsed; --i >= 0;) { - if (elementToLookFor == *e) + if (objectToLookFor == *e) { result = (int) (e - this->elements); break; @@ -4751,42 +3917,42 @@ public: return result; } - /** Returns true if the array contains at least one occurrence of an object. + /** Returns true if the array contains a specified object. - @param elementToLookFor the value or object to look for - @returns true if the item is found + @param objectToLookFor the object to look for + @returns true if the object is in the array */ - bool contains (const ElementType elementToLookFor) const throw() + bool contains (const ObjectClass* const objectToLookFor) const throw() { lock.enter(); - const ElementType* e = this->elements; - int num = numUsed; + ObjectClass* const* e = this->elements; + int i = numUsed; - while (num >= 4) + while (i >= 4) { - if (*e == elementToLookFor - || *++e == elementToLookFor - || *++e == elementToLookFor - || *++e == elementToLookFor) + if (objectToLookFor == *e + || objectToLookFor == *++e + || objectToLookFor == *++e + || objectToLookFor == *++e) { lock.exit(); return true; } - num -= 4; + i -= 4; ++e; } - while (num > 0) + while (i > 0) { - if (elementToLookFor == *e) + if (objectToLookFor == *e) { lock.exit(); return true; } - --num; + --i; ++e; } @@ -4794,299 +3960,155 @@ public: return false; } - /** Appends a new element at the end of the array. - - @param newElement the new object to add to the array - @see set, insert, addIfNotAlreadyThere, addSorted, addArray - */ - void add (const ElementType newElement) throw() - { - lock.enter(); - this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = newElement; - lock.exit(); - } + /** Appends a new object to the end of the array. - /** Inserts a new element into the array at a given position. + Note that the this object will be deleted by the OwnedArray when it + is removed, so be careful not to delete it somewhere else. - If the index is less than 0 or greater than the size of the array, the - element will be added to the end of the array. - Otherwise, it will be inserted into the array, moving all the later elements - along to make room. + Also be careful not to add the same object to the array more than once, + as this will obviously cause deletion of dangling pointers. - @param indexToInsertAt the index at which the new element should be - inserted (pass in -1 to add it to the end) - @param newElement the new object to add to the array - @see add, addSorted, set + @param newObject the new object to add to the array + @see set, insert, addIfNotAlreadyThere, addSorted */ - void insert (int indexToInsertAt, const ElementType newElement) throw() + void add (const ObjectClass* const newObject) throw() { lock.enter(); this->ensureAllocatedSize (numUsed + 1); - - if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) - { - ElementType* const insertPos = this->elements + indexToInsertAt; - const int numberToMove = numUsed - indexToInsertAt; - - if (numberToMove > 0) - memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); - - *insertPos = newElement; - ++numUsed; - } - else - { - this->elements [numUsed++] = newElement; - } - + this->elements [numUsed++] = const_cast (newObject); lock.exit(); } - /** Inserts multiple copies of an element into the array at a given position. + /** Inserts a new object into the array at the given index. + + Note that the this object will be deleted by the OwnedArray when it + is removed, so be careful not to delete it somewhere else. If the index is less than 0 or greater than the size of the array, the element will be added to the end of the array. Otherwise, it will be inserted into the array, moving all the later elements along to make room. - @param indexToInsertAt the index at which the new element should be inserted - @param newElement the new object to add to the array - @param numberOfTimesToInsertIt how many copies of the value to insert - @see insert, add, addSorted, set + Be careful not to add the same object to the array more than once, + as this will obviously cause deletion of dangling pointers. + + @param indexToInsertAt the index at which the new element should be inserted + @param newObject the new object to add to the array + @see add, addSorted, addIfNotAlreadyThere, set */ - void insertMultiple (int indexToInsertAt, const ElementType newElement, - int numberOfTimesToInsertIt) throw() + void insert (int indexToInsertAt, + const ObjectClass* const newObject) throw() { - if (numberOfTimesToInsertIt > 0) + if (indexToInsertAt >= 0) { lock.enter(); - this->ensureAllocatedSize (numUsed + numberOfTimesToInsertIt); - - if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) - { - ElementType* insertPos = this->elements + indexToInsertAt; - const int numberToMove = numUsed - indexToInsertAt; - - memmove (insertPos + numberOfTimesToInsertIt, insertPos, numberToMove * sizeof (ElementType)); - numUsed += numberOfTimesToInsertIt; - - while (--numberOfTimesToInsertIt >= 0) - *insertPos++ = newElement; - } - else - { - while (--numberOfTimesToInsertIt >= 0) - this->elements [numUsed++] = newElement; - } - - lock.exit(); - } - } - - /** Inserts an array of values into this array at a given position. - If the index is less than 0 or greater than the size of the array, the - new elements will be added to the end of the array. - Otherwise, they will be inserted into the array, moving all the later elements - along to make room. + if (indexToInsertAt > numUsed) + indexToInsertAt = numUsed; - @param indexToInsertAt the index at which the first new element should be inserted - @param newElements the new values to add to the array - @param numberOfElements how many items are in the array - @see insert, add, addSorted, set - */ - void insertArray (int indexToInsertAt, - const ElementType* newElements, - int numberOfElements) throw() - { - if (numberOfElements > 0) - { - lock.enter(); - this->ensureAllocatedSize (numUsed + numberOfElements); + this->ensureAllocatedSize (numUsed + 1); - if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) - { - ElementType* insertPos = this->elements + indexToInsertAt; - const int numberToMove = numUsed - indexToInsertAt; + ObjectClass** const e = this->elements + indexToInsertAt; + const int numToMove = numUsed - indexToInsertAt; - memmove (insertPos + numberOfElements, insertPos, numberToMove * sizeof (ElementType)); - numUsed += numberOfElements; + if (numToMove > 0) + memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); - while (--numberOfElements >= 0) - *insertPos++ = *newElements++; - } - else - { - while (--numberOfElements >= 0) - this->elements [numUsed++] = *newElements++; - } + *e = const_cast (newObject); + ++numUsed; lock.exit(); } + else + { + add (newObject); + } } - /** Appends a new element at the end of the array as long as the array doesn't + /** Appends a new object at the end of the array as long as the array doesn't already contain it. - If the array already contains an element that matches the one passed in, nothing - will be done. + If the array already contains a matching object, nothing will be done. - @param newElement the new object to add to the array + @param newObject the new object to add to the array */ - void addIfNotAlreadyThere (const ElementType newElement) throw() + void addIfNotAlreadyThere (const ObjectClass* const newObject) throw() { lock.enter(); - if (! contains (newElement)) - add (newElement); + if (! contains (newObject)) + add (newObject); lock.exit(); } - /** Replaces an element with a new value. + /** Replaces an object in the array with a different one. If the index is less than zero, this method does nothing. - If the index is beyond the end of the array, the item is added to the end of the array. + If the index is beyond the end of the array, the new object is added to the end of the array. - @param indexToChange the index whose value you want to change - @param newValue the new value to set for this index. - @see add, insert + Be careful not to add the same object to the array more than once, + as this will obviously cause deletion of dangling pointers. + + @param indexToChange the index whose value you want to change + @param newObject the new value to set for this index. + @param deleteOldElement whether to delete the object that's being replaced with the new one + @see add, insert, remove */ void set (const int indexToChange, - const ElementType newValue) throw() + const ObjectClass* const newObject, + const bool deleteOldElement = true) { - jassert (indexToChange >= 0); - if (indexToChange >= 0) { + ObjectClass* toDelete = 0; lock.enter(); if (indexToChange < numUsed) { - this->elements [indexToChange] = newValue; + if (deleteOldElement) + toDelete = this->elements [indexToChange]; + + if (toDelete == newObject) + toDelete = 0; + else + this->elements [indexToChange] = const_cast (newObject); } else { this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = newValue; + this->elements [numUsed++] = const_cast (newObject); } lock.exit(); - } - } - - /** Replaces an element with a new value without doing any bounds-checking. - - This just sets a value directly in the array's internal storage, so you'd - better make sure it's in range! - - @param indexToChange the index whose value you want to change - @param newValue the new value to set for this index. - @see set, getUnchecked - */ - void setUnchecked (const int indexToChange, - const ElementType newValue) throw() - { - lock.enter(); - jassert (((unsigned int) indexToChange) < (unsigned int) numUsed); - this->elements [indexToChange] = newValue; - lock.exit(); - } - - /** Adds elements from an array to the end of this array. - - @param elementsToAdd the array of elements to add - @param numElementsToAdd how many elements are in this other array - @see add - */ - void addArray (const ElementType* elementsToAdd, - int numElementsToAdd) throw() - { - lock.enter(); - - if (numElementsToAdd > 0) - { - this->ensureAllocatedSize (numUsed + numElementsToAdd); - - while (--numElementsToAdd >= 0) - this->elements [numUsed++] = *elementsToAdd++; - } - - lock.exit(); - } - - /** This swaps the contents of this array with those of another array. - - If you need to exchange two arrays, this is vastly quicker than using copy-by-value - because it just swaps their internal pointers. - */ - template - void swapWithArray (OtherArrayType& otherArray) throw() - { - lock.enter(); - otherArray.lock.enter(); - swapVariables (this->numUsed, otherArray.numUsed); - swapVariables (this->elements, otherArray.elements); - swapVariables (this->numAllocated, otherArray.numAllocated); - otherArray.lock.exit(); - lock.exit(); - } - - /** Adds elements from another array to the end of this array. - - @param arrayToAddFrom the array from which to copy the elements - @param startIndex the first element of the other array to start copying from - @param numElementsToAdd how many elements to add from the other array. If this - value is negative or greater than the number of available elements, - all available elements will be copied. - @see add - */ - template - void addArray (const OtherArrayType& arrayToAddFrom, - int startIndex = 0, - int numElementsToAdd = -1) throw() - { - arrayToAddFrom.lockArray(); - lock.enter(); - jassert (this != &arrayToAddFrom); - if (startIndex < 0) - { - jassertfalse - startIndex = 0; + delete toDelete; } - - if (numElementsToAdd < 0 || startIndex + numElementsToAdd > arrayToAddFrom.size()) - numElementsToAdd = arrayToAddFrom.size() - startIndex; - - this->addArray ((const ElementType*) (arrayToAddFrom.elements + startIndex), numElementsToAdd); - - lock.exit(); - arrayToAddFrom.unlockArray(); } - /** Inserts a new element into the array, assuming that the array is sorted. + /** Inserts a new object into the array assuming that the array is sorted. - This will use a comparator to find the position at which the new element + This will use a comparator to find the position at which the new object should go. If the array isn't sorted, the behaviour of this method will be unpredictable. - @param comparator the comparator to use to compare the elements - see the sort() - method for details about the form this object should take - @param newElement the new element to insert to the array - @see add, sort + @param comparator the comparator to use to compare the elements - see the sort method + for details about this object's structure + @param newObject the new object to insert to the array + @see add, sort, indexOfSorted */ template void addSorted (ElementComparator& comparator, - const ElementType newElement) throw() + ObjectClass* const newObject) throw() { + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused lock.enter(); - insert (findInsertIndexInSortedArray (comparator, this->elements, newElement, 0, numUsed), newElement); + insert (findInsertIndexInSortedArray (comparator, this->elements, newObject, 0, numUsed), newObject); lock.exit(); } - /** Finds the index of an element in the array, assuming that the array is sorted. + /** Finds the index of an object in the array, assuming that the array is sorted. This will use a comparator to do a binary-chop to find the index of the given element, if it exists. If the array isn't sorted, the behaviour of this @@ -5094,13 +4116,13 @@ public: @param comparator the comparator to use to compare the elements - see the sort() method for details about the form this object should take - @param elementToLookFor the element to search for + @param objectToLookFor the object to search for @returns the index of the element, or -1 if it's not found @see addSorted, sort */ template int indexOfSorted (ElementComparator& comparator, - const ElementType elementToLookFor) const throw() + const ObjectClass* const objectToLookFor) const throw() { (void) comparator; // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused @@ -5116,7 +4138,7 @@ public: lock.exit(); return -1; } - else if (comparator.compareElements (elementToLookFor, this->elements [start]) == 0) + else if (comparator.compareElements (objectToLookFor, this->elements [start]) == 0) { lock.exit(); return start; @@ -5130,7 +4152,7 @@ public: lock.exit(); return -1; } - else if (comparator.compareElements (elementToLookFor, this->elements [halfway]) >= 0) + else if (comparator.compareElements (objectToLookFor, this->elements [halfway]) >= 0) start = halfway; else end = halfway; @@ -5138,62 +4160,63 @@ public: } } - /** Removes an element from the array. + /** Removes an object from the array. - This will remove the element at a given index, and move back - all the subsequent elements to close the gap. + This will remove the object at a given index (optionally also + deleting it) and move back all the subsequent objects to close the gap. If the index passed in is out-of-range, nothing will happen. @param indexToRemove the index of the element to remove - @returns the element that has been removed - @see removeValue, removeRange + @param deleteObject whether to delete the object that is removed + @see removeObject, removeRange */ - ElementType remove (const int indexToRemove) throw() + void remove (const int indexToRemove, + const bool deleteObject = true) { lock.enter(); + ObjectClass* toDelete = 0; if (((unsigned int) indexToRemove) < (unsigned int) numUsed) { - --numUsed; + ObjectClass** const e = this->elements + indexToRemove; - ElementType* const e = this->elements + indexToRemove; - ElementType const removed = *e; - const int numberToShift = numUsed - indexToRemove; + if (deleteObject) + toDelete = *e; - if (numberToShift > 0) - memmove (e, e + 1, numberToShift * sizeof (ElementType)); + --numUsed; + const int numToShift = numUsed - indexToRemove; + + if (numToShift > 0) + memmove (e, e + 1, numToShift * sizeof (ObjectClass*)); if ((numUsed << 1) < this->numAllocated) minimiseStorageOverheads(); - - lock.exit(); - return removed; - } - else - { - lock.exit(); - return ElementType(); } + + lock.exit(); + + delete toDelete; } - /** Removes an item from the array. + /** Removes a specified object from the array. - This will remove the first occurrence of the given element from the array. If the item isn't found, no action is taken. - @param valueToRemove the object to try to remove + @param objectToRemove the object to try to remove + @param deleteObject whether to delete the object (if it's found) @see remove, removeRange */ - void removeValue (const ElementType valueToRemove) throw() + void removeObject (const ObjectClass* const objectToRemove, + const bool deleteObject = true) { lock.enter(); - ElementType* e = this->elements; + ObjectClass** e = this->elements; for (int i = numUsed; --i >= 0;) { - if (valueToRemove == *e) + if (objectToRemove == *e) { - remove ((int) (e - this->elements)); + remove ((int) (e - this->elements), deleteObject); break; } @@ -5203,20 +4226,22 @@ public: lock.exit(); } - /** Removes a range of elements from the array. + /** Removes a range of objects from the array. - This will remove a set of elements, starting from the given index, - and move subsequent elements down to close the gap. + This will remove a set of objects, starting from the given index, + and move any subsequent elements down to close the gap. If the range extends beyond the bounds of the array, it will be safely clipped to the size of the array. - @param startIndex the index of the first element to remove - @param numberToRemove how many elements should be removed - @see remove, removeValue + @param startIndex the index of the first object to remove + @param numberToRemove how many objects should be removed + @param deleteObjects whether to delete the objects that get removed + @see remove, removeObject */ void removeRange (int startIndex, - const int numberToRemove) throw() + const int numberToRemove, + const bool deleteObjects = true) { lock.enter(); const int endIndex = jlimit (0, numUsed, startIndex + numberToRemove); @@ -5224,8 +4249,17 @@ public: if (endIndex > startIndex) { + if (deleteObjects) + { + for (int i = startIndex; i < endIndex; ++i) + { + delete this->elements [i]; + this->elements [i] = 0; // (in case one of the destructors accesses this array and hits a dangling pointer) + } + } + const int rangeSize = endIndex - startIndex; - ElementType* e = this->elements + startIndex; + ObjectClass** e = this->elements + startIndex; int numToShift = numUsed - endIndex; numUsed -= rangeSize; @@ -5242,89 +4276,34 @@ public: lock.exit(); } - /** Removes the last n elements from the array. - - @param howManyToRemove how many elements to remove from the end of the array - @see remove, removeValue, removeRange - */ - void removeLast (const int howManyToRemove = 1) throw() - { - lock.enter(); - numUsed = jmax (0, numUsed - howManyToRemove); - - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); - - lock.exit(); - } - - /** Removes any elements which are also in another array. - - @param otherArray the other array in which to look for elements to remove - @see removeValuesNotIn, remove, removeValue, removeRange - */ - template - void removeValuesIn (const OtherArrayType& otherArray) throw() - { - otherArray.lockArray(); - lock.enter(); - - if (this == &otherArray) - { - clear(); - } - else - { - if (otherArray.size() > 0) - { - for (int i = numUsed; --i >= 0;) - if (otherArray.contains (this->elements [i])) - remove (i); - } - } - - lock.exit(); - otherArray.unlockArray(); - } - - /** Removes any elements which are not found in another array. - - Only elements which occur in this other array will be retained. + /** Removes the last n objects from the array. - @param otherArray the array in which to look for elements NOT to remove - @see removeValuesIn, remove, removeValue, removeRange + @param howManyToRemove how many objects to remove from the end of the array + @param deleteObjects whether to also delete the objects that are removed + @see remove, removeObject, removeRange */ - template - void removeValuesNotIn (const OtherArrayType& otherArray) throw() + void removeLast (int howManyToRemove = 1, + const bool deleteObjects = true) { - otherArray.lockArray(); lock.enter(); - if (this != &otherArray) + if (howManyToRemove >= numUsed) { - if (otherArray.size() <= 0) - { - clear(); - } - else - { - for (int i = numUsed; --i >= 0;) - if (! otherArray.contains (this->elements [i])) - remove (i); - } + clear (deleteObjects); + } + else + { + while (--howManyToRemove >= 0) + remove (numUsed - 1, deleteObjects); } lock.exit(); - otherArray.unlockArray(); } - /** Swaps over two elements in the array. - - This swaps over the elements found at the two indexes passed in. - If either index is out-of-range, this method will do nothing. + /** Swaps a pair of objects in the array. - @param index1 index of one of the elements to swap - @param index2 index of the other element to swap + If either of the indexes passed in is out-of-range, nothing will happen, + otherwise the two objects at these positions will be exchanged. */ void swap (const int index1, const int index2) throw() @@ -5332,7 +4311,7 @@ public: lock.enter(); if (((unsigned int) index1) < (unsigned int) numUsed - && ((unsigned int) index2) < (unsigned int) numUsed) + && ((unsigned int) index2) < (unsigned int) numUsed) { swapVariables (this->elements [index1], this->elements [index2]); @@ -5341,19 +4320,18 @@ public: lock.exit(); } - /** Moves one of the values to a different position. + /** Moves one of the objects to a different position. - This will move the value to a specified index, shuffling along + This will move the object to a specified index, shuffling along any intervening elements as required. So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. - @param currentIndex the index of the value to be moved. If this isn't a + @param currentIndex the index of the object to be moved. If this isn't a valid index, then nothing will be done - @param newIndex the index at which you'd like this value to end up. If this - is less than zero, the value will be moved to the end - of the array + @param newIndex the index at which you'd like this object to end up. If this + is less than zero, it will be moved to the end of the array */ void move (const int currentIndex, int newIndex) throw() @@ -5367,19 +4345,19 @@ public: if (((unsigned int) newIndex) >= (unsigned int) numUsed) newIndex = numUsed - 1; - const ElementType value = this->elements [currentIndex]; + ObjectClass* const value = this->elements [currentIndex]; if (newIndex > currentIndex) { memmove (this->elements + currentIndex, this->elements + currentIndex + 1, - (newIndex - currentIndex) * sizeof (ElementType)); + (newIndex - currentIndex) * sizeof (ObjectClass*)); } else { memmove (this->elements + newIndex + 1, this->elements + newIndex, - (currentIndex - newIndex) * sizeof (ElementType)); + (currentIndex - newIndex) * sizeof (ObjectClass*)); } this->elements [newIndex] = value; @@ -5389,6 +4367,23 @@ public: } } + /** This swaps the contents of this array with those of another array. + + If you need to exchange two arrays, this is vastly quicker than using copy-by-value + because it just swaps their internal pointers. + */ + template + void swapWithArray (OtherArrayType& otherArray) throw() + { + lock.enter(); + otherArray.lock.enter(); + swapVariables (this->numUsed, otherArray.numUsed); + swapVariables (this->elements, otherArray.elements); + swapVariables (this->numAllocated, otherArray.numAllocated); + otherArray.lock.exit(); + lock.exit(); + } + /** Reduces the amount of storage being used by the array. Arrays typically allocate slightly more storage than they need, and after @@ -5448,8 +4443,7 @@ public: be important in some cases. If it's false, a faster algorithm is used, but equivalent elements may be rearranged. - - @see addSorted, indexOfSorted, sortArray + @see sortArray, indexOfSorted */ template void sort (ElementComparator& comparator, @@ -5457,6 +4451,7 @@ public: { (void) comparator; // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused + lock.enter(); sortArray (comparator, this->elements, 0, size() - 1, retainOrderOfEquivalentItems); lock.exit(); @@ -5491,2399 +4486,3122 @@ public: private: int numUsed; TypeOfCriticalSectionToUse lock; + + // disallow copy constructor and assignment + OwnedArray (const OwnedArray&); + const OwnedArray& operator= (const OwnedArray&); }; -#endif // __JUCE_ARRAY_JUCEHEADER__ -/********* End of inlined file: juce_Array.h *********/ +#endif // __JUCE_OWNEDARRAY_JUCEHEADER__ +/********* End of inlined file: juce_OwnedArray.h *********/ -/** - A typedef for an Array of void*'s. +/********* Start of inlined file: juce_Time.h *********/ +#ifndef __JUCE_TIME_JUCEHEADER__ +#define __JUCE_TIME_JUCEHEADER__ - VoidArrays are used in various places throughout the library instead of - more strongly-typed arrays, to keep code-size low. +/********* Start of inlined file: juce_RelativeTime.h *********/ +#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ +#define __JUCE_RELATIVETIME_JUCEHEADER__ + +/** A relative measure of time. + + The time is stored as a number of seconds, at double-precision floating + point accuracy, and may be positive or negative. + + If you need an absolute time, (i.e. a date + time), see the Time class. */ -typedef Array VoidArray; +class JUCE_API RelativeTime +{ +public: -#endif // __JUCE_VOIDARRAY_JUCEHEADER__ -/********* End of inlined file: juce_VoidArray.h *********/ + /** Creates a RelativeTime. -#ifndef DOXYGEN - // (used in StringArray::appendNumbersToDuplicates) - static const tchar* const defaultPreNumberString = JUCE_T(" ("); - static const tchar* const defaultPostNumberString = JUCE_T(")"); -#endif + @param seconds the number of seconds, which may be +ve or -ve. + @see milliseconds, minutes, hours, days, weeks + */ + explicit RelativeTime (const double seconds = 0.0) throw(); + + /** Copies another relative time. */ + RelativeTime (const RelativeTime& other) throw(); + + /** Copies another relative time. */ + const RelativeTime& operator= (const RelativeTime& other) throw(); + + /** Destructor. */ + ~RelativeTime() throw(); + + /** Creates a new RelativeTime object representing a number of milliseconds. + + @see minutes, hours, days, weeks + */ + static const RelativeTime milliseconds (const int milliseconds) throw(); + + /** Creates a new RelativeTime object representing a number of milliseconds. + + @see minutes, hours, days, weeks + */ + static const RelativeTime milliseconds (const int64 milliseconds) throw(); + + /** Creates a new RelativeTime object representing a number of minutes. + + @see milliseconds, hours, days, weeks + */ + static const RelativeTime minutes (const double numberOfMinutes) throw(); + + /** Creates a new RelativeTime object representing a number of hours. + + @see milliseconds, minutes, days, weeks + */ + static const RelativeTime hours (const double numberOfHours) throw(); + + /** Creates a new RelativeTime object representing a number of days. + + @see milliseconds, minutes, hours, weeks + */ + static const RelativeTime days (const double numberOfDays) throw(); + + /** Creates a new RelativeTime object representing a number of weeks. + + @see milliseconds, minutes, hours, days + */ + static const RelativeTime weeks (const double numberOfWeeks) throw(); + + /** Returns the number of milliseconds this time represents. + + @see milliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks + */ + int64 inMilliseconds() const throw(); + + /** Returns the number of seconds this time represents. + + @see inMilliseconds, inMinutes, inHours, inDays, inWeeks + */ + double inSeconds() const throw() { return seconds; } + + /** Returns the number of minutes this time represents. + + @see inMilliseconds, inSeconds, inHours, inDays, inWeeks + */ + double inMinutes() const throw(); + + /** Returns the number of hours this time represents. + + @see inMilliseconds, inSeconds, inMinutes, inDays, inWeeks + */ + double inHours() const throw(); + + /** Returns the number of days this time represents. + + @see inMilliseconds, inSeconds, inMinutes, inHours, inWeeks + */ + double inDays() const throw(); + + /** Returns the number of weeks this time represents. + + @see inMilliseconds, inSeconds, inMinutes, inHours, inDays + */ + double inWeeks() const throw(); + + /** Returns a readable textual description of the time. + + The exact format of the string returned will depend on + the magnitude of the time - e.g. + + "1 min 4 secs", "1 hr 45 mins", "2 weeks 5 days", "140 ms" + + so that only the two most significant units are printed. + + The returnValueForZeroTime value is the result that is returned if the + length is zero. Depending on your application you might want to use this + to return something more relevant like "empty" or "0 secs", etc. + + @see inMilliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks + */ + const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw(); + + /** Compares two RelativeTimes. */ + bool operator== (const RelativeTime& other) const throw(); + /** Compares two RelativeTimes. */ + bool operator!= (const RelativeTime& other) const throw(); + + /** Compares two RelativeTimes. */ + bool operator> (const RelativeTime& other) const throw(); + /** Compares two RelativeTimes. */ + bool operator< (const RelativeTime& other) const throw(); + /** Compares two RelativeTimes. */ + bool operator>= (const RelativeTime& other) const throw(); + /** Compares two RelativeTimes. */ + bool operator<= (const RelativeTime& other) const throw(); + + /** Adds another RelativeTime to this one and returns the result. */ + const RelativeTime operator+ (const RelativeTime& timeToAdd) const throw(); + /** Subtracts another RelativeTime from this one and returns the result. */ + const RelativeTime operator- (const RelativeTime& timeToSubtract) const throw(); + + /** Adds a number of seconds to this RelativeTime and returns the result. */ + const RelativeTime operator+ (const double secondsToAdd) const throw(); + /** Subtracts a number of seconds from this RelativeTime and returns the result. */ + const RelativeTime operator- (const double secondsToSubtract) const throw(); + + /** Adds another RelativeTime to this one. */ + const RelativeTime& operator+= (const RelativeTime& timeToAdd) throw(); + /** Subtracts another RelativeTime from this one. */ + const RelativeTime& operator-= (const RelativeTime& timeToSubtract) throw(); + + /** Adds a number of seconds to this time. */ + const RelativeTime& operator+= (const double secondsToAdd) throw(); + + /** Subtracts a number of seconds from this time. */ + const RelativeTime& operator-= (const double secondsToSubtract) throw(); + + juce_UseDebuggingNewOperator + +private: + double seconds; +}; + +#endif // __JUCE_RELATIVETIME_JUCEHEADER__ +/********* End of inlined file: juce_RelativeTime.h *********/ /** - A special array for holding a list of strings. + Holds an absolute date and time. - @see String, StringPairArray + Internally, the time is stored at millisecond precision. + + @see RelativeTime */ -class JUCE_API StringArray +class JUCE_API Time { public: - /** Creates an empty string array */ - StringArray() throw(); + /** Creates a Time object. - /** Creates a copy of another string array */ - StringArray (const StringArray& other) throw(); + This default constructor creates a time of 1st January 1970, (which is + represented internally as 0ms). - /** Creates a copy of an array of string literals. + To create a time object representing the current time, use getCurrentTime(). - @param strings an array of strings to add. Null pointers in the array will be - treated as empty strings - @param numberOfStrings how many items there are in the array + @see getCurrentTime */ - StringArray (const juce_wchar** const strings, - const int numberOfStrings) throw(); + Time() throw(); - /** Creates a copy of an array of string literals. + /** Creates a copy of another Time object. */ + Time (const Time& other) throw(); - @param strings an array of strings to add. Null pointers in the array will be - treated as empty strings - @param numberOfStrings how many items there are in the array + /** Creates a time based on a number of milliseconds. + + The internal millisecond count is set to 0 (1st January 1970). To create a + time object set to the current time, use getCurrentTime(). + + @param millisecondsSinceEpoch the number of milliseconds since the unix + 'epoch' (midnight Jan 1st 1970). + @see getCurrentTime, currentTimeMillis */ - StringArray (const char** const strings, - const int numberOfStrings) throw(); + Time (const int64 millisecondsSinceEpoch) throw(); + + /** Creates a time from a set of date components. + + The timezone is assumed to be whatever the system is using as its locale. + + @param year the year, in 4-digit format, e.g. 2004 + @param month the month, in the range 0 to 11 + @param day the day of the month, in the range 1 to 31 + @param hours hours in 24-hour clock format, 0 to 23 + @param minutes minutes 0 to 59 + @param seconds seconds 0 to 59 + @param milliseconds milliseconds 0 to 999 + @param useLocalTime if true, encode using the current machine's local time; if + false, it will always work in GMT. + */ + Time (const int year, + const int month, + const int day, + const int hours, + const int minutes, + const int seconds = 0, + const int milliseconds = 0, + const bool useLocalTime = true) throw(); + + /** Destructor. */ + ~Time() throw(); + + /** Copies this time from another one. */ + const Time& operator= (const Time& other) throw(); + + /** Returns a Time object that is set to the current system time. + + @see currentTimeMillis + */ + static const Time JUCE_CALLTYPE getCurrentTime() throw(); + + /** Returns the time as a number of milliseconds. + + @returns the number of milliseconds this Time object represents, since + midnight jan 1st 1970. + @see getMilliseconds + */ + int64 toMilliseconds() const throw() { return millisSinceEpoch; } + + /** Returns the year. + + A 4-digit format is used, e.g. 2004. + */ + int getYear() const throw(); + + /** Returns the number of the month. + + The value returned is in the range 0 to 11. + @see getMonthName + */ + int getMonth() const throw(); + + /** Returns the name of the month. + + @param threeLetterVersion if true, it'll be a 3-letter abbreviation, e.g. "Jan"; if false + it'll return the long form, e.g. "January" + @see getMonth + */ + const String getMonthName (const bool threeLetterVersion) const throw(); + + /** Returns the day of the month. + + The value returned is in the range 1 to 31. + */ + int getDayOfMonth() const throw(); + + /** Returns the number of the day of the week. + + The value returned is in the range 0 to 6 (0 = sunday, 1 = monday, etc). + */ + int getDayOfWeek() const throw(); + + /** Returns the name of the weekday. + + @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if + false, it'll return the full version, e.g. "Tuesday". + */ + const String getWeekdayName (const bool threeLetterVersion) const throw(); + + /** Returns the number of hours since midnight. + + This is in 24-hour clock format, in the range 0 to 23. + + @see getHoursInAmPmFormat, isAfternoon + */ + int getHours() const throw(); + + /** Returns true if the time is in the afternoon. + + So it returns true for "PM", false for "AM". + + @see getHoursInAmPmFormat, getHours + */ + bool isAfternoon() const throw(); + + /** Returns the hours in 12-hour clock format. + + This will return a value 1 to 12 - use isAfternoon() to find out + whether this is in the afternoon or morning. + + @see getHours, isAfternoon + */ + int getHoursInAmPmFormat() const throw(); + + /** Returns the number of minutes, 0 to 59. */ + int getMinutes() const throw(); + + /** Returns the number of seconds, 0 to 59. */ + int getSeconds() const throw(); + + /** Returns the number of milliseconds, 0 to 999. + + Unlike toMilliseconds(), this just returns the position within the + current second rather than the total number since the epoch. + + @see toMilliseconds + */ + int getMilliseconds() const throw(); + + /** Returns true if the local timezone uses a daylight saving correction. */ + bool isDaylightSavingTime() const throw(); + + /** Returns a 3-character string to indicate the local timezone. */ + const String getTimeZone() const throw(); + + /** Quick way of getting a string version of a date and time. + + For a more powerful way of formatting the date and time, see the formatted() method. + + @param includeDate whether to include the date in the string + @param includeTime whether to include the time in the string + @param includeSeconds if the time is being included, this provides an option not to include + the seconds in it + @param use24HourClock if the time is being included, sets whether to use am/pm or 24 + hour notation. + @see formatted + */ + const String toString (const bool includeDate, + const bool includeTime, + const bool includeSeconds = true, + const bool use24HourClock = false) const throw(); + + /** Converts this date/time to a string with a user-defined format. + + This uses the C strftime() function to format this time as a string. To save you + looking it up, these are the escape codes that strftime uses (other codes might + work on some platforms and not others, but these are the common ones): + + %a is replaced by the locale's abbreviated weekday name. + %A is replaced by the locale's full weekday name. + %b is replaced by the locale's abbreviated month name. + %B is replaced by the locale's full month name. + %c is replaced by the locale's appropriate date and time representation. + %d is replaced by the day of the month as a decimal number [01,31]. + %H is replaced by the hour (24-hour clock) as a decimal number [00,23]. + %I is replaced by the hour (12-hour clock) as a decimal number [01,12]. + %j is replaced by the day of the year as a decimal number [001,366]. + %m is replaced by the month as a decimal number [01,12]. + %M is replaced by the minute as a decimal number [00,59]. + %p is replaced by the locale's equivalent of either a.m. or p.m. + %S is replaced by the second as a decimal number [00,61]. + %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. + %w is replaced by the weekday as a decimal number [0,6], with 0 representing Sunday. + %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0. + %x is replaced by the locale's appropriate date representation. + %X is replaced by the locale's appropriate time representation. + %y is replaced by the year without century as a decimal number [00,99]. + %Y is replaced by the year with century as a decimal number. + %Z is replaced by the timezone name or abbreviation, or by no bytes if no timezone information exists. + %% is replaced by %. + + @see toString + */ + const String formatted (const tchar* const format) const throw(); + + /** Adds a RelativeTime to this time and returns the result. */ + const Time operator+ (const RelativeTime& delta) const throw() { return Time (millisSinceEpoch + delta.inMilliseconds()); } + + /** Subtracts a RelativeTime from this time and returns the result. */ + const Time operator- (const RelativeTime& delta) const throw() { return Time (millisSinceEpoch - delta.inMilliseconds()); } + + /** Returns the relative time difference between this time and another one. */ + const RelativeTime operator- (const Time& other) const throw() { return RelativeTime::milliseconds (millisSinceEpoch - other.millisSinceEpoch); } + + /** Compares two Time objects. */ + bool operator== (const Time& other) const throw() { return millisSinceEpoch == other.millisSinceEpoch; } + + /** Compares two Time objects. */ + bool operator!= (const Time& other) const throw() { return millisSinceEpoch != other.millisSinceEpoch; } + + /** Compares two Time objects. */ + bool operator< (const Time& other) const throw() { return millisSinceEpoch < other.millisSinceEpoch; } + + /** Compares two Time objects. */ + bool operator<= (const Time& other) const throw() { return millisSinceEpoch <= other.millisSinceEpoch; } + + /** Compares two Time objects. */ + bool operator> (const Time& other) const throw() { return millisSinceEpoch > other.millisSinceEpoch; } + + /** Compares two Time objects. */ + bool operator>= (const Time& other) const throw() { return millisSinceEpoch >= other.millisSinceEpoch; } + + /** Tries to set the computer's clock. + + @returns true if this succeeds, although depending on the system, the + application might not have sufficient privileges to do this. + */ + bool setSystemTimeToThisTime() const throw(); + + /** Returns the name of a day of the week. + + @param dayNumber the day, 0 to 6 (0 = sunday, 1 = monday, etc) + @param threeLetterVersion if true, it'll return a 3-letter abbreviation, e.g. "Tue"; if + false, it'll return the full version, e.g. "Tuesday". + */ + static const String getWeekdayName (int dayNumber, + const bool threeLetterVersion) throw(); + + /** Returns the name of one of the months. + + @param monthNumber the month, 0 to 11 + @param threeLetterVersion if true, it'll be a 3-letter abbreviation, e.g. "Jan"; if false + it'll return the long form, e.g. "January" + */ + static const String getMonthName (int monthNumber, + const bool threeLetterVersion) throw(); + + // Static methods for getting system timers directly.. - /** Creates a copy of a null-terminated array of string literals. + /** Returns the current system time. - Each item from the array passed-in is added, until it encounters a null pointer, - at which point it stops. + Returns the number of milliseconds since midnight jan 1st 1970. + + Should be accurate to within a few millisecs, depending on platform, + hardware, etc. */ - StringArray (const juce_wchar** const strings) throw(); + static int64 currentTimeMillis() throw(); - /** Creates a copy of a null-terminated array of string literals. + /** Returns the number of millisecs since system startup. - Each item from the array passed-in is added, until it encounters a null pointer, - at which point it stops. + Should be accurate to within a few millisecs, depending on platform, + hardware, etc. + + @see getApproximateMillisecondCounter */ - StringArray (const char** const strings) throw(); + static uint32 getMillisecondCounter() throw(); - /** Destructor. */ - virtual ~StringArray() throw(); + /** Returns the number of millisecs since system startup. - /** Copies the contents of another string array into this one */ - const StringArray& operator= (const StringArray& other) throw(); + Same as getMillisecondCounter(), but returns a more accurate value, using + the high-res timer. - /** Compares two arrays. + @see getMillisecondCounter + */ + static double getMillisecondCounterHiRes() throw(); - Comparisons are case-sensitive. + /** Waits until the getMillisecondCounter() reaches a given value. - @returns true only if the other array contains exactly the same strings in the same order + This will make the thread sleep as efficiently as it can while it's waiting. */ - bool operator== (const StringArray& other) const throw(); + static void waitForMillisecondCounter (const uint32 targetTime) throw(); - /** Compares two arrays. + /** Less-accurate but faster version of getMillisecondCounter(). - Comparisons are case-sensitive. + This will return the last value that getMillisecondCounter() returned, so doesn't + need to make a system call, but is less accurate - it shouldn't be more than + 100ms away from the correct time, though, so is still accurate enough for a + lot of purposes. - @returns false if the other array contains exactly the same strings in the same order + @see getMillisecondCounter */ - bool operator!= (const StringArray& other) const throw(); + static uint32 getApproximateMillisecondCounter() throw(); - /** Returns the number of strings in the array */ - inline int size() const throw() { return strings.size(); }; + // High-resolution timers.. - /** Returns one of the strings from the array. + /** Returns the current high-resolution counter's tick-count. - If the index is out-of-range, an empty string is returned. + This is a similar idea to getMillisecondCounter(), but with a higher + resolution. - Obviously the reference returned shouldn't be stored for later use, as the - string it refers to may disappear when the array changes. + @see getHighResolutionTicksPerSecond, highResolutionTicksToSeconds, + secondsToHighResolutionTicks */ - const String& operator[] (const int index) const throw(); - - /** Searches for a string in the array. + static int64 getHighResolutionTicks() throw(); - The comparison will be case-insensitive if the ignoreCase parameter is true. + /** Returns the resolution of the high-resolution counter in ticks per second. - @returns true if the string is found inside the array + @see getHighResolutionTicks, highResolutionTicksToSeconds, + secondsToHighResolutionTicks */ - bool contains (const String& stringToLookFor, - const bool ignoreCase = false) const throw(); + static int64 getHighResolutionTicksPerSecond() throw(); - /** Searches for a string in the array. + /** Converts a number of high-resolution ticks into seconds. - The comparison will be case-insensitive if the ignoreCase parameter is true. + @see getHighResolutionTicks, getHighResolutionTicksPerSecond, + secondsToHighResolutionTicks + */ + static double highResolutionTicksToSeconds (const int64 ticks) throw(); - @param stringToLookFor the string to try to find - @param ignoreCase whether the comparison should be case-insensitive - @param startIndex the first index to start searching from - @returns the index of the first occurrence of the string in this array, - or -1 if it isn't found. + /** Converts a number seconds into high-resolution ticks. + + @see getHighResolutionTicks, getHighResolutionTicksPerSecond, + highResolutionTicksToSeconds */ - int indexOf (const String& stringToLookFor, - const bool ignoreCase = false, - int startIndex = 0) const throw(); + static int64 secondsToHighResolutionTicks (const double seconds) throw(); - /** Appends a string at the end of the array. */ - void add (const String& stringToAdd) throw(); +private: - /** Inserts a string into the array. + int64 millisSinceEpoch; +}; - This will insert a string into the array at the given index, moving - up the other elements to make room for it. - If the index is less than zero or greater than the size of the array, - the new string will be added to the end of the array. - */ - void insert (const int index, - const String& stringToAdd) throw(); +#endif // __JUCE_TIME_JUCEHEADER__ +/********* End of inlined file: juce_Time.h *********/ - /** Adds a string to the array as long as it's not already in there. +/********* Start of inlined file: juce_StringArray.h *********/ +#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ +#define __JUCE_STRINGARRAY_JUCEHEADER__ - The search can optionally be case-insensitive. - */ - void addIfNotAlreadyThere (const String& stringToAdd, - const bool ignoreCase = false) throw(); +/********* Start of inlined file: juce_VoidArray.h *********/ +#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ +#define __JUCE_VOIDARRAY_JUCEHEADER__ - /** Replaces one of the strings in the array with another one. +/********* Start of inlined file: juce_Array.h *********/ +#ifndef __JUCE_ARRAY_JUCEHEADER__ +#define __JUCE_ARRAY_JUCEHEADER__ - If the index is higher than the array's size, the new string will be - added to the end of the array; if it's less than zero nothing happens. - */ - void set (const int index, - const String& newString) throw(); +/** + Holds a list of primitive objects, such as ints, doubles, or pointers. - /** Appends some strings from another array to the end of this one. + Examples of arrays are: Array or Array - @param other the array to add - @param startIndex the first element of the other array to add - @param numElementsToAdd the maximum number of elements to add (if this is - less than zero, they are all added) - */ - void addArray (const StringArray& other, - int startIndex = 0, - int numElementsToAdd = -1) throw(); + Note that when holding pointers to objects, the array doesn't take any ownership + of the objects - for doing this, see the OwnedArray class or the ReferenceCountedArray class. - /** Breaks up a string into tokens and adds them to this array. + If you're using a class or struct as the element type, it must be + capable of being copied or moved with a straightforward memcpy, rather than + needing construction and destruction code. - This will tokenise the given string using whitespace characters as the - token delimiters, and will add these tokens to the end of the array. + For holding lists of strings, use the specialised class StringArray. - @returns the number of tokens added - */ - int addTokens (const tchar* const stringToTokenise, - const bool preserveQuotedStrings) throw(); + To make all the array's methods thread-safe, pass in "CriticalSection" as the templated + TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. - /** Breaks up a string into tokens and adds them to this array. + @see OwnedArray, ReferenceCountedArray, StringArray, CriticalSection +*/ +template +class Array : private ArrayAllocationBase +{ +public: - This will tokenise the given string (using the string passed in to define the - token delimiters), and will add these tokens to the end of the array. + /** Creates an empty array. - @param stringToTokenise the string to tokenise - @param breakCharacters a string of characters, any of which will be considered - to be a token delimiter. - @param quoteCharacters if this string isn't empty, it defines a set of characters - which are treated as quotes. Any text occurring - between quotes is not broken up into tokens. - @returns the number of tokens added - */ - int addTokens (const tchar* const stringToTokenise, - const tchar* breakCharacters, - const tchar* quoteCharacters) throw(); + @param granularity this is the size of increment by which the internal storage + used by the array will grow. Only change it from the default if you know the + array is going to be very big and needs to be able to grow efficiently. - /** Breaks up a string into lines and adds them to this array. + @see ArrayAllocationBase + */ + Array (const int granularity = juceDefaultArrayGranularity) throw() + : ArrayAllocationBase (granularity), + numUsed (0) + { + } - This breaks a string down into lines separated by \\n or \\r\\n, and adds each line - to the array. Line-break characters are omitted from the strings that are added to - the array. + /** Creates a copy of another array. + @param other the array to copy */ - int addLines (const tchar* stringToBreakUp) throw(); + Array (const Array& other) throw() + : ArrayAllocationBase (other.granularity) + { + other.lockArray(); + numUsed = other.numUsed; + this->setAllocatedSize (other.numUsed); + memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); + other.unlockArray(); + } - /** Removes all elements from the array. */ - void clear() throw(); + /** Initalises from a null-terminated C array of values. - /** Removes a string from the array. + @param values the array to copy from + */ + Array (const ElementType* values) throw() + : ArrayAllocationBase (juceDefaultArrayGranularity), + numUsed (0) + { + while (*values != 0) + add (*values++); + } - If the index is out-of-range, no action will be taken. + /** Initalises from a C array of values. + + @param values the array to copy from + @param numValues the number of values in the array */ - void remove (const int index) throw(); + Array (const ElementType* values, int numValues) throw() + : ArrayAllocationBase (juceDefaultArrayGranularity), + numUsed (numValues) + { + this->setAllocatedSize (numValues); + memcpy (this->elements, values, numValues * sizeof (ElementType)); + } - /** Finds a string in the array and removes it. + /** Destructor. */ + ~Array() throw() + { + } - This will remove the first occurrence of the given string from the array. The - comparison may be case-insensitive depending on the ignoreCase parameter. + /** Copies another array. + @param other the array to copy */ - void removeString (const String& stringToRemove, - const bool ignoreCase = false) throw(); + const Array & operator= (const Array & other) throw() + { + if (this != &other) + { + other.lockArray(); + lock.enter(); - /** Removes any duplicated elements from the array. + this->granularity = other.granularity; + this->ensureAllocatedSize (other.size()); + numUsed = other.numUsed; + memcpy (this->elements, other.elements, this->numUsed * sizeof (ElementType)); + minimiseStorageOverheads(); - If any string appears in the array more than once, only the first occurrence of - it will be retained. + lock.exit(); + other.unlockArray(); + } - @param ignoreCase whether to use a case-insensitive comparison + return *this; + } + + /** Compares this array to another one. + Two arrays are considered equal if they both contain the same set of + elements, in the same order. + @param other the other array to compare with */ - void removeDuplicates (const bool ignoreCase) throw(); + template + bool operator== (const OtherArrayType& other) const throw() + { + lock.enter(); - /** Removes empty strings from the array. + if (this->numUsed != other.numUsed) + { + lock.exit(); + return false; + } - @param removeWhitespaceStrings if true, strings that only contain whitespace - characters will also be removed + for (int i = numUsed; --i >= 0;) + { + if (this->elements [i] != other.elements [i]) + { + lock.exit(); + return false; + } + } + + lock.exit(); + return true; + } + + /** Compares this array to another one. + Two arrays are considered equal if they both contain the same set of + elements, in the same order. + @param other the other array to compare with */ - void removeEmptyStrings (const bool removeWhitespaceStrings = true) throw(); + template + bool operator!= (const OtherArrayType& other) const throw() + { + return ! operator== (other); + } - /** Moves one of the strings to a different position. + /** Removes all elements from the array. + This will remove all the elements, and free any storage that the array is + using. To clear the array without freeing the storage, use the clearQuick() + method instead. - This will move the string to a specified index, shuffling along - any intervening elements as required. + @see clearQuick + */ + void clear() throw() + { + lock.enter(); + this->setAllocatedSize (0); + numUsed = 0; + lock.exit(); + } - So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling - move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. + /** Removes all elements from the array without freeing the array's allocated storage. - @param currentIndex the index of the value to be moved. If this isn't a - valid index, then nothing will be done - @param newIndex the index at which you'd like this value to end up. If this - is less than zero, the value will be moved to the end - of the array + @see clear */ - void move (const int currentIndex, int newIndex) throw(); + void clearQuick() throw() + { + lock.enter(); + numUsed = 0; + lock.exit(); + } - /** Deletes any whitespace characters from the starts and ends of all the strings. */ - void trim() throw(); + /** Returns the current number of elements in the array. + */ + inline int size() const throw() + { + return numUsed; + } - /** Adds numbers to the strings in the array, to make each string unique. + /** Returns one of the elements in the array. + If the index passed in is beyond the range of valid elements, this + will return zero. - This will add numbers to the ends of groups of similar strings. - e.g. if there are two "moose" strings, they will become "moose (1)" and "moose (2)" + If you're certain that the index will always be a valid element, you + can call getUnchecked() instead, which is faster. - @param ignoreCaseWhenComparing whether the comparison used is case-insensitive - @param appendNumberToFirstInstance whether the first of a group of similar strings - also has a number appended to it. - @param preNumberString when adding a number, this string is added before the number - @param postNumberString this string is appended after any numbers that are added + @param index the index of the element being requested (0 is the first element in the array) + @see getUnchecked, getFirst, getLast */ - void appendNumbersToDuplicates (const bool ignoreCaseWhenComparing, - const bool appendNumberToFirstInstance, - const tchar* const preNumberString = defaultPreNumberString, - const tchar* const postNumberString = defaultPostNumberString) throw(); + inline ElementType operator[] (const int index) const throw() + { + lock.enter(); + const ElementType result = (((unsigned int) index) < (unsigned int) numUsed) + ? this->elements [index] + : ElementType(); + lock.exit(); - /** Joins the strings in the array together into one string. + return result; + } - This will join a range of elements from the array into a string, separating - them with a given string. + /** Returns one of the elements in the array, without checking the index passed in. - e.g. joinIntoString (",") will turn an array of "a" "b" and "c" into "a,b,c". + Unlike the operator[] method, this will try to return an element without + checking that the index is within the bounds of the array, so should only + be used when you're confident that it will always be a valid index. - @param separatorString the string to insert between all the strings - @param startIndex the first element to join - @param numberOfElements how many elements to join together. If this is less - than zero, all available elements will be used. + @param index the index of the element being requested (0 is the first element in the array) + @see operator[], getFirst, getLast */ - const String joinIntoString (const String& separatorString, - int startIndex = 0, - int numberOfElements = -1) const throw(); + inline ElementType getUnchecked (const int index) const throw() + { + lock.enter(); + jassert (((unsigned int) index) < (unsigned int) numUsed); + const ElementType result = this->elements [index]; + lock.exit(); - /** Sorts the array into alphabetical order. + return result; + } - @param ignoreCase if true, the comparisons used will be case-sensitive. - */ - void sort (const bool ignoreCase) throw(); + /** Returns a direct reference to one of the elements in the array, without checking the index passed in. - /** Reduces the amount of storage being used by the array. + This is like getUnchecked, but returns a direct reference to the element, so that + you can alter it directly. Obviously this can be dangerous, so only use it when + absolutely necessary. - Arrays typically allocate slightly more storage than they need, and after - removing elements, they may have quite a lot of unused space allocated. - This method will reduce the amount of allocated storage to a minimum. + @param index the index of the element being requested (0 is the first element in the array) + @see operator[], getFirst, getLast */ - void minimiseStorageOverheads() throw(); + inline ElementType& getReference (const int index) const throw() + { + lock.enter(); + jassert (((unsigned int) index) < (unsigned int) numUsed); + ElementType& result = this->elements [index]; + lock.exit(); + return result; + } - juce_UseDebuggingNewOperator + /** Returns the first element in the array, or 0 if the array is empty. -private: - VoidArray strings; -}; + @see operator[], getUnchecked, getLast + */ + inline ElementType getFirst() const throw() + { + lock.enter(); + const ElementType result = (numUsed > 0) ? this->elements [0] + : ElementType(); + lock.exit(); -#endif // __JUCE_STRINGARRAY_JUCEHEADER__ -/********* End of inlined file: juce_StringArray.h *********/ + return result; + } -/********* Start of inlined file: juce_MemoryBlock.h *********/ -#ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ -#define __JUCE_MEMORYBLOCK_JUCEHEADER__ + /** Returns the last element in the array, or 0 if the array is empty. -/** - A class to hold a resizable block of raw data. + @see operator[], getUnchecked, getFirst + */ + inline ElementType getLast() const throw() + { + lock.enter(); + const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1] + : ElementType(); + lock.exit(); -*/ -class JUCE_API MemoryBlock -{ -public: + return result; + } - /** Create an uninitialised block with 0 size. */ - MemoryBlock() throw(); + /** Finds the index of the first element which matches the value passed in. - /** Creates a memory block with a given initial size. + This will search the array for the given object, and return the index + of its first occurrence. If the object isn't found, the method will return -1. - @param initialSize the size of block to create - @param initialiseToZero whether to clear the memory or just leave it uninitialised + @param elementToLookFor the value or object to look for + @returns the index of the object, or -1 if it's not found */ - MemoryBlock (const int initialSize, - const bool initialiseToZero = false) throw(); + int indexOf (const ElementType elementToLookFor) const throw() + { + int result = -1; - /** Creates a copy of another memory block. */ - MemoryBlock (const MemoryBlock& other) throw(); + lock.enter(); + const ElementType* e = this->elements; - /** Creates a memory block using a copy of a block of data. + for (int i = numUsed; --i >= 0;) + { + if (elementToLookFor == *e) + { + result = (int) (e - this->elements); + break; + } - @param dataToInitialiseFrom some data to copy into this block - @param sizeInBytes how much space to use - */ - MemoryBlock (const void* const dataToInitialiseFrom, - const int sizeInBytes) throw(); + ++e; + } - /** Destructor. */ - ~MemoryBlock() throw(); + lock.exit(); + return result; + } - /** Copies another memory block onto this one. + /** Returns true if the array contains at least one occurrence of an object. - This block will be resized and copied to exactly match the other one. + @param elementToLookFor the value or object to look for + @returns true if the item is found */ - const MemoryBlock& operator= (const MemoryBlock& other) throw(); + bool contains (const ElementType elementToLookFor) const throw() + { + lock.enter(); + + const ElementType* e = this->elements; + int num = numUsed; + + while (num >= 4) + { + if (*e == elementToLookFor + || *++e == elementToLookFor + || *++e == elementToLookFor + || *++e == elementToLookFor) + { + lock.exit(); + return true; + } - /** Compares two memory blocks. + num -= 4; + ++e; + } - @returns true only if the two blocks are the same size and have identical contents. - */ - bool operator== (const MemoryBlock& other) const throw(); + while (num > 0) + { + if (elementToLookFor == *e) + { + lock.exit(); + return true; + } - /** Compares two memory blocks. + --num; + ++e; + } - @returns true if the two blocks are different sizes or have different contents. - */ - bool operator!= (const MemoryBlock& other) const throw(); + lock.exit(); + return false; + } - /** Returns a pointer to the data, casting it to any type of primitive data required. + /** Appends a new element at the end of the array. - Note that the pointer returned will probably become invalid when the - block is resized. + @param newElement the new object to add to the array + @see set, insert, addIfNotAlreadyThere, addSorted, addArray */ - template - operator DataType*() const throw() { return (DataType*) data; } - - /** Returns a void pointer to the data. + void add (const ElementType newElement) throw() + { + lock.enter(); + this->ensureAllocatedSize (numUsed + 1); + this->elements [numUsed++] = newElement; + lock.exit(); + } - Note that the pointer returned will probably become invalid when the - block is resized. - */ - void* getData() const throw() { return data; } + /** Inserts a new element into the array at a given position. - /** Returns a byte from the memory block. + If the index is less than 0 or greater than the size of the array, the + element will be added to the end of the array. + Otherwise, it will be inserted into the array, moving all the later elements + along to make room. - This returns a reference, so you can also use it to set a byte. + @param indexToInsertAt the index at which the new element should be + inserted (pass in -1 to add it to the end) + @param newElement the new object to add to the array + @see add, addSorted, set */ - char& operator[] (const int offset) const throw() { return data [offset]; } - - /** Returns the block's current allocated size, in bytes. */ - int getSize() const throw() { return size; } + void insert (int indexToInsertAt, const ElementType newElement) throw() + { + lock.enter(); + this->ensureAllocatedSize (numUsed + 1); - /** Resizes the memory block. + if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) + { + ElementType* const insertPos = this->elements + indexToInsertAt; + const int numberToMove = numUsed - indexToInsertAt; - This will try to keep as much of the block's current content as it can, - and can optionally be made to clear any new space that gets allocated at - the end of the block. + if (numberToMove > 0) + memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); - @param newSize the new desired size for the block - @param initialiseNewSpaceToZero if the block gets enlarged, this determines - whether to clear the new section or just leave it - uninitialised - @see ensureSize - */ - void setSize (const int newSize, - const bool initialiseNewSpaceToZero = false) throw(); + *insertPos = newElement; + ++numUsed; + } + else + { + this->elements [numUsed++] = newElement; + } - /** Increases the block's size only if it's smaller than a given size. + lock.exit(); + } - @param minimumSize if the block is already bigger than this size, no action - will be taken; otherwise it will be increased to this size - @param initialiseNewSpaceToZero if the block gets enlarged, this determines - whether to clear the new section or just leave it - uninitialised - @see setSize - */ - void ensureSize (const int minimumSize, - const bool initialiseNewSpaceToZero = false) throw(); + /** Inserts multiple copies of an element into the array at a given position. - /** Fills the entire memory block with a repeated byte value. + If the index is less than 0 or greater than the size of the array, the + element will be added to the end of the array. + Otherwise, it will be inserted into the array, moving all the later elements + along to make room. - This is handy for clearing a block of memory to zero. + @param indexToInsertAt the index at which the new element should be inserted + @param newElement the new object to add to the array + @param numberOfTimesToInsertIt how many copies of the value to insert + @see insert, add, addSorted, set */ - void fillWith (const uint8 valueToUse) throw(); + void insertMultiple (int indexToInsertAt, const ElementType newElement, + int numberOfTimesToInsertIt) throw() + { + if (numberOfTimesToInsertIt > 0) + { + lock.enter(); + this->ensureAllocatedSize (numUsed + numberOfTimesToInsertIt); - /** Adds another block of data to the end of this one. + if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) + { + ElementType* insertPos = this->elements + indexToInsertAt; + const int numberToMove = numUsed - indexToInsertAt; - This block's size will be increased accordingly. - */ - void append (const void* const data, - const int numBytes) throw(); + memmove (insertPos + numberOfTimesToInsertIt, insertPos, numberToMove * sizeof (ElementType)); + numUsed += numberOfTimesToInsertIt; - /** Copies data into this MemoryBlock from a memory address. + while (--numberOfTimesToInsertIt >= 0) + *insertPos++ = newElement; + } + else + { + while (--numberOfTimesToInsertIt >= 0) + this->elements [numUsed++] = newElement; + } - @param srcData the memory location of the data to copy into this block - @param destinationOffset the offset in this block at which the data being copied should begin - @param numBytes how much to copy in (if this goes beyond the size of the memory block, - it will be clipped so not to do anything nasty) - */ - void copyFrom (const void* srcData, - int destinationOffset, - int numBytes) throw(); + lock.exit(); + } + } - /** Copies data from this MemoryBlock to a memory address. + /** Inserts an array of values into this array at a given position. - @param destData the memory location to write to - @param sourceOffset the offset within this block from which the copied data will be read - @param numBytes how much to copy (if this extends beyond the limits of the memory block, - zeros will be used for that portion of the data) + If the index is less than 0 or greater than the size of the array, the + new elements will be added to the end of the array. + Otherwise, they will be inserted into the array, moving all the later elements + along to make room. + + @param indexToInsertAt the index at which the first new element should be inserted + @param newElements the new values to add to the array + @param numberOfElements how many items are in the array + @see insert, add, addSorted, set */ - void copyTo (void* destData, - int sourceOffset, - int numBytes) const throw(); + void insertArray (int indexToInsertAt, + const ElementType* newElements, + int numberOfElements) throw() + { + if (numberOfElements > 0) + { + lock.enter(); + this->ensureAllocatedSize (numUsed + numberOfElements); - /** Chops out a section of the block. + if (((unsigned int) indexToInsertAt) < (unsigned int) numUsed) + { + ElementType* insertPos = this->elements + indexToInsertAt; + const int numberToMove = numUsed - indexToInsertAt; - This will remove a section of the memory block and close the gap around it, - shifting any subsequent data downwards and reducing the size of the block. + memmove (insertPos + numberOfElements, insertPos, numberToMove * sizeof (ElementType)); + numUsed += numberOfElements; - If the range specified goes beyond the size of the block, it will be clipped. - */ - void removeSection (int startByte, int numBytesToRemove) throw(); + while (--numberOfElements >= 0) + *insertPos++ = *newElements++; + } + else + { + while (--numberOfElements >= 0) + this->elements [numUsed++] = *newElements++; + } - /** Attempts to parse the contents of the block as a zero-terminated string of 8-bit - characters in the system's default encoding. */ - const String toString() const throw(); + lock.exit(); + } + } - /** Parses a string of hexadecimal numbers and writes this data into the memory block. + /** Appends a new element at the end of the array as long as the array doesn't + already contain it. - The block will be resized to the number of valid bytes read from the string. - Non-hex characters in the string will be ignored. + If the array already contains an element that matches the one passed in, nothing + will be done. - @see String::toHexString() + @param newElement the new object to add to the array */ - void loadFromHexString (const String& sourceHexString) throw(); + void addIfNotAlreadyThere (const ElementType newElement) throw() + { + lock.enter(); - /** Sets a number of bits in the memory block, treating it as a long binary sequence. */ - void setBitRange (int bitRangeStart, - int numBits, - int binaryNumberToApply) throw(); + if (! contains (newElement)) + add (newElement); - /** Reads a number of bits from the memory block, treating it as one long binary sequence */ - int getBitRange (int bitRangeStart, - int numBitsToRead) const throw(); + lock.exit(); + } - /** Returns a string of characters that represent the binary contents of this block. + /** Replaces an element with a new value. - Uses a 64-bit encoding system to allow binary data to be turned into a string - of simple non-extended characters, e.g. for storage in XML. + If the index is less than zero, this method does nothing. + If the index is beyond the end of the array, the item is added to the end of the array. - @see fromBase64Encoding + @param indexToChange the index whose value you want to change + @param newValue the new value to set for this index. + @see add, insert */ - const String toBase64Encoding() const throw(); + void set (const int indexToChange, + const ElementType newValue) throw() + { + jassert (indexToChange >= 0); - /** Takes a string of encoded characters and turns it into binary data. + if (indexToChange >= 0) + { + lock.enter(); - The string passed in must have been created by to64BitEncoding(), and this - block will be resized to recreate the original data block. + if (indexToChange < numUsed) + { + this->elements [indexToChange] = newValue; + } + else + { + this->ensureAllocatedSize (numUsed + 1); + this->elements [numUsed++] = newValue; + } - @see toBase64Encoding - */ - bool fromBase64Encoding (const String& encodedString) throw(); + lock.exit(); + } + } - juce_UseDebuggingNewOperator + /** Replaces an element with a new value without doing any bounds-checking. -private: + This just sets a value directly in the array's internal storage, so you'd + better make sure it's in range! - char* data; - int size; -}; + @param indexToChange the index whose value you want to change + @param newValue the new value to set for this index. + @see set, getUnchecked + */ + void setUnchecked (const int indexToChange, + const ElementType newValue) throw() + { + lock.enter(); + jassert (((unsigned int) indexToChange) < (unsigned int) numUsed); + this->elements [indexToChange] = newValue; + lock.exit(); + } -#endif // __JUCE_MEMORYBLOCK_JUCEHEADER__ -/********* End of inlined file: juce_MemoryBlock.h *********/ + /** Adds elements from an array to the end of this array. -class FileInputStream; -class FileOutputStream; + @param elementsToAdd the array of elements to add + @param numElementsToAdd how many elements are in this other array + @see add + */ + void addArray (const ElementType* elementsToAdd, + int numElementsToAdd) throw() + { + lock.enter(); -/** - Represents a local file or directory. + if (numElementsToAdd > 0) + { + this->ensureAllocatedSize (numUsed + numElementsToAdd); - This class encapsulates the absolute pathname of a file or directory, and - has methods for finding out about the file and changing its properties. + while (--numElementsToAdd >= 0) + this->elements [numUsed++] = *elementsToAdd++; + } - To read or write to the file, there are methods for returning an input or - output stream. + lock.exit(); + } - @see FileInputStream, FileOutputStream -*/ -class JUCE_API File -{ -public: + /** This swaps the contents of this array with those of another array. - /** Creates an (invalid) file object. + If you need to exchange two arrays, this is vastly quicker than using copy-by-value + because it just swaps their internal pointers. + */ + template + void swapWithArray (OtherArrayType& otherArray) throw() + { + lock.enter(); + otherArray.lock.enter(); + swapVariables (this->numUsed, otherArray.numUsed); + swapVariables (this->elements, otherArray.elements); + swapVariables (this->numAllocated, otherArray.numAllocated); + otherArray.lock.exit(); + lock.exit(); + } - The file is initially set to an empty path, so getFullPath() will return - an empty string, and comparing the file to File::nonexistent will return - true. + /** Adds elements from another array to the end of this array. - You can use its operator= method to point it at a proper file. + @param arrayToAddFrom the array from which to copy the elements + @param startIndex the first element of the other array to start copying from + @param numElementsToAdd how many elements to add from the other array. If this + value is negative or greater than the number of available elements, + all available elements will be copied. + @see add */ - File() throw() {} - - /** Creates a file from an absolute path. + template + void addArray (const OtherArrayType& arrayToAddFrom, + int startIndex = 0, + int numElementsToAdd = -1) throw() + { + arrayToAddFrom.lockArray(); + lock.enter(); + jassert (this != &arrayToAddFrom); - If the path supplied is a relative path, it is taken to be relative - to the current working directory (see File::getCurrentWorkingDirectory()), - but this isn't a recommended way of creating a file, because you - never know what the CWD is going to be. + if (startIndex < 0) + { + jassertfalse + startIndex = 0; + } - On the Mac/Linux, the path can include "~" notation for referring to - user home directories. - */ - File (const String& path) throw(); + if (numElementsToAdd < 0 || startIndex + numElementsToAdd > arrayToAddFrom.size()) + numElementsToAdd = arrayToAddFrom.size() - startIndex; - /** Creates a copy of another file object. */ - File (const File& other) throw(); + this->addArray ((const ElementType*) (arrayToAddFrom.elements + startIndex), numElementsToAdd); - /** Destructor. */ - ~File() throw() {} + lock.exit(); + arrayToAddFrom.unlockArray(); + } - /** Sets the file based on an absolute pathname. + /** Inserts a new element into the array, assuming that the array is sorted. - If the path supplied is a relative path, it is taken to be relative - to the current working directory (see File::getCurrentWorkingDirectory()), - but this isn't a recommended way of creating a file, because you - never know what the CWD is going to be. + This will use a comparator to find the position at which the new element + should go. If the array isn't sorted, the behaviour of this + method will be unpredictable. - On the Mac/Linux, the path can include "~" notation for referring to - user home directories. + @param comparator the comparator to use to compare the elements - see the sort() + method for details about the form this object should take + @param newElement the new element to insert to the array + @see add, sort */ - const File& operator= (const String& newFilePath) throw(); - - /** Copies from another file object. */ - const File& operator= (const File& otherFile) throw(); + template + void addSorted (ElementComparator& comparator, + const ElementType newElement) throw() + { + lock.enter(); + insert (findInsertIndexInSortedArray (comparator, this->elements, newElement, 0, numUsed), newElement); + lock.exit(); + } - /** This static constant is used for referring to an 'invalid' file. */ - static const File nonexistent; + /** Finds the index of an element in the array, assuming that the array is sorted. - /** Checks whether the file actually exists. + This will use a comparator to do a binary-chop to find the index of the given + element, if it exists. If the array isn't sorted, the behaviour of this + method will be unpredictable. - @returns true if the file exists, either as a file or a directory. - @see existsAsFile, isDirectory + @param comparator the comparator to use to compare the elements - see the sort() + method for details about the form this object should take + @param elementToLookFor the element to search for + @returns the index of the element, or -1 if it's not found + @see addSorted, sort */ - bool exists() const throw(); + template + int indexOfSorted (ElementComparator& comparator, + const ElementType elementToLookFor) const throw() + { + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused + lock.enter(); - /** Checks whether the file exists and is a file rather than a directory. + int start = 0; + int end = numUsed; - @returns true only if this is a real file, false if it's a directory - or doesn't exist - @see exists, isDirectory - */ - bool existsAsFile() const throw(); + for (;;) + { + if (start >= end) + { + lock.exit(); + return -1; + } + else if (comparator.compareElements (elementToLookFor, this->elements [start]) == 0) + { + lock.exit(); + return start; + } + else + { + const int halfway = (start + end) >> 1; - /** Checks whether the file is a directory that exists. + if (halfway == start) + { + lock.exit(); + return -1; + } + else if (comparator.compareElements (elementToLookFor, this->elements [halfway]) >= 0) + start = halfway; + else + end = halfway; + } + } + } - @returns true only if the file is a directory which actually exists, so - false if it's a file or doesn't exist at all - @see exists, existsAsFile - */ - bool isDirectory() const throw(); + /** Removes an element from the array. - /** Returns the size of the file in bytes. + This will remove the element at a given index, and move back + all the subsequent elements to close the gap. + If the index passed in is out-of-range, nothing will happen. - @returns the number of bytes in the file, or 0 if it doesn't exist. + @param indexToRemove the index of the element to remove + @returns the element that has been removed + @see removeValue, removeRange */ - int64 getSize() const throw(); + ElementType remove (const int indexToRemove) throw() + { + lock.enter(); - /** Utility function to convert a file size in bytes to a neat string description. + if (((unsigned int) indexToRemove) < (unsigned int) numUsed) + { + --numUsed; - So for example 100 would return "100 bytes", 2000 would return "2 KB", - 2000000 would produce "2 MB", etc. - */ - static const String descriptionOfSizeInBytes (const int64 bytes); + ElementType* const e = this->elements + indexToRemove; + ElementType const removed = *e; + const int numberToShift = numUsed - indexToRemove; - /** Returns the complete, absolute path of this file. + if (numberToShift > 0) + memmove (e, e + 1, numberToShift * sizeof (ElementType)); - This includes the filename and all its parent folders. On Windows it'll - also include the drive letter prefix; on Mac or Linux it'll be a complete - path starting from the root folder. + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); + + lock.exit(); + return removed; + } + else + { + lock.exit(); + return ElementType(); + } + } + + /** Removes an item from the array. - If you just want the file's name, you should use getFileName() or - getFileNameWithoutExtension(). + This will remove the first occurrence of the given element from the array. + If the item isn't found, no action is taken. - @see getFileName, getRelativePathFrom + @param valueToRemove the object to try to remove + @see remove, removeRange */ - const String& getFullPathName() const throw() { return fullPath; } + void removeValue (const ElementType valueToRemove) throw() + { + lock.enter(); + ElementType* e = this->elements; - /** Returns the last section of the pathname. + for (int i = numUsed; --i >= 0;) + { + if (valueToRemove == *e) + { + remove ((int) (e - this->elements)); + break; + } - Returns just the final part of the path - e.g. if the whole path - is "/moose/fish/foo.txt" this will return "foo.txt". + ++e; + } - For a directory, it returns the final part of the path - e.g. for the - directory "/moose/fish" it'll return "fish". + lock.exit(); + } - If the filename begins with a dot, it'll return the whole filename, e.g. for - "/moose/.fish", it'll return ".fish" + /** Removes a range of elements from the array. - @see getFullPathName, getFileNameWithoutExtension - */ - const String getFileName() const throw(); + This will remove a set of elements, starting from the given index, + and move subsequent elements down to close the gap. - /** Creates a relative path that refers to a file relatively to a given directory. + If the range extends beyond the bounds of the array, it will + be safely clipped to the size of the array. - e.g. File ("/moose/foo.txt").getRelativePathFrom ("/moose/fish/haddock") - would return "../../foo.txt". + @param startIndex the index of the first element to remove + @param numberToRemove how many elements should be removed + @see remove, removeValue + */ + void removeRange (int startIndex, + const int numberToRemove) throw() + { + lock.enter(); + const int endIndex = jlimit (0, numUsed, startIndex + numberToRemove); + startIndex = jlimit (0, numUsed, startIndex); - If it's not possible to navigate from one file to the other, an absolute - path is returned. If the paths are invalid, an empty string may also be - returned. + if (endIndex > startIndex) + { + const int rangeSize = endIndex - startIndex; + ElementType* e = this->elements + startIndex; + int numToShift = numUsed - endIndex; + numUsed -= rangeSize; - @param directoryToBeRelativeTo the directory which the resultant string will - be relative to. If this is actually a file rather than - a directory, its parent directory will be used instead. - If it doesn't exist, it's assumed to be a directory. - @see getChildFile, isAbsolutePath - */ - const String getRelativePathFrom (const File& directoryToBeRelativeTo) const throw(); + while (--numToShift >= 0) + { + *e = e [rangeSize]; + ++e; + } - /** Returns the file's extension. + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); + } - Returns the file extension of this file, also including the dot. + lock.exit(); + } - e.g. "/moose/fish/foo.txt" would return ".txt" + /** Removes the last n elements from the array. - @see hasFileExtension, withFileExtension, getFileNameWithoutExtension + @param howManyToRemove how many elements to remove from the end of the array + @see remove, removeValue, removeRange */ - const String getFileExtension() const throw(); + void removeLast (const int howManyToRemove = 1) throw() + { + lock.enter(); + numUsed = jmax (0, numUsed - howManyToRemove); - /** Checks whether the file has a given extension. + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); - @param extensionToTest the extension to look for - it doesn't matter whether or - not this string has a dot at the start, so ".wav" and "wav" - will have the same effect. The comparison used is - case-insensitve. + lock.exit(); + } - @see getFileExtension, withFileExtension, getFileNameWithoutExtension + /** Removes any elements which are also in another array. + + @param otherArray the other array in which to look for elements to remove + @see removeValuesNotIn, remove, removeValue, removeRange */ - bool hasFileExtension (const String& extensionToTest) const throw(); + template + void removeValuesIn (const OtherArrayType& otherArray) throw() + { + otherArray.lockArray(); + lock.enter(); - /** Returns a version of this file with a different file extension. + if (this == &otherArray) + { + clear(); + } + else + { + if (otherArray.size() > 0) + { + for (int i = numUsed; --i >= 0;) + if (otherArray.contains (this->elements [i])) + remove (i); + } + } - e.g. File ("/moose/fish/foo.txt").withFileExtension ("html") returns "/moose/fish/foo.html" + lock.exit(); + otherArray.unlockArray(); + } - @param newExtension the new extension, either with or without a dot at the start (this - doesn't make any difference). To get remove a file's extension altogether, - pass an empty string into this function. + /** Removes any elements which are not found in another array. - @see getFileName, getFileExtension, hasFileExtension, getFileNameWithoutExtension + Only elements which occur in this other array will be retained. + + @param otherArray the array in which to look for elements NOT to remove + @see removeValuesIn, remove, removeValue, removeRange */ - const File withFileExtension (const String& newExtension) const throw(); + template + void removeValuesNotIn (const OtherArrayType& otherArray) throw() + { + otherArray.lockArray(); + lock.enter(); - /** Returns the last part of the filename, without its file extension. + if (this != &otherArray) + { + if (otherArray.size() <= 0) + { + clear(); + } + else + { + for (int i = numUsed; --i >= 0;) + if (! otherArray.contains (this->elements [i])) + remove (i); + } + } - e.g. for "/moose/fish/foo.txt" this will return "foo". + lock.exit(); + otherArray.unlockArray(); + } - @see getFileName, getFileExtension, hasFileExtension, withFileExtension - */ - const String getFileNameWithoutExtension() const throw(); + /** Swaps over two elements in the array. - /** Returns a 32-bit hash-code that identifies this file. + This swaps over the elements found at the two indexes passed in. + If either index is out-of-range, this method will do nothing. - This is based on the filename. Obviously it's possible, although unlikely, that - two files will have the same hash-code. + @param index1 index of one of the elements to swap + @param index2 index of the other element to swap */ - int hashCode() const throw(); - - /** Returns a 64-bit hash-code that identifies this file. + void swap (const int index1, + const int index2) throw() + { + lock.enter(); - This is based on the filename. Obviously it's possible, although unlikely, that - two files will have the same hash-code. - */ - int64 hashCode64() const throw(); + if (((unsigned int) index1) < (unsigned int) numUsed + && ((unsigned int) index2) < (unsigned int) numUsed) + { + swapVariables (this->elements [index1], + this->elements [index2]); + } - /** Returns a file based on a relative path. + lock.exit(); + } - This will find a child file or directory of the current object. + /** Moves one of the values to a different position. - e.g. - File ("/moose/fish").getChildFile ("foo.txt") will produce "/moose/fish/foo.txt". - File ("/moose/fish").getChildFile ("../foo.txt") will produce "/moose/foo.txt". + This will move the value to a specified index, shuffling along + any intervening elements as required. - If the string is actually an absolute path, it will be treated as such, e.g. - File ("/moose/fish").getChildFile ("/foo.txt") will produce "/foo.txt" + So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling + move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. - @see getSiblingFile, getParentDirectory, getRelativePathFrom, isAChildOf + @param currentIndex the index of the value to be moved. If this isn't a + valid index, then nothing will be done + @param newIndex the index at which you'd like this value to end up. If this + is less than zero, the value will be moved to the end + of the array */ - const File getChildFile (String relativePath) const throw(); - - /** Returns a file which is in the same directory as this one. + void move (const int currentIndex, + int newIndex) throw() + { + if (currentIndex != newIndex) + { + lock.enter(); - This is equivalent to getParentDirectory().getChildFile (name). + if (((unsigned int) currentIndex) < (unsigned int) numUsed) + { + if (((unsigned int) newIndex) >= (unsigned int) numUsed) + newIndex = numUsed - 1; - @see getChildFile, getParentDirectory - */ - const File getSiblingFile (const String& siblingFileName) const throw(); + const ElementType value = this->elements [currentIndex]; - /** Returns the directory that contains this file or directory. + if (newIndex > currentIndex) + { + memmove (this->elements + currentIndex, + this->elements + currentIndex + 1, + (newIndex - currentIndex) * sizeof (ElementType)); + } + else + { + memmove (this->elements + newIndex + 1, + this->elements + newIndex, + (currentIndex - newIndex) * sizeof (ElementType)); + } - e.g. for "/moose/fish/foo.txt" this will return "/moose/fish". - */ - const File getParentDirectory() const throw(); + this->elements [newIndex] = value; + } - /** Checks whether a file is somewhere inside a directory. + lock.exit(); + } + } - Returns true if this file is somewhere inside a subdirectory of the directory - that is passed in. Neither file actually has to exist, because the function - just checks the paths for similarities. + /** Reduces the amount of storage being used by the array. - e.g. File ("/moose/fish/foo.txt").isAChildOf ("/moose") is true. - File ("/moose/fish/foo.txt").isAChildOf ("/moose/fish") is also true. + Arrays typically allocate slightly more storage than they need, and after + removing elements, they may have quite a lot of unused space allocated. + This method will reduce the amount of allocated storage to a minimum. */ - bool isAChildOf (const File& potentialParentDirectory) const throw(); + void minimiseStorageOverheads() throw() + { + lock.enter(); - /** Chooses a filename relative to this one that doesn't already exist. + if (numUsed == 0) + { + this->setAllocatedSize (0); + } + else + { + const int newAllocation = this->granularity * (numUsed / this->granularity + 1); - If this file is a directory, this will return a child file of this - directory that doesn't exist, by adding numbers to a prefix and suffix until - it finds one that isn't already there. + if (newAllocation < this->numAllocated) + this->setAllocatedSize (newAllocation); + } - If the prefix + the suffix doesn't exist, it won't bother adding a number. + lock.exit(); + } - e.g. File ("/moose/fish").getNonexistentChildFile ("foo", ".txt", true) might - return "/moose/fish/foo(2).txt" if there's already a file called "foo.txt". + /** Increases the array's internal storage to hold a minimum number of elements. - @param prefix the string to use for the filename before the number - @param suffix the string to add to the filename after the number - @param putNumbersInBrackets if true, this will create filenames in the - format "prefix(number)suffix", if false, it will leave the - brackets out. + Calling this before adding a large known number of elements means that + the array won't have to keep dynamically resizing itself as the elements + are added, and it'll therefore be more efficient. */ - const File getNonexistentChildFile (const String& prefix, - const String& suffix, - bool putNumbersInBrackets = true) const throw(); + void ensureStorageAllocated (const int minNumElements) throw() + { + this->ensureAllocatedSize (minNumElements); + } - /** Chooses a filename for a sibling file to this one that doesn't already exist. + /** Sorts the elements in the array. - If this file doesn't exist, this will just return itself, otherwise it - will return an appropriate sibling that doesn't exist, e.g. if a file - "/moose/fish/foo.txt" exists, this might return "/moose/fish/foo(2).txt". + This will use a comparator object to sort the elements into order. The object + passed must have a method of the form: + @code + int compareElements (ElementType first, ElementType second); + @endcode - @param putNumbersInBrackets whether to add brackets around the numbers that - get appended to the new filename. - */ - const File getNonexistentSibling (const bool putNumbersInBrackets = true) const throw(); + ..and this method must return: + - a value of < 0 if the first comes before the second + - a value of 0 if the two objects are equivalent + - a value of > 0 if the second comes before the first - /** Compares the pathnames for two files. */ - bool operator== (const File& otherFile) const throw(); - /** Compares the pathnames for two files. */ - bool operator!= (const File& otherFile) const throw(); + To improve performance, the compareElements() method can be declared as static or const. - /** Checks whether a file can be created or written to. + @param comparator the comparator to use for comparing elements. + @param retainOrderOfEquivalentItems if this is true, then items + which the comparator says are equivalent will be + kept in the order in which they currently appear + in the array. This is slower to perform, but may + be important in some cases. If it's false, a faster + algorithm is used, but equivalent elements may be + rearranged. - @returns true if it's possible to create and write to this file. If the file - doesn't already exist, this will check its parent directory to - see if writing is allowed. - @see setReadOnly + @see addSorted, indexOfSorted, sortArray */ - bool hasWriteAccess() const throw(); - - /** Changes the write-permission of a file or directory. + template + void sort (ElementComparator& comparator, + const bool retainOrderOfEquivalentItems = false) const throw() + { + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused + lock.enter(); + sortArray (comparator, this->elements, 0, size() - 1, retainOrderOfEquivalentItems); + lock.exit(); + } - @param shouldBeReadOnly whether to add or remove write-permission - @param applyRecursively if the file is a directory and this is true, it will - recurse through all the subfolders changing the permissions - of all files - @returns true if it manages to change the file's permissions. - @see hasWriteAccess - */ - bool setReadOnly (const bool shouldBeReadOnly, - const bool applyRecursively = false) const throw(); + /** Locks the array's CriticalSection. - /** Returns true if this file is a hidden or system file. + Of course if the type of section used is a DummyCriticalSection, this won't + have any effect. - The criteria for deciding whether a file is hidden are platform-dependent. + @see unlockArray */ - bool isHidden() const throw(); - - /** Returns the last modification time of this file. + void lockArray() const throw() + { + lock.enter(); + } - @returns the time, or an invalid time if the file doesn't exist. - @see setLastModificationTime, getLastAccessTime, getCreationTime - */ - const Time getLastModificationTime() const throw(); + /** Unlocks the array's CriticalSection. - /** Returns the last time this file was accessed. + Of course if the type of section used is a DummyCriticalSection, this won't + have any effect. - @returns the time, or an invalid time if the file doesn't exist. - @see setLastAccessTime, getLastModificationTime, getCreationTime + @see lockArray */ - const Time getLastAccessTime() const throw(); + void unlockArray() const throw() + { + lock.exit(); + } - /** Returns the time that this file was created. + juce_UseDebuggingNewOperator - @returns the time, or an invalid time if the file doesn't exist. - @see getLastModificationTime, getLastAccessTime - */ - const Time getCreationTime() const throw(); +private: + int numUsed; + TypeOfCriticalSectionToUse lock; +}; - /** Changes the modification time for this file. +#endif // __JUCE_ARRAY_JUCEHEADER__ +/********* End of inlined file: juce_Array.h *********/ - @param newTime the time to apply to the file - @returns true if it manages to change the file's time. - @see getLastModificationTime, setLastAccessTime, setCreationTime - */ - bool setLastModificationTime (const Time& newTime) const throw(); +/** + A typedef for an Array of void*'s. - /** Changes the last-access time for this file. + VoidArrays are used in various places throughout the library instead of + more strongly-typed arrays, to keep code-size low. +*/ +typedef Array VoidArray; - @param newTime the time to apply to the file - @returns true if it manages to change the file's time. - @see getLastAccessTime, setLastModificationTime, setCreationTime - */ - bool setLastAccessTime (const Time& newTime) const throw(); +#endif // __JUCE_VOIDARRAY_JUCEHEADER__ +/********* End of inlined file: juce_VoidArray.h *********/ - /** Changes the creation date for this file. +#ifndef DOXYGEN + // (used in StringArray::appendNumbersToDuplicates) + static const tchar* const defaultPreNumberString = JUCE_T(" ("); + static const tchar* const defaultPostNumberString = JUCE_T(")"); +#endif - @param newTime the time to apply to the file - @returns true if it manages to change the file's time. - @see getCreationTime, setLastModificationTime, setLastAccessTime - */ - bool setCreationTime (const Time& newTime) const throw(); +/** + A special array for holding a list of strings. - /** Creates an empty file if it doesn't already exist. + @see String, StringPairArray +*/ +class JUCE_API StringArray +{ +public: - If the file that this object refers to doesn't exist, this will create a file - of zero size. + /** Creates an empty string array */ + StringArray() throw(); - If it already exists or is a directory, this method will do nothing. + /** Creates a copy of another string array */ + StringArray (const StringArray& other) throw(); - @returns true if the file has been created (or if it already existed). - @see createDirectory - */ - bool create() const throw(); + /** Creates a copy of an array of string literals. - /** Creates a new directory for this filename. + @param strings an array of strings to add. Null pointers in the array will be + treated as empty strings + @param numberOfStrings how many items there are in the array + */ + StringArray (const juce_wchar** const strings, + const int numberOfStrings) throw(); - This will try to create the file as a directory, and fill also create - any parent directories it needs in order to complete the operation. + /** Creates a copy of an array of string literals. - @returns true if the directory has been created successfully, (or if it - already existed beforehand). - @see create + @param strings an array of strings to add. Null pointers in the array will be + treated as empty strings + @param numberOfStrings how many items there are in the array */ - bool createDirectory() const throw(); - - /** Deletes a file. + StringArray (const char** const strings, + const int numberOfStrings) throw(); - If this file is actually a directory, it may not be deleted correctly if it - contains files. See deleteRecursively() as a better way of deleting directories. + /** Creates a copy of a null-terminated array of string literals. - @returns true if the file has been successfully deleted (or if it didn't exist to - begin with). - @see deleteRecursively + Each item from the array passed-in is added, until it encounters a null pointer, + at which point it stops. */ - bool deleteFile() const throw(); - - /** Deletes a file or directory and all its subdirectories. + StringArray (const juce_wchar** const strings) throw(); - If this file is a directory, this will try to delete it and all its subfolders. If - it's just a file, it will just try to delete the file. + /** Creates a copy of a null-terminated array of string literals. - @returns true if the file and all its subfolders have been successfully deleted - (or if it didn't exist to begin with). - @see deleteFile + Each item from the array passed-in is added, until it encounters a null pointer, + at which point it stops. */ - bool deleteRecursively() const throw(); + StringArray (const char** const strings) throw(); - /** Moves or renames a file. + /** Destructor. */ + virtual ~StringArray() throw(); - Tries to move a file to a different location. - If the target file already exists, this will attempt to delete it first, and - will fail if this can't be done. + /** Copies the contents of another string array into this one */ + const StringArray& operator= (const StringArray& other) throw(); - Note that the destination file isn't the directory to put it in, it's the actual - filename that you want the new file to have. + /** Compares two arrays. - @returns true if the operation succeeds + Comparisons are case-sensitive. + + @returns true only if the other array contains exactly the same strings in the same order */ - bool moveFileTo (const File& targetLocation) const throw(); + bool operator== (const StringArray& other) const throw(); - /** Copies a file. + /** Compares two arrays. - Tries to copy a file to a different location. - If the target file already exists, this will attempt to delete it first, and - will fail if this can't be done. + Comparisons are case-sensitive. - @returns true if the operation succeeds + @returns false if the other array contains exactly the same strings in the same order */ - bool copyFileTo (const File& targetLocation) const throw(); + bool operator!= (const StringArray& other) const throw(); - /** Copies a directory. + /** Returns the number of strings in the array */ + inline int size() const throw() { return strings.size(); }; - Tries to copy an entire directory, recursively. + /** Returns one of the strings from the array. - If this file isn't a directory or if any target files can't be created, this - will return false. + If the index is out-of-range, an empty string is returned. - @param newDirectory the directory that this one should be copied to. Note that this - is the name of the actual directory to create, not the directory - into which the new one should be placed, so there must be enough - write privileges to create it if it doesn't exist. Any files inside - it will be overwritten by similarly named ones that are copied. + Obviously the reference returned shouldn't be stored for later use, as the + string it refers to may disappear when the array changes. */ - bool copyDirectoryTo (const File& newDirectory) const throw(); + const String& operator[] (const int index) const throw(); - /** Used in file searching, to specify whether to return files, directories, or both. - */ - enum TypesOfFileToFind - { - findDirectories = 1, /**< Use this flag to indicate that you want to find directories. */ - findFiles = 2, /**< Use this flag to indicate that you want to find files. */ - findFilesAndDirectories = 3, /**< Use this flag to indicate that you want to find both files and directories. */ - ignoreHiddenFiles = 4 /**< Add this flag to avoid returning any hidden files in the results. */ - }; + /** Searches for a string in the array. - /** Searches inside a directory for files matching a wildcard pattern. + The comparison will be case-insensitive if the ignoreCase parameter is true. - Assuming that this file is a directory, this method will search it - for either files or subdirectories whose names match a filename pattern. + @returns true if the string is found inside the array + */ + bool contains (const String& stringToLookFor, + const bool ignoreCase = false) const throw(); - @param results an array to which File objects will be added for the - files that the search comes up with - @param whatToLookFor a value from the TypesOfFileToFind enum, specifying whether to - return files, directories, or both. If the ignoreHiddenFiles flag - is also added to this value, hidden files won't be returned - @param searchRecursively if true, all subdirectories will be recursed into to do - an exhaustive search - @param wildCardPattern the filename pattern to search for, e.g. "*.txt" - @returns the number of results that have been found + /** Searches for a string in the array. - @see getNumberOfChildFiles, DirectoryIterator - */ - int findChildFiles (OwnedArray& results, - const int whatToLookFor, - const bool searchRecursively, - const String& wildCardPattern = JUCE_T("*")) const throw(); + The comparison will be case-insensitive if the ignoreCase parameter is true. - /** Searches inside a directory and counts how many files match a wildcard pattern. + @param stringToLookFor the string to try to find + @param ignoreCase whether the comparison should be case-insensitive + @param startIndex the first index to start searching from + @returns the index of the first occurrence of the string in this array, + or -1 if it isn't found. + */ + int indexOf (const String& stringToLookFor, + const bool ignoreCase = false, + int startIndex = 0) const throw(); - Assuming that this file is a directory, this method will search it - for either files or subdirectories whose names match a filename pattern, - and will return the number of matches found. + /** Appends a string at the end of the array. */ + void add (const String& stringToAdd) throw(); - This isn't a recursive call, and will only search this directory, not - its children. + /** Inserts a string into the array. - @param whatToLookFor a value from the TypesOfFileToFind enum, specifying whether to - count files, directories, or both. If the ignoreHiddenFiles flag - is also added to this value, hidden files won't be counted - @param wildCardPattern the filename pattern to search for, e.g. "*.txt" - @returns the number of matches found - @see findChildFiles, DirectoryIterator + This will insert a string into the array at the given index, moving + up the other elements to make room for it. + If the index is less than zero or greater than the size of the array, + the new string will be added to the end of the array. */ - int getNumberOfChildFiles (const int whatToLookFor, - const String& wildCardPattern = JUCE_T("*")) const throw(); + void insert (const int index, + const String& stringToAdd) throw(); - /** Creates a stream to read from this file. + /** Adds a string to the array as long as it's not already in there. - @returns a stream that will read from this file (initially positioned at the - start of the file), or 0 if the file can't be opened for some reason - @see createOutputStream, loadFileAsData + The search can optionally be case-insensitive. */ - FileInputStream* createInputStream() const throw(); - - /** Creates a stream to write to this file. + void addIfNotAlreadyThere (const String& stringToAdd, + const bool ignoreCase = false) throw(); - If the file exists, the stream that is returned will be positioned ready for - writing at the end of the file, so you might want to use deleteFile() first - to write to an empty file. + /** Replaces one of the strings in the array with another one. - @returns a stream that will write to this file (initially positioned at the - end of the file), or 0 if the file can't be opened for some reason - @see createInputStream, printf, appendData, appendText + If the index is higher than the array's size, the new string will be + added to the end of the array; if it's less than zero nothing happens. */ - FileOutputStream* createOutputStream (const int bufferSize = 0x8000) const throw(); - - /** Loads a file's contents into memory as a block of binary data. + void set (const int index, + const String& newString) throw(); - Of course, trying to load a very large file into memory will blow up, so - it's better to check first. + /** Appends some strings from another array to the end of this one. - @param result the data block to which the file's contents should be appended - note - that if the memory block might already contain some data, you - might want to clear it first - @returns true if the file could all be read into memory + @param other the array to add + @param startIndex the first element of the other array to add + @param numElementsToAdd the maximum number of elements to add (if this is + less than zero, they are all added) */ - bool loadFileAsData (MemoryBlock& result) const throw(); + void addArray (const StringArray& other, + int startIndex = 0, + int numElementsToAdd = -1) throw(); - /** Reads a file into memory as a string. + /** Breaks up a string into tokens and adds them to this array. - Attempts to load the entire file as a zero-terminated string. + This will tokenise the given string using whitespace characters as the + token delimiters, and will add these tokens to the end of the array. - This makes use of InputStream::readEntireStreamAsString, which should - automatically cope with unicode/acsii file formats. + @returns the number of tokens added */ - const String loadFileAsString() const throw(); + int addTokens (const tchar* const stringToTokenise, + const bool preserveQuotedStrings) throw(); - /** Writes text to the end of the file. + /** Breaks up a string into tokens and adds them to this array. - This will try to do a printf to the file. + This will tokenise the given string (using the string passed in to define the + token delimiters), and will add these tokens to the end of the array. - @returns false if it can't write to the file for some reason + @param stringToTokenise the string to tokenise + @param breakCharacters a string of characters, any of which will be considered + to be a token delimiter. + @param quoteCharacters if this string isn't empty, it defines a set of characters + which are treated as quotes. Any text occurring + between quotes is not broken up into tokens. + @returns the number of tokens added */ - bool printf (const tchar* format, ...) const throw(); - - /** Appends a block of binary data to the end of the file. + int addTokens (const tchar* const stringToTokenise, + const tchar* breakCharacters, + const tchar* quoteCharacters) throw(); - This will try to write the given buffer to the end of the file. + /** Breaks up a string into lines and adds them to this array. - @returns false if it can't write to the file for some reason + This breaks a string down into lines separated by \\n or \\r\\n, and adds each line + to the array. Line-break characters are omitted from the strings that are added to + the array. */ - bool appendData (const void* const dataToAppend, - const int numberOfBytes) const throw(); + int addLines (const tchar* stringToBreakUp) throw(); - /** Replaces this file's contents with a given block of data. + /** Removes all elements from the array. */ + void clear() throw(); - This will delete the file and replace it with the given data. + /** Removes a string from the array. - A nice feature of this method is that it's safe - instead of deleting - the file first and then re-writing it, it creates a new temporary file, - writes the data to that, and then moves the new file to replace the existing - file. This means that if the power gets pulled out or something crashes, - you're a lot less likely to end up with an empty file.. + If the index is out-of-range, no action will be taken. + */ + void remove (const int index) throw(); - Returns true if the operation succeeds, or false if it fails. + /** Finds a string in the array and removes it. - @see appendText + This will remove the first occurrence of the given string from the array. The + comparison may be case-insensitive depending on the ignoreCase parameter. */ - bool replaceWithData (const void* const dataToWrite, - const int numberOfBytes) const throw(); + void removeString (const String& stringToRemove, + const bool ignoreCase = false) throw(); - /** Appends a string to the end of the file. + /** Removes any duplicated elements from the array. - This will try to append a text string to the file, as either 16-bit unicode - or 8-bit characters in the default system encoding. + If any string appears in the array more than once, only the first occurrence of + it will be retained. - It can also write the 'ff fe' unicode header bytes before the text to indicate - the endianness of the file. + @param ignoreCase whether to use a case-insensitive comparison + */ + void removeDuplicates (const bool ignoreCase) throw(); - Any single \\n characters in the string are replaced with \\r\\n before it is written. + /** Removes empty strings from the array. - @see replaceWithText + @param removeWhitespaceStrings if true, strings that only contain whitespace + characters will also be removed */ - bool appendText (const String& textToAppend, - const bool asUnicode = false, - const bool writeUnicodeHeaderBytes = false) const throw(); + void removeEmptyStrings (const bool removeWhitespaceStrings = true) throw(); - /** Replaces this file's contents with a given text string. + /** Moves one of the strings to a different position. - This will delete the file and replace it with the given text. + This will move the string to a specified index, shuffling along + any intervening elements as required. - A nice feature of this method is that it's safe - instead of deleting - the file first and then re-writing it, it creates a new temporary file, - writes the text to that, and then moves the new file to replace the existing - file. This means that if the power gets pulled out or something crashes, - you're a lot less likely to end up with an empty file.. + So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling + move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. - For an explanation of the parameters here, see the appendText() method. + @param currentIndex the index of the value to be moved. If this isn't a + valid index, then nothing will be done + @param newIndex the index at which you'd like this value to end up. If this + is less than zero, the value will be moved to the end + of the array + */ + void move (const int currentIndex, int newIndex) throw(); - Returns true if the operation succeeds, or false if it fails. + /** Deletes any whitespace characters from the starts and ends of all the strings. */ + void trim() throw(); - @see appendText - */ - bool replaceWithText (const String& textToWrite, - const bool asUnicode = false, - const bool writeUnicodeHeaderBytes = false) const throw(); + /** Adds numbers to the strings in the array, to make each string unique. - /** Creates a set of files to represent each file root. + This will add numbers to the ends of groups of similar strings. + e.g. if there are two "moose" strings, they will become "moose (1)" and "moose (2)" - e.g. on Windows this will create files for "c:\", "d:\" etc according - to which ones are available. On the Mac/Linux, this will probably - just add a single entry for "/". + @param ignoreCaseWhenComparing whether the comparison used is case-insensitive + @param appendNumberToFirstInstance whether the first of a group of similar strings + also has a number appended to it. + @param preNumberString when adding a number, this string is added before the number + @param postNumberString this string is appended after any numbers that are added */ - static void findFileSystemRoots (OwnedArray& results) throw(); + void appendNumbersToDuplicates (const bool ignoreCaseWhenComparing, + const bool appendNumberToFirstInstance, + const tchar* const preNumberString = defaultPreNumberString, + const tchar* const postNumberString = defaultPostNumberString) throw(); - /** Finds the name of the drive on which this file lives. + /** Joins the strings in the array together into one string. - @returns the volume label of the drive, or an empty string if this isn't possible - */ - const String getVolumeLabel() const throw(); + This will join a range of elements from the array into a string, separating + them with a given string. - /** Returns the serial number of the volume on which this file lives. + e.g. joinIntoString (",") will turn an array of "a" "b" and "c" into "a,b,c". - @returns the serial number, or zero if there's a problem doing this + @param separatorString the string to insert between all the strings + @param startIndex the first element to join + @param numberOfElements how many elements to join together. If this is less + than zero, all available elements will be used. */ - int getVolumeSerialNumber() const throw(); + const String joinIntoString (const String& separatorString, + int startIndex = 0, + int numberOfElements = -1) const throw(); - /** Returns the number of bytes free on the drive that this file lives on. + /** Sorts the array into alphabetical order. - @returns the number of bytes free, or 0 if there's a problem finding this out + @param ignoreCase if true, the comparisons used will be case-sensitive. */ - int64 getBytesFreeOnVolume() const throw(); - - /** Returns true if this file is on a CD or DVD drive. */ - bool isOnCDRomDrive() const throw(); + void sort (const bool ignoreCase) throw(); - /** Returns true if this file is on a hard disk. + /** Reduces the amount of storage being used by the array. - This will fail if it's a network drive, but will still be true for - removable hard-disks. + Arrays typically allocate slightly more storage than they need, and after + removing elements, they may have quite a lot of unused space allocated. + This method will reduce the amount of allocated storage to a minimum. */ - bool isOnHardDisk() const throw(); + void minimiseStorageOverheads() throw(); - /** Returns true if this file is on a removable disk drive. + juce_UseDebuggingNewOperator - This might be a usb-drive, a CD-rom, or maybe a network drive. - */ - bool isOnRemovableDrive() const throw(); +private: + VoidArray strings; +}; - /** Launches the file as a process. +#endif // __JUCE_STRINGARRAY_JUCEHEADER__ +/********* End of inlined file: juce_StringArray.h *********/ - - if the file is executable, this will run it. +/********* Start of inlined file: juce_MemoryBlock.h *********/ +#ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ +#define __JUCE_MEMORYBLOCK_JUCEHEADER__ - - if it's a document of some kind, it will launch the document with its - default viewer application. +/** + A class to hold a resizable block of raw data. - - if it's a folder, it will be opened in Explorer, Finder, or equivalent. - */ - bool startAsProcess (const String& parameters = String::empty) const throw(); +*/ +class JUCE_API MemoryBlock +{ +public: - /** A set of types of location that can be passed to the getSpecialLocation() method. + /** Create an uninitialised block with 0 size. */ + MemoryBlock() throw(); + + /** Creates a memory block with a given initial size. + + @param initialSize the size of block to create + @param initialiseToZero whether to clear the memory or just leave it uninitialised */ - enum SpecialLocationType - { - /** The user's home folder. This is the same as using File ("~"). */ - userHomeDirectory, + MemoryBlock (const int initialSize, + const bool initialiseToZero = false) throw(); - /** The user's default documents folder. On Windows, this might be the user's - "My Documents" folder. On the Mac it'll be their "Documents" folder. Linux - doesn't tend to have one of these, so it might just return their home folder. - */ - userDocumentsDirectory, + /** Creates a copy of another memory block. */ + MemoryBlock (const MemoryBlock& other) throw(); - /** The folder that contains the user's desktop objects. */ - userDesktopDirectory, + /** Creates a memory block using a copy of a block of data. - /** The folder in which applications store their persistent user-specific settings. - On Windows, this might be "\Documents and Settings\username\Application Data". - On the Mac, it might be "~/Library". If you're going to store your settings in here, - always create your own sub-folder to put them in, to avoid making a mess. - */ - userApplicationDataDirectory, + @param dataToInitialiseFrom some data to copy into this block + @param sizeInBytes how much space to use + */ + MemoryBlock (const void* const dataToInitialiseFrom, + const int sizeInBytes) throw(); - /** An equivalent of the userApplicationDataDirectory folder that is shared by all users - of the computer, rather than just the current user. + /** Destructor. */ + ~MemoryBlock() throw(); - On the Mac it'll be "/Library", on Windows, it could be something like - "\Documents and Settings\All Users\Application Data". + /** Copies another memory block onto this one. - Depending on the setup, this folder may be read-only. - */ - commonApplicationDataDirectory, + This block will be resized and copied to exactly match the other one. + */ + const MemoryBlock& operator= (const MemoryBlock& other) throw(); - /** The folder that should be used for temporary files. + /** Compares two memory blocks. - Always delete them when you're finished, to keep the user's computer tidy! - */ - tempDirectory, + @returns true only if the two blocks are the same size and have identical contents. + */ + bool operator== (const MemoryBlock& other) const throw(); - /** Returns this application's executable file. + /** Compares two memory blocks. - If running as a plug-in or DLL, this will (where possible) be the DLL rather than the - host app. + @returns true if the two blocks are different sizes or have different contents. + */ + bool operator!= (const MemoryBlock& other) const throw(); - On the mac this will return the unix binary, not the package folder - see - currentApplicationFile for that. - */ - currentExecutableFile, + /** Returns a pointer to the data, casting it to any type of primitive data required. - /** Returns this application's location. + Note that the pointer returned will probably become invalid when the + block is resized. + */ + template + operator DataType*() const throw() { return (DataType*) data; } - If running as a plug-in or DLL, this will (where possible) be the DLL rather than the - host app. + /** Returns a void pointer to the data. - On the mac this will return the package folder (if it's in one), not the unix binary - that's inside it - compare with currentExecutableFile. - */ - currentApplicationFile, + Note that the pointer returned will probably become invalid when the + block is resized. + */ + void* getData() const throw() { return data; } - /** The directory in which applications normally get installed. + /** Returns a byte from the memory block. - So on windows, this would be something like "c:\program files", on the - Mac "/Applications", or "/usr" on linux. - */ - globalApplicationsDirectory, + This returns a reference, so you can also use it to set a byte. + */ + char& operator[] (const int offset) const throw() { return data [offset]; } - /** The most likely place where a user might store their music files. - */ - userMusicDirectory, + /** Returns the block's current allocated size, in bytes. */ + int getSize() const throw() { return size; } - /** The most likely place where a user might store their movie files. - */ - userMoviesDirectory, - }; + /** Resizes the memory block. - /** Finds the location of a special type of file or directory, such as a home folder or - documents folder. + This will try to keep as much of the block's current content as it can, + and can optionally be made to clear any new space that gets allocated at + the end of the block. - @see SpecialLocationType + @param newSize the new desired size for the block + @param initialiseNewSpaceToZero if the block gets enlarged, this determines + whether to clear the new section or just leave it + uninitialised + @see ensureSize */ - static const File JUCE_CALLTYPE getSpecialLocation (const SpecialLocationType type); - - /** Returns a temporary file in the system's temp directory. + void setSize (const int newSize, + const bool initialiseNewSpaceToZero = false) throw(); - This will try to return the name of a non-existent temp file. + /** Increases the block's size only if it's smaller than a given size. - To get the temp folder, you can use getSpecialLocation (File::tempDirectory). + @param minimumSize if the block is already bigger than this size, no action + will be taken; otherwise it will be increased to this size + @param initialiseNewSpaceToZero if the block gets enlarged, this determines + whether to clear the new section or just leave it + uninitialised + @see setSize */ - static const File createTempFile (const String& fileNameEnding) throw(); + void ensureSize (const int minimumSize, + const bool initialiseNewSpaceToZero = false) throw(); - /** Returns the current working directory. + /** Fills the entire memory block with a repeated byte value. - @see setAsCurrentWorkingDirectory + This is handy for clearing a block of memory to zero. */ - static const File getCurrentWorkingDirectory() throw(); + void fillWith (const uint8 valueToUse) throw(); - /** Sets the current working directory to be this file. + /** Adds another block of data to the end of this one. - For this to work the file must point to a valid directory. + This block's size will be increased accordingly. + */ + void append (const void* const data, + const int numBytes) throw(); - @returns true if the current directory has been changed. - @see getCurrentWorkingDirectory + /** Copies data into this MemoryBlock from a memory address. + + @param srcData the memory location of the data to copy into this block + @param destinationOffset the offset in this block at which the data being copied should begin + @param numBytes how much to copy in (if this goes beyond the size of the memory block, + it will be clipped so not to do anything nasty) */ - bool setAsCurrentWorkingDirectory() const throw(); + void copyFrom (const void* srcData, + int destinationOffset, + int numBytes) throw(); - /** The system-specific file separator character. + /** Copies data from this MemoryBlock to a memory address. - On Windows, this will be '\', on Mac/Linux, it'll be '/' + @param destData the memory location to write to + @param sourceOffset the offset within this block from which the copied data will be read + @param numBytes how much to copy (if this extends beyond the limits of the memory block, + zeros will be used for that portion of the data) */ - static const tchar separator; + void copyTo (void* destData, + int sourceOffset, + int numBytes) const throw(); - /** The system-specific file separator character, as a string. + /** Chops out a section of the block. - On Windows, this will be '\', on Mac/Linux, it'll be '/' + This will remove a section of the memory block and close the gap around it, + shifting any subsequent data downwards and reducing the size of the block. + + If the range specified goes beyond the size of the block, it will be clipped. */ - static const tchar* separatorString; + void removeSection (int startByte, int numBytesToRemove) throw(); - /** Removes illegal characters from a filename. + /** Attempts to parse the contents of the block as a zero-terminated string of 8-bit + characters in the system's default encoding. */ + const String toString() const throw(); - This will return a copy of the given string after removing characters - that are not allowed in a legal filename, and possibly shortening the - string if it's too long. + /** Parses a string of hexadecimal numbers and writes this data into the memory block. - Because this will remove slashes, don't use it on an absolute pathname. + The block will be resized to the number of valid bytes read from the string. + Non-hex characters in the string will be ignored. + + @see String::toHexString() + */ + void loadFromHexString (const String& sourceHexString) throw(); + + /** Sets a number of bits in the memory block, treating it as a long binary sequence. */ + void setBitRange (int bitRangeStart, + int numBits, + int binaryNumberToApply) throw(); - @see createLegalPathName - */ - static const String createLegalFileName (const String& fileNameToFix) throw(); + /** Reads a number of bits from the memory block, treating it as one long binary sequence */ + int getBitRange (int bitRangeStart, + int numBitsToRead) const throw(); - /** Removes illegal characters from a pathname. + /** Returns a string of characters that represent the binary contents of this block. - Similar to createLegalFileName(), but this won't remove slashes, so can - be used on a complete pathname. + Uses a 64-bit encoding system to allow binary data to be turned into a string + of simple non-extended characters, e.g. for storage in XML. - @see createLegalFileName + @see fromBase64Encoding */ - static const String createLegalPathName (const String& pathNameToFix) throw(); + const String toBase64Encoding() const throw(); - /** Indicates whether filenames are case-sensitive on the current operating system. - */ - static bool areFileNamesCaseSensitive(); + /** Takes a string of encoded characters and turns it into binary data. - /** Returns true if the string seems to be a fully-specified absolute path. + The string passed in must have been created by to64BitEncoding(), and this + block will be resized to recreate the original data block. + + @see toBase64Encoding */ - static bool isAbsolutePath (const String& path) throw(); + bool fromBase64Encoding (const String& encodedString) throw(); juce_UseDebuggingNewOperator private: - String fullPath; - - // internal way of contructing a file without checking the path - friend class DirectoryIterator; - File (const String&, int) throw(); - const String getPathUpToLastSlash() const throw(); + char* data; + int size; }; -#endif // __JUCE_FILE_JUCEHEADER__ -/********* End of inlined file: juce_File.h *********/ +#endif // __JUCE_MEMORYBLOCK_JUCEHEADER__ +/********* End of inlined file: juce_MemoryBlock.h *********/ + +class FileInputStream; +class FileOutputStream; /** - A simple implemenation of a Logger that writes to a file. + Represents a local file or directory. - @see Logger + This class encapsulates the absolute pathname of a file or directory, and + has methods for finding out about the file and changing its properties. + + To read or write to the file, there are methods for returning an input or + output stream. + + @see FileInputStream, FileOutputStream */ -class JUCE_API FileLogger : public Logger +class JUCE_API File { public: - /** Creates a FileLogger for a given file. + /** Creates an (invalid) file object. - @param fileToWriteTo the file that to use - new messages will be appended - to the file. If the file doesn't exist, it will be created, - along with any parent directories that are needed. - @param welcomeMessage when opened, the logger will write a header to the log, along - with the current date and time, and this welcome message - @param maxInitialFileSizeBytes if this is zero or greater, then if the file already exists - but is larger than this number of bytes, then the start of the - file will be truncated to keep the size down. This prevents a log - file getting ridiculously large over time. The file will be truncated - at a new-line boundary. If this value is less than zero, no size limit - will be imposed; if it's zero, the file will always be deleted. Note that - the size is only checked once when this object is created - any logging - that is done later will be appended without any checking + The file is initially set to an empty path, so getFullPath() will return + an empty string, and comparing the file to File::nonexistent will return + true. + + You can use its operator= method to point it at a proper file. */ - FileLogger (const File& fileToWriteTo, - const String& welcomeMessage, - const int maxInitialFileSizeBytes = 128 * 1024); + File() throw() {} + + /** Creates a file from an absolute path. + + If the path supplied is a relative path, it is taken to be relative + to the current working directory (see File::getCurrentWorkingDirectory()), + but this isn't a recommended way of creating a file, because you + never know what the CWD is going to be. + + On the Mac/Linux, the path can include "~" notation for referring to + user home directories. + */ + File (const String& path) throw(); + + /** Creates a copy of another file object. */ + File (const File& other) throw(); /** Destructor. */ - ~FileLogger(); + ~File() throw() {} - void logMessage (const String& message); + /** Sets the file based on an absolute pathname. - /** Helper function to create a log file in the correct place for this platform. + If the path supplied is a relative path, it is taken to be relative + to the current working directory (see File::getCurrentWorkingDirectory()), + but this isn't a recommended way of creating a file, because you + never know what the CWD is going to be. - On Windows this will return a logger with a path such as: - c:\\Documents and Settings\\username\\Application Data\\[logFileSubDirectoryName]\\[logFileName] + On the Mac/Linux, the path can include "~" notation for referring to + user home directories. + */ + const File& operator= (const String& newFilePath) throw(); - On the Mac it'll create something like: - ~/Library/Logs/[logFileName] + /** Copies from another file object. */ + const File& operator= (const File& otherFile) throw(); - The method might return 0 if the file can't be created for some reason. + /** This static constant is used for referring to an 'invalid' file. */ + static const File nonexistent; - @param logFileSubDirectoryName if a subdirectory is needed, this is what it will be called - - it's best to use the something like the name of your application here. - @param logFileName the name of the file to create, e.g. "MyAppLog.txt". Don't just - call it "log.txt" because if it goes in a directory with logs - from other applications (as it will do on the Mac) then no-one - will know which one is yours! - @param welcomeMessage a message that will be written to the log when it's opened. - @param maxInitialFileSizeBytes (see the FileLogger constructor for more info on this) + /** Checks whether the file actually exists. + + @returns true if the file exists, either as a file or a directory. + @see existsAsFile, isDirectory */ - static FileLogger* createDefaultAppLogger (const String& logFileSubDirectoryName, - const String& logFileName, - const String& welcomeMessage, - const int maxInitialFileSizeBytes = 128 * 1024); + bool exists() const throw(); - juce_UseDebuggingNewOperator + /** Checks whether the file exists and is a file rather than a directory. -private: - File logFile; - CriticalSection logLock; - FileOutputStream* logStream; + @returns true only if this is a real file, false if it's a directory + or doesn't exist + @see exists, isDirectory + */ + bool existsAsFile() const throw(); - void trimFileSize (int maxFileSizeBytes) const; + /** Checks whether the file is a directory that exists. - FileLogger (const FileLogger&); - const FileLogger& operator= (const FileLogger&); -}; + @returns true only if the file is a directory which actually exists, so + false if it's a file or doesn't exist at all + @see exists, existsAsFile + */ + bool isDirectory() const throw(); -#endif // __JUCE_FILELOGGER_JUCEHEADER__ -/********* End of inlined file: juce_FileLogger.h *********/ + /** Returns the size of the file in bytes. -#endif -#ifndef __JUCE_INITIALISATION_JUCEHEADER__ + @returns the number of bytes in the file, or 0 if it doesn't exist. + */ + int64 getSize() const throw(); -/********* Start of inlined file: juce_Initialisation.h *********/ -#ifndef __JUCE_INITIALISATION_JUCEHEADER__ -#define __JUCE_INITIALISATION_JUCEHEADER__ + /** Utility function to convert a file size in bytes to a neat string description. -/** Initialises Juce's GUI classes. + So for example 100 would return "100 bytes", 2000 would return "2 KB", + 2000000 would produce "2 MB", etc. + */ + static const String descriptionOfSizeInBytes (const int64 bytes); - If you're embedding Juce into an application that uses its own event-loop rather - than using the START_JUCE_APPLICATION macro, call this function before making any - Juce calls, to make sure things are initialised correctly. + /** Returns the complete, absolute path of this file. - Note that if you're creating a Juce DLL for Windows, you may also need to call the - PlatformUtilities::setCurrentModuleInstanceHandle() method. + This includes the filename and all its parent folders. On Windows it'll + also include the drive letter prefix; on Mac or Linux it'll be a complete + path starting from the root folder. - @see shutdownJuce_GUI(), initialiseJuce_NonGUI() -*/ -void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI(); + If you just want the file's name, you should use getFileName() or + getFileNameWithoutExtension(). -/** Clears up any static data being used by Juce's GUI classes. + @see getFileName, getRelativePathFrom + */ + const String& getFullPathName() const throw() { return fullPath; } - If you're embedding Juce into an application that uses its own event-loop rather - than using the START_JUCE_APPLICATION macro, call this function in your shutdown - code to clean up any juce objects that might be lying around. + /** Returns the last section of the pathname. - @see initialiseJuce_GUI(), initialiseJuce_NonGUI() -*/ -void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); + Returns just the final part of the path - e.g. if the whole path + is "/moose/fish/foo.txt" this will return "foo.txt". -/** Initialises the core parts of Juce. + For a directory, it returns the final part of the path - e.g. for the + directory "/moose/fish" it'll return "fish". - If you're embedding Juce into either a command-line program, call this function - at the start of your main() function to make sure that Juce is initialised correctly. + If the filename begins with a dot, it'll return the whole filename, e.g. for + "/moose/.fish", it'll return ".fish" - Note that if you're creating a Juce DLL for Windows, you may also need to call the - PlatformUtilities::setCurrentModuleInstanceHandle() method. + @see getFullPathName, getFileNameWithoutExtension + */ + const String getFileName() const throw(); - @see shutdownJuce_NonGUI, initialiseJuce_GUI -*/ -void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI(); + /** Creates a relative path that refers to a file relatively to a given directory. -/** Clears up any static data being used by Juce's non-gui core classes. + e.g. File ("/moose/foo.txt").getRelativePathFrom ("/moose/fish/haddock") + would return "../../foo.txt". - If you're embedding Juce into either a command-line program, call this function - at the end of your main() function if you want to make sure any Juce objects are - cleaned up correctly. + If it's not possible to navigate from one file to the other, an absolute + path is returned. If the paths are invalid, an empty string may also be + returned. - @see initialiseJuce_NonGUI, initialiseJuce_GUI -*/ -void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI(); + @param directoryToBeRelativeTo the directory which the resultant string will + be relative to. If this is actually a file rather than + a directory, its parent directory will be used instead. + If it doesn't exist, it's assumed to be a directory. + @see getChildFile, isAbsolutePath + */ + const String getRelativePathFrom (const File& directoryToBeRelativeTo) const throw(); -#endif // __JUCE_INITIALISATION_JUCEHEADER__ -/********* End of inlined file: juce_Initialisation.h *********/ + /** Returns the file's extension. -#endif -#ifndef __JUCE_LOGGER_JUCEHEADER__ + Returns the file extension of this file, also including the dot. -#endif -#ifndef __JUCE_MATHSFUNCTIONS_JUCEHEADER__ + e.g. "/moose/fish/foo.txt" would return ".txt" -#endif -#ifndef __JUCE_MEMORY_JUCEHEADER__ + @see hasFileExtension, withFileExtension, getFileNameWithoutExtension + */ + const String getFileExtension() const throw(); -#endif -#ifndef __JUCE_PLATFORMDEFS_JUCEHEADER__ + /** Checks whether the file has a given extension. -#endif -#ifndef __JUCE_RANDOM_JUCEHEADER__ + @param extensionToTest the extension to look for - it doesn't matter whether or + not this string has a dot at the start, so ".wav" and "wav" + will have the same effect. The comparison used is + case-insensitve. -/********* Start of inlined file: juce_Random.h *********/ -#ifndef __JUCE_RANDOM_JUCEHEADER__ -#define __JUCE_RANDOM_JUCEHEADER__ + @see getFileExtension, withFileExtension, getFileNameWithoutExtension + */ + bool hasFileExtension (const String& extensionToTest) const throw(); -/** - A simple pseudo-random number generator. -*/ -class JUCE_API Random -{ -public: + /** Returns a version of this file with a different file extension. - /** Creates a Random object based on a seed value. + e.g. File ("/moose/fish/foo.txt").withFileExtension ("html") returns "/moose/fish/foo.html" - For a given seed value, the subsequent numbers generated by this object - will be predictable, so a good idea is to set this value based - on the time, e.g. + @param newExtension the new extension, either with or without a dot at the start (this + doesn't make any difference). To get remove a file's extension altogether, + pass an empty string into this function. - new Random (Time::currentTimeMillis()) + @see getFileName, getFileExtension, hasFileExtension, getFileNameWithoutExtension */ - Random (const int64 seedValue) throw(); + const File withFileExtension (const String& newExtension) const throw(); - /** Destructor. */ - ~Random() throw(); + /** Returns the last part of the filename, without its file extension. - /** Returns the next random 32 bit integer. + e.g. for "/moose/fish/foo.txt" this will return "foo". - @returns a random integer from the full range 0x80000000 to 0x7fffffff + @see getFileName, getFileExtension, hasFileExtension, withFileExtension */ - int nextInt() throw(); + const String getFileNameWithoutExtension() const throw(); - /** Returns the next random number, limited to a given range. + /** Returns a 32-bit hash-code that identifies this file. - @returns a random integer between 0 (inclusive) and maxValue (exclusive). + This is based on the filename. Obviously it's possible, although unlikely, that + two files will have the same hash-code. */ - int nextInt (const int maxValue) throw(); + int hashCode() const throw(); - /** Returns the next 64-bit random number. + /** Returns a 64-bit hash-code that identifies this file. - @returns a random integer from the full range 0x8000000000000000 to 0x7fffffffffffffff + This is based on the filename. Obviously it's possible, although unlikely, that + two files will have the same hash-code. */ - int64 nextInt64() throw(); + int64 hashCode64() const throw(); - /** Returns the next random floating-point number. + /** Returns a file based on a relative path. - @returns a random value in the range 0 to 1.0 + This will find a child file or directory of the current object. + + e.g. + File ("/moose/fish").getChildFile ("foo.txt") will produce "/moose/fish/foo.txt". + File ("/moose/fish").getChildFile ("../foo.txt") will produce "/moose/foo.txt". + + If the string is actually an absolute path, it will be treated as such, e.g. + File ("/moose/fish").getChildFile ("/foo.txt") will produce "/foo.txt" + + @see getSiblingFile, getParentDirectory, getRelativePathFrom, isAChildOf */ - float nextFloat() throw(); + const File getChildFile (String relativePath) const throw(); - /** Returns the next random floating-point number. + /** Returns a file which is in the same directory as this one. - @returns a random value in the range 0 to 1.0 + This is equivalent to getParentDirectory().getChildFile (name). + + @see getChildFile, getParentDirectory */ - double nextDouble() throw(); + const File getSiblingFile (const String& siblingFileName) const throw(); - /** Returns the next random boolean value. + /** Returns the directory that contains this file or directory. + + e.g. for "/moose/fish/foo.txt" this will return "/moose/fish". */ - bool nextBool() throw(); + const File getParentDirectory() const throw(); - /** To avoid the overhead of having to create a new Random object whenever - you need a number, this is a shared application-wide object that - can be used. + /** Checks whether a file is somewhere inside a directory. - It's not thread-safe though, so threads should use their own Random object. + Returns true if this file is somewhere inside a subdirectory of the directory + that is passed in. Neither file actually has to exist, because the function + just checks the paths for similarities. + + e.g. File ("/moose/fish/foo.txt").isAChildOf ("/moose") is true. + File ("/moose/fish/foo.txt").isAChildOf ("/moose/fish") is also true. */ - static Random& getSystemRandom() throw(); + bool isAChildOf (const File& potentialParentDirectory) const throw(); - /** Resets this Random object to a given seed value. */ - void setSeed (const int64 newSeed) throw(); + /** Chooses a filename relative to this one that doesn't already exist. - juce_UseDebuggingNewOperator + If this file is a directory, this will return a child file of this + directory that doesn't exist, by adding numbers to a prefix and suffix until + it finds one that isn't already there. -private: - int64 seed; -}; + If the prefix + the suffix doesn't exist, it won't bother adding a number. -#endif // __JUCE_RANDOM_JUCEHEADER__ -/********* End of inlined file: juce_Random.h *********/ + e.g. File ("/moose/fish").getNonexistentChildFile ("foo", ".txt", true) might + return "/moose/fish/foo(2).txt" if there's already a file called "foo.txt". -#endif -#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ + @param prefix the string to use for the filename before the number + @param suffix the string to add to the filename after the number + @param putNumbersInBrackets if true, this will create filenames in the + format "prefix(number)suffix", if false, it will leave the + brackets out. + */ + const File getNonexistentChildFile (const String& prefix, + const String& suffix, + bool putNumbersInBrackets = true) const throw(); -#endif -#ifndef __JUCE_SINGLETON_JUCEHEADER__ + /** Chooses a filename for a sibling file to this one that doesn't already exist. -/********* Start of inlined file: juce_Singleton.h *********/ -#ifndef __JUCE_SINGLETON_JUCEHEADER__ -#define __JUCE_SINGLETON_JUCEHEADER__ + If this file doesn't exist, this will just return itself, otherwise it + will return an appropriate sibling that doesn't exist, e.g. if a file + "/moose/fish/foo.txt" exists, this might return "/moose/fish/foo(2).txt". -/********* Start of inlined file: juce_ScopedLock.h *********/ -#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ -#define __JUCE_SCOPEDLOCK_JUCEHEADER__ + @param putNumbersInBrackets whether to add brackets around the numbers that + get appended to the new filename. + */ + const File getNonexistentSibling (const bool putNumbersInBrackets = true) const throw(); -/** - Automatically locks and unlocks a CriticalSection object. + /** Compares the pathnames for two files. */ + bool operator== (const File& otherFile) const throw(); + /** Compares the pathnames for two files. */ + bool operator!= (const File& otherFile) const throw(); - Use one of these as a local variable to control access to a CriticalSection. + /** Checks whether a file can be created or written to. - e.g. @code + @returns true if it's possible to create and write to this file. If the file + doesn't already exist, this will check its parent directory to + see if writing is allowed. + @see setReadOnly + */ + bool hasWriteAccess() const throw(); - CriticalSection myCriticalSection; + /** Changes the write-permission of a file or directory. - for (;;) - { - const ScopedLock myScopedLock (myCriticalSection); - // myCriticalSection is now locked + @param shouldBeReadOnly whether to add or remove write-permission + @param applyRecursively if the file is a directory and this is true, it will + recurse through all the subfolders changing the permissions + of all files + @returns true if it manages to change the file's permissions. + @see hasWriteAccess + */ + bool setReadOnly (const bool shouldBeReadOnly, + const bool applyRecursively = false) const throw(); - ...do some stuff... + /** Returns true if this file is a hidden or system file. - // myCriticalSection gets unlocked here. - } - @endcode + The criteria for deciding whether a file is hidden are platform-dependent. + */ + bool isHidden() const throw(); - @see CriticalSection, ScopedUnlock -*/ -class JUCE_API ScopedLock -{ -public: + /** Returns the last modification time of this file. - /** Creates a ScopedLock. + @returns the time, or an invalid time if the file doesn't exist. + @see setLastModificationTime, getLastAccessTime, getCreationTime + */ + const Time getLastModificationTime() const throw(); - As soon as it is created, this will lock the CriticalSection, and - when the ScopedLock object is deleted, the CriticalSection will - be unlocked. + /** Returns the last time this file was accessed. - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! Best just to use it - as a local stack object, rather than creating one with the new() operator. + @returns the time, or an invalid time if the file doesn't exist. + @see setLastAccessTime, getLastModificationTime, getCreationTime */ - inline ScopedLock (const CriticalSection& lock) throw() : lock_ (lock) { lock.enter(); } + const Time getLastAccessTime() const throw(); - /** Destructor. + /** Returns the time that this file was created. - The CriticalSection will be unlocked when the destructor is called. + @returns the time, or an invalid time if the file doesn't exist. + @see getLastModificationTime, getLastAccessTime + */ + const Time getCreationTime() const throw(); - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! + /** Changes the modification time for this file. + + @param newTime the time to apply to the file + @returns true if it manages to change the file's time. + @see getLastModificationTime, setLastAccessTime, setCreationTime */ - inline ~ScopedLock() throw() { lock_.exit(); } + bool setLastModificationTime (const Time& newTime) const throw(); -private: + /** Changes the last-access time for this file. - const CriticalSection& lock_; + @param newTime the time to apply to the file + @returns true if it manages to change the file's time. + @see getLastAccessTime, setLastModificationTime, setCreationTime + */ + bool setLastAccessTime (const Time& newTime) const throw(); - ScopedLock (const ScopedLock&); - const ScopedLock& operator= (const ScopedLock&); -}; + /** Changes the creation date for this file. -/** - Automatically unlocks and re-locks a CriticalSection object. + @param newTime the time to apply to the file + @returns true if it manages to change the file's time. + @see getCreationTime, setLastModificationTime, setLastAccessTime + */ + bool setCreationTime (const Time& newTime) const throw(); - This is the reverse of a ScopedLock object - instead of locking the critical - section for the lifetime of this object, it unlocks it. + /** Creates an empty file if it doesn't already exist. - Make sure you don't try to unlock critical sections that aren't actually locked! + If the file that this object refers to doesn't exist, this will create a file + of zero size. - e.g. @code + If it already exists or is a directory, this method will do nothing. - CriticalSection myCriticalSection; + @returns true if the file has been created (or if it already existed). + @see createDirectory + */ + bool create() const throw(); - for (;;) - { - const ScopedLock myScopedLock (myCriticalSection); - // myCriticalSection is now locked + /** Creates a new directory for this filename. - ... do some stuff with it locked .. + This will try to create the file as a directory, and fill also create + any parent directories it needs in order to complete the operation. + + @returns true if the directory has been created successfully, (or if it + already existed beforehand). + @see create + */ + bool createDirectory() const throw(); + + /** Deletes a file. - while (xyz) - { - ... do some stuff with it locked .. + If this file is actually a directory, it may not be deleted correctly if it + contains files. See deleteRecursively() as a better way of deleting directories. - const ScopedUnlock unlocker (myCriticalSection); + @returns true if the file has been successfully deleted (or if it didn't exist to + begin with). + @see deleteRecursively + */ + bool deleteFile() const throw(); - // myCriticalSection is now unlocked for the remainder of this block, - // and re-locked at the end. + /** Deletes a file or directory and all its subdirectories. - ...do some stuff with it unlocked ... - } + If this file is a directory, this will try to delete it and all its subfolders. If + it's just a file, it will just try to delete the file. - // myCriticalSection gets unlocked here. - } - @endcode + @returns true if the file and all its subfolders have been successfully deleted + (or if it didn't exist to begin with). + @see deleteFile + */ + bool deleteRecursively() const throw(); - @see CriticalSection, ScopedLock -*/ -class ScopedUnlock -{ -public: + /** Moves or renames a file. - /** Creates a ScopedUnlock. + Tries to move a file to a different location. + If the target file already exists, this will attempt to delete it first, and + will fail if this can't be done. - As soon as it is created, this will unlock the CriticalSection, and - when the ScopedLock object is deleted, the CriticalSection will - be re-locked. + Note that the destination file isn't the directory to put it in, it's the actual + filename that you want the new file to have. - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! Best just to use it - as a local stack object, rather than creating one with the new() operator. + @returns true if the operation succeeds */ - inline ScopedUnlock (const CriticalSection& lock) throw() : lock_ (lock) { lock.exit(); } + bool moveFileTo (const File& targetLocation) const throw(); - /** Destructor. + /** Copies a file. - The CriticalSection will be unlocked when the destructor is called. + Tries to copy a file to a different location. + If the target file already exists, this will attempt to delete it first, and + will fail if this can't be done. - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! + @returns true if the operation succeeds */ - inline ~ScopedUnlock() throw() { lock_.enter(); } + bool copyFileTo (const File& targetLocation) const throw(); -private: + /** Copies a directory. - const CriticalSection& lock_; + Tries to copy an entire directory, recursively. - ScopedUnlock (const ScopedLock&); - const ScopedUnlock& operator= (const ScopedUnlock&); -}; + If this file isn't a directory or if any target files can't be created, this + will return false. -#endif // __JUCE_SCOPEDLOCK_JUCEHEADER__ -/********* End of inlined file: juce_ScopedLock.h *********/ + @param newDirectory the directory that this one should be copied to. Note that this + is the name of the actual directory to create, not the directory + into which the new one should be placed, so there must be enough + write privileges to create it if it doesn't exist. Any files inside + it will be overwritten by similarly named ones that are copied. + */ + bool copyDirectoryTo (const File& newDirectory) const throw(); -/** - Macro to declare member variables and methods for a singleton class. + /** Used in file searching, to specify whether to return files, directories, or both. + */ + enum TypesOfFileToFind + { + findDirectories = 1, /**< Use this flag to indicate that you want to find directories. */ + findFiles = 2, /**< Use this flag to indicate that you want to find files. */ + findFilesAndDirectories = 3, /**< Use this flag to indicate that you want to find both files and directories. */ + ignoreHiddenFiles = 4 /**< Add this flag to avoid returning any hidden files in the results. */ + }; - To use this, add the line juce_DeclareSingleton (MyClass, allowOnlyOneInstance) - to the class's definition. + /** Searches inside a directory for files matching a wildcard pattern. - If allowOnlyOneInstance == true, it won't allow the object to be created - more than once in the process's lifetime. + Assuming that this file is a directory, this method will search it + for either files or subdirectories whose names match a filename pattern. - Then put a macro juce_ImplementSingleton (MyClass) along with the class's - implementation code. + @param results an array to which File objects will be added for the + files that the search comes up with + @param whatToLookFor a value from the TypesOfFileToFind enum, specifying whether to + return files, directories, or both. If the ignoreHiddenFiles flag + is also added to this value, hidden files won't be returned + @param searchRecursively if true, all subdirectories will be recursed into to do + an exhaustive search + @param wildCardPattern the filename pattern to search for, e.g. "*.txt" + @returns the number of results that have been found - Clients can then call the static MyClass::getInstance() to get a pointer to the - singleton, or MyClass::getInstanceWithoutCreating() which may return 0 if no instance - is currently extant + @see getNumberOfChildFiles, DirectoryIterator + */ + int findChildFiles (OwnedArray& results, + const int whatToLookFor, + const bool searchRecursively, + const String& wildCardPattern = JUCE_T("*")) const throw(); - it's a very good idea to also add the call clearSingletonInstance() to the - destructor of the class, in case it is deleted by other means than deleteInstance() + /** Searches inside a directory and counts how many files match a wildcard pattern. - e.g. @code + Assuming that this file is a directory, this method will search it + for either files or subdirectories whose names match a filename pattern, + and will return the number of matches found. - class MySingleton - { - public: - MySingleton() - { - } + This isn't a recursive call, and will only search this directory, not + its children. - ~MySingleton() - { - // this ensures that no dangling pointers are left when the - // singleton is deleted. - clearSingletonInstance(); - } + @param whatToLookFor a value from the TypesOfFileToFind enum, specifying whether to + count files, directories, or both. If the ignoreHiddenFiles flag + is also added to this value, hidden files won't be counted + @param wildCardPattern the filename pattern to search for, e.g. "*.txt" + @returns the number of matches found + @see findChildFiles, DirectoryIterator + */ + int getNumberOfChildFiles (const int whatToLookFor, + const String& wildCardPattern = JUCE_T("*")) const throw(); - juce_DeclareSingleton (MySingleton, false) - }; + /** Creates a stream to read from this file. - juce_ImplementSingleton (MySingleton) + @returns a stream that will read from this file (initially positioned at the + start of the file), or 0 if the file can't be opened for some reason + @see createOutputStream, loadFileAsData + */ + FileInputStream* createInputStream() const throw(); - // example of usage: - MySingleton* m = MySingleton::getInstance(); // creates the singleton if there isn't already one. + /** Creates a stream to write to this file. - ... + If the file exists, the stream that is returned will be positioned ready for + writing at the end of the file, so you might want to use deleteFile() first + to write to an empty file. - MySingleton::deleteInstance(); // safely deletes the singleton (if it's been created). + @returns a stream that will write to this file (initially positioned at the + end of the file), or 0 if the file can't be opened for some reason + @see createInputStream, printf, appendData, appendText + */ + FileOutputStream* createOutputStream (const int bufferSize = 0x8000) const throw(); - @endcode + /** Loads a file's contents into memory as a block of binary data. - If you know that your object will only be created and deleted by a single thread, you - can use the slightly more efficient juce_DeclareSingleton_SingleThreaded() macro instead - of this one. + Of course, trying to load a very large file into memory will blow up, so + it's better to check first. - @see juce_ImplementSingleton, juce_DeclareSingleton_SingleThreaded -*/ -#define juce_DeclareSingleton(classname, allowOnlyOneInstance) \ -\ - static classname* _singletonInstance; \ - static JUCE_NAMESPACE::CriticalSection _singletonLock; \ -\ - static classname* getInstance() \ - { \ - if (_singletonInstance == 0) \ - {\ - const JUCE_NAMESPACE::ScopedLock sl (_singletonLock); \ -\ - if (_singletonInstance == 0) \ - { \ - static bool alreadyInside = false; \ - static bool createdOnceAlready = false; \ -\ - const bool problem = alreadyInside || ((allowOnlyOneInstance) && createdOnceAlready); \ - jassert (! problem); \ - if (! problem) \ - { \ - createdOnceAlready = true; \ - alreadyInside = true; \ - classname* newObject = new classname(); /* (use a stack variable to avoid setting the newObject value before the class has finished its constructor) */ \ - alreadyInside = false; \ -\ - _singletonInstance = newObject; \ - } \ - } \ - } \ -\ - return _singletonInstance; \ - } \ -\ - static inline classname* getInstanceWithoutCreating() throw() \ - { \ - return _singletonInstance; \ - } \ -\ - static void deleteInstance() \ - { \ - const JUCE_NAMESPACE::ScopedLock sl (_singletonLock); \ - if (_singletonInstance != 0) \ - { \ - classname* const old = _singletonInstance; \ - _singletonInstance = 0; \ - delete old; \ - } \ - } \ -\ - void clearSingletonInstance() throw() \ - { \ - if (_singletonInstance == this) \ - _singletonInstance = 0; \ - } + @param result the data block to which the file's contents should be appended - note + that if the memory block might already contain some data, you + might want to clear it first + @returns true if the file could all be read into memory + */ + bool loadFileAsData (MemoryBlock& result) const throw(); -/** This is a counterpart to the juce_DeclareSingleton macro. + /** Reads a file into memory as a string. - After adding the juce_DeclareSingleton to the class definition, this macro has - to be used in the cpp file. -*/ -#define juce_ImplementSingleton(classname) \ -\ - classname* classname::_singletonInstance = 0; \ - JUCE_NAMESPACE::CriticalSection classname::_singletonLock; + Attempts to load the entire file as a zero-terminated string. -/** - Macro to declare member variables and methods for a singleton class. + This makes use of InputStream::readEntireStreamAsString, which should + automatically cope with unicode/acsii file formats. + */ + const String loadFileAsString() const throw(); - This is exactly the same as juce_DeclareSingleton, but doesn't use a critical - section to make access to it thread-safe. If you know that your object will - only ever be created or deleted by a single thread, then this is a - more efficient version to use. + /** Writes text to the end of the file. - See the documentation for juce_DeclareSingleton for more information about - how to use it, the only difference being that you have to use - juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton. + This will try to do a printf to the file. - @see juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton, juce_DeclareSingleton_SingleThreaded_Minimal -*/ -#define juce_DeclareSingleton_SingleThreaded(classname, allowOnlyOneInstance) \ -\ - static classname* _singletonInstance; \ -\ - static classname* getInstance() \ - { \ - if (_singletonInstance == 0) \ - { \ - static bool alreadyInside = false; \ - static bool createdOnceAlready = false; \ -\ - const bool problem = alreadyInside || ((allowOnlyOneInstance) && createdOnceAlready); \ - jassert (! problem); \ - if (! problem) \ - { \ - createdOnceAlready = true; \ - alreadyInside = true; \ - classname* newObject = new classname(); /* (use a stack variable to avoid setting the newObject value before the class has finished its constructor) */ \ - alreadyInside = false; \ -\ - _singletonInstance = newObject; \ - } \ - } \ -\ - return _singletonInstance; \ - } \ -\ - static inline classname* getInstanceWithoutCreating() throw() \ - { \ - return _singletonInstance; \ - } \ -\ - static void deleteInstance() \ - { \ - if (_singletonInstance != 0) \ - { \ - classname* const old = _singletonInstance; \ - _singletonInstance = 0; \ - delete old; \ - } \ - } \ -\ - void clearSingletonInstance() throw() \ - { \ - if (_singletonInstance == this) \ - _singletonInstance = 0; \ - } + @returns false if it can't write to the file for some reason + */ + bool printf (const tchar* format, ...) const throw(); -/** - Macro to declare member variables and methods for a singleton class. + /** Appends a block of binary data to the end of the file. - This is like juce_DeclareSingleton_SingleThreaded, but doesn't do any checking - for recursion or repeated instantiation. It's intended for use as a lightweight - version of a singleton, where you're using it in very straightforward - circumstances and don't need the extra checking. + This will try to write the given buffer to the end of the file. - Juce use the normal juce_ImplementSingleton_SingleThreaded as the counterpart - to this declaration, as you would with juce_DeclareSingleton_SingleThreaded. + @returns false if it can't write to the file for some reason + */ + bool appendData (const void* const dataToAppend, + const int numberOfBytes) const throw(); - See the documentation for juce_DeclareSingleton for more information about - how to use it, the only difference being that you have to use - juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton. + /** Replaces this file's contents with a given block of data. - @see juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton -*/ -#define juce_DeclareSingleton_SingleThreaded_Minimal(classname) \ -\ - static classname* _singletonInstance; \ -\ - static classname* getInstance() \ - { \ - if (_singletonInstance == 0) \ - _singletonInstance = new classname(); \ -\ - return _singletonInstance; \ - } \ -\ - static inline classname* getInstanceWithoutCreating() throw() \ - { \ - return _singletonInstance; \ - } \ -\ - static void deleteInstance() \ - { \ - if (_singletonInstance != 0) \ - { \ - classname* const old = _singletonInstance; \ - _singletonInstance = 0; \ - delete old; \ - } \ - } \ -\ - void clearSingletonInstance() throw() \ - { \ - if (_singletonInstance == this) \ - _singletonInstance = 0; \ - } + This will delete the file and replace it with the given data. -/** This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro. + A nice feature of this method is that it's safe - instead of deleting + the file first and then re-writing it, it creates a new temporary file, + writes the data to that, and then moves the new file to replace the existing + file. This means that if the power gets pulled out or something crashes, + you're a lot less likely to end up with an empty file.. - After adding juce_DeclareSingleton_SingleThreaded or juce_DeclareSingleton_SingleThreaded_Minimal - to the class definition, this macro has to be used somewhere in the cpp file. -*/ -#define juce_ImplementSingleton_SingleThreaded(classname) \ -\ - classname* classname::_singletonInstance = 0; + Returns true if the operation succeeds, or false if it fails. -#endif // __JUCE_SINGLETON_JUCEHEADER__ -/********* End of inlined file: juce_Singleton.h *********/ + @see appendText + */ + bool replaceWithData (const void* const dataToWrite, + const int numberOfBytes) const throw(); -#endif -#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ + /** Appends a string to the end of the file. -#endif -#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ + This will try to append a text string to the file, as either 16-bit unicode + or 8-bit characters in the default system encoding. -/********* Start of inlined file: juce_SystemStats.h *********/ -#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ -#define __JUCE_SYSTEMSTATS_JUCEHEADER__ + It can also write the 'ff fe' unicode header bytes before the text to indicate + the endianness of the file. -/** - Contains methods for finding out about the current hardware and OS configuration. -*/ -class JUCE_API SystemStats -{ -public: + Any single \\n characters in the string are replaced with \\r\\n before it is written. - /** Returns the current version of JUCE, + @see replaceWithText + */ + bool appendText (const String& textToAppend, + const bool asUnicode = false, + const bool writeUnicodeHeaderBytes = false) const throw(); - (just in case you didn't already know at compile-time.) + /** Replaces this file's contents with a given text string. - See also the JUCE_VERSION, JUCE_MAJOR_VERSION and JUCE_MINOR_VERSION macros. - */ - static const String getJUCEVersion() throw(); + This will delete the file and replace it with the given text. - /** The set of possible results of the getOperatingSystemType() method. - */ - enum OperatingSystemType - { - UnknownOS = 0, + A nice feature of this method is that it's safe - instead of deleting + the file first and then re-writing it, it creates a new temporary file, + writes the text to that, and then moves the new file to replace the existing + file. This means that if the power gets pulled out or something crashes, + you're a lot less likely to end up with an empty file.. - MacOSX = 0x1000, - Linux = 0x2000, + For an explanation of the parameters here, see the appendText() method. - Win95 = 0x4001, - Win98 = 0x4002, - WinNT351 = 0x4103, - WinNT40 = 0x4104, - Win2000 = 0x4105, - WinXP = 0x4106, - WinVista = 0x4107, + Returns true if the operation succeeds, or false if it fails. - Windows = 0x4000, /**< To test whether any version of Windows is running, - you can use the expression ((getOperatingSystemType() & Windows) != 0). */ - WindowsNT = 0x0100, /**< To test whether the platform is Windows NT or later (i.e. not Win95 or 98), - you can use the expression ((getOperatingSystemType() & WindowsNT) != 0). */ - }; + @see appendText + */ + bool replaceWithText (const String& textToWrite, + const bool asUnicode = false, + const bool writeUnicodeHeaderBytes = false) const throw(); - /** Returns the type of operating system we're running on. + /** Creates a set of files to represent each file root. - @returns one of the values from the OperatingSystemType enum. - @see getOperatingSystemName + e.g. on Windows this will create files for "c:\", "d:\" etc according + to which ones are available. On the Mac/Linux, this will probably + just add a single entry for "/". */ - static OperatingSystemType getOperatingSystemType() throw(); + static void findFileSystemRoots (OwnedArray& results) throw(); - /** Returns the name of the type of operating system we're running on. + /** Finds the name of the drive on which this file lives. - @returns a string describing the OS type. - @see getOperatingSystemType + @returns the volume label of the drive, or an empty string if this isn't possible */ - static const String getOperatingSystemName() throw(); + const String getVolumeLabel() const throw(); - /** Returns true if the OS is 64-bit, or false for a 32-bit OS. + /** Returns the serial number of the volume on which this file lives. + + @returns the serial number, or zero if there's a problem doing this */ - static bool isOperatingSystem64Bit() throw(); + int getVolumeSerialNumber() const throw(); - // CPU and memory information.. + /** Returns the number of bytes free on the drive that this file lives on. - /** Returns the approximate CPU speed. + @returns the number of bytes free, or 0 if there's a problem finding this out + */ + int64 getBytesFreeOnVolume() const throw(); - @returns the speed in megahertz, e.g. 1500, 2500, 32000 (depending on - what year you're reading this...) + /** Returns true if this file is on a CD or DVD drive. */ + bool isOnCDRomDrive() const throw(); + + /** Returns true if this file is on a hard disk. + + This will fail if it's a network drive, but will still be true for + removable hard-disks. */ - static int getCpuSpeedInMegaherz() throw(); + bool isOnHardDisk() const throw(); - /** Returns a string to indicate the CPU vendor. + /** Returns true if this file is on a removable disk drive. - Might not be known on some systems. + This might be a usb-drive, a CD-rom, or maybe a network drive. */ - static const String getCpuVendor() throw(); + bool isOnRemovableDrive() const throw(); - /** Checks whether Intel MMX instructions are available. */ - static bool hasMMX() throw(); + /** Launches the file as a process. - /** Checks whether Intel SSE instructions are available. */ - static bool hasSSE() throw(); + - if the file is executable, this will run it. - /** Checks whether Intel SSE2 instructions are available. */ - static bool hasSSE2() throw(); + - if it's a document of some kind, it will launch the document with its + default viewer application. - /** Checks whether AMD 3DNOW instructions are available. */ - static bool has3DNow() throw(); + - if it's a folder, it will be opened in Explorer, Finder, or equivalent. + */ + bool startAsProcess (const String& parameters = String::empty) const throw(); + + /** A set of types of location that can be passed to the getSpecialLocation() method. + */ + enum SpecialLocationType + { + /** The user's home folder. This is the same as using File ("~"). */ + userHomeDirectory, - /** Returns the number of CPUs. - */ - static int getNumCpus() throw(); + /** The user's default documents folder. On Windows, this might be the user's + "My Documents" folder. On the Mac it'll be their "Documents" folder. Linux + doesn't tend to have one of these, so it might just return their home folder. + */ + userDocumentsDirectory, - /** Returns a clock-cycle tick counter, if available. + /** The folder that contains the user's desktop objects. */ + userDesktopDirectory, - If the machine can do it, this will return a tick-count - where each tick is one cpu clock cycle - used for profiling - code. + /** The folder in which applications store their persistent user-specific settings. + On Windows, this might be "\Documents and Settings\username\Application Data". + On the Mac, it might be "~/Library". If you're going to store your settings in here, + always create your own sub-folder to put them in, to avoid making a mess. + */ + userApplicationDataDirectory, - @returns the tick count, or zero if not available. - */ - static int64 getClockCycleCounter() throw(); + /** An equivalent of the userApplicationDataDirectory folder that is shared by all users + of the computer, rather than just the current user. - /** Finds out how much RAM is in the machine. + On the Mac it'll be "/Library", on Windows, it could be something like + "\Documents and Settings\All Users\Application Data". - @returns the approximate number of megabytes of memory, or zero if - something goes wrong when finding out. - */ - static int getMemorySizeInMegabytes() throw(); + Depending on the setup, this folder may be read-only. + */ + commonApplicationDataDirectory, - /** Returns the system page-size. + /** The folder that should be used for temporary files. - This is only used by programmers with beards. - */ - static int getPageSize() throw(); + Always delete them when you're finished, to keep the user's computer tidy! + */ + tempDirectory, - /** Returns a list of MAC addresses found on this machine. + /** Returns this application's executable file. - @param addresses an array into which the MAC addresses should be copied - @param maxNum the number of elements in this array - @param littleEndian the endianness of the numbers to return. Note that - the default values of this parameter are different on - Mac/PC to avoid breaking old software that was written - before this parameter was added (when the two systems - defaulted to using different endiannesses). In newer - software you probably want to specify an explicit value - for this. - @returns the number of MAC addresses that were found - */ - static int getMACAddresses (int64* addresses, int maxNum, -#if JUCE_MAC - const bool littleEndian = true) throw(); -#else - const bool littleEndian = false) throw(); -#endif + If running as a plug-in or DLL, this will (where possible) be the DLL rather than the + host app. - // not-for-public-use platform-specific method gets called at startup to initialise things. - static void initialiseStats() throw(); -}; + On the mac this will return the unix binary, not the package folder - see + currentApplicationFile for that. + */ + currentExecutableFile, -#endif // __JUCE_SYSTEMSTATS_JUCEHEADER__ -/********* End of inlined file: juce_SystemStats.h *********/ + /** Returns this application's location. -#endif -#ifndef __JUCE_TIME_JUCEHEADER__ + If running as a plug-in or DLL, this will (where possible) be the DLL rather than the + host app. -#endif -#ifndef __JUCE_ARRAY_JUCEHEADER__ + On the mac this will return the package folder (if it's in one), not the unix binary + that's inside it - compare with currentExecutableFile. + */ + currentApplicationFile, -#endif -#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ + /** The directory in which applications normally get installed. -#endif -#ifndef __JUCE_BITARRAY_JUCEHEADER__ + So on windows, this would be something like "c:\program files", on the + Mac "/Applications", or "/usr" on linux. + */ + globalApplicationsDirectory, -/********* Start of inlined file: juce_BitArray.h *********/ -#ifndef __JUCE_BITARRAY_JUCEHEADER__ -#define __JUCE_BITARRAY_JUCEHEADER__ + /** The most likely place where a user might store their music files. + */ + userMusicDirectory, -class MemoryBlock; + /** The most likely place where a user might store their movie files. + */ + userMoviesDirectory, + }; -/** - An array of on/off bits, also usable to store large binary integers. + /** Finds the location of a special type of file or directory, such as a home folder or + documents folder. - A BitArray acts like an arbitrarily large integer whose bits can be set or - cleared, and some basic mathematical operations can be done on the number as - a whole. -*/ -class JUCE_API BitArray -{ -public: + @see SpecialLocationType + */ + static const File JUCE_CALLTYPE getSpecialLocation (const SpecialLocationType type); - /** Creates an empty BitArray */ - BitArray() throw(); + /** Returns a temporary file in the system's temp directory. - /** Creates a BitArray containing an integer value in its low bits. + This will try to return the name of a non-existent temp file. - The low 32 bits of the array are initialised with this value. + To get the temp folder, you can use getSpecialLocation (File::tempDirectory). */ - BitArray (const unsigned int value) throw(); + static const File createTempFile (const String& fileNameEnding) throw(); - /** Creates a BitArray containing an integer value in its low bits. + /** Returns the current working directory. - The low 32 bits of the array are initialised with the absolute value - passed in, and its sign is set to reflect the sign of the number. + @see setAsCurrentWorkingDirectory */ - BitArray (const int value) throw(); + static const File getCurrentWorkingDirectory() throw(); - /** Creates a BitArray containing an integer value in its low bits. + /** Sets the current working directory to be this file. - The low 64 bits of the array are initialised with the absolute value - passed in, and its sign is set to reflect the sign of the number. + For this to work the file must point to a valid directory. + + @returns true if the current directory has been changed. + @see getCurrentWorkingDirectory */ - BitArray (int64 value) throw(); + bool setAsCurrentWorkingDirectory() const throw(); - /** Creates a copy of another BitArray. */ - BitArray (const BitArray& other) throw(); + /** The system-specific file separator character. - /** Destructor. */ - ~BitArray() throw(); + On Windows, this will be '\', on Mac/Linux, it'll be '/' + */ + static const tchar separator; - /** Copies another BitArray onto this one. */ - const BitArray& operator= (const BitArray& other) throw(); + /** The system-specific file separator character, as a string. - /** Two arrays are the same if the same bits are set. */ - bool operator== (const BitArray& other) const throw(); - /** Two arrays are the same if the same bits are set. */ - bool operator!= (const BitArray& other) const throw(); + On Windows, this will be '\', on Mac/Linux, it'll be '/' + */ + static const tchar* separatorString; - /** Clears all bits in the BitArray to 0. */ - void clear() throw(); + /** Removes illegal characters from a filename. - /** Clears a particular bit in the array. */ - void clearBit (const int bitNumber) throw(); + This will return a copy of the given string after removing characters + that are not allowed in a legal filename, and possibly shortening the + string if it's too long. - /** Sets a specified bit to 1. + Because this will remove slashes, don't use it on an absolute pathname. - If the bit number is high, this will grow the array to accomodate it. + @see createLegalPathName */ - void setBit (const int bitNumber) throw(); + static const String createLegalFileName (const String& fileNameToFix) throw(); - /** Sets or clears a specified bit. */ - void setBit (const int bitNumber, - const bool shouldBeSet) throw(); + /** Removes illegal characters from a pathname. - /** Sets a range of bits to be either on or off. + Similar to createLegalFileName(), but this won't remove slashes, so can + be used on a complete pathname. - @param startBit the first bit to change - @param numBits the number of bits to change - @param shouldBeSet whether to turn these bits on or off + @see createLegalFileName */ - void setRange (int startBit, - int numBits, - const bool shouldBeSet) throw(); - - /** Inserts a bit an a given position, shifting up any bits above it. */ - void insertBit (const int bitNumber, - const bool shouldBeSet) throw(); - - /** Returns the value of a specified bit in the array. + static const String createLegalPathName (const String& pathNameToFix) throw(); - If the index is out-of-range, the result will be false. + /** Indicates whether filenames are case-sensitive on the current operating system. */ - bool operator[] (const int bit) const throw(); + static bool areFileNamesCaseSensitive(); - /** Returns true if no bits are set. */ - bool isEmpty() const throw(); + /** Returns true if the string seems to be a fully-specified absolute path. + */ + static bool isAbsolutePath (const String& path) throw(); - /** Returns a range of bits in the array as an integer value. + juce_UseDebuggingNewOperator - e.g. getBitRangeAsInt (0, 32) would return the lowest 32 bits. +private: - Asking for more than 32 bits isn't allowed (obviously). - */ - int getBitRangeAsInt (int startBit, int numBits) const throw(); + String fullPath; - /** Sets a range of bits in the array based on an integer value. + // internal way of contructing a file without checking the path + friend class DirectoryIterator; + File (const String&, int) throw(); + const String getPathUpToLastSlash() const throw(); +}; - Copies the given integer into the array, starting at startBit, - and only using up to numBits of the available bits. - */ - void setBitRangeAsInt (int startBit, int numBits, - unsigned int valueToSet) throw(); +#endif // __JUCE_FILE_JUCEHEADER__ +/********* End of inlined file: juce_File.h *********/ - /** Performs a bitwise OR with another BitArray. +/** + A simple implemenation of a Logger that writes to a file. - The result ends up in this array. - */ - void orWith (const BitArray& other) throw(); + @see Logger +*/ +class JUCE_API FileLogger : public Logger +{ +public: - /** Performs a bitwise AND with another BitArray. + /** Creates a FileLogger for a given file. - The result ends up in this array. + @param fileToWriteTo the file that to use - new messages will be appended + to the file. If the file doesn't exist, it will be created, + along with any parent directories that are needed. + @param welcomeMessage when opened, the logger will write a header to the log, along + with the current date and time, and this welcome message + @param maxInitialFileSizeBytes if this is zero or greater, then if the file already exists + but is larger than this number of bytes, then the start of the + file will be truncated to keep the size down. This prevents a log + file getting ridiculously large over time. The file will be truncated + at a new-line boundary. If this value is less than zero, no size limit + will be imposed; if it's zero, the file will always be deleted. Note that + the size is only checked once when this object is created - any logging + that is done later will be appended without any checking */ - void andWith (const BitArray& other) throw(); + FileLogger (const File& fileToWriteTo, + const String& welcomeMessage, + const int maxInitialFileSizeBytes = 128 * 1024); - /** Performs a bitwise XOR with another BitArray. + /** Destructor. */ + ~FileLogger(); - The result ends up in this array. - */ - void xorWith (const BitArray& other) throw(); + void logMessage (const String& message); - /** Adds another BitArray's value to this one. + /** Helper function to create a log file in the correct place for this platform. - Treating the two arrays as large positive integers, this - adds them up and puts the result in this array. - */ - void add (const BitArray& other) throw(); + On Windows this will return a logger with a path such as: + c:\\Documents and Settings\\username\\Application Data\\[logFileSubDirectoryName]\\[logFileName] - /** Subtracts another BitArray's value from this one. + On the Mac it'll create something like: + ~/Library/Logs/[logFileName] - Treating the two arrays as large positive integers, this - subtracts them and puts the result in this array. + The method might return 0 if the file can't be created for some reason. - Note that if the result should be negative, this won't be - handled correctly. + @param logFileSubDirectoryName if a subdirectory is needed, this is what it will be called - + it's best to use the something like the name of your application here. + @param logFileName the name of the file to create, e.g. "MyAppLog.txt". Don't just + call it "log.txt" because if it goes in a directory with logs + from other applications (as it will do on the Mac) then no-one + will know which one is yours! + @param welcomeMessage a message that will be written to the log when it's opened. + @param maxInitialFileSizeBytes (see the FileLogger constructor for more info on this) */ - void subtract (const BitArray& other) throw(); + static FileLogger* createDefaultAppLogger (const String& logFileSubDirectoryName, + const String& logFileName, + const String& welcomeMessage, + const int maxInitialFileSizeBytes = 128 * 1024); - /** Multiplies another BitArray's value with this one. + juce_UseDebuggingNewOperator - Treating the two arrays as large positive integers, this - multiplies them and puts the result in this array. - */ - void multiplyBy (const BitArray& other) throw(); +private: + File logFile; + CriticalSection logLock; + FileOutputStream* logStream; - /** Divides another BitArray's value into this one and also produces a remainder. + void trimFileSize (int maxFileSizeBytes) const; - Treating the two arrays as large positive integers, this - divides this value by the other, leaving the quotient in this - array, and the remainder is copied into the other BitArray passed in. - */ - void divideBy (const BitArray& divisor, BitArray& remainder) throw(); + FileLogger (const FileLogger&); + const FileLogger& operator= (const FileLogger&); +}; - /** Returns the largest value that will divide both this value and the one - passed-in. - */ - const BitArray findGreatestCommonDivisor (BitArray other) const throw(); +#endif // __JUCE_FILELOGGER_JUCEHEADER__ +/********* End of inlined file: juce_FileLogger.h *********/ - /** Performs a modulo operation on this value. +#endif +#ifndef __JUCE_RANDOM_JUCEHEADER__ - The result is stored in this value. - */ - void modulo (const BitArray& divisor) throw(); +/********* Start of inlined file: juce_Random.h *********/ +#ifndef __JUCE_RANDOM_JUCEHEADER__ +#define __JUCE_RANDOM_JUCEHEADER__ - /** Performs a combined exponent and modulo operation. +/** + A simple pseudo-random number generator. +*/ +class JUCE_API Random +{ +public: - This BitArray's value becomes (this ^ exponent) % modulus. - */ - void exponentModulo (const BitArray& exponent, const BitArray& modulus) throw(); + /** Creates a Random object based on a seed value. - /** Performs an inverse modulo on the value. + For a given seed value, the subsequent numbers generated by this object + will be predictable, so a good idea is to set this value based + on the time, e.g. - i.e. the result is (this ^ -1) mod (modulus). + new Random (Time::currentTimeMillis()) */ - void inverseModulo (const BitArray& modulus) throw(); + Random (const int64 seedValue) throw(); - /** Shifts a section of bits left or right. + /** Destructor. */ + ~Random() throw(); - @param howManyBitsLeft how far to move the bits (+ve numbers shift it left, -ve numbers shift it right). - @param startBit the first bit to affect - if this is > 0, only bits above that index will be affected. + /** Returns the next random 32 bit integer. + + @returns a random integer from the full range 0x80000000 to 0x7fffffff */ - void shiftBits (int howManyBitsLeft, - int startBit = 0) throw(); + int nextInt() throw(); - /** Does a signed comparison of two BitArrays. + /** Returns the next random number, limited to a given range. - Return values are: - - 0 if the numbers are the same - - < 0 if this number is smaller than the other - - > 0 if this number is bigger than the other + @returns a random integer between 0 (inclusive) and maxValue (exclusive). */ - int compare (const BitArray& other) const throw(); + int nextInt (const int maxValue) throw(); - /** Compares the magnitudes of two BitArrays, ignoring their signs. + /** Returns the next 64-bit random number. - Return values are: - - 0 if the numbers are the same - - < 0 if this number is smaller than the other - - > 0 if this number is bigger than the other + @returns a random integer from the full range 0x8000000000000000 to 0x7fffffffffffffff */ - int compareAbsolute (const BitArray& other) const throw(); + int64 nextInt64() throw(); - /** Returns true if the value is less than zero. + /** Returns the next random floating-point number. - @see setNegative, negate + @returns a random value in the range 0 to 1.0 */ - bool isNegative() const throw(); + float nextFloat() throw(); - /** Changes the sign of the number to be positive or negative. + /** Returns the next random floating-point number. - @see isNegative, negate + @returns a random value in the range 0 to 1.0 */ - void setNegative (const bool shouldBeNegative) throw(); - - /** Inverts the sign of the number. + double nextDouble() throw(); - @see isNegative, setNegative + /** Returns the next random boolean value. */ - void negate() throw(); + bool nextBool() throw(); - /** Counts the total number of set bits in the array. */ - int countNumberOfSetBits() const throw(); + /** To avoid the overhead of having to create a new Random object whenever + you need a number, this is a shared application-wide object that + can be used. - /** Looks for the index of the next set bit after a given starting point. + It's not thread-safe though, so threads should use their own Random object. + */ + static Random& getSystemRandom() throw(); - searches from startIndex (inclusive) upwards for the first set bit, - and returns its index. + /** Resets this Random object to a given seed value. */ + void setSeed (const int64 newSeed) throw(); - If no set bits are found, it returns -1. - */ - int findNextSetBit (int startIndex = 0) const throw(); + juce_UseDebuggingNewOperator - /** Looks for the index of the next clear bit after a given starting point. +private: + int64 seed; +}; - searches from startIndex (inclusive) upwards for the first clear bit, - and returns its index. - */ - int findNextClearBit (int startIndex = 0) const throw(); +#endif // __JUCE_RANDOM_JUCEHEADER__ +/********* End of inlined file: juce_Random.h *********/ - /** Returns the index of the highest set bit in the array. +#endif +#ifndef __JUCE_INITIALISATION_JUCEHEADER__ - If the array is empty, this will return -1. - */ - int getHighestBit() const throw(); +/********* Start of inlined file: juce_Initialisation.h *********/ +#ifndef __JUCE_INITIALISATION_JUCEHEADER__ +#define __JUCE_INITIALISATION_JUCEHEADER__ - /** Sets a range of bits to random values. */ - void fillBitsRandomly (int startBit, int numBits) throw(); +/** Initialises Juce's GUI classes. - /** Turns this value into a random number less than the given value. */ - void createRandomNumber (const BitArray& maximumValue) throw(); + If you're embedding Juce into an application that uses its own event-loop rather + than using the START_JUCE_APPLICATION macro, call this function before making any + Juce calls, to make sure things are initialised correctly. - /** Converts the array to a number string. + Note that if you're creating a Juce DLL for Windows, you may also need to call the + PlatformUtilities::setCurrentModuleInstanceHandle() method. - Specify a base such as 2 (binary), 8 (octal), 10 (decimal), 16 (hex). - */ - const String toString (const int base) const throw(); + @see shutdownJuce_GUI(), initialiseJuce_NonGUI() +*/ +void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI(); - /** Converts a number string to an array. +/** Clears up any static data being used by Juce's GUI classes. - Any non-valid characters will be ignored. + If you're embedding Juce into an application that uses its own event-loop rather + than using the START_JUCE_APPLICATION macro, call this function in your shutdown + code to clean up any juce objects that might be lying around. - Specify a base such as 2 (binary), 8 (octal), 10 (decimal), 16 (hex). - */ - void parseString (const String& text, - const int base) throw(); + @see initialiseJuce_GUI(), initialiseJuce_NonGUI() +*/ +void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI(); - /** Turns the array into a block of binary data. +/** Initialises the core parts of Juce. - The data is arranged as little-endian, so the first byte of data is the low 8 bits - of the array, and so on. + If you're embedding Juce into either a command-line program, call this function + at the start of your main() function to make sure that Juce is initialised correctly. - @see loadFromMemoryBlock - */ - const MemoryBlock toMemoryBlock() const throw(); + Note that if you're creating a Juce DLL for Windows, you may also need to call the + PlatformUtilities::setCurrentModuleInstanceHandle() method. - /** Copies a block of raw data onto this array. + @see shutdownJuce_NonGUI, initialiseJuce_GUI +*/ +void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI(); - The data is arranged as little-endian, so the first byte of data is the low 8 bits - of the array, and so on. +/** Clears up any static data being used by Juce's non-gui core classes. - @see toMemoryBlock - */ - void loadFromMemoryBlock (const MemoryBlock& data) throw(); + If you're embedding Juce into either a command-line program, call this function + at the end of your main() function if you want to make sure any Juce objects are + cleaned up correctly. - juce_UseDebuggingNewOperator + @see initialiseJuce_NonGUI, initialiseJuce_GUI +*/ +void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI(); -private: - void ensureSize (const int numVals) throw(); - unsigned int* values; - int numValues, highestBit; - bool negative; -}; +#endif // __JUCE_INITIALISATION_JUCEHEADER__ +/********* End of inlined file: juce_Initialisation.h *********/ -#endif // __JUCE_BITARRAY_JUCEHEADER__ -/********* End of inlined file: juce_BitArray.h *********/ +#endif +#ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ #endif -#ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ +#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ #endif -#ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ +#ifndef __JUCE_TIME_JUCEHEADER__ #endif -#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ +#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ + +#endif +#ifndef __JUCE_MEMORY_JUCEHEADER__ #endif #ifndef __JUCE_PROPERTYSET_JUCEHEADER__ @@ -8637,12 +8355,16 @@ public: document @param encodingType the character encoding format string to put into the xml header + @param lineWrapLength the line length that will be used before items get placed on + a new line. This isn't an absolute maximum length, it just + determines how lists of attributes get broken up @see writeToFile */ const String createDocument (const String& dtdToUse, const bool allOnOneLine = false, const bool includeXmlHeader = true, - const tchar* const encodingType = JUCE_T("UTF-8")) const throw(); + const tchar* const encodingType = JUCE_T("UTF-8"), + const int lineWrapLength = 60) const throw(); /** Writes the element to a file as an XML document. @@ -8656,13 +8378,17 @@ public: @param dtdToUse the DTD to add to the document @param encodingType the character encoding format string to put into the xml header + @param lineWrapLength the line length that will be used before items get placed on + a new line. This isn't an absolute maximum length, it just + determines how lists of attributes get broken up @returns true if the file is written successfully; false if something goes wrong in the process @see createDocument */ bool writeToFile (const File& destinationFile, const String& dtdToUse, - const tchar* const encodingType = JUCE_T("UTF-8")) const throw(); + const tchar* const encodingType = JUCE_T("UTF-8"), + const int lineWrapLength = 60) const throw(); /** Returns this element's tag type name. @@ -9113,7 +8839,9 @@ private: void copyChildrenAndAttributesFrom (const XmlElement& other) throw(); - void writeElementAsText (OutputStream& out, const int indentationLevel) const throw(); + void writeElementAsText (OutputStream& out, + const int indentationLevel, + const int lineWrapLength) const throw(); XmlElement** getChildElementsAsArray (const int) const throw(); void reorderChildElements (XmlElement** const, const int) throw(); @@ -9334,11 +9062,16 @@ private: /********* End of inlined file: juce_PropertySet.h *********/ #endif -#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ +#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ -/********* Start of inlined file: juce_ReferenceCountedArray.h *********/ -#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ -#define __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ +#endif +#ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ + +#endif +#ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ + +#endif +#ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ /********* Start of inlined file: juce_ReferenceCountedObject.h *********/ #ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ @@ -9552,687 +9285,876 @@ public: return referencedObject; } -private: +private: + + ReferenceCountedObjectClass* referencedObject; +}; + +#endif // __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ +/********* End of inlined file: juce_ReferenceCountedObject.h *********/ + +#endif +#ifndef __JUCE_SPARSESET_JUCEHEADER__ + +/********* Start of inlined file: juce_SparseSet.h *********/ +#ifndef __JUCE_SPARSESET_JUCEHEADER__ +#define __JUCE_SPARSESET_JUCEHEADER__ + +/** + Holds a set of primitive values, storing them as a set of ranges. + + This container acts like a simple BitArray, but can efficiently hold large + continguous ranges of values. It's quite a specialised class, mostly useful + for things like keeping the set of selected rows in a listbox. + + The type used as a template paramter must be an integer type, such as int, short, + int64, etc. +*/ +template +class SparseSet +{ +public: + + /** Creates a new empty set. */ + SparseSet() throw() + { + } + + /** Creates a copy of another SparseSet. */ + SparseSet (const SparseSet& other) throw() + : values (other.values) + { + } + + /** Destructor. */ + ~SparseSet() throw() + { + } + + /** Clears the set. */ + void clear() throw() + { + values.clear(); + } + + /** Checks whether the set is empty. + + This is much quicker than using (size() == 0). + */ + bool isEmpty() const throw() + { + return values.size() == 0; + } + + /** Returns the number of values in the set. + + Because of the way the data is stored, this method can take longer if there + are a lot of items in the set. Use isEmpty() for a quick test of whether there + are any items. + */ + Type size() const throw() + { + Type num = 0; + + for (int i = 0; i < values.size(); i += 2) + num += values[i + 1] - values[i]; + + return num; + } + + /** Returns one of the values in the set. + + @param index the index of the value to retrieve, in the range 0 to (size() - 1). + @returns the value at this index, or 0 if it's out-of-range + */ + Type operator[] (int index) const throw() + { + for (int i = 0; i < values.size(); i += 2) + { + const Type s = values.getUnchecked(i); + const Type e = values.getUnchecked(i + 1); + + if (index < e - s) + return s + index; + + index -= e - s; + } + + return (Type) 0; + } + + /** Checks whether a particular value is in the set. */ + bool contains (const Type valueToLookFor) const throw() + { + bool on = false; + + for (int i = 0; i < values.size(); ++i) + { + if (values.getUnchecked(i) > valueToLookFor) + return on; + + on = ! on; + } + + return false; + } + + /** Returns the number of contiguous blocks of values. + + @see getRange + */ + int getNumRanges() const throw() + { + return values.size() >> 1; + } + + /** Returns one of the contiguous ranges of values stored. + + @param rangeIndex the index of the range to look up, between 0 + and (getNumRanges() - 1) + @param startValue on return, the value at the start of the range + @param numValues on return, the number of values in the range + + @see getTotalRange + */ + bool getRange (const int rangeIndex, + Type& startValue, + Type& numValues) const throw() + { + if (((unsigned int) rangeIndex) < (unsigned int) getNumRanges()) + { + startValue = values [rangeIndex << 1]; + numValues = values [(rangeIndex << 1) + 1] - startValue; + + return true; + } + + return false; + } + + /** Returns the lowest and highest values in the set. + + @see getRange + */ + bool getTotalRange (Type& lowestValue, + Type& highestValue) const throw() + { + if (values.size() > 0) + { + lowestValue = values.getUnchecked (0); + highestValue = values.getUnchecked (values.size() - 1); + return true; + } + + return false; + } + + /** Adds a range of contiguous values to the set. + + e.g. addRange (10, 4) will add (10, 11, 12, 13) to the set. + + @param firstValue the start of the range of values to add + @param numValuesToAdd how many values to add + */ + void addRange (const Type firstValue, + const Type numValuesToAdd) throw() + { + jassert (numValuesToAdd >= 0); + + if (numValuesToAdd > 0) + { + removeRange (firstValue, numValuesToAdd); + + IntegerElementComparator sorter; + values.addSorted (sorter, firstValue); + values.addSorted (sorter, firstValue + numValuesToAdd); + + simplify(); + } + } + + /** Removes a range of values from the set. + + e.g. removeRange (10, 4) will remove (10, 11, 12, 13) from the set. + + @param firstValue the start of the range of values to remove + @param numValuesToRemove how many values to remove + */ + void removeRange (const Type firstValue, + const Type numValuesToRemove) throw() + { + jassert (numValuesToRemove >= 0); + + if (numValuesToRemove > 0 + && firstValue < values.getLast()) + { + const bool onAtStart = contains (firstValue - 1); + Type lastValue = firstValue + numValuesToRemove; + + if (lastValue < firstValue) // possible if the signed arithmetic wraps around + lastValue = values.getLast(); + + const bool onAtEnd = contains (lastValue); + + for (int i = values.size(); --i >= 0;) + { + if (values.getUnchecked(i) >= firstValue + && values.getUnchecked(i) <= lastValue) + { + values.remove (i); + } + } + + IntegerElementComparator sorter; + + if (onAtStart) + values.addSorted (sorter, firstValue); + + if (onAtEnd) + values.addSorted (sorter, lastValue); + + simplify(); + } + } + + /** Does an XOR of the values in a given range. */ + void invertRange (const Type firstValue, + const Type numValues) + { + SparseSet newItems; + newItems.addRange (firstValue, numValues); + + int i; + for (i = getNumRanges(); --i >= 0;) + { + const int start = values [i << 1]; + const int end = values [(i << 1) + 1]; + + newItems.removeRange (start, end); + } + + removeRange (firstValue, numValues); + + for (i = newItems.getNumRanges(); --i >= 0;) + { + const int start = newItems.values [i << 1]; + const int end = newItems.values [(i << 1) + 1]; + + addRange (start, end); + } + } + + /** Checks whether any part of a given range overlaps any part of this one. */ + bool overlapsRange (const Type firstValue, + const Type numValues) throw() + { + jassert (numValues >= 0); + + if (numValues > 0) + { + for (int i = getNumRanges(); --i >= 0;) + { + if (firstValue >= values.getUnchecked ((i << 1) + 1)) + return false; + + if (firstValue + numValues > values.getUnchecked (i << 1)) + return true; + } + } + + return false; + } + + /** Checks whether the whole of a given range is contained within this one. */ + bool containsRange (const Type firstValue, + const Type numValues) throw() + { + jassert (numValues >= 0); + + if (numValues > 0) + { + for (int i = getNumRanges(); --i >= 0;) + { + if (firstValue >= values.getUnchecked ((i << 1) + 1)) + return false; + + if (firstValue >= values.getUnchecked (i << 1) + && firstValue + numValues <= values.getUnchecked ((i << 1) + 1)) + return true; + } + } + + return false; + } + + bool operator== (const SparseSet& other) throw() + { + return values == other.values; + } + + bool operator!= (const SparseSet& other) throw() + { + return values != other.values; + } + + juce_UseDebuggingNewOperator + +private: + // alternating start/end values of ranges of values that are present. + Array values; + + void simplify() throw() + { + jassert ((values.size() & 1) == 0); + + for (int i = values.size(); --i > 0;) + if (values.getUnchecked(i) == values.getUnchecked (i - 1)) + values.removeRange (i - 1, 2); + } +}; + +#endif // __JUCE_SPARSESET_JUCEHEADER__ +/********* End of inlined file: juce_SparseSet.h *********/ + +#endif +#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ - ReferenceCountedObjectClass* referencedObject; -}; +#endif +#ifndef __JUCE_SORTEDSET_JUCEHEADER__ -#endif // __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ -/********* End of inlined file: juce_ReferenceCountedObject.h *********/ +/********* Start of inlined file: juce_SortedSet.h *********/ +#ifndef __JUCE_SORTEDSET_JUCEHEADER__ +#define __JUCE_SORTEDSET_JUCEHEADER__ + +#if JUCE_MSVC + #pragma warning (push) + #pragma warning (disable: 4512) +#endif /** - Holds a list of objects derived from ReferenceCountedObject. + Holds a set of unique primitive objects, such as ints or doubles. - A ReferenceCountedArray holds objects derived from ReferenceCountedObject, - and takes care of incrementing and decrementing their ref counts when they - are added and removed from the array. + A set can only hold one item with a given value, so if for example it's a + set of integers, attempting to add the same integer twice will do nothing + the second time. - To make all the array's methods thread-safe, pass in "CriticalSection" as the templated + Internally, the list of items is kept sorted (which means that whatever + kind of primitive type is used must support the ==, <, >, <= and >= operators + to determine the order), and searching the set for known values is very fast + because it uses a binary-chop method. + + Note that if you're using a class or struct as the element type, it must be + capable of being copied or moved with a straightforward memcpy, rather than + needing construction and destruction code. + + To make all the set's methods thread-safe, pass in "CriticalSection" as the templated TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. - @see Array, OwnedArray, StringArray + @see Array, OwnedArray, ReferenceCountedArray, StringArray, CriticalSection */ -template -class ReferenceCountedArray : private ArrayAllocationBase +template +class SortedSet : private ArrayAllocationBase { public: - /** Creates an empty array. + /** Creates an empty set. @param granularity this is the size of increment by which the internal storage used by the array will grow. Only change it from the default if you know the array is going to be very big and needs to be able to grow efficiently. - @see ReferenceCountedObject, ArrayAllocationBase, Array, OwnedArray + @see ArrayAllocationBase */ - ReferenceCountedArray (const int granularity = juceDefaultArrayGranularity) throw() - : ArrayAllocationBase (granularity), - numUsed (0) + SortedSet (const int granularity = juceDefaultArrayGranularity) throw() + : ArrayAllocationBase (granularity), + numUsed (0) { } - /** Creates a copy of another array */ - ReferenceCountedArray (const ReferenceCountedArray& other) throw() - : ArrayAllocationBase (other.granularity), - numUsed (other.numUsed) + /** Creates a copy of another set. + @param other the set to copy + */ + SortedSet (const SortedSet& other) throw() + : ArrayAllocationBase (other.granularity) { - other.lockArray(); - this->setAllocatedSize (numUsed); - memcpy (this->elements, other.elements, numUsed * sizeof (ObjectClass*)); - - for (int i = numUsed; --i >= 0;) - if (this->elements[i] != 0) - this->elements[i]->incReferenceCount(); - - other.unlockArray(); + other.lockSet(); + numUsed = other.numUsed; + setAllocatedSize (other.numUsed); + memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); + other.unlockSet(); } - /** Copies another array into this one. + /** Destructor. */ + ~SortedSet() throw() + { + } - Any existing objects in this array will first be released. + /** Copies another set over this one. + @param other the set to copy */ - const ReferenceCountedArray& operator= (const ReferenceCountedArray& other) throw() + const SortedSet & operator= (const SortedSet & other) throw() { if (this != &other) { - other.lockArray(); + other.lockSet(); lock.enter(); - clear(); - this->granularity = other.granularity; - this->ensureAllocatedSize (other.numUsed); + ensureAllocatedSize (other.size()); numUsed = other.numUsed; - memcpy (this->elements, other.elements, numUsed * sizeof (ObjectClass*)); + memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); minimiseStorageOverheads(); - for (int i = numUsed; --i >= 0;) - if (this->elements[i] != 0) - this->elements[i]->incReferenceCount(); - lock.exit(); - other.unlockArray(); + other.unlockSet(); } return *this; } - /** Destructor. - - Any objects in the array will be released, and may be deleted if not referenced from elsewhere. - */ - ~ReferenceCountedArray() - { - clear(); - } + /** Compares this set to another one. - /** Removes all objects from the array. + Two sets are considered equal if they both contain the same set of + elements. - Any objects in the array that are not referenced from elsewhere will be deleted. + @param other the other set to compare with */ - void clear() + bool operator== (const SortedSet& other) const throw() { lock.enter(); - while (numUsed > 0) - if (this->elements [--numUsed] != 0) - this->elements [numUsed]->decReferenceCount(); + if (numUsed != other.numUsed) + { + lock.exit(); + return false; + } - jassert (numUsed == 0); - this->setAllocatedSize (0); + for (int i = numUsed; --i >= 0;) + { + if (this->elements [i] != other.elements [i]) + { + lock.exit(); + return false; + } + } lock.exit(); + return true; } - /** Returns the current number of objects in the array. */ - inline int size() const throw() + /** Compares this set to another one. + + Two sets are considered equal if they both contain the same set of + elements. + + @param other the other set to compare with + */ + bool operator!= (const SortedSet& other) const throw() { - return numUsed; + return ! operator== (other); } - /** Returns a pointer to the object at this index in the array. + /** Removes all elements from the set. - If the index is out-of-range, this will return a null pointer, (and - it could be null anyway, because it's ok for the array to hold null - pointers as well as objects). + This will remove all the elements, and free any storage that the set is + using. To clear it without freeing the storage, use the clearQuick() + method instead. - @see getUnchecked + @see clearQuick */ - inline ObjectClass* operator[] (const int index) const throw() + void clear() throw() { lock.enter(); - ObjectClass* const result = (((unsigned int) index) < (unsigned int) numUsed) - ? this->elements [index] - : (ObjectClass*) 0; + this->setAllocatedSize (0); + numUsed = 0; lock.exit(); - return result; } - /** Returns a pointer to the object at this index in the array, without checking whether the index is in-range. + /** Removes all elements from the set without freeing the array's allocated storage. - This is a faster and less safe version of operator[] which doesn't check the index passed in, so - it can be used when you're sure the index if always going to be legal. + @see clear */ - inline ObjectClass* getUnchecked (const int index) const throw() + void clearQuick() throw() { lock.enter(); - jassert (((unsigned int) index) < (unsigned int) numUsed); - ObjectClass* const result = this->elements [index]; + numUsed = 0; lock.exit(); - return result; } - /** Returns a pointer to the first object in the array. - - This will return a null pointer if the array's empty. - @see getLast + /** Returns the current number of elements in the set. */ - inline ObjectClass* getFirst() const throw() + inline int size() const throw() { - lock.enter(); - ObjectClass* const result = (numUsed > 0) ? this->elements [0] - : (ObjectClass*) 0; - lock.exit(); - - return result; + return numUsed; } - /** Returns a pointer to the last object in the array. + /** Returns one of the elements in the set. - This will return a null pointer if the array's empty. - @see getFirst + If the index passed in is beyond the range of valid elements, this + will return zero. + + If you're certain that the index will always be a valid element, you + can call getUnchecked() instead, which is faster. + + @param index the index of the element being requested (0 is the first element in the set) + @see getUnchecked, getFirst, getLast */ - inline ObjectClass* getLast() const throw() + inline ElementType operator[] (const int index) const throw() { lock.enter(); - ObjectClass* const result = (numUsed > 0) ? this->elements [numUsed - 1] - : (ObjectClass*) 0; + const ElementType result = (((unsigned int) index) < (unsigned int) numUsed) + ? this->elements [index] + : (ElementType) 0; lock.exit(); return result; } - /** Finds the index of the first occurrence of an object in the array. + /** Returns one of the elements in the set, without checking the index passed in. + Unlike the operator[] method, this will try to return an element without + checking that the index is within the bounds of the set, so should only + be used when you're confident that it will always be a valid index. - @param objectToLookFor the object to look for - @returns the index at which the object was found, or -1 if it's not found + @param index the index of the element being requested (0 is the first element in the set) + @see operator[], getFirst, getLast */ - int indexOf (const ObjectClass* const objectToLookFor) const throw() + inline ElementType getUnchecked (const int index) const throw() { - int result = -1; - lock.enter(); - ObjectClass** e = this->elements; - - for (int i = numUsed; --i >= 0;) - { - if (objectToLookFor == *e) - { - result = (int) (e - this->elements); - break; - } - - ++e; - } - + jassert (((unsigned int) index) < (unsigned int) numUsed); + const ElementType result = this->elements [index]; lock.exit(); + return result; } - /** Returns true if the array contains a specified object. + /** Returns the first element in the set, or 0 if the set is empty. - @param objectToLookFor the object to look for - @returns true if the object is in the array + @see operator[], getUnchecked, getLast */ - bool contains (const ObjectClass* const objectToLookFor) const throw() + inline ElementType getFirst() const throw() { lock.enter(); - ObjectClass** e = this->elements; - - for (int i = numUsed; --i >= 0;) - { - if (objectToLookFor == *e) - { - lock.exit(); - return true; - } - - ++e; - } - + const ElementType result = (numUsed > 0) ? this->elements [0] + : (ElementType) 0; lock.exit(); - return false; - } - /** Appends a new object to the end of the array. + return result; + } - This will increase the new object's reference count. + /** Returns the last element in the set, or 0 if the set is empty. - @param newObject the new object to add to the array - @see set, insert, addIfNotAlreadyThere, addSorted, addArray + @see operator[], getUnchecked, getFirst */ - void add (ObjectClass* const newObject) throw() + inline ElementType getLast() const throw() { lock.enter(); - this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = newObject; - - if (newObject != 0) - newObject->incReferenceCount(); - + const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1] + : (ElementType) 0; lock.exit(); - } - - /** Inserts a new object into the array at the given index. - - If the index is less than 0 or greater than the size of the array, the - element will be added to the end of the array. - Otherwise, it will be inserted into the array, moving all the later elements - along to make room. - - This will increase the new object's reference count. - - @param indexToInsertAt the index at which the new element should be inserted - @param newObject the new object to add to the array - @see add, addSorted, addIfNotAlreadyThere, set - */ - void insert (int indexToInsertAt, - ObjectClass* const newObject) throw() - { - if (indexToInsertAt >= 0) - { - lock.enter(); - - if (indexToInsertAt > numUsed) - indexToInsertAt = numUsed; - - this->ensureAllocatedSize (numUsed + 1); - - ObjectClass** const e = this->elements + indexToInsertAt; - const int numToMove = numUsed - indexToInsertAt; - - if (numToMove > 0) - memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); - - *e = newObject; - - if (newObject != 0) - newObject->incReferenceCount(); - ++numUsed; - lock.exit(); - } - else - { - add (newObject); - } + return result; } - /** Appends a new object at the end of the array as long as the array doesn't - already contain it. + /** Finds the index of the first element which matches the value passed in. - If the array already contains a matching object, nothing will be done. + This will search the set for the given object, and return the index + of its first occurrence. If the object isn't found, the method will return -1. - @param newObject the new object to add to the array + @param elementToLookFor the value or object to look for + @returns the index of the object, or -1 if it's not found */ - void addIfNotAlreadyThere (ObjectClass* const newObject) throw() + int indexOf (const ElementType elementToLookFor) const throw() { lock.enter(); - if (! contains (newObject)) - add (newObject); - - lock.exit(); - } - - /** Replaces an object in the array with a different one. - - If the index is less than zero, this method does nothing. - If the index is beyond the end of the array, the new object is added to the end of the array. - - The object being added has its reference count increased, and if it's replacing - another object, then that one has its reference count decreased, and may be deleted. + int start = 0; + int end = numUsed; - @param indexToChange the index whose value you want to change - @param newObject the new value to set for this index. - @see add, insert, remove - */ - void set (const int indexToChange, - ObjectClass* const newObject) - { - if (indexToChange >= 0) + for (;;) { - lock.enter(); - - if (newObject != 0) - newObject->incReferenceCount(); - - if (indexToChange < numUsed) + if (start >= end) { - if (this->elements [indexToChange] != 0) - this->elements [indexToChange]->decReferenceCount(); - - this->elements [indexToChange] = newObject; + lock.exit(); + return -1; } - else + else if (elementToLookFor == this->elements [start]) { - this->ensureAllocatedSize (numUsed + 1); - this->elements [numUsed++] = newObject; + lock.exit(); + return start; } + else + { + const int halfway = (start + end) >> 1; - lock.exit(); - } - } - - /** Adds elements from another array to the end of this array. - - @param arrayToAddFrom the array from which to copy the elements - @param startIndex the first element of the other array to start copying from - @param numElementsToAdd how many elements to add from the other array. If this - value is negative or greater than the number of available elements, - all available elements will be copied. - @see add - */ - void addArray (const ReferenceCountedArray& arrayToAddFrom, - int startIndex = 0, - int numElementsToAdd = -1) throw() - { - arrayToAddFrom.lockArray(); - lock.enter(); - - if (startIndex < 0) - { - jassertfalse - startIndex = 0; - } - - if (numElementsToAdd < 0 || startIndex + numElementsToAdd > arrayToAddFrom.size()) - numElementsToAdd = arrayToAddFrom.size() - startIndex; - - if (numElementsToAdd > 0) - { - this->ensureAllocatedSize (numUsed + numElementsToAdd); - - while (--numElementsToAdd >= 0) - add (arrayToAddFrom.getUnchecked (startIndex++)); - } - - lock.exit(); - arrayToAddFrom.unlockArray(); - } - - /** Inserts a new object into the array assuming that the array is sorted. - - This will use a comparator to find the position at which the new object - should go. If the array isn't sorted, the behaviour of this - method will be unpredictable. - - @param comparator the comparator object to use to compare the elements - see the - sort() method for details about this object's form - @param newObject the new object to insert to the array - @see add, sort - */ - template - void addSorted (ElementComparator& comparator, - ObjectClass* newObject) throw() - { - lock.enter(); - insert (findInsertIndexInSortedArray (comparator, this->elements, newObject, 0, numUsed), newObject); - lock.exit(); - } - - /** Removes an object from the array. - - This will remove the object at a given index and move back all the - subsequent objects to close the gap. - - If the index passed in is out-of-range, nothing will happen. - - The object that is removed will have its reference count decreased, - and may be deleted if not referenced from elsewhere. - - @param indexToRemove the index of the element to remove - @see removeObject, removeRange - */ - void remove (const int indexToRemove) - { - lock.enter(); - - if (((unsigned int) indexToRemove) < (unsigned int) numUsed) - { - ObjectClass** const e = this->elements + indexToRemove; - - if (*e != 0) - (*e)->decReferenceCount(); - - --numUsed; - const int numberToShift = numUsed - indexToRemove; - - if (numberToShift > 0) - memmove (e, e + 1, numberToShift * sizeof (ObjectClass*)); - - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); + if (halfway == start) + { + lock.exit(); + return -1; + } + else if (elementToLookFor >= this->elements [halfway]) + start = halfway; + else + end = halfway; + } } - - lock.exit(); - } - - /** Removes the first occurrence of a specified object from the array. - - If the item isn't found, no action is taken. If it is found, it is - removed and has its reference count decreased. - - @param objectToRemove the object to try to remove - @see remove, removeRange - */ - void removeObject (ObjectClass* const objectToRemove) - { - lock.enter(); - remove (indexOf (objectToRemove)); - lock.exit(); } - /** Removes a range of objects from the array. - - This will remove a set of objects, starting from the given index, - and move any subsequent elements down to close the gap. - - If the range extends beyond the bounds of the array, it will - be safely clipped to the size of the array. - - The objects that are removed will have their reference counts decreased, - and may be deleted if not referenced from elsewhere. + /** Returns true if the set contains at least one occurrence of an object. - @param startIndex the index of the first object to remove - @param numberToRemove how many objects should be removed - @see remove, removeObject + @param elementToLookFor the value or object to look for + @returns true if the item is found */ - void removeRange (const int startIndex, - const int numberToRemove) + bool contains (const ElementType elementToLookFor) const throw() { lock.enter(); - const int start = jlimit (0, numUsed, startIndex); - const int end = jlimit (0, numUsed, startIndex + numberToRemove); + int start = 0; + int end = numUsed; - if (end > start) + for (;;) { - int i; - for (i = start; i < end; ++i) + if (start >= end) { - if (this->elements[i] != 0) + lock.exit(); + return false; + } + else if (elementToLookFor == this->elements [start]) + { + lock.exit(); + return true; + } + else + { + const int halfway = (start + end) >> 1; + + if (halfway == start) { - this->elements[i]->decReferenceCount(); - this->elements[i] = 0; // (in case one of the destructors accesses this array and hits a dangling pointer) + lock.exit(); + return false; } + else if (elementToLookFor >= this->elements [halfway]) + start = halfway; + else + end = halfway; } + } + } - const int rangeSize = end - start; - ObjectClass** e = this->elements + start; - i = numUsed - end; - numUsed -= rangeSize; + /** Adds a new element to the set, (as long as it's not already in there). - while (--i >= 0) + @param newElement the new object to add to the set + @see set, insert, addIfNotAlreadyThere, addSorted, addSet, addArray + */ + void add (const ElementType newElement) throw() + { + lock.enter(); + + int start = 0; + int end = numUsed; + + for (;;) + { + if (start >= end) { - *e = e [rangeSize]; - ++e; + jassert (start <= end); + insertInternal (start, newElement); + break; + } + else if (newElement == this->elements [start]) + { + break; } + else + { + const int halfway = (start + end) >> 1; - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); + if (halfway == start) + { + if (newElement >= this->elements [halfway]) + insertInternal (start + 1, newElement); + else + insertInternal (start, newElement); + + break; + } + else if (newElement >= this->elements [halfway]) + start = halfway; + else + end = halfway; + } } lock.exit(); } - /** Removes the last n objects from the array. - - The objects that are removed will have their reference counts decreased, - and may be deleted if not referenced from elsewhere. + /** Adds elements from an array to this set. - @param howManyToRemove how many objects to remove from the end of the array - @see remove, removeObject, removeRange + @param elementsToAdd the array of elements to add + @param numElementsToAdd how many elements are in this other array + @see add */ - void removeLast (int howManyToRemove = 1) + void addArray (const ElementType* elementsToAdd, + int numElementsToAdd) throw() { lock.enter(); - if (howManyToRemove > numUsed) - howManyToRemove = numUsed; - - while (--howManyToRemove >= 0) - remove (numUsed - 1); + while (--numElementsToAdd >= 0) + add (*elementsToAdd++); lock.exit(); } - /** Swaps a pair of objects in the array. + /** Adds elements from another set to this one. - If either of the indexes passed in is out-of-range, nothing will happen, - otherwise the two objects at these positions will be exchanged. + @param setToAddFrom the set from which to copy the elements + @param startIndex the first element of the other set to start copying from + @param numElementsToAdd how many elements to add from the other set. If this + value is negative or greater than the number of available elements, + all available elements will be copied. + @see add */ - void swap (const int index1, - const int index2) throw() + template + void addSet (const OtherSetType& setToAddFrom, + int startIndex = 0, + int numElementsToAdd = -1) throw() { + setToAddFrom.lockSet(); lock.enter(); + jassert (this != &setToAddFrom); - if (((unsigned int) index1) < (unsigned int) numUsed - && ((unsigned int) index2) < (unsigned int) numUsed) + if (this != &setToAddFrom) { - swapVariables (this->elements [index1], - this->elements [index2]); + if (startIndex < 0) + { + jassertfalse + startIndex = 0; + } + + if (numElementsToAdd < 0 || startIndex + numElementsToAdd > setToAddFrom.size()) + numElementsToAdd = setToAddFrom.size() - startIndex; + + addArray (setToAddFrom.elements + startIndex, numElementsToAdd); } lock.exit(); + setToAddFrom.unlockSet(); } - /** Moves one of the objects to a different position. - - This will move the object to a specified index, shuffling along - any intervening elements as required. + /** Removes an element from the set. - So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling - move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. + This will remove the element at a given index. + If the index passed in is out-of-range, nothing will happen. - @param currentIndex the index of the object to be moved. If this isn't a - valid index, then nothing will be done - @param newIndex the index at which you'd like this object to end up. If this - is less than zero, it will be moved to the end of the array + @param indexToRemove the index of the element to remove + @returns the element that has been removed + @see removeValue, removeRange */ - void move (const int currentIndex, - int newIndex) throw() + ElementType remove (const int indexToRemove) throw() { - if (currentIndex != newIndex) - { - lock.enter(); + lock.enter(); - if (((unsigned int) currentIndex) < (unsigned int) numUsed) - { - if (((unsigned int) newIndex) >= (unsigned int) numUsed) - newIndex = numUsed - 1; + if (((unsigned int) indexToRemove) < (unsigned int) numUsed) + { + --numUsed; - ObjectClass* const value = this->elements [currentIndex]; + ElementType* const e = this->elements + indexToRemove; + ElementType const removed = *e; + const int numberToShift = numUsed - indexToRemove; - if (newIndex > currentIndex) - { - memmove (this->elements + currentIndex, - this->elements + currentIndex + 1, - (newIndex - currentIndex) * sizeof (ObjectClass*)); - } - else - { - memmove (this->elements + newIndex + 1, - this->elements + newIndex, - (currentIndex - newIndex) * sizeof (ObjectClass*)); - } + if (numberToShift > 0) + memmove (e, e + 1, numberToShift * sizeof (ElementType)); - this->elements [newIndex] = value; - } + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); lock.exit(); + return removed; + } + else + { + lock.exit(); + return 0; } } - /** Compares this array to another one. + /** Removes an item from the set. - @returns true only if the other array contains the same objects in the same order + This will remove the given element from the set, if it's there. + + @param valueToRemove the object to try to remove + @see remove, removeRange */ - bool operator== (const ReferenceCountedArray& other) const throw() + void removeValue (const ElementType valueToRemove) throw() { - other.lockArray(); lock.enter(); + remove (indexOf (valueToRemove)); + lock.exit(); + } - bool result = numUsed == other.numUsed; + /** Removes any elements which are also in another set. - if (result) + @param otherSet the other set in which to look for elements to remove + @see removeValuesNotIn, remove, removeValue, removeRange + */ + template + void removeValuesIn (const OtherSetType& otherSet) throw() + { + otherSet.lockSet(); + lock.enter(); + + if (this == &otherSet) { - for (int i = numUsed; --i >= 0;) + clear(); + } + else + { + if (otherSet.size() > 0) { - if (this->elements [i] != other.elements [i]) - { - result = false; - break; - } + for (int i = numUsed; --i >= 0;) + if (otherSet.contains (this->elements [i])) + remove (i); } } lock.exit(); - other.unlockArray(); - - return result; - } - - /** Compares this array to another one. - - @see operator== - */ - bool operator!= (const ReferenceCountedArray& other) const throw() - { - return ! operator== (other); + otherSet.unlockSet(); } - /** Sorts the elements in the array. - - This will use a comparator object to sort the elements into order. The object - passed must have a method of the form: - @code - int compareElements (ElementType first, ElementType second); - @endcode - - ..and this method must return: - - a value of < 0 if the first comes before the second - - a value of 0 if the two objects are equivalent - - a value of > 0 if the second comes before the first - - To improve performance, the compareElements() method can be declared as static or const. + /** Removes any elements which are not found in another set. - @param comparator the comparator to use for comparing elements. - @param retainOrderOfEquivalentItems if this is true, then items - which the comparator says are equivalent will be - kept in the order in which they currently appear - in the array. This is slower to perform, but may - be important in some cases. If it's false, a faster - algorithm is used, but equivalent elements may be - rearranged. + Only elements which occur in this other set will be retained. - @see sortArray + @param otherSet the set in which to look for elements NOT to remove + @see removeValuesIn, remove, removeValue, removeRange */ - template - void sort (ElementComparator& comparator, - const bool retainOrderOfEquivalentItems = false) const throw() + template + void removeValuesNotIn (const OtherSetType& otherSet) throw() { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused - + otherSet.lockSet(); lock.enter(); - sortArray (comparator, this->elements, 0, size() - 1, retainOrderOfEquivalentItems); + + if (this != &otherSet) + { + if (otherSet.size() <= 0) + { + clear(); + } + else + { + for (int i = numUsed; --i >= 0;) + if (! otherSet.contains (this->elements [i])) + remove (i); + } + } + lock.exit(); + otherSet.lockSet(); } - /** Reduces the amount of storage being used by the array. + /** Reduces the amount of storage being used by the set. - Arrays typically allocate slightly more storage than they need, and after + Sets typically allocate slightly more storage than they need, and after removing elements, they may have quite a lot of unused space allocated. This method will reduce the amount of allocated storage to a minimum. */ @@ -10255,26 +10177,26 @@ public: lock.exit(); } - /** Locks the array's CriticalSection. + /** Locks the set's CriticalSection. Of course if the type of section used is a DummyCriticalSection, this won't have any effect. - @see unlockArray + @see unlockSet */ - void lockArray() const throw() + void lockSet() const throw() { lock.enter(); } - /** Unlocks the array's CriticalSection. + /** Unlocks the set's CriticalSection. Of course if the type of section used is a DummyCriticalSection, this won't have any effect. - @see lockArray + @see lockSet */ - void unlockArray() const throw() + void unlockSet() const throw() { lock.exit(); } @@ -10284,1047 +10206,1081 @@ public: private: int numUsed; TypeOfCriticalSectionToUse lock; -}; -#endif // __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ -/********* End of inlined file: juce_ReferenceCountedArray.h *********/ + void insertInternal (const int indexToInsertAt, const ElementType newElement) throw() + { + this->ensureAllocatedSize (numUsed + 1); -#endif -#ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ + ElementType* const insertPos = this->elements + indexToInsertAt; + const int numberToMove = numUsed - indexToInsertAt; -#endif -#ifndef __JUCE_SORTEDSET_JUCEHEADER__ + if (numberToMove > 0) + memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); -/********* Start of inlined file: juce_SortedSet.h *********/ -#ifndef __JUCE_SORTEDSET_JUCEHEADER__ -#define __JUCE_SORTEDSET_JUCEHEADER__ + *insertPos = newElement; + ++numUsed; + } +}; #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4512) + #pragma warning (pop) #endif -/** - Holds a set of unique primitive objects, such as ints or doubles. +#endif // __JUCE_SORTEDSET_JUCEHEADER__ +/********* End of inlined file: juce_SortedSet.h *********/ - A set can only hold one item with a given value, so if for example it's a - set of integers, attempting to add the same integer twice will do nothing - the second time. +#endif +#ifndef __JUCE_BITARRAY_JUCEHEADER__ - Internally, the list of items is kept sorted (which means that whatever - kind of primitive type is used must support the ==, <, >, <= and >= operators - to determine the order), and searching the set for known values is very fast - because it uses a binary-chop method. +/********* Start of inlined file: juce_BitArray.h *********/ +#ifndef __JUCE_BITARRAY_JUCEHEADER__ +#define __JUCE_BITARRAY_JUCEHEADER__ - Note that if you're using a class or struct as the element type, it must be - capable of being copied or moved with a straightforward memcpy, rather than - needing construction and destruction code. +class MemoryBlock; - To make all the set's methods thread-safe, pass in "CriticalSection" as the templated - TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. +/** + An array of on/off bits, also usable to store large binary integers. - @see Array, OwnedArray, ReferenceCountedArray, StringArray, CriticalSection + A BitArray acts like an arbitrarily large integer whose bits can be set or + cleared, and some basic mathematical operations can be done on the number as + a whole. */ -template -class SortedSet : private ArrayAllocationBase +class JUCE_API BitArray { public: - /** Creates an empty set. + /** Creates an empty BitArray */ + BitArray() throw(); + + /** Creates a BitArray containing an integer value in its low bits. + + The low 32 bits of the array are initialised with this value. + */ + BitArray (const unsigned int value) throw(); + + /** Creates a BitArray containing an integer value in its low bits. + + The low 32 bits of the array are initialised with the absolute value + passed in, and its sign is set to reflect the sign of the number. + */ + BitArray (const int value) throw(); + + /** Creates a BitArray containing an integer value in its low bits. + + The low 64 bits of the array are initialised with the absolute value + passed in, and its sign is set to reflect the sign of the number. + */ + BitArray (int64 value) throw(); + + /** Creates a copy of another BitArray. */ + BitArray (const BitArray& other) throw(); + + /** Destructor. */ + ~BitArray() throw(); + + /** Copies another BitArray onto this one. */ + const BitArray& operator= (const BitArray& other) throw(); + + /** Two arrays are the same if the same bits are set. */ + bool operator== (const BitArray& other) const throw(); + /** Two arrays are the same if the same bits are set. */ + bool operator!= (const BitArray& other) const throw(); + + /** Clears all bits in the BitArray to 0. */ + void clear() throw(); + + /** Clears a particular bit in the array. */ + void clearBit (const int bitNumber) throw(); + + /** Sets a specified bit to 1. + + If the bit number is high, this will grow the array to accomodate it. + */ + void setBit (const int bitNumber) throw(); + + /** Sets or clears a specified bit. */ + void setBit (const int bitNumber, + const bool shouldBeSet) throw(); + + /** Sets a range of bits to be either on or off. + + @param startBit the first bit to change + @param numBits the number of bits to change + @param shouldBeSet whether to turn these bits on or off + */ + void setRange (int startBit, + int numBits, + const bool shouldBeSet) throw(); + + /** Inserts a bit an a given position, shifting up any bits above it. */ + void insertBit (const int bitNumber, + const bool shouldBeSet) throw(); + + /** Returns the value of a specified bit in the array. + + If the index is out-of-range, the result will be false. + */ + bool operator[] (const int bit) const throw(); + + /** Returns true if no bits are set. */ + bool isEmpty() const throw(); + + /** Returns a range of bits in the array as an integer value. + + e.g. getBitRangeAsInt (0, 32) would return the lowest 32 bits. + + Asking for more than 32 bits isn't allowed (obviously). + */ + int getBitRangeAsInt (int startBit, int numBits) const throw(); + + /** Sets a range of bits in the array based on an integer value. + + Copies the given integer into the array, starting at startBit, + and only using up to numBits of the available bits. + */ + void setBitRangeAsInt (int startBit, int numBits, + unsigned int valueToSet) throw(); + + /** Performs a bitwise OR with another BitArray. + + The result ends up in this array. + */ + void orWith (const BitArray& other) throw(); + + /** Performs a bitwise AND with another BitArray. + + The result ends up in this array. + */ + void andWith (const BitArray& other) throw(); + + /** Performs a bitwise XOR with another BitArray. + + The result ends up in this array. + */ + void xorWith (const BitArray& other) throw(); + + /** Adds another BitArray's value to this one. + + Treating the two arrays as large positive integers, this + adds them up and puts the result in this array. + */ + void add (const BitArray& other) throw(); + + /** Subtracts another BitArray's value from this one. + + Treating the two arrays as large positive integers, this + subtracts them and puts the result in this array. + + Note that if the result should be negative, this won't be + handled correctly. + */ + void subtract (const BitArray& other) throw(); + + /** Multiplies another BitArray's value with this one. + + Treating the two arrays as large positive integers, this + multiplies them and puts the result in this array. + */ + void multiplyBy (const BitArray& other) throw(); + + /** Divides another BitArray's value into this one and also produces a remainder. + + Treating the two arrays as large positive integers, this + divides this value by the other, leaving the quotient in this + array, and the remainder is copied into the other BitArray passed in. + */ + void divideBy (const BitArray& divisor, BitArray& remainder) throw(); - @param granularity this is the size of increment by which the internal storage - used by the array will grow. Only change it from the default if you know the - array is going to be very big and needs to be able to grow efficiently. + /** Returns the largest value that will divide both this value and the one + passed-in. + */ + const BitArray findGreatestCommonDivisor (BitArray other) const throw(); - @see ArrayAllocationBase + /** Performs a modulo operation on this value. + + The result is stored in this value. */ - SortedSet (const int granularity = juceDefaultArrayGranularity) throw() - : ArrayAllocationBase (granularity), - numUsed (0) - { - } + void modulo (const BitArray& divisor) throw(); - /** Creates a copy of another set. - @param other the set to copy + /** Performs a combined exponent and modulo operation. + + This BitArray's value becomes (this ^ exponent) % modulus. */ - SortedSet (const SortedSet& other) throw() - : ArrayAllocationBase (other.granularity) - { - other.lockSet(); - numUsed = other.numUsed; - setAllocatedSize (other.numUsed); - memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); - other.unlockSet(); - } + void exponentModulo (const BitArray& exponent, const BitArray& modulus) throw(); - /** Destructor. */ - ~SortedSet() throw() - { - } + /** Performs an inverse modulo on the value. - /** Copies another set over this one. - @param other the set to copy + i.e. the result is (this ^ -1) mod (modulus). */ - const SortedSet & operator= (const SortedSet & other) throw() - { - if (this != &other) - { - other.lockSet(); - lock.enter(); + void inverseModulo (const BitArray& modulus) throw(); - this->granularity = other.granularity; - ensureAllocatedSize (other.size()); - numUsed = other.numUsed; - memcpy (this->elements, other.elements, numUsed * sizeof (ElementType)); - minimiseStorageOverheads(); + /** Shifts a section of bits left or right. - lock.exit(); - other.unlockSet(); - } + @param howManyBitsLeft how far to move the bits (+ve numbers shift it left, -ve numbers shift it right). + @param startBit the first bit to affect - if this is > 0, only bits above that index will be affected. + */ + void shiftBits (int howManyBitsLeft, + int startBit = 0) throw(); - return *this; - } + /** Does a signed comparison of two BitArrays. - /** Compares this set to another one. + Return values are: + - 0 if the numbers are the same + - < 0 if this number is smaller than the other + - > 0 if this number is bigger than the other + */ + int compare (const BitArray& other) const throw(); - Two sets are considered equal if they both contain the same set of - elements. + /** Compares the magnitudes of two BitArrays, ignoring their signs. - @param other the other set to compare with + Return values are: + - 0 if the numbers are the same + - < 0 if this number is smaller than the other + - > 0 if this number is bigger than the other */ - bool operator== (const SortedSet& other) const throw() - { - lock.enter(); + int compareAbsolute (const BitArray& other) const throw(); - if (numUsed != other.numUsed) - { - lock.exit(); - return false; - } + /** Returns true if the value is less than zero. - for (int i = numUsed; --i >= 0;) - { - if (this->elements [i] != other.elements [i]) - { - lock.exit(); - return false; - } - } + @see setNegative, negate + */ + bool isNegative() const throw(); - lock.exit(); - return true; - } + /** Changes the sign of the number to be positive or negative. - /** Compares this set to another one. + @see isNegative, negate + */ + void setNegative (const bool shouldBeNegative) throw(); - Two sets are considered equal if they both contain the same set of - elements. + /** Inverts the sign of the number. - @param other the other set to compare with + @see isNegative, setNegative */ - bool operator!= (const SortedSet& other) const throw() - { - return ! operator== (other); - } + void negate() throw(); - /** Removes all elements from the set. + /** Counts the total number of set bits in the array. */ + int countNumberOfSetBits() const throw(); - This will remove all the elements, and free any storage that the set is - using. To clear it without freeing the storage, use the clearQuick() - method instead. + /** Looks for the index of the next set bit after a given starting point. - @see clearQuick + searches from startIndex (inclusive) upwards for the first set bit, + and returns its index. + + If no set bits are found, it returns -1. */ - void clear() throw() - { - lock.enter(); - this->setAllocatedSize (0); - numUsed = 0; - lock.exit(); - } + int findNextSetBit (int startIndex = 0) const throw(); - /** Removes all elements from the set without freeing the array's allocated storage. + /** Looks for the index of the next clear bit after a given starting point. - @see clear + searches from startIndex (inclusive) upwards for the first clear bit, + and returns its index. */ - void clearQuick() throw() - { - lock.enter(); - numUsed = 0; - lock.exit(); - } + int findNextClearBit (int startIndex = 0) const throw(); - /** Returns the current number of elements in the set. + /** Returns the index of the highest set bit in the array. + + If the array is empty, this will return -1. */ - inline int size() const throw() - { - return numUsed; - } + int getHighestBit() const throw(); - /** Returns one of the elements in the set. + /** Sets a range of bits to random values. */ + void fillBitsRandomly (int startBit, int numBits) throw(); - If the index passed in is beyond the range of valid elements, this - will return zero. + /** Turns this value into a random number less than the given value. */ + void createRandomNumber (const BitArray& maximumValue) throw(); - If you're certain that the index will always be a valid element, you - can call getUnchecked() instead, which is faster. + /** Converts the array to a number string. - @param index the index of the element being requested (0 is the first element in the set) - @see getUnchecked, getFirst, getLast + Specify a base such as 2 (binary), 8 (octal), 10 (decimal), 16 (hex). */ - inline ElementType operator[] (const int index) const throw() - { - lock.enter(); - const ElementType result = (((unsigned int) index) < (unsigned int) numUsed) - ? this->elements [index] - : (ElementType) 0; - lock.exit(); + const String toString (const int base) const throw(); - return result; - } + /** Converts a number string to an array. - /** Returns one of the elements in the set, without checking the index passed in. - Unlike the operator[] method, this will try to return an element without - checking that the index is within the bounds of the set, so should only - be used when you're confident that it will always be a valid index. + Any non-valid characters will be ignored. - @param index the index of the element being requested (0 is the first element in the set) - @see operator[], getFirst, getLast + Specify a base such as 2 (binary), 8 (octal), 10 (decimal), 16 (hex). */ - inline ElementType getUnchecked (const int index) const throw() - { - lock.enter(); - jassert (((unsigned int) index) < (unsigned int) numUsed); - const ElementType result = this->elements [index]; - lock.exit(); + void parseString (const String& text, + const int base) throw(); - return result; - } + /** Turns the array into a block of binary data. - /** Returns the first element in the set, or 0 if the set is empty. + The data is arranged as little-endian, so the first byte of data is the low 8 bits + of the array, and so on. - @see operator[], getUnchecked, getLast + @see loadFromMemoryBlock */ - inline ElementType getFirst() const throw() - { - lock.enter(); - const ElementType result = (numUsed > 0) ? this->elements [0] - : (ElementType) 0; - lock.exit(); + const MemoryBlock toMemoryBlock() const throw(); - return result; - } + /** Copies a block of raw data onto this array. - /** Returns the last element in the set, or 0 if the set is empty. + The data is arranged as little-endian, so the first byte of data is the low 8 bits + of the array, and so on. - @see operator[], getUnchecked, getFirst + @see toMemoryBlock */ - inline ElementType getLast() const throw() - { - lock.enter(); - const ElementType result = (numUsed > 0) ? this->elements [numUsed - 1] - : (ElementType) 0; - lock.exit(); + void loadFromMemoryBlock (const MemoryBlock& data) throw(); - return result; - } + juce_UseDebuggingNewOperator - /** Finds the index of the first element which matches the value passed in. +private: + void ensureSize (const int numVals) throw(); + unsigned int* values; + int numValues, highestBit; + bool negative; +}; - This will search the set for the given object, and return the index - of its first occurrence. If the object isn't found, the method will return -1. +#endif // __JUCE_BITARRAY_JUCEHEADER__ +/********* End of inlined file: juce_BitArray.h *********/ - @param elementToLookFor the value or object to look for - @returns the index of the object, or -1 if it's not found - */ - int indexOf (const ElementType elementToLookFor) const throw() - { - lock.enter(); +#endif +#ifndef __JUCE_ARRAY_JUCEHEADER__ - int start = 0; - int end = numUsed; +#endif +#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ - for (;;) - { - if (start >= end) - { - lock.exit(); - return -1; - } - else if (elementToLookFor == this->elements [start]) - { - lock.exit(); - return start; - } - else - { - const int halfway = (start + end) >> 1; +#endif +#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ - if (halfway == start) - { - lock.exit(); - return -1; - } - else if (elementToLookFor >= this->elements [halfway]) - start = halfway; - else - end = halfway; - } - } - } +/********* Start of inlined file: juce_ReferenceCountedArray.h *********/ +#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ +#define __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ - /** Returns true if the set contains at least one occurrence of an object. +/** + Holds a list of objects derived from ReferenceCountedObject. - @param elementToLookFor the value or object to look for - @returns true if the item is found + A ReferenceCountedArray holds objects derived from ReferenceCountedObject, + and takes care of incrementing and decrementing their ref counts when they + are added and removed from the array. + + To make all the array's methods thread-safe, pass in "CriticalSection" as the templated + TypeOfCriticalSectionToUse parameter, instead of the default DummyCriticalSection. + + @see Array, OwnedArray, StringArray +*/ +template +class ReferenceCountedArray : private ArrayAllocationBase +{ +public: + + /** Creates an empty array. + + @param granularity this is the size of increment by which the internal storage + used by the array will grow. Only change it from the default if you know the + array is going to be very big and needs to be able to grow efficiently. + + @see ReferenceCountedObject, ArrayAllocationBase, Array, OwnedArray */ - bool contains (const ElementType elementToLookFor) const throw() + ReferenceCountedArray (const int granularity = juceDefaultArrayGranularity) throw() + : ArrayAllocationBase (granularity), + numUsed (0) { - lock.enter(); + } - int start = 0; - int end = numUsed; + /** Creates a copy of another array */ + ReferenceCountedArray (const ReferenceCountedArray& other) throw() + : ArrayAllocationBase (other.granularity), + numUsed (other.numUsed) + { + other.lockArray(); + this->setAllocatedSize (numUsed); + memcpy (this->elements, other.elements, numUsed * sizeof (ObjectClass*)); - for (;;) - { - if (start >= end) - { - lock.exit(); - return false; - } - else if (elementToLookFor == this->elements [start]) - { - lock.exit(); - return true; - } - else - { - const int halfway = (start + end) >> 1; + for (int i = numUsed; --i >= 0;) + if (this->elements[i] != 0) + this->elements[i]->incReferenceCount(); - if (halfway == start) - { - lock.exit(); - return false; - } - else if (elementToLookFor >= this->elements [halfway]) - start = halfway; - else - end = halfway; - } - } + other.unlockArray(); } - /** Adds a new element to the set, (as long as it's not already in there). + /** Copies another array into this one. - @param newElement the new object to add to the set - @see set, insert, addIfNotAlreadyThere, addSorted, addSet, addArray + Any existing objects in this array will first be released. */ - void add (const ElementType newElement) throw() + const ReferenceCountedArray& operator= (const ReferenceCountedArray& other) throw() { - lock.enter(); + if (this != &other) + { + other.lockArray(); + lock.enter(); - int start = 0; - int end = numUsed; + clear(); - for (;;) - { - if (start >= end) - { - jassert (start <= end); - insertInternal (start, newElement); - break; - } - else if (newElement == this->elements [start]) - { - break; - } - else - { - const int halfway = (start + end) >> 1; + this->granularity = other.granularity; + this->ensureAllocatedSize (other.numUsed); + numUsed = other.numUsed; + memcpy (this->elements, other.elements, numUsed * sizeof (ObjectClass*)); + minimiseStorageOverheads(); - if (halfway == start) - { - if (newElement >= this->elements [halfway]) - insertInternal (start + 1, newElement); - else - insertInternal (start, newElement); + for (int i = numUsed; --i >= 0;) + if (this->elements[i] != 0) + this->elements[i]->incReferenceCount(); - break; - } - else if (newElement >= this->elements [halfway]) - start = halfway; - else - end = halfway; - } + lock.exit(); + other.unlockArray(); } - lock.exit(); + return *this; } - /** Adds elements from an array to this set. + /** Destructor. - @param elementsToAdd the array of elements to add - @param numElementsToAdd how many elements are in this other array - @see add + Any objects in the array will be released, and may be deleted if not referenced from elsewhere. */ - void addArray (const ElementType* elementsToAdd, - int numElementsToAdd) throw() + ~ReferenceCountedArray() { - lock.enter(); - - while (--numElementsToAdd >= 0) - add (*elementsToAdd++); - - lock.exit(); + clear(); } - /** Adds elements from another set to this one. + /** Removes all objects from the array. - @param setToAddFrom the set from which to copy the elements - @param startIndex the first element of the other set to start copying from - @param numElementsToAdd how many elements to add from the other set. If this - value is negative or greater than the number of available elements, - all available elements will be copied. - @see add + Any objects in the array that are not referenced from elsewhere will be deleted. */ - template - void addSet (const OtherSetType& setToAddFrom, - int startIndex = 0, - int numElementsToAdd = -1) throw() + void clear() { - setToAddFrom.lockSet(); lock.enter(); - jassert (this != &setToAddFrom); - - if (this != &setToAddFrom) - { - if (startIndex < 0) - { - jassertfalse - startIndex = 0; - } - if (numElementsToAdd < 0 || startIndex + numElementsToAdd > setToAddFrom.size()) - numElementsToAdd = setToAddFrom.size() - startIndex; + while (numUsed > 0) + if (this->elements [--numUsed] != 0) + this->elements [numUsed]->decReferenceCount(); - addArray (setToAddFrom.elements + startIndex, numElementsToAdd); - } + jassert (numUsed == 0); + this->setAllocatedSize (0); lock.exit(); - setToAddFrom.unlockSet(); } - /** Removes an element from the set. - - This will remove the element at a given index. - If the index passed in is out-of-range, nothing will happen. - - @param indexToRemove the index of the element to remove - @returns the element that has been removed - @see removeValue, removeRange - */ - ElementType remove (const int indexToRemove) throw() + /** Returns the current number of objects in the array. */ + inline int size() const throw() { - lock.enter(); - - if (((unsigned int) indexToRemove) < (unsigned int) numUsed) - { - --numUsed; - - ElementType* const e = this->elements + indexToRemove; - ElementType const removed = *e; - const int numberToShift = numUsed - indexToRemove; + return numUsed; + } - if (numberToShift > 0) - memmove (e, e + 1, numberToShift * sizeof (ElementType)); + /** Returns a pointer to the object at this index in the array. - if ((numUsed << 1) < this->numAllocated) - minimiseStorageOverheads(); + If the index is out-of-range, this will return a null pointer, (and + it could be null anyway, because it's ok for the array to hold null + pointers as well as objects). - lock.exit(); - return removed; - } - else - { - lock.exit(); - return 0; - } + @see getUnchecked + */ + inline ObjectClass* operator[] (const int index) const throw() + { + lock.enter(); + ObjectClass* const result = (((unsigned int) index) < (unsigned int) numUsed) + ? this->elements [index] + : (ObjectClass*) 0; + lock.exit(); + return result; } - /** Removes an item from the set. - - This will remove the given element from the set, if it's there. + /** Returns a pointer to the object at this index in the array, without checking whether the index is in-range. - @param valueToRemove the object to try to remove - @see remove, removeRange + This is a faster and less safe version of operator[] which doesn't check the index passed in, so + it can be used when you're sure the index if always going to be legal. */ - void removeValue (const ElementType valueToRemove) throw() + inline ObjectClass* getUnchecked (const int index) const throw() { lock.enter(); - remove (indexOf (valueToRemove)); + jassert (((unsigned int) index) < (unsigned int) numUsed); + ObjectClass* const result = this->elements [index]; lock.exit(); + return result; } - /** Removes any elements which are also in another set. + /** Returns a pointer to the first object in the array. - @param otherSet the other set in which to look for elements to remove - @see removeValuesNotIn, remove, removeValue, removeRange + This will return a null pointer if the array's empty. + @see getLast */ - template - void removeValuesIn (const OtherSetType& otherSet) throw() + inline ObjectClass* getFirst() const throw() { - otherSet.lockSet(); lock.enter(); + ObjectClass* const result = (numUsed > 0) ? this->elements [0] + : (ObjectClass*) 0; + lock.exit(); - if (this == &otherSet) - { - clear(); - } - else - { - if (otherSet.size() > 0) - { - for (int i = numUsed; --i >= 0;) - if (otherSet.contains (this->elements [i])) - remove (i); - } - } + return result; + } + + /** Returns a pointer to the last object in the array. + This will return a null pointer if the array's empty. + @see getFirst + */ + inline ObjectClass* getLast() const throw() + { + lock.enter(); + ObjectClass* const result = (numUsed > 0) ? this->elements [numUsed - 1] + : (ObjectClass*) 0; lock.exit(); - otherSet.unlockSet(); - } - /** Removes any elements which are not found in another set. + return result; + } - Only elements which occur in this other set will be retained. + /** Finds the index of the first occurrence of an object in the array. - @param otherSet the set in which to look for elements NOT to remove - @see removeValuesIn, remove, removeValue, removeRange + @param objectToLookFor the object to look for + @returns the index at which the object was found, or -1 if it's not found */ - template - void removeValuesNotIn (const OtherSetType& otherSet) throw() + int indexOf (const ObjectClass* const objectToLookFor) const throw() { - otherSet.lockSet(); + int result = -1; + lock.enter(); + ObjectClass** e = this->elements; - if (this != &otherSet) + for (int i = numUsed; --i >= 0;) { - if (otherSet.size() <= 0) - { - clear(); - } - else + if (objectToLookFor == *e) { - for (int i = numUsed; --i >= 0;) - if (! otherSet.contains (this->elements [i])) - remove (i); + result = (int) (e - this->elements); + break; } + + ++e; } lock.exit(); - otherSet.lockSet(); + return result; } - /** Reduces the amount of storage being used by the set. + /** Returns true if the array contains a specified object. - Sets typically allocate slightly more storage than they need, and after - removing elements, they may have quite a lot of unused space allocated. - This method will reduce the amount of allocated storage to a minimum. + @param objectToLookFor the object to look for + @returns true if the object is in the array */ - void minimiseStorageOverheads() throw() + bool contains (const ObjectClass* const objectToLookFor) const throw() { lock.enter(); + ObjectClass** e = this->elements; - if (numUsed == 0) - { - this->setAllocatedSize (0); - } - else + for (int i = numUsed; --i >= 0;) { - const int newAllocation = this->granularity * (numUsed / this->granularity + 1); + if (objectToLookFor == *e) + { + lock.exit(); + return true; + } - if (newAllocation < this->numAllocated) - this->setAllocatedSize (newAllocation); + ++e; } lock.exit(); + return false; } - /** Locks the set's CriticalSection. + /** Appends a new object to the end of the array. - Of course if the type of section used is a DummyCriticalSection, this won't - have any effect. + This will increase the new object's reference count. - @see unlockSet + @param newObject the new object to add to the array + @see set, insert, addIfNotAlreadyThere, addSorted, addArray */ - void lockSet() const throw() + void add (ObjectClass* const newObject) throw() { lock.enter(); - } - - /** Unlocks the set's CriticalSection. + this->ensureAllocatedSize (numUsed + 1); + this->elements [numUsed++] = newObject; - Of course if the type of section used is a DummyCriticalSection, this won't - have any effect. + if (newObject != 0) + newObject->incReferenceCount(); - @see lockSet - */ - void unlockSet() const throw() - { lock.exit(); } - juce_UseDebuggingNewOperator + /** Inserts a new object into the array at the given index. -private: - int numUsed; - TypeOfCriticalSectionToUse lock; + If the index is less than 0 or greater than the size of the array, the + element will be added to the end of the array. + Otherwise, it will be inserted into the array, moving all the later elements + along to make room. - void insertInternal (const int indexToInsertAt, const ElementType newElement) throw() - { - this->ensureAllocatedSize (numUsed + 1); + This will increase the new object's reference count. - ElementType* const insertPos = this->elements + indexToInsertAt; - const int numberToMove = numUsed - indexToInsertAt; + @param indexToInsertAt the index at which the new element should be inserted + @param newObject the new object to add to the array + @see add, addSorted, addIfNotAlreadyThere, set + */ + void insert (int indexToInsertAt, + ObjectClass* const newObject) throw() + { + if (indexToInsertAt >= 0) + { + lock.enter(); - if (numberToMove > 0) - memmove (insertPos + 1, insertPos, numberToMove * sizeof (ElementType)); + if (indexToInsertAt > numUsed) + indexToInsertAt = numUsed; - *insertPos = newElement; - ++numUsed; - } -}; + this->ensureAllocatedSize (numUsed + 1); -#if JUCE_MSVC - #pragma warning (pop) -#endif + ObjectClass** const e = this->elements + indexToInsertAt; + const int numToMove = numUsed - indexToInsertAt; -#endif // __JUCE_SORTEDSET_JUCEHEADER__ -/********* End of inlined file: juce_SortedSet.h *********/ + if (numToMove > 0) + memmove (e + 1, e, numToMove * sizeof (ObjectClass*)); -#endif -#ifndef __JUCE_SPARSESET_JUCEHEADER__ + *e = newObject; -/********* Start of inlined file: juce_SparseSet.h *********/ -#ifndef __JUCE_SPARSESET_JUCEHEADER__ -#define __JUCE_SPARSESET_JUCEHEADER__ + if (newObject != 0) + newObject->incReferenceCount(); -/** - Holds a set of primitive values, storing them as a set of ranges. + ++numUsed; + lock.exit(); + } + else + { + add (newObject); + } + } - This container acts like a simple BitArray, but can efficiently hold large - continguous ranges of values. It's quite a specialised class, mostly useful - for things like keeping the set of selected rows in a listbox. + /** Appends a new object at the end of the array as long as the array doesn't + already contain it. - The type used as a template paramter must be an integer type, such as int, short, - int64, etc. -*/ -template -class SparseSet -{ -public: + If the array already contains a matching object, nothing will be done. - /** Creates a new empty set. */ - SparseSet() throw() + @param newObject the new object to add to the array + */ + void addIfNotAlreadyThere (ObjectClass* const newObject) throw() { - } + lock.enter(); - /** Creates a copy of another SparseSet. */ - SparseSet (const SparseSet& other) throw() - : values (other.values) - { - } + if (! contains (newObject)) + add (newObject); - /** Destructor. */ - ~SparseSet() throw() - { + lock.exit(); } - /** Clears the set. */ - void clear() throw() - { - values.clear(); - } + /** Replaces an object in the array with a different one. - /** Checks whether the set is empty. + If the index is less than zero, this method does nothing. + If the index is beyond the end of the array, the new object is added to the end of the array. - This is much quicker than using (size() == 0). + The object being added has its reference count increased, and if it's replacing + another object, then that one has its reference count decreased, and may be deleted. + + @param indexToChange the index whose value you want to change + @param newObject the new value to set for this index. + @see add, insert, remove */ - bool isEmpty() const throw() + void set (const int indexToChange, + ObjectClass* const newObject) { - return values.size() == 0; - } + if (indexToChange >= 0) + { + lock.enter(); - /** Returns the number of values in the set. + if (newObject != 0) + newObject->incReferenceCount(); - Because of the way the data is stored, this method can take longer if there - are a lot of items in the set. Use isEmpty() for a quick test of whether there - are any items. - */ - Type size() const throw() - { - Type num = 0; + if (indexToChange < numUsed) + { + if (this->elements [indexToChange] != 0) + this->elements [indexToChange]->decReferenceCount(); - for (int i = 0; i < values.size(); i += 2) - num += values[i + 1] - values[i]; + this->elements [indexToChange] = newObject; + } + else + { + this->ensureAllocatedSize (numUsed + 1); + this->elements [numUsed++] = newObject; + } - return num; + lock.exit(); + } } - /** Returns one of the values in the set. + /** Adds elements from another array to the end of this array. - @param index the index of the value to retrieve, in the range 0 to (size() - 1). - @returns the value at this index, or 0 if it's out-of-range + @param arrayToAddFrom the array from which to copy the elements + @param startIndex the first element of the other array to start copying from + @param numElementsToAdd how many elements to add from the other array. If this + value is negative or greater than the number of available elements, + all available elements will be copied. + @see add */ - Type operator[] (int index) const throw() + void addArray (const ReferenceCountedArray& arrayToAddFrom, + int startIndex = 0, + int numElementsToAdd = -1) throw() { - for (int i = 0; i < values.size(); i += 2) - { - const Type s = values.getUnchecked(i); - const Type e = values.getUnchecked(i + 1); - - if (index < e - s) - return s + index; + arrayToAddFrom.lockArray(); + lock.enter(); - index -= e - s; + if (startIndex < 0) + { + jassertfalse + startIndex = 0; } - return (Type) 0; - } - - /** Checks whether a particular value is in the set. */ - bool contains (const Type valueToLookFor) const throw() - { - bool on = false; + if (numElementsToAdd < 0 || startIndex + numElementsToAdd > arrayToAddFrom.size()) + numElementsToAdd = arrayToAddFrom.size() - startIndex; - for (int i = 0; i < values.size(); ++i) + if (numElementsToAdd > 0) { - if (values.getUnchecked(i) > valueToLookFor) - return on; + this->ensureAllocatedSize (numUsed + numElementsToAdd); - on = ! on; + while (--numElementsToAdd >= 0) + add (arrayToAddFrom.getUnchecked (startIndex++)); } - return false; + lock.exit(); + arrayToAddFrom.unlockArray(); } - /** Returns the number of contiguous blocks of values. + /** Inserts a new object into the array assuming that the array is sorted. - @see getRange + This will use a comparator to find the position at which the new object + should go. If the array isn't sorted, the behaviour of this + method will be unpredictable. + + @param comparator the comparator object to use to compare the elements - see the + sort() method for details about this object's form + @param newObject the new object to insert to the array + @see add, sort */ - int getNumRanges() const throw() + template + void addSorted (ElementComparator& comparator, + ObjectClass* newObject) throw() { - return values.size() >> 1; + lock.enter(); + insert (findInsertIndexInSortedArray (comparator, this->elements, newObject, 0, numUsed), newObject); + lock.exit(); } - /** Returns one of the contiguous ranges of values stored. + /** Removes an object from the array. - @param rangeIndex the index of the range to look up, between 0 - and (getNumRanges() - 1) - @param startValue on return, the value at the start of the range - @param numValues on return, the number of values in the range + This will remove the object at a given index and move back all the + subsequent objects to close the gap. - @see getTotalRange + If the index passed in is out-of-range, nothing will happen. + + The object that is removed will have its reference count decreased, + and may be deleted if not referenced from elsewhere. + + @param indexToRemove the index of the element to remove + @see removeObject, removeRange */ - bool getRange (const int rangeIndex, - Type& startValue, - Type& numValues) const throw() + void remove (const int indexToRemove) { - if (((unsigned int) rangeIndex) < (unsigned int) getNumRanges()) + lock.enter(); + + if (((unsigned int) indexToRemove) < (unsigned int) numUsed) { - startValue = values [rangeIndex << 1]; - numValues = values [(rangeIndex << 1) + 1] - startValue; + ObjectClass** const e = this->elements + indexToRemove; - return true; - } + if (*e != 0) + (*e)->decReferenceCount(); - return false; - } + --numUsed; + const int numberToShift = numUsed - indexToRemove; - /** Returns the lowest and highest values in the set. + if (numberToShift > 0) + memmove (e, e + 1, numberToShift * sizeof (ObjectClass*)); - @see getRange - */ - bool getTotalRange (Type& lowestValue, - Type& highestValue) const throw() - { - if (values.size() > 0) - { - lowestValue = values.getUnchecked (0); - highestValue = values.getUnchecked (values.size() - 1); - return true; + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); } - return false; + lock.exit(); } - /** Adds a range of contiguous values to the set. + /** Removes the first occurrence of a specified object from the array. - e.g. addRange (10, 4) will add (10, 11, 12, 13) to the set. + If the item isn't found, no action is taken. If it is found, it is + removed and has its reference count decreased. - @param firstValue the start of the range of values to add - @param numValuesToAdd how many values to add + @param objectToRemove the object to try to remove + @see remove, removeRange */ - void addRange (const Type firstValue, - const Type numValuesToAdd) throw() + void removeObject (ObjectClass* const objectToRemove) { - jassert (numValuesToAdd >= 0); - - if (numValuesToAdd > 0) - { - removeRange (firstValue, numValuesToAdd); + lock.enter(); + remove (indexOf (objectToRemove)); + lock.exit(); + } - IntegerElementComparator sorter; - values.addSorted (sorter, firstValue); - values.addSorted (sorter, firstValue + numValuesToAdd); + /** Removes a range of objects from the array. - simplify(); - } - } + This will remove a set of objects, starting from the given index, + and move any subsequent elements down to close the gap. - /** Removes a range of values from the set. + If the range extends beyond the bounds of the array, it will + be safely clipped to the size of the array. - e.g. removeRange (10, 4) will remove (10, 11, 12, 13) from the set. + The objects that are removed will have their reference counts decreased, + and may be deleted if not referenced from elsewhere. - @param firstValue the start of the range of values to remove - @param numValuesToRemove how many values to remove + @param startIndex the index of the first object to remove + @param numberToRemove how many objects should be removed + @see remove, removeObject */ - void removeRange (const Type firstValue, - const Type numValuesToRemove) throw() + void removeRange (const int startIndex, + const int numberToRemove) { - jassert (numValuesToRemove >= 0); - - if (numValuesToRemove > 0 - && firstValue < values.getLast()) - { - const bool onAtStart = contains (firstValue - 1); - Type lastValue = firstValue + numValuesToRemove; - - if (lastValue < firstValue) // possible if the signed arithmetic wraps around - lastValue = values.getLast(); + lock.enter(); - const bool onAtEnd = contains (lastValue); + const int start = jlimit (0, numUsed, startIndex); + const int end = jlimit (0, numUsed, startIndex + numberToRemove); - for (int i = values.size(); --i >= 0;) + if (end > start) + { + int i; + for (i = start; i < end; ++i) { - if (values.getUnchecked(i) >= firstValue - && values.getUnchecked(i) <= lastValue) + if (this->elements[i] != 0) { - values.remove (i); + this->elements[i]->decReferenceCount(); + this->elements[i] = 0; // (in case one of the destructors accesses this array and hits a dangling pointer) } } - IntegerElementComparator sorter; + const int rangeSize = end - start; + ObjectClass** e = this->elements + start; + i = numUsed - end; + numUsed -= rangeSize; - if (onAtStart) - values.addSorted (sorter, firstValue); + while (--i >= 0) + { + *e = e [rangeSize]; + ++e; + } - if (onAtEnd) - values.addSorted (sorter, lastValue); + if ((numUsed << 1) < this->numAllocated) + minimiseStorageOverheads(); + } + + lock.exit(); + } + + /** Removes the last n objects from the array. + + The objects that are removed will have their reference counts decreased, + and may be deleted if not referenced from elsewhere. + + @param howManyToRemove how many objects to remove from the end of the array + @see remove, removeObject, removeRange + */ + void removeLast (int howManyToRemove = 1) + { + lock.enter(); + + if (howManyToRemove > numUsed) + howManyToRemove = numUsed; + + while (--howManyToRemove >= 0) + remove (numUsed - 1); - simplify(); - } + lock.exit(); } - /** Does an XOR of the values in a given range. */ - void invertRange (const Type firstValue, - const Type numValues) + /** Swaps a pair of objects in the array. + + If either of the indexes passed in is out-of-range, nothing will happen, + otherwise the two objects at these positions will be exchanged. + */ + void swap (const int index1, + const int index2) throw() { - SparseSet newItems; - newItems.addRange (firstValue, numValues); + lock.enter(); - int i; - for (i = getNumRanges(); --i >= 0;) + if (((unsigned int) index1) < (unsigned int) numUsed + && ((unsigned int) index2) < (unsigned int) numUsed) { - const int start = values [i << 1]; - const int end = values [(i << 1) + 1]; - - newItems.removeRange (start, end); + swapVariables (this->elements [index1], + this->elements [index2]); } - removeRange (firstValue, numValues); + lock.exit(); + } - for (i = newItems.getNumRanges(); --i >= 0;) - { - const int start = newItems.values [i << 1]; - const int end = newItems.values [(i << 1) + 1]; + /** Moves one of the objects to a different position. - addRange (start, end); - } - } + This will move the object to a specified index, shuffling along + any intervening elements as required. - /** Checks whether any part of a given range overlaps any part of this one. */ - bool overlapsRange (const Type firstValue, - const Type numValues) throw() - { - jassert (numValues >= 0); + So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling + move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }. - if (numValues > 0) + @param currentIndex the index of the object to be moved. If this isn't a + valid index, then nothing will be done + @param newIndex the index at which you'd like this object to end up. If this + is less than zero, it will be moved to the end of the array + */ + void move (const int currentIndex, + int newIndex) throw() + { + if (currentIndex != newIndex) { - for (int i = getNumRanges(); --i >= 0;) + lock.enter(); + + if (((unsigned int) currentIndex) < (unsigned int) numUsed) { - if (firstValue >= values.getUnchecked ((i << 1) + 1)) - return false; + if (((unsigned int) newIndex) >= (unsigned int) numUsed) + newIndex = numUsed - 1; - if (firstValue + numValues > values.getUnchecked (i << 1)) - return true; + ObjectClass* const value = this->elements [currentIndex]; + + if (newIndex > currentIndex) + { + memmove (this->elements + currentIndex, + this->elements + currentIndex + 1, + (newIndex - currentIndex) * sizeof (ObjectClass*)); + } + else + { + memmove (this->elements + newIndex + 1, + this->elements + newIndex, + (currentIndex - newIndex) * sizeof (ObjectClass*)); + } + + this->elements [newIndex] = value; } - } - return false; + lock.exit(); + } } - /** Checks whether the whole of a given range is contained within this one. */ - bool containsRange (const Type firstValue, - const Type numValues) throw() + /** Compares this array to another one. + + @returns true only if the other array contains the same objects in the same order + */ + bool operator== (const ReferenceCountedArray& other) const throw() { - jassert (numValues >= 0); + other.lockArray(); + lock.enter(); - if (numValues > 0) + bool result = numUsed == other.numUsed; + + if (result) { - for (int i = getNumRanges(); --i >= 0;) + for (int i = numUsed; --i >= 0;) { - if (firstValue >= values.getUnchecked ((i << 1) + 1)) - return false; - - if (firstValue >= values.getUnchecked (i << 1) - && firstValue + numValues <= values.getUnchecked ((i << 1) + 1)) - return true; + if (this->elements [i] != other.elements [i]) + { + result = false; + break; + } } } - return false; - } - - bool operator== (const SparseSet& other) throw() - { - return values == other.values; - } + lock.exit(); + other.unlockArray(); - bool operator!= (const SparseSet& other) throw() - { - return values != other.values; + return result; } - juce_UseDebuggingNewOperator - -private: - // alternating start/end values of ranges of values that are present. - Array values; + /** Compares this array to another one. - void simplify() throw() + @see operator== + */ + bool operator!= (const ReferenceCountedArray& other) const throw() { - jassert ((values.size() & 1) == 0); - - for (int i = values.size(); --i > 0;) - if (values.getUnchecked(i) == values.getUnchecked (i - 1)) - values.removeRange (i - 1, 2); + return ! operator== (other); } -}; - -#endif // __JUCE_SPARSESET_JUCEHEADER__ -/********* End of inlined file: juce_SparseSet.h *********/ - -#endif -#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ - -#endif -#ifndef __JUCE_INPUTSTREAM_JUCEHEADER__ - -#endif -#ifndef __JUCE_OUTPUTSTREAM_JUCEHEADER__ -#endif -#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ + /** Sorts the elements in the array. -/********* Start of inlined file: juce_DirectoryIterator.h *********/ -#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ -#define __JUCE_DIRECTORYITERATOR_JUCEHEADER__ + This will use a comparator object to sort the elements into order. The object + passed must have a method of the form: + @code + int compareElements (ElementType first, ElementType second); + @endcode -/** - Searches through a the files in a directory, returning each file that is found. + ..and this method must return: + - a value of < 0 if the first comes before the second + - a value of 0 if the two objects are equivalent + - a value of > 0 if the second comes before the first - A DirectoryIterator will search through a directory and its subdirectories using - a wildcard filepattern match. + To improve performance, the compareElements() method can be declared as static or const. - If you may be finding a large number of files, this is better than - using File::findChildFiles() because it doesn't block while it finds them - all, and this is more memory-efficient. + @param comparator the comparator to use for comparing elements. + @param retainOrderOfEquivalentItems if this is true, then items + which the comparator says are equivalent will be + kept in the order in which they currently appear + in the array. This is slower to perform, but may + be important in some cases. If it's false, a faster + algorithm is used, but equivalent elements may be + rearranged. - It can also guess how far it's got using a wildly inaccurate algorithm. -*/ -class JUCE_API DirectoryIterator -{ -public: + @see sortArray + */ + template + void sort (ElementComparator& comparator, + const bool retainOrderOfEquivalentItems = false) const throw() + { + (void) comparator; // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused - /** Creates a DirectoryIterator for a given directory. + lock.enter(); + sortArray (comparator, this->elements, 0, size() - 1, retainOrderOfEquivalentItems); + lock.exit(); + } - After creating one of these, call its next() method to get the - first file - e.g. @code + /** Reduces the amount of storage being used by the array. - DirectoryIterator iter (File ("/animals/mooses"), true, "*.moose"); + Arrays typically allocate slightly more storage than they need, and after + removing elements, they may have quite a lot of unused space allocated. + This method will reduce the amount of allocated storage to a minimum. + */ + void minimiseStorageOverheads() throw() + { + lock.enter(); - while (iter.next()) + if (numUsed == 0) { - File theFileItFound (iter.getFile()); + this->setAllocatedSize (0); + } + else + { + const int newAllocation = this->granularity * (numUsed / this->granularity + 1); - ... etc + if (newAllocation < this->numAllocated) + this->setAllocatedSize (newAllocation); } - @endcode - @param directory the directory to search in - @param isRecursive whether all the subdirectories should also be searched - @param wildCard the file pattern to match - @param whatToLookFor a value from the File::TypesOfFileToFind enum, specifying - whether to look for files, directories, or both. - */ - DirectoryIterator (const File& directory, - bool isRecursive, - const String& wildCard = JUCE_T("*"), - const int whatToLookFor = File::findFiles) throw(); + lock.exit(); + } - /** Destructor. */ - ~DirectoryIterator() throw(); + /** Locks the array's CriticalSection. - /** Call this to move the iterator along to the next file. + Of course if the type of section used is a DummyCriticalSection, this won't + have any effect. - @returns true if a file was found (you can then use getFile() to see what it was) - or - false if there are no more matching files. + @see unlockArray */ - bool next() throw(); - - /** Returns the file that the iterator is currently pointing at. + void lockArray() const throw() + { + lock.enter(); + } - The result of this call is only valid after a call to next() has returned true. - */ - const File getFile() const throw(); + /** Unlocks the array's CriticalSection. - /** Returns a guess of how far through the search the iterator has got. + Of course if the type of section used is a DummyCriticalSection, this won't + have any effect. - @returns a value 0.0 to 1.0 to show the progress, although this won't be - very accurate. + @see lockArray */ - float getEstimatedProgress() const throw(); + void unlockArray() const throw() + { + lock.exit(); + } juce_UseDebuggingNewOperator private: - OwnedArray filesFound; - OwnedArray dirsFound; - String wildCard; - int index; - const int whatToLookFor; - DirectoryIterator* subIterator; - - DirectoryIterator (const DirectoryIterator&); - const DirectoryIterator& operator= (const DirectoryIterator&); + int numUsed; + TypeOfCriticalSectionToUse lock; }; -#endif // __JUCE_DIRECTORYITERATOR_JUCEHEADER__ -/********* End of inlined file: juce_DirectoryIterator.h *********/ +#endif // __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ +/********* End of inlined file: juce_ReferenceCountedArray.h *********/ #endif -#ifndef __JUCE_FILE_JUCEHEADER__ +#ifndef __JUCE_INPUTSTREAM_JUCEHEADER__ + +#endif +#ifndef __JUCE_OUTPUTSTREAM_JUCEHEADER__ #endif #ifndef __JUCE_FILEINPUTSTREAM_JUCEHEADER__ @@ -11434,6 +11390,98 @@ private: #endif // __JUCE_FILEOUTPUTSTREAM_JUCEHEADER__ /********* End of inlined file: juce_FileOutputStream.h *********/ +#endif +#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ + +/********* Start of inlined file: juce_DirectoryIterator.h *********/ +#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ +#define __JUCE_DIRECTORYITERATOR_JUCEHEADER__ + +/** + Searches through a the files in a directory, returning each file that is found. + + A DirectoryIterator will search through a directory and its subdirectories using + a wildcard filepattern match. + + If you may be finding a large number of files, this is better than + using File::findChildFiles() because it doesn't block while it finds them + all, and this is more memory-efficient. + + It can also guess how far it's got using a wildly inaccurate algorithm. +*/ +class JUCE_API DirectoryIterator +{ +public: + + /** Creates a DirectoryIterator for a given directory. + + After creating one of these, call its next() method to get the + first file - e.g. @code + + DirectoryIterator iter (File ("/animals/mooses"), true, "*.moose"); + + while (iter.next()) + { + File theFileItFound (iter.getFile()); + + ... etc + } + @endcode + + @param directory the directory to search in + @param isRecursive whether all the subdirectories should also be searched + @param wildCard the file pattern to match + @param whatToLookFor a value from the File::TypesOfFileToFind enum, specifying + whether to look for files, directories, or both. + */ + DirectoryIterator (const File& directory, + bool isRecursive, + const String& wildCard = JUCE_T("*"), + const int whatToLookFor = File::findFiles) throw(); + + /** Destructor. */ + ~DirectoryIterator() throw(); + + /** Call this to move the iterator along to the next file. + + @returns true if a file was found (you can then use getFile() to see what it was) - or + false if there are no more matching files. + */ + bool next() throw(); + + /** Returns the file that the iterator is currently pointing at. + + The result of this call is only valid after a call to next() has returned true. + */ + const File getFile() const throw(); + + /** Returns a guess of how far through the search the iterator has got. + + @returns a value 0.0 to 1.0 to show the progress, although this won't be + very accurate. + */ + float getEstimatedProgress() const throw(); + + juce_UseDebuggingNewOperator + +private: + OwnedArray filesFound; + OwnedArray dirsFound; + String wildCard; + int index; + const int whatToLookFor; + DirectoryIterator* subIterator; + + DirectoryIterator (const DirectoryIterator&); + const DirectoryIterator& operator= (const DirectoryIterator&); +}; + +#endif // __JUCE_DIRECTORYITERATOR_JUCEHEADER__ +/********* End of inlined file: juce_DirectoryIterator.h *********/ + +#endif +#ifndef __JUCE_FILE_JUCEHEADER__ + #endif #ifndef __JUCE_FILESEARCHPATH_JUCEHEADER__ @@ -11657,6 +11705,93 @@ private: #endif // __JUCE_NAMEDPIPE_JUCEHEADER__ /********* End of inlined file: juce_NamedPipe.h *********/ +#endif +#ifndef __JUCE_MD5_JUCEHEADER__ + +/********* Start of inlined file: juce_MD5.h *********/ +#ifndef __JUCE_MD5_JUCEHEADER__ +#define __JUCE_MD5_JUCEHEADER__ + +/** + MD5 checksum class. + + Create one of these with a block of source data or a string, and it calculates the + MD5 checksum of that data. + + You can then retrieve this checksum as a 16-byte block, or as a hex string. +*/ +class JUCE_API MD5 +{ +public: + + /** Creates a null MD5 object. */ + MD5(); + + /** Creates a copy of another MD5. */ + MD5 (const MD5& other); + + /** Copies another MD5. */ + const MD5& operator= (const MD5& other); + + /** Creates a checksum for a block of binary data. */ + MD5 (const MemoryBlock& data); + + /** Creates a checksum for a block of binary data. */ + MD5 (const char* data, const int numBytes); + + /** Creates a checksum for a string. */ + MD5 (const String& text); + + /** Creates a checksum for the input from a stream. + + This will read up to the given number of bytes from the stream, and produce the + checksum of that. If the number of bytes to read is negative, it'll read + until the stream is exhausted. + */ + MD5 (InputStream& input, int numBytesToRead = -1); + + /** Creates a checksum for a file. */ + MD5 (const File& file); + + /** Destructor. */ + ~MD5(); + + /** Returns the checksum as a 16-byte block of data. */ + const MemoryBlock getRawChecksumData() const; + + /** Returns the checksum as a 32-digit hex string. */ + const String toHexString() const; + + /** Compares this to another MD5. */ + bool operator== (const MD5& other) const; + + /** Compares this to another MD5. */ + bool operator!= (const MD5& other) const; + + juce_UseDebuggingNewOperator + +private: + uint8 result [16]; + + struct ProcessContext + { + uint8 buffer [64]; + uint32 state [4]; + uint32 count [2]; + + ProcessContext(); + + void processBlock (const uint8* const data, int dataSize); + void transform (const uint8* const buffer); + void finish (uint8* const result); + }; + + void processStream (InputStream& input, int numBytesToRead); +}; + +#endif // __JUCE_MD5_JUCEHEADER__ +/********* End of inlined file: juce_MD5.h *********/ + #endif #ifndef __JUCE_BLOWFISH_JUCEHEADER__ @@ -11706,91 +11841,72 @@ private: /********* End of inlined file: juce_BlowFish.h *********/ #endif -#ifndef __JUCE_MD5_JUCEHEADER__ +#ifndef __JUCE_RSAKEY_JUCEHEADER__ -/********* Start of inlined file: juce_MD5.h *********/ -#ifndef __JUCE_MD5_JUCEHEADER__ -#define __JUCE_MD5_JUCEHEADER__ +/********* Start of inlined file: juce_RSAKey.h *********/ +#ifndef __JUCE_RSAKEY_JUCEHEADER__ +#define __JUCE_RSAKEY_JUCEHEADER__ /** - MD5 checksum class. - - Create one of these with a block of source data or a string, and it calculates the - MD5 checksum of that data. + RSA public/private key-pair encryption class. - You can then retrieve this checksum as a 16-byte block, or as a hex string. + An object of this type makes up one half of a public/private RSA key pair. Use the + createKeyPair() method to create a matching pair for encoding/decoding. */ -class JUCE_API MD5 +class JUCE_API RSAKey { public: - /** Creates a null MD5 object. */ - MD5(); - - /** Creates a copy of another MD5. */ - MD5 (const MD5& other); - - /** Copies another MD5. */ - const MD5& operator= (const MD5& other); - - /** Creates a checksum for a block of binary data. */ - MD5 (const MemoryBlock& data); - - /** Creates a checksum for a block of binary data. */ - MD5 (const char* data, const int numBytes); - - /** Creates a checksum for a string. */ - MD5 (const String& text); - - /** Creates a checksum for the input from a stream. + /** Creates a null key object. - This will read up to the given number of bytes from the stream, and produce the - checksum of that. If the number of bytes to read is negative, it'll read - until the stream is exhausted. + Initialise a pair of objects for use with the createKeyPair() method. */ - MD5 (InputStream& input, int numBytesToRead = -1); + RSAKey() throw(); - /** Creates a checksum for a file. */ - MD5 (const File& file); + /** Loads a key from an encoded string representation. + + This reloads a key from a string created by the toString() method. + */ + RSAKey (const String& stringRepresentation) throw(); /** Destructor. */ - ~MD5(); + ~RSAKey() throw(); - /** Returns the checksum as a 16-byte block of data. */ - const MemoryBlock getRawChecksumData() const; + /** Turns the key into a string representation. - /** Returns the checksum as a 32-digit hex string. */ - const String toHexString() const; + This can be reloaded using the constructor that takes a string. + */ + const String toString() const throw(); - /** Compares this to another MD5. */ - bool operator== (const MD5& other) const; + /** Encodes or decodes a value. - /** Compares this to another MD5. */ - bool operator!= (const MD5& other) const; + Call this on the public key object to encode some data, then use the matching + private key object to decode it. - juce_UseDebuggingNewOperator + Returns false if the operation failed, e.g. if this object isn't a valid key. + */ + bool applyToValue (BitArray& value) const throw(); -private: - uint8 result [16]; + /** Creates a public/private key-pair. - struct ProcessContext - { - uint8 buffer [64]; - uint32 state [4]; - uint32 count [2]; + Each key will perform one-way encryption that can only be reversed by + using the other key. - ProcessContext(); + The numBits parameter specifies the size of key, e.g. 128, 256, 512 bit. Bigger + sizes are more secure, but this method will take longer to execute. + */ + static void createKeyPair (RSAKey& publicKey, + RSAKey& privateKey, + const int numBits) throw(); - void processBlock (const uint8* const data, int dataSize); - void transform (const uint8* const buffer); - void finish (uint8* const result); - }; + juce_UseDebuggingNewOperator - void processStream (InputStream& input, int numBytesToRead); +protected: + BitArray part1, part2; }; -#endif // __JUCE_MD5_JUCEHEADER__ -/********* End of inlined file: juce_MD5.h *********/ +#endif // __JUCE_RSAKEY_JUCEHEADER__ +/********* End of inlined file: juce_RSAKey.h *********/ #endif #ifndef __JUCE_PRIMES_JUCEHEADER__ @@ -11834,72 +11950,218 @@ public: /********* End of inlined file: juce_Primes.h *********/ #endif -#ifndef __JUCE_RSAKEY_JUCEHEADER__ +#ifndef __JUCE_URL_JUCEHEADER__ -/********* Start of inlined file: juce_RSAKey.h *********/ -#ifndef __JUCE_RSAKEY_JUCEHEADER__ -#define __JUCE_RSAKEY_JUCEHEADER__ +/********* Start of inlined file: juce_URL.h *********/ +#ifndef __JUCE_URL_JUCEHEADER__ +#define __JUCE_URL_JUCEHEADER__ /** - RSA public/private key-pair encryption class. + Represents a URL and has a bunch of useful functions to manipulate it. - An object of this type makes up one half of a public/private RSA key pair. Use the - createKeyPair() method to create a matching pair for encoding/decoding. + This class can be used to launch URLs in browsers, and also to create + InputStreams that can read from remote http or ftp sources. */ -class JUCE_API RSAKey +class JUCE_API URL { public: - /** Creates a null key object. + /** Creates an empty URL. */ + URL() throw(); - Initialise a pair of objects for use with the createKeyPair() method. + /** Creates a URL from a string. */ + URL (const String& url); + + /** Creates a copy of another URL. */ + URL (const URL& other); + + /** Destructor. */ + ~URL() throw(); + + /** Copies this URL from another one. */ + const URL& operator= (const URL& other); + + /** Returns a string version of the URL. + + If includeGetParameters is true and any parameters have been set with the + withParameter() method, then the string will have these appended on the + end and url-encoded. */ - RSAKey() throw(); + const String toString (const bool includeGetParameters) const; - /** Loads a key from an encoded string representation. + /** True if it seems to be valid. */ + bool isWellFormed() const; - This reloads a key from a string created by the toString() method. + /** Returns a copy of this URL, with a GET parameter added to the end. + + Any control characters in the value will be encoded. + + e.g. calling "withParameter ("amount", "some fish") for the url "www.fish.com" + would produce a new url whose toString(true) method would return + "www.fish.com?amount=some+fish". */ - RSAKey (const String& stringRepresentation) throw(); + const URL withParameter (const String& parameterName, + const String& parameterValue) const; - /** Destructor. */ - ~RSAKey() throw(); + /** Returns a copy of this URl, with a file-upload type parameter added to it. - /** Turns the key into a string representation. + When performing a POST where one of your parameters is a binary file, this + lets you specify the file. - This can be reloaded using the constructor that takes a string. + Note that the filename is stored, but the file itself won't actually be read + until this URL is later used to create a network input stream. */ - const String toString() const throw(); + const URL withFileToUpload (const String& parameterName, + const File& fileToUpload, + const String& mimeType) const; - /** Encodes or decodes a value. + /** Returns a set of all the parameters encoded into the url. - Call this on the public key object to encode some data, then use the matching - private key object to decode it. + E.g. for the url "www.fish.com?type=haddock&amount=some+fish", this array would + contain two pairs: "type" => "haddock" and "amount" => "some fish". - Returns false if the operation failed, e.g. if this object isn't a valid key. + The values returned will have been cleaned up to remove any escape characters. + + @see getNamedParameter, withParameter */ - bool applyToValue (BitArray& value) const throw(); + const StringPairArray& getParameters() const throw(); - /** Creates a public/private key-pair. + /** Returns the set of files that should be uploaded as part of a POST operation. - Each key will perform one-way encryption that can only be reversed by - using the other key. + This is the set of files that were added to the URL with the withFileToUpload() + method. + */ + const StringPairArray& getFilesToUpload() const throw(); - The numBits parameter specifies the size of key, e.g. 128, 256, 512 bit. Bigger - sizes are more secure, but this method will take longer to execute. + /** Returns the set of mime types associated with each of the upload files. */ - static void createKeyPair (RSAKey& publicKey, - RSAKey& privateKey, - const int numBits) throw(); + const StringPairArray& getMimeTypesOfUploadFiles() const throw(); + + /** Tries to launch the system's default browser to open the URL. + + Returns true if this seems to have worked. + */ + bool launchInDefaultBrowser() const; + + /** Takes a guess as to whether a string might be a valid website address. + + This isn't foolproof! + */ + static bool isProbablyAWebsiteURL (const String& possibleURL); + + /** Takes a guess as to whether a string might be a valid email address. + + This isn't foolproof! + */ + static bool isProbablyAnEmailAddress (const String& possibleEmailAddress); + + /** This callback function can be used by the createInputStream() method. + + It allows your app to receive progress updates during a lengthy POST operation. If you + want to continue the operation, this should return true, or false to abort. + */ + typedef bool (OpenStreamProgressCallback) (void* context, int bytesSent, int totalBytes); + + /** Attempts to open a stream that can read from this URL. + + @param usePostCommand if true, it will try to do use a http 'POST' to pass + the paramters, otherwise it'll encode them into the + URL and do a 'GET'. + @param progressCallback if this is non-zero, it lets you supply a callback function + to keep track of the operation's progress. This can be useful + for lengthy POST operations, so that you can provide user feedback. + @param progressCallbackContext if a callback is specified, this value will be passed to + the function + @param extraHeaders if not empty, this string is appended onto the headers that + are used for the request. It must therefore be a valid set of HTML + header directives, separated by newlines. + @param connectionTimeOutMs if 0, this will use whatever default setting the OS chooses. If + a negative number, it will be infinite. Otherwise it specifies a + time in milliseconds. + */ + InputStream* createInputStream (const bool usePostCommand, + OpenStreamProgressCallback* const progressCallback = 0, + void* const progressCallbackContext = 0, + const String& extraHeaders = String::empty, + const int connectionTimeOutMs = 0) const; + + /** Tries to download the entire contents of this URL into a binary data block. + + If it succeeds, this will return true and append the data it read onto the end + of the memory block. + + @param destData the memory block to append the new data to + @param usePostCommand whether to use a POST command to get the data (uses + a GET command if this is false) + @see readEntireTextStream, readEntireXmlStream + */ + bool readEntireBinaryStream (MemoryBlock& destData, + const bool usePostCommand = false) const; + + /** Tries to download the entire contents of this URL as a string. + + If it fails, this will return an empty string, otherwise it will return the + contents of the downloaded file. If you need to distinguish between a read + operation that fails and one that returns an empty string, you'll need to use + a different method, such as readEntireBinaryStream(). + + @param usePostCommand whether to use a POST command to get the data (uses + a GET command if this is false) + @see readEntireBinaryStream, readEntireXmlStream + */ + const String readEntireTextStream (const bool usePostCommand = false) const; + + /** Tries to download the entire contents of this URL and parse it as XML. + + If it fails, or if the text that it reads can't be parsed as XML, this will + return 0. + + When it returns a valid XmlElement object, the caller is responsibile for deleting + this object when no longer needed. + + @param usePostCommand whether to use a POST command to get the data (uses + a GET command if this is false) + + @see readEntireBinaryStream, readEntireTextStream + */ + XmlElement* readEntireXmlStream (const bool usePostCommand = false) const; + + /** Adds escape sequences to a string to encode any characters that aren't + legal in a URL. + + E.g. any spaces will be replaced with "%20". + + This is the opposite of removeEscapeChars(). + + If isParameter is true, it means that the string is going to be used + as a parameter, so it also encodes '$' and ',' (which would otherwise + be legal in a URL. + + @see removeEscapeChars + */ + static const String addEscapeChars (const String& stringToAddEscapeCharsTo, + const bool isParameter); + + /** Replaces any escape character sequences in a string with their original + character codes. + + E.g. any instances of "%20" will be replaced by a space. + + This is the opposite of addEscapeChars(). + + @see addEscapeChars + */ + static const String removeEscapeChars (const String& stringToRemoveEscapeCharsFrom); juce_UseDebuggingNewOperator -protected: - BitArray part1, part2; +private: + String url; + StringPairArray parameters, filesToUpload, mimeTypes; }; -#endif // __JUCE_RSAKEY_JUCEHEADER__ -/********* End of inlined file: juce_RSAKey.h *********/ +#endif // __JUCE_URL_JUCEHEADER__ +/********* End of inlined file: juce_URL.h *********/ #endif #ifndef __JUCE_SOCKET_JUCEHEADER__ @@ -12155,213 +12417,135 @@ private: /********* End of inlined file: juce_Socket.h *********/ #endif -#ifndef __JUCE_URL_JUCEHEADER__ +#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ -/********* Start of inlined file: juce_URL.h *********/ -#ifndef __JUCE_URL_JUCEHEADER__ -#define __JUCE_URL_JUCEHEADER__ +/********* Start of inlined file: juce_MemoryOutputStream.h *********/ +#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ +#define __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ -/** - Represents a URL and has a bunch of useful functions to manipulate it. +/** Writes data to an internal memory buffer, which grows as required. - This class can be used to launch URLs in browsers, and also to create - InputStreams that can read from remote http or ftp sources. + The data that was written into the stream can then be accessed later as + a contiguous block of memory. */ -class JUCE_API URL +class JUCE_API MemoryOutputStream : public OutputStream { public: - /** Creates an empty URL. */ - URL() throw(); - - /** Creates a URL from a string. */ - URL (const String& url); - - /** Creates a copy of another URL. */ - URL (const URL& other); - - /** Destructor. */ - ~URL() throw(); - - /** Copies this URL from another one. */ - const URL& operator= (const URL& other); - - /** Returns a string version of the URL. - - If includeGetParameters is true and any parameters have been set with the - withParameter() method, then the string will have these appended on the - end and url-encoded. - */ - const String toString (const bool includeGetParameters) const; - - /** True if it seems to be valid. */ - bool isWellFormed() const; - - /** Returns a copy of this URL, with a GET parameter added to the end. - - Any control characters in the value will be encoded. - - e.g. calling "withParameter ("amount", "some fish") for the url "www.fish.com" - would produce a new url whose toString(true) method would return - "www.fish.com?amount=some+fish". - */ - const URL withParameter (const String& parameterName, - const String& parameterValue) const; - - /** Returns a copy of this URl, with a file-upload type parameter added to it. - - When performing a POST where one of your parameters is a binary file, this - lets you specify the file. - - Note that the filename is stored, but the file itself won't actually be read - until this URL is later used to create a network input stream. - */ - const URL withFileToUpload (const String& parameterName, - const File& fileToUpload, - const String& mimeType) const; - - /** Returns a set of all the parameters encoded into the url. - - E.g. for the url "www.fish.com?type=haddock&amount=some+fish", this array would - contain two pairs: "type" => "haddock" and "amount" => "some fish". - - The values returned will have been cleaned up to remove any escape characters. - - @see getNamedParameter, withParameter - */ - const StringPairArray& getParameters() const throw(); - - /** Returns the set of files that should be uploaded as part of a POST operation. - - This is the set of files that were added to the URL with the withFileToUpload() - method. - */ - const StringPairArray& getFilesToUpload() const throw(); - - /** Returns the set of mime types associated with each of the upload files. - */ - const StringPairArray& getMimeTypesOfUploadFiles() const throw(); - - /** Tries to launch the system's default browser to open the URL. - - Returns true if this seems to have worked. - */ - bool launchInDefaultBrowser() const; - - /** Takes a guess as to whether a string might be a valid website address. - - This isn't foolproof! - */ - static bool isProbablyAWebsiteURL (const String& possibleURL); - - /** Takes a guess as to whether a string might be a valid email address. + /** Creates a memory stream ready for writing into. - This isn't foolproof! + @param initialSize the intial amount of space to allocate for writing into + @param granularity the increments by which the internal storage will be increased + @param memoryBlockToWriteTo if this is non-zero, then this block will be used as the + place that the data gets stored. If it's zero, the stream + will allocate its own storage internally, which you can + access using getData() and getDataSize() */ - static bool isProbablyAnEmailAddress (const String& possibleEmailAddress); + MemoryOutputStream (const int initialSize = 256, + const int granularity = 256, + MemoryBlock* const memoryBlockToWriteTo = 0) throw(); - /** This callback function can be used by the createInputStream() method. + /** Destructor. - It allows your app to receive progress updates during a lengthy POST operation. If you - want to continue the operation, this should return true, or false to abort. + This will free any data that was written to it. */ - typedef bool (OpenStreamProgressCallback) (void* context, int bytesSent, int totalBytes); + ~MemoryOutputStream() throw(); - /** Attempts to open a stream that can read from this URL. + /** Returns a pointer to the data that has been written to the stream. - @param usePostCommand if true, it will try to do use a http 'POST' to pass - the paramters, otherwise it'll encode them into the - URL and do a 'GET'. - @param progressCallback if this is non-zero, it lets you supply a callback function - to keep track of the operation's progress. This can be useful - for lengthy POST operations, so that you can provide user feedback. - @param progressCallbackContext if a callback is specified, this value will be passed to - the function - @param extraHeaders if not empty, this string is appended onto the headers that - are used for the request. It must therefore be a valid set of HTML - header directives, separated by newlines. - @param connectionTimeOutMs if 0, this will use whatever default setting the OS chooses. If - a negative number, it will be infinite. Otherwise it specifies a - time in milliseconds. + @see getDataSize */ - InputStream* createInputStream (const bool usePostCommand, - OpenStreamProgressCallback* const progressCallback = 0, - void* const progressCallbackContext = 0, - const String& extraHeaders = String::empty, - const int connectionTimeOutMs = 0) const; - - /** Tries to download the entire contents of this URL into a binary data block. + const char* getData() throw(); - If it succeeds, this will return true and append the data it read onto the end - of the memory block. + /** Returns the number of bytes of data that have been written to the stream. - @param destData the memory block to append the new data to - @param usePostCommand whether to use a POST command to get the data (uses - a GET command if this is false) - @see readEntireTextStream, readEntireXmlStream + @see getData */ - bool readEntireBinaryStream (MemoryBlock& destData, - const bool usePostCommand = false) const; - - /** Tries to download the entire contents of this URL as a string. + int getDataSize() const throw(); - If it fails, this will return an empty string, otherwise it will return the - contents of the downloaded file. If you need to distinguish between a read - operation that fails and one that returns an empty string, you'll need to use - a different method, such as readEntireBinaryStream(). + /** Resets the stream, clearing any data that has been written to it so far. */ + void reset() throw(); - @param usePostCommand whether to use a POST command to get the data (uses - a GET command if this is false) - @see readEntireBinaryStream, readEntireXmlStream - */ - const String readEntireTextStream (const bool usePostCommand = false) const; + void flush(); + bool write (const void* buffer, int howMany); + int64 getPosition(); + bool setPosition (int64 newPosition); - /** Tries to download the entire contents of this URL and parse it as XML. + juce_UseDebuggingNewOperator - If it fails, or if the text that it reads can't be parsed as XML, this will - return 0. +private: + MemoryBlock* data; + int position, size, blockSize; + bool ownsMemoryBlock; +}; - When it returns a valid XmlElement object, the caller is responsibile for deleting - this object when no longer needed. +#endif // __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ +/********* End of inlined file: juce_MemoryOutputStream.h *********/ - @param usePostCommand whether to use a POST command to get the data (uses - a GET command if this is false) +#endif +#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ - @see readEntireBinaryStream, readEntireTextStream - */ - XmlElement* readEntireXmlStream (const bool usePostCommand = false) const; +/********* Start of inlined file: juce_SubregionStream.h *********/ +#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ +#define __JUCE_SUBREGIONSTREAM_JUCEHEADER__ - /** Adds escape sequences to a string to encode any characters that aren't - legal in a URL. +/** Wraps another input stream, and reads from a specific part of it. - E.g. any spaces will be replaced with "%20". + This lets you take a subsection of a stream and present it as an entire + stream in its own right. +*/ +class JUCE_API SubregionStream : public InputStream +{ +public: - This is the opposite of removeEscapeChars(). + /** Creates a SubregionStream from an input source. - @see removeEscapeChars + @param sourceStream the source stream to read from + @param startPositionInSourceStream this is the position in the source stream that + corresponds to position 0 in this stream + @param lengthOfSourceStream this specifies the maximum number of bytes + from the source stream that will be passed through + by this stream. When the position of this stream + exceeds lengthOfSourceStream, it will cause an end-of-stream. + If the length passed in here is greater than the length + of the source stream (as returned by getTotalLength()), + then the smaller value will be used. + Passing a negative value for this parameter means it + will keep reading until the source's end-of-stream. + @param deleteSourceWhenDestroyed whether the sourceStream that is passed in should be + deleted by this object when it is itself deleted. */ - static const String addEscapeChars (const String& stringToAddEscapeCharsTo); - - /** Replaces any escape character sequences in a string with their original - character codes. - - E.g. any instances of "%20" will be replaced by a space. + SubregionStream (InputStream* const sourceStream, + const int64 startPositionInSourceStream, + const int64 lengthOfSourceStream, + const bool deleteSourceWhenDestroyed) throw(); - This is the opposite of addEscapeChars(). + /** Destructor. - @see addEscapeChars + This may also delete the source stream, if that option was chosen when the + buffered stream was created. */ - static const String removeEscapeChars (const String& stringToRemoveEscapeCharsFrom); + ~SubregionStream() throw(); + + int64 getTotalLength(); + int64 getPosition(); + bool setPosition (int64 newPosition); + int read (void* destBuffer, int maxBytesToRead); + bool isExhausted(); juce_UseDebuggingNewOperator private: - String url; - StringPairArray parameters, filesToUpload, mimeTypes; + InputStream* const source; + const bool deleteSourceWhenDestroyed; + const int64 startPositionInSourceStream, lengthOfSourceStream; + + SubregionStream (const SubregionStream&); + const SubregionStream& operator= (const SubregionStream&); }; -#endif // __JUCE_URL_JUCEHEADER__ -/********* End of inlined file: juce_URL.h *********/ +#endif // __JUCE_SUBREGIONSTREAM_JUCEHEADER__ +/********* End of inlined file: juce_SubregionStream.h *********/ #endif #ifndef __JUCE_BUFFEREDINPUTSTREAM_JUCEHEADER__ @@ -12504,6 +12688,9 @@ private: #endif // __JUCE_FILEINPUTSOURCE_JUCEHEADER__ /********* End of inlined file: juce_FileInputSource.h *********/ +#endif +#ifndef __JUCE_INPUTSOURCE_JUCEHEADER__ + #endif #ifndef __JUCE_GZIPCOMPRESSOROUTPUTSTREAM_JUCEHEADER__ @@ -12626,9 +12813,6 @@ private: #endif // __JUCE_GZIPDECOMPRESSORINPUTSTREAM_JUCEHEADER__ /********* End of inlined file: juce_GZIPDecompressorInputStream.h *********/ -#endif -#ifndef __JUCE_INPUTSOURCE_JUCEHEADER__ - #endif #ifndef __JUCE_MEMORYINPUTSTREAM_JUCEHEADER__ @@ -12681,135 +12865,97 @@ private: /********* End of inlined file: juce_MemoryInputStream.h *********/ #endif -#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ +#ifndef __JUCE_UUID_JUCEHEADER__ -/********* Start of inlined file: juce_MemoryOutputStream.h *********/ -#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ -#define __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ +/********* Start of inlined file: juce_Uuid.h *********/ +#ifndef __JUCE_UUID_JUCEHEADER__ +#define __JUCE_UUID_JUCEHEADER__ -/** Writes data to an internal memory buffer, which grows as required. +/** + A universally unique 128-bit identifier. - The data that was written into the stream can then be accessed later as - a contiguous block of memory. + This class generates very random unique numbers based on the system time + and MAC addresses if any are available. It's extremely unlikely that two identical + UUIDs would ever be created by chance. + + The class includes methods for saving the ID as a string or as raw binary data. */ -class JUCE_API MemoryOutputStream : public OutputStream +class JUCE_API Uuid { public: - /** Creates a memory stream ready for writing into. - - @param initialSize the intial amount of space to allocate for writing into - @param granularity the increments by which the internal storage will be increased - @param memoryBlockToWriteTo if this is non-zero, then this block will be used as the - place that the data gets stored. If it's zero, the stream - will allocate its own storage internally, which you can - access using getData() and getDataSize() - */ - MemoryOutputStream (const int initialSize = 256, - const int granularity = 256, - MemoryBlock* const memoryBlockToWriteTo = 0) throw(); - - /** Destructor. - - This will free any data that was written to it. - */ - ~MemoryOutputStream() throw(); + /** Creates a new unique ID. */ + Uuid(); - /** Returns a pointer to the data that has been written to the stream. + /** Destructor. */ + ~Uuid() throw(); - @see getDataSize - */ - const char* getData() throw(); + /** Creates a copy of another UUID. */ + Uuid (const Uuid& other); - /** Returns the number of bytes of data that have been written to the stream. + /** Copies another UUID. */ + Uuid& operator= (const Uuid& other); - @see getData - */ - int getDataSize() const throw(); + /** Returns true if the ID is zero. */ + bool isNull() const throw(); - /** Resets the stream, clearing any data that has been written to it so far. */ - void reset() throw(); + /** Compares two UUIDs. */ + bool operator== (const Uuid& other) const; - void flush(); - bool write (const void* buffer, int howMany); - int64 getPosition(); - bool setPosition (int64 newPosition); + /** Compares two UUIDs. */ + bool operator!= (const Uuid& other) const; - juce_UseDebuggingNewOperator + /** Returns a stringified version of this UUID. -private: - MemoryBlock* data; - int position, size, blockSize; - bool ownsMemoryBlock; -}; + A Uuid object can later be reconstructed from this string using operator= or + the constructor that takes a string parameter. -#endif // __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ -/********* End of inlined file: juce_MemoryOutputStream.h *********/ + @returns a 32 character hex string. + */ + const String toString() const; -#endif -#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ + /** Creates an ID from an encoded string version. -/********* Start of inlined file: juce_SubregionStream.h *********/ -#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ -#define __JUCE_SUBREGIONSTREAM_JUCEHEADER__ + @see toString + */ + Uuid (const String& uuidString); -/** Wraps another input stream, and reads from a specific part of it. + /** Copies from a stringified UUID. - This lets you take a subsection of a stream and present it as an entire - stream in its own right. -*/ -class JUCE_API SubregionStream : public InputStream -{ -public: + The string passed in should be one that was created with the toString() method. + */ + Uuid& operator= (const String& uuidString); - /** Creates a SubregionStream from an input source. + /** Returns a pointer to the internal binary representation of the ID. - @param sourceStream the source stream to read from - @param startPositionInSourceStream this is the position in the source stream that - corresponds to position 0 in this stream - @param lengthOfSourceStream this specifies the maximum number of bytes - from the source stream that will be passed through - by this stream. When the position of this stream - exceeds lengthOfSourceStream, it will cause an end-of-stream. - If the length passed in here is greater than the length - of the source stream (as returned by getTotalLength()), - then the smaller value will be used. - Passing a negative value for this parameter means it - will keep reading until the source's end-of-stream. - @param deleteSourceWhenDestroyed whether the sourceStream that is passed in should be - deleted by this object when it is itself deleted. + This is an array of 16 bytes. To reconstruct a Uuid from its data, use + the constructor or operator= method that takes an array of uint8s. */ - SubregionStream (InputStream* const sourceStream, - const int64 startPositionInSourceStream, - const int64 lengthOfSourceStream, - const bool deleteSourceWhenDestroyed) throw(); + const uint8* getRawData() const throw() { return value.asBytes; } - /** Destructor. + /** Creates a UUID from a 16-byte array. - This may also delete the source stream, if that option was chosen when the - buffered stream was created. + @see getRawData */ - ~SubregionStream() throw(); + Uuid (const uint8* const rawData); - int64 getTotalLength(); - int64 getPosition(); - bool setPosition (int64 newPosition); - int read (void* destBuffer, int maxBytesToRead); - bool isExhausted(); + /** Sets this UUID from 16-bytes of raw data. */ + Uuid& operator= (const uint8* const rawData); juce_UseDebuggingNewOperator private: - InputStream* const source; - const bool deleteSourceWhenDestroyed; - const int64 startPositionInSourceStream, lengthOfSourceStream; + union + { + uint8 asBytes [16]; + int asInt[4]; + int64 asInt64[2]; - SubregionStream (const SubregionStream&); - const SubregionStream& operator= (const SubregionStream&); + } value; }; -#endif // __JUCE_SUBREGIONSTREAM_JUCEHEADER__ -/********* End of inlined file: juce_SubregionStream.h *********/ +#endif // __JUCE_UUID_JUCEHEADER__ +/********* End of inlined file: juce_Uuid.h *********/ #endif #ifndef __JUCE_PERFORMANCECOUNTER_JUCEHEADER__ @@ -12894,6 +13040,142 @@ private: #endif // __JUCE_PERFORMANCECOUNTER_JUCEHEADER__ /********* End of inlined file: juce_PerformanceCounter.h *********/ +#endif +#ifndef __JUCE_ZIPFILE_JUCEHEADER__ + +/********* Start of inlined file: juce_ZipFile.h *********/ +#ifndef __JUCE_ZIPFILE_JUCEHEADER__ +#define __JUCE_ZIPFILE_JUCEHEADER__ + +/** + Decodes a ZIP file from a stream. + + This can enumerate the items in a ZIP file and can create suitable stream objects + to read each one. +*/ +class JUCE_API ZipFile +{ +public: + + /** Creates a ZipFile for a given stream. + + @param inputStream the stream to read from + @param deleteStreamWhenDestroyed if set to true, the object passed-in + will be deleted when this ZipFile object is deleted + */ + ZipFile (InputStream* const inputStream, + const bool deleteStreamWhenDestroyed) throw(); + + /** Creates a ZipFile based for a file. */ + ZipFile (const File& file); + + /** Creates a ZipFile for an input source. + + The inputSource object will be owned by the zip file, which will delete + it later when not needed. + */ + ZipFile (InputSource* const inputSource); + + /** Destructor. */ + ~ZipFile() throw(); + + /** + Contains information about one of the entries in a ZipFile. + + @see ZipFile::getEntry + */ + struct ZipEntry + { + /** The name of the file, which may also include a partial pathname. */ + String filename; + + /** The file's original size. */ + unsigned int uncompressedSize; + + /** The last time the file was modified. */ + Time fileTime; + }; + + /** Returns the number of items in the zip file. */ + int getNumEntries() const throw(); + + /** Returns a structure that describes one of the entries in the zip file. + + This may return zero if the index is out of range. + + @see ZipFile::ZipEntry + */ + const ZipEntry* getEntry (const int index) const throw(); + + /** Returns the index of the first entry with a given filename. + + This uses a case-sensitive comparison to look for a filename in the + list of entries. It might return -1 if no match is found. + + @see ZipFile::ZipEntry + */ + int getIndexOfFileName (const String& fileName) const throw(); + + /** Returns a structure that describes one of the entries in the zip file. + + This uses a case-sensitive comparison to look for a filename in the + list of entries. It might return 0 if no match is found. + + @see ZipFile::ZipEntry + */ + const ZipEntry* getEntry (const String& fileName) const throw(); + + /** Sorts the list of entries, based on the filename. + */ + void sortEntriesByFilename(); + + /** Creates a stream that can read from one of the zip file's entries. + + The stream that is returned must be deleted by the caller (and + zero might be returned if a stream can't be opened for some reason). + + The stream must not be used after the ZipFile object that created + has been deleted. + */ + InputStream* createStreamForEntry (const int index); + + /** Uncompresses all of the files in the zip file. + + This will expand all the entires into a target directory. The relative + paths of the entries are used. + + @param targetDirectory the root folder to uncompress to + @param shouldOverwriteFiles whether to overwrite existing files with similarly-named ones + */ + void uncompressTo (const File& targetDirectory, + const bool shouldOverwriteFiles = true); + + juce_UseDebuggingNewOperator + +private: + VoidArray entries; + friend class ZipInputStream; + CriticalSection lock; + InputStream* inputStream; + InputSource* inputSource; + + bool deleteStreamWhenDestroyed; + int numEntries, centralRecStart; + +#ifdef JUCE_DEBUG + int numOpenStreams; +#endif + + void init(); + int findEndOfZipEntryTable (InputStream* in); + + ZipFile (const ZipFile&); + const ZipFile& operator= (const ZipFile&); +}; + +#endif // __JUCE_ZIPFILE_JUCEHEADER__ +/********* End of inlined file: juce_ZipFile.h *********/ + #endif #ifndef __JUCE_PLATFORMUTILITIES_JUCEHEADER__ @@ -12919,23 +13201,12 @@ public: #if JUCE_MAC || DOXYGEN - /** MAC ONLY - Turns a String into a pascal string. */ - static void copyToStr255 (Str255& d, const String& s); - /** MAC ONLY - Turns a String into a pascal string. */ - static void copyToStr63 (Str63& d, const String& s); - /** MAC ONLY - Turns a Core CF String into a juce one. */ static const String cfStringToJuceString (CFStringRef cfString); /** MAC ONLY - Turns a juce string into a Core CF one. */ static CFStringRef juceStringToCFString (const String& s); - /** MAC ONLY - Converts a UTF16 string to a Juce String. */ - static const String convertUTF16ToString (const UniChar* utf16); - - /** MAC ONLY - Turns a file path into an FSSpec, returning true if it succeeds. */ - static bool makeFSSpecFromPath (FSSpec* destFSSpec, const String& path); - /** MAC ONLY - Turns a file path into an FSRef, returning true if it succeeds. */ static bool makeFSRefFromPath (FSRef* destFSRef, const String& path); @@ -13015,6 +13286,35 @@ public: */ static void fpuReset(); +#if JUCE_LINUX || JUCE_WIN32 + + /** Loads a dynamically-linked library into the process's address space. + + @param pathOrFilename the platform-dependent name and search path + @returns a handle which can be used by getProcedureEntryPoint(), or + zero if it fails. + @see freeDynamicLibrary, getProcedureEntryPoint + */ + static void* loadDynamicLibrary (const String& pathOrFilename); + + /** Frees a dynamically-linked library. + + @param libraryHandle a handle created by loadDynamicLibrary + @see loadDynamicLibrary, getProcedureEntryPoint + */ + static void freeDynamicLibrary (void* libraryHandle); + + /** Finds a procedure call in a dynamically-linked library. + + @param libraryHandle a library handle returned by loadDynamicLibrary + @param procedureName the name of the procedure call to try to load + @returns a pointer to the function if found, or 0 if it fails + @see loadDynamicLibrary + */ + static void* getProcedureEntryPoint (void* libraryHandle, + const String& procedureName); +#endif + #if JUCE_LINUX || DOXYGEN #endif @@ -13022,6 +13322,19 @@ public: #if JUCE_MAC +/** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object + using RAII. +*/ +class ScopedAutoReleasePool +{ +public: + ScopedAutoReleasePool(); + ~ScopedAutoReleasePool(); + +private: + void* pool; +}; + /** A wrapper class for picking up events from an Apple IR remote control device. @@ -13065,802 +13378,1023 @@ public: /** Starts the device running and responding to events. - Returns true if it managed to open the device. + Returns true if it managed to open the device. + + @param inExclusiveMode if true, the remote will be grabbed exclusively for this app, + and will not be available to any other part of the system. If + false, it will be shared with other apps. + @see stop + */ + bool start (const bool inExclusiveMode) throw(); + + /** Stops the device running. + @see start + */ + void stop() throw(); + + /** Returns true if the device has been started successfully. + */ + bool isActive() const throw(); + + /** Returns the ID number of the remote, if it has sent one. + */ + int getRemoteId() const throw() { return remoteId; } + + juce_UseDebuggingNewOperator + + /** @internal */ + void handleCallbackInternal(); + +private: + void* device; + void* queue; + int remoteId; + + bool open (const bool openInExclusiveMode) throw(); +}; + +#endif + +#endif // __JUCE_PLATFORMUTILITIES_JUCEHEADER__ +/********* End of inlined file: juce_PlatformUtilities.h *********/ + +#endif +#ifndef __JUCE_XMLELEMENT_JUCEHEADER__ + +#endif +#ifndef __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__ + +#endif +#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ + +#endif +#ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ + +/********* Start of inlined file: juce_LocalisedStrings.h *********/ +#ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ +#define __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ + +/** Used in the same way as the T(text) macro, this will attempt to translate a + string into a localised version using the LocalisedStrings class. + + @see LocalisedStrings +*/ +#define TRANS(stringLiteral) \ + LocalisedStrings::translateWithCurrentMappings (stringLiteral) + +/** + Used to convert strings to localised foreign-language versions. + + This is basically a look-up table of strings and their translated equivalents. + It can be loaded from a text file, so that you can supply a set of localised + versions of strings that you use in your app. + + To use it in your code, simply call the translate() method on each string that + might have foreign versions, and if none is found, the method will just return + the original string. + + The translation file should start with some lines specifying a description of + the language it contains, and also a list of ISO country codes where it might + be appropriate to use the file. After that, each line of the file should contain + a pair of quoted strings with an '=' sign. + + E.g. for a french translation, the file might be: + + @code + language: French + countries: fr be mc ch lu + + "hello" = "bonjour" + "goodbye" = "au revoir" + @endcode + + If the strings need to contain a quote character, they can use '\"' instead, and + if the first non-whitespace character on a line isn't a quote, then it's ignored, + (you can use this to add comments). + + Note that this is a singleton class, so don't create or destroy the object directly. + There's also a TRANS(text) macro defined to make it easy to use the this. + + E.g. @code + printSomething (TRANS("hello")); + @endcode + + This macro is used in the Juce classes themselves, so your application has a chance to + intercept and translate any internal Juce text strings that might be shown. (You can easily + get a list of all the messages by searching for the TRANS() macro in the Juce source + code). +*/ +class JUCE_API LocalisedStrings +{ +public: + + /** Creates a set of translations from the text of a translation file. + + When you create one of these, you can call setCurrentMappings() to make it + the set of mappings that the system's using. + */ + LocalisedStrings (const String& fileContents) throw(); + + /** Creates a set of translations from a file. + + When you create one of these, you can call setCurrentMappings() to make it + the set of mappings that the system's using. + */ + LocalisedStrings (const File& fileToLoad) throw(); + + /** Destructor. */ + ~LocalisedStrings() throw(); + + /** Selects the current set of mappings to be used by the system. + + The object you pass in will be automatically deleted when no longer needed, so + don't keep a pointer to it. You can also pass in zero to remove the current + mappings. + + See also the TRANS() macro, which uses the current set to do its translation. + + @see translateWithCurrentMappings + */ + static void setCurrentMappings (LocalisedStrings* newTranslations) throw(); + + /** Returns the currently selected set of mappings. + + This is the object that was last passed to setCurrentMappings(). It may + be 0 if none has been created. + */ + static LocalisedStrings* getCurrentMappings() throw(); + + /** Tries to translate a string using the currently selected set of mappings. + + If no mapping has been set, or if the mapping doesn't contain a translation + for the string, this will just return the original string. + + See also the TRANS() macro, which uses this method to do its translation. + + @see setCurrentMappings, getCurrentMappings + */ + static const String translateWithCurrentMappings (const String& text) throw(); + + /** Tries to translate a string using the currently selected set of mappings. + + If no mapping has been set, or if the mapping doesn't contain a translation + for the string, this will just return the original string. + + See also the TRANS() macro, which uses this method to do its translation. - @param inExclusiveMode if true, the remote will be grabbed exclusively for this app, - and will not be available to any other part of the system. If - false, it will be shared with other apps. - @see stop + @see setCurrentMappings, getCurrentMappings */ - bool start (const bool inExclusiveMode) throw(); + static const String translateWithCurrentMappings (const char* text) throw(); - /** Stops the device running. - @see start + /** Attempts to look up a string and return its localised version. + + If the string isn't found in the list, the original string will be returned. */ - void stop() throw(); + const String translate (const String& text) const throw(); - /** Returns true if the device has been started successfully. + /** Returns the name of the language specified in the translation file. + + This is specified in the file using a line starting with "language:", e.g. + @code + language: german + @endcode */ - bool isActive() const throw(); + const String getLanguageName() const throw() { return languageName; } - /** Returns the ID number of the remote, if it has sent one. + /** Returns the list of suitable country codes listed in the translation file. + + These is specified in the file using a line starting with "countries:", e.g. + @code + countries: fr be mc ch lu + @endcode + + The country codes are supposed to be 2-character ISO complient codes. */ - int getRemoteId() const throw() { return remoteId; } + const StringArray getCountryCodes() const throw() { return countryCodes; } juce_UseDebuggingNewOperator - /** @internal */ - void handleCallbackInternal(); - private: - void* device; - void* queue; - int remoteId; + String languageName; + StringArray countryCodes; + StringPairArray translations; - bool open (const bool openInExclusiveMode) throw(); + void loadFromText (const String& fileContents) throw(); }; -#endif - -#endif // __JUCE_PLATFORMUTILITIES_JUCEHEADER__ -/********* End of inlined file: juce_PlatformUtilities.h *********/ +#endif // __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ +/********* End of inlined file: juce_LocalisedStrings.h *********/ #endif -#ifndef __JUCE_UUID_JUCEHEADER__ +#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ -/********* Start of inlined file: juce_Uuid.h *********/ -#ifndef __JUCE_UUID_JUCEHEADER__ -#define __JUCE_UUID_JUCEHEADER__ +/********* Start of inlined file: juce_XmlDocument.h *********/ +#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ +#define __JUCE_XMLDOCUMENT_JUCEHEADER__ /** - A universally unique 128-bit identifier. + Parses a text-based XML document and creates an XmlElement object from it. - This class generates very random unique numbers based on the system time - and MAC addresses if any are available. It's extremely unlikely that two identical - UUIDs would ever be created by chance. + The parser will parse DTDs to load external entities but won't + check the document for validity against the DTD. - The class includes methods for saving the ID as a string or as raw binary data. -*/ -class JUCE_API Uuid -{ -public: + e.g. + @code - /** Creates a new unique ID. */ - Uuid(); + XmlDocument myDocument (File ("myfile.xml")); + XmlElement* mainElement = myDocument.getDocumentElement(); - /** Destructor. */ - ~Uuid() throw(); + if (mainElement == 0) + { + String error = myDocument.getLastParseError(); + } + else + { + ..use the element + } - /** Creates a copy of another UUID. */ - Uuid (const Uuid& other); + @endcode - /** Copies another UUID. */ - Uuid& operator= (const Uuid& other); + @see XmlElement +*/ +class JUCE_API XmlDocument +{ +public: - /** Returns true if the ID is zero. */ - bool isNull() const throw(); + /** Creates an XmlDocument from the xml text. - /** Compares two UUIDs. */ - bool operator== (const Uuid& other) const; + The text doesn't actually get parsed until the getDocumentElement() method is + called. + */ + XmlDocument (const String& documentText) throw(); - /** Compares two UUIDs. */ - bool operator!= (const Uuid& other) const; + /** Creates an XmlDocument from a file. - /** Returns a stringified version of this UUID. + The text doesn't actually get parsed until the getDocumentElement() method is + called. + */ + XmlDocument (const File& file); - A Uuid object can later be reconstructed from this string using operator= or - the constructor that takes a string parameter. + /** Destructor. */ + ~XmlDocument() throw(); - @returns a 32 character hex string. - */ - const String toString() const; + /** Creates an XmlElement object to represent the main document node. - /** Creates an ID from an encoded string version. + This method will do the actual parsing of the text, and if there's a + parse error, it may returns 0 (and you can find out the error using + the getLastParseError() method). - @see toString + @param onlyReadOuterDocumentElement if true, the parser will only read the + first section of the file, and will only + return the outer document element - this + allows quick checking of large files to + see if they contain the correct type of + tag, without having to parse the entire file + @returns a new XmlElement which the caller will need to delete, or null if + there was an error. + @see getLastParseError */ - Uuid (const String& uuidString); + XmlElement* getDocumentElement (const bool onlyReadOuterDocumentElement = false); - /** Copies from a stringified UUID. + /** Returns the parsing error that occurred the last time getDocumentElement was called. - The string passed in should be one that was created with the toString() method. + @returns the error, or an empty string if there was no error. */ - Uuid& operator= (const String& uuidString); + const String& getLastParseError() const throw(); - /** Returns a pointer to the internal binary representation of the ID. + /** Sets an input source object to use for parsing documents that reference external entities. - This is an array of 16 bytes. To reconstruct a Uuid from its data, use - the constructor or operator= method that takes an array of uint8s. - */ - const uint8* getRawData() const throw() { return value.asBytes; } + If the document has been created from a file, this probably won't be needed, but + if you're parsing some text and there might be a DTD that references external + files, you may need to create a custom input source that can retrieve the + other files it needs. - /** Creates a UUID from a 16-byte array. + The object that is passed-in will be deleted automatically when no longer needed. - @see getRawData + @see InputSource */ - Uuid (const uint8* const rawData); - - /** Sets this UUID from 16-bytes of raw data. */ - Uuid& operator= (const uint8* const rawData); + void setInputSource (InputSource* const newSource) throw(); juce_UseDebuggingNewOperator private: - union - { - uint8 asBytes [16]; - int asInt[4]; - int64 asInt64[2]; + String originalText; + const tchar* input; + bool outOfData, errorOccurred; - } value; + bool identifierLookupTable [128]; + String lastError, dtdText; + StringArray tokenisedDTD; + bool needToLoadDTD; + InputSource* inputSource; + + void setLastError (const String& desc, const bool carryOn) throw(); + void skipHeader() throw(); + void skipNextWhiteSpace() throw(); + tchar readNextChar() throw(); + XmlElement* readNextElement (const bool alsoParseSubElements) throw(); + void readChildElements (XmlElement* parent) throw(); + int findNextTokenLength() throw(); + void readQuotedString (String& result) throw(); + void readEntity (String& result) throw(); + + const String getFileContents (const String& filename) const; + const String expandEntity (const String& entity); + const String expandExternalEntity (const String& entity); + const String getParameterEntity (const String& entity); }; -#endif // __JUCE_UUID_JUCEHEADER__ -/********* End of inlined file: juce_Uuid.h *********/ +#endif // __JUCE_XMLDOCUMENT_JUCEHEADER__ +/********* End of inlined file: juce_XmlDocument.h *********/ #endif -#ifndef __JUCE_ZIPFILE_JUCEHEADER__ +#ifndef __JUCE_STRINGPAIRARRAY_JUCEHEADER__ -/********* Start of inlined file: juce_ZipFile.h *********/ -#ifndef __JUCE_ZIPFILE_JUCEHEADER__ -#define __JUCE_ZIPFILE_JUCEHEADER__ +#endif +#ifndef __JUCE_STRING_JUCEHEADER__ + +#endif +#ifndef __JUCE_THREADPOOL_JUCEHEADER__ + +/********* Start of inlined file: juce_ThreadPool.h *********/ +#ifndef __JUCE_THREADPOOL_JUCEHEADER__ +#define __JUCE_THREADPOOL_JUCEHEADER__ + +/********* Start of inlined file: juce_Thread.h *********/ +#ifndef __JUCE_THREAD_JUCEHEADER__ +#define __JUCE_THREAD_JUCEHEADER__ + +/********* Start of inlined file: juce_WaitableEvent.h *********/ +#ifndef __JUCE_WAITABLEEVENT_JUCEHEADER__ +#define __JUCE_WAITABLEEVENT_JUCEHEADER__ /** - Decodes a ZIP file from a stream. + Allows threads to wait for events triggered by other threads. - This can enumerate the items in a ZIP file and can create suitable stream objects - to read each one. + A thread can call wait() on a WaitableObject, and this will suspend the + calling thread until another thread wakes it up by calling the signal() + method. */ -class JUCE_API ZipFile +class JUCE_API WaitableEvent { public: - /** Creates a ZipFile for a given stream. + /** Creates a WaitableEvent object. */ + WaitableEvent() throw(); - @param inputStream the stream to read from - @param deleteStreamWhenDestroyed if set to true, the object passed-in - will be deleted when this ZipFile object is deleted + /** Destructor. + + If other threads are waiting on this object when it gets deleted, this + can cause nasty errors, so be careful! */ - ZipFile (InputStream* const inputStream, - const bool deleteStreamWhenDestroyed) throw(); + ~WaitableEvent() throw(); - /** Creates a ZipFile based for a file. */ - ZipFile (const File& file); + /** Suspends the calling thread until the event has been signalled. - /** Creates a ZipFile for an input source. + This will wait until the object's signal() method is called by another thread, + or until the timeout expires. - The inputSource object will be owned by the zip file, which will delete - it later when not needed. + After the event has been signalled, this method will return true and reset + the event. + + @param timeOutMilliseconds the maximum time to wait, in milliseconds. A negative + value will cause it to wait forever. + + @returns true if the object has been signalled, false if the timeout expires first. + @see signal, reset */ - ZipFile (InputSource* const inputSource); + bool wait (const int timeOutMilliseconds = -1) const throw(); - /** Destructor. */ - ~ZipFile() throw(); + /** Wakes up any threads that are currently waiting on this object. - /** - Contains information about one of the entries in a ZipFile. + If signal() is called when nothing is waiting, the next thread to call wait() + will return immediately and reset the signal. - @see ZipFile::getEntry + @see wait, reset */ - struct ZipEntry - { - /** The name of the file, which may also include a partial pathname. */ - String filename; + void signal() const throw(); - /** The file's original size. */ - unsigned int uncompressedSize; + /** Resets the event to an unsignalled state. - /** The last time the file was modified. */ - Time fileTime; - }; + If it's not already signalled, this does nothing. + */ + void reset() const throw(); - /** Returns the number of items in the zip file. */ - int getNumEntries() const throw(); + juce_UseDebuggingNewOperator - /** Returns a structure that describes one of the entries in the zip file. +private: + void* internal; - This may return zero if the index is out of range. + WaitableEvent (const WaitableEvent&); + const WaitableEvent& operator= (const WaitableEvent&); +}; - @see ZipFile::ZipEntry - */ - const ZipEntry* getEntry (const int index) const throw(); +#endif // __JUCE_WAITABLEEVENT_JUCEHEADER__ +/********* End of inlined file: juce_WaitableEvent.h *********/ - /** Returns the index of the first entry with a given filename. +/** + Encapsulates a thread. - This uses a case-sensitive comparison to look for a filename in the - list of entries. It might return -1 if no match is found. + Subclasses derive from Thread and implement the run() method, in which they + do their business. The thread can then be started with the startThread() method + and controlled with various other methods. - @see ZipFile::ZipEntry - */ - int getIndexOfFileName (const String& fileName) const throw(); + This class also contains some thread-related static methods, such + as sleep(), yield(), getCurrentThreadId() etc. - /** Returns a structure that describes one of the entries in the zip file. + @see CriticalSection, WaitableEvent, Process, ThreadWithProgressWindow, + MessageManagerLock +*/ +class JUCE_API Thread +{ +public: - This uses a case-sensitive comparison to look for a filename in the - list of entries. It might return 0 if no match is found. + /** + Creates a thread. - @see ZipFile::ZipEntry + When first created, the thread is not running. Use the startThread() + method to start it. */ - const ZipEntry* getEntry (const String& fileName) const throw(); + Thread (const String& threadName); - /** Sorts the list of entries, based on the filename. + /** Destructor. + + Deleting a Thread object that is running will only give the thread a + brief opportunity to stop itself cleanly, so it's recommended that you + should always call stopThread() with a decent timeout before deleting, + to avoid the thread being forcibly killed (which is a Bad Thing). */ - void sortEntriesByFilename(); + virtual ~Thread(); - /** Creates a stream that can read from one of the zip file's entries. + /** Must be implemented to perform the thread's actual code. - The stream that is returned must be deleted by the caller (and - zero might be returned if a stream can't be opened for some reason). + Remember that the thread must regularly check the threadShouldExit() + method whilst running, and if this returns true it should return from + the run() method as soon as possible to avoid being forcibly killed. - The stream must not be used after the ZipFile object that created - has been deleted. + @see threadShouldExit, startThread */ - InputStream* createStreamForEntry (const int index); + virtual void run() = 0; - /** Uncompresses all of the files in the zip file. + // Thread control functions.. - This will expand all the entires into a target directory. The relative - paths of the entries are used. + /** Starts the thread running. - @param targetDirectory the root folder to uncompress to - @param shouldOverwriteFiles whether to overwrite existing files with similarly-named ones + This will start the thread's run() method. + (if it's already started, startThread() won't do anything). + + @see stopThread */ - void uncompressTo (const File& targetDirectory, - const bool shouldOverwriteFiles = true); + void startThread() throw(); - juce_UseDebuggingNewOperator + /** Starts the thread with a given priority. -private: - VoidArray entries; - friend class ZipInputStream; - CriticalSection lock; - InputStream* inputStream; - InputSource* inputSource; + Launches the thread with a given priority, where 0 = lowest, 10 = highest. + If the thread is already running, its priority will be changed. - bool deleteStreamWhenDestroyed; - int numEntries, centralRecStart; + @see startThread, setPriority + */ + void startThread (const int priority) throw(); -#ifdef JUCE_DEBUG - int numOpenStreams; -#endif + /** Attempts to stop the thread running. - void init(); - int findEndOfZipEntryTable (InputStream* in); + This method will cause the threadShouldExit() method to return true + and call notify() in case the thread is currently waiting. - ZipFile (const ZipFile&); - const ZipFile& operator= (const ZipFile&); -}; + Hopefully the thread will then respond to this by exiting cleanly, and + the stopThread method will wait for a given time-period for this to + happen. -#endif // __JUCE_ZIPFILE_JUCEHEADER__ -/********* End of inlined file: juce_ZipFile.h *********/ + If the thread is stuck and fails to respond after the time-out, it gets + forcibly killed, which is a very bad thing to happen, as it could still + be holding locks, etc. which are needed by other parts of your program. -#endif -#ifndef __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__ + @param timeOutMilliseconds The number of milliseconds to wait for the + thread to finish before killing it by force. A negative + value in here will wait forever. + @see signalThreadShouldExit, threadShouldExit, waitForThreadToExit, isThreadRunning + */ + void stopThread (const int timeOutMilliseconds) throw(); -#endif -#ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ + /** Returns true if the thread is currently active */ + bool isThreadRunning() const throw(); -/********* Start of inlined file: juce_LocalisedStrings.h *********/ -#ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ -#define __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ + /** Sets a flag to tell the thread it should stop. -/** Used in the same way as the T(text) macro, this will attempt to translate a - string into a localised version using the LocalisedStrings class. + Calling this means that the threadShouldExit() method will then return true. + The thread should be regularly checking this to see whether it should exit. - @see LocalisedStrings -*/ -#define TRANS(stringLiteral) \ - LocalisedStrings::translateWithCurrentMappings (stringLiteral) + @see threadShouldExit + @see waitForThreadToExit + */ + void signalThreadShouldExit() throw(); -/** - Used to convert strings to localised foreign-language versions. + /** Checks whether the thread has been told to stop running. - This is basically a look-up table of strings and their translated equivalents. - It can be loaded from a text file, so that you can supply a set of localised - versions of strings that you use in your app. + Threads need to check this regularly, and if it returns true, they should + return from their run() method at the first possible opportunity. - To use it in your code, simply call the translate() method on each string that - might have foreign versions, and if none is found, the method will just return - the original string. + @see signalThreadShouldExit + */ + inline bool threadShouldExit() const throw() { return threadShouldExit_; } - The translation file should start with some lines specifying a description of - the language it contains, and also a list of ISO country codes where it might - be appropriate to use the file. After that, each line of the file should contain - a pair of quoted strings with an '=' sign. + /** Waits for the thread to stop. - E.g. for a french translation, the file might be: + This will waits until isThreadRunning() is false or until a timeout expires. - @code - language: French - countries: fr be mc ch lu + @param timeOutMilliseconds the time to wait, in milliseconds. If this value + is less than zero, it will wait forever. + @returns true if the thread exits, or false if the timeout expires first. + */ + bool waitForThreadToExit (const int timeOutMilliseconds) const throw(); - "hello" = "bonjour" - "goodbye" = "au revoir" - @endcode + /** Changes the thread's priority. - If the strings need to contain a quote character, they can use '\"' instead, and - if the first non-whitespace character on a line isn't a quote, then it's ignored, - (you can use this to add comments). + @param priority the new priority, in the range 0 (lowest) to 10 (highest). A priority + of 5 is normal. + */ + void setPriority (const int priority) throw(); - Note that this is a singleton class, so don't create or destroy the object directly. - There's also a TRANS(text) macro defined to make it easy to use the this. + /** Changes the priority of the caller thread. - E.g. @code - printSomething (TRANS("hello")); - @endcode + Similar to setPriority(), but this static method acts on the caller thread. - This macro is used in the Juce classes themselves, so your application has a chance to - intercept and translate any internal Juce text strings that might be shown. (You can easily - get a list of all the messages by searching for the TRANS() macro in the Juce source - code). -*/ -class JUCE_API LocalisedStrings -{ -public: + @see setPriority + */ + static void setCurrentThreadPriority (const int priority) throw(); - /** Creates a set of translations from the text of a translation file. + /** Sets the affinity mask for the thread. - When you create one of these, you can call setCurrentMappings() to make it - the set of mappings that the system's using. + This will only have an effect next time the thread is started - i.e. if the + thread is already running when called, it'll have no effect. + + @see setCurrentThreadAffinityMask */ - LocalisedStrings (const String& fileContents) throw(); + void setAffinityMask (const uint32 affinityMask) throw(); - /** Creates a set of translations from a file. + /** Changes the affinity mask for the caller thread. - When you create one of these, you can call setCurrentMappings() to make it - the set of mappings that the system's using. + This will change the affinity mask for the thread that calls this static method. + + @see setAffinityMask */ - LocalisedStrings (const File& fileToLoad) throw(); + static void setCurrentThreadAffinityMask (const uint32 affinityMask) throw(); - /** Destructor. */ - ~LocalisedStrings() throw(); + // this can be called from any thread that needs to pause.. + static void JUCE_CALLTYPE sleep (int milliseconds) throw(); - /** Selects the current set of mappings to be used by the system. + /** Yields the calling thread's current time-slot. */ + static void JUCE_CALLTYPE yield() throw(); - The object you pass in will be automatically deleted when no longer needed, so - don't keep a pointer to it. You can also pass in zero to remove the current - mappings. + /** Makes the thread wait for a notification. - See also the TRANS() macro, which uses the current set to do its translation. + This puts the thread to sleep until either the timeout period expires, or + another thread calls the notify() method to wake it up. - @see translateWithCurrentMappings + @returns true if the event has been signalled, false if the timeout expires. */ - static void setCurrentMappings (LocalisedStrings* newTranslations) throw(); + bool wait (const int timeOutMilliseconds) const throw(); - /** Returns the currently selected set of mappings. + /** Wakes up the thread. - This is the object that was last passed to setCurrentMappings(). It may - be 0 if none has been created. + If the thread has called the wait() method, this will wake it up. + + @see wait */ - static LocalisedStrings* getCurrentMappings() throw(); + void notify() const throw(); - /** Tries to translate a string using the currently selected set of mappings. + /** Returns an id that identifies the caller thread. - If no mapping has been set, or if the mapping doesn't contain a translation - for the string, this will just return the original string. + To find the ID of a particular thread object, use getThreadId(). - See also the TRANS() macro, which uses this method to do its translation. + @returns a unique identifier that identifies the calling thread. + @see getThreadId + */ + static int64 getCurrentThreadId() throw(); - @see setCurrentMappings, getCurrentMappings + /** Finds the thread object that is currently running. + + Note that the main UI thread (or other non-Juce threads) don't have a Thread + object associated with them, so this will return 0. */ - static const String translateWithCurrentMappings (const String& text) throw(); + static Thread* getCurrentThread() throw(); - /** Tries to translate a string using the currently selected set of mappings. + /** Returns the ID of this thread. - If no mapping has been set, or if the mapping doesn't contain a translation - for the string, this will just return the original string. + That means the ID of this thread object - not of the thread that's calling the method. - See also the TRANS() macro, which uses this method to do its translation. + This can change when the thread is started and stopped, and will be invalid if the + thread's not actually running. - @see setCurrentMappings, getCurrentMappings + @see getCurrentThreadId */ - static const String translateWithCurrentMappings (const char* text) throw(); + int64 getThreadId() const throw(); - /** Attempts to look up a string and return its localised version. + /** Returns the name of the thread. - If the string isn't found in the list, the original string will be returned. + This is the name that gets set in the constructor. */ - const String translate (const String& text) const throw(); + const String getThreadName() const throw() { return threadName_; } - /** Returns the name of the language specified in the translation file. + /** Returns the number of currently-running threads. - This is specified in the file using a line starting with "language:", e.g. - @code - language: german - @endcode + @returns the number of Thread objects known to be currently running. + @see stopAllThreads */ - const String getLanguageName() const throw() { return languageName; } - - /** Returns the list of suitable country codes listed in the translation file. + static int getNumRunningThreads() throw(); - These is specified in the file using a line starting with "countries:", e.g. - @code - countries: fr be mc ch lu - @endcode + /** Tries to stop all currently-running threads. - The country codes are supposed to be 2-character ISO complient codes. + This will attempt to stop all the threads known to be running at the moment. */ - const StringArray getCountryCodes() const throw() { return countryCodes; } + static void stopAllThreads (const int timeoutInMillisecs) throw(); juce_UseDebuggingNewOperator private: - String languageName; - StringArray countryCodes; - StringPairArray translations; - - void loadFromText (const String& fileContents) throw(); -}; - -#endif // __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ -/********* End of inlined file: juce_LocalisedStrings.h *********/ + const String threadName_; + void* volatile threadHandle_; + CriticalSection startStopLock; + WaitableEvent startSuspensionEvent_, defaultEvent_; -#endif -#ifndef __JUCE_STRING_JUCEHEADER__ + int threadPriority_; + int64 threadId_; + uint32 affinityMask_; + bool volatile threadShouldExit_; -#endif -#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ + friend void JUCE_API juce_threadEntryPoint (void*); + static void threadEntryPoint (Thread* thread) throw(); -#endif -#ifndef __JUCE_STRINGPAIRARRAY_JUCEHEADER__ + Thread (const Thread&); + const Thread& operator= (const Thread&); +}; -#endif -#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ +#endif // __JUCE_THREAD_JUCEHEADER__ +/********* End of inlined file: juce_Thread.h *********/ -/********* Start of inlined file: juce_XmlDocument.h *********/ -#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ -#define __JUCE_XMLDOCUMENT_JUCEHEADER__ +class ThreadPool; +class ThreadPoolThread; /** - Parses a text-based XML document and creates an XmlElement object from it. - - The parser will parse DTDs to load external entities but won't - check the document for validity against the DTD. - - e.g. - @code - - XmlDocument myDocument (File ("myfile.xml")); - XmlElement* mainElement = myDocument.getDocumentElement(); + A task that is executed by a ThreadPool object. - if (mainElement == 0) - { - String error = myDocument.getLastParseError(); - } - else - { - ..use the element - } + A ThreadPool keeps a list of ThreadPoolJob objects which are executed by + its threads. - @endcode + The runJob() method needs to be implemented to do the task, and if the code that + does the work takes a significant time to run, it must keep checking the shouldExit() + method to see if something is trying to interrupt the job. If shouldExit() returns + true, the runJob() method must return immediately. - @see XmlElement + @see ThreadPool, Thread */ -class JUCE_API XmlDocument +class JUCE_API ThreadPoolJob { public: - /** Creates an XmlDocument from the xml text. - - The text doesn't actually get parsed until the getDocumentElement() method is - called. - */ - XmlDocument (const String& documentText) throw(); - - /** Creates an XmlDocument from a file. + /** Creates a thread pool job object. - The text doesn't actually get parsed until the getDocumentElement() method is - called. + After creating your job, add it to a thread pool with ThreadPool::addJob(). */ - XmlDocument (const File& file); + ThreadPoolJob (const String& name); /** Destructor. */ - ~XmlDocument() throw(); - - /** Creates an XmlElement object to represent the main document node. - - This method will do the actual parsing of the text, and if there's a - parse error, it may returns 0 (and you can find out the error using - the getLastParseError() method). + virtual ~ThreadPoolJob(); - @param onlyReadOuterDocumentElement if true, the parser will only read the - first section of the file, and will only - return the outer document element - this - allows quick checking of large files to - see if they contain the correct type of - tag, without having to parse the entire file - @returns a new XmlElement which the caller will need to delete, or null if - there was an error. - @see getLastParseError + /** Returns the name of this job. + @see setJobName */ - XmlElement* getDocumentElement (const bool onlyReadOuterDocumentElement = false); + const String getJobName() const; - /** Returns the parsing error that occurred the last time getDocumentElement was called. + /** Changes the job's name. + @see getJobName + */ + void setJobName (const String& newName); - @returns the error, or an empty string if there was no error. + /** These are the values that can be returned by the runJob() method. */ - const String& getLastParseError() const throw(); + enum JobStatus + { + jobHasFinished = 0, /**< indicates that the job has finished and can be + removed from the pool. */ - /** Sets an input source object to use for parsing documents that reference external entities. + jobHasFinishedAndShouldBeDeleted, /**< indicates that the job has finished and that it + should be automatically deleted by the pool. */ - If the document has been created from a file, this probably won't be needed, but - if you're parsing some text and there might be a DTD that references external - files, you may need to create a custom input source that can retrieve the - other files it needs. + jobNeedsRunningAgain /**< indicates that the job would like to be called + again when a thread is free. */ + }; - The object that is passed-in will be deleted automatically when no longer needed. + /** Peforms the actual work that this job needs to do. - @see InputSource - */ - void setInputSource (InputSource* const newSource) throw(); + Your subclass must implement this method, in which is does its work. - juce_UseDebuggingNewOperator + If the code in this method takes a significant time to run, it must repeatedly check + the shouldExit() method to see if something is trying to interrupt the job. + If shouldExit() ever returns true, the runJob() method must return immediately. -private: - String originalText; - const tchar* input; - bool outOfData, errorOccurred; + If this method returns jobHasFinished, then the job will be removed from the pool + immediately. If it returns jobNeedsRunningAgain, then the job will be left in the + pool and will get a chance to run again as soon as a thread is free. - bool identifierLookupTable [128]; - String lastError, dtdText; - StringArray tokenisedDTD; - bool needToLoadDTD; - InputSource* inputSource; + @see shouldExit() + */ + virtual JobStatus runJob() = 0; - void setLastError (const String& desc, const bool carryOn) throw(); - void skipHeader() throw(); - void skipNextWhiteSpace() throw(); - tchar readNextChar() throw(); - XmlElement* readNextElement (const bool alsoParseSubElements) throw(); - void readChildElements (XmlElement* parent) throw(); - int findNextTokenLength() throw(); - void readQuotedString (String& result) throw(); - void readEntity (String& result) throw(); + /** Returns true if this job is currently running its runJob() method. */ + bool isRunning() const throw() { return isActive; } - const String getFileContents (const String& filename) const; - const String expandEntity (const String& entity); - const String expandExternalEntity (const String& entity); - const String getParameterEntity (const String& entity); -}; + /** Returns true if something is trying to interrupt this job and make it stop. -#endif // __JUCE_XMLDOCUMENT_JUCEHEADER__ -/********* End of inlined file: juce_XmlDocument.h *********/ + Your runJob() method must call this whenever it gets a chance, and if it ever + returns true, the runJob() method must return immediately. -#endif -#ifndef __JUCE_XMLELEMENT_JUCEHEADER__ + @see signalJobShouldExit() + */ + bool shouldExit() const throw() { return shouldStop; } -#endif -#ifndef __JUCE_CRITICALSECTION_JUCEHEADER__ + /** Calling this will cause the shouldExit() method to return true, and the job + should (if it's been implemented correctly) stop as soon as possible. -#endif -#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ + @see shouldExit() + */ + void signalJobShouldExit(); -/********* Start of inlined file: juce_InterProcessLock.h *********/ -#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ -#define __JUCE_INTERPROCESSLOCK_JUCEHEADER__ + juce_UseDebuggingNewOperator + +private: + friend class ThreadPool; + friend class ThreadPoolThread; + String jobName; + ThreadPool* pool; + bool shouldStop, isActive, shouldBeDeleted; +}; /** - Acts as a critical section which processes can use to block each other. + A set of threads that will run a list of jobs. - @see CriticalSection + When a ThreadPoolJob object is added to the ThreadPool's list, its run() method + will be called by the next pooled thread that becomes free. + + @see ThreadPoolJob, Thread */ -class JUCE_API InterProcessLock +class JUCE_API ThreadPool { public: - /** Creates a lock object. + /** Creates a thread pool. - @param name a name that processes will use to identify this lock object + Once you've created a pool, you can give it some things to do with the addJob() + method. + + @param numberOfThreads the maximum number of actual threads to run. + @param startThreadsOnlyWhenNeeded if this is true, then no threads will be started + until there are some jobs to run. If false, then + all the threads will be fired-up immediately so that + they're ready for action + @param stopThreadsWhenNotUsedTimeoutMs if this timeout is > 0, then if any threads have been + inactive for this length of time, they will automatically + be stopped until more jobs come along and they're needed */ - InterProcessLock (const String& name) throw(); + ThreadPool (const int numberOfThreads, + const bool startThreadsOnlyWhenNeeded = true, + const int stopThreadsWhenNotUsedTimeoutMs = 5000); /** Destructor. - This will also release the lock if it's currently held by this process. + This will attempt to remove all the jobs before deleting, but if you want to + specify a timeout, you should call removeAllJobs() explicitly before deleting + the pool. */ - ~InterProcessLock() throw(); - - /** Attempts to lock the critical section. + ~ThreadPool(); - @param timeOutMillisecs how many milliseconds to wait if the lock - is already held by another process - a value of - 0 will return immediately, negative values will wait - forever - @returns true if the lock could be gained within the timeout period, or - false if the timeout expired. - */ - bool enter (int timeOutMillisecs = -1) throw(); + /** Adds a job to the queue. - /** Releases the lock if it's currently held by this process. + Once a job has been added, then the next time a thread is free, it will run + the job's ThreadPoolJob::runJob() method. Depending on the return value of the + runJob() method, the pool will either remove the job from the pool or add it to + the back of the queue to be run again. */ - void exit() throw(); - - juce_UseDebuggingNewOperator + void addJob (ThreadPoolJob* const job); -private: + /** Tries to remove a job from the pool. - void* internal; - String name; - int reentrancyLevel; + If the job isn't yet running, this will simply remove it. If it is running, it + will wait for it to finish. - InterProcessLock (const InterProcessLock&); - const InterProcessLock& operator= (const InterProcessLock&); -}; + If the timeout period expires before the job finishes running, then the job will be + left in the pool and this will return false. It returns true if the job is sucessfully + stopped and removed. -#endif // __JUCE_INTERPROCESSLOCK_JUCEHEADER__ -/********* End of inlined file: juce_InterProcessLock.h *********/ + @param job the job to remove + @param interruptIfRunning if true, then if the job is currently busy, its + ThreadPoolJob::signalJobShouldExit() method will be called to try + to interrupt it. If false, then if the job will be allowed to run + until it stops normally (or the timeout expires) + @param timeOutMilliseconds the length of time this method should wait for the job to finish + before giving up and returning false + */ + bool removeJob (ThreadPoolJob* const job, + const bool interruptIfRunning, + const int timeOutMilliseconds); -#endif -#ifndef __JUCE_PROCESS_JUCEHEADER__ + /** Tries clear all jobs from the pool. -/********* Start of inlined file: juce_Process.h *********/ -#ifndef __JUCE_PROCESS_JUCEHEADER__ -#define __JUCE_PROCESS_JUCEHEADER__ + @param interruptRunningJobs if true, then all running jobs will have their ThreadPoolJob::signalJobShouldExit() + methods called to try to interrupt them + @param timeOutMilliseconds the length of time this method should wait for all the jobs to finish + before giving up and returning false + @returns true if all jobs are successfully stopped and removed; false if the timeout period + expires while waiting for them to stop + */ + bool removeAllJobs (const bool interruptRunningJobs, + const int timeOutMilliseconds); -/** Represents the current executable's process. + /** Returns the number of jobs currently running or queued. + */ + int getNumJobs() const throw(); - This contains methods for controlling the current application at the - process-level. + /** Returns one of the jobs in the queue. - @see Thread, JUCEApplication -*/ -class JUCE_API Process -{ -public: + Note that this can be a very volatile list as jobs might be continuously getting shifted + around in the list, and this method may return 0 if the index is currently out-of-range. + */ + ThreadPoolJob* getJob (const int index) const; - enum ProcessPriority - { - LowPriority = 0, - NormalPriority = 1, - HighPriority = 2, - RealtimePriority = 3 - }; + /** Returns true if the given job is currently queued or running. - /** Changes the current process's priority. + @see isJobRunning() + */ + bool contains (const ThreadPoolJob* const job) const throw(); - @param priority the process priority, where - 0=low, 1=normal, 2=high, 3=realtime + /** Returns true if the given job is currently being run by a thread. */ - static void setPriority (const ProcessPriority priority); + bool isJobRunning (const ThreadPoolJob* const job) const; - /** Kills the current process immediately. + /** Waits until a job has finished running and has been removed from the pool. - This is an emergency process terminator that kills the application - immediately - it's intended only for use only when something goes - horribly wrong. + This will wait until the job is no longer in the pool - i.e. until its + runJob() method returns ThreadPoolJob::jobHasFinished. - @see JUCEApplication::quit + If the timeout period expires before the job finishes, this will return false; + it returns true if the job has finished successfully. */ - static void terminate(); + bool waitForJobToFinish (const ThreadPoolJob* const job, + const int timeOutMilliseconds) const; - /** Returns true if this application process is the one that the user is - currently using. + /** Returns a list of the names of all the jobs currently running or queued. + + If onlyReturnActiveJobs is true, only the ones currently running are returned. */ - static bool isForegroundProcess() throw(); + const StringArray getNamesOfAllJobs (const bool onlyReturnActiveJobs) const; - /** Raises the current process's privilege level. + /** Changes the priority of all the threads. - Does nothing if this isn't supported by the current OS, or if process - privilege level is fixed. + This will call Thread::setPriority() for each thread in the pool. */ - static void raisePrivilege(); + void setThreadPriorities (const int newPriority); - /** Lowers the current process's privilege level. + juce_UseDebuggingNewOperator - Does nothing if this isn't supported by the current OS, or if process - privilege level is fixed. - */ - static void lowerPrivilege(); +private: + const int numThreads, threadStopTimeout; + int priority; + Thread** threads; + VoidArray jobs; - /** Returns true if this process is being hosted by a debugger. - */ - static bool JUCE_CALLTYPE isRunningUnderDebugger() throw(); + CriticalSection lock; + uint32 lastJobEndTime; - /** Loads a dynamically-linked library into the process's address space. + friend class ThreadPoolThread; + bool runNextJob(); - @param pathOrFilename the platform-dependent name and search path - @returns a handle which can be used by getProcedureEntryPoint(), or - zero if it fails. - @see freeDynamicLibrary, getProcedureEntryPoint - */ - static void* loadDynamicLibrary (const String& pathOrFilename); + ThreadPool (const ThreadPool&); + const ThreadPool& operator= (const ThreadPool&); +}; - /** Frees a dynamically-linked library. +#endif // __JUCE_THREADPOOL_JUCEHEADER__ +/********* End of inlined file: juce_ThreadPool.h *********/ - @param libraryHandle a handle created by loadDynamicLibrary - @see loadDynamicLibrary, getProcedureEntryPoint - */ - static void freeDynamicLibrary (void* libraryHandle); +#endif +#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ - /** Finds a procedure call in a dynamically-linked library. +/********* Start of inlined file: juce_TimeSliceThread.h *********/ +#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ +#define __JUCE_TIMESLICETHREAD_JUCEHEADER__ - @param libraryHandle a library handle returned by loadDynamicLibrary - @param procedureName the name of the procedure call to try to load - @returns a pointer to the function if found, or 0 if it fails - @see loadDynamicLibrary - */ - static void* getProcedureEntryPoint (void* libraryHandle, - const String& procedureName); +/** + Used by the TimeSliceThread class. -}; + To register your class with a TimeSliceThread, derive from this class and + use the TimeSliceThread::addTimeSliceClient() method to add it to the list. -#endif // __JUCE_PROCESS_JUCEHEADER__ -/********* End of inlined file: juce_Process.h *********/ + Make sure you always call TimeSliceThread::removeTimeSliceClient() before + deleting your client! -#endif -#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ + @see TimeSliceThread +*/ +class JUCE_API TimeSliceClient +{ +public: + /** Destructor. */ + virtual ~TimeSliceClient() {} -/********* Start of inlined file: juce_ReadWriteLock.h *********/ -#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ -#define __JUCE_READWRITELOCK_JUCEHEADER__ + /** Called back by a TimeSliceThread. -/********* Start of inlined file: juce_WaitableEvent.h *********/ -#ifndef __JUCE_WAITABLEEVENT_JUCEHEADER__ -#define __JUCE_WAITABLEEVENT_JUCEHEADER__ + When you register this class with it, a TimeSliceThread will repeatedly call + this method. + + The implementation of this method should use its time-slice to do something that's + quick - never block for longer than absolutely necessary. + + @returns Your method should return true if it needs more time, or false if it's + not too busy and doesn't need calling back urgently. If all the thread's + clients indicate that they're not busy, then it'll save CPU by sleeping for + up to half a second in between callbacks. You can force the TimeSliceThread + to wake up and poll again immediately by calling its notify() method. + */ + virtual bool useTimeSlice() = 0; +}; /** - Allows threads to wait for events triggered by other threads. + A thread that keeps a list of clients, and calls each one in turn, giving them + all a chance to run some sort of short task. - A thread can call wait() on a WaitableObject, and this will suspend the - calling thread until another thread wakes it up by calling the signal() - method. + @see TimeSliceClient, Thread */ -class JUCE_API WaitableEvent +class JUCE_API TimeSliceThread : public Thread { public: - /** Creates a WaitableEvent object. */ - WaitableEvent() throw(); - - /** Destructor. + /** + Creates a TimeSliceThread. - If other threads are waiting on this object when it gets deleted, this - can cause nasty errors, so be careful! + When first created, the thread is not running. Use the startThread() + method to start it. */ - ~WaitableEvent() throw(); - - /** Suspends the calling thread until the event has been signalled. + TimeSliceThread (const String& threadName); - This will wait until the object's signal() method is called by another thread, - or until the timeout expires. + /** Destructor. - After the event has been signalled, this method will return true and reset - the event. + Deleting a Thread object that is running will only give the thread a + brief opportunity to stop itself cleanly, so it's recommended that you + should always call stopThread() with a decent timeout before deleting, + to avoid the thread being forcibly killed (which is a Bad Thing). + */ + ~TimeSliceThread(); - @param timeOutMilliseconds the maximum time to wait, in milliseconds. A negative - value will cause it to wait forever. + /** Adds a client to the list. - @returns true if the object has been signalled, false if the timeout expires first. - @see signal, reset + The client's callbacks will start immediately (possibly before the method + has returned). */ - bool wait (const int timeOutMilliseconds = -1) const throw(); - - /** Wakes up any threads that are currently waiting on this object. + void addTimeSliceClient (TimeSliceClient* const client); - If signal() is called when nothing is waiting, the next thread to call wait() - will return immediately and reset the signal. + /** Removes a client from the list. - @see wait, reset + This method will make sure that all callbacks to the client have completely + finished before the method returns. */ - void signal() const throw(); + void removeTimeSliceClient (TimeSliceClient* const client); - /** Resets the event to an unsignalled state. + /** Returns the number of registered clients. */ + int getNumClients() const throw(); - If it's not already signalled, this does nothing. - */ - void reset() const throw(); + /** Returns one of the registered clients. */ + TimeSliceClient* getClient (const int index) const throw(); + + /** @internal */ + void run(); juce_UseDebuggingNewOperator private: - void* internal; + CriticalSection callbackLock, listLock; + Array clients; + int index; + TimeSliceClient* clientBeingCalled; + bool clientsChanged; - WaitableEvent (const WaitableEvent&); - const WaitableEvent& operator= (const WaitableEvent&); + TimeSliceThread (const TimeSliceThread&); + const TimeSliceThread& operator= (const TimeSliceThread&); }; -#endif // __JUCE_WAITABLEEVENT_JUCEHEADER__ -/********* End of inlined file: juce_WaitableEvent.h *********/ +#endif // __JUCE_TIMESLICETHREAD_JUCEHEADER__ +/********* End of inlined file: juce_TimeSliceThread.h *********/ + +#endif +#ifndef __JUCE_CRITICALSECTION_JUCEHEADER__ + +#endif +#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ + +/********* Start of inlined file: juce_ScopedReadLock.h *********/ +#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ +#define __JUCE_SCOPEDREADLOCK_JUCEHEADER__ + +/********* Start of inlined file: juce_ReadWriteLock.h *********/ +#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ +#define __JUCE_READWRITELOCK_JUCEHEADER__ /** A critical section that allows multiple simultaneous readers. @@ -13955,8 +14489,8 @@ private: CriticalSection accessLock; WaitableEvent waitEvent; mutable int numWaitingWriters, numWriters; - mutable int writerThreadId; - mutable Array readerThreads; + mutable int64 writerThreadId; + mutable Array readerThreads; ReadWriteLock (const ReadWriteLock&); const ReadWriteLock& operator= (const ReadWriteLock&); @@ -13965,16 +14499,6 @@ private: #endif // __JUCE_READWRITELOCK_JUCEHEADER__ /********* End of inlined file: juce_ReadWriteLock.h *********/ -#endif -#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ - -#endif -#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ - -/********* Start of inlined file: juce_ScopedReadLock.h *********/ -#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ -#define __JUCE_SCOPEDREADLOCK_JUCEHEADER__ - /** Automatically locks and unlocks a ReadWriteLock object. @@ -14034,756 +14558,290 @@ private: /********* End of inlined file: juce_ScopedReadLock.h *********/ #endif -#ifndef __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ - -/********* Start of inlined file: juce_ScopedTryLock.h *********/ -#ifndef __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ -#define __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ - -/** - Automatically tries to lock and unlock a CriticalSection object. - - Use one of these as a local variable to control access to a CriticalSection. - - e.g. @code - - CriticalSection myCriticalSection; +#ifndef __JUCE_PROCESS_JUCEHEADER__ - for (;;) - { - const ScopedTryLock myScopedTryLock (myCriticalSection); +/********* Start of inlined file: juce_Process.h *********/ +#ifndef __JUCE_PROCESS_JUCEHEADER__ +#define __JUCE_PROCESS_JUCEHEADER__ - // Unlike using a ScopedLock, this may fail to actually get the lock, so you - // should test this with the isLocked() method before doing your thread-unsafe - // action.. - if (myScopedTryLock.isLocked()) - { - ...do some stuff... - } - else - { - ..our attempt at locking failed because another thread had already locked it.. - } +/** Represents the current executable's process. - // myCriticalSection gets unlocked here (if it was locked) - } - @endcode + This contains methods for controlling the current application at the + process-level. - @see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock + @see Thread, JUCEApplication */ -class JUCE_API ScopedTryLock +class JUCE_API Process { public: - /** Creates a ScopedTryLock. - - As soon as it is created, this will try to lock the CriticalSection, and - when the ScopedTryLock object is deleted, the CriticalSection will - be unlocked if the lock was successful. - - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! Best just to use it - as a local stack object, rather than creating one with the new() operator. - */ - inline ScopedTryLock (const CriticalSection& lock) throw() : lock_ (lock), lockWasSuccessful (lock.tryEnter()) {} - - /** Destructor. - - The CriticalSection will be unlocked (if locked) when the destructor is called. - - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! - */ - inline ~ScopedTryLock() throw() { if (lockWasSuccessful) lock_.exit(); } - - /** Lock state - - @return True if the CriticalSection is locked. - */ - bool isLocked() const throw() { return lockWasSuccessful; } - -private: - - const CriticalSection& lock_; - const bool lockWasSuccessful; - - ScopedTryLock (const ScopedTryLock&); - const ScopedTryLock& operator= (const ScopedTryLock&); -}; - -#endif // __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ -/********* End of inlined file: juce_ScopedTryLock.h *********/ - -#endif -#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ - -/********* Start of inlined file: juce_ScopedWriteLock.h *********/ -#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ -#define __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ - -/** - Automatically locks and unlocks a ReadWriteLock object. - - Use one of these as a local variable to control access to a ReadWriteLock. - - e.g. @code - - ReadWriteLock myLock; - - for (;;) + enum ProcessPriority { - const ScopedWriteLock myScopedLock (myLock); - // myLock is now locked - - ...do some stuff... - - // myLock gets unlocked here. - } - @endcode - - @see ReadWriteLock, ScopedReadLock -*/ -class JUCE_API ScopedWriteLock -{ -public: - - /** Creates a ScopedWriteLock. - - As soon as it is created, this will call ReadWriteLock::enterWrite(), and - when the ScopedWriteLock object is deleted, the ReadWriteLock will - be unlocked. - - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! Best just to use it - as a local stack object, rather than creating one with the new() operator. - */ - inline ScopedWriteLock (const ReadWriteLock& lock) throw() : lock_ (lock) { lock.enterWrite(); } - - /** Destructor. - - The ReadWriteLock's exitWrite() method will be called when the destructor is called. - - Make sure this object is created and deleted by the same thread, - otherwise there are no guarantees what will happen! - */ - inline ~ScopedWriteLock() throw() { lock_.exitWrite(); } - -private: - - const ReadWriteLock& lock_; - - ScopedWriteLock (const ScopedWriteLock&); - const ScopedWriteLock& operator= (const ScopedWriteLock&); -}; - -#endif // __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ -/********* End of inlined file: juce_ScopedWriteLock.h *********/ - -#endif -#ifndef __JUCE_THREAD_JUCEHEADER__ - -/********* Start of inlined file: juce_Thread.h *********/ -#ifndef __JUCE_THREAD_JUCEHEADER__ -#define __JUCE_THREAD_JUCEHEADER__ - -/** - Encapsulates a thread. - - Subclasses derive from Thread and implement the run() method, in which they - do their business. The thread can then be started with the startThread() method - and controlled with various other methods. - - This class also contains some thread-related static methods, such - as sleep(), yield(), getCurrentThreadId() etc. - - @see CriticalSection, WaitableEvent, Process, ThreadWithProgressWindow, - MessageManagerLock -*/ -class JUCE_API Thread -{ -public: - - /** - Creates a thread. - - When first created, the thread is not running. Use the startThread() - method to start it. - */ - Thread (const String& threadName); - - /** Destructor. - - Deleting a Thread object that is running will only give the thread a - brief opportunity to stop itself cleanly, so it's recommended that you - should always call stopThread() with a decent timeout before deleting, - to avoid the thread being forcibly killed (which is a Bad Thing). - */ - virtual ~Thread(); - - /** Must be implemented to perform the thread's actual code. - - Remember that the thread must regularly check the threadShouldExit() - method whilst running, and if this returns true it should return from - the run() method as soon as possible to avoid being forcibly killed. - - @see threadShouldExit, startThread - */ - virtual void run() = 0; - - // Thread control functions.. - - /** Starts the thread running. - - This will start the thread's run() method. - (if it's already started, startThread() won't do anything). - - @see stopThread - */ - void startThread() throw(); - - /** Starts the thread with a given priority. - - Launches the thread with a given priority, where 0 = lowest, 10 = highest. - If the thread is already running, its priority will be changed. - - @see startThread, setPriority - */ - void startThread (const int priority) throw(); - - /** Attempts to stop the thread running. - - This method will cause the threadShouldExit() method to return true - and call notify() in case the thread is currently waiting. - - Hopefully the thread will then respond to this by exiting cleanly, and - the stopThread method will wait for a given time-period for this to - happen. - - If the thread is stuck and fails to respond after the time-out, it gets - forcibly killed, which is a very bad thing to happen, as it could still - be holding locks, etc. which are needed by other parts of your program. - - @param timeOutMilliseconds The number of milliseconds to wait for the - thread to finish before killing it by force. A negative - value in here will wait forever. - @see signalThreadShouldExit, threadShouldExit, waitForThreadToExit, isThreadRunning - */ - void stopThread (const int timeOutMilliseconds) throw(); - - /** Returns true if the thread is currently active */ - bool isThreadRunning() const throw(); - - /** Sets a flag to tell the thread it should stop. - - Calling this means that the threadShouldExit() method will then return true. - The thread should be regularly checking this to see whether it should exit. - - @see threadShouldExit - @see waitForThreadToExit - */ - void signalThreadShouldExit() throw(); - - /** Checks whether the thread has been told to stop running. - - Threads need to check this regularly, and if it returns true, they should - return from their run() method at the first possible opportunity. - - @see signalThreadShouldExit - */ - inline bool threadShouldExit() const throw() { return threadShouldExit_; } - - /** Waits for the thread to stop. - - This will waits until isThreadRunning() is false or until a timeout expires. - - @param timeOutMilliseconds the time to wait, in milliseconds. If this value - is less than zero, it will wait forever. - @returns true if the thread exits, or false if the timeout expires first. - */ - bool waitForThreadToExit (const int timeOutMilliseconds) const throw(); - - /** Changes the thread's priority. - - @param priority the new priority, in the range 0 (lowest) to 10 (highest). A priority - of 5 is normal. - */ - void setPriority (const int priority) throw(); - - /** Changes the priority of the caller thread. - - Similar to setPriority(), but this static method acts on the caller thread. - - @see setPriority - */ - static void setCurrentThreadPriority (const int priority) throw(); - - /** Sets the affinity mask for the thread. - - This will only have an effect next time the thread is started - i.e. if the - thread is already running when called, it'll have no effect. - - @see setCurrentThreadAffinityMask - */ - void setAffinityMask (const uint32 affinityMask) throw(); - - /** Changes the affinity mask for the caller thread. - - This will change the affinity mask for the thread that calls this static method. - - @see setAffinityMask - */ - static void setCurrentThreadAffinityMask (const uint32 affinityMask) throw(); - - // this can be called from any thread that needs to pause.. - static void JUCE_CALLTYPE sleep (int milliseconds) throw(); - - /** Yields the calling thread's current time-slot. */ - static void JUCE_CALLTYPE yield() throw(); - - /** Makes the thread wait for a notification. - - This puts the thread to sleep until either the timeout period expires, or - another thread calls the notify() method to wake it up. - - @returns true if the event has been signalled, false if the timeout expires. - */ - bool wait (const int timeOutMilliseconds) const throw(); - - /** Wakes up the thread. - - If the thread has called the wait() method, this will wake it up. - - @see wait - */ - void notify() const throw(); - - /** Returns an id that identifies the caller thread. - - To find the ID of a particular thread object, use getThreadId(). - - @returns a unique identifier that identifies the calling thread. - @see getThreadId - */ - static int getCurrentThreadId() throw(); - - /** Finds the thread object that is currently running. - - Note that the main UI thread (or other non-Juce threads) don't have a Thread - object associated with them, so this will return 0. - */ - static Thread* getCurrentThread() throw(); - - /** Returns the ID of this thread. - - That means the ID of this thread object - not of the thread that's calling the method. - - This can change when the thread is started and stopped, and will be invalid if the - thread's not actually running. - - @see getCurrentThreadId - */ - int getThreadId() const throw(); - - /** Returns the name of the thread. - - This is the name that gets set in the constructor. - */ - const String getThreadName() const throw() { return threadName_; } - - /** Returns the number of currently-running threads. - - @returns the number of Thread objects known to be currently running. - @see stopAllThreads - */ - static int getNumRunningThreads() throw(); - - /** Tries to stop all currently-running threads. - - This will attempt to stop all the threads known to be running at the moment. - */ - static void stopAllThreads (const int timeoutInMillisecs) throw(); - - juce_UseDebuggingNewOperator - -private: - const String threadName_; - void* volatile threadHandle_; - CriticalSection startStopLock; - WaitableEvent startSuspensionEvent_, defaultEvent_; - - int threadPriority_, threadId_; - uint32 affinityMask_; - bool volatile threadShouldExit_; - - friend void JUCE_API juce_threadEntryPoint (void*); - static void threadEntryPoint (Thread* thread) throw(); - - Thread (const Thread&); - const Thread& operator= (const Thread&); -}; - -#endif // __JUCE_THREAD_JUCEHEADER__ -/********* End of inlined file: juce_Thread.h *********/ - -#endif -#ifndef __JUCE_THREADPOOL_JUCEHEADER__ - -/********* Start of inlined file: juce_ThreadPool.h *********/ -#ifndef __JUCE_THREADPOOL_JUCEHEADER__ -#define __JUCE_THREADPOOL_JUCEHEADER__ - -class ThreadPool; -class ThreadPoolThread; - -/** - A task that is executed by a ThreadPool object. - - A ThreadPool keeps a list of ThreadPoolJob objects which are executed by - its threads. - - The runJob() method needs to be implemented to do the task, and if the code that - does the work takes a significant time to run, it must keep checking the shouldExit() - method to see if something is trying to interrupt the job. If shouldExit() returns - true, the runJob() method must return immediately. - - @see ThreadPool, Thread -*/ -class JUCE_API ThreadPoolJob -{ -public: + LowPriority = 0, + NormalPriority = 1, + HighPriority = 2, + RealtimePriority = 3 + }; - /** Creates a thread pool job object. + /** Changes the current process's priority. - After creating your job, add it to a thread pool with ThreadPool::addJob(). + @param priority the process priority, where + 0=low, 1=normal, 2=high, 3=realtime */ - ThreadPoolJob (const String& name); + static void setPriority (const ProcessPriority priority); - /** Destructor. */ - virtual ~ThreadPoolJob(); + /** Kills the current process immediately. - /** Returns the name of this job. - @see setJobName - */ - const String getJobName() const; + This is an emergency process terminator that kills the application + immediately - it's intended only for use only when something goes + horribly wrong. - /** Changes the job's name. - @see getJobName + @see JUCEApplication::quit */ - void setJobName (const String& newName); + static void terminate(); - /** These are the values that can be returned by the runJob() method. + /** Returns true if this application process is the one that the user is + currently using. */ - enum JobStatus - { - jobHasFinished = 0, /**< indicates that the job has finished and can be - removed from the pool. */ - - jobHasFinishedAndShouldBeDeleted, /**< indicates that the job has finished and that it - should be automatically deleted by the pool. */ - - jobNeedsRunningAgain /**< indicates that the job would like to be called - again when a thread is free. */ - }; + static bool isForegroundProcess() throw(); - /** Peforms the actual work that this job needs to do. + /** Raises the current process's privilege level. - Your subclass must implement this method, in which is does its work. + Does nothing if this isn't supported by the current OS, or if process + privilege level is fixed. + */ + static void raisePrivilege(); - If the code in this method takes a significant time to run, it must repeatedly check - the shouldExit() method to see if something is trying to interrupt the job. - If shouldExit() ever returns true, the runJob() method must return immediately. + /** Lowers the current process's privilege level. - If this method returns jobHasFinished, then the job will be removed from the pool - immediately. If it returns jobNeedsRunningAgain, then the job will be left in the - pool and will get a chance to run again as soon as a thread is free. + Does nothing if this isn't supported by the current OS, or if process + privilege level is fixed. + */ + static void lowerPrivilege(); - @see shouldExit() + /** Returns true if this process is being hosted by a debugger. */ - virtual JobStatus runJob() = 0; + static bool JUCE_CALLTYPE isRunningUnderDebugger() throw(); +}; - /** Returns true if this job is currently running its runJob() method. */ - bool isRunning() const throw() { return isActive; } +#endif // __JUCE_PROCESS_JUCEHEADER__ +/********* End of inlined file: juce_Process.h *********/ - /** Returns true if something is trying to interrupt this job and make it stop. +#endif +#ifndef __JUCE_THREAD_JUCEHEADER__ - Your runJob() method must call this whenever it gets a chance, and if it ever - returns true, the runJob() method must return immediately. +#endif +#ifndef __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ - @see signalJobShouldExit() - */ - bool shouldExit() const throw() { return shouldStop; } +/********* Start of inlined file: juce_ScopedTryLock.h *********/ +#ifndef __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ +#define __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ - /** Calling this will cause the shouldExit() method to return true, and the job - should (if it's been implemented correctly) stop as soon as possible. +/** + Automatically tries to lock and unlock a CriticalSection object. - @see shouldExit() - */ - void signalJobShouldExit(); + Use one of these as a local variable to control access to a CriticalSection. - juce_UseDebuggingNewOperator + e.g. @code -private: - friend class ThreadPool; - friend class ThreadPoolThread; - String jobName; - ThreadPool* pool; - bool shouldStop, isActive, shouldBeDeleted; -}; + CriticalSection myCriticalSection; -/** - A set of threads that will run a list of jobs. + for (;;) + { + const ScopedTryLock myScopedTryLock (myCriticalSection); - When a ThreadPoolJob object is added to the ThreadPool's list, its run() method - will be called by the next pooled thread that becomes free. + // Unlike using a ScopedLock, this may fail to actually get the lock, so you + // should test this with the isLocked() method before doing your thread-unsafe + // action.. + if (myScopedTryLock.isLocked()) + { + ...do some stuff... + } + else + { + ..our attempt at locking failed because another thread had already locked it.. + } - @see ThreadPoolJob, Thread + // myCriticalSection gets unlocked here (if it was locked) + } + @endcode + + @see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock */ -class JUCE_API ThreadPool +class JUCE_API ScopedTryLock { public: - /** Creates a thread pool. + /** Creates a ScopedTryLock. - Once you've created a pool, you can give it some things to do with the addJob() - method. + As soon as it is created, this will try to lock the CriticalSection, and + when the ScopedTryLock object is deleted, the CriticalSection will + be unlocked if the lock was successful. - @param numberOfThreads the maximum number of actual threads to run. - @param startThreadsOnlyWhenNeeded if this is true, then no threads will be started - until there are some jobs to run. If false, then - all the threads will be fired-up immediately so that - they're ready for action - @param stopThreadsWhenNotUsedTimeoutMs if this timeout is > 0, then if any threads have been - inactive for this length of time, they will automatically - be stopped until more jobs come along and they're needed + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! Best just to use it + as a local stack object, rather than creating one with the new() operator. */ - ThreadPool (const int numberOfThreads, - const bool startThreadsOnlyWhenNeeded = true, - const int stopThreadsWhenNotUsedTimeoutMs = 5000); + inline ScopedTryLock (const CriticalSection& lock) throw() : lock_ (lock), lockWasSuccessful (lock.tryEnter()) {} /** Destructor. - This will attempt to remove all the jobs before deleting, but if you want to - specify a timeout, you should call removeAllJobs() explicitly before deleting - the pool. + The CriticalSection will be unlocked (if locked) when the destructor is called. + + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! */ - ~ThreadPool(); + inline ~ScopedTryLock() throw() { if (lockWasSuccessful) lock_.exit(); } - /** Adds a job to the queue. + /** Lock state - Once a job has been added, then the next time a thread is free, it will run - the job's ThreadPoolJob::runJob() method. Depending on the return value of the - runJob() method, the pool will either remove the job from the pool or add it to - the back of the queue to be run again. + @return True if the CriticalSection is locked. */ - void addJob (ThreadPoolJob* const job); - - /** Tries to remove a job from the pool. + bool isLocked() const throw() { return lockWasSuccessful; } - If the job isn't yet running, this will simply remove it. If it is running, it - will wait for it to finish. +private: - If the timeout period expires before the job finishes running, then the job will be - left in the pool and this will return false. It returns true if the job is sucessfully - stopped and removed. + const CriticalSection& lock_; + const bool lockWasSuccessful; - @param job the job to remove - @param interruptIfRunning if true, then if the job is currently busy, its - ThreadPoolJob::signalJobShouldExit() method will be called to try - to interrupt it. If false, then if the job will be allowed to run - until it stops normally (or the timeout expires) - @param timeOutMilliseconds the length of time this method should wait for the job to finish - before giving up and returning false - */ - bool removeJob (ThreadPoolJob* const job, - const bool interruptIfRunning, - const int timeOutMilliseconds); + ScopedTryLock (const ScopedTryLock&); + const ScopedTryLock& operator= (const ScopedTryLock&); +}; - /** Tries clear all jobs from the pool. +#endif // __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ +/********* End of inlined file: juce_ScopedTryLock.h *********/ - @param interruptRunningJobs if true, then all running jobs will have their ThreadPoolJob::signalJobShouldExit() - methods called to try to interrupt them - @param timeOutMilliseconds the length of time this method should wait for all the jobs to finish - before giving up and returning false - @returns true if all jobs are successfully stopped and removed; false if the timeout period - expires while waiting for them to stop - */ - bool removeAllJobs (const bool interruptRunningJobs, - const int timeOutMilliseconds); +#endif +#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ - /** Returns the number of jobs currently running or queued. - */ - int getNumJobs() const throw(); +#endif +#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ - /** Returns one of the jobs in the queue. +/********* Start of inlined file: juce_InterProcessLock.h *********/ +#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ +#define __JUCE_INTERPROCESSLOCK_JUCEHEADER__ - Note that this can be a very volatile list as jobs might be continuously getting shifted - around in the list, and this method may return 0 if the index is currently out-of-range. - */ - ThreadPoolJob* getJob (const int index) const; +/** + Acts as a critical section which processes can use to block each other. - /** Returns true if the given job is currently queued or running. + @see CriticalSection +*/ +class JUCE_API InterProcessLock +{ +public: - @see isJobRunning() - */ - bool contains (const ThreadPoolJob* const job) const throw(); + /** Creates a lock object. - /** Returns true if the given job is currently being run by a thread. + @param name a name that processes will use to identify this lock object */ - bool isJobRunning (const ThreadPoolJob* const job) const; - - /** Waits until a job has finished running and has been removed from the pool. + InterProcessLock (const String& name) throw(); - This will wait until the job is no longer in the pool - i.e. until its - runJob() method returns ThreadPoolJob::jobHasFinished. + /** Destructor. - If the timeout period expires before the job finishes, this will return false; - it returns true if the job has finished successfully. + This will also release the lock if it's currently held by this process. */ - bool waitForJobToFinish (const ThreadPoolJob* const job, - const int timeOutMilliseconds) const; + ~InterProcessLock() throw(); - /** Returns a list of the names of all the jobs currently running or queued. + /** Attempts to lock the critical section. - If onlyReturnActiveJobs is true, only the ones currently running are returned. + @param timeOutMillisecs how many milliseconds to wait if the lock + is already held by another process - a value of + 0 will return immediately, negative values will wait + forever + @returns true if the lock could be gained within the timeout period, or + false if the timeout expired. */ - const StringArray getNamesOfAllJobs (const bool onlyReturnActiveJobs) const; - - /** Changes the priority of all the threads. + bool enter (int timeOutMillisecs = -1) throw(); - This will call Thread::setPriority() for each thread in the pool. + /** Releases the lock if it's currently held by this process. */ - void setThreadPriorities (const int newPriority); + void exit() throw(); juce_UseDebuggingNewOperator private: - const int numThreads, threadStopTimeout; - int priority; - Thread** threads; - VoidArray jobs; - - CriticalSection lock; - uint32 lastJobEndTime; - friend class ThreadPoolThread; - bool runNextJob(); + void* internal; + String name; + int reentrancyLevel; - ThreadPool (const ThreadPool&); - const ThreadPool& operator= (const ThreadPool&); + InterProcessLock (const InterProcessLock&); + const InterProcessLock& operator= (const InterProcessLock&); }; -#endif // __JUCE_THREADPOOL_JUCEHEADER__ -/********* End of inlined file: juce_ThreadPool.h *********/ +#endif // __JUCE_INTERPROCESSLOCK_JUCEHEADER__ +/********* End of inlined file: juce_InterProcessLock.h *********/ #endif -#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ +#ifndef __JUCE_WAITABLEEVENT_JUCEHEADER__ -/********* Start of inlined file: juce_TimeSliceThread.h *********/ -#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ -#define __JUCE_TIMESLICETHREAD_JUCEHEADER__ +#endif +#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ -/** - Used by the TimeSliceThread class. +#endif +#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ - To register your class with a TimeSliceThread, derive from this class and - use the TimeSliceThread::addTimeSliceClient() method to add it to the list. +/********* Start of inlined file: juce_ScopedWriteLock.h *********/ +#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ +#define __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ - Make sure you always call TimeSliceThread::removeTimeSliceClient() before - deleting your client! +/** + Automatically locks and unlocks a ReadWriteLock object. - @see TimeSliceThread -*/ -class JUCE_API TimeSliceClient -{ -public: - /** Destructor. */ - virtual ~TimeSliceClient() {} + Use one of these as a local variable to control access to a ReadWriteLock. - /** Called back by a TimeSliceThread. + e.g. @code - When you register this class with it, a TimeSliceThread will repeatedly call - this method. + ReadWriteLock myLock; - The implementation of this method should use its time-slice to do something that's - quick - never block for longer than absolutely necessary. + for (;;) + { + const ScopedWriteLock myScopedLock (myLock); + // myLock is now locked - @returns Your method should return true if it needs more time, or false if it's - not too busy and doesn't need calling back urgently. If all the thread's - clients indicate that they're not busy, then it'll save CPU by sleeping for - up to half a second in between callbacks. You can force the TimeSliceThread - to wake up and poll again immediately by calling its notify() method. - */ - virtual bool useTimeSlice() = 0; -}; + ...do some stuff... -/** - A thread that keeps a list of clients, and calls each one in turn, giving them - all a chance to run some sort of short task. + // myLock gets unlocked here. + } + @endcode - @see TimeSliceClient, Thread + @see ReadWriteLock, ScopedReadLock */ -class JUCE_API TimeSliceThread : public Thread +class JUCE_API ScopedWriteLock { public: - /** - Creates a TimeSliceThread. - - When first created, the thread is not running. Use the startThread() - method to start it. - */ - TimeSliceThread (const String& threadName); + /** Creates a ScopedWriteLock. - /** Destructor. + As soon as it is created, this will call ReadWriteLock::enterWrite(), and + when the ScopedWriteLock object is deleted, the ReadWriteLock will + be unlocked. - Deleting a Thread object that is running will only give the thread a - brief opportunity to stop itself cleanly, so it's recommended that you - should always call stopThread() with a decent timeout before deleting, - to avoid the thread being forcibly killed (which is a Bad Thing). + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! Best just to use it + as a local stack object, rather than creating one with the new() operator. */ - ~TimeSliceThread(); - - /** Adds a client to the list. + inline ScopedWriteLock (const ReadWriteLock& lock) throw() : lock_ (lock) { lock.enterWrite(); } - The client's callbacks will start immediately (possibly before the method - has returned). - */ - void addTimeSliceClient (TimeSliceClient* const client); + /** Destructor. - /** Removes a client from the list. + The ReadWriteLock's exitWrite() method will be called when the destructor is called. - This method will make sure that all callbacks to the client have completely - finished before the method returns. + Make sure this object is created and deleted by the same thread, + otherwise there are no guarantees what will happen! */ - void removeTimeSliceClient (TimeSliceClient* const client); - - /** Returns the number of registered clients. */ - int getNumClients() const throw(); - - /** Returns one of the registered clients. */ - TimeSliceClient* getClient (const int index) const throw(); - - /** @internal */ - void run(); - - juce_UseDebuggingNewOperator + inline ~ScopedWriteLock() throw() { lock_.exitWrite(); } private: - CriticalSection callbackLock, listLock; - Array clients; - int index; - TimeSliceClient* clientBeingCalled; - bool clientsChanged; - TimeSliceThread (const TimeSliceThread&); - const TimeSliceThread& operator= (const TimeSliceThread&); -}; + const ReadWriteLock& lock_; -#endif // __JUCE_TIMESLICETHREAD_JUCEHEADER__ -/********* End of inlined file: juce_TimeSliceThread.h *********/ + ScopedWriteLock (const ScopedWriteLock&); + const ScopedWriteLock& operator= (const ScopedWriteLock&); +}; -#endif -#ifndef __JUCE_WAITABLEEVENT_JUCEHEADER__ +#endif // __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ +/********* End of inlined file: juce_ScopedWriteLock.h *********/ #endif @@ -14795,8 +14853,8 @@ private: #if ! JUCE_ONLY_BUILD_CORE_LIBRARY /********* Start of inlined file: juce_app_includes.h *********/ -#ifndef __JUCE_JUCE_APP_INCLUDES_INCLUDEFILES__ -#define __JUCE_JUCE_APP_INCLUDES_INCLUDEFILES__ +#ifndef __JUCE_APP_INCLUDES_JUCEHEADER__ +#define __JUCE_APP_INCLUDES_JUCEHEADER__ #ifndef __JUCE_APPLICATION_JUCEHEADER__ @@ -20045,6 +20103,7 @@ class Graphics; #define __JUCE_MESSAGE_JUCEHEADER__ class MessageListener; +class MessageManager; /** The base class for objects that can be delivered to a MessageListener. @@ -20186,8 +20245,7 @@ public: windowHasTitleBar = (1 << 3), /**< Indicates that the window should have a normal OS-specific title bar and frame\. if not specified, the window will be borderless. */ - windowIsResizable = (1 << 4), /**< Indicates that the window should let mouse clicks pass - through it (may not be possible on some platforms). */ + windowIsResizable = (1 << 4), /**< Indicates that the window should have a resizable border. */ windowHasMinimiseButton = (1 << 5), /**< Indicates that if the window has a title bar, it should have a minimise button on it. */ windowHasMaximiseButton = (1 << 6), /**< Indicates that if the window has a title bar, it should have a @@ -20199,6 +20257,9 @@ public: windowRepaintedExplictly = (1 << 9), /**< Not intended for public use - this tells a window not to do its own repainting, but only to repaint when the performAnyPendingRepaintsNow() method is called. */ + windowIgnoresKeyPresses = (1 << 10), /**< Tells the window not to catch any keypresses. This can + be used for things like plugin windows, to stop them interfering + with the host's shortcut keys */ windowIsSemiTransparent = (1 << 31) /**< Not intended for public use - makes a window transparent. */ }; @@ -23191,12 +23252,9 @@ public: and maybe cancel the quit, you'll need to handle this in the systemRequestedQuit() method - see that method's help for more info. - @param useMaximumForce if this is true, the process will be forcibly killed - before leaving the WinMain or main() function, which can - be useful if threads might have got stuck somehow. @see MessageManager, DeletedAtShutdown */ - static void quit (const bool useMaximumForce = false); + static void quit(); /** Sets the value that should be returned as the application's exit code when the app quits. @@ -23241,7 +23299,7 @@ private: int appReturnValue; bool stillInitialising; - static int shutdownAppAndClearUp (const bool useMaximumForce); + static int shutdownAppAndClearUp(); }; #endif // __JUCE_APPLICATION_JUCEHEADER__ @@ -26478,7 +26536,6 @@ public: class AudioFormatReader; class AudioFormatWriter; -const int maxNumAudioSampleBufferChannels = 32; /** A multi-channel buffer of 32-bit floating point audio samples. @@ -26807,7 +26864,7 @@ public: private: int numChannels, size, allocatedBytes; - float* channels [maxNumAudioSampleBufferChannels + 1]; + float** channels; float* allocatedData; }; @@ -26858,6 +26915,13 @@ public: void processSamples (float* const samples, const int numSamples) throw(); + /** Processes a single sample, without any locking or checking. + + Use this if you need fast processing of a single value, but be aware that + this isn't thread-safe in the way that processSamples() is. + */ + float processSingleSampleRaw (const float sample) throw(); + /** Sets the filter up to act as a low-pass filter. */ void makeLowPass (const double sampleRate, @@ -29535,6 +29599,7 @@ private: void timerCallback(); void showFor (Component* const c); + void hide(); TooltipWindow (const TooltipWindow&); const TooltipWindow& operator= (const TooltipWindow&); @@ -33077,6 +33142,14 @@ public: */ void setBorderSize (int horizontalBorder, int verticalBorder); + /** Returns the size of the horizontal gap being left around the text. + */ + int getHorizontalBorderSize() const throw() { return horizontalBorderSize; } + + /** Returns the size of the vertical gap being left around the text. + */ + int getVerticalBorderSize() const throw() { return verticalBorderSize; } + /** Makes this label "stick to" another component. This will cause the label to follow another component around, staying @@ -33103,6 +33176,15 @@ public: */ bool isAttachedOnLeft() const throw() { return leftOfOwnerComp; } + /** Specifies the minimum amount that the font can be squashed horizantally before it starts + using ellipsis. + + @see Graphics::drawFittedText + */ + void setMinimumHorizontalScale (const float newScale); + + float getMinimumHorizontalScale() const throw() { return minimumHorizontalScale; } + /** Registers a listener that will be called when the label's text changes. */ void addListener (LabelListener* const listener) throw(); @@ -33221,6 +33303,7 @@ private: Component* ownerComponent; ComponentDeletionWatcher* deletionWatcher; int horizontalBorderSize, verticalBorderSize; + float minimumHorizontalScale; bool editSingleClick : 1; bool editDoubleClick : 1; bool lossOfFocusDiscardsChanges : 1; @@ -37127,7 +37210,8 @@ private: #define __JUCE_MESSAGEMANAGER_JUCEHEADER__ class Thread; -class InternalTimerThread; +class Component; +class MessageManagerLock; /** See MessageManager::callFunctionOnMessageThread() for use of this function type */ @@ -37137,36 +37221,28 @@ typedef void* (MessageCallbackFunction) (void* userData); @see Message, MessageListener, MessageManagerLock, JUCEApplication */ -class JUCE_API MessageManager : private DeletedAtShutdown, - private Timer +class JUCE_API MessageManager : private DeletedAtShutdown { public: /** Returns the global instance of the MessageManager. */ static MessageManager* getInstance() throw(); - /** Synchronously dispatches up to a certain number of messages from the queue. - - This will return when the queue becomes empty, or when the given number of - messages has been sent. - */ - void dispatchPendingMessages (int maxNumberOfMessagesToDispatch = 1000); - - /** Synchronously sends the next pending message. + void runDispatchLoop(); + void stopDispatchLoop(); + bool hasStopMessageBeenSent() const throw() { return quitMessagePosted; } - This must only be called by the message-thread. + /** Synchronously dispatches messages until a given time has elapsed. - @param returnImmediatelyIfNoMessages if false, it will block indefinitely until a message - needs dispatching. If true, then if no messages are - pending, it will return immediately. - @param wasAMessageDispatched if this is non-zero, it will be set to true or false - depending on whether a message was actually sent or - not. - @returns false if the thing that's calling it should stop calling - i.e. if the - app is trying to quit. + Returns false if a quit message has been posted, otherwise returns true. */ - bool dispatchNextMessage (const bool returnImmediatelyIfNoMessages = false, - bool* const wasAMessageDispatched = 0); + bool runDispatchLoopUntil (int millisecondsToRunFor); + + /*int runModalLoop (Component* componentToBeModal); + bool makeComponentModal (Component* componentToBeModal); + bool isComponentModal (const Component* component) const; + Component* getCurrentModalComponent() const; + void exitModalLoop (int returnValue);*/ /** Calls a function using the message-thread. @@ -37204,7 +37280,7 @@ public: (Best to ignore this method unless you really know what you're doing..) @see setCurrentMessageThread */ - int getCurrentMessageThread() const throw() { return messageThreadId; } + int64 getCurrentMessageThread() const throw() { return messageThreadId; } /** Returns true if the caller thread has currenltly got the message manager locked. @@ -37235,37 +37311,10 @@ public: /** Deregisters a broadcast listener. */ void deregisterBroadcastListener (ActionListener* listener) throw(); - /** Sets a time-limit for the app to be 'busy' before an hourglass cursor will be shown. - - @param millisecs how long before the cursor is shown (the default time is 500ms). If the - value is 0 or less, the wait cursor will never be shown (although on the - Mac the system might still decide to show it after a while). - @see MouseCursor::showWaitCursor - */ - void setTimeBeforeShowingWaitCursor (const int millisecs) throw(); - - /** Returns the time-out before the 'busy' cursor is shown when the app is busy. - - @see setTimeBeforeShowingWaitCursor, MouseCursor::showWaitCursor - */ - int getTimeBeforeShowingWaitCursor() const throw(); - - /** Tells the message manager that the system isn't locked-up, even if the message - loop isn't active. - - Used internally, this is handy when an OS enters its own modal loop. - */ - static void delayWaitCursor() throw(); - - /** Returns true if JUCEApplication::quit() has been called. */ - bool hasQuitMessageBeenPosted() const throw(); - /** @internal */ void deliverMessage (void*); /** @internal */ void deliverBroadcastMessage (const String&); - /** @internal */ - void timerCallback(); juce_UseDebuggingNewOperator @@ -37282,28 +37331,20 @@ private: ActionListenerList* broadcastListeners; friend class JUCEApplication; - bool quitMessagePosted, quitMessageReceived, useMaximumForceWhenQuitting; + bool quitMessagePosted, quitMessageReceived; + int64 messageThreadId; - int messageThreadId; - int volatile messageCounter, lastMessageCounter, isInMessageDispatcher; - bool volatile needToGetRidOfWaitCursor; - int volatile timeBeforeWaitCursor; - unsigned int lastActivityCheckOkTime; + VoidArray modalComponents; + static void* exitModalLoopCallback (void*); - bool runDispatchLoop(); void postMessageToQueue (Message* const message); - void postQuitMessage (const bool useMaximumForce); static void doPlatformSpecificInitialisation(); static void doPlatformSpecificShutdown(); - friend class InternalTimerThread; - static void inactivityCheckCallback() throw(); - void inactivityCheckCallbackInt() throw(); - friend class MessageManagerLock; CriticalSection messageDispatchLock; - int currentLockingThreadId; + int64 currentLockingThreadId; MessageManager (const MessageManager&); const MessageManager& operator= (const MessageManager&); @@ -37406,7 +37447,7 @@ public: bool lockWasGained() const throw() { return locked; } private: - int lastLockingThreadId; + int64 lastLockingThreadId; bool locked; }; @@ -51740,6 +51781,13 @@ public: /** @internal */ void paint (Graphics& g); + /** Returns the native handle of an embedded heavyweight window, if there is one. + + E.g. On windows, this will return the HWND of the sub-window containing + the opengl context, on the mac it'll be the NSOpenGLView. + */ + void* getNativeWindowHandle() const; + juce_UseDebuggingNewOperator private: @@ -51895,20 +51943,82 @@ private: #if JUCE_WIN32 - typedef ActiveXControlComponent QTWinBaseClass; + typedef ActiveXControlComponent QTCompBaseClass; #else - typedef Component QTWinBaseClass; +/********* Start of inlined file: juce_NSViewComponent.h *********/ +#ifndef __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ +#define __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ + +#if ! DOXYGEN + class NSViewComponentInternal; +#endif + +#if JUCE_MAC || DOXYGEN + +/** + A Mac-specific class that can create and embed an NSView inside itself. + + To use it, create one of these, put it in place and make sure it's visible in a + window, then use setView() to assign an NSView to it. The view will then be + moved and resized to follow the movements of this component. + + Of course, since the view is a native object, it'll obliterate any + juce components that may overlap this component, but that's life. +*/ +class JUCE_API NSViewComponent : public Component +{ +public: + + /** Create an initially-empty container. */ + NSViewComponent(); + + /** Destructor. */ + ~NSViewComponent(); + + /** Assigns an NSView to this peer. + + The view will be retained and released by this component for as long as + it is needed. To remove the current view, just call setView (0). + + Note: a void* is used here to avoid including the cocoa headers as + part of the juce.h, but the method expects an NSView*. + */ + void setView (void* nsView); + + /** Returns the current NSView. + + Note: a void* is returned here to avoid including the cocoa headers as + a requirement of juce.h, so you should just cast the object to an NSView*. + */ + void* getView() const; + + /** @internal */ + void paint (Graphics& g); + + juce_UseDebuggingNewOperator + +private: + friend class NSViewComponentInternal; + NSViewComponentInternal* info; + + NSViewComponent (const NSViewComponent&); + const NSViewComponent& operator= (const NSViewComponent&); +}; + +#endif + +#endif // __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ +/********* End of inlined file: juce_NSViewComponent.h *********/ + + typedef NSViewComponent QTCompBaseClass; #endif /** A window that can play back a QuickTime movie. */ -class JUCE_API QuickTimeMovieComponent : public QTWinBaseClass - #if JUCE_MAC - , private Timer - #endif +class JUCE_API QuickTimeMovieComponent : public QTCompBaseClass { public: @@ -52033,40 +52143,25 @@ public: /** @internal */ void paint (Graphics& g); - /** @internal */ - void parentHierarchyChanged(); - /** @internal */ - void visibilityChanged(); -#if JUCE_MAC - /** @internal */ - void handleMCEvent (void*); - /** @internal */ - void assignMovieToWindow(); - /** @internal */ - void timerCallback(); - /** @internal */ - void moved(); - /** @internal */ - void resized(); -#endif juce_UseDebuggingNewOperator private: File movieFile; - bool movieLoaded, controllerVisible; - - void* internal; + bool movieLoaded, controllerVisible, looping; -#if JUCE_MAC - void* associatedWindow; - Rectangle lastPositionApplied; - bool controllerAssignedToWindow, reentrant, looping; - void checkWindowAssociation(); -#endif +#if JUCE_WIN32 + /** @internal */ + void parentHierarchyChanged(); + /** @internal */ + void visibilityChanged(); void createControlIfNeeded(); bool isControlCreated() const; + void* internal; +#else + void* movie; +#endif QuickTimeMovieComponent (const QuickTimeMovieComponent&); const QuickTimeMovieComponent& operator= (const QuickTimeMovieComponent&); @@ -52141,6 +52236,8 @@ private: #ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ #define __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ +#if JUCE_WEB_BROWSER + class WebBrowserComponentInternal; /** @@ -52200,8 +52297,6 @@ public: /** @internal */ void paint (Graphics& g); /** @internal */ - void moved(); - /** @internal */ void resized(); /** @internal */ void parentHierarchyChanged(); @@ -52218,13 +52313,6 @@ private: StringArray lastHeaders; MemoryBlock lastPostData; -#if JUCE_MAC - void* associatedWindow; - void updateBrowserPosition(); - void createBrowser(); - void deleteBrowser(); -#endif - void reloadLastURL(); void checkWindowAssociation(); @@ -52232,6 +52320,7 @@ private: const WebBrowserComponent& operator= (const WebBrowserComponent&); }; +#endif #endif // __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ /********* End of inlined file: juce_WebBrowserComponent.h *********/ @@ -52540,6 +52629,8 @@ public: virtual void positionComboBoxText (ComboBox& box, Label& labelToPosition); + virtual void drawLabel (Graphics& g, Label& label); + virtual void drawLinearSlider (Graphics& g, int x, int y, int width, int height, @@ -53323,7 +53414,7 @@ private: #endif -#endif +#endif // __JUCE_APP_INCLUDES_JUCEHEADER__ /********* End of inlined file: juce_app_includes.h *********/ #endif diff --git a/src/juce_amalgamated_template.cpp b/src/juce_amalgamated_template.cpp index d43074488b..eecfea8f6f 100644 --- a/src/juce_amalgamated_template.cpp +++ b/src/juce_amalgamated_template.cpp @@ -37,44 +37,22 @@ */ +#ifdef __JUCE_JUCEHEADER__ + /* When you add the amalgamated cpp file to your project, you mustn't include it in + a file where you've already included juce.h - just put it inside a file on its own, + possibly with your config flags preceding it, but don't include anything else. */ + #error +#endif + #include "../juce_Config.h" //============================================================================== #ifdef _WIN32 - #include "../build/win32/platform_specific_code/win32_headers.h" - #include - #include - #include - - #if JUCE_QUICKTIME - #include - #include - #include - #include - #include - #undef TARGET_OS_MAC // quicktime sets these, but they confuse some of the 3rd party libs - #undef MACOS - #endif - + #include "../build/win32/platform_specific_code/juce_win32_NativeIncludes.h" #elif defined (LINUX) - + // #else - #include - #include - #define __Point__ - #include - #include - #include - #include - #include - #include - #include - #include - - #include - #include - #include - #include + #include "../build/macosx/platform_specific_code/juce_mac_NativeIncludes.h" #endif //============================================================================== @@ -181,7 +159,7 @@ #include "juce_appframework/audio/plugins/juce_PluginDirectoryScanner.cpp" #include "juce_appframework/audio/plugins/juce_PluginListComponent.cpp" #include "juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.cpp" -#include "juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp" +#include "juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.mm" #include "juce_appframework/audio/processors/juce_AudioProcessor.cpp" #include "juce_appframework/audio/processors/juce_AudioProcessorEditor.cpp" #include "juce_appframework/audio/processors/juce_AudioProcessorGraph.cpp" @@ -287,7 +265,6 @@ #include "juce_appframework/gui/components/special/juce_MidiKeyboardComponent.cpp" #include "juce_appframework/gui/components/special/juce_OpenGLComponent.cpp" #include "juce_appframework/gui/components/special/juce_PreferencesPanel.cpp" -#include "juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp" #include "juce_appframework/gui/components/special/juce_SystemTrayIconComponent.cpp" #include "juce_appframework/gui/components/windows/juce_AlertWindow.cpp" #include "juce_appframework/gui/components/windows/juce_ComponentPeer.cpp" @@ -358,26 +335,7 @@ //============================================================================== #if JUCE_WIN32 -#include "../build/win32/platform_specific_code/juce_win32_Files.cpp" -#include "../build/win32/platform_specific_code/juce_win32_Network.cpp" -#include "../build/win32/platform_specific_code/juce_win32_Misc.cpp" -#include "../build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp" -#include "../build/win32/platform_specific_code/juce_win32_SystemStats.cpp" -#include "../build/win32/platform_specific_code/juce_win32_Threads.cpp" -#include "../build/win32/platform_specific_code/juce_win32_DynamicLibraryLoader.cpp" - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - #include "../build/win32/platform_specific_code/juce_win32_ASIO.cpp" - #include "../build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp" - #include "../build/win32/platform_specific_code/juce_win32_DirectSound.cpp" - #include "../build/win32/platform_specific_code/juce_win32_FileChooser.cpp" - #include "../build/win32/platform_specific_code/juce_win32_Fonts.cpp" - #include "../build/win32/platform_specific_code/juce_win32_Messaging.cpp" - #include "../build/win32/platform_specific_code/juce_win32_Midi.cpp" - #include "../build/win32/platform_specific_code/juce_win32_WebBrowserComponent.cpp" - #include "../build/win32/platform_specific_code/juce_win32_Windowing.cpp" -#endif - +#include "../build/win32/platform_specific_code/juce_win32_NativeCode.cpp" #include "../build/win32/platform_specific_code/juce_win32_AutoLinkLibraries.h" #endif @@ -407,21 +365,7 @@ //============================================================================== #if JUCE_MAC -#include "../build/macosx/platform_specific_code/juce_mac_Files.cpp" +#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_SystemStats.mm" -#include "../build/macosx/platform_specific_code/juce_mac_Threads.cpp" -#include "../build/macosx/platform_specific_code/juce_mac_Network.mm" - -#if ! JUCE_ONLY_BUILD_CORE_LIBRARY - #include "../build/macosx/platform_specific_code/juce_mac_AudioCDBurner.mm" - #include "../build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp" - #include "../build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp" - #include "../build/macosx/platform_specific_code/juce_mac_FileChooser.mm" - #include "../build/macosx/platform_specific_code/juce_mac_Fonts.mm" - #include "../build/macosx/platform_specific_code/juce_mac_Messaging.mm" - #include "../build/macosx/platform_specific_code/juce_mac_WebBrowserComponent.mm" - #include "../build/macosx/platform_specific_code/juce_mac_Windowing.mm" -#endif #endif diff --git a/src/juce_app_includes.h b/src/juce_app_includes.h index 00f3cc6e96..b955478566 100644 --- a/src/juce_app_includes.h +++ b/src/juce_app_includes.h @@ -29,8 +29,8 @@ ============================================================================== */ -#ifndef __JUCE_JUCE_APP_INCLUDES_INCLUDEFILES__ -#define __JUCE_JUCE_APP_INCLUDES_INCLUDEFILES__ +#ifndef __JUCE_APP_INCLUDES_JUCEHEADER__ +#define __JUCE_APP_INCLUDES_JUCEHEADER__ #ifndef __JUCE_APPLICATION_JUCEHEADER__ #include "juce_appframework/application/juce_Application.h" @@ -738,4 +738,4 @@ #include "juce_appframework/documents/juce_UndoManager.h" #endif -#endif +#endif // __JUCE_APP_INCLUDES_JUCEHEADER__ diff --git a/src/juce_appframework/application/juce_Application.cpp b/src/juce_appframework/application/juce_Application.cpp index 4c19436bcb..ecdaaa28c9 100644 --- a/src/juce_appframework/application/juce_Application.cpp +++ b/src/juce_appframework/application/juce_Application.cpp @@ -51,6 +51,7 @@ BEGIN_JUCE_NAMESPACE #include "../../juce_core/basics/juce_Initialisation.h" #include "../../juce_core/threads/juce_Process.h" #include "../../juce_core/threads/juce_InterProcessLock.h" +#include "../../juce_core/misc/juce_PlatformUtilities.h" void juce_setCurrentExecutableFileName (const String& filename) throw(); void juce_setCurrentThreadName (const String& name) throw(); @@ -99,9 +100,9 @@ void JUCEApplication::systemRequestedQuit() quit(); } -void JUCEApplication::quit (const bool useMaximumForce) +void JUCEApplication::quit() { - MessageManager::getInstance()->postQuitMessage (useMaximumForce); + MessageManager::getInstance()->stopDispatchLoop(); } void JUCEApplication::setApplicationReturnValue (const int newReturnValue) throw() @@ -165,7 +166,6 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) { jassert (appInstance == 0); appInstance = app; - bool useForce = true; initialiseJuce_GUI(); @@ -203,7 +203,7 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) app->stillInitialising = false; // now loop until a quit message is received.. - useForce = MessageManager::getInstance()->runDispatchLoop(); + MessageManager::getInstance()->runDispatchLoop(); MessageManager::getInstance()->deregisterBroadcastListener (app); @@ -224,10 +224,10 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) } #endif - return shutdownAppAndClearUp (useForce); + return shutdownAppAndClearUp(); } -int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) +int JUCEApplication::shutdownAppAndClearUp() { jassert (appInstance != 0); JUCEApplication* const app = appInstance; @@ -266,11 +266,6 @@ int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) } JUCE_CATCH_ALL_ASSERT - if (useMaximumForce) - { - Process::terminate(); - } - reentrancyCheck = false; } @@ -280,6 +275,10 @@ int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce) int JUCEApplication::main (int argc, char* argv[], JUCEApplication* const newApp) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + juce_setCurrentExecutableFileName (String::fromUTF8 ((const uint8*) argv[0])); String cmd; @@ -303,6 +302,9 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_GUI() { if (! juceInitialisedGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif juceInitialisedGUI = true; initialiseJuce_NonGUI(); @@ -336,6 +338,9 @@ void JUCE_PUBLIC_FUNCTION shutdownJuce_GUI() { if (juceInitialisedGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif DeletedAtShutdown::deleteAll(); LookAndFeel::clearDefaultLookAndFeel(); diff --git a/src/juce_appframework/application/juce_Application.h b/src/juce_appframework/application/juce_Application.h index 3874467169..3e55a890df 100644 --- a/src/juce_appframework/application/juce_Application.h +++ b/src/juce_appframework/application/juce_Application.h @@ -241,12 +241,9 @@ public: and maybe cancel the quit, you'll need to handle this in the systemRequestedQuit() method - see that method's help for more info. - @param useMaximumForce if this is true, the process will be forcibly killed - before leaving the WinMain or main() function, which can - be useful if threads might have got stuck somehow. @see MessageManager, DeletedAtShutdown */ - static void quit (const bool useMaximumForce = false); + static void quit(); /** Sets the value that should be returned as the application's exit code when the app quits. @@ -293,7 +290,7 @@ private: int appReturnValue; bool stillInitialising; - static int shutdownAppAndClearUp (const bool useMaximumForce); + static int shutdownAppAndClearUp(); }; diff --git a/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp b/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp index 9e9af852d0..a8f39f7779 100644 --- a/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp +++ b/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp @@ -64,6 +64,8 @@ #include "../../../juce_core/basics/juce_StandardHeader.h" +#if ! (JUCE_MAC && JUCE_64BIT) + BEGIN_JUCE_NAMESPACE #include "juce_QuickTimeAudioFormat.h" @@ -408,7 +410,7 @@ AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*stream return 0; } - END_JUCE_NAMESPACE #endif +#endif diff --git a/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp b/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp index 41bf1fc3ee..b889796480 100644 --- a/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp +++ b/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp @@ -45,10 +45,11 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_, size (numSamples) { jassert (numSamples >= 0); - jassert (numChannels_ > 0 && numChannels_ <= maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); allocatedBytes = numChannels * numSamples * sizeof (float) + 32; allocatedData = (float*) juce_malloc (allocatedBytes); + channels = (float**) juce_malloc (numChannels_ * sizeof (float*)); float* chan = allocatedData; for (int i = 0; i < numChannels_; ++i) @@ -68,7 +69,9 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo, allocatedBytes (0), allocatedData (0) { - jassert (((unsigned int) numChannels_) <= (unsigned int) maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); + + channels = (float**) juce_malloc (numChannels_ * sizeof (float*)); for (int i = 0; i < numChannels_; ++i) { @@ -85,12 +88,15 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, const int numChannels_, const int numSamples) throw() { - jassert (((unsigned int) numChannels_) <= (unsigned int) maxNumAudioSampleBufferChannels); + jassert (numChannels_ > 0); juce_free (allocatedData); allocatedData = 0; allocatedBytes = 0; + if (numChannels_ > numChannels) + channels = (float**) juce_realloc (channels, numChannels_ * sizeof (float*)); + numChannels = numChannels_; size = numSamples; @@ -109,6 +115,8 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw() : numChannels (other.numChannels), size (other.size) { + channels = (float**) juce_malloc (other.numChannels * sizeof (float*)); + if (other.allocatedData != 0) { allocatedBytes = numChannels * size * sizeof (float) + 32; @@ -152,6 +160,7 @@ const AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& AudioSampleBuffer::~AudioSampleBuffer() throw() { juce_free (allocatedData); + juce_free (channels); } float* AudioSampleBuffer::getSampleData (const int channelNumber, @@ -169,7 +178,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, const bool clearExtraSpace, const bool avoidReallocating) throw() { - jassert (newNumChannels > 0 && newNumChannels <= maxNumAudioSampleBufferChannels); + jassert (newNumChannels > 0); if (newNumSamples != size || newNumChannels != numChannels) { @@ -212,6 +221,10 @@ void AudioSampleBuffer::setSize (const int newNumChannels, } size = newNumSamples; + + if (newNumChannels > numChannels) + channels = (float**) juce_realloc (channels, newNumChannels * sizeof (float*)); + numChannels = newNumChannels; float* chan = allocatedData; diff --git a/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.h b/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.h index 3ac000ac1f..dafd71229f 100644 --- a/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.h +++ b/src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.h @@ -34,7 +34,6 @@ class AudioFormatReader; class AudioFormatWriter; -const int maxNumAudioSampleBufferChannels = 32; //============================================================================== @@ -371,7 +370,7 @@ public: private: int numChannels, size, allocatedBytes; - float* channels [maxNumAudioSampleBufferChannels + 1]; + float** channels; float* allocatedData; }; diff --git a/src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.mm b/src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.mm new file mode 100644 index 0000000000..b41685c7ca --- /dev/null +++ b/src/juce_appframework/audio/plugins/formats/juce_AudioUnitPluginFormat.mm @@ -0,0 +1,1332 @@ +/* + ============================================================================== + + 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 "../../../../../juce_Config.h" + +#if JUCE_PLUGINHOST_AU && (! (defined (LINUX) || defined (_WIN32))) + +#include +#include + +#if JUCE_MAC && JUCE_32BIT + #define JUCE_SUPPORT_CARBON 1 +#endif + +#if JUCE_SUPPORT_CARBON +#include +#include +#endif + +#include "../../../../juce_core/basics/juce_StandardHeader.h" + +BEGIN_JUCE_NAMESPACE + +#include "juce_AudioUnitPluginFormat.h" +#include "../juce_PluginDescription.h" +#include "../../../../juce_core/threads/juce_ScopedLock.h" +#include "../../../../juce_appframework/events/juce_Timer.h" +#include "../../../../juce_core/misc/juce_PlatformUtilities.h" +#include "../../../../juce_appframework/gui/components/layout/juce_ComponentMovementWatcher.h" +#include "../../../../juce_appframework/gui/components/special/juce_NSViewComponent.h" + +#if JUCE_MAC + +#if MACOS_10_3_OR_EARLIER + #define kAudioUnitType_Generator 'augn' +#endif + +// Change this to disable logging of various activities +#ifndef AU_LOGGING + #define AU_LOGGING 1 +#endif + +#if AU_LOGGING + #define log(a) Logger::writeToLog(a); +#else + #define log(a) +#endif + +#if JUCE_SUPPORT_CARBON +#include "../../../../../build/macosx/platform_specific_code/juce_mac_CarbonViewWrapperComponent.h" +#endif + + +static int insideCallback = 0; + +//============================================================================== +class AudioUnitPluginWindowCarbon; +class AudioUnitPluginWindowCocoa; + +//============================================================================== +class AudioUnitPluginInstance : public AudioPluginInstance +{ +public: + //============================================================================== + ~AudioUnitPluginInstance(); + + //============================================================================== + // AudioPluginInstance methods: + + void fillInPluginDescription (PluginDescription& desc) const + { + desc.name = pluginName; + desc.file = file; + desc.uid = ((int) componentDesc.componentType) + ^ ((int) componentDesc.componentSubType) + ^ ((int) componentDesc.componentManufacturer); + desc.lastFileModTime = file.getLastModificationTime(); + desc.pluginFormatName = "AudioUnit"; + desc.category = getCategory(); + desc.manufacturerName = manufacturer; + desc.version = version; + desc.numInputChannels = getNumInputChannels(); + desc.numOutputChannels = getNumOutputChannels(); + desc.isInstrument = (componentDesc.componentType == kAudioUnitType_MusicDevice); + } + + const String getName() const { return pluginName; } + bool acceptsMidi() const { return wantsMidiMessages; } + bool producesMidi() const { return false; } + + //============================================================================== + // AudioProcessor methods: + + void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock); + void releaseResources(); + void processBlock (AudioSampleBuffer& buffer, + MidiBuffer& midiMessages); + + AudioProcessorEditor* createEditor(); + + const String getInputChannelName (const int index) const; + bool isInputChannelStereoPair (int index) const; + + const String getOutputChannelName (const int index) const; + bool isOutputChannelStereoPair (int index) const; + + //============================================================================== + int getNumParameters(); + float getParameter (int index); + void setParameter (int index, float newValue); + const String getParameterName (int index); + const String getParameterText (int index); + bool isParameterAutomatable (int index) const; + + //============================================================================== + int getNumPrograms(); + int getCurrentProgram(); + void setCurrentProgram (int index); + const String getProgramName (int index); + void changeProgramName (int index, const String& newName); + + //============================================================================== + void getStateInformation (MemoryBlock& destData); + void getCurrentProgramStateInformation (MemoryBlock& destData); + void setStateInformation (const void* data, int sizeInBytes); + void setCurrentProgramStateInformation (const void* data, int sizeInBytes); + + //============================================================================== + juce_UseDebuggingNewOperator + +private: + friend class AudioUnitPluginWindowCarbon; + friend class AudioUnitPluginWindowCocoa; + friend class AudioUnitPluginFormat; + + ComponentDescription componentDesc; + String pluginName, manufacturer, version; + File file; + CriticalSection lock; + bool initialised, wantsMidiMessages, wasPlaying; + + AudioBufferList* outputBufferList; + AudioTimeStamp timeStamp; + AudioSampleBuffer* currentBuffer; + + AudioUnit audioUnit; + Array parameterIds; + + //============================================================================== + bool getComponentDescFromFile (const File& file); + void initialise(); + + //============================================================================== + OSStatus renderGetInput (AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData) const; + + static OSStatus renderGetInputCallback (void* inRefCon, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData) + { + return ((AudioUnitPluginInstance*) inRefCon) + ->renderGetInput (ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData); + } + + OSStatus getBeatAndTempo (Float64* outCurrentBeat, Float64* outCurrentTempo) const; + OSStatus getMusicalTimeLocation (UInt32* outDeltaSampleOffsetToNextBeat, Float32* outTimeSig_Numerator, + UInt32* outTimeSig_Denominator, Float64* outCurrentMeasureDownBeat) const; + OSStatus getTransportState (Boolean* outIsPlaying, Boolean* outTransportStateChanged, + Float64* outCurrentSampleInTimeLine, Boolean* outIsCycling, + Float64* outCycleStartBeat, Float64* outCycleEndBeat); + + static OSStatus getBeatAndTempoCallback (void* inHostUserData, Float64* outCurrentBeat, Float64* outCurrentTempo) + { + return ((AudioUnitPluginInstance*) inHostUserData)->getBeatAndTempo (outCurrentBeat, outCurrentTempo); + } + + static OSStatus getMusicalTimeLocationCallback (void* inHostUserData, UInt32* outDeltaSampleOffsetToNextBeat, + Float32* outTimeSig_Numerator, UInt32* outTimeSig_Denominator, + Float64* outCurrentMeasureDownBeat) + { + return ((AudioUnitPluginInstance*) inHostUserData) + ->getMusicalTimeLocation (outDeltaSampleOffsetToNextBeat, outTimeSig_Numerator, + outTimeSig_Denominator, outCurrentMeasureDownBeat); + } + + static OSStatus getTransportStateCallback (void* inHostUserData, Boolean* outIsPlaying, Boolean* outTransportStateChanged, + Float64* outCurrentSampleInTimeLine, Boolean* outIsCycling, + Float64* outCycleStartBeat, Float64* outCycleEndBeat) + { + return ((AudioUnitPluginInstance*) inHostUserData) + ->getTransportState (outIsPlaying, outTransportStateChanged, + outCurrentSampleInTimeLine, outIsCycling, + outCycleStartBeat, outCycleEndBeat); + } + + //============================================================================== + void getNumChannels (int& numIns, int& numOuts) + { + numIns = 0; + numOuts = 0; + + AUChannelInfo supportedChannels [128]; + UInt32 supportedChannelsSize = sizeof (supportedChannels); + + if (AudioUnitGetProperty (audioUnit, kAudioUnitProperty_SupportedNumChannels, kAudioUnitScope_Global, + 0, supportedChannels, &supportedChannelsSize) == noErr + && supportedChannelsSize > 0) + { + for (int i = 0; i < supportedChannelsSize / sizeof (AUChannelInfo); ++i) + { + numIns = jmax (numIns, supportedChannels[i].inChannels); + numOuts = jmax (numOuts, supportedChannels[i].outChannels); + } + } + else + { + // (this really means the plugin will take any number of ins/outs as long + // as they are the same) + numIns = numOuts = 2; + } + } + + const String getCategory() const; + + //============================================================================== + AudioUnitPluginInstance (const File& file); +}; + +//============================================================================== +AudioUnitPluginInstance::AudioUnitPluginInstance (const File& file_) + : file (file_), + initialised (false), + wantsMidiMessages (false), + audioUnit (0), + outputBufferList (0), + currentBuffer (0) +{ + try + { + ++insideCallback; + + log (T("Opening AU: ") + file.getFullPathName()); + + if (getComponentDescFromFile (file)) + { + ComponentRecord* const comp = FindNextComponent (0, &componentDesc); + + if (comp != 0) + { + audioUnit = (AudioUnit) OpenComponent (comp); + + wantsMidiMessages = componentDesc.componentType == kAudioUnitType_MusicDevice + || componentDesc.componentType == kAudioUnitType_MusicEffect; + } + } + + --insideCallback; + } + catch (...) + { + --insideCallback; + } +} + +AudioUnitPluginInstance::~AudioUnitPluginInstance() +{ + { + const ScopedLock sl (lock); + + jassert (insideCallback == 0); + + if (audioUnit != 0) + { + AudioUnitUninitialize (audioUnit); + CloseComponent (audioUnit); + audioUnit = 0; + } + } + + juce_free (outputBufferList); +} + +bool AudioUnitPluginInstance::getComponentDescFromFile (const File& file) +{ + zerostruct (componentDesc); + + if (! file.hasFileExtension (T(".component"))) + return false; + + const String filename (file.getFullPathName()); + const char* const utf8 = filename.toUTF8(); + CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, + strlen (utf8), file.isDirectory()); + if (url != 0) + { + CFBundleRef bundleRef = CFBundleCreate (kCFAllocatorDefault, url); + CFRelease (url); + + if (bundleRef != 0) + { + CFTypeRef name = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleName")); + + if (name != 0 && CFGetTypeID (name) == CFStringGetTypeID()) + pluginName = PlatformUtilities::cfStringToJuceString ((CFStringRef) name); + + if (pluginName.isEmpty()) + pluginName = file.getFileNameWithoutExtension(); + + CFTypeRef versionString = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleVersion")); + + if (versionString != 0 && CFGetTypeID (versionString) == CFStringGetTypeID()) + version = PlatformUtilities::cfStringToJuceString ((CFStringRef) versionString); + + CFTypeRef manuString = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleGetInfoString")); + + if (manuString != 0 && CFGetTypeID (manuString) == CFStringGetTypeID()) + manufacturer = PlatformUtilities::cfStringToJuceString ((CFStringRef) manuString); + + short resFileId = CFBundleOpenBundleResourceMap (bundleRef); + UseResFile (resFileId); + + for (int i = 1; i <= Count1Resources ('thng'); ++i) + { + Handle h = Get1IndResource ('thng', i); + + if (h != 0) + { + HLock (h); + const uint32* const types = (const uint32*) *h; + + if (types[0] == kAudioUnitType_MusicDevice + || types[0] == kAudioUnitType_MusicEffect + || types[0] == kAudioUnitType_Effect + || types[0] == kAudioUnitType_Generator + || types[0] == kAudioUnitType_Panner) + { + componentDesc.componentType = types[0]; + componentDesc.componentSubType = types[1]; + componentDesc.componentManufacturer = types[2]; + break; + } + + HUnlock (h); + ReleaseResource (h); + } + } + + CFBundleCloseBundleResourceMap (bundleRef, resFileId); + CFRelease (bundleRef); + } + } + + return componentDesc.componentType != 0 && componentDesc.componentSubType != 0; +} + +//============================================================================== +void AudioUnitPluginInstance::initialise() +{ + if (initialised || audioUnit == 0) + return; + + log (T("Initialising AU: ") + pluginName); + + parameterIds.clear(); + + { + UInt32 paramListSize = 0; + AudioUnitGetProperty (audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, + 0, 0, ¶mListSize); + + if (paramListSize > 0) + { + parameterIds.insertMultiple (0, 0, paramListSize / sizeof (int)); + + AudioUnitGetProperty (audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, + 0, ¶meterIds.getReference(0), ¶mListSize); + } + } + + { + AURenderCallbackStruct info; + zerostruct (info); + info.inputProcRefCon = this; + info.inputProc = renderGetInputCallback; + + AudioUnitSetProperty (audioUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, + 0, &info, sizeof (info)); + } + + { + HostCallbackInfo info; + zerostruct (info); + info.hostUserData = this; + info.beatAndTempoProc = getBeatAndTempoCallback; + info.musicalTimeLocationProc = getMusicalTimeLocationCallback; + info.transportStateProc = getTransportStateCallback; + + AudioUnitSetProperty (audioUnit, kAudioUnitProperty_HostCallbacks, kAudioUnitScope_Global, + 0, &info, sizeof (info)); + } + + int numIns, numOuts; + getNumChannels (numIns, numOuts); + setPlayConfigDetails (numIns, numOuts, 0, 0); + + initialised = AudioUnitInitialize (audioUnit) == noErr; + + setLatencySamples (0); +} + + +//============================================================================== +void AudioUnitPluginInstance::prepareToPlay (double sampleRate_, + int samplesPerBlockExpected) +{ + initialise(); + + if (initialised) + { + int numIns, numOuts; + getNumChannels (numIns, numOuts); + + setPlayConfigDetails (numIns, numOuts, sampleRate_, samplesPerBlockExpected); + + Float64 latencySecs = 0.0; + UInt32 latencySize = sizeof (latencySecs); + AudioUnitGetProperty (audioUnit, kAudioUnitProperty_Latency, kAudioUnitScope_Global, + 0, &latencySecs, &latencySize); + + setLatencySamples (roundDoubleToInt (latencySecs * sampleRate_)); + + AudioUnitReset (audioUnit, kAudioUnitScope_Input, 0); + AudioUnitReset (audioUnit, kAudioUnitScope_Output, 0); + AudioUnitReset (audioUnit, kAudioUnitScope_Global, 0); + + AudioStreamBasicDescription stream; + zerostruct (stream); + stream.mSampleRate = sampleRate_; + stream.mFormatID = kAudioFormatLinearPCM; + stream.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved; + stream.mFramesPerPacket = 1; + stream.mBytesPerPacket = 4; + stream.mBytesPerFrame = 4; + stream.mBitsPerChannel = 32; + stream.mChannelsPerFrame = numIns; + + OSStatus err = AudioUnitSetProperty (audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + 0, &stream, sizeof (stream)); + + stream.mChannelsPerFrame = numOuts; + + err = AudioUnitSetProperty (audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + 0, &stream, sizeof (stream)); + + juce_free (outputBufferList); + outputBufferList = (AudioBufferList*) juce_calloc (sizeof (AudioBufferList) + sizeof (AudioBuffer) * (numOuts + 1)); + outputBufferList->mNumberBuffers = numOuts; + + for (int i = numOuts; --i >= 0;) + outputBufferList->mBuffers[i].mNumberChannels = 1; + + zerostruct (timeStamp); + timeStamp.mSampleTime = 0; + timeStamp.mHostTime = AudioGetCurrentHostTime(); + timeStamp.mFlags = kAudioTimeStampSampleTimeValid | kAudioTimeStampHostTimeValid; + + currentBuffer = 0; + wasPlaying = false; + } +} + +void AudioUnitPluginInstance::releaseResources() +{ + if (initialised) + { + AudioUnitReset (audioUnit, kAudioUnitScope_Input, 0); + AudioUnitReset (audioUnit, kAudioUnitScope_Output, 0); + AudioUnitReset (audioUnit, kAudioUnitScope_Global, 0); + + juce_free (outputBufferList); + outputBufferList = 0; + currentBuffer = 0; + } +} + +OSStatus AudioUnitPluginInstance::renderGetInput (AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData) const +{ + if (inBusNumber == 0 + && currentBuffer != 0) + { + jassert (inNumberFrames == currentBuffer->getNumSamples()); // if this ever happens, might need to add extra handling + + for (int i = 0; i < ioData->mNumberBuffers; ++i) + { + if (i < currentBuffer->getNumChannels()) + { + memcpy (ioData->mBuffers[i].mData, + currentBuffer->getSampleData (i, 0), + sizeof (float) * inNumberFrames); + } + else + { + zeromem (ioData->mBuffers[i].mData, sizeof (float) * inNumberFrames); + } + } + } + + return noErr; +} + +void AudioUnitPluginInstance::processBlock (AudioSampleBuffer& buffer, + MidiBuffer& midiMessages) +{ + const int numSamples = buffer.getNumSamples(); + + if (initialised) + { + AudioUnitRenderActionFlags flags = 0; + + timeStamp.mHostTime = AudioGetCurrentHostTime(); + + for (int i = getNumOutputChannels(); --i >= 0;) + { + outputBufferList->mBuffers[i].mDataByteSize = sizeof (float) * numSamples; + outputBufferList->mBuffers[i].mData = buffer.getSampleData (i, 0); + } + + currentBuffer = &buffer; + + if (wantsMidiMessages) + { + const uint8* midiEventData; + int midiEventSize, midiEventPosition; + MidiBuffer::Iterator i (midiMessages); + + while (i.getNextEvent (midiEventData, midiEventSize, midiEventPosition)) + { + if (midiEventSize <= 3) + MusicDeviceMIDIEvent (audioUnit, + midiEventData[0], midiEventData[1], midiEventData[2], + midiEventPosition); + else + MusicDeviceSysEx (audioUnit, midiEventData, midiEventSize); + } + + midiMessages.clear(); + } + + AudioUnitRender (audioUnit, &flags, &timeStamp, + 0, numSamples, outputBufferList); + + timeStamp.mSampleTime += numSamples; + } + else + { + // Not initialised, so just bypass.. + for (int i = getNumInputChannels(); i < getNumOutputChannels(); ++i) + buffer.clear (i, 0, buffer.getNumSamples()); + } +} + +//============================================================================== +OSStatus AudioUnitPluginInstance::getBeatAndTempo (Float64* outCurrentBeat, Float64* outCurrentTempo) const +{ + AudioPlayHead* const ph = getPlayHead(); + AudioPlayHead::CurrentPositionInfo result; + + if (ph != 0 && ph->getCurrentPosition (result)) + { + *outCurrentBeat = result.ppqPosition; + *outCurrentTempo = result.bpm; + } + else + { + *outCurrentBeat = 0; + *outCurrentTempo = 120.0; + } + + return noErr; +} + +OSStatus AudioUnitPluginInstance::getMusicalTimeLocation (UInt32* outDeltaSampleOffsetToNextBeat, + Float32* outTimeSig_Numerator, + UInt32* outTimeSig_Denominator, + Float64* outCurrentMeasureDownBeat) const +{ + AudioPlayHead* const ph = getPlayHead(); + AudioPlayHead::CurrentPositionInfo result; + + if (ph != 0 && ph->getCurrentPosition (result)) + { + *outTimeSig_Numerator = result.timeSigNumerator; + *outTimeSig_Denominator = result.timeSigDenominator; + + *outDeltaSampleOffsetToNextBeat = 0; //xxx + *outCurrentMeasureDownBeat = result.ppqPositionOfLastBarStart; //xxx wrong + } + else + { + *outDeltaSampleOffsetToNextBeat = 0; + *outTimeSig_Numerator = 4; + *outTimeSig_Denominator = 4; + *outCurrentMeasureDownBeat = 0; + } + + return noErr; +} + +OSStatus AudioUnitPluginInstance::getTransportState (Boolean* outIsPlaying, + Boolean* outTransportStateChanged, + Float64* outCurrentSampleInTimeLine, + Boolean* outIsCycling, + Float64* outCycleStartBeat, + Float64* outCycleEndBeat) +{ + AudioPlayHead* const ph = getPlayHead(); + AudioPlayHead::CurrentPositionInfo result; + + if (ph != 0 && ph->getCurrentPosition (result)) + { + if (outIsPlaying != 0) + *outIsPlaying = result.isPlaying; + + if (outTransportStateChanged != 0) + { + *outTransportStateChanged = result.isPlaying != wasPlaying; + wasPlaying = result.isPlaying; + } + + if (outCurrentSampleInTimeLine != 0) + *outCurrentSampleInTimeLine = roundDoubleToInt (result.timeInSeconds * getSampleRate()); + + if (outIsCycling != 0) + *outIsCycling = false; + + if (outCycleStartBeat != 0) + *outCycleStartBeat = 0; + + if (outCycleEndBeat != 0) + *outCycleEndBeat = 0; + } + else + { + if (outIsPlaying != 0) + *outIsPlaying = false; + + if (outTransportStateChanged != 0) + *outTransportStateChanged = false; + + if (outCurrentSampleInTimeLine != 0) + *outCurrentSampleInTimeLine = 0; + + if (outIsCycling != 0) + *outIsCycling = false; + + if (outCycleStartBeat != 0) + *outCycleStartBeat = 0; + + if (outCycleEndBeat != 0) + *outCycleEndBeat = 0; + } + + return noErr; +} + + +//============================================================================== +static VoidArray activeWindows; + +class AudioUnitPluginWindowCocoa : public AudioProcessorEditor +{ +public: + AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& plugin_) + : AudioProcessorEditor (&plugin_), + plugin (plugin_), + wrapper (0) + { + addAndMakeVisible (wrapper = new NSViewComponent()); + + activeWindows.add (this); + + setOpaque (true); + setVisible (true); + setSize (100, 100); + + createView(); + } + + ~AudioUnitPluginWindowCocoa() + { + wrapper->setView (0); + activeWindows.removeValue (this); + if (isValid()) + plugin.editorBeingDeleted (this); + delete wrapper; + } + + bool isValid() const { return wrapper->getView() != 0; } + + void resized() + { + wrapper->setSize (getWidth(), getHeight()); + } + +private: + AudioUnitPluginInstance& plugin; + NSViewComponent* wrapper; + + bool createView() + { + UInt32 dataSize = 0; + Boolean isWritable = false; + if (AudioUnitGetPropertyInfo (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global, + 0, &dataSize, &isWritable) != noErr + || dataSize == 0) + { + return false; + } + + if (AudioUnitGetPropertyInfo (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global, + 0, &dataSize, &isWritable) != noErr) + { + return false; + } + + NSView* pluginView = 0; + AudioUnitCocoaViewInfo* info = (AudioUnitCocoaViewInfo*) juce_calloc (dataSize); + + if (AudioUnitGetProperty (plugin.audioUnit, kAudioUnitProperty_CocoaUI, kAudioUnitScope_Global, + 0, info, &dataSize) == noErr) + { + NSString* viewClassName = (NSString*) (info->mCocoaAUViewClass[0]); + NSString* path = (NSString*) CFURLCopyPath (info->mCocoaAUViewBundleLocation); + NSBundle* viewBundle = [NSBundle bundleWithPath: [path autorelease]]; + Class viewClass = [viewBundle classNamed: viewClassName]; + + if ([viewClass conformsToProtocol: @protocol (AUCocoaUIBase)] + && [viewClass instancesRespondToSelector: @selector (interfaceVersion)] + && [viewClass instancesRespondToSelector: @selector (uiViewForAudioUnit: withSize:)]) + { + id factory = [[[viewClass alloc] init] autorelease]; + pluginView = [factory uiViewForAudioUnit: plugin.audioUnit + withSize: NSMakeSize (getWidth(), getHeight())]; + } + + for (int i = (dataSize - sizeof (CFURLRef)) / sizeof (CFStringRef); --i >= 0;) + { + CFRelease (info->mCocoaAUViewClass[i]); + CFRelease (info->mCocoaAUViewBundleLocation); + } + } + + juce_free (info); + wrapper->setView (pluginView); + return pluginView != 0; + } +}; + +#if JUCE_SUPPORT_CARBON + +//============================================================================== +class AudioUnitPluginWindowCarbon : public AudioProcessorEditor +{ +public: + //============================================================================== + AudioUnitPluginWindowCarbon (AudioUnitPluginInstance& plugin_) + : AudioProcessorEditor (&plugin_), + plugin (plugin_), + viewComponent (0) + { + addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this)); + + activeWindows.add (this); + + setOpaque (true); + setVisible (true); + setSize (400, 300); + + ComponentDescription viewList [16]; + UInt32 viewListSize = sizeof (viewList); + AudioUnitGetProperty (plugin.audioUnit, kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, + 0, &viewList, &viewListSize); + + componentRecord = FindNextComponent (0, &viewList[0]); + } + + ~AudioUnitPluginWindowCarbon() + { + deleteAndZero (innerWrapper); + + activeWindows.removeValue (this); + + if (isValid()) + plugin.editorBeingDeleted (this); + } + + bool isValid() const throw() { return componentRecord != 0; } + + //============================================================================== + void paint (Graphics& g) + { + g.fillAll (Colours::black); + } + + void resized() + { + innerWrapper->setSize (getWidth(), getHeight()); + } + + //============================================================================== + bool keyStateChanged() + { + return false; + } + + bool keyPressed (const KeyPress&) + { + return false; + } + + //============================================================================== + void broughtToFront() + { + activeWindows.removeValue (this); + activeWindows.add (this); + } + + //============================================================================== + AudioUnit getAudioUnit() const { return plugin.audioUnit; } + + AudioUnitCarbonView getViewComponent() + { + if (viewComponent == 0 && componentRecord != 0) + viewComponent = (AudioUnitCarbonView) OpenComponent (componentRecord); + + return viewComponent; + } + + void closeViewComponent() + { + if (viewComponent != 0) + { + CloseComponent (viewComponent); + viewComponent = 0; + } + } + + //============================================================================== + juce_UseDebuggingNewOperator + +private: + AudioUnitPluginInstance& plugin; + ComponentRecord* componentRecord; + AudioUnitCarbonView viewComponent; + + //============================================================================== + class InnerWrapperComponent : public CarbonViewWrapperComponent + { + public: + InnerWrapperComponent (AudioUnitPluginWindowCarbon* const owner_) + : owner (owner_) + { + } + + ~InnerWrapperComponent() + { + deleteWindow(); + } + + HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) + { + log (T("Opening AU GUI: ") + owner->plugin.getName()); + + AudioUnitCarbonView viewComponent = owner->getViewComponent(); + + if (viewComponent == 0) + return 0; + + Float32Point pos = { 0, 0 }; + Float32Point size = { 250, 200 }; + + HIViewRef pluginView = 0; + + AudioUnitCarbonViewCreate (viewComponent, + owner->getAudioUnit(), + windowRef, + rootView, + &pos, + &size, + (ControlRef*) &pluginView); + + return pluginView; + } + + void removeView (HIViewRef) + { + log (T("Closing AU GUI: ") + owner->plugin.getName()); + + owner->closeViewComponent(); + } + + private: + AudioUnitPluginWindowCarbon* const owner; + }; + + friend class InnerWrapperComponent; + InnerWrapperComponent* innerWrapper; +}; + +#endif + +//============================================================================== +AudioProcessorEditor* AudioUnitPluginInstance::createEditor() +{ + AudioProcessorEditor* w = new AudioUnitPluginWindowCocoa (*this); + + if (! ((AudioUnitPluginWindowCocoa*) w)->isValid()) + deleteAndZero (w); + +#if JUCE_SUPPORT_CARBON + if (w == 0) + { + w = new AudioUnitPluginWindowCarbon (*this); + + if (! ((AudioUnitPluginWindowCarbon*) w)->isValid()) + deleteAndZero (w); + } +#endif + + return w; +} + + +//============================================================================== +const String AudioUnitPluginInstance::getCategory() const +{ + const char* result = 0; + + switch (componentDesc.componentType) + { + case kAudioUnitType_Effect: + case kAudioUnitType_MusicEffect: + result = "Effect"; + break; + case kAudioUnitType_MusicDevice: + result = "Synth"; + break; + case kAudioUnitType_Generator: + result = "Generator"; + break; + case kAudioUnitType_Panner: + result = "Panner"; + break; + default: + break; + } + + return result; +} + +//============================================================================== +int AudioUnitPluginInstance::getNumParameters() +{ + return parameterIds.size(); +} + +float AudioUnitPluginInstance::getParameter (int index) +{ + const ScopedLock sl (lock); + + Float32 value = 0.0f; + + if (audioUnit != 0 && ((unsigned int) index) < (unsigned int) parameterIds.size()) + { + AudioUnitGetParameter (audioUnit, + (UInt32) parameterIds.getUnchecked (index), + kAudioUnitScope_Global, 0, + &value); + } + + return value; +} + +void AudioUnitPluginInstance::setParameter (int index, float newValue) +{ + const ScopedLock sl (lock); + + if (audioUnit != 0 && ((unsigned int) index) < (unsigned int) parameterIds.size()) + { + AudioUnitSetParameter (audioUnit, + (UInt32) parameterIds.getUnchecked (index), + kAudioUnitScope_Global, 0, + newValue, 0); + } +} + +const String AudioUnitPluginInstance::getParameterName (int index) +{ + AudioUnitParameterInfo info; + zerostruct (info); + UInt32 sz = sizeof (info); + + String name; + + if (AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_ParameterInfo, + kAudioUnitScope_Global, + parameterIds [index], &info, &sz) == noErr) + { + if ((info.flags & kAudioUnitParameterFlag_HasCFNameString) != 0) + name = PlatformUtilities::cfStringToJuceString (info.cfNameString); + else + name = String (info.name, sizeof (info.name)); + } + + return name; +} + +const String AudioUnitPluginInstance::getParameterText (int index) +{ + return String (getParameter (index)); +} + +bool AudioUnitPluginInstance::isParameterAutomatable (int index) const +{ + AudioUnitParameterInfo info; + UInt32 sz = sizeof (info); + + if (AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_ParameterInfo, + kAudioUnitScope_Global, + parameterIds [index], &info, &sz) == noErr) + { + return (info.flags & kAudioUnitParameterFlag_NonRealTime) == 0; + } + + return true; +} + +//============================================================================== +int AudioUnitPluginInstance::getNumPrograms() +{ + CFArrayRef presets; + UInt32 sz = sizeof (CFArrayRef); + int num = 0; + + if (AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_FactoryPresets, + kAudioUnitScope_Global, + 0, &presets, &sz) == noErr) + { + num = (int) CFArrayGetCount (presets); + CFRelease (presets); + } + + return num; +} + +int AudioUnitPluginInstance::getCurrentProgram() +{ + AUPreset current; + current.presetNumber = 0; + UInt32 sz = sizeof (AUPreset); + + AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_FactoryPresets, + kAudioUnitScope_Global, + 0, ¤t, &sz); + + return current.presetNumber; +} + +void AudioUnitPluginInstance::setCurrentProgram (int newIndex) +{ + AUPreset current; + current.presetNumber = newIndex; + current.presetName = 0; + + AudioUnitSetProperty (audioUnit, + kAudioUnitProperty_FactoryPresets, + kAudioUnitScope_Global, + 0, ¤t, sizeof (AUPreset)); +} + +const String AudioUnitPluginInstance::getProgramName (int index) +{ + String s; + CFArrayRef presets; + UInt32 sz = sizeof (CFArrayRef); + + if (AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_FactoryPresets, + kAudioUnitScope_Global, + 0, &presets, &sz) == noErr) + { + for (CFIndex i = 0; i < CFArrayGetCount (presets); ++i) + { + const AUPreset* p = (const AUPreset*) CFArrayGetValueAtIndex (presets, i); + + if (p != 0 && p->presetNumber == index) + { + s = PlatformUtilities::cfStringToJuceString (p->presetName); + break; + } + } + + CFRelease (presets); + } + + return s; +} + +void AudioUnitPluginInstance::changeProgramName (int index, const String& newName) +{ + jassertfalse // xxx not implemented! +} + +//============================================================================== +const String AudioUnitPluginInstance::getInputChannelName (const int index) const +{ + if (((unsigned int) index) < (unsigned int) getNumInputChannels()) + return T("Input ") + String (index + 1); + + return String::empty; +} + +bool AudioUnitPluginInstance::isInputChannelStereoPair (int index) const +{ + if (((unsigned int) index) >= (unsigned int) getNumInputChannels()) + return false; + + + return true; +} + +const String AudioUnitPluginInstance::getOutputChannelName (const int index) const +{ + if (((unsigned int) index) < (unsigned int) getNumOutputChannels()) + return T("Output ") + String (index + 1); + + return String::empty; +} + +bool AudioUnitPluginInstance::isOutputChannelStereoPair (int index) const +{ + if (((unsigned int) index) >= (unsigned int) getNumOutputChannels()) + return false; + + return true; +} + +//============================================================================== +void AudioUnitPluginInstance::getStateInformation (MemoryBlock& destData) +{ + getCurrentProgramStateInformation (destData); +} + +void AudioUnitPluginInstance::getCurrentProgramStateInformation (MemoryBlock& destData) +{ + CFPropertyListRef propertyList = 0; + UInt32 sz = sizeof (CFPropertyListRef); + + if (AudioUnitGetProperty (audioUnit, + kAudioUnitProperty_ClassInfo, + kAudioUnitScope_Global, + 0, &propertyList, &sz) == noErr) + { + CFWriteStreamRef stream = CFWriteStreamCreateWithAllocatedBuffers (kCFAllocatorDefault, kCFAllocatorDefault); + CFWriteStreamOpen (stream); + + CFIndex bytesWritten = CFPropertyListWriteToStream (propertyList, stream, kCFPropertyListBinaryFormat_v1_0, 0); + CFWriteStreamClose (stream); + + CFDataRef data = (CFDataRef) CFWriteStreamCopyProperty (stream, kCFStreamPropertyDataWritten); + + destData.setSize (bytesWritten); + destData.copyFrom (CFDataGetBytePtr (data), 0, destData.getSize()); + CFRelease (data); + + CFRelease (stream); + CFRelease (propertyList); + } +} + +void AudioUnitPluginInstance::setStateInformation (const void* data, int sizeInBytes) +{ + setCurrentProgramStateInformation (data, sizeInBytes); +} + +void AudioUnitPluginInstance::setCurrentProgramStateInformation (const void* data, int sizeInBytes) +{ + CFReadStreamRef stream = CFReadStreamCreateWithBytesNoCopy (kCFAllocatorDefault, + (const UInt8*) data, + sizeInBytes, + kCFAllocatorNull); + CFReadStreamOpen (stream); + + CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0; + CFPropertyListRef propertyList = CFPropertyListCreateFromStream (kCFAllocatorDefault, + stream, + 0, + kCFPropertyListImmutable, + &format, + 0); + CFRelease (stream); + + if (propertyList != 0) + AudioUnitSetProperty (audioUnit, + kAudioUnitProperty_ClassInfo, + kAudioUnitScope_Global, + 0, &propertyList, sizeof (propertyList)); +} + +//============================================================================== +//============================================================================== +AudioUnitPluginFormat::AudioUnitPluginFormat() +{ +} + +AudioUnitPluginFormat::~AudioUnitPluginFormat() +{ +} + +void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray & results, + const File& file) +{ + if (! fileMightContainThisPluginType (file)) + return; + + PluginDescription desc; + desc.file = file; + desc.uid = 0; + + AudioUnitPluginInstance* instance = dynamic_cast (createInstanceFromDescription (desc)); + + if (instance == 0) + return; + + try + { + instance->fillInPluginDescription (desc); + results.add (new PluginDescription (desc)); + } + catch (...) + { + // crashed while loading... + } + + deleteAndZero (instance); +} + +AudioPluginInstance* AudioUnitPluginFormat::createInstanceFromDescription (const PluginDescription& desc) +{ + AudioUnitPluginInstance* result = 0; + + if (fileMightContainThisPluginType (desc.file)) + { + result = new AudioUnitPluginInstance (desc.file); + + if (result->audioUnit != 0) + { + result->initialise(); + } + else + { + deleteAndZero (result); + } + } + + return result; +} + +bool AudioUnitPluginFormat::fileMightContainThisPluginType (const File& f) +{ + return f.hasFileExtension (T(".component")) + && f.isDirectory(); +} + +const FileSearchPath AudioUnitPluginFormat::getDefaultLocationsToSearch() +{ + return FileSearchPath ("~/Library/Audio/Plug-Ins/Components;/Library/Audio/Plug-Ins/Components"); +} + +#endif + +END_JUCE_NAMESPACE + +#undef log + +#endif diff --git a/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp index 7b0411e582..c6febe9724 100644 --- a/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp +++ b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp @@ -31,7 +31,7 @@ #include "../../../../../juce_Config.h" -#if JUCE_PLUGINHOST_VST +#if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WIN32) #ifdef _WIN32 #undef _WIN32_WINNT @@ -40,7 +40,7 @@ #define STRICT #include #include - #pragma warning (disable : 4312) + #pragma warning (disable : 4312 4355) #elif defined (LINUX) #include #include @@ -52,12 +52,20 @@ #undef Drawable #undef Time #else + #ifndef JUCE_MAC_VST_INCLUDED + // On the mac, this file needs to be compiled indirectly, by using + // juce_VSTPluginFormat.mm instead - that wraps it as an objective-C file for cocoa + #error + #endif + #include #include #endif //============================================================================== #include "../../../../juce_core/basics/juce_StandardHeader.h" +#if ! (JUCE_MAC && JUCE_64BIT) + BEGIN_JUCE_NAMESPACE #include "juce_VSTPluginFormat.h" @@ -71,6 +79,11 @@ BEGIN_JUCE_NAMESPACE #include "../../../application/juce_Application.h" #include "../../../../juce_core/misc/juce_PlatformUtilities.h" +#if JUCE_MAC + #include "../../../../../build/macosx/platform_specific_code/juce_mac_CarbonViewWrapperComponent.h" +#endif + + //============================================================================== #undef PRAGMA_ALIGN_SUPPORTED #define VST_FORCE_DEPRECATED 0 @@ -206,11 +219,7 @@ class VSTPluginWindow; #endif //============================================================================== -#if JUCE_MAC -extern bool juce_isHIViewCreatedByJuce (HIViewRef view); -extern bool juce_isWindowCreatedByJuce (WindowRef window); - -#if JUCE_PPC +#if JUCE_MAC && JUCE_PPC static void* NewCFMFromMachO (void* const machofp) throw() { void* result = juce_malloc (8); @@ -221,7 +230,6 @@ static void* NewCFMFromMachO (void* const machofp) throw() return result; } #endif -#endif //============================================================================== #if JUCE_LINUX @@ -425,12 +433,12 @@ public: pluginName = file.getFileNameWithoutExtension(); - hModule = Process::loadDynamicLibrary (file.getFullPathName()); + hModule = PlatformUtilities::loadDynamicLibrary (file.getFullPathName()); - moduleMain = (MainCall) Process::getProcedureEntryPoint (hModule, "VSTPluginMain"); + moduleMain = (MainCall) PlatformUtilities::getProcedureEntryPoint (hModule, "VSTPluginMain"); if (moduleMain == 0) - moduleMain = (MainCall) Process::getProcedureEntryPoint (hModule, "main"); + moduleMain = (MainCall) PlatformUtilities::getProcedureEntryPoint (hModule, "main"); return moduleMain != 0; } @@ -439,7 +447,7 @@ public: { _fpreset(); // (doesn't do any harm) - Process::freeDynamicLibrary (hModule); + PlatformUtilities::freeDynamicLibrary (hModule); } void closeEffect (AEffect* eff) @@ -1232,12 +1240,18 @@ static Array activeVSTWindows; //============================================================================== class VSTPluginWindow : public AudioProcessorEditor, + #if ! JUCE_MAC + public ComponentMovementWatcher, + #endif public Timer { public: //============================================================================== VSTPluginWindow (VSTPluginInstance& plugin_) : AudioProcessorEditor (&plugin_), +#if ! JUCE_MAC + ComponentMovementWatcher (this), +#endif plugin (plugin_), isOpen (false), wasShowing (false), @@ -1253,11 +1267,9 @@ public: pluginWindow = None; pluginProc = None; #else - pluginViewRef = 0; + addAndMakeVisible (innerWrapper = new InnerWrapperComponent (this)); #endif - movementWatcher = new CompMovementWatcher (this); - activeVSTWindows.add (this); setSize (1, 1); @@ -1267,16 +1279,18 @@ public: ~VSTPluginWindow() { - deleteAndZero (movementWatcher); - +#if JUCE_MAC + deleteAndZero (innerWrapper); +#else closePluginWindow(); - +#endif activeVSTWindows.removeValue (this); plugin.editorBeingDeleted (this); } //============================================================================== - void componentMovedOrResized() +#if ! JUCE_MAC + void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) { if (recursiveResize) return; @@ -1290,39 +1304,7 @@ public: recursiveResize = true; -#if JUCE_MAC - if (pluginViewRef != 0) - { - HIRect r; - r.origin.x = (float) x; - r.origin.y = (float) y; - r.size.width = (float) getWidth(); - r.size.height = (float) getHeight(); - HIViewSetFrame (pluginViewRef, &r); - } - else if (pluginWindowRef != 0) - { - Rect r; - r.left = getScreenX(); - r.top = getScreenY(); - r.right = r.left + getWidth(); - r.bottom = r.top + getHeight(); - - WindowGroupRef group = GetWindowGroup (pluginWindowRef); - WindowGroupAttributes atts; - GetWindowGroupAttributes (group, &atts); - ChangeWindowGroupAttributes (group, 0, kWindowGroupAttrMoveTogether); - - SetWindowBounds (pluginWindowRef, kWindowContentRgn, &r); - - if ((atts & kWindowGroupAttrMoveTogether) != 0) - ChangeWindowGroupAttributes (group, kWindowGroupAttrMoveTogether, 0); - } - else - { - repaint(); - } -#elif JUCE_WIN32 +#if JUCE_WIN32 if (pluginHWND != 0) MoveWindow (pluginHWND, x, y, getWidth(), getHeight(), TRUE); #elif JUCE_LINUX @@ -1338,7 +1320,7 @@ public: } } - void componentVisibilityChanged() + void componentVisibilityChanged (Component&) { const bool isShowingNow = isShowing(); @@ -1352,7 +1334,7 @@ public: closePluginWindow(); } - componentMovedOrResized(); + componentMovedOrResized (true, true); } void componentPeerChanged() @@ -1360,6 +1342,7 @@ public: closePluginWindow(); openPluginWindow(); } +#endif //============================================================================== bool keyStateChanged() @@ -1373,6 +1356,12 @@ public: } //============================================================================== +#if JUCE_MAC + void paint (Graphics& g) + { + g.fillAll (Colours::black); + } +#else void paint (Graphics& g) { if (isOpen) @@ -1385,18 +1374,7 @@ public: getScreenY() - peer->getScreenY(), getWidth(), getHeight()); -#if JUCE_MAC - if (pluginViewRef == 0) - { - ERect r; - r.left = getScreenX() - peer->getScreenX(); - r.right = r.left + getWidth(); - r.top = getScreenY() - peer->getScreenY(); - r.bottom = r.top + getHeight(); - - dispatch (effEditDraw, 0, 0, &r, 0); - } -#elif JUCE_LINUX +#if JUCE_LINUX if (pluginWindow != 0) { const Rectangle clip (g.getClipBounds()); @@ -1421,6 +1399,7 @@ public: g.fillAll (Colours::black); } } +#endif //============================================================================== void timerCallback() @@ -1452,20 +1431,7 @@ public: //============================================================================== void mouseDown (const MouseEvent& e) { -#if JUCE_MAC - if (! alreadyInside) - { - alreadyInside = true; - toFront (true); - dispatch (effEditMouse, e.x, e.y, 0, 0); - alreadyInside = false; - } - else - { - PostEvent (::mouseDown, 0); - } -#elif JUCE_LINUX - +#if JUCE_LINUX if (pluginWindow == 0) return; @@ -1487,7 +1453,7 @@ public: sendEventToChild (&ev); -#else +#elif JUCE_WIN32 (void) e; toFront (true); @@ -1516,15 +1482,56 @@ private: HWND pluginHWND; void* originalWndProc; int sizeCheckCount; -#elif JUCE_MAC - HIViewRef pluginViewRef; - WindowRef pluginWindowRef; #elif JUCE_LINUX Window pluginWindow; EventProcPtr pluginProc; #endif //============================================================================== +#if JUCE_MAC + void openPluginWindow (WindowRef parentWindow) + { + if (isOpen || parentWindow == 0) + return; + + isOpen = true; + + ERect* rect = 0; + dispatch (effEditGetRect, 0, 0, &rect, 0); + dispatch (effEditOpen, 0, 0, parentWindow, 0); + + // do this before and after like in the steinberg example + dispatch (effEditGetRect, 0, 0, &rect, 0); + dispatch (effGetProgram, 0, 0, 0, 0); // also in steinberg code + + // Install keyboard hooks + pluginWantsKeys = (dispatch (effKeysRequired, 0, 0, 0, 0) == 0); + + // double-check it's not too tiny + int w = 250, h = 150; + + if (rect != 0) + { + w = rect->right - rect->left; + h = rect->bottom - rect->top; + + if (w == 0 || h == 0) + { + w = 250; + h = 150; + } + } + + w = jmax (w, 32); + h = jmax (h, 32); + + setSize (w, h); + + startTimer (18 + JUCE_NAMESPACE::Random::getSystemRandom().nextInt (5)); + repaint(); + } + +#else void openPluginWindow() { if (isOpen || getWindowHandle() == 0) @@ -1598,44 +1605,6 @@ private: } } } -#elif JUCE_MAC - HIViewRef root = HIViewGetRoot ((WindowRef) getWindowHandle()); - HIViewFindByID (root, kHIViewWindowContentID, &root); - pluginViewRef = HIViewGetFirstSubview (root); - - while (pluginViewRef != 0 && juce_isHIViewCreatedByJuce (pluginViewRef)) - pluginViewRef = HIViewGetNextView (pluginViewRef); - - pluginWindowRef = 0; - - if (pluginViewRef == 0) - { - WindowGroupRef ourGroup = GetWindowGroup ((WindowRef) getWindowHandle()); - //DebugPrintWindowGroup (ourGroup); - //DebugPrintAllWindowGroups(); - - GetIndexedWindow (ourGroup, 1, - kWindowGroupContentsVisible, - &pluginWindowRef); - - if (pluginWindowRef == (WindowRef) getWindowHandle() - || juce_isWindowCreatedByJuce (pluginWindowRef)) - pluginWindowRef = 0; - } - - int w = 250, h = 150; - - if (rect != 0) - { - w = rect->right - rect->left; - h = rect->bottom - rect->top; - - if (w == 0 || h == 0) - { - w = 250; - h = 150; - } - } #elif JUCE_LINUX pluginWindow = getChildWindow ((Window) getWindowHandle()); @@ -1675,8 +1644,10 @@ private: startTimer (18 + JUCE_NAMESPACE::Random::getSystemRandom().nextInt (5)); repaint(); } +#endif //============================================================================== +#if ! JUCE_MAC void closePluginWindow() { if (isOpen) @@ -1701,10 +1672,6 @@ private: DestroyWindow (pluginHWND); pluginHWND = 0; -#elif JUCE_MAC - dispatch (effEditSleep, 0, 0, 0, 0); - pluginViewRef = 0; - stopTimer(); #elif JUCE_LINUX stopTimer(); pluginWindow = 0; @@ -1712,6 +1679,13 @@ private: #endif } } +#endif + + //============================================================================== + int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) + { + return plugin.dispatch (opcode, index, value, ptr, opt); + } //============================================================================== #if JUCE_WIN32 @@ -1730,49 +1704,8 @@ private: sizeCheckCount = 0; } } -#endif - - //============================================================================== - class CompMovementWatcher : public ComponentMovementWatcher - { - public: - CompMovementWatcher (VSTPluginWindow* const owner_) - : ComponentMovementWatcher (owner_), - owner (owner_) - { - } - - //============================================================================== - void componentMovedOrResized (bool /*wasMoved*/, bool /*wasResized*/) - { - owner->componentMovedOrResized(); - } - - void componentPeerChanged() - { - owner->componentPeerChanged(); - } - - void componentVisibilityChanged (Component&) - { - owner->componentVisibilityChanged(); - } - - private: - VSTPluginWindow* const owner; - }; - - CompMovementWatcher* movementWatcher; - - //============================================================================== - int dispatch (const int opcode, const int index, const int value, void* const ptr, float opt) - { - return plugin.dispatch (opcode, index, value, ptr, opt); - } - //============================================================================== // hooks to get keyboard events from VST windows.. -#if JUCE_WIN32 static LRESULT CALLBACK vstHookWndProc (HWND hW, UINT message, WPARAM wParam, LPARAM lParam) { for (int i = activeVSTWindows.size(); --i >= 0;) @@ -1965,6 +1898,86 @@ private: } #endif +#if JUCE_MAC + class InnerWrapperComponent : public CarbonViewWrapperComponent + { + public: + InnerWrapperComponent (VSTPluginWindow* const owner_) + : owner (owner_), + alreadyInside (false) + { + } + + ~InnerWrapperComponent() + { + deleteWindow(); + } + + HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) + { + owner->openPluginWindow (windowRef); + return 0; + } + + void removeView (HIViewRef) + { + owner->dispatch (effEditClose, 0, 0, 0, 0); + owner->dispatch (effEditSleep, 0, 0, 0, 0); + } + + bool getEmbeddedViewSize (int& w, int& h) + { + ERect* rect = 0; + owner->dispatch (effEditGetRect, 0, 0, &rect, 0); + w = rect->right - rect->left; + h = rect->bottom - rect->top; + return true; + } + + void mouseDown (int x, int y) + { + if (! alreadyInside) + { + alreadyInside = true; + getTopLevelComponent()->toFront (true); + owner->dispatch (effEditMouse, x, y, 0, 0); + alreadyInside = false; + } + else + { + PostEvent (::mouseDown, 0); + } + } + + void paint() + { + ComponentPeer* const peer = getPeer(); + + if (peer != 0) + { + ERect r; + r.left = getScreenX() - peer->getScreenX(); + r.right = r.left + getWidth(); + r.top = getScreenY() - peer->getScreenY(); + r.bottom = r.top + getHeight(); + + owner->dispatch (effEditDraw, 0, 0, &r, 0); + } + } + + private: + VSTPluginWindow* const owner; + bool alreadyInside; + }; + + friend class InnerWrapperComponent; + InnerWrapperComponent* innerWrapper; + + void resized() + { + innerWrapper->setSize (getWidth(), getHeight()); + } +#endif }; //============================================================================== @@ -3041,6 +3054,8 @@ const FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() END_JUCE_NAMESPACE +#endif + #undef log #endif diff --git a/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.mm b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.mm new file mode 100644 index 0000000000..ceeb1a3fc5 --- /dev/null +++ b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.mm @@ -0,0 +1,35 @@ +/* + ============================================================================== + + 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 just wraps juce_VSTPluginFormat.cpp in an objective-C wrapper +#define JUCE_MAC_VST_INCLUDED 1 +#include "juce_VSTPluginFormat.cpp" + diff --git a/src/juce_appframework/audio/plugins/juce_PluginListComponent.cpp b/src/juce_appframework/audio/plugins/juce_PluginListComponent.cpp index 24e2c42025..c781736f37 100644 --- a/src/juce_appframework/audio/plugins/juce_PluginListComponent.cpp +++ b/src/juce_appframework/audio/plugins/juce_PluginListComponent.cpp @@ -270,7 +270,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format) aw.enterModalState(); - MessageManager::getInstance()->dispatchPendingMessages(); + MessageManager::getInstance()->runDispatchLoopUntil (300); PluginDirectoryScanner scanner (list, *format, path, true, deadMansPedalFile); @@ -279,7 +279,7 @@ void PluginListComponent::scanFor (AudioPluginFormat* format) aw.setMessage (TRANS("Testing:\n\n") + scanner.getNextPluginFileThatWillBeScanned().getFileName()); - MessageManager::getInstance()->dispatchPendingMessages (500); + MessageManager::getInstance()->runDispatchLoopUntil (20); if (! scanner.scanNextFile (true)) break; diff --git a/src/juce_appframework/events/juce_MessageManager.cpp b/src/juce_appframework/events/juce_MessageManager.cpp index 310807e8f8..914ef368f6 100644 --- a/src/juce_appframework/events/juce_MessageManager.cpp +++ b/src/juce_appframework/events/juce_MessageManager.cpp @@ -55,14 +55,7 @@ static const int quitMessageId = 0xfffff321; MessageManager::MessageManager() throw() : broadcastListeners (0), quitMessagePosted (false), - quitMessageReceived (false), - useMaximumForceWhenQuitting (true), - messageCounter (0), - lastMessageCounter (-1), - isInMessageDispatcher (0), - needToGetRidOfWaitCursor (false), - timeBeforeWaitCursor (0), - lastActivityCheckOkTime (0) + quitMessageReceived (false) { currentLockingThreadId = messageThreadId = Thread::getCurrentThreadId(); } @@ -82,8 +75,6 @@ MessageManager* MessageManager::getInstance() throw() { instance = new MessageManager(); doPlatformSpecificInitialisation(); - - instance->setTimeBeforeShowingWaitCursor (500); } return instance; @@ -111,107 +102,53 @@ void MessageManager::deliverMessage (void* message) recipient->handleMessage (*m); } JUCE_CATCH_EXCEPTION - - if (needToGetRidOfWaitCursor) - { - needToGetRidOfWaitCursor = false; - MouseCursor::hideWaitCursor(); - } - - ++messageCounter; } else if (recipient == 0 && m->intParameter1 == quitMessageId) { quitMessageReceived = true; - useMaximumForceWhenQuitting = (m->intParameter2 != 0); } delete m; } //============================================================================== -bool MessageManager::dispatchNextMessage (const bool returnImmediatelyIfNoMessages, - bool* const wasAMessageDispatched) +#if ! JUCE_MAC +void MessageManager::runDispatchLoop() { - if (quitMessageReceived) - { - if (wasAMessageDispatched != 0) - *wasAMessageDispatched = false; - - return false; - } - - ++isInMessageDispatcher; - - bool result = false; - - JUCE_TRY - { - result = juce_dispatchNextMessageOnSystemQueue (returnImmediatelyIfNoMessages); - - if (wasAMessageDispatched != 0) - *wasAMessageDispatched = result; + jassert (isThisTheMessageThread()); // must only be called by the message thread - if (instance == 0) - return false; - } - JUCE_CATCH_EXCEPTION + runDispatchLoopUntil (-1); +} - --isInMessageDispatcher; - ++messageCounter; +void MessageManager::stopDispatchLoop() +{ + Message* const m = new Message (quitMessageId, 0, 0, 0); + m->messageRecipient = 0; + postMessageToQueue (m); - return result || ! returnImmediatelyIfNoMessages; + quitMessagePosted = true; } -void MessageManager::dispatchPendingMessages (int maxNumberOfMessagesToDispatch) +bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor) { jassert (isThisTheMessageThread()); // must only be called by the message thread - while (--maxNumberOfMessagesToDispatch >= 0 && ! quitMessageReceived) - { - ++isInMessageDispatcher; - - bool carryOn = false; + const int64 endTime = Time::currentTimeMillis() + millisecondsToRunFor; + while ((millisecondsToRunFor < 0 || endTime > Time::currentTimeMillis()) + && ! quitMessageReceived) + { JUCE_TRY { - carryOn = juce_dispatchNextMessageOnSystemQueue (true); + juce_dispatchNextMessageOnSystemQueue (millisecondsToRunFor >= 0); } JUCE_CATCH_EXCEPTION - - --isInMessageDispatcher; - ++messageCounter; - - if (! carryOn) - break; - } -} - -bool MessageManager::runDispatchLoop() -{ - jassert (isThisTheMessageThread()); // must only be called by the message thread - - while (dispatchNextMessage()) - { } - return useMaximumForceWhenQuitting; -} - -//============================================================================== -void MessageManager::postQuitMessage (const bool useMaximumForce) -{ - Message* const m = new Message (quitMessageId, (useMaximumForce) ? 1 : 0, 0, 0); - m->messageRecipient = 0; - postMessageToQueue (m); - - quitMessagePosted = true; + return ! quitMessageReceived; } -bool MessageManager::hasQuitMessageBeenPosted() const throw() -{ - return quitMessagePosted; -} +#endif //============================================================================== void MessageManager::deliverBroadcastMessage (const String& value) @@ -235,78 +172,6 @@ void MessageManager::deregisterBroadcastListener (ActionListener* const listener } //============================================================================== -// This gets called occasionally by the timer thread (to save using an extra thread -// for it). -void MessageManager::inactivityCheckCallback() throw() -{ - if (instance != 0) - instance->inactivityCheckCallbackInt(); -} - -void MessageManager::inactivityCheckCallbackInt() throw() -{ - const unsigned int now = Time::getApproximateMillisecondCounter(); - - if (isInMessageDispatcher > 0 - && lastMessageCounter == messageCounter - && timeBeforeWaitCursor > 0 - && lastActivityCheckOkTime > 0 - && ! ModifierKeys::getCurrentModifiersRealtime().isAnyMouseButtonDown()) - { - if (now >= lastActivityCheckOkTime + timeBeforeWaitCursor - && ! needToGetRidOfWaitCursor) - { - // been in the same message call too long.. - MouseCursor::showWaitCursor(); - needToGetRidOfWaitCursor = true; - } - } - else - { - lastActivityCheckOkTime = now; - lastMessageCounter = messageCounter; - } -} - -void MessageManager::delayWaitCursor() throw() -{ - if (instance != 0) - { - instance->messageCounter++; - - if (instance->needToGetRidOfWaitCursor) - { - instance->needToGetRidOfWaitCursor = false; - MouseCursor::hideWaitCursor(); - } - } -} - -void MessageManager::setTimeBeforeShowingWaitCursor (const int millisecs) throw() -{ - // if this is a bit too small you'll get a lot of unwanted hourglass cursors.. - jassert (millisecs <= 0 || millisecs > 200); - - timeBeforeWaitCursor = millisecs; - - if (millisecs > 0) - startTimer (millisecs / 2); // (see timerCallback() for explanation of this) - else - stopTimer(); -} - -void MessageManager::timerCallback() -{ - // dummy callback - the message manager is just a Timer to ensure that there are always - // some events coming in - otherwise it'll show the egg-timer/beachball-of-death. - ++messageCounter; -} - -int MessageManager::getTimeBeforeShowingWaitCursor() const throw() -{ - return timeBeforeWaitCursor; -} - bool MessageManager::isThisTheMessageThread() const throw() { return Thread::getCurrentThreadId() == messageThreadId; diff --git a/src/juce_appframework/events/juce_MessageManager.h b/src/juce_appframework/events/juce_MessageManager.h index 7757036b48..0a9287e91f 100644 --- a/src/juce_appframework/events/juce_MessageManager.h +++ b/src/juce_appframework/events/juce_MessageManager.h @@ -34,10 +34,11 @@ #include "../application/juce_DeletedAtShutdown.h" #include "../../juce_core/containers/juce_SortedSet.h" +#include "../../juce_core/containers/juce_VoidArray.h" #include "juce_ActionListenerList.h" -#include "juce_Timer.h" class Thread; -class InternalTimerThread; +class Component; +class MessageManagerLock; //============================================================================== @@ -51,8 +52,7 @@ typedef void* (MessageCallbackFunction) (void* userData); @see Message, MessageListener, MessageManagerLock, JUCEApplication */ -class JUCE_API MessageManager : private DeletedAtShutdown, - private Timer +class JUCE_API MessageManager : private DeletedAtShutdown { public: //============================================================================== @@ -60,28 +60,22 @@ public: static MessageManager* getInstance() throw(); //============================================================================== - /** Synchronously dispatches up to a certain number of messages from the queue. + void runDispatchLoop(); + void stopDispatchLoop(); + bool hasStopMessageBeenSent() const throw() { return quitMessagePosted; } - This will return when the queue becomes empty, or when the given number of - messages has been sent. - */ - void dispatchPendingMessages (int maxNumberOfMessagesToDispatch = 1000); - - /** Synchronously sends the next pending message. - - This must only be called by the message-thread. + /** Synchronously dispatches messages until a given time has elapsed. - @param returnImmediatelyIfNoMessages if false, it will block indefinitely until a message - needs dispatching. If true, then if no messages are - pending, it will return immediately. - @param wasAMessageDispatched if this is non-zero, it will be set to true or false - depending on whether a message was actually sent or - not. - @returns false if the thing that's calling it should stop calling - i.e. if the - app is trying to quit. + Returns false if a quit message has been posted, otherwise returns true. */ - bool dispatchNextMessage (const bool returnImmediatelyIfNoMessages = false, - bool* const wasAMessageDispatched = 0); + bool runDispatchLoopUntil (int millisecondsToRunFor); + + //============================================================================== + /*int runModalLoop (Component* componentToBeModal); + bool makeComponentModal (Component* componentToBeModal); + bool isComponentModal (const Component* component) const; + Component* getCurrentModalComponent() const; + void exitModalLoop (int returnValue);*/ //============================================================================== /** Calls a function using the message-thread. @@ -120,7 +114,7 @@ public: (Best to ignore this method unless you really know what you're doing..) @see setCurrentMessageThread */ - int getCurrentMessageThread() const throw() { return messageThreadId; } + int64 getCurrentMessageThread() const throw() { return messageThreadId; } /** Returns true if the caller thread has currenltly got the message manager locked. @@ -152,40 +146,11 @@ public: /** Deregisters a broadcast listener. */ void deregisterBroadcastListener (ActionListener* listener) throw(); - //============================================================================== - /** Sets a time-limit for the app to be 'busy' before an hourglass cursor will be shown. - - @param millisecs how long before the cursor is shown (the default time is 500ms). If the - value is 0 or less, the wait cursor will never be shown (although on the - Mac the system might still decide to show it after a while). - @see MouseCursor::showWaitCursor - */ - void setTimeBeforeShowingWaitCursor (const int millisecs) throw(); - - /** Returns the time-out before the 'busy' cursor is shown when the app is busy. - - @see setTimeBeforeShowingWaitCursor, MouseCursor::showWaitCursor - */ - int getTimeBeforeShowingWaitCursor() const throw(); - - /** Tells the message manager that the system isn't locked-up, even if the message - loop isn't active. - - Used internally, this is handy when an OS enters its own modal loop. - */ - static void delayWaitCursor() throw(); - - //============================================================================== - /** Returns true if JUCEApplication::quit() has been called. */ - bool hasQuitMessageBeenPosted() const throw(); - //============================================================================== /** @internal */ void deliverMessage (void*); /** @internal */ void deliverBroadcastMessage (const String&); - /** @internal */ - void timerCallback(); //============================================================================== juce_UseDebuggingNewOperator @@ -203,28 +168,20 @@ private: ActionListenerList* broadcastListeners; friend class JUCEApplication; - bool quitMessagePosted, quitMessageReceived, useMaximumForceWhenQuitting; + bool quitMessagePosted, quitMessageReceived; + int64 messageThreadId; - int messageThreadId; - int volatile messageCounter, lastMessageCounter, isInMessageDispatcher; - bool volatile needToGetRidOfWaitCursor; - int volatile timeBeforeWaitCursor; - unsigned int lastActivityCheckOkTime; + VoidArray modalComponents; + static void* exitModalLoopCallback (void*); - bool runDispatchLoop(); void postMessageToQueue (Message* const message); - void postQuitMessage (const bool useMaximumForce); static void doPlatformSpecificInitialisation(); static void doPlatformSpecificShutdown(); - friend class InternalTimerThread; - static void inactivityCheckCallback() throw(); - void inactivityCheckCallbackInt() throw(); - friend class MessageManagerLock; CriticalSection messageDispatchLock; - int currentLockingThreadId; + int64 currentLockingThreadId; MessageManager (const MessageManager&); const MessageManager& operator= (const MessageManager&); @@ -332,7 +289,7 @@ public: private: - int lastLockingThreadId; + int64 lastLockingThreadId; bool locked; }; diff --git a/src/juce_appframework/events/juce_Timer.cpp b/src/juce_appframework/events/juce_Timer.cpp index 37c32ce783..4cc9e40b5c 100644 --- a/src/juce_appframework/events/juce_Timer.cpp +++ b/src/juce_appframework/events/juce_Timer.cpp @@ -183,7 +183,6 @@ public: void run() { uint32 lastTime = Time::getMillisecondCounter(); - uint32 lastMessageManagerCallback = lastTime; while (! threadShouldExit()) { @@ -222,12 +221,6 @@ public: now = Time::getMillisecondCounter(); - if (now > lastMessageManagerCallback + 200) - { - lastMessageManagerCallback = now; - MessageManager::inactivityCheckCallback(); - } - if (now > messageDeliveryTimeout) break; } @@ -238,12 +231,6 @@ public: // Time::getApproximateMillisecondTimer value stay up-to-date wait (jlimit (1, 50, timeUntilFirstTimer)); } - - if (now > lastMessageManagerCallback + 200) - { - lastMessageManagerCallback = now; - MessageManager::inactivityCheckCallback(); - } } } diff --git a/src/juce_appframework/gui/components/controls/juce_Slider.cpp b/src/juce_appframework/gui/components/controls/juce_Slider.cpp index def3b94af0..c8665f268b 100644 --- a/src/juce_appframework/gui/components/controls/juce_Slider.cpp +++ b/src/juce_appframework/gui/components/controls/juce_Slider.cpp @@ -1,1392 +1,1392 @@ -/* - ============================================================================== - - 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 "../../../../juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "juce_Slider.h" -#include "../lookandfeel/juce_LookAndFeel.h" -#include "../menus/juce_PopupMenu.h" -#include "../juce_Desktop.h" -#include "../special/juce_BubbleComponent.h" -#include "../../../../juce_core/text/juce_LocalisedStrings.h" - - -//============================================================================== -class SliderPopupDisplayComponent : public BubbleComponent -{ -public: - //============================================================================== - SliderPopupDisplayComponent (Slider* const owner_) - : owner (owner_), - font (15.0f, Font::bold) - { - setAlwaysOnTop (true); - } - - ~SliderPopupDisplayComponent() - { - } - - void paintContent (Graphics& g, int w, int h) - { - g.setFont (font); - g.setColour (Colours::black); - - g.drawFittedText (text, 0, 0, w, h, Justification::centred, 1); - } - - void getContentSize (int& w, int& h) - { - w = font.getStringWidth (text) + 18; - h = (int) (font.getHeight() * 1.6f); - } - - void updatePosition (const String& newText) - { - if (text != newText) - { - text = newText; - repaint(); - } - - BubbleComponent::setPosition (owner); - } - - //============================================================================== - juce_UseDebuggingNewOperator - -private: - Slider* owner; - Font font; - String text; - - SliderPopupDisplayComponent (const SliderPopupDisplayComponent&); - const SliderPopupDisplayComponent& operator= (const SliderPopupDisplayComponent&); -}; - -//============================================================================== -Slider::Slider (const String& name) - : Component (name), - listeners (2), - currentValue (0.0), - valueMin (0.0), - valueMax (0.0), - minimum (0), - maximum (10), - interval (0), - skewFactor (1.0), - velocityModeSensitivity (1.0), - velocityModeOffset (0.0), - velocityModeThreshold (1), - rotaryStart (float_Pi * 1.2f), - rotaryEnd (float_Pi * 2.8f), - numDecimalPlaces (7), - sliderRegionStart (0), - sliderRegionSize (1), - sliderBeingDragged (-1), - pixelsForFullDragExtent (250), - style (LinearHorizontal), - textBoxPos (TextBoxLeft), - textBoxWidth (80), - textBoxHeight (20), - incDecButtonMode (incDecButtonsNotDraggable), - editableText (true), - doubleClickToValue (false), - isVelocityBased (false), - userKeyOverridesVelocity (true), - rotaryStop (true), - incDecButtonsSideBySide (false), - sendChangeOnlyOnRelease (false), - popupDisplayEnabled (false), - menuEnabled (false), - menuShown (false), - scrollWheelEnabled (true), - snapsToMousePos (true), - valueBox (0), - incButton (0), - decButton (0), - popupDisplay (0), - parentForPopupDisplay (0) -{ - setWantsKeyboardFocus (false); - setRepaintsOnMouseActivity (true); - - lookAndFeelChanged(); - updateText(); -} - -Slider::~Slider() -{ - deleteAndZero (popupDisplay); - deleteAllChildren(); -} - - -//============================================================================== -void Slider::handleAsyncUpdate() -{ - cancelPendingUpdate(); - - for (int i = listeners.size(); --i >= 0;) - { - ((SliderListener*) listeners.getUnchecked (i))->sliderValueChanged (this); - i = jmin (i, listeners.size()); - } -} - -void Slider::sendDragStart() -{ - startedDragging(); - - for (int i = listeners.size(); --i >= 0;) - { - ((SliderListener*) listeners.getUnchecked (i))->sliderDragStarted (this); - i = jmin (i, listeners.size()); - } -} - -void Slider::sendDragEnd() -{ - stoppedDragging(); - - sliderBeingDragged = -1; - - for (int i = listeners.size(); --i >= 0;) - { - ((SliderListener*) listeners.getUnchecked (i))->sliderDragEnded (this); - i = jmin (i, listeners.size()); - } -} - -void Slider::addListener (SliderListener* const listener) throw() -{ - jassert (listener != 0); - if (listener != 0) - listeners.add (listener); -} - -void Slider::removeListener (SliderListener* const listener) throw() -{ - listeners.removeValue (listener); -} - -//============================================================================== -void Slider::setSliderStyle (const SliderStyle newStyle) -{ - if (style != newStyle) - { - style = newStyle; - repaint(); - lookAndFeelChanged(); - } -} - -void Slider::setRotaryParameters (const float startAngleRadians, - const float endAngleRadians, - const bool stopAtEnd) -{ - // make sure the values are sensible.. - jassert (rotaryStart >= 0 && rotaryEnd >= 0); - jassert (rotaryStart < float_Pi * 4.0f && rotaryEnd < float_Pi * 4.0f); - jassert (rotaryStart < rotaryEnd); - - rotaryStart = startAngleRadians; - rotaryEnd = endAngleRadians; - rotaryStop = stopAtEnd; -} - -void Slider::setVelocityBasedMode (const bool velBased) throw() -{ - isVelocityBased = velBased; -} - -void Slider::setVelocityModeParameters (const double sensitivity, - const int threshold, - const double offset, - const bool userCanPressKeyToSwapMode) throw() -{ - jassert (threshold >= 0); - jassert (sensitivity > 0); - jassert (offset >= 0); - - velocityModeSensitivity = sensitivity; - velocityModeOffset = offset; - velocityModeThreshold = threshold; - userKeyOverridesVelocity = userCanPressKeyToSwapMode; -} - -void Slider::setSkewFactor (const double factor) throw() -{ - skewFactor = factor; -} - -void Slider::setSkewFactorFromMidPoint (const double sliderValueToShowAtMidPoint) throw() -{ - if (maximum > minimum) - skewFactor = log (0.5) / log ((sliderValueToShowAtMidPoint - minimum) - / (maximum - minimum)); -} - -void Slider::setMouseDragSensitivity (const int distanceForFullScaleDrag) -{ - jassert (distanceForFullScaleDrag > 0); - - pixelsForFullDragExtent = distanceForFullScaleDrag; -} - -void Slider::setIncDecButtonsMode (const IncDecButtonMode mode) -{ - if (incDecButtonMode != mode) - { - incDecButtonMode = mode; - lookAndFeelChanged(); - } -} - -void Slider::setTextBoxStyle (const TextEntryBoxPosition newPosition, - const bool isReadOnly, - const int textEntryBoxWidth, - const int textEntryBoxHeight) -{ - textBoxPos = newPosition; - editableText = ! isReadOnly; - textBoxWidth = textEntryBoxWidth; - textBoxHeight = textEntryBoxHeight; - - repaint(); - lookAndFeelChanged(); -} - -void Slider::setTextBoxIsEditable (const bool shouldBeEditable) throw() -{ - editableText = shouldBeEditable; - - if (valueBox != 0) - valueBox->setEditable (shouldBeEditable && isEnabled()); -} - -void Slider::showTextBox() -{ - jassert (editableText); // this should probably be avoided in read-only sliders. - - if (valueBox != 0) - valueBox->showEditor(); -} - -void Slider::hideTextBox (const bool discardCurrentEditorContents) -{ - if (valueBox != 0) - { - valueBox->hideEditor (discardCurrentEditorContents); - - if (discardCurrentEditorContents) - updateText(); - } -} - -void Slider::setChangeNotificationOnlyOnRelease (const bool onlyNotifyOnRelease) throw() -{ - sendChangeOnlyOnRelease = onlyNotifyOnRelease; -} - -void Slider::setSliderSnapsToMousePosition (const bool shouldSnapToMouse) throw() -{ - snapsToMousePos = shouldSnapToMouse; -} - -void Slider::setPopupDisplayEnabled (const bool enabled, - Component* const parentComponentToUse) throw() -{ - popupDisplayEnabled = enabled; - parentForPopupDisplay = parentComponentToUse; -} - -//============================================================================== -void Slider::colourChanged() -{ - lookAndFeelChanged(); -} - -void Slider::lookAndFeelChanged() -{ - const String previousTextBoxContent (valueBox != 0 ? valueBox->getText() - : getTextFromValue (currentValue)); - - deleteAllChildren(); - valueBox = 0; - - LookAndFeel& lf = getLookAndFeel(); - - if (textBoxPos != NoTextBox) - { - addAndMakeVisible (valueBox = getLookAndFeel().createSliderTextBox (*this)); - - valueBox->setWantsKeyboardFocus (false); - valueBox->setText (previousTextBoxContent, false); - - valueBox->setEditable (editableText && isEnabled()); - valueBox->addListener (this); - - if (style == LinearBar) - valueBox->addMouseListener (this, false); - } - - if (style == IncDecButtons) - { - addAndMakeVisible (incButton = lf.createSliderButton (true)); - incButton->addButtonListener (this); - - addAndMakeVisible (decButton = lf.createSliderButton (false)); - decButton->addButtonListener (this); - - if (incDecButtonMode != incDecButtonsNotDraggable) - { - incButton->addMouseListener (this, false); - decButton->addMouseListener (this, false); - } - else - { - incButton->setRepeatSpeed (300, 100, 20); - incButton->addMouseListener (decButton, false); - - decButton->setRepeatSpeed (300, 100, 20); - decButton->addMouseListener (incButton, false); - } - } - - setComponentEffect (lf.getSliderEffect()); - - resized(); - repaint(); -} - -//============================================================================== -void Slider::setRange (const double newMin, - const double newMax, - const double newInt) -{ - if (minimum != newMin - || maximum != newMax - || interval != newInt) - { - minimum = newMin; - maximum = newMax; - interval = newInt; - - // figure out the number of DPs needed to display all values at this - // interval setting. - numDecimalPlaces = 7; - - if (newInt != 0) - { - int v = abs ((int) (newInt * 10000000)); - - while ((v % 10) == 0) - { - --numDecimalPlaces; - v /= 10; - } - } - - // keep the current values inside the new range.. - if (style != TwoValueHorizontal && style != TwoValueVertical) - { - setValue (currentValue, false, false); - } - else - { - setMinValue (getMinValue(), false, false); - setMaxValue (getMaxValue(), false, false); - } - - updateText(); - } -} - -void Slider::triggerChangeMessage (const bool synchronous) -{ - if (synchronous) - handleAsyncUpdate(); - else - triggerAsyncUpdate(); - - valueChanged(); -} - -double Slider::getValue() const throw() -{ - // for a two-value style slider, you should use the getMinValue() and getMaxValue() - // methods to get the two values. - jassert (style != TwoValueHorizontal && style != TwoValueVertical); - - return currentValue; -} - -void Slider::setValue (double newValue, - const bool sendUpdateMessage, - const bool sendMessageSynchronously) -{ - // for a two-value style slider, you should use the setMinValue() and setMaxValue() - // methods to set the two values. - jassert (style != TwoValueHorizontal && style != TwoValueVertical); - - newValue = constrainedValue (newValue); - - if (style == ThreeValueHorizontal || style == ThreeValueVertical) - { - jassert (valueMin <= valueMax); - newValue = jlimit (valueMin, valueMax, newValue); - } - - if (currentValue != newValue) - { - if (valueBox != 0) - valueBox->hideEditor (true); - - currentValue = newValue; - updateText(); - repaint(); - - if (popupDisplay != 0) - { - ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (currentValue)); - popupDisplay->repaint(); - } - - if (sendUpdateMessage) - triggerChangeMessage (sendMessageSynchronously); - } -} - -double Slider::getMinValue() const throw() -{ - // The minimum value only applies to sliders that are in two- or three-value mode. - jassert (style == TwoValueHorizontal || style == TwoValueVertical - || style == ThreeValueHorizontal || style == ThreeValueVertical); - - return valueMin; -} - -double Slider::getMaxValue() const throw() -{ - // The maximum value only applies to sliders that are in two- or three-value mode. - jassert (style == TwoValueHorizontal || style == TwoValueVertical - || style == ThreeValueHorizontal || style == ThreeValueVertical); - - return valueMax; -} - -void Slider::setMinValue (double newValue, const bool sendUpdateMessage, const bool sendMessageSynchronously) -{ - // The minimum value only applies to sliders that are in two- or three-value mode. - jassert (style == TwoValueHorizontal || style == TwoValueVertical - || style == ThreeValueHorizontal || style == ThreeValueVertical); - - newValue = constrainedValue (newValue); - - if (style == TwoValueHorizontal || style == TwoValueVertical) - newValue = jmin (valueMax, newValue); - else - newValue = jmin (currentValue, newValue); - - if (valueMin != newValue) - { - valueMin = newValue; - repaint(); - - if (popupDisplay != 0) - { - ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (valueMin)); - popupDisplay->repaint(); - } - - if (sendUpdateMessage) - triggerChangeMessage (sendMessageSynchronously); - } -} - -void Slider::setMaxValue (double newValue, const bool sendUpdateMessage, const bool sendMessageSynchronously) -{ - // The maximum value only applies to sliders that are in two- or three-value mode. - jassert (style == TwoValueHorizontal || style == TwoValueVertical - || style == ThreeValueHorizontal || style == ThreeValueVertical); - - newValue = constrainedValue (newValue); - - if (style == TwoValueHorizontal || style == TwoValueVertical) - newValue = jmax (valueMin, newValue); - else - newValue = jmax (currentValue, newValue); - - if (valueMax != newValue) - { - valueMax = newValue; - repaint(); - - if (popupDisplay != 0) - { - ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (valueMax)); - popupDisplay->repaint(); - } - - if (sendUpdateMessage) - triggerChangeMessage (sendMessageSynchronously); - } -} - -void Slider::setDoubleClickReturnValue (const bool isDoubleClickEnabled, - const double valueToSetOnDoubleClick) throw() -{ - doubleClickToValue = isDoubleClickEnabled; - doubleClickReturnValue = valueToSetOnDoubleClick; -} - -double Slider::getDoubleClickReturnValue (bool& isEnabled_) const throw() -{ - isEnabled_ = doubleClickToValue; - return doubleClickReturnValue; -} - -void Slider::updateText() -{ - if (valueBox != 0) - valueBox->setText (getTextFromValue (currentValue), false); -} - -void Slider::setTextValueSuffix (const String& suffix) -{ - if (textSuffix != suffix) - { - textSuffix = suffix; - updateText(); - } -} - -const String Slider::getTextFromValue (double v) -{ - if (numDecimalPlaces > 0) - return String (v, numDecimalPlaces) + textSuffix; - else - return String (roundDoubleToInt (v)) + textSuffix; -} - -double Slider::getValueFromText (const String& text) -{ - String t (text.trimStart()); - - if (t.endsWith (textSuffix)) - t = t.substring (0, t.length() - textSuffix.length()); - - while (t.startsWithChar (T('+'))) - t = t.substring (1).trimStart(); - - return t.initialSectionContainingOnly (T("0123456789.,-")) - .getDoubleValue(); -} - -double Slider::proportionOfLengthToValue (double proportion) -{ - if (skewFactor != 1.0 && proportion > 0.0) - proportion = exp (log (proportion) / skewFactor); - - return minimum + (maximum - minimum) * proportion; -} - -double Slider::valueToProportionOfLength (double value) -{ - const double n = (value - minimum) / (maximum - minimum); - - return skewFactor == 1.0 ? n : pow (n, skewFactor); -} - -double Slider::snapValue (double attemptedValue, const bool) -{ - return attemptedValue; -} - -//============================================================================== -void Slider::startedDragging() -{ -} - -void Slider::stoppedDragging() -{ -} - -void Slider::valueChanged() -{ -} - -//============================================================================== -void Slider::enablementChanged() -{ - repaint(); -} - -void Slider::setPopupMenuEnabled (const bool menuEnabled_) throw() -{ - menuEnabled = menuEnabled_; -} - -void Slider::setScrollWheelEnabled (const bool enabled) throw() -{ - scrollWheelEnabled = enabled; -} - -//============================================================================== -void Slider::labelTextChanged (Label* label) -{ - const double newValue = snapValue (getValueFromText (label->getText()), false); - - if (getValue() != newValue) - { - sendDragStart(); - setValue (newValue, true, true); - sendDragEnd(); - } - - updateText(); // force a clean-up of the text, needed in case setValue() hasn't done this. -} - -void Slider::buttonClicked (Button* button) -{ - if (style == IncDecButtons) - { - sendDragStart(); - - if (button == incButton) - setValue (snapValue (getValue() + interval, false), true, true); - else if (button == decButton) - setValue (snapValue (getValue() - interval, false), true, true); - - sendDragEnd(); - } -} - -//============================================================================== -double Slider::constrainedValue (double value) const throw() -{ - if (interval > 0) - value = minimum + interval * floor ((value - minimum) / interval + 0.5); - - if (value <= minimum || maximum <= minimum) - value = minimum; - else if (value >= maximum) - value = maximum; - - return value; -} - -float Slider::getLinearSliderPos (const double value) -{ - double sliderPosProportional; - - if (maximum > minimum) - { - if (value < minimum) - { - sliderPosProportional = 0.0; - } - else if (value > maximum) - { - sliderPosProportional = 1.0; - } - else - { - sliderPosProportional = valueToProportionOfLength (value); - jassert (sliderPosProportional >= 0 && sliderPosProportional <= 1.0); - } - } - else - { - sliderPosProportional = 0.5; - } - - if (isVertical() || style == IncDecButtons) - sliderPosProportional = 1.0 - sliderPosProportional; - - return (float) (sliderRegionStart + sliderPosProportional * sliderRegionSize); -} - -bool Slider::isHorizontal() const throw() -{ - return style == LinearHorizontal - || style == LinearBar - || style == TwoValueHorizontal - || style == ThreeValueHorizontal; -} - -bool Slider::isVertical() const throw() -{ - return style == LinearVertical - || style == TwoValueVertical - || style == ThreeValueVertical; -} - -bool Slider::incDecDragDirectionIsHorizontal() const throw() -{ - return incDecButtonMode == incDecButtonsDraggable_Horizontal - || (incDecButtonMode == incDecButtonsDraggable_AutoDirection && incDecButtonsSideBySide); -} - -float Slider::getPositionOfValue (const double value) -{ - if (isHorizontal() || isVertical()) - { - return getLinearSliderPos (value); - } - else - { - jassertfalse // not a valid call on a slider that doesn't work linearly! - return 0.0f; - } -} - -//============================================================================== -void Slider::paint (Graphics& g) -{ - if (style != IncDecButtons) - { - if (style == Rotary || style == RotaryHorizontalDrag || style == RotaryVerticalDrag) - { - const float sliderPos = (float) valueToProportionOfLength (currentValue); - jassert (sliderPos >= 0 && sliderPos <= 1.0f); - - getLookAndFeel().drawRotarySlider (g, - sliderRect.getX(), - sliderRect.getY(), - sliderRect.getWidth(), - sliderRect.getHeight(), - sliderPos, - rotaryStart, rotaryEnd, - *this); - } - else - { - getLookAndFeel().drawLinearSlider (g, - sliderRect.getX(), - sliderRect.getY(), - sliderRect.getWidth(), - sliderRect.getHeight(), - getLinearSliderPos (currentValue), - getLinearSliderPos (valueMin), - getLinearSliderPos (valueMax), - style, - *this); - } - - if (style == LinearBar && valueBox == 0) - { - g.setColour (findColour (Slider::textBoxOutlineColourId)); - g.drawRect (0, 0, getWidth(), getHeight(), 1); - } - } -} - -void Slider::resized() -{ - int minXSpace = 0; - int minYSpace = 0; - - if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) - minXSpace = 30; - else - minYSpace = 15; - - const int tbw = jmax (0, jmin (textBoxWidth, getWidth() - minXSpace)); - const int tbh = jmax (0, jmin (textBoxHeight, getHeight() - minYSpace)); - - if (style == LinearBar) - { - if (valueBox != 0) - valueBox->setBounds (0, 0, getWidth(), getHeight()); - } - else - { - if (textBoxPos == NoTextBox) - { - sliderRect.setBounds (0, 0, getWidth(), getHeight()); - } - else if (textBoxPos == TextBoxLeft) - { - valueBox->setBounds (0, (getHeight() - tbh) / 2, tbw, tbh); - sliderRect.setBounds (tbw, 0, getWidth() - tbw, getHeight()); - } - else if (textBoxPos == TextBoxRight) - { - valueBox->setBounds (getWidth() - tbw, (getHeight() - tbh) / 2, tbw, tbh); - sliderRect.setBounds (0, 0, getWidth() - tbw, getHeight()); - } - else if (textBoxPos == TextBoxAbove) - { - valueBox->setBounds ((getWidth() - tbw) / 2, 0, tbw, tbh); - sliderRect.setBounds (0, tbh, getWidth(), getHeight() - tbh); - } - else if (textBoxPos == TextBoxBelow) - { - valueBox->setBounds ((getWidth() - tbw) / 2, getHeight() - tbh, tbw, tbh); - sliderRect.setBounds (0, 0, getWidth(), getHeight() - tbh); - } - } - - const int indent = getLookAndFeel().getSliderThumbRadius (*this); - - if (style == LinearBar) - { - const int barIndent = 1; - sliderRegionStart = barIndent; - sliderRegionSize = getWidth() - barIndent * 2; - - sliderRect.setBounds (sliderRegionStart, barIndent, - sliderRegionSize, getHeight() - barIndent * 2); - } - else if (isHorizontal()) - { - sliderRegionStart = sliderRect.getX() + indent; - sliderRegionSize = jmax (1, sliderRect.getWidth() - indent * 2); - - sliderRect.setBounds (sliderRegionStart, sliderRect.getY(), - sliderRegionSize, sliderRect.getHeight()); - } - else if (isVertical()) - { - sliderRegionStart = sliderRect.getY() + indent; - sliderRegionSize = jmax (1, sliderRect.getHeight() - indent * 2); - - sliderRect.setBounds (sliderRect.getX(), sliderRegionStart, - sliderRect.getWidth(), sliderRegionSize); - } - else - { - sliderRegionStart = 0; - sliderRegionSize = 100; - } - - if (style == IncDecButtons) - { - Rectangle buttonRect (sliderRect); - - if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) - buttonRect.expand (-2, 0); - else - buttonRect.expand (0, -2); - - incDecButtonsSideBySide = buttonRect.getWidth() > buttonRect.getHeight(); - - if (incDecButtonsSideBySide) - { - decButton->setBounds (buttonRect.getX(), - buttonRect.getY(), - buttonRect.getWidth() / 2, - buttonRect.getHeight()); - - decButton->setConnectedEdges (Button::ConnectedOnRight); - - incButton->setBounds (buttonRect.getCentreX(), - buttonRect.getY(), - buttonRect.getWidth() / 2, - buttonRect.getHeight()); - - incButton->setConnectedEdges (Button::ConnectedOnLeft); - } - else - { - incButton->setBounds (buttonRect.getX(), - buttonRect.getY(), - buttonRect.getWidth(), - buttonRect.getHeight() / 2); - - incButton->setConnectedEdges (Button::ConnectedOnBottom); - - decButton->setBounds (buttonRect.getX(), - buttonRect.getCentreY(), - buttonRect.getWidth(), - buttonRect.getHeight() / 2); - - decButton->setConnectedEdges (Button::ConnectedOnTop); - } - } -} - -void Slider::focusOfChildComponentChanged (FocusChangeType) -{ - repaint(); -} - -void Slider::mouseDown (const MouseEvent& e) -{ - mouseWasHidden = false; - incDecDragged = false; - - if (isEnabled()) - { - if (e.mods.isPopupMenu() && menuEnabled) - { - menuShown = true; - - PopupMenu m; - m.addItem (1, TRANS ("velocity-sensitive mode"), true, isVelocityBased); - m.addSeparator(); - - if (style == Rotary || style == RotaryHorizontalDrag || style == RotaryVerticalDrag) - { - PopupMenu rotaryMenu; - rotaryMenu.addItem (2, TRANS ("use circular dragging"), true, style == Rotary); - rotaryMenu.addItem (3, TRANS ("use left-right dragging"), true, style == RotaryHorizontalDrag); - rotaryMenu.addItem (4, TRANS ("use up-down dragging"), true, style == RotaryVerticalDrag); - - m.addSubMenu (TRANS ("rotary mode"), rotaryMenu); - } - - const int r = m.show(); - - if (r == 1) - { - setVelocityBasedMode (! isVelocityBased); - } - else if (r == 2) - { - setSliderStyle (Rotary); - } - else if (r == 3) - { - setSliderStyle (RotaryHorizontalDrag); - } - else if (r == 4) - { - setSliderStyle (RotaryVerticalDrag); - } - } - else if (maximum > minimum) - { - menuShown = false; - - if (valueBox != 0) - valueBox->hideEditor (true); - - sliderBeingDragged = 0; - - if (style == TwoValueHorizontal - || style == TwoValueVertical - || style == ThreeValueHorizontal - || style == ThreeValueVertical) - { - const float mousePos = (float) (isVertical() ? e.y : e.x); - - const float normalPosDistance = fabsf (getLinearSliderPos (currentValue) - mousePos); - const float minPosDistance = fabsf (getLinearSliderPos (valueMin) - 0.1f - mousePos); - const float maxPosDistance = fabsf (getLinearSliderPos (valueMax) + 0.1f - mousePos); - - if (style == TwoValueHorizontal || style == TwoValueVertical) - { - if (maxPosDistance <= minPosDistance) - sliderBeingDragged = 2; - else - sliderBeingDragged = 1; - } - else if (style == ThreeValueHorizontal || style == ThreeValueVertical) - { - if (normalPosDistance >= minPosDistance && maxPosDistance >= minPosDistance) - sliderBeingDragged = 1; - else if (normalPosDistance >= maxPosDistance) - sliderBeingDragged = 2; - } - } - - minMaxDiff = valueMax - valueMin; - - mouseXWhenLastDragged = e.x; - mouseYWhenLastDragged = e.y; - lastAngle = rotaryStart + (rotaryEnd - rotaryStart) - * valueToProportionOfLength (currentValue); - - if (sliderBeingDragged == 2) - valueWhenLastDragged = valueMax; - else if (sliderBeingDragged == 1) - valueWhenLastDragged = valueMin; - else - valueWhenLastDragged = currentValue; - - valueOnMouseDown = valueWhenLastDragged; - - if (popupDisplayEnabled) - { - SliderPopupDisplayComponent* const popup = new SliderPopupDisplayComponent (this); - popupDisplay = popup; - - if (parentForPopupDisplay != 0) - { - parentForPopupDisplay->addChildComponent (popup); - } - else - { - popup->addToDesktop (0); - } - - popup->setVisible (true); - } - - sendDragStart(); - - mouseDrag (e); - } - } -} - -void Slider::mouseUp (const MouseEvent&) -{ - if (isEnabled() - && (! menuShown) - && (maximum > minimum) - && (style != IncDecButtons || incDecDragged)) - { - restoreMouseIfHidden(); - - if (sendChangeOnlyOnRelease && valueOnMouseDown != currentValue) - triggerChangeMessage (false); - - sendDragEnd(); - - deleteAndZero (popupDisplay); - - if (style == IncDecButtons) - { - incButton->setState (Button::buttonNormal); - decButton->setState (Button::buttonNormal); - } - } -} - -void Slider::restoreMouseIfHidden() -{ - if (mouseWasHidden) - { - mouseWasHidden = false; - - Component* c = Component::getComponentUnderMouse(); - - if (c == 0) - c = this; - - c->enableUnboundedMouseMovement (false); - - const double pos = (sliderBeingDragged == 2) ? getMaxValue() - : ((sliderBeingDragged == 1) ? getMinValue() - : currentValue); - - if (style == RotaryHorizontalDrag || style == RotaryVerticalDrag) - { - int x, y, downX, downY; - Desktop::getMousePosition (x, y); - Desktop::getLastMouseDownPosition (downX, downY); - - if (style == RotaryHorizontalDrag) - { - const double posDiff = valueToProportionOfLength (pos) - valueToProportionOfLength (valueOnMouseDown); - x = pixelsForFullDragExtent * posDiff + downX; - y = downY; - } - else - { - const double posDiff = valueToProportionOfLength (valueOnMouseDown) - valueToProportionOfLength (pos); - x = downX; - y = pixelsForFullDragExtent * posDiff + downY; - } - - Desktop::setMousePosition (x, y); - } - else - { - const int pixelPos = (int) getLinearSliderPos (pos); - - int x = isHorizontal() ? pixelPos : (getWidth() / 2); - int y = isVertical() ? pixelPos : (getHeight() / 2); - - relativePositionToGlobal (x, y); - Desktop::setMousePosition (x, y); - } - } -} - -void Slider::modifierKeysChanged (const ModifierKeys& modifiers) -{ - if (isEnabled() - && style != IncDecButtons - && style != Rotary - && isVelocityBased == modifiers.isAnyModifierKeyDown()) - { - restoreMouseIfHidden(); - } -} - -static double smallestAngleBetween (double a1, double a2) -{ - return jmin (fabs (a1 - a2), - fabs (a1 + double_Pi * 2.0 - a2), - fabs (a2 + double_Pi * 2.0 - a1)); -} - -void Slider::mouseDrag (const MouseEvent& e) -{ - if (isEnabled() - && (! menuShown) - && (maximum > minimum)) - { - if (style == Rotary) - { - int dx = e.x - sliderRect.getCentreX(); - int dy = e.y - sliderRect.getCentreY(); - - if (dx * dx + dy * dy > 25) - { - double angle = atan2 ((double) dx, (double) -dy); - while (angle < 0.0) - angle += double_Pi * 2.0; - - if (rotaryStop && ! e.mouseWasClicked()) - { - if (fabs (angle - lastAngle) > double_Pi) - { - if (angle >= lastAngle) - angle -= double_Pi * 2.0; - else - angle += double_Pi * 2.0; - } - - if (angle >= lastAngle) - angle = jmin (angle, (double) jmax (rotaryStart, rotaryEnd)); - else - angle = jmax (angle, (double) jmin (rotaryStart, rotaryEnd)); - } - else - { - while (angle < rotaryStart) - angle += double_Pi * 2.0; - - if (angle > rotaryEnd) - { - if (smallestAngleBetween (angle, rotaryStart) <= smallestAngleBetween (angle, rotaryEnd)) - angle = rotaryStart; - else - angle = rotaryEnd; - } - } - - const double proportion = (angle - rotaryStart) / (rotaryEnd - rotaryStart); - - valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, proportion)); - - lastAngle = angle; - } - } - else - { - if (style == LinearBar && e.mouseWasClicked() - && valueBox != 0 && valueBox->isEditable()) - return; - - if (style == IncDecButtons) - { - if (! incDecDragged) - incDecDragged = e.getDistanceFromDragStart() > 10 && ! e.mouseWasClicked(); - - if (! incDecDragged) - return; - } - - - if ((isVelocityBased == (userKeyOverridesVelocity ? e.mods.testFlags (ModifierKeys::ctrlModifier | ModifierKeys::commandModifier | ModifierKeys::altModifier) - : false)) - || ((maximum - minimum) / sliderRegionSize < interval)) - { - const int mousePos = (isHorizontal() || style == RotaryHorizontalDrag) ? e.x : e.y; - - double scaledMousePos = (mousePos - sliderRegionStart) / (double) sliderRegionSize; - - if (style == RotaryHorizontalDrag - || style == RotaryVerticalDrag - || style == IncDecButtons - || ((style == LinearHorizontal || style == LinearVertical || style == LinearBar) - && ! snapsToMousePos)) - { - const int mouseDiff = (style == RotaryHorizontalDrag - || style == LinearHorizontal - || style == LinearBar - || (style == IncDecButtons && incDecDragDirectionIsHorizontal())) - ? e.getDistanceFromDragStartX() - : -e.getDistanceFromDragStartY(); - - double newPos = valueToProportionOfLength (valueOnMouseDown) - + mouseDiff * (1.0 / pixelsForFullDragExtent); - - valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, newPos)); - - if (style == IncDecButtons) - { - incButton->setState (mouseDiff < 0 ? Button::buttonNormal : Button::buttonDown); - decButton->setState (mouseDiff > 0 ? Button::buttonNormal : Button::buttonDown); - } - } - else - { - if (isVertical()) - scaledMousePos = 1.0 - scaledMousePos; - - valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, scaledMousePos)); - } - } - else - { - const int mouseDiff = (isHorizontal() || style == RotaryHorizontalDrag - || (style == IncDecButtons && incDecDragDirectionIsHorizontal())) - ? e.x - mouseXWhenLastDragged - : e.y - mouseYWhenLastDragged; - - const double maxSpeed = jmax (200, sliderRegionSize); - double speed = jlimit (0.0, maxSpeed, (double) abs (mouseDiff)); - - if (speed != 0) - { - speed = 0.2 * velocityModeSensitivity - * (1.0 + sin (double_Pi * (1.5 + jmin (0.5, velocityModeOffset - + jmax (0.0, (double) (speed - velocityModeThreshold)) - / maxSpeed)))); - - if (mouseDiff < 0) - speed = -speed; - - if (isVertical() || style == RotaryVerticalDrag - || (style == IncDecButtons && ! incDecDragDirectionIsHorizontal())) - speed = -speed; - - const double currentPos = valueToProportionOfLength (valueWhenLastDragged); - - valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, currentPos + speed)); - - e.originalComponent->enableUnboundedMouseMovement (true, false); - mouseWasHidden = true; - } - } - } - - valueWhenLastDragged = jlimit (minimum, maximum, valueWhenLastDragged); - - if (sliderBeingDragged == 0) - { - setValue (snapValue (valueWhenLastDragged, true), - ! sendChangeOnlyOnRelease, true); - } - else if (sliderBeingDragged == 1) - { - setMinValue (snapValue (valueWhenLastDragged, true), - ! sendChangeOnlyOnRelease, false); - - if (e.mods.isShiftDown()) - setMaxValue (getMinValue() + minMaxDiff, false); - else - minMaxDiff = valueMax - valueMin; - } - else - { - jassert (sliderBeingDragged == 2); - - setMaxValue (snapValue (valueWhenLastDragged, true), - ! sendChangeOnlyOnRelease, false); - - if (e.mods.isShiftDown()) - setMinValue (getMaxValue() - minMaxDiff, false); - else - minMaxDiff = valueMax - valueMin; - } - - mouseXWhenLastDragged = e.x; - mouseYWhenLastDragged = e.y; - } -} - -void Slider::mouseDoubleClick (const MouseEvent&) -{ - if (doubleClickToValue - && isEnabled() - && style != IncDecButtons - && minimum <= doubleClickReturnValue - && maximum >= doubleClickReturnValue) - { - sendDragStart(); - setValue (doubleClickReturnValue, true, true); - sendDragEnd(); - } -} - -void Slider::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, float wheelIncrementY) -{ - if (scrollWheelEnabled && isEnabled() - && style != TwoValueHorizontal - && style != TwoValueVertical) - { - if (maximum > minimum && ! isMouseButtonDownAnywhere()) - { - if (valueBox != 0) - valueBox->hideEditor (false); - - const double proportionDelta = (wheelIncrementX != 0 ? -wheelIncrementX : wheelIncrementY) * 0.15f; - const double currentPos = valueToProportionOfLength (currentValue); - const double newValue = proportionOfLengthToValue (jlimit (0.0, 1.0, currentPos + proportionDelta)); - - double delta = (newValue != currentValue) - ? jmax (fabs (newValue - currentValue), interval) : 0; - - if (currentValue > newValue) - delta = -delta; - - sendDragStart(); - setValue (snapValue (currentValue + delta, false), true, true); - sendDragEnd(); - } - } - else - { - Component::mouseWheelMove (e, wheelIncrementX, wheelIncrementY); - } -} - -void SliderListener::sliderDragStarted (Slider*) -{ -} - -void SliderListener::sliderDragEnded (Slider*) -{ -} - - -END_JUCE_NAMESPACE +/* + ============================================================================== + + 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 "../../../../juce_core/basics/juce_StandardHeader.h" + +BEGIN_JUCE_NAMESPACE + +#include "juce_Slider.h" +#include "../lookandfeel/juce_LookAndFeel.h" +#include "../menus/juce_PopupMenu.h" +#include "../juce_Desktop.h" +#include "../special/juce_BubbleComponent.h" +#include "../../../../juce_core/text/juce_LocalisedStrings.h" + + +//============================================================================== +class SliderPopupDisplayComponent : public BubbleComponent +{ +public: + //============================================================================== + SliderPopupDisplayComponent (Slider* const owner_) + : owner (owner_), + font (15.0f, Font::bold) + { + setAlwaysOnTop (true); + } + + ~SliderPopupDisplayComponent() + { + } + + void paintContent (Graphics& g, int w, int h) + { + g.setFont (font); + g.setColour (Colours::black); + + g.drawFittedText (text, 0, 0, w, h, Justification::centred, 1); + } + + void getContentSize (int& w, int& h) + { + w = font.getStringWidth (text) + 18; + h = (int) (font.getHeight() * 1.6f); + } + + void updatePosition (const String& newText) + { + if (text != newText) + { + text = newText; + repaint(); + } + + BubbleComponent::setPosition (owner); + } + + //============================================================================== + juce_UseDebuggingNewOperator + +private: + Slider* owner; + Font font; + String text; + + SliderPopupDisplayComponent (const SliderPopupDisplayComponent&); + const SliderPopupDisplayComponent& operator= (const SliderPopupDisplayComponent&); +}; + +//============================================================================== +Slider::Slider (const String& name) + : Component (name), + listeners (2), + currentValue (0.0), + valueMin (0.0), + valueMax (0.0), + minimum (0), + maximum (10), + interval (0), + skewFactor (1.0), + velocityModeSensitivity (1.0), + velocityModeOffset (0.0), + velocityModeThreshold (1), + rotaryStart (float_Pi * 1.2f), + rotaryEnd (float_Pi * 2.8f), + numDecimalPlaces (7), + sliderRegionStart (0), + sliderRegionSize (1), + sliderBeingDragged (-1), + pixelsForFullDragExtent (250), + style (LinearHorizontal), + textBoxPos (TextBoxLeft), + textBoxWidth (80), + textBoxHeight (20), + incDecButtonMode (incDecButtonsNotDraggable), + editableText (true), + doubleClickToValue (false), + isVelocityBased (false), + userKeyOverridesVelocity (true), + rotaryStop (true), + incDecButtonsSideBySide (false), + sendChangeOnlyOnRelease (false), + popupDisplayEnabled (false), + menuEnabled (false), + menuShown (false), + scrollWheelEnabled (true), + snapsToMousePos (true), + valueBox (0), + incButton (0), + decButton (0), + popupDisplay (0), + parentForPopupDisplay (0) +{ + setWantsKeyboardFocus (false); + setRepaintsOnMouseActivity (true); + + lookAndFeelChanged(); + updateText(); +} + +Slider::~Slider() +{ + deleteAndZero (popupDisplay); + deleteAllChildren(); +} + + +//============================================================================== +void Slider::handleAsyncUpdate() +{ + cancelPendingUpdate(); + + for (int i = listeners.size(); --i >= 0;) + { + ((SliderListener*) listeners.getUnchecked (i))->sliderValueChanged (this); + i = jmin (i, listeners.size()); + } +} + +void Slider::sendDragStart() +{ + startedDragging(); + + for (int i = listeners.size(); --i >= 0;) + { + ((SliderListener*) listeners.getUnchecked (i))->sliderDragStarted (this); + i = jmin (i, listeners.size()); + } +} + +void Slider::sendDragEnd() +{ + stoppedDragging(); + + sliderBeingDragged = -1; + + for (int i = listeners.size(); --i >= 0;) + { + ((SliderListener*) listeners.getUnchecked (i))->sliderDragEnded (this); + i = jmin (i, listeners.size()); + } +} + +void Slider::addListener (SliderListener* const listener) throw() +{ + jassert (listener != 0); + if (listener != 0) + listeners.add (listener); +} + +void Slider::removeListener (SliderListener* const listener) throw() +{ + listeners.removeValue (listener); +} + +//============================================================================== +void Slider::setSliderStyle (const SliderStyle newStyle) +{ + if (style != newStyle) + { + style = newStyle; + repaint(); + lookAndFeelChanged(); + } +} + +void Slider::setRotaryParameters (const float startAngleRadians, + const float endAngleRadians, + const bool stopAtEnd) +{ + // make sure the values are sensible.. + jassert (rotaryStart >= 0 && rotaryEnd >= 0); + jassert (rotaryStart < float_Pi * 4.0f && rotaryEnd < float_Pi * 4.0f); + jassert (rotaryStart < rotaryEnd); + + rotaryStart = startAngleRadians; + rotaryEnd = endAngleRadians; + rotaryStop = stopAtEnd; +} + +void Slider::setVelocityBasedMode (const bool velBased) throw() +{ + isVelocityBased = velBased; +} + +void Slider::setVelocityModeParameters (const double sensitivity, + const int threshold, + const double offset, + const bool userCanPressKeyToSwapMode) throw() +{ + jassert (threshold >= 0); + jassert (sensitivity > 0); + jassert (offset >= 0); + + velocityModeSensitivity = sensitivity; + velocityModeOffset = offset; + velocityModeThreshold = threshold; + userKeyOverridesVelocity = userCanPressKeyToSwapMode; +} + +void Slider::setSkewFactor (const double factor) throw() +{ + skewFactor = factor; +} + +void Slider::setSkewFactorFromMidPoint (const double sliderValueToShowAtMidPoint) throw() +{ + if (maximum > minimum) + skewFactor = log (0.5) / log ((sliderValueToShowAtMidPoint - minimum) + / (maximum - minimum)); +} + +void Slider::setMouseDragSensitivity (const int distanceForFullScaleDrag) +{ + jassert (distanceForFullScaleDrag > 0); + + pixelsForFullDragExtent = distanceForFullScaleDrag; +} + +void Slider::setIncDecButtonsMode (const IncDecButtonMode mode) +{ + if (incDecButtonMode != mode) + { + incDecButtonMode = mode; + lookAndFeelChanged(); + } +} + +void Slider::setTextBoxStyle (const TextEntryBoxPosition newPosition, + const bool isReadOnly, + const int textEntryBoxWidth, + const int textEntryBoxHeight) +{ + textBoxPos = newPosition; + editableText = ! isReadOnly; + textBoxWidth = textEntryBoxWidth; + textBoxHeight = textEntryBoxHeight; + + repaint(); + lookAndFeelChanged(); +} + +void Slider::setTextBoxIsEditable (const bool shouldBeEditable) throw() +{ + editableText = shouldBeEditable; + + if (valueBox != 0) + valueBox->setEditable (shouldBeEditable && isEnabled()); +} + +void Slider::showTextBox() +{ + jassert (editableText); // this should probably be avoided in read-only sliders. + + if (valueBox != 0) + valueBox->showEditor(); +} + +void Slider::hideTextBox (const bool discardCurrentEditorContents) +{ + if (valueBox != 0) + { + valueBox->hideEditor (discardCurrentEditorContents); + + if (discardCurrentEditorContents) + updateText(); + } +} + +void Slider::setChangeNotificationOnlyOnRelease (const bool onlyNotifyOnRelease) throw() +{ + sendChangeOnlyOnRelease = onlyNotifyOnRelease; +} + +void Slider::setSliderSnapsToMousePosition (const bool shouldSnapToMouse) throw() +{ + snapsToMousePos = shouldSnapToMouse; +} + +void Slider::setPopupDisplayEnabled (const bool enabled, + Component* const parentComponentToUse) throw() +{ + popupDisplayEnabled = enabled; + parentForPopupDisplay = parentComponentToUse; +} + +//============================================================================== +void Slider::colourChanged() +{ + lookAndFeelChanged(); +} + +void Slider::lookAndFeelChanged() +{ + const String previousTextBoxContent (valueBox != 0 ? valueBox->getText() + : getTextFromValue (currentValue)); + + deleteAllChildren(); + valueBox = 0; + + LookAndFeel& lf = getLookAndFeel(); + + if (textBoxPos != NoTextBox) + { + addAndMakeVisible (valueBox = getLookAndFeel().createSliderTextBox (*this)); + + valueBox->setWantsKeyboardFocus (false); + valueBox->setText (previousTextBoxContent, false); + + valueBox->setEditable (editableText && isEnabled()); + valueBox->addListener (this); + + if (style == LinearBar) + valueBox->addMouseListener (this, false); + } + + if (style == IncDecButtons) + { + addAndMakeVisible (incButton = lf.createSliderButton (true)); + incButton->addButtonListener (this); + + addAndMakeVisible (decButton = lf.createSliderButton (false)); + decButton->addButtonListener (this); + + if (incDecButtonMode != incDecButtonsNotDraggable) + { + incButton->addMouseListener (this, false); + decButton->addMouseListener (this, false); + } + else + { + incButton->setRepeatSpeed (300, 100, 20); + incButton->addMouseListener (decButton, false); + + decButton->setRepeatSpeed (300, 100, 20); + decButton->addMouseListener (incButton, false); + } + } + + setComponentEffect (lf.getSliderEffect()); + + resized(); + repaint(); +} + +//============================================================================== +void Slider::setRange (const double newMin, + const double newMax, + const double newInt) +{ + if (minimum != newMin + || maximum != newMax + || interval != newInt) + { + minimum = newMin; + maximum = newMax; + interval = newInt; + + // figure out the number of DPs needed to display all values at this + // interval setting. + numDecimalPlaces = 7; + + if (newInt != 0) + { + int v = abs ((int) (newInt * 10000000)); + + while ((v % 10) == 0) + { + --numDecimalPlaces; + v /= 10; + } + } + + // keep the current values inside the new range.. + if (style != TwoValueHorizontal && style != TwoValueVertical) + { + setValue (currentValue, false, false); + } + else + { + setMinValue (getMinValue(), false, false); + setMaxValue (getMaxValue(), false, false); + } + + updateText(); + } +} + +void Slider::triggerChangeMessage (const bool synchronous) +{ + if (synchronous) + handleAsyncUpdate(); + else + triggerAsyncUpdate(); + + valueChanged(); +} + +double Slider::getValue() const throw() +{ + // for a two-value style slider, you should use the getMinValue() and getMaxValue() + // methods to get the two values. + jassert (style != TwoValueHorizontal && style != TwoValueVertical); + + return currentValue; +} + +void Slider::setValue (double newValue, + const bool sendUpdateMessage, + const bool sendMessageSynchronously) +{ + // for a two-value style slider, you should use the setMinValue() and setMaxValue() + // methods to set the two values. + jassert (style != TwoValueHorizontal && style != TwoValueVertical); + + newValue = constrainedValue (newValue); + + if (style == ThreeValueHorizontal || style == ThreeValueVertical) + { + jassert (valueMin <= valueMax); + newValue = jlimit (valueMin, valueMax, newValue); + } + + if (currentValue != newValue) + { + if (valueBox != 0) + valueBox->hideEditor (true); + + currentValue = newValue; + updateText(); + repaint(); + + if (popupDisplay != 0) + { + ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (currentValue)); + popupDisplay->repaint(); + } + + if (sendUpdateMessage) + triggerChangeMessage (sendMessageSynchronously); + } +} + +double Slider::getMinValue() const throw() +{ + // The minimum value only applies to sliders that are in two- or three-value mode. + jassert (style == TwoValueHorizontal || style == TwoValueVertical + || style == ThreeValueHorizontal || style == ThreeValueVertical); + + return valueMin; +} + +double Slider::getMaxValue() const throw() +{ + // The maximum value only applies to sliders that are in two- or three-value mode. + jassert (style == TwoValueHorizontal || style == TwoValueVertical + || style == ThreeValueHorizontal || style == ThreeValueVertical); + + return valueMax; +} + +void Slider::setMinValue (double newValue, const bool sendUpdateMessage, const bool sendMessageSynchronously) +{ + // The minimum value only applies to sliders that are in two- or three-value mode. + jassert (style == TwoValueHorizontal || style == TwoValueVertical + || style == ThreeValueHorizontal || style == ThreeValueVertical); + + newValue = constrainedValue (newValue); + + if (style == TwoValueHorizontal || style == TwoValueVertical) + newValue = jmin (valueMax, newValue); + else + newValue = jmin (currentValue, newValue); + + if (valueMin != newValue) + { + valueMin = newValue; + repaint(); + + if (popupDisplay != 0) + { + ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (valueMin)); + popupDisplay->repaint(); + } + + if (sendUpdateMessage) + triggerChangeMessage (sendMessageSynchronously); + } +} + +void Slider::setMaxValue (double newValue, const bool sendUpdateMessage, const bool sendMessageSynchronously) +{ + // The maximum value only applies to sliders that are in two- or three-value mode. + jassert (style == TwoValueHorizontal || style == TwoValueVertical + || style == ThreeValueHorizontal || style == ThreeValueVertical); + + newValue = constrainedValue (newValue); + + if (style == TwoValueHorizontal || style == TwoValueVertical) + newValue = jmax (valueMin, newValue); + else + newValue = jmax (currentValue, newValue); + + if (valueMax != newValue) + { + valueMax = newValue; + repaint(); + + if (popupDisplay != 0) + { + ((SliderPopupDisplayComponent*) popupDisplay)->updatePosition (getTextFromValue (valueMax)); + popupDisplay->repaint(); + } + + if (sendUpdateMessage) + triggerChangeMessage (sendMessageSynchronously); + } +} + +void Slider::setDoubleClickReturnValue (const bool isDoubleClickEnabled, + const double valueToSetOnDoubleClick) throw() +{ + doubleClickToValue = isDoubleClickEnabled; + doubleClickReturnValue = valueToSetOnDoubleClick; +} + +double Slider::getDoubleClickReturnValue (bool& isEnabled_) const throw() +{ + isEnabled_ = doubleClickToValue; + return doubleClickReturnValue; +} + +void Slider::updateText() +{ + if (valueBox != 0) + valueBox->setText (getTextFromValue (currentValue), false); +} + +void Slider::setTextValueSuffix (const String& suffix) +{ + if (textSuffix != suffix) + { + textSuffix = suffix; + updateText(); + } +} + +const String Slider::getTextFromValue (double v) +{ + if (numDecimalPlaces > 0) + return String (v, numDecimalPlaces) + textSuffix; + else + return String (roundDoubleToInt (v)) + textSuffix; +} + +double Slider::getValueFromText (const String& text) +{ + String t (text.trimStart()); + + if (t.endsWith (textSuffix)) + t = t.substring (0, t.length() - textSuffix.length()); + + while (t.startsWithChar (T('+'))) + t = t.substring (1).trimStart(); + + return t.initialSectionContainingOnly (T("0123456789.,-")) + .getDoubleValue(); +} + +double Slider::proportionOfLengthToValue (double proportion) +{ + if (skewFactor != 1.0 && proportion > 0.0) + proportion = exp (log (proportion) / skewFactor); + + return minimum + (maximum - minimum) * proportion; +} + +double Slider::valueToProportionOfLength (double value) +{ + const double n = (value - minimum) / (maximum - minimum); + + return skewFactor == 1.0 ? n : pow (n, skewFactor); +} + +double Slider::snapValue (double attemptedValue, const bool) +{ + return attemptedValue; +} + +//============================================================================== +void Slider::startedDragging() +{ +} + +void Slider::stoppedDragging() +{ +} + +void Slider::valueChanged() +{ +} + +//============================================================================== +void Slider::enablementChanged() +{ + repaint(); +} + +void Slider::setPopupMenuEnabled (const bool menuEnabled_) throw() +{ + menuEnabled = menuEnabled_; +} + +void Slider::setScrollWheelEnabled (const bool enabled) throw() +{ + scrollWheelEnabled = enabled; +} + +//============================================================================== +void Slider::labelTextChanged (Label* label) +{ + const double newValue = snapValue (getValueFromText (label->getText()), false); + + if (getValue() != newValue) + { + sendDragStart(); + setValue (newValue, true, true); + sendDragEnd(); + } + + updateText(); // force a clean-up of the text, needed in case setValue() hasn't done this. +} + +void Slider::buttonClicked (Button* button) +{ + if (style == IncDecButtons) + { + sendDragStart(); + + if (button == incButton) + setValue (snapValue (getValue() + interval, false), true, true); + else if (button == decButton) + setValue (snapValue (getValue() - interval, false), true, true); + + sendDragEnd(); + } +} + +//============================================================================== +double Slider::constrainedValue (double value) const throw() +{ + if (interval > 0) + value = minimum + interval * floor ((value - minimum) / interval + 0.5); + + if (value <= minimum || maximum <= minimum) + value = minimum; + else if (value >= maximum) + value = maximum; + + return value; +} + +float Slider::getLinearSliderPos (const double value) +{ + double sliderPosProportional; + + if (maximum > minimum) + { + if (value < minimum) + { + sliderPosProportional = 0.0; + } + else if (value > maximum) + { + sliderPosProportional = 1.0; + } + else + { + sliderPosProportional = valueToProportionOfLength (value); + jassert (sliderPosProportional >= 0 && sliderPosProportional <= 1.0); + } + } + else + { + sliderPosProportional = 0.5; + } + + if (isVertical() || style == IncDecButtons) + sliderPosProportional = 1.0 - sliderPosProportional; + + return (float) (sliderRegionStart + sliderPosProportional * sliderRegionSize); +} + +bool Slider::isHorizontal() const throw() +{ + return style == LinearHorizontal + || style == LinearBar + || style == TwoValueHorizontal + || style == ThreeValueHorizontal; +} + +bool Slider::isVertical() const throw() +{ + return style == LinearVertical + || style == TwoValueVertical + || style == ThreeValueVertical; +} + +bool Slider::incDecDragDirectionIsHorizontal() const throw() +{ + return incDecButtonMode == incDecButtonsDraggable_Horizontal + || (incDecButtonMode == incDecButtonsDraggable_AutoDirection && incDecButtonsSideBySide); +} + +float Slider::getPositionOfValue (const double value) +{ + if (isHorizontal() || isVertical()) + { + return getLinearSliderPos (value); + } + else + { + jassertfalse // not a valid call on a slider that doesn't work linearly! + return 0.0f; + } +} + +//============================================================================== +void Slider::paint (Graphics& g) +{ + if (style != IncDecButtons) + { + if (style == Rotary || style == RotaryHorizontalDrag || style == RotaryVerticalDrag) + { + const float sliderPos = (float) valueToProportionOfLength (currentValue); + jassert (sliderPos >= 0 && sliderPos <= 1.0f); + + getLookAndFeel().drawRotarySlider (g, + sliderRect.getX(), + sliderRect.getY(), + sliderRect.getWidth(), + sliderRect.getHeight(), + sliderPos, + rotaryStart, rotaryEnd, + *this); + } + else + { + getLookAndFeel().drawLinearSlider (g, + sliderRect.getX(), + sliderRect.getY(), + sliderRect.getWidth(), + sliderRect.getHeight(), + getLinearSliderPos (currentValue), + getLinearSliderPos (valueMin), + getLinearSliderPos (valueMax), + style, + *this); + } + + if (style == LinearBar && valueBox == 0) + { + g.setColour (findColour (Slider::textBoxOutlineColourId)); + g.drawRect (0, 0, getWidth(), getHeight(), 1); + } + } +} + +void Slider::resized() +{ + int minXSpace = 0; + int minYSpace = 0; + + if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) + minXSpace = 30; + else + minYSpace = 15; + + const int tbw = jmax (0, jmin (textBoxWidth, getWidth() - minXSpace)); + const int tbh = jmax (0, jmin (textBoxHeight, getHeight() - minYSpace)); + + if (style == LinearBar) + { + if (valueBox != 0) + valueBox->setBounds (0, 0, getWidth(), getHeight()); + } + else + { + if (textBoxPos == NoTextBox) + { + sliderRect.setBounds (0, 0, getWidth(), getHeight()); + } + else if (textBoxPos == TextBoxLeft) + { + valueBox->setBounds (0, (getHeight() - tbh) / 2, tbw, tbh); + sliderRect.setBounds (tbw, 0, getWidth() - tbw, getHeight()); + } + else if (textBoxPos == TextBoxRight) + { + valueBox->setBounds (getWidth() - tbw, (getHeight() - tbh) / 2, tbw, tbh); + sliderRect.setBounds (0, 0, getWidth() - tbw, getHeight()); + } + else if (textBoxPos == TextBoxAbove) + { + valueBox->setBounds ((getWidth() - tbw) / 2, 0, tbw, tbh); + sliderRect.setBounds (0, tbh, getWidth(), getHeight() - tbh); + } + else if (textBoxPos == TextBoxBelow) + { + valueBox->setBounds ((getWidth() - tbw) / 2, getHeight() - tbh, tbw, tbh); + sliderRect.setBounds (0, 0, getWidth(), getHeight() - tbh); + } + } + + const int indent = getLookAndFeel().getSliderThumbRadius (*this); + + if (style == LinearBar) + { + const int barIndent = 1; + sliderRegionStart = barIndent; + sliderRegionSize = getWidth() - barIndent * 2; + + sliderRect.setBounds (sliderRegionStart, barIndent, + sliderRegionSize, getHeight() - barIndent * 2); + } + else if (isHorizontal()) + { + sliderRegionStart = sliderRect.getX() + indent; + sliderRegionSize = jmax (1, sliderRect.getWidth() - indent * 2); + + sliderRect.setBounds (sliderRegionStart, sliderRect.getY(), + sliderRegionSize, sliderRect.getHeight()); + } + else if (isVertical()) + { + sliderRegionStart = sliderRect.getY() + indent; + sliderRegionSize = jmax (1, sliderRect.getHeight() - indent * 2); + + sliderRect.setBounds (sliderRect.getX(), sliderRegionStart, + sliderRect.getWidth(), sliderRegionSize); + } + else + { + sliderRegionStart = 0; + sliderRegionSize = 100; + } + + if (style == IncDecButtons) + { + Rectangle buttonRect (sliderRect); + + if (textBoxPos == TextBoxLeft || textBoxPos == TextBoxRight) + buttonRect.expand (-2, 0); + else + buttonRect.expand (0, -2); + + incDecButtonsSideBySide = buttonRect.getWidth() > buttonRect.getHeight(); + + if (incDecButtonsSideBySide) + { + decButton->setBounds (buttonRect.getX(), + buttonRect.getY(), + buttonRect.getWidth() / 2, + buttonRect.getHeight()); + + decButton->setConnectedEdges (Button::ConnectedOnRight); + + incButton->setBounds (buttonRect.getCentreX(), + buttonRect.getY(), + buttonRect.getWidth() / 2, + buttonRect.getHeight()); + + incButton->setConnectedEdges (Button::ConnectedOnLeft); + } + else + { + incButton->setBounds (buttonRect.getX(), + buttonRect.getY(), + buttonRect.getWidth(), + buttonRect.getHeight() / 2); + + incButton->setConnectedEdges (Button::ConnectedOnBottom); + + decButton->setBounds (buttonRect.getX(), + buttonRect.getCentreY(), + buttonRect.getWidth(), + buttonRect.getHeight() / 2); + + decButton->setConnectedEdges (Button::ConnectedOnTop); + } + } +} + +void Slider::focusOfChildComponentChanged (FocusChangeType) +{ + repaint(); +} + +void Slider::mouseDown (const MouseEvent& e) +{ + mouseWasHidden = false; + incDecDragged = false; + + if (isEnabled()) + { + if (e.mods.isPopupMenu() && menuEnabled) + { + menuShown = true; + + PopupMenu m; + m.addItem (1, TRANS ("velocity-sensitive mode"), true, isVelocityBased); + m.addSeparator(); + + if (style == Rotary || style == RotaryHorizontalDrag || style == RotaryVerticalDrag) + { + PopupMenu rotaryMenu; + rotaryMenu.addItem (2, TRANS ("use circular dragging"), true, style == Rotary); + rotaryMenu.addItem (3, TRANS ("use left-right dragging"), true, style == RotaryHorizontalDrag); + rotaryMenu.addItem (4, TRANS ("use up-down dragging"), true, style == RotaryVerticalDrag); + + m.addSubMenu (TRANS ("rotary mode"), rotaryMenu); + } + + const int r = m.show(); + + if (r == 1) + { + setVelocityBasedMode (! isVelocityBased); + } + else if (r == 2) + { + setSliderStyle (Rotary); + } + else if (r == 3) + { + setSliderStyle (RotaryHorizontalDrag); + } + else if (r == 4) + { + setSliderStyle (RotaryVerticalDrag); + } + } + else if (maximum > minimum) + { + menuShown = false; + + if (valueBox != 0) + valueBox->hideEditor (true); + + sliderBeingDragged = 0; + + if (style == TwoValueHorizontal + || style == TwoValueVertical + || style == ThreeValueHorizontal + || style == ThreeValueVertical) + { + const float mousePos = (float) (isVertical() ? e.y : e.x); + + const float normalPosDistance = fabsf (getLinearSliderPos (currentValue) - mousePos); + const float minPosDistance = fabsf (getLinearSliderPos (valueMin) - 0.1f - mousePos); + const float maxPosDistance = fabsf (getLinearSliderPos (valueMax) + 0.1f - mousePos); + + if (style == TwoValueHorizontal || style == TwoValueVertical) + { + if (maxPosDistance <= minPosDistance) + sliderBeingDragged = 2; + else + sliderBeingDragged = 1; + } + else if (style == ThreeValueHorizontal || style == ThreeValueVertical) + { + if (normalPosDistance >= minPosDistance && maxPosDistance >= minPosDistance) + sliderBeingDragged = 1; + else if (normalPosDistance >= maxPosDistance) + sliderBeingDragged = 2; + } + } + + minMaxDiff = valueMax - valueMin; + + mouseXWhenLastDragged = e.x; + mouseYWhenLastDragged = e.y; + lastAngle = rotaryStart + (rotaryEnd - rotaryStart) + * valueToProportionOfLength (currentValue); + + if (sliderBeingDragged == 2) + valueWhenLastDragged = valueMax; + else if (sliderBeingDragged == 1) + valueWhenLastDragged = valueMin; + else + valueWhenLastDragged = currentValue; + + valueOnMouseDown = valueWhenLastDragged; + + if (popupDisplayEnabled) + { + SliderPopupDisplayComponent* const popup = new SliderPopupDisplayComponent (this); + popupDisplay = popup; + + if (parentForPopupDisplay != 0) + { + parentForPopupDisplay->addChildComponent (popup); + } + else + { + popup->addToDesktop (0); + } + + popup->setVisible (true); + } + + sendDragStart(); + + mouseDrag (e); + } + } +} + +void Slider::mouseUp (const MouseEvent&) +{ + if (isEnabled() + && (! menuShown) + && (maximum > minimum) + && (style != IncDecButtons || incDecDragged)) + { + restoreMouseIfHidden(); + + if (sendChangeOnlyOnRelease && valueOnMouseDown != currentValue) + triggerChangeMessage (false); + + sendDragEnd(); + + deleteAndZero (popupDisplay); + + if (style == IncDecButtons) + { + incButton->setState (Button::buttonNormal); + decButton->setState (Button::buttonNormal); + } + } +} + +void Slider::restoreMouseIfHidden() +{ + if (mouseWasHidden) + { + mouseWasHidden = false; + + Component* c = Component::getComponentUnderMouse(); + + if (c == 0) + c = this; + + c->enableUnboundedMouseMovement (false); + + const double pos = (sliderBeingDragged == 2) ? getMaxValue() + : ((sliderBeingDragged == 1) ? getMinValue() + : currentValue); + + if (style == RotaryHorizontalDrag || style == RotaryVerticalDrag) + { + int x, y, downX, downY; + Desktop::getMousePosition (x, y); + Desktop::getLastMouseDownPosition (downX, downY); + + if (style == RotaryHorizontalDrag) + { + const double posDiff = valueToProportionOfLength (pos) - valueToProportionOfLength (valueOnMouseDown); + x = roundDoubleToInt (pixelsForFullDragExtent * posDiff + downX); + y = downY; + } + else + { + const double posDiff = valueToProportionOfLength (valueOnMouseDown) - valueToProportionOfLength (pos); + x = downX; + y = roundDoubleToInt (pixelsForFullDragExtent * posDiff + downY); + } + + Desktop::setMousePosition (x, y); + } + else + { + const int pixelPos = (int) getLinearSliderPos (pos); + + int x = isHorizontal() ? pixelPos : (getWidth() / 2); + int y = isVertical() ? pixelPos : (getHeight() / 2); + + relativePositionToGlobal (x, y); + Desktop::setMousePosition (x, y); + } + } +} + +void Slider::modifierKeysChanged (const ModifierKeys& modifiers) +{ + if (isEnabled() + && style != IncDecButtons + && style != Rotary + && isVelocityBased == modifiers.isAnyModifierKeyDown()) + { + restoreMouseIfHidden(); + } +} + +static double smallestAngleBetween (double a1, double a2) +{ + return jmin (fabs (a1 - a2), + fabs (a1 + double_Pi * 2.0 - a2), + fabs (a2 + double_Pi * 2.0 - a1)); +} + +void Slider::mouseDrag (const MouseEvent& e) +{ + if (isEnabled() + && (! menuShown) + && (maximum > minimum)) + { + if (style == Rotary) + { + int dx = e.x - sliderRect.getCentreX(); + int dy = e.y - sliderRect.getCentreY(); + + if (dx * dx + dy * dy > 25) + { + double angle = atan2 ((double) dx, (double) -dy); + while (angle < 0.0) + angle += double_Pi * 2.0; + + if (rotaryStop && ! e.mouseWasClicked()) + { + if (fabs (angle - lastAngle) > double_Pi) + { + if (angle >= lastAngle) + angle -= double_Pi * 2.0; + else + angle += double_Pi * 2.0; + } + + if (angle >= lastAngle) + angle = jmin (angle, (double) jmax (rotaryStart, rotaryEnd)); + else + angle = jmax (angle, (double) jmin (rotaryStart, rotaryEnd)); + } + else + { + while (angle < rotaryStart) + angle += double_Pi * 2.0; + + if (angle > rotaryEnd) + { + if (smallestAngleBetween (angle, rotaryStart) <= smallestAngleBetween (angle, rotaryEnd)) + angle = rotaryStart; + else + angle = rotaryEnd; + } + } + + const double proportion = (angle - rotaryStart) / (rotaryEnd - rotaryStart); + + valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, proportion)); + + lastAngle = angle; + } + } + else + { + if (style == LinearBar && e.mouseWasClicked() + && valueBox != 0 && valueBox->isEditable()) + return; + + if (style == IncDecButtons) + { + if (! incDecDragged) + incDecDragged = e.getDistanceFromDragStart() > 10 && ! e.mouseWasClicked(); + + if (! incDecDragged) + return; + } + + + if ((isVelocityBased == (userKeyOverridesVelocity ? e.mods.testFlags (ModifierKeys::ctrlModifier | ModifierKeys::commandModifier | ModifierKeys::altModifier) + : false)) + || ((maximum - minimum) / sliderRegionSize < interval)) + { + const int mousePos = (isHorizontal() || style == RotaryHorizontalDrag) ? e.x : e.y; + + double scaledMousePos = (mousePos - sliderRegionStart) / (double) sliderRegionSize; + + if (style == RotaryHorizontalDrag + || style == RotaryVerticalDrag + || style == IncDecButtons + || ((style == LinearHorizontal || style == LinearVertical || style == LinearBar) + && ! snapsToMousePos)) + { + const int mouseDiff = (style == RotaryHorizontalDrag + || style == LinearHorizontal + || style == LinearBar + || (style == IncDecButtons && incDecDragDirectionIsHorizontal())) + ? e.getDistanceFromDragStartX() + : -e.getDistanceFromDragStartY(); + + double newPos = valueToProportionOfLength (valueOnMouseDown) + + mouseDiff * (1.0 / pixelsForFullDragExtent); + + valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, newPos)); + + if (style == IncDecButtons) + { + incButton->setState (mouseDiff < 0 ? Button::buttonNormal : Button::buttonDown); + decButton->setState (mouseDiff > 0 ? Button::buttonNormal : Button::buttonDown); + } + } + else + { + if (isVertical()) + scaledMousePos = 1.0 - scaledMousePos; + + valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, scaledMousePos)); + } + } + else + { + const int mouseDiff = (isHorizontal() || style == RotaryHorizontalDrag + || (style == IncDecButtons && incDecDragDirectionIsHorizontal())) + ? e.x - mouseXWhenLastDragged + : e.y - mouseYWhenLastDragged; + + const double maxSpeed = jmax (200, sliderRegionSize); + double speed = jlimit (0.0, maxSpeed, (double) abs (mouseDiff)); + + if (speed != 0) + { + speed = 0.2 * velocityModeSensitivity + * (1.0 + sin (double_Pi * (1.5 + jmin (0.5, velocityModeOffset + + jmax (0.0, (double) (speed - velocityModeThreshold)) + / maxSpeed)))); + + if (mouseDiff < 0) + speed = -speed; + + if (isVertical() || style == RotaryVerticalDrag + || (style == IncDecButtons && ! incDecDragDirectionIsHorizontal())) + speed = -speed; + + const double currentPos = valueToProportionOfLength (valueWhenLastDragged); + + valueWhenLastDragged = proportionOfLengthToValue (jlimit (0.0, 1.0, currentPos + speed)); + + e.originalComponent->enableUnboundedMouseMovement (true, false); + mouseWasHidden = true; + } + } + } + + valueWhenLastDragged = jlimit (minimum, maximum, valueWhenLastDragged); + + if (sliderBeingDragged == 0) + { + setValue (snapValue (valueWhenLastDragged, true), + ! sendChangeOnlyOnRelease, true); + } + else if (sliderBeingDragged == 1) + { + setMinValue (snapValue (valueWhenLastDragged, true), + ! sendChangeOnlyOnRelease, false); + + if (e.mods.isShiftDown()) + setMaxValue (getMinValue() + minMaxDiff, false); + else + minMaxDiff = valueMax - valueMin; + } + else + { + jassert (sliderBeingDragged == 2); + + setMaxValue (snapValue (valueWhenLastDragged, true), + ! sendChangeOnlyOnRelease, false); + + if (e.mods.isShiftDown()) + setMinValue (getMaxValue() - minMaxDiff, false); + else + minMaxDiff = valueMax - valueMin; + } + + mouseXWhenLastDragged = e.x; + mouseYWhenLastDragged = e.y; + } +} + +void Slider::mouseDoubleClick (const MouseEvent&) +{ + if (doubleClickToValue + && isEnabled() + && style != IncDecButtons + && minimum <= doubleClickReturnValue + && maximum >= doubleClickReturnValue) + { + sendDragStart(); + setValue (doubleClickReturnValue, true, true); + sendDragEnd(); + } +} + +void Slider::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, float wheelIncrementY) +{ + if (scrollWheelEnabled && isEnabled() + && style != TwoValueHorizontal + && style != TwoValueVertical) + { + if (maximum > minimum && ! isMouseButtonDownAnywhere()) + { + if (valueBox != 0) + valueBox->hideEditor (false); + + const double proportionDelta = (wheelIncrementX != 0 ? -wheelIncrementX : wheelIncrementY) * 0.15f; + const double currentPos = valueToProportionOfLength (currentValue); + const double newValue = proportionOfLengthToValue (jlimit (0.0, 1.0, currentPos + proportionDelta)); + + double delta = (newValue != currentValue) + ? jmax (fabs (newValue - currentValue), interval) : 0; + + if (currentValue > newValue) + delta = -delta; + + sendDragStart(); + setValue (snapValue (currentValue + delta, false), true, true); + sendDragEnd(); + } + } + else + { + Component::mouseWheelMove (e, wheelIncrementX, wheelIncrementY); + } +} + +void SliderListener::sliderDragStarted (Slider*) +{ +} + +void SliderListener::sliderDragEnded (Slider*) +{ +} + + +END_JUCE_NAMESPACE diff --git a/src/juce_appframework/gui/components/juce_Component.cpp b/src/juce_appframework/gui/components/juce_Component.cpp index ad586e3597..e98c4bd8bd 100644 --- a/src/juce_appframework/gui/components/juce_Component.cpp +++ b/src/juce_appframework/gui/components/juce_Component.cpp @@ -1425,7 +1425,7 @@ int Component::runModalLoop() { while (flags.currentlyModalFlag && flags.visibleFlag) { - if (! MessageManager::getInstance()->dispatchNextMessage()) + if (! MessageManager::getInstance()->runDispatchLoopUntil (20)) break; // check whether this component was deleted during the last message diff --git a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index 47e4a61bd7..c01e957997 100644 --- a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -954,15 +954,15 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& const bool showChannelsAsStereoPairs_, const bool hideAdvancedOptionsWithButton_) : deviceManager (deviceManager_), + deviceTypeDropDown (0), + deviceTypeDropDownLabel (0), + audioDeviceSettingsComp (0), minOutputChannels (minOutputChannels_), maxOutputChannels (maxOutputChannels_), minInputChannels (minInputChannels_), maxInputChannels (maxInputChannels_), showChannelsAsStereoPairs (showChannelsAsStereoPairs_), - hideAdvancedOptionsWithButton (hideAdvancedOptionsWithButton_), - deviceTypeDropDown (0), - deviceTypeDropDownLabel (0), - audioDeviceSettingsComp (0) + hideAdvancedOptionsWithButton (hideAdvancedOptionsWithButton_) { jassert (minOutputChannels >= 0 && minOutputChannels <= maxOutputChannels); jassert (minInputChannels >= 0 && minInputChannels <= maxInputChannels); diff --git a/src/juce_appframework/gui/components/special/juce_NSViewComponent.h b/src/juce_appframework/gui/components/special/juce_NSViewComponent.h new file mode 100644 index 0000000000..935f8de930 --- /dev/null +++ b/src/juce_appframework/gui/components/special/juce_NSViewComponent.h @@ -0,0 +1,96 @@ +/* + ============================================================================== + + 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_NSVIEWCOMPONENT_JUCEHEADER__ +#define __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ + +#include "../juce_Component.h" +#if ! DOXYGEN + class NSViewComponentInternal; +#endif + +#if JUCE_MAC || DOXYGEN + +//============================================================================== +/** + A Mac-specific class that can create and embed an NSView inside itself. + + To use it, create one of these, put it in place and make sure it's visible in a + window, then use setView() to assign an NSView to it. The view will then be + moved and resized to follow the movements of this component. + + Of course, since the view is a native object, it'll obliterate any + juce components that may overlap this component, but that's life. +*/ +class JUCE_API NSViewComponent : public Component +{ +public: + //============================================================================== + /** Create an initially-empty container. */ + NSViewComponent(); + + /** Destructor. */ + ~NSViewComponent(); + + /** Assigns an NSView to this peer. + + The view will be retained and released by this component for as long as + it is needed. To remove the current view, just call setView (0). + + Note: a void* is used here to avoid including the cocoa headers as + part of the juce.h, but the method expects an NSView*. + */ + void setView (void* nsView); + + /** Returns the current NSView. + + Note: a void* is returned here to avoid including the cocoa headers as + a requirement of juce.h, so you should just cast the object to an NSView*. + */ + void* getView() const; + + //============================================================================== + /** @internal */ + void paint (Graphics& g); + + juce_UseDebuggingNewOperator + +private: + friend class NSViewComponentInternal; + NSViewComponentInternal* info; + + NSViewComponent (const NSViewComponent&); + const NSViewComponent& operator= (const NSViewComponent&); +}; + +#endif + +#endif // __JUCE_NSVIEWCOMPONENT_JUCEHEADER__ diff --git a/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h b/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h index fd0fddfda9..0cc0624805 100644 --- a/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h +++ b/src/juce_appframework/gui/components/special/juce_OpenGLComponent.h @@ -328,6 +328,13 @@ public: /** @internal */ void paint (Graphics& g); + /** Returns the native handle of an embedded heavyweight window, if there is one. + + E.g. On windows, this will return the HWND of the sub-window containing + the opengl context, on the mac it'll be the NSOpenGLView. + */ + void* getNativeWindowHandle() const; + juce_UseDebuggingNewOperator private: diff --git a/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp b/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp deleted file mode 100644 index 595ffa2136..0000000000 --- a/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.cpp +++ /dev/null @@ -1,1115 +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. - - ============================================================================== -*/ - -#include "../../../../../juce_Config.h" - -#if JUCE_QUICKTIME - -#ifdef _MSC_VER - #pragma warning (disable: 4514) -#endif - -#ifdef _WIN32 - #include - - #ifdef _MSC_VER - #pragma warning (push) - #pragma warning (disable : 4100) - #endif - - /* If you've got an include error here, you probably need to install the QuickTime SDK and - add its header directory to your include path. - - Alternatively, if you don't need any QuickTime services, just turn off the JUCE_QUICKTIME - flag in juce_Config.h - */ - #include - #include - #include - #include - #include - - #ifdef _MSC_VER - #pragma warning (pop) - #endif - - // If you've got QuickTime 7 installed, then these COM objects should be found in - // the "\Program Files\Quicktime" directory. You'll need to add this directory to - // your include search path to make these import statements work. - #import - #import - - using namespace QTOLibrary; - using namespace QTOControlLib; -#else - #include - #include - #include - #include -#endif - -#include "../../../../juce_core/basics/juce_StandardHeader.h" - -BEGIN_JUCE_NAMESPACE - -#include "juce_QuickTimeMovieComponent.h" -#include "../../../../juce_core/io/files/juce_FileInputStream.h" - -bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle); - -static bool hasLoadedQT = false; -static bool isQTAvailable = false; - - -//============================================================================== -struct QTMovieCompInternal -{ - QTMovieCompInternal() - : dataHandle (0) - { -#if JUCE_MAC - movie = 0; - controller = 0; -#endif - } - - ~QTMovieCompInternal() - { - clearHandle(); - } - -#if JUCE_MAC - Movie movie; - MovieController controller; -#else - IQTControlPtr qtControlInternal; - IQTMoviePtr qtMovieInternal; -#endif - - Handle dataHandle; - - void clearHandle() - { - if (dataHandle != 0) - { - DisposeHandle (dataHandle); - dataHandle = 0; - } - } -}; - -#if JUCE_WIN32 - -#define qtControl (((QTMovieCompInternal*) internal)->qtControlInternal) -#define qtMovie (((QTMovieCompInternal*) internal)->qtMovieInternal) - -//============================================================================== -QuickTimeMovieComponent::QuickTimeMovieComponent() - : movieLoaded (false), - controllerVisible (true) -{ - internal = new QTMovieCompInternal(); - setMouseEventsAllowed (false); -} - -QuickTimeMovieComponent::~QuickTimeMovieComponent() -{ - closeMovie(); - qtControl = 0; - - deleteControl(); - - delete internal; - internal = 0; -} - -bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - - isQTAvailable = (InitializeQTML (0) == noErr) - && (EnterMovies() == noErr); - } - - return isQTAvailable; -} - -//============================================================================== -void QuickTimeMovieComponent::createControlIfNeeded() -{ - if (isShowing() && ! isControlCreated()) - { - const IID qtIID = __uuidof (QTControl); - - if (createControl (&qtIID)) - { - const IID qtInterfaceIID = __uuidof (IQTControl); - qtControl = (IQTControl*) queryInterface (&qtInterfaceIID); - - if (qtControl != 0) - { - qtControl->Release(); // it has one ref too many at this point - - qtControl->QuickTimeInitialize(); - qtControl->PutSizing (qtMovieFitsControl); - - if (movieFile != File::nonexistent) - loadMovie (movieFile, controllerVisible); - } - } - } -} - -bool QuickTimeMovieComponent::isControlCreated() const -{ - return isControlOpen(); -} - -bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, - const bool isControllerVisible) -{ - movieFile = File::nonexistent; - movieLoaded = false; - qtMovie = 0; - controllerVisible = isControllerVisible; - createControlIfNeeded(); - - if (isControlCreated()) - { - if (qtControl != 0) - { - qtControl->Put_MovieHandle (0); - ((QTMovieCompInternal*) internal)->clearHandle(); - - Movie movie; - if (juce_OpenQuickTimeMovieFromStream (movieStream, movie, ((QTMovieCompInternal*) internal)->dataHandle)) - { - qtControl->Put_MovieHandle ((long) (pointer_sized_int) movie); - - qtMovie = qtControl->GetMovie(); - - if (qtMovie != 0) - qtMovie->PutMovieControllerType (isControllerVisible ? qtMovieControllerTypeStandard - : qtMovieControllerTypeNone); - } - - if (movie == 0) - ((QTMovieCompInternal*) internal)->clearHandle(); - } - - movieLoaded = (qtMovie != 0); - } - else - { - // You're trying to open a movie when the control hasn't yet been created, probably because - // you've not yet added this component to a Window and made the whole component hierarchy visible. - jassertfalse - } - - delete movieStream; - return movieLoaded; -} - -void QuickTimeMovieComponent::closeMovie() -{ - stop(); - movieFile = File::nonexistent; - movieLoaded = false; - qtMovie = 0; - - if (qtControl != 0) - qtControl->Put_MovieHandle (0); - - ((QTMovieCompInternal*) internal)->clearHandle(); -} - -const File QuickTimeMovieComponent::getCurrentMovieFile() const -{ - return movieFile; -} - -bool QuickTimeMovieComponent::isMovieOpen() const -{ - return movieLoaded; -} - -double QuickTimeMovieComponent::getMovieDuration() const -{ - if (qtMovie != 0) - return qtMovie->GetDuration() / (double) qtMovie->GetTimeScale(); - - return 0.0; -} - -void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const -{ - if (qtMovie != 0) - { - struct QTRECT r = qtMovie->GetNaturalRect(); - - width = r.right - r.left; - height = r.bottom - r.top; - } - else - { - width = height = 0; - } -} - -void QuickTimeMovieComponent::play() -{ - if (qtMovie != 0) - qtMovie->Play(); -} - -void QuickTimeMovieComponent::stop() -{ - if (qtMovie != 0) - qtMovie->Stop(); -} - -bool QuickTimeMovieComponent::isPlaying() const -{ - return qtMovie != 0 && qtMovie->GetRate() != 0.0f; -} - -void QuickTimeMovieComponent::setPosition (const double seconds) -{ - if (qtMovie != 0) - qtMovie->PutTime ((long) (seconds * qtMovie->GetTimeScale())); -} - -double QuickTimeMovieComponent::getPosition() const -{ - if (qtMovie != 0) - return qtMovie->GetTime() / (double) qtMovie->GetTimeScale(); - - return 0.0; -} - -void QuickTimeMovieComponent::setSpeed (const float newSpeed) -{ - if (qtMovie != 0) - qtMovie->PutRate (newSpeed); -} - -void QuickTimeMovieComponent::setMovieVolume (const float newVolume) -{ - if (qtMovie != 0) - { - qtMovie->PutAudioVolume (newVolume); - qtMovie->PutAudioMute (newVolume <= 0); - } -} - -float QuickTimeMovieComponent::getMovieVolume() const -{ - if (qtMovie != 0) - return qtMovie->GetAudioVolume(); - - return 0.0f; -} - -void QuickTimeMovieComponent::setLooping (const bool shouldLoop) -{ - if (qtMovie != 0) - qtMovie->PutLoop (shouldLoop); -} - -bool QuickTimeMovieComponent::isLooping() const -{ - return qtMovie != 0 && qtMovie->GetLoop(); -} - -bool QuickTimeMovieComponent::isControllerVisible() const -{ - return controllerVisible; -} - -void QuickTimeMovieComponent::parentHierarchyChanged() -{ - createControlIfNeeded(); - QTWinBaseClass::parentHierarchyChanged(); -} - -void QuickTimeMovieComponent::visibilityChanged() -{ - createControlIfNeeded(); - QTWinBaseClass::visibilityChanged(); -} - -void QuickTimeMovieComponent::paint (Graphics& g) -{ - if (! isControlCreated()) - g.fillAll (Colours::black); -} - -#endif - -//============================================================================== -#if JUCE_MAC - -#include "../../../../juce_core/misc/juce_PlatformUtilities.h" -#include "../../../events/juce_MessageManager.h" -#include "../../graphics/geometry/juce_RectangleList.h" - -static VoidArray activeQTWindows (2); - -struct MacClickEventData -{ - ::Point where; - long when; - long modifiers; -}; - -void OfferMouseClickToQuickTime (WindowRef window, - ::Point where, long when, long modifiers, - Component* topLevelComp) -{ - if (hasLoadedQT) - { - for (int i = activeQTWindows.size(); --i >= 0;) - { - QuickTimeMovieComponent* const qtw = (QuickTimeMovieComponent*) activeQTWindows[i]; - - if (qtw->isVisible() && topLevelComp->isParentOf (qtw)) - { - MacClickEventData data; - data.where = where; - data.when = when; - data.modifiers = modifiers; - - qtw->handleMCEvent (&data); - } - } - } -} - -//============================================================================== -QuickTimeMovieComponent::QuickTimeMovieComponent() - : internal (new QTMovieCompInternal()), - associatedWindow (0), - controllerVisible (false), - controllerAssignedToWindow (false), - reentrant (false) -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - isQTAvailable = EnterMovies() == noErr; - } - - setOpaque (true); - setVisible (true); - - activeQTWindows.add (this); -} - -QuickTimeMovieComponent::~QuickTimeMovieComponent() -{ - closeMovie(); - - activeQTWindows.removeValue ((void*) this); - - QTMovieCompInternal* const i = (QTMovieCompInternal*) internal; - delete i; - - if (activeQTWindows.size() == 0 && isQTAvailable) - { - isQTAvailable = false; - hasLoadedQT = false; - - ExitMovies(); - } -} - -bool QuickTimeMovieComponent::isQuickTimeAvailable() throw() -{ - if (! hasLoadedQT) - { - hasLoadedQT = true; - isQTAvailable = EnterMovies() == noErr; - } - - return isQTAvailable; -} - -bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, - const bool controllerVisible_) -{ - if (! isQTAvailable) - return false; - - closeMovie(); - movieFile = File::nonexistent; - - if (getPeer() == 0) - { - // To open a movie, this component must be visible inside a functioning window, so that - // the QT control can be assigned to the window. - jassertfalse - return false; - } - - controllerVisible = controllerVisible_; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - GrafPtr savedPort; - GetPort (&savedPort); - bool result = false; - - if (juce_OpenQuickTimeMovieFromStream (movieStream, qmci->movie, qmci->dataHandle)) - { - qmci->controller = 0; - - void* window = getWindowHandle(); - - if (window != associatedWindow && window != 0) - associatedWindow = window; - - assignMovieToWindow(); - - SetMovieActive (qmci->movie, true); - SetMovieProgressProc (qmci->movie, (MovieProgressUPP) -1, 0); - - startTimer (1000 / 50); // this needs to be quite a high frequency for smooth playback - result = true; - - repaint(); - } - - MacSetPort (savedPort); - - return result; -} - -void QuickTimeMovieComponent::closeMovie() -{ - stop(); - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - DisposeMovieController (qmci->controller); - qmci->controller = 0; - } - - if (qmci->movie != 0) - { - DisposeMovie (qmci->movie); - qmci->movie = 0; - } - - qmci->clearHandle(); - - stopTimer(); - movieFile = File::nonexistent; -} - -bool QuickTimeMovieComponent::isMovieOpen() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - return qmci->movie != 0 && qmci->controller != 0; -} - -const File QuickTimeMovieComponent::getCurrentMovieFile() const -{ - return movieFile; -} - -static GrafPtr getPortForWindow (void* window) -{ - if (window == 0) - return 0; - - return (GrafPtr) GetWindowPort ((WindowRef) window); -} - -void QuickTimeMovieComponent::assignMovieToWindow() -{ - if (reentrant) - return; - - reentrant = true; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - if (qmci->controller != 0) - { - DisposeMovieController (qmci->controller); - qmci->controller = 0; - } - - controllerAssignedToWindow = false; - - void* window = getWindowHandle(); - GrafPtr port = getPortForWindow (window); - - if (port != 0) - { - GrafPtr savedPort; - GetPort (&savedPort); - - SetMovieGWorld (qmci->movie, (CGrafPtr) port, 0); - MacSetPort (port); - - Rect r; - r.top = 0; - r.left = 0; - r.right = (short) jmax (1, getWidth()); - r.bottom = (short) jmax (1, getHeight()); - SetMovieBox (qmci->movie, &r); - - // create the movie controller - qmci->controller = NewMovieController (qmci->movie, &r, - controllerVisible ? mcTopLeftMovie - : mcNotVisible); - - if (qmci->controller != 0) - { - MCEnableEditing (qmci->controller, true); - - MCDoAction (qmci->controller, mcActionSetUseBadge, (void*) false); - MCDoAction (qmci->controller, mcActionSetLoopIsPalindrome, (void*) false); - setLooping (looping); - - MCDoAction (qmci->controller, mcActionSetFlags, - (void*) (pointer_sized_int) (mcFlagSuppressMovieFrame | (controllerVisible ? 0 : (mcFlagSuppressStepButtons | mcFlagSuppressSpeakerButton)))); - - MCSetControllerBoundsRect (qmci->controller, &r); - - controllerAssignedToWindow = true; - - resized(); - } - - MacSetPort (savedPort); - } - else - { - SetMovieGWorld (qmci->movie, 0, 0); - } - - reentrant = false; -} - -void QuickTimeMovieComponent::play() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - StartMovie (qmci->movie); -} - -void QuickTimeMovieComponent::stop() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - StopMovie (qmci->movie); -} - -bool QuickTimeMovieComponent::isPlaying() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - return qmci->movie != 0 && GetMovieRate (qmci->movie) != 0; -} - -void QuickTimeMovieComponent::setPosition (const double seconds) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - TimeRecord time; - time.base = GetMovieTimeBase (qmci->movie); - time.scale = 100000; - const uint64 t = (uint64) (100000.0 * seconds); - time.value.lo = (UInt32) (t & 0xffffffff); - time.value.hi = (UInt32) (t >> 32); - - SetMovieTime (qmci->movie, &time); - timerCallback(); // to call MCIdle - } - else - { - jassertfalse // no movie is open, so can't set the position. - } -} - -double QuickTimeMovieComponent::getPosition() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - { - TimeRecord time; - GetMovieTime (qmci->movie, &time); - - return ((int64) (((uint64) time.value.hi << 32) | (uint64) time.value.lo)) - / (double) time.scale; - } - - return 0.0; -} - -void QuickTimeMovieComponent::setSpeed (const float newSpeed) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - SetMovieRate (qmci->movie, (Fixed) (newSpeed * (Fixed) 0x00010000L)); -} - -double QuickTimeMovieComponent::getMovieDuration() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - return GetMovieDuration (qmci->movie) / (double) GetMovieTimeScale (qmci->movie); - - return 0.0; -} - -void QuickTimeMovieComponent::setLooping (const bool shouldLoop) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - looping = shouldLoop; - - if (qmci->controller != 0) - MCDoAction (qmci->controller, mcActionSetLooping, (void*) shouldLoop); -} - -bool QuickTimeMovieComponent::isLooping() const -{ - return looping; -} - -void QuickTimeMovieComponent::setMovieVolume (const float newVolume) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - SetMovieVolume (qmci->movie, jlimit ((short) 0, (short) 0x100, (short) (newVolume * 0x0100))); -} - -float QuickTimeMovieComponent::getMovieVolume() const -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - return jmax (0.0f, GetMovieVolume (qmci->movie) / (float) 0x0100); - - return 0.0f; -} - -void QuickTimeMovieComponent::getMovieNormalSize (int& width, int& height) const -{ - width = 0; - height = 0; - - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie != 0) - { - Rect r; - GetMovieNaturalBoundsRect (qmci->movie, &r); - width = r.right - r.left; - height = r.bottom - r.top; - } -} - -void QuickTimeMovieComponent::paint (Graphics& g) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->movie == 0 || qmci->controller == 0) - { - g.fillAll (Colours::black); - return; - } - - GrafPtr savedPort; - GetPort (&savedPort); - - MacSetPort (getPortForWindow (getWindowHandle())); - MCDraw (qmci->controller, (WindowRef) getWindowHandle()); - - MacSetPort (savedPort); - - ComponentPeer* const peer = getPeer(); - - if (peer != 0) - { - peer->addMaskedRegion (getScreenX() - peer->getScreenX(), - getScreenY() - peer->getScreenY(), - getWidth(), getHeight()); - } - - timerCallback(); -} - -static const Rectangle getMoviePos (Component* const c) -{ - return Rectangle (c->getScreenX() - c->getTopLevelComponent()->getScreenX(), - c->getScreenY() - c->getTopLevelComponent()->getScreenY(), - jmax (1, c->getWidth()), - jmax (1, c->getHeight())); -} - -void QuickTimeMovieComponent::moved() -{ - resized(); -} - -void QuickTimeMovieComponent::resized() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0 && isShowing()) - { - checkWindowAssociation(); - - GrafPtr port = getPortForWindow (getWindowHandle()); - - if (port != 0) - { - GrafPtr savedPort; - GetPort (&savedPort); - - SetMovieGWorld (qmci->movie, (CGrafPtr) port, 0); - MacSetPort (port); - - lastPositionApplied = getMoviePos (this); - - Rect r; - r.left = (short) lastPositionApplied.getX(); - r.top = (short) lastPositionApplied.getY(); - r.right = (short) lastPositionApplied.getRight(); - r.bottom = (short) lastPositionApplied.getBottom(); - - if (MCGetVisible (qmci->controller)) - MCSetControllerBoundsRect (qmci->controller, &r); - else - SetMovieBox (qmci->movie, &r); - - if (! isPlaying()) - timerCallback(); - - MacSetPort (savedPort); - - repaint(); - } - } -} - -void QuickTimeMovieComponent::visibilityChanged() -{ - checkWindowAssociation(); - QTWinBaseClass::visibilityChanged(); -} - -void QuickTimeMovieComponent::timerCallback() -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0) - { - if (isTimerRunning()) - startTimer (getTimerInterval()); - - MCIdle (qmci->controller); - - if (lastPositionApplied != getMoviePos (this)) - resized(); - } -} - -void QuickTimeMovieComponent::checkWindowAssociation() -{ - void* const window = getWindowHandle(); - - if (window != associatedWindow - || (window != 0 && ! controllerAssignedToWindow)) - { - associatedWindow = window; - assignMovieToWindow(); - } -} - -void QuickTimeMovieComponent::parentHierarchyChanged() -{ - checkWindowAssociation(); -} - -void QuickTimeMovieComponent::handleMCEvent (void* ev) -{ - QTMovieCompInternal* const qmci = (QTMovieCompInternal*) internal; - - if (qmci->controller != 0 && isShowing()) - { - MacClickEventData* data = (MacClickEventData*) ev; - - data->where.h -= getTopLevelComponent()->getScreenX(); - data->where.v -= getTopLevelComponent()->getScreenY(); - - Boolean b = false; - MCPtInController (qmci->controller, data->where, &b); - - if (b) - { - const int oldTimeBeforeWaitCursor = MessageManager::getInstance()->getTimeBeforeShowingWaitCursor(); - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (0); - - MCClick (qmci->controller, - (WindowRef) getWindowHandle(), - data->where, - data->when, - data->modifiers); - - MessageManager::getInstance()->setTimeBeforeShowingWaitCursor (oldTimeBeforeWaitCursor); - } - } -} - -#endif - -//============================================================================== -// (methods common to both platforms..) - -static Handle createHandleDataRef (Handle dataHandle, const char* fileName) -{ - Handle dataRef = 0; - OSStatus err = PtrToHand (&dataHandle, &dataRef, sizeof (Handle)); - if (err == noErr) - { - Str255 suffix; - - CharacterFunctions::copy ((char*) suffix, fileName, 128); - - StringPtr name = suffix; - err = PtrAndHand (name, dataRef, name[0] + 1); - - if (err == noErr) - { - long atoms[3]; - atoms[0] = EndianU32_NtoB (3 * sizeof (long)); - atoms[1] = EndianU32_NtoB (kDataRefExtensionMacOSFileType); - atoms[2] = EndianU32_NtoB (MovieFileType); - - err = PtrAndHand (atoms, dataRef, 3 * sizeof (long)); - - if (err == noErr) - return dataRef; - } - - DisposeHandle (dataRef); - } - - return 0; -} - -static CFStringRef juceStringToCFString (const String& s) -{ - const int len = s.length(); - const juce_wchar* const t = (const juce_wchar*) s; - - UniChar* temp = (UniChar*) juce_malloc (sizeof (UniChar) * len + 4); - - for (int i = 0; i <= len; ++i) - temp[i] = t[i]; - - CFStringRef result = CFStringCreateWithCharacters (kCFAllocatorDefault, temp, len); - juce_free (temp); - - return result; -} - -static bool openMovie (QTNewMoviePropertyElement* props, int prop, Movie& movie) -{ - Boolean trueBool = true; - props[prop].propClass = kQTPropertyClass_MovieInstantiation; - props[prop].propID = kQTMovieInstantiationPropertyID_DontResolveDataRefs; - props[prop].propValueSize = sizeof (trueBool); - props[prop].propValueAddress = &trueBool; - ++prop; - - props[prop].propClass = kQTPropertyClass_MovieInstantiation; - props[prop].propID = kQTMovieInstantiationPropertyID_AsyncOK; - props[prop].propValueSize = sizeof (trueBool); - props[prop].propValueAddress = &trueBool; - ++prop; - - Boolean isActive = true; - props[prop].propClass = kQTPropertyClass_NewMovieProperty; - props[prop].propID = kQTNewMoviePropertyID_Active; - props[prop].propValueSize = sizeof (isActive); - props[prop].propValueAddress = &isActive; - ++prop; - -#if JUCE_MAC - SetPort (0); -#else - MacSetPort (0); -#endif - - jassert (prop <= 5); - OSStatus err = NewMovieFromProperties (prop, props, 0, 0, &movie); - - return err == noErr; -} - -bool juce_OpenQuickTimeMovieFromStream (InputStream* input, Movie& movie, Handle& dataHandle) -{ - if (input == 0) - return false; - - dataHandle = 0; - bool ok = false; - - QTNewMoviePropertyElement props[5]; - zeromem (props, sizeof (props)); - int prop = 0; - - DataReferenceRecord dr; - props[prop].propClass = kQTPropertyClass_DataLocation; - props[prop].propID = kQTDataLocationPropertyID_DataReference; - props[prop].propValueSize = sizeof (dr); - props[prop].propValueAddress = (void*) &dr; - ++prop; - - FileInputStream* const fin = dynamic_cast (input); - - if (fin != 0) - { - CFStringRef filePath = juceStringToCFString (fin->getFile().getFullPathName()); - - QTNewDataReferenceFromFullPathCFString (filePath, (QTPathStyle) kQTNativeDefaultPathStyle, 0, - &dr.dataRef, &dr.dataRefType); - - - ok = openMovie (props, prop, movie); - - DisposeHandle (dr.dataRef); - CFRelease (filePath); - } - else - { - // sanity-check because this currently needs to load the whole stream into memory.. - jassert (input->getTotalLength() < 50 * 1024 * 1024); - - dataHandle = NewHandle ((Size) input->getTotalLength()); - HLock (dataHandle); - // read the entire stream into memory - this is a pain, but can't get it to work - // properly using a custom callback to supply the data. - input->read (*dataHandle, (int) input->getTotalLength()); - HUnlock (dataHandle); - - // different types to get QT to try. (We should really be a bit smarter here by - // working out in advance which one the stream contains, rather than just trying - // each one) - const char* const suffixesToTry[] = { "\04.mov", "\04.mp3", - "\04.avi", "\04.m4a" }; - - for (int i = 0; i < numElementsInArray (suffixesToTry) && ! ok; ++i) - { - /* // this fails for some bizarre reason - it can be bodged to work with - // movies, but can't seem to do it for other file types.. - QTNewMovieUserProcRecord procInfo; - procInfo.getMovieUserProc = NewGetMovieUPP (readMovieStreamProc); - procInfo.getMovieUserProcRefcon = this; - procInfo.defaultDataRef.dataRef = dataRef; - procInfo.defaultDataRef.dataRefType = HandleDataHandlerSubType; - - props[prop].propClass = kQTPropertyClass_DataLocation; - props[prop].propID = kQTDataLocationPropertyID_MovieUserProc; - props[prop].propValueSize = sizeof (procInfo); - props[prop].propValueAddress = (void*) &procInfo; - ++prop; */ - - dr.dataRef = createHandleDataRef (dataHandle, suffixesToTry [i]); - dr.dataRefType = HandleDataHandlerSubType; - ok = openMovie (props, prop, movie); - - DisposeHandle (dr.dataRef); - } - } - - return ok; -} - -bool QuickTimeMovieComponent::loadMovie (const File& movieFile_, - const bool isControllerVisible) -{ - const bool ok = loadMovie ((InputStream*) movieFile_.createInputStream(), isControllerVisible); - movieFile = movieFile_; - return ok; -} - -void QuickTimeMovieComponent::goToStart() -{ - setPosition (0.0); -} - -void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangle& spaceToFitWithin, - const RectanglePlacement& placement) -{ - int normalWidth, normalHeight; - getMovieNormalSize (normalWidth, normalHeight); - - if (normalWidth > 0 && normalHeight > 0 && ! spaceToFitWithin.isEmpty()) - { - double x = 0.0, y = 0.0, w = normalWidth, h = normalHeight; - - placement.applyTo (x, y, w, h, - spaceToFitWithin.getX(), spaceToFitWithin.getY(), - spaceToFitWithin.getWidth(), spaceToFitWithin.getHeight()); - - if (w > 0 && h > 0) - { - setBounds (roundDoubleToInt (x), roundDoubleToInt (y), - roundDoubleToInt (w), roundDoubleToInt (h)); - } - } - else - { - setBounds (spaceToFitWithin); - } -} - - -END_JUCE_NAMESPACE - -#endif diff --git a/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h b/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h index 3aeb7b7c50..a99ce99a59 100644 --- a/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h +++ b/src/juce_appframework/gui/components/special/juce_QuickTimeMovieComponent.h @@ -39,11 +39,10 @@ #if JUCE_WIN32 #include "juce_ActiveXControlComponent.h" - typedef ActiveXControlComponent QTWinBaseClass; + typedef ActiveXControlComponent QTCompBaseClass; #else - #include "../juce_Component.h" - #include "../../../events/juce_Timer.h" - typedef Component QTWinBaseClass; + #include "juce_NSViewComponent.h" + typedef NSViewComponent QTCompBaseClass; #endif //============================================================================== @@ -51,10 +50,7 @@ A window that can play back a QuickTime movie. */ -class JUCE_API QuickTimeMovieComponent : public QTWinBaseClass - #if JUCE_MAC - , private Timer - #endif +class JUCE_API QuickTimeMovieComponent : public QTCompBaseClass { public: //============================================================================== @@ -182,40 +178,25 @@ public: //============================================================================== /** @internal */ void paint (Graphics& g); - /** @internal */ - void parentHierarchyChanged(); - /** @internal */ - void visibilityChanged(); -#if JUCE_MAC - /** @internal */ - void handleMCEvent (void*); - /** @internal */ - void assignMovieToWindow(); - /** @internal */ - void timerCallback(); - /** @internal */ - void moved(); - /** @internal */ - void resized(); -#endif juce_UseDebuggingNewOperator private: File movieFile; - bool movieLoaded, controllerVisible; + bool movieLoaded, controllerVisible, looping; - void* internal; - -#if JUCE_MAC - void* associatedWindow; - Rectangle lastPositionApplied; - bool controllerAssignedToWindow, reentrant, looping; - void checkWindowAssociation(); -#endif +#if JUCE_WIN32 + /** @internal */ + void parentHierarchyChanged(); + /** @internal */ + void visibilityChanged(); void createControlIfNeeded(); bool isControlCreated() const; + void* internal; +#else + void* movie; +#endif QuickTimeMovieComponent (const QuickTimeMovieComponent&); const QuickTimeMovieComponent& operator= (const QuickTimeMovieComponent&); diff --git a/src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h b/src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h index 782388175d..880f8c4046 100644 --- a/src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h +++ b/src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h @@ -33,6 +33,9 @@ #define __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ #include "../juce_Component.h" + +#if JUCE_WEB_BROWSER + class WebBrowserComponentInternal; @@ -98,8 +101,6 @@ public: /** @internal */ void paint (Graphics& g); /** @internal */ - void moved(); - /** @internal */ void resized(); /** @internal */ void parentHierarchyChanged(); @@ -117,13 +118,6 @@ private: StringArray lastHeaders; MemoryBlock lastPostData; -#if JUCE_MAC - void* associatedWindow; - void updateBrowserPosition(); - void createBrowser(); - void deleteBrowser(); -#endif - void reloadLastURL(); void checkWindowAssociation(); @@ -132,4 +126,5 @@ private: }; +#endif #endif // __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ diff --git a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.h b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.h index 24989c573c..b30c007180 100644 --- a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.h +++ b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.h @@ -80,6 +80,9 @@ public: windowRepaintedExplictly = (1 << 9), /**< Not intended for public use - this tells a window not to do its own repainting, but only to repaint when the performAnyPendingRepaintsNow() method is called. */ + windowIgnoresKeyPresses = (1 << 10), /**< Tells the window not to catch any keypresses. This can + be used for things like plugin windows, to stop them interfering + with the host's shortcut keys */ windowIsSemiTransparent = (1 << 31) /**< Not intended for public use - makes a window transparent. */ }; diff --git a/src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp b/src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp index dddee37a14..99ca7c9f67 100644 --- a/src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp +++ b/src/juce_appframework/gui/components/windows/juce_SplashScreen.cpp @@ -96,7 +96,7 @@ void SplashScreen::show (const String& title, addToDesktop (useDropShadow ? ComponentPeer::windowHasDropShadow : 0); toFront (false); - MessageManager::getInstance()->dispatchPendingMessages(); + MessageManager::getInstance()->runDispatchLoopUntil (300); repaint(); diff --git a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp index a8446f14ad..08e1f16232 100644 --- a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp +++ b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp @@ -58,19 +58,12 @@ TooltipWindow::TooltipWindow (Component* const parentComponent, setOpaque (true); if (parentComponent != 0) - { parentComponent->addChildComponent (this); - } - else - { - setSize (1, 1); // to keep the OS happy by not having zero-size windows - addToDesktop (ComponentPeer::windowHasDropShadow - | ComponentPeer::windowIsTemporary); - } } TooltipWindow::~TooltipWindow() { + hide(); } void TooltipWindow::paint (Graphics& g) @@ -80,7 +73,7 @@ void TooltipWindow::paint (Graphics& g) void TooltipWindow::mouseEnter (const MouseEvent&) { - setVisible (false); + hide(); } void TooltipWindow::showFor (Component* const c) @@ -94,7 +87,7 @@ void TooltipWindow::showFor (Component* const c) if (tip.isEmpty()) { - setVisible (false); + hide(); } else { @@ -119,10 +112,23 @@ void TooltipWindow::showFor (Component* const c) setBounds (x, y, w, h); setVisible (true); + + if (getParentComponent() == 0) + { + addToDesktop (ComponentPeer::windowHasDropShadow + | ComponentPeer::windowIsTemporary); + } + toFront (false); } } +void TooltipWindow::hide() +{ + removeFromDesktop(); + setVisible (false); +} + void TooltipWindow::timerCallback() { int mx, my; @@ -143,7 +149,7 @@ void TooltipWindow::timerCallback() if (isVisible()) { lastHideTime = now; - setVisible (false); + hide(); } changedCompsSinceShown = changedCompsSinceShown || changedComp; diff --git a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.h b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.h index a8b9c2f03b..2fe185ec48 100644 --- a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.h +++ b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.h @@ -111,6 +111,7 @@ private: void timerCallback(); void showFor (Component* const c); + void hide(); TooltipWindow (const TooltipWindow&); const TooltipWindow& operator= (const TooltipWindow&); diff --git a/src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index 5611fa52fa..384d3c0770 100644 --- a/src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/juce_appframework/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -926,8 +926,8 @@ static void transformedImageRender (Image& destImage, for (int y = 0; y < destClipH; ++y) { - double sx = srcX - 0.5; - double sy = srcY - 0.5; + double sx = srcX - (srcClipWidth == destClipW ? 0.0 : 0.5); + double sy = srcY - (srcClipHeight == destClipH ? 0.0 : 0.5); DestPixelType* dest = (DestPixelType*) (destPixels + destStride * y); for (int x = 0; x < destClipW; ++x) diff --git a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp index 57eac0892f..d2d7bbae42 100644 --- a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp +++ b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp @@ -116,7 +116,7 @@ namespace jpeglibNamespace #else #define JPEG_INTERNALS #undef FAR - #include + #include #endif } diff --git a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp index 35a8381e70..5ebeb58e96 100644 --- a/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp +++ b/src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp @@ -38,7 +38,7 @@ namespace zlibNamespace { -#if JUCE_INCLUDE_ZLIB_CODE +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen #include "../../../../../juce_core/io/streams/zlib/zlib.h" @@ -52,7 +52,7 @@ namespace pnglibNamespace { using namespace zlibNamespace; -#if JUCE_INCLUDE_PNGLIB_CODE +#if JUCE_INCLUDE_PNGLIB_CODE using ::malloc; using ::free; @@ -89,7 +89,7 @@ namespace pnglibNamespace #include #include -#endif +#endif } #ifdef _MSC_VER diff --git a/src/juce_appframework/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c b/src/juce_appframework/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c index 56eeef7858..e966a27c56 100644 --- a/src/juce_appframework/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c +++ b/src/juce_appframework/gui/graphics/imaging/image_file_formats/pnglib/pngrutil.c @@ -2912,7 +2912,7 @@ png_read_finish_row(png_structp png_ptr) char extra; int ret; - png_ptr->zstream.next_out = (Byte *)&extra; + png_ptr->zstream.next_out = (Bytef *)&extra; png_ptr->zstream.avail_out = (uInt)1; for(;;) { diff --git a/src/juce_core/basics/juce_SystemStats.cpp b/src/juce_core/basics/juce_SystemStats.cpp index 7dd3a8ccf2..1edc7c1683 100644 --- a/src/juce_core/basics/juce_SystemStats.cpp +++ b/src/juce_core/basics/juce_SystemStats.cpp @@ -40,6 +40,7 @@ BEGIN_JUCE_NAMESPACE #include "juce_Atomic.h" #include "../threads/juce_Thread.h" #include "../text/juce_LocalisedStrings.h" +#include "../../juce_core/misc/juce_PlatformUtilities.h" void juce_initialiseStrings(); @@ -57,6 +58,10 @@ void JUCE_PUBLIC_FUNCTION initialiseJuce_NonGUI() { if (! juceInitialisedNonGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + #ifdef JUCE_DEBUG // Some simple test code to keep an eye on things and make sure these functions // work ok on all platforms. Let me know if any of these assertions fail! @@ -99,6 +104,10 @@ void JUCE_PUBLIC_FUNCTION shutdownJuce_NonGUI() { if (juceInitialisedNonGUI) { +#if JUCE_MAC + const ScopedAutoReleasePool pool; +#endif + #if JUCE_WIN32 // need to shut down sockets if they were used.. if (juce_CloseWin32SocketLib != 0) diff --git a/src/juce_core/io/network/juce_Socket.cpp b/src/juce_core/io/network/juce_Socket.cpp index 5b34850949..eec04353bd 100644 --- a/src/juce_core/io/network/juce_Socket.cpp +++ b/src/juce_core/io/network/juce_Socket.cpp @@ -30,7 +30,6 @@ */ #ifdef _WIN32 - #include "../../../../build/win32/platform_specific_code/win32_headers.h" #include #ifdef _MSC_VER diff --git a/src/juce_core/io/network/juce_URL.cpp b/src/juce_core/io/network/juce_URL.cpp index f9231c9766..f3fa37251f 100644 --- a/src/juce_core/io/network/juce_URL.cpp +++ b/src/juce_core/io/network/juce_URL.cpp @@ -109,9 +109,9 @@ static const String getMangledParameters (const StringPairArray& parameters) if (i > 0) p += T("&"); - p << URL::addEscapeChars (parameters.getAllKeys() [i]) + p << URL::addEscapeChars (parameters.getAllKeys() [i], true) << T("=") - << URL::addEscapeChars (parameters.getAllValues() [i]); + << URL::addEscapeChars (parameters.getAllValues() [i], true); } return p; @@ -495,11 +495,13 @@ const String URL::removeEscapeChars (const String& s) return stringResult; } -const String URL::addEscapeChars (const String& s) +const String URL::addEscapeChars (const String& s, const bool isParameter) { String result; result.preallocateStorage (s.length() + 8); const char* utf8 = s.toUTF8(); + const char* legalChars = isParameter ? "_-.*!'()" + : "_-$.*!'(),"; while (*utf8 != 0) { @@ -510,7 +512,7 @@ const String URL::addEscapeChars (const String& s) result += T('+'); } else if (CharacterFunctions::isLetterOrDigit (c) - || CharacterFunctions::indexOfChar ("_-$.*!'(),", c, false) >= 0) + || CharacterFunctions::indexOfChar (legalChars, c, false) >= 0) { result << c; } diff --git a/src/juce_core/io/network/juce_URL.h b/src/juce_core/io/network/juce_URL.h index 2870ce8f40..6505b1ec08 100644 --- a/src/juce_core/io/network/juce_URL.h +++ b/src/juce_core/io/network/juce_URL.h @@ -223,9 +223,14 @@ public: This is the opposite of removeEscapeChars(). + If isParameter is true, it means that the string is going to be used + as a parameter, so it also encodes '$' and ',' (which would otherwise + be legal in a URL. + @see removeEscapeChars */ - static const String addEscapeChars (const String& stringToAddEscapeCharsTo); + static const String addEscapeChars (const String& stringToAddEscapeCharsTo, + const bool isParameter); /** Replaces any escape character sequences in a string with their original character codes. diff --git a/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp b/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp index 84e9537ac1..bae0c5254b 100644 --- a/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp +++ b/src/juce_core/io/streams/juce_GZIPCompressorOutputStream.cpp @@ -33,7 +33,7 @@ namespace zlibNamespace { -#if JUCE_INCLUDE_ZLIB_CODE +#if JUCE_INCLUDE_ZLIB_CODE #undef OS_CODE #undef fdopen #include "zlib/zlib.h" diff --git a/src/juce_core/misc/juce_PlatformUtilities.h b/src/juce_core/misc/juce_PlatformUtilities.h index 2320aa8d84..e64f1df004 100644 --- a/src/juce_core/misc/juce_PlatformUtilities.h +++ b/src/juce_core/misc/juce_PlatformUtilities.h @@ -54,23 +54,12 @@ public: #if JUCE_MAC || DOXYGEN //============================================================================== - /** MAC ONLY - Turns a String into a pascal string. */ - static void copyToStr255 (Str255& d, const String& s); - /** MAC ONLY - Turns a String into a pascal string. */ - static void copyToStr63 (Str63& d, const String& s); - /** MAC ONLY - Turns a Core CF String into a juce one. */ static const String cfStringToJuceString (CFStringRef cfString); /** MAC ONLY - Turns a juce string into a Core CF one. */ static CFStringRef juceStringToCFString (const String& s); - /** MAC ONLY - Converts a UTF16 string to a Juce String. */ - static const String convertUTF16ToString (const UniChar* utf16); - - /** MAC ONLY - Turns a file path into an FSSpec, returning true if it succeeds. */ - static bool makeFSSpecFromPath (FSSpec* destFSSpec, const String& path); - /** MAC ONLY - Turns a file path into an FSRef, returning true if it succeeds. */ static bool makeFSRefFromPath (FSRef* destFSRef, const String& path); @@ -153,6 +142,35 @@ public: static void fpuReset(); +#if JUCE_LINUX || JUCE_WIN32 + //============================================================================== + /** Loads a dynamically-linked library into the process's address space. + + @param pathOrFilename the platform-dependent name and search path + @returns a handle which can be used by getProcedureEntryPoint(), or + zero if it fails. + @see freeDynamicLibrary, getProcedureEntryPoint + */ + static void* loadDynamicLibrary (const String& pathOrFilename); + + /** Frees a dynamically-linked library. + + @param libraryHandle a handle created by loadDynamicLibrary + @see loadDynamicLibrary, getProcedureEntryPoint + */ + static void freeDynamicLibrary (void* libraryHandle); + + /** Finds a procedure call in a dynamically-linked library. + + @param libraryHandle a library handle returned by loadDynamicLibrary + @param procedureName the name of the procedure call to try to load + @returns a pointer to the function if found, or 0 if it fails + @see loadDynamicLibrary + */ + static void* getProcedureEntryPoint (void* libraryHandle, + const String& procedureName); +#endif + #if JUCE_LINUX || DOXYGEN //============================================================================== @@ -162,6 +180,20 @@ public: #if JUCE_MAC +//============================================================================== +/** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object + using RAII. +*/ +class ScopedAutoReleasePool +{ +public: + ScopedAutoReleasePool(); + ~ScopedAutoReleasePool(); + +private: + void* pool; +}; + //============================================================================== /** A wrapper class for picking up events from an Apple IR remote control device. diff --git a/src/juce_core/text/juce_XmlElement.cpp b/src/juce_core/text/juce_XmlElement.cpp index d0b2be54e8..e94c94880c 100644 --- a/src/juce_core/text/juce_XmlElement.cpp +++ b/src/juce_core/text/juce_XmlElement.cpp @@ -267,7 +267,8 @@ static void writeSpaces (OutputStream& out, int numSpaces) throw() } void XmlElement::writeElementAsText (OutputStream& outputStream, - const int indentationLevel) const throw() + const int indentationLevel, + const int lineWrapLength) const throw() { writeSpaces (outputStream, indentationLevel); @@ -283,7 +284,7 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, const XmlAttributeNode* att = attributes; while (att != 0) { - if (lineLen > 60 && indentationLevel >= 0) + if (lineLen > lineWrapLength && indentationLevel >= 0) { outputStream.write ("\r\n", 2); writeSpaces (outputStream, attIndent); @@ -336,11 +337,11 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, if (lastWasTextNode) outputStream.write ("\r\n", 2); - child->writeElementAsText (outputStream, indentationLevel + 2); + child->writeElementAsText (outputStream, indentationLevel + 2, lineWrapLength); } else { - child->writeElementAsText (outputStream, indentationLevel); + child->writeElementAsText (outputStream, indentationLevel, lineWrapLength); } lastWasTextNode = false; @@ -386,7 +387,8 @@ void XmlElement::writeElementAsText (OutputStream& outputStream, const String XmlElement::createDocument (const String& dtd, const bool allOnOneLine, const bool includeXmlHeader, - const tchar* const encoding) const throw() + const tchar* const encoding, + const int lineWrapLength) const throw() { String doc; doc.preallocateStorage (1024); @@ -411,7 +413,7 @@ const String XmlElement::createDocument (const String& dtd, } MemoryOutputStream mem (2048, 4096); - writeElementAsText (mem, allOnOneLine ? -1 : 0); + writeElementAsText (mem, allOnOneLine ? -1 : 0, lineWrapLength); return doc + String (mem.getData(), mem.getDataSize()); @@ -419,7 +421,8 @@ const String XmlElement::createDocument (const String& dtd, bool XmlElement::writeToFile (const File& f, const String& dtd, - const tchar* const encoding) const throw() + const tchar* const encoding, + const int lineWrapLength) const throw() { if (f.hasWriteAccess()) { @@ -432,7 +435,7 @@ bool XmlElement::writeToFile (const File& f, *out << "\r\n\r\n" << dtd << "\r\n"; - writeElementAsText (*out, 0); + writeElementAsText (*out, 0, lineWrapLength); delete out; diff --git a/src/juce_core/text/juce_XmlElement.h b/src/juce_core/text/juce_XmlElement.h index 713f90ed60..4ae166b602 100644 --- a/src/juce_core/text/juce_XmlElement.h +++ b/src/juce_core/text/juce_XmlElement.h @@ -190,12 +190,16 @@ public: document @param encodingType the character encoding format string to put into the xml header + @param lineWrapLength the line length that will be used before items get placed on + a new line. This isn't an absolute maximum length, it just + determines how lists of attributes get broken up @see writeToFile */ const String createDocument (const String& dtdToUse, const bool allOnOneLine = false, const bool includeXmlHeader = true, - const tchar* const encodingType = JUCE_T("UTF-8")) const throw(); + const tchar* const encodingType = JUCE_T("UTF-8"), + const int lineWrapLength = 60) const throw(); /** Writes the element to a file as an XML document. @@ -209,13 +213,17 @@ public: @param dtdToUse the DTD to add to the document @param encodingType the character encoding format string to put into the xml header + @param lineWrapLength the line length that will be used before items get placed on + a new line. This isn't an absolute maximum length, it just + determines how lists of attributes get broken up @returns true if the file is written successfully; false if something goes wrong in the process @see createDocument */ bool writeToFile (const File& destinationFile, const String& dtdToUse, - const tchar* const encodingType = JUCE_T("UTF-8")) const throw(); + const tchar* const encodingType = JUCE_T("UTF-8"), + const int lineWrapLength = 60) const throw(); //============================================================================== /** Returns this element's tag type name. @@ -675,7 +683,9 @@ private: void copyChildrenAndAttributesFrom (const XmlElement& other) throw(); - void writeElementAsText (OutputStream& out, const int indentationLevel) const throw(); + void writeElementAsText (OutputStream& out, + const int indentationLevel, + const int lineWrapLength) const throw(); XmlElement** getChildElementsAsArray (const int) const throw(); void reorderChildElements (XmlElement** const, const int) throw(); diff --git a/src/juce_core/threads/juce_Process.h b/src/juce_core/threads/juce_Process.h index 0b52eef848..62729e1f69 100644 --- a/src/juce_core/threads/juce_Process.h +++ b/src/juce_core/threads/juce_Process.h @@ -97,34 +97,6 @@ public: /** Returns true if this process is being hosted by a debugger. */ static bool JUCE_CALLTYPE isRunningUnderDebugger() throw(); - - //============================================================================== - /** Loads a dynamically-linked library into the process's address space. - - @param pathOrFilename the platform-dependent name and search path - @returns a handle which can be used by getProcedureEntryPoint(), or - zero if it fails. - @see freeDynamicLibrary, getProcedureEntryPoint - */ - static void* loadDynamicLibrary (const String& pathOrFilename); - - /** Frees a dynamically-linked library. - - @param libraryHandle a handle created by loadDynamicLibrary - @see loadDynamicLibrary, getProcedureEntryPoint - */ - static void freeDynamicLibrary (void* libraryHandle); - - /** Finds a procedure call in a dynamically-linked library. - - @param libraryHandle a library handle returned by loadDynamicLibrary - @param procedureName the name of the procedure call to try to load - @returns a pointer to the function if found, or 0 if it fails - @see loadDynamicLibrary - */ - static void* getProcedureEntryPoint (void* libraryHandle, - const String& procedureName); - }; diff --git a/src/juce_core/threads/juce_ReadWriteLock.cpp b/src/juce_core/threads/juce_ReadWriteLock.cpp index 7a62680b83..a43a19e7c6 100644 --- a/src/juce_core/threads/juce_ReadWriteLock.cpp +++ b/src/juce_core/threads/juce_ReadWriteLock.cpp @@ -56,7 +56,7 @@ ReadWriteLock::~ReadWriteLock() throw() //============================================================================== void ReadWriteLock::enterRead() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (;;) @@ -92,14 +92,14 @@ void ReadWriteLock::enterRead() const throw() void ReadWriteLock::exitRead() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (int i = 0; i < readerThreads.size(); i += 2) { if (readerThreads.getUnchecked(i) == threadId) { - const int newCount = readerThreads.getUnchecked (i + 1) - 1; + const int newCount = ((int) readerThreads.getUnchecked (i + 1)) - 1; if (newCount == 0) { @@ -121,7 +121,7 @@ void ReadWriteLock::exitRead() const throw() //============================================================================== void ReadWriteLock::enterWrite() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); for (;;) @@ -146,7 +146,7 @@ void ReadWriteLock::enterWrite() const throw() bool ReadWriteLock::tryEnterWrite() const throw() { - const int threadId = Thread::getCurrentThreadId(); + const int64 threadId = Thread::getCurrentThreadId(); const ScopedLock sl (accessLock); if (readerThreads.size() + numWriters == 0 diff --git a/src/juce_core/threads/juce_ReadWriteLock.h b/src/juce_core/threads/juce_ReadWriteLock.h index 258221d8bd..2ca4f78541 100644 --- a/src/juce_core/threads/juce_ReadWriteLock.h +++ b/src/juce_core/threads/juce_ReadWriteLock.h @@ -134,8 +134,8 @@ private: CriticalSection accessLock; WaitableEvent waitEvent; mutable int numWaitingWriters, numWriters; - mutable int writerThreadId; - mutable Array readerThreads; + mutable int64 writerThreadId; + mutable Array readerThreads; ReadWriteLock (const ReadWriteLock&); const ReadWriteLock& operator= (const ReadWriteLock&); diff --git a/src/juce_core/threads/juce_Thread.cpp b/src/juce_core/threads/juce_Thread.cpp index f4234ecd0a..7ac476dc6b 100644 --- a/src/juce_core/threads/juce_Thread.cpp +++ b/src/juce_core/threads/juce_Thread.cpp @@ -225,7 +225,7 @@ void Thread::setAffinityMask (const uint32 affinityMask) throw() affinityMask_ = affinityMask; } -int Thread::getThreadId() const throw() +int64 Thread::getThreadId() const throw() { return threadId_; } @@ -249,7 +249,7 @@ int Thread::getNumRunningThreads() throw() Thread* Thread::getCurrentThread() throw() { - const int thisId = getCurrentThreadId(); + const int64 thisId = getCurrentThreadId(); Thread* result = 0; runningThreadsLock.enter(); diff --git a/src/juce_core/threads/juce_Thread.h b/src/juce_core/threads/juce_Thread.h index 0c8806661b..a8a3926c32 100644 --- a/src/juce_core/threads/juce_Thread.h +++ b/src/juce_core/threads/juce_Thread.h @@ -223,7 +223,7 @@ public: @returns a unique identifier that identifies the calling thread. @see getThreadId */ - static int getCurrentThreadId() throw(); + static int64 getCurrentThreadId() throw(); /** Finds the thread object that is currently running. @@ -241,7 +241,7 @@ public: @see getCurrentThreadId */ - int getThreadId() const throw(); + int64 getThreadId() const throw(); /** Returns the name of the thread. @@ -273,7 +273,8 @@ private: CriticalSection startStopLock; WaitableEvent startSuspensionEvent_, defaultEvent_; - int threadPriority_, threadId_; + int threadPriority_; + int64 threadId_; uint32 affinityMask_; bool volatile threadShouldExit_; diff --git a/src/juce_core_includes.h b/src/juce_core_includes.h index 14291fc3d2..5438978091 100644 --- a/src/juce_core_includes.h +++ b/src/juce_core_includes.h @@ -32,56 +32,53 @@ #ifndef __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ #define __JUCE_JUCE_CORE_INCLUDES_INCLUDEFILES__ -#ifndef __JUCE_ATOMIC_JUCEHEADER__ - #include "juce_core/basics/juce_Atomic.h" -#endif -#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ - #include "juce_core/basics/juce_DataConversions.h" -#endif -#ifndef __JUCE_FILELOGGER_JUCEHEADER__ - #include "juce_core/basics/juce_FileLogger.h" -#endif -#ifndef __JUCE_INITIALISATION_JUCEHEADER__ - #include "juce_core/basics/juce_Initialisation.h" +#ifndef __JUCE_SINGLETON_JUCEHEADER__ + #include "juce_core/basics/juce_Singleton.h" #endif -#ifndef __JUCE_LOGGER_JUCEHEADER__ - #include "juce_core/basics/juce_Logger.h" +#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ + #include "juce_core/basics/juce_SystemStats.h" #endif #ifndef __JUCE_MATHSFUNCTIONS_JUCEHEADER__ #include "juce_core/basics/juce_MathsFunctions.h" #endif -#ifndef __JUCE_MEMORY_JUCEHEADER__ - #include "juce_core/basics/juce_Memory.h" -#endif #ifndef __JUCE_PLATFORMDEFS_JUCEHEADER__ #include "juce_core/basics/juce_PlatformDefs.h" #endif +#ifndef __JUCE_ATOMIC_JUCEHEADER__ + #include "juce_core/basics/juce_Atomic.h" +#endif +#ifndef __JUCE_LOGGER_JUCEHEADER__ + #include "juce_core/basics/juce_Logger.h" +#endif +#ifndef __JUCE_FILELOGGER_JUCEHEADER__ + #include "juce_core/basics/juce_FileLogger.h" +#endif #ifndef __JUCE_RANDOM_JUCEHEADER__ #include "juce_core/basics/juce_Random.h" #endif -#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ - #include "juce_core/basics/juce_RelativeTime.h" -#endif -#ifndef __JUCE_SINGLETON_JUCEHEADER__ - #include "juce_core/basics/juce_Singleton.h" +#ifndef __JUCE_INITIALISATION_JUCEHEADER__ + #include "juce_core/basics/juce_Initialisation.h" #endif #ifndef __JUCE_STANDARDHEADER_JUCEHEADER__ #include "juce_core/basics/juce_StandardHeader.h" #endif -#ifndef __JUCE_SYSTEMSTATS_JUCEHEADER__ - #include "juce_core/basics/juce_SystemStats.h" +#ifndef __JUCE_RELATIVETIME_JUCEHEADER__ + #include "juce_core/basics/juce_RelativeTime.h" #endif #ifndef __JUCE_TIME_JUCEHEADER__ #include "juce_core/basics/juce_Time.h" #endif -#ifndef __JUCE_ARRAY_JUCEHEADER__ - #include "juce_core/containers/juce_Array.h" +#ifndef __JUCE_DATACONVERSIONS_JUCEHEADER__ + #include "juce_core/basics/juce_DataConversions.h" #endif -#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ - #include "juce_core/containers/juce_ArrayAllocationBase.h" +#ifndef __JUCE_MEMORY_JUCEHEADER__ + #include "juce_core/basics/juce_Memory.h" #endif -#ifndef __JUCE_BITARRAY_JUCEHEADER__ - #include "juce_core/containers/juce_BitArray.h" +#ifndef __JUCE_PROPERTYSET_JUCEHEADER__ + #include "juce_core/containers/juce_PropertySet.h" +#endif +#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ + #include "juce_core/containers/juce_VoidArray.h" #endif #ifndef __JUCE_ELEMENTCOMPARATOR_JUCEHEADER__ #include "juce_core/containers/juce_ElementComparator.h" @@ -89,26 +86,29 @@ #ifndef __JUCE_MEMORYBLOCK_JUCEHEADER__ #include "juce_core/containers/juce_MemoryBlock.h" #endif -#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ - #include "juce_core/containers/juce_OwnedArray.h" -#endif -#ifndef __JUCE_PROPERTYSET_JUCEHEADER__ - #include "juce_core/containers/juce_PropertySet.h" -#endif -#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ - #include "juce_core/containers/juce_ReferenceCountedArray.h" -#endif #ifndef __JUCE_REFERENCECOUNTEDOBJECT_JUCEHEADER__ #include "juce_core/containers/juce_ReferenceCountedObject.h" #endif +#ifndef __JUCE_SPARSESET_JUCEHEADER__ + #include "juce_core/containers/juce_SparseSet.h" +#endif +#ifndef __JUCE_OWNEDARRAY_JUCEHEADER__ + #include "juce_core/containers/juce_OwnedArray.h" +#endif #ifndef __JUCE_SORTEDSET_JUCEHEADER__ #include "juce_core/containers/juce_SortedSet.h" #endif -#ifndef __JUCE_SPARSESET_JUCEHEADER__ - #include "juce_core/containers/juce_SparseSet.h" +#ifndef __JUCE_BITARRAY_JUCEHEADER__ + #include "juce_core/containers/juce_BitArray.h" #endif -#ifndef __JUCE_VOIDARRAY_JUCEHEADER__ - #include "juce_core/containers/juce_VoidArray.h" +#ifndef __JUCE_ARRAY_JUCEHEADER__ + #include "juce_core/containers/juce_Array.h" +#endif +#ifndef __JUCE_ARRAYALLOCATIONBASE_JUCEHEADER__ + #include "juce_core/containers/juce_ArrayAllocationBase.h" +#endif +#ifndef __JUCE_REFERENCECOUNTEDARRAY_JUCEHEADER__ + #include "juce_core/containers/juce_ReferenceCountedArray.h" #endif #ifndef __JUCE_INPUTSTREAM_JUCEHEADER__ #include "juce_core/io/juce_InputStream.h" @@ -116,18 +116,18 @@ #ifndef __JUCE_OUTPUTSTREAM_JUCEHEADER__ #include "juce_core/io/juce_OutputStream.h" #endif -#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ - #include "juce_core/io/files/juce_DirectoryIterator.h" -#endif -#ifndef __JUCE_FILE_JUCEHEADER__ - #include "juce_core/io/files/juce_File.h" -#endif #ifndef __JUCE_FILEINPUTSTREAM_JUCEHEADER__ #include "juce_core/io/files/juce_FileInputStream.h" #endif #ifndef __JUCE_FILEOUTPUTSTREAM_JUCEHEADER__ #include "juce_core/io/files/juce_FileOutputStream.h" #endif +#ifndef __JUCE_DIRECTORYITERATOR_JUCEHEADER__ + #include "juce_core/io/files/juce_DirectoryIterator.h" +#endif +#ifndef __JUCE_FILE_JUCEHEADER__ + #include "juce_core/io/files/juce_File.h" +#endif #ifndef __JUCE_FILESEARCHPATH_JUCEHEADER__ #include "juce_core/io/files/juce_FileSearchPath.h" #endif @@ -137,20 +137,26 @@ #ifndef __JUCE_BLOWFISH_JUCEHEADER__ #include "juce_core/cryptography/juce_BlowFish.h" #endif -#ifndef __JUCE_MD5_JUCEHEADER__ - #include "juce_core/cryptography/juce_MD5.h" -#endif #ifndef __JUCE_PRIMES_JUCEHEADER__ #include "juce_core/cryptography/juce_Primes.h" #endif +#ifndef __JUCE_MD5_JUCEHEADER__ + #include "juce_core/cryptography/juce_MD5.h" +#endif #ifndef __JUCE_RSAKEY_JUCEHEADER__ #include "juce_core/cryptography/juce_RSAKey.h" #endif +#ifndef __JUCE_URL_JUCEHEADER__ + #include "juce_core/io/network/juce_URL.h" +#endif #ifndef __JUCE_SOCKET_JUCEHEADER__ #include "juce_core/io/network/juce_Socket.h" #endif -#ifndef __JUCE_URL_JUCEHEADER__ - #include "juce_core/io/network/juce_URL.h" +#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ + #include "juce_core/io/streams/juce_MemoryOutputStream.h" +#endif +#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ + #include "juce_core/io/streams/juce_SubregionStream.h" #endif #ifndef __JUCE_BUFFEREDINPUTSTREAM_JUCEHEADER__ #include "juce_core/io/streams/juce_BufferedInputStream.h" @@ -158,92 +164,86 @@ #ifndef __JUCE_FILEINPUTSOURCE_JUCEHEADER__ #include "juce_core/io/streams/juce_FileInputSource.h" #endif +#ifndef __JUCE_INPUTSOURCE_JUCEHEADER__ + #include "juce_core/io/streams/juce_InputSource.h" +#endif #ifndef __JUCE_GZIPCOMPRESSOROUTPUTSTREAM_JUCEHEADER__ #include "juce_core/io/streams/juce_GZIPCompressorOutputStream.h" #endif #ifndef __JUCE_GZIPDECOMPRESSORINPUTSTREAM_JUCEHEADER__ #include "juce_core/io/streams/juce_GZIPDecompressorInputStream.h" #endif -#ifndef __JUCE_INPUTSOURCE_JUCEHEADER__ - #include "juce_core/io/streams/juce_InputSource.h" -#endif #ifndef __JUCE_MEMORYINPUTSTREAM_JUCEHEADER__ #include "juce_core/io/streams/juce_MemoryInputStream.h" #endif -#ifndef __JUCE_MEMORYOUTPUTSTREAM_JUCEHEADER__ - #include "juce_core/io/streams/juce_MemoryOutputStream.h" -#endif -#ifndef __JUCE_SUBREGIONSTREAM_JUCEHEADER__ - #include "juce_core/io/streams/juce_SubregionStream.h" -#endif #ifndef __JUCE_PERFORMANCECOUNTER_JUCEHEADER__ #include "juce_core/misc/juce_PerformanceCounter.h" #endif +#ifndef __JUCE_ZIPFILE_JUCEHEADER__ + #include "juce_core/misc/juce_ZipFile.h" +#endif #ifndef __JUCE_PLATFORMUTILITIES_JUCEHEADER__ #include "juce_core/misc/juce_PlatformUtilities.h" #endif #ifndef __JUCE_UUID_JUCEHEADER__ #include "juce_core/misc/juce_Uuid.h" #endif -#ifndef __JUCE_ZIPFILE_JUCEHEADER__ - #include "juce_core/misc/juce_ZipFile.h" +#ifndef __JUCE_XMLELEMENT_JUCEHEADER__ + #include "juce_core/text/juce_XmlElement.h" #endif #ifndef __JUCE_CHARACTERFUNCTIONS_JUCEHEADER__ #include "juce_core/text/juce_CharacterFunctions.h" #endif +#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ + #include "juce_core/text/juce_StringArray.h" +#endif #ifndef __JUCE_LOCALISEDSTRINGS_JUCEHEADER__ #include "juce_core/text/juce_LocalisedStrings.h" #endif -#ifndef __JUCE_STRING_JUCEHEADER__ - #include "juce_core/text/juce_String.h" -#endif -#ifndef __JUCE_STRINGARRAY_JUCEHEADER__ - #include "juce_core/text/juce_StringArray.h" +#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ + #include "juce_core/text/juce_XmlDocument.h" #endif #ifndef __JUCE_STRINGPAIRARRAY_JUCEHEADER__ #include "juce_core/text/juce_StringPairArray.h" #endif -#ifndef __JUCE_XMLDOCUMENT_JUCEHEADER__ - #include "juce_core/text/juce_XmlDocument.h" +#ifndef __JUCE_STRING_JUCEHEADER__ + #include "juce_core/text/juce_String.h" #endif -#ifndef __JUCE_XMLELEMENT_JUCEHEADER__ - #include "juce_core/text/juce_XmlElement.h" +#ifndef __JUCE_THREADPOOL_JUCEHEADER__ + #include "juce_core/threads/juce_ThreadPool.h" +#endif +#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ + #include "juce_core/threads/juce_TimeSliceThread.h" #endif #ifndef __JUCE_CRITICALSECTION_JUCEHEADER__ #include "juce_core/threads/juce_CriticalSection.h" #endif -#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ - #include "juce_core/threads/juce_InterProcessLock.h" +#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ + #include "juce_core/threads/juce_ScopedReadLock.h" #endif #ifndef __JUCE_PROCESS_JUCEHEADER__ #include "juce_core/threads/juce_Process.h" #endif -#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ - #include "juce_core/threads/juce_ReadWriteLock.h" -#endif -#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ - #include "juce_core/threads/juce_ScopedLock.h" -#endif -#ifndef __JUCE_SCOPEDREADLOCK_JUCEHEADER__ - #include "juce_core/threads/juce_ScopedReadLock.h" +#ifndef __JUCE_THREAD_JUCEHEADER__ + #include "juce_core/threads/juce_Thread.h" #endif #ifndef __JUCE_SCOPEDTRYLOCK_JUCEHEADER__ #include "juce_core/threads/juce_ScopedTryLock.h" #endif -#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ - #include "juce_core/threads/juce_ScopedWriteLock.h" -#endif -#ifndef __JUCE_THREAD_JUCEHEADER__ - #include "juce_core/threads/juce_Thread.h" -#endif -#ifndef __JUCE_THREADPOOL_JUCEHEADER__ - #include "juce_core/threads/juce_ThreadPool.h" +#ifndef __JUCE_SCOPEDLOCK_JUCEHEADER__ + #include "juce_core/threads/juce_ScopedLock.h" #endif -#ifndef __JUCE_TIMESLICETHREAD_JUCEHEADER__ - #include "juce_core/threads/juce_TimeSliceThread.h" +#ifndef __JUCE_INTERPROCESSLOCK_JUCEHEADER__ + #include "juce_core/threads/juce_InterProcessLock.h" #endif #ifndef __JUCE_WAITABLEEVENT_JUCEHEADER__ #include "juce_core/threads/juce_WaitableEvent.h" #endif +#ifndef __JUCE_READWRITELOCK_JUCEHEADER__ + #include "juce_core/threads/juce_ReadWriteLock.h" +#endif +#ifndef __JUCE_SCOPEDWRITELOCK_JUCEHEADER__ + #include "juce_core/threads/juce_ScopedWriteLock.h" +#endif #endif