Browse Source

Removed the old demo.

tags/2021-05-28
jules 11 years ago
parent
commit
e4288fa8b6
93 changed files with 0 additions and 42425 deletions
  1. BIN
      extras/JuceDemo/Binary Data/cello.wav
  2. +0
    -49
      extras/JuceDemo/Binary Data/demo table data.xml
  3. BIN
      extras/JuceDemo/Binary Data/icons.zip
  4. BIN
      extras/JuceDemo/Binary Data/juce.png
  5. BIN
      extras/JuceDemo/Binary Data/juce_icon.png
  6. +0
    -50
      extras/JuceDemo/Binary Data/treedemo.xml
  7. +0
    -18
      extras/JuceDemo/Builds/Android/AndroidManifest.xml
  8. +0
    -31
      extras/JuceDemo/Builds/Android/build.xml
  9. +0
    -61
      extras/JuceDemo/Builds/Android/jni/Android.mk
  10. +0
    -6
      extras/JuceDemo/Builds/Android/jni/Application.mk
  11. +0
    -10
      extras/JuceDemo/Builds/Android/local.properties
  12. +0
    -5
      extras/JuceDemo/Builds/Android/project.properties
  13. BIN
      extras/JuceDemo/Builds/Android/res/drawable-mdpi/icon.png
  14. +0
    -5
      extras/JuceDemo/Builds/Android/res/values/strings.xml
  15. +0
    -717
      extras/JuceDemo/Builds/Android/src/com/juce/JuceDemo.java
  16. +0
    -3540
      extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp
  17. +0
    -294
      extras/JuceDemo/Builds/Linux/Makefile
  18. BIN
      extras/JuceDemo/Builds/MacOSX/Icon.icns
  19. +0
    -27
      extras/JuceDemo/Builds/MacOSX/Info.plist
  20. +0
    -2227
      extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
  21. BIN
      extras/JuceDemo/Builds/MacOSX/RecentFilesMenuTemplate.nib
  22. +0
    -19
      extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.sln
  23. +0
    -4626
      extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
  24. BIN
      extras/JuceDemo/Builds/VisualStudio2005/icon.ico
  25. +0
    -33
      extras/JuceDemo/Builds/VisualStudio2005/resources.rc
  26. +0
    -19
      extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.sln
  27. +0
    -4626
      extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
  28. BIN
      extras/JuceDemo/Builds/VisualStudio2008/icon.ico
  29. +0
    -33
      extras/JuceDemo/Builds/VisualStudio2008/resources.rc
  30. +0
    -19
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.sln
  31. +0
    -1723
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
  32. +0
    -2990
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
  33. BIN
      extras/JuceDemo/Builds/VisualStudio2010/icon.ico
  34. +0
    -33
      extras/JuceDemo/Builds/VisualStudio2010/resources.rc
  35. +0
    -19
      extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.sln
  36. +0
    -1729
      extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj
  37. +0
    -2990
      extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters
  38. BIN
      extras/JuceDemo/Builds/VisualStudio2012/icon.ico
  39. +0
    -33
      extras/JuceDemo/Builds/VisualStudio2012/resources.rc
  40. BIN
      extras/JuceDemo/Builds/iOS/Icon.icns
  41. +0
    -29
      extras/JuceDemo/Builds/iOS/Info.plist
  42. +0
    -2206
      extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
  43. +0
    -336
      extras/JuceDemo/Juce Demo.jucer
  44. +0
    -189
      extras/JuceDemo/JuceLibraryCode/AppConfig.h
  45. +0
    -2177
      extras/JuceDemo/JuceLibraryCode/BinaryData.cpp
  46. +0
    -33
      extras/JuceDemo/JuceLibraryCode/BinaryData.h
  47. +0
    -46
      extras/JuceDemo/JuceLibraryCode/JuceHeader.h
  48. +0
    -12
      extras/JuceDemo/JuceLibraryCode/ReadMe.txt
  49. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.h
  50. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.h
  51. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_audio_formats/juce_audio_formats.h
  52. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_audio_processors/juce_audio_processors.h
  53. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_audio_utils/juce_audio_utils.h
  54. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_core/juce_core.h
  55. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_cryptography/juce_cryptography.h
  56. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_data_structures/juce_data_structures.h
  57. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_events/juce_events.h
  58. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_graphics/juce_graphics.h
  59. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_gui_basics/juce_gui_basics.h
  60. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_gui_extra/juce_gui_extra.h
  61. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_opengl/juce_opengl.h
  62. +0
    -5
      extras/JuceDemo/JuceLibraryCode/modules/juce_video/juce_video.h
  63. +0
    -174
      extras/JuceDemo/Source/ApplicationStartup.cpp
  64. +0
    -701
      extras/JuceDemo/Source/MainDemoWindow.cpp
  65. +0
    -49
      extras/JuceDemo/Source/MainDemoWindow.h
  66. +0
    -409
      extras/JuceDemo/Source/demos/AudioDemoLatencyPage.cpp
  67. +0
    -76
      extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h
  68. +0
    -414
      extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp
  69. +0
    -96
      extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h
  70. +0
    -293
      extras/JuceDemo/Source/demos/AudioDemoRecordPage.cpp
  71. +0
    -77
      extras/JuceDemo/Source/demos/AudioDemoRecordPage.h
  72. +0
    -109
      extras/JuceDemo/Source/demos/AudioDemoSetupPage.cpp
  73. +0
    -69
      extras/JuceDemo/Source/demos/AudioDemoSetupPage.h
  74. +0
    -387
      extras/JuceDemo/Source/demos/AudioDemoSynthPage.cpp
  75. +0
    -79
      extras/JuceDemo/Source/demos/AudioDemoSynthPage.h
  76. +0
    -218
      extras/JuceDemo/Source/demos/AudioDemoTabComponent.cpp
  77. +0
    -99
      extras/JuceDemo/Source/demos/AudioDemoTabComponent.h
  78. +0
    -190
      extras/JuceDemo/Source/demos/CameraDemo.cpp
  79. +0
    -92
      extras/JuceDemo/Source/demos/CodeEditorDemo.cpp
  80. +0
    -155
      extras/JuceDemo/Source/demos/DirectShowDemo.cpp
  81. +0
    -274
      extras/JuceDemo/Source/demos/DragAndDropDemo.cpp
  82. +0
    -218
      extras/JuceDemo/Source/demos/FontsAndTextDemo.cpp
  83. +0
    -312
      extras/JuceDemo/Source/demos/InterprocessCommsDemo.cpp
  84. +0
    -279
      extras/JuceDemo/Source/demos/OpenGLDemo.cpp
  85. +0
    -117
      extras/JuceDemo/Source/demos/QuickTimeDemo.cpp
  86. +0
    -3854
      extras/JuceDemo/Source/demos/RenderingTestComponent.cpp
  87. +0
    -100
      extras/JuceDemo/Source/demos/RenderingTestComponent.h
  88. +0
    -320
      extras/JuceDemo/Source/demos/TableDemo.cpp
  89. +0
    -350
      extras/JuceDemo/Source/demos/ThreadingDemo.cpp
  90. +0
    -267
      extras/JuceDemo/Source/demos/TreeViewDemo.cpp
  91. +0
    -143
      extras/JuceDemo/Source/demos/WebBrowserDemo.cpp
  92. +0
    -1407
      extras/JuceDemo/Source/demos/WidgetsDemo.cpp
  93. +0
    -67
      extras/JuceDemo/Source/jucedemo_headers.h

BIN
extras/JuceDemo/Binary Data/cello.wav View File


+ 0
- 49
extras/JuceDemo/Binary Data/demo table data.xml View File

@@ -1,49 +0,0 @@
<DEMO_TABLE_DATA>
<COLUMNS>
<COLUMN columnId="1" name="ID" width="50"/>
<COLUMN columnId="2" name="Artist" width="150"/>
<COLUMN columnId="3" name="Song" width="200"/>
<COLUMN columnId="4" name="Album" width="100"/>
<COLUMN columnId="5" name="Rating" width="120"/>
<COLUMN columnId="6" name="Genre" width="80"/>
<COLUMN columnId="7" name="Length" width="80"/>
</COLUMNS>
<DATA>
<ITEM ID="01" Artist="The Beatles" Album="Revolver" Song="Taxman" Genre="Rock" Length="2:39" Rating="1"/>
<ITEM ID="02" Artist="The Beatles" Album="Revolver" Song="Eleanor Rigby" Genre="Rock" Length="2:07" Rating="2"/>
<ITEM ID="03" Artist="The Beatles" Album="Revolver" Song="I'm only Sleeping" Genre="Rock" Length="3:01" Rating="3"/>
<ITEM ID="04" Artist="The Beatles" Album="Revolver" Song="Yellow Submarine" Genre="Rock" Length="2:40" Rating="4"/>
<ITEM ID="05" Artist="The Beatles" Album="Rubber Soul" Song="Drive My Car" Genre="Rock" Length="2:30" Rating="1"/>
<ITEM ID="06" Artist="The Beatles" Album="Rubber Soul" Song="Norwegian Wood" Genre="Rock" Length="2:05" Rating="1"/>
<ITEM ID="07" Artist="The Beatles" Album="Rubber Soul" Song="Nowhere Man" Genre="Rock" Length="2:44" Rating="5"/>
<ITEM ID="08" Artist="The Beatles" Album="Rubber Soul" Song="The Word" Genre="Rock" Length="2:43" Rating="2"/>
<ITEM ID="09" Artist="The Beatles" Album="Rubber Soul" Song="What Goes On" Genre="Rock" Length="2:50" Rating="3"/>
<ITEM ID="10" Artist="The Beatles" Album="Rubber Soul" Song="In My Life" Genre="Rock" Length="2:27" Rating="1"/>
<ITEM ID="11" Artist="Cocteau Twins" Album="Victorialand" Song="Lazy Calm" Genre="Etherial" Length="6:36" Rating="6"/>
<ITEM ID="12" Artist="Cocteau Twins" Album="Victorialand" Song="Fluffy Tufts" Genre="Etherial" Length="3:05" Rating="1"/>
<ITEM ID="13" Artist="Cocteau Twins" Album="Victorialand" Song="Oomingmak" Genre="Etherial" Length="2:42" Rating="3"/>
<ITEM ID="14" Artist="Cocteau Twins" Album="Victorialand" Song="Feet-Like Fins" Genre="Etherial" Length="3:26" Rating="1"/>
<ITEM ID="15" Artist="Cocteau Twins" Album="Four Calendar Cafe" Song="Know Who You Are At Every Age" Genre="Etherial" Length="3:42" Rating="1"/>
<ITEM ID="16" Artist="Cocteau Twins" Album="Four Calendar Cafe" Song="Evangeline" Genre="Etherial" Length="4:31" Rating="5"/>
<ITEM ID="17" Artist="Cocteau Twins" Album="Four Calendar Cafe" Song="Bluebeard" Genre="Etherial" Length="3:56" Rating="1"/>
<ITEM ID="18" Artist="Cocteau Twins" Album="Four Calendar Cafe" Song="Squeeze-Wax" Genre="Etherial" Length="3:49" Rating="1"/>
<ITEM ID="19" Artist="Cocteau Twins" Album="Heaven Or Las Vegas" Song="Cherry-Coloured Funk" Genre="Etherial" Length="3:13" Rating="1"/>
<ITEM ID="20" Artist="Cocteau Twins" Album="Heaven Or Las Vegas" Song="Iceblink Luck" Genre="Etherial" Length="3:18" Rating="7"/>
<ITEM ID="21" Artist="Cocteau Twins" Album="Heaven Or Las Vegas" Song="Fifty-Fifty Clown" Genre="Etherial" Length="3:15" Rating="2"/>
<ITEM ID="22" Artist="Cocteau Twins" Album="Heaven Or Las Vegas" Song="Fotzepolitic" Genre="Etherial" Length="3:30" Rating="1"/>
<ITEM ID="23" Artist="Robyn Hitchcock" Album="I Often Dream of Trains" Song="Nocturne" Genre="Rock" Length="1:42" Rating="1"/>
<ITEM ID="24" Artist="Robyn Hitchcock" Album="I Often Dream of Trains" Song="Uncorrected Personality Traits" Genre="Rock" Length="1:45" Rating="5"/>
<ITEM ID="25" Artist="Robyn Hitchcock" Album="I Often Dream of Trains" Song="My Favourite Buildings" Genre="Rock" Length="2:49" Rating="1"/>
<ITEM ID="26" Artist="Robyn Hitchcock" Album="I Often Dream of Trains" Song="Heartful of Leaves" Genre="Rock" Length="2:30" Rating="7"/>
<ITEM ID="27" Artist="Robyn Hitchcock" Album="Luxor" Song="Penelope's Angles" Genre="Rock" Length="3:18" Rating="1"/>
<ITEM ID="28" Artist="Robyn Hitchcock" Album="Luxor" Song="You Remind Me Of You" Genre="Rock" Length="4:15" Rating="4"/>
<ITEM ID="29" Artist="Robyn Hitchcock" Album="Luxor" Song="The Wolf House" Genre="Rock" Length="3:23" Rating="1"/>
<ITEM ID="30" Artist="Robyn Hitchcock" Album="Jewels For Sophia" Song="Mexican God" Genre="Rock" Length="2:57" Rating="3"/>
<ITEM ID="31" Artist="Robyn Hitchcock" Album="Jewels For Sophia" Song="The Cheese Alarm" Genre="Rock" Length="4:03" Rating="1"/>
<ITEM ID="32" Artist="Robyn Hitchcock" Album="Jewels For Sophia" Song="No, I Don't Remember Guildford" Genre="Rock" Length="4:45" Rating="6"/>
<ITEM ID="33" Artist="Syd Barrett" Album="Barrett" Song="Baby Lemonade" Genre="Rock" Length="4:10" Rating="2"/>
<ITEM ID="34" Artist="Syd Barrett" Album="Barrett" Song="Dominoes" Genre="Rock" Length="4:08" Rating="3"/>
<ITEM ID="35" Artist="Syd Barrett" Album="Barrett" Song="Gigolo Aunt" Genre="Rock" Length="5:46" Rating="4"/>
<ITEM ID="36" Artist="Syd Barrett" Album="Barrett" Song="Effervescing Elephant" Genre="Rock" Length="1:52" Rating="5"/>
</DATA>
</DEMO_TABLE_DATA>

BIN
extras/JuceDemo/Binary Data/icons.zip View File


BIN
extras/JuceDemo/Binary Data/juce.png View File

Before After
Width: 140  |  Height: 86  |  Size: 15KB

BIN
extras/JuceDemo/Binary Data/juce_icon.png View File

Before After
Width: 128  |  Height: 128  |  Size: 19KB

+ 0
- 50
extras/JuceDemo/Binary Data/treedemo.xml View File

@@ -1,50 +0,0 @@
<tree>
<item1>
<subnode colour="ffff0000" width="800" />
<subnode colour="ff33bb00" width="50" />
<subnode colour="33000000" />
<subnode width="100" />
<subnode colour="ff8866ee" />
<subnode/>
<subnode colour="33000000" />
<subnode/>
<subnode/>
</item1>
<item2 colour="ff777777">
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode width="800"/>
<subnode width="800"/>
<subnode/>
<subnode/>
<subnode/>
<item3>
<subnode>
<subnode width="50"/>
</subnode>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
</item3>
</item2>
<item4>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
<subnode/>
</item4>
</tree>

+ 0
- 18
extras/JuceDemo/Builds/Android/AndroidManifest.xml View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0"
package="com.juce">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="JuceDemo" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

+ 0
- 31
extras/JuceDemo/Builds/Android/build.xml View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Juce Demo" default="debug">
<loadproperties srcFile="local.properties"/>
<loadproperties srcFile="project.properties"/>
<target name="clean">
<exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
<arg value="clean"/>
</exec>
</target>
<target name="-pre-build">
<condition property="makefileConfig" value="Debug" else="Release">
<equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
</condition>
<condition property="ndkDebugValue" value="NDK_DEBUG=1" else="NDK_DEBUG=0">
<equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
</condition>
<condition property="app_abis" value="armeabi armeabi-v7a" else="armeabi armeabi-v7a">
<equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
</condition>
<exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
<arg value="--jobs=2"/>
<arg value="CONFIG=${makefileConfig}"/>
<arg value="${ndkDebugValue}"/>
<arg value="APP_ABI=${app_abis}"/>
</exec>
<delete file="${out.final.file}"/>
<delete file="${out.packaged.file}"/>
</target>
<import file="${sdk.dir}/tools/ant/build.xml"/>
</project>

+ 0
- 61
extras/JuceDemo/Builds/Android/jni/Android.mk View File

@@ -1,61 +0,0 @@
# Automatically generated makefile, created by the Introjucer
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_MODULE := juce_jni
LOCAL_SRC_FILES := \
../../../Source/ApplicationStartup.cpp\
../../../Source/MainDemoWindow.cpp\
../../../Source/demos/AudioDemoLatencyPage.cpp\
../../../Source/demos/AudioDemoPlaybackPage.cpp\
../../../Source/demos/AudioDemoRecordPage.cpp\
../../../Source/demos/AudioDemoSetupPage.cpp\
../../../Source/demos/AudioDemoSynthPage.cpp\
../../../Source/demos/AudioDemoTabComponent.cpp\
../../../Source/demos/CameraDemo.cpp\
../../../Source/demos/CodeEditorDemo.cpp\
../../../Source/demos/DirectShowDemo.cpp\
../../../Source/demos/DragAndDropDemo.cpp\
../../../Source/demos/FontsAndTextDemo.cpp\
../../../Source/demos/InterprocessCommsDemo.cpp\
../../../Source/demos/OpenGLDemo.cpp\
../../../Source/demos/QuickTimeDemo.cpp\
../../../Source/demos/RenderingTestComponent.cpp\
../../../Source/demos/TableDemo.cpp\
../../../Source/demos/ThreadingDemo.cpp\
../../../Source/demos/TreeViewDemo.cpp\
../../../Source/demos/WebBrowserDemo.cpp\
../../../Source/demos/WidgetsDemo.cpp\
../../../JuceLibraryCode/BinaryData.cpp\
../../../../../modules/juce_audio_basics/juce_audio_basics.cpp\
../../../../../modules/juce_audio_devices/juce_audio_devices.cpp\
../../../../../modules/juce_audio_formats/juce_audio_formats.cpp\
../../../../../modules/juce_audio_processors/juce_audio_processors.cpp\
../../../../../modules/juce_audio_utils/juce_audio_utils.cpp\
../../../../../modules/juce_core/juce_core.cpp\
../../../../../modules/juce_cryptography/juce_cryptography.cpp\
../../../../../modules/juce_data_structures/juce_data_structures.cpp\
../../../../../modules/juce_events/juce_events.cpp\
../../../../../modules/juce_graphics/juce_graphics.cpp\
../../../../../modules/juce_gui_basics/juce_gui_basics.cpp\
../../../../../modules/juce_gui_extra/juce_gui_extra.cpp\
../../../../../modules/juce_opengl/juce_opengl.cpp\
../../../../../modules/juce_video/juce_video.cpp\
ifeq ($(CONFIG),Debug)
LOCAL_CPPFLAGS += -fsigned-char -fexceptions -frtti -g -I "../../JuceLibraryCode" -I "../../../../modules" -O0 -D "JUCE_ANDROID=1" -D "JUCE_ANDROID_API_VERSION=8" -D "JUCE_ANDROID_ACTIVITY_CLASSNAME=com_juce_JuceDemo" -D JUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/juce/JuceDemo\" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
LOCAL_LDLIBS := -llog -lGLESv2
LOCAL_CFLAGS += -fsigned-char -fexceptions -frtti -g -I "../../JuceLibraryCode" -I "../../../../modules" -O0 -D "JUCE_ANDROID=1" -D "JUCE_ANDROID_API_VERSION=8" -D "JUCE_ANDROID_ACTIVITY_CLASSNAME=com_juce_JuceDemo" -D JUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/juce/JuceDemo\" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
LOCAL_LDLIBS := -llog -lGLESv2
else
LOCAL_CPPFLAGS += -fsigned-char -fexceptions -frtti -I "../../JuceLibraryCode" -I "../../../../modules" -Os -D "JUCE_ANDROID=1" -D "JUCE_ANDROID_API_VERSION=8" -D "JUCE_ANDROID_ACTIVITY_CLASSNAME=com_juce_JuceDemo" -D JUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/juce/JuceDemo\" -D "NDEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
LOCAL_LDLIBS := -llog -lGLESv2
LOCAL_CFLAGS += -fsigned-char -fexceptions -frtti -I "../../JuceLibraryCode" -I "../../../../modules" -Os -D "JUCE_ANDROID=1" -D "JUCE_ANDROID_API_VERSION=8" -D "JUCE_ANDROID_ACTIVITY_CLASSNAME=com_juce_JuceDemo" -D JUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/juce/JuceDemo\" -D "NDEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
LOCAL_LDLIBS := -llog -lGLESv2
endif
include $(BUILD_SHARED_LIBRARY)

+ 0
- 6
extras/JuceDemo/Builds/Android/jni/Application.mk View File

@@ -1,6 +0,0 @@
# Automatically generated makefile, created by the Introjucer
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
APP_STL := gnustl_static
APP_CPPFLAGS += -fsigned-char -fexceptions -frtti -Wno-psabi
APP_PLATFORM := android-8

+ 0
- 10
extras/JuceDemo/Builds/Android/local.properties View File

@@ -1,10 +0,0 @@
# This file is used to override default values used by the Ant build system.
# It is automatically generated by the Introjucer - DO NOT EDIT IT or your changes will be lost!.
sdk.dir=${user.home}/SDKs/android-sdk
ndk.dir=${user.home}/SDKs/android-ndk
key.store=${user.home}/.android/debug.keystore
key.alias=androiddebugkey
key.store.password=android
key.alias.password=android

+ 0
- 5
extras/JuceDemo/Builds/Android/project.properties View File

@@ -1,5 +0,0 @@
# This file is used to override default values used by the Ant build system.
# It is automatically generated - DO NOT EDIT IT or your changes will be lost!.
target=android-8

BIN
extras/JuceDemo/Builds/Android/res/drawable-mdpi/icon.png View File

Before After
Width: 128  |  Height: 128  |  Size: 17KB

+ 0
- 5
extras/JuceDemo/Builds/Android/res/values/strings.xml View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Juce Demo</string>
</resources>

+ 0
- 717
extras/JuceDemo/Builds/Android/src/com/juce/JuceDemo.java View File

@@ -1,717 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
package com.juce;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.view.*;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.graphics.*;
import android.opengl.*;
import android.text.ClipboardManager;
import android.text.InputType;
import android.util.DisplayMetrics;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.HttpURLConnection;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.media.AudioManager;
import android.media.MediaScannerConnection;
import android.media.MediaScannerConnection.MediaScannerConnectionClient;
//==============================================================================
public final class JuceDemo extends Activity
{
//==============================================================================
static
{
System.loadLibrary ("juce_jni");
}
@Override
public final void onCreate (Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
viewHolder = new ViewHolder (this);
setContentView (viewHolder);
setVolumeControlStream (AudioManager.STREAM_MUSIC);
}
@Override
protected final void onDestroy()
{
quitApp();
super.onDestroy();
}
@Override
protected final void onPause()
{
if (viewHolder != null)
viewHolder.onPause();
suspendApp();
super.onPause();
}
@Override
protected final void onResume()
{
super.onResume();
if (viewHolder != null)
viewHolder.onResume();
resumeApp();
}
@Override
public void onConfigurationChanged (Configuration cfg)
{
super.onConfigurationChanged (cfg);
setContentView (viewHolder);
}
private void callAppLauncher()
{
launchApp (getApplicationInfo().publicSourceDir,
getApplicationInfo().dataDir);
}
//==============================================================================
private native void launchApp (String appFile, String appDataDir);
private native void quitApp();
private native void suspendApp();
private native void resumeApp();
private native void setScreenSize (int screenWidth, int screenHeight, int dpi);
//==============================================================================
public native void deliverMessage (long value);
private android.os.Handler messageHandler = new android.os.Handler();
public final void postMessage (long value)
{
messageHandler.post (new MessageCallback (value));
}
private final class MessageCallback implements Runnable
{
public MessageCallback (long value_) { value = value_; }
public final void run() { deliverMessage (value); }
private long value;
}
//==============================================================================
private ViewHolder viewHolder;
public final ComponentPeerView createNewView (boolean opaque, long host)
{
ComponentPeerView v = new ComponentPeerView (this, opaque, host);
viewHolder.addView (v);
return v;
}
public final void deleteView (ComponentPeerView view)
{
ViewGroup group = (ViewGroup) (view.getParent());
if (group != null)
group.removeView (view);
}
final class ViewHolder extends ViewGroup
{
public ViewHolder (Context context)
{
super (context);
setDescendantFocusability (ViewGroup.FOCUS_AFTER_DESCENDANTS);
setFocusable (false);
}
protected final void onLayout (boolean changed, int left, int top, int right, int bottom)
{
setScreenSize (getWidth(), getHeight(), getDPI());
if (isFirstResize)
{
isFirstResize = false;
callAppLauncher();
}
}
public final void onPause()
{
for (int i = getChildCount(); --i >= 0;)
{
View v = getChildAt (i);
if (v instanceof ComponentPeerView)
((ComponentPeerView) v).onPause();
}
}
public final void onResume()
{
for (int i = getChildCount(); --i >= 0;)
{
View v = getChildAt (i);
if (v instanceof ComponentPeerView)
((ComponentPeerView) v).onResume();
}
}
private final int getDPI()
{
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics (metrics);
return metrics.densityDpi;
}
private boolean isFirstResize = true;
}
public final void excludeClipRegion (android.graphics.Canvas canvas, float left, float top, float right, float bottom)
{
canvas.clipRect (left, top, right, bottom, android.graphics.Region.Op.DIFFERENCE);
}
//==============================================================================
public final String getClipboardContent()
{
ClipboardManager clipboard = (ClipboardManager) getSystemService (CLIPBOARD_SERVICE);
return clipboard.getText().toString();
}
public final void setClipboardContent (String newText)
{
ClipboardManager clipboard = (ClipboardManager) getSystemService (CLIPBOARD_SERVICE);
clipboard.setText (newText);
}
//==============================================================================
public final void showMessageBox (String title, String message, final long callback)
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.setTitle (title)
.setMessage (message)
.setCancelable (true)
.setPositiveButton ("OK", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 0);
}
});
builder.create().show();
}
public final void showOkCancelBox (String title, String message, final long callback)
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.setTitle (title)
.setMessage (message)
.setCancelable (true)
.setPositiveButton ("OK", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 1);
}
})
.setNegativeButton ("Cancel", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 0);
}
});
builder.create().show();
}
public final void showYesNoCancelBox (String title, String message, final long callback)
{
AlertDialog.Builder builder = new AlertDialog.Builder (this);
builder.setTitle (title)
.setMessage (message)
.setCancelable (true)
.setPositiveButton ("Yes", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 1);
}
})
.setNegativeButton ("No", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 2);
}
})
.setNeutralButton ("Cancel", new DialogInterface.OnClickListener()
{
public void onClick (DialogInterface dialog, int id)
{
dialog.cancel();
JuceDemo.this.alertDismissed (callback, 0);
}
});
builder.create().show();
}
public native void alertDismissed (long callback, int id);
//==============================================================================
public final class ComponentPeerView extends ViewGroup
implements View.OnFocusChangeListener
{
public ComponentPeerView (Context context, boolean opaque_, long host)
{
super (context);
this.host = host;
setWillNotDraw (false);
opaque = opaque_;
setFocusable (true);
setFocusableInTouchMode (true);
setOnFocusChangeListener (this);
requestFocus();
}
//==============================================================================
private native void handlePaint (long host, Canvas canvas);
@Override
public void onDraw (Canvas canvas)
{
handlePaint (host, canvas);
}
@Override
public boolean isOpaque()
{
return opaque;
}
private boolean opaque;
private long host;
//==============================================================================
private native void handleMouseDown (long host, int index, float x, float y, long time);
private native void handleMouseDrag (long host, int index, float x, float y, long time);
private native void handleMouseUp (long host, int index, float x, float y, long time);
@Override
public boolean onTouchEvent (MotionEvent event)
{
int action = event.getAction();
long time = event.getEventTime();
switch (action & MotionEvent.ACTION_MASK)
{
case MotionEvent.ACTION_DOWN:
handleMouseDown (host, event.getPointerId(0), event.getX(), event.getY(), time);
return true;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
handleMouseUp (host, event.getPointerId(0), event.getX(), event.getY(), time);
return true;
case MotionEvent.ACTION_MOVE:
{
int n = event.getPointerCount();
for (int i = 0; i < n; ++i)
handleMouseDrag (host, event.getPointerId(i), event.getX(i), event.getY(i), time);
return true;
}
case MotionEvent.ACTION_POINTER_UP:
{
int i = (action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
handleMouseUp (host, event.getPointerId(i), event.getX(i), event.getY(i), time);
return true;
}
case MotionEvent.ACTION_POINTER_DOWN:
{
int i = (action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
handleMouseDown (host, event.getPointerId(i), event.getX(i), event.getY(i), time);
return true;
}
default:
break;
}
return false;
}
//==============================================================================
private native void handleKeyDown (long host, int keycode, int textchar);
private native void handleKeyUp (long host, int keycode, int textchar);
public void showKeyboard (boolean shouldShow)
{
InputMethodManager imm = (InputMethodManager) getSystemService (Context.INPUT_METHOD_SERVICE);
if (imm != null)
{
if (shouldShow)
imm.showSoftInput (this, InputMethodManager.SHOW_FORCED);
else
imm.hideSoftInputFromWindow (getWindowToken(), 0);
}
}
@Override
public boolean onKeyDown (int keyCode, KeyEvent event)
{
switch (keyCode)
{
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
return super.onKeyDown (keyCode, event);
default: break;
}
handleKeyDown (host, keyCode, event.getUnicodeChar());
return true;
}
@Override
public boolean onKeyUp (int keyCode, KeyEvent event)
{
handleKeyUp (host, keyCode, event.getUnicodeChar());
return true;
}
// this is here to make keyboard entry work on a Galaxy Tab2 10.1
@Override
public InputConnection onCreateInputConnection (EditorInfo outAttrs)
{
outAttrs.actionLabel = "";
outAttrs.hintText = "";
outAttrs.initialCapsMode = 0;
outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
outAttrs.label = "";
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
outAttrs.inputType = InputType.TYPE_NULL;
return new BaseInputConnection (this, false);
}
//==============================================================================
@Override
protected void onSizeChanged (int w, int h, int oldw, int oldh)
{
super.onSizeChanged (w, h, oldw, oldh);
viewSizeChanged (host);
}
@Override
protected void onLayout (boolean changed, int left, int top, int right, int bottom)
{
for (int i = getChildCount(); --i >= 0;)
requestTransparentRegion (getChildAt (i));
}
private native void viewSizeChanged (long host);
@Override
public void onFocusChange (View v, boolean hasFocus)
{
if (v == this)
focusChanged (host, hasFocus);
}
private native void focusChanged (long host, boolean hasFocus);
public void setViewName (String newName) {}
public boolean isVisible() { return getVisibility() == VISIBLE; }
public void setVisible (boolean b) { setVisibility (b ? VISIBLE : INVISIBLE); }
public boolean containsPoint (int x, int y)
{
return true; //xxx needs to check overlapping views
}
public final void onPause()
{
for (int i = getChildCount(); --i >= 0;)
{
View v = getChildAt (i);
if (v instanceof OpenGLView)
((OpenGLView) v).onPause();
}
}
public final void onResume()
{
for (int i = getChildCount(); --i >= 0;)
{
View v = getChildAt (i);
if (v instanceof OpenGLView)
((OpenGLView) v).onResume();
}
}
public OpenGLView createGLView()
{
OpenGLView glView = new OpenGLView (getContext());
addView (glView);
return glView;
}
}
//==============================================================================
public final class OpenGLView extends GLSurfaceView
implements GLSurfaceView.Renderer
{
OpenGLView (Context context)
{
super (context);
setEGLContextClientVersion (2);
setRenderer (this);
setRenderMode (RENDERMODE_WHEN_DIRTY);
}
@Override
public void onSurfaceCreated (GL10 unused, EGLConfig config)
{
contextCreated();
}
@Override
public void onSurfaceChanged (GL10 unused, int width, int height)
{
contextChangedSize();
}
@Override
public void onDrawFrame (GL10 unused)
{
render();
}
private native void contextCreated();
private native void contextChangedSize();
private native void render();
}
//==============================================================================
public final int[] renderGlyph (char glyph, Paint paint, android.graphics.Matrix matrix, Rect bounds)
{
Path p = new Path();
paint.getTextPath (String.valueOf (glyph), 0, 1, 0.0f, 0.0f, p);
RectF boundsF = new RectF();
p.computeBounds (boundsF, true);
matrix.mapRect (boundsF);
boundsF.roundOut (bounds);
bounds.left--;
bounds.right++;
final int w = bounds.width();
final int h = Math.max (1, bounds.height());
Bitmap bm = Bitmap.createBitmap (w, h, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas (bm);
matrix.postTranslate (-bounds.left, -bounds.top);
c.setMatrix (matrix);
c.drawPath (p, paint);
final int sizeNeeded = w * h;
if (cachedRenderArray.length < sizeNeeded)
cachedRenderArray = new int [sizeNeeded];
bm.getPixels (cachedRenderArray, 0, w, 0, 0, w, h);
bm.recycle();
return cachedRenderArray;
}
private int[] cachedRenderArray = new int [256];
//==============================================================================
public static class HTTPStream
{
public HTTPStream (HttpURLConnection connection_) throws IOException
{
connection = connection_;
inputStream = new BufferedInputStream (connection.getInputStream());
}
public final void release()
{
try
{
inputStream.close();
}
catch (IOException e)
{}
connection.disconnect();
}
public final int read (byte[] buffer, int numBytes)
{
int num = 0;
try
{
num = inputStream.read (buffer, 0, numBytes);
}
catch (IOException e)
{}
if (num > 0)
position += num;
return num;
}
public final long getPosition() { return position; }
public final long getTotalLength() { return -1; }
public final boolean isExhausted() { return false; }
public final boolean setPosition (long newPos) { return false; }
private HttpURLConnection connection;
private InputStream inputStream;
private long position;
}
public static final HTTPStream createHTTPStream (String address, boolean isPost, byte[] postData,
String headers, int timeOutMs,
java.lang.StringBuffer responseHeaders)
{
try
{
HttpURLConnection connection = (HttpURLConnection) (new URL (address).openConnection());
if (connection != null)
{
try
{
if (isPost)
{
connection.setConnectTimeout (timeOutMs);
connection.setDoOutput (true);
connection.setChunkedStreamingMode (0);
OutputStream out = connection.getOutputStream();
out.write (postData);
out.flush();
}
return new HTTPStream (connection);
}
catch (Throwable e)
{
connection.disconnect();
}
}
}
catch (Throwable e)
{}
return null;
}
public final void launchURL (String url)
{
startActivity (new Intent (Intent.ACTION_VIEW, Uri.parse (url)));
}
public static final String getLocaleValue (boolean isRegion)
{
java.util.Locale locale = java.util.Locale.getDefault();
return isRegion ? locale.getDisplayCountry (java.util.Locale.US)
: locale.getDisplayLanguage (java.util.Locale.US);
}
//==============================================================================
private final class SingleMediaScanner implements MediaScannerConnectionClient
{
public SingleMediaScanner (Context context, String filename)
{
file = filename;
msc = new MediaScannerConnection (context, this);
msc.connect();
}
@Override
public void onMediaScannerConnected()
{
msc.scanFile (file, null);
}
@Override
public void onScanCompleted (String path, Uri uri)
{
msc.disconnect();
}
private MediaScannerConnection msc;
private String file;
}
public final void scanFile (String filename)
{
new SingleMediaScanner (this, filename);
}
}

+ 0
- 3540
extras/JuceDemo/Builds/CodeBlocks/Juce Demo.cbp
File diff suppressed because it is too large
View File


+ 0
- 294
extras/JuceDemo/Builds/Linux/Makefile View File

@@ -1,294 +0,0 @@
# Automatically generated makefile, created by the Introjucer
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
# (this disables dependency generation if multiple architectures are set)
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)
ifndef CONFIG
CONFIG=Debug
endif
ifeq ($(CONFIG),Debug)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Debug
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
TARGET := JuceDemo
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
endif
ifeq ($(CONFIG),Release)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Release
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -Os
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
TARGET := JuceDemo
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
endif
OBJECTS := \
$(OBJDIR)/ApplicationStartup_3bf86e16.o \
$(OBJDIR)/MainDemoWindow_f9e963d5.o \
$(OBJDIR)/AudioDemoLatencyPage_c12cc5dc.o \
$(OBJDIR)/AudioDemoPlaybackPage_a7b17745.o \
$(OBJDIR)/AudioDemoRecordPage_77bd50fb.o \
$(OBJDIR)/AudioDemoSetupPage_e6febadb.o \
$(OBJDIR)/AudioDemoSynthPage_6d168c9a.o \
$(OBJDIR)/AudioDemoTabComponent_81185e3.o \
$(OBJDIR)/CameraDemo_954a4a30.o \
$(OBJDIR)/CodeEditorDemo_55f35645.o \
$(OBJDIR)/DirectShowDemo_2e0bc311.o \
$(OBJDIR)/DragAndDropDemo_f8c9e5d7.o \
$(OBJDIR)/FontsAndTextDemo_2cefcecb.o \
$(OBJDIR)/InterprocessCommsDemo_aa1c1119.o \
$(OBJDIR)/OpenGLDemo_f1e721ba.o \
$(OBJDIR)/QuickTimeDemo_84dae9df.o \
$(OBJDIR)/RenderingTestComponent_dde8a0e7.o \
$(OBJDIR)/TableDemo_99f71d3.o \
$(OBJDIR)/ThreadingDemo_35b0f31d.o \
$(OBJDIR)/TreeViewDemo_c130a3ae.o \
$(OBJDIR)/WebBrowserDemo_be24b7bf.o \
$(OBJDIR)/WidgetsDemo_9419b474.o \
$(OBJDIR)/BinaryData_ce4232d4.o \
$(OBJDIR)/juce_audio_basics_399a455e.o \
$(OBJDIR)/juce_audio_devices_c1c9ba9c.o \
$(OBJDIR)/juce_audio_formats_f04b043c.o \
$(OBJDIR)/juce_audio_processors_eb9ae116.o \
$(OBJDIR)/juce_audio_utils_cf18005c.o \
$(OBJDIR)/juce_core_1ee54a40.o \
$(OBJDIR)/juce_cryptography_3b1f489a.o \
$(OBJDIR)/juce_data_structures_84790dfc.o \
$(OBJDIR)/juce_events_584896b4.o \
$(OBJDIR)/juce_graphics_f9afc18.o \
$(OBJDIR)/juce_gui_basics_90929794.o \
$(OBJDIR)/juce_gui_extra_b81d9e1c.o \
$(OBJDIR)/juce_opengl_1890bee0.o \
$(OBJDIR)/juce_video_86a19d3c.o \
.PHONY: clean
$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking Juce Demo
-@mkdir -p $(BINDIR)
-@mkdir -p $(LIBDIR)
-@mkdir -p $(OUTDIR)
@$(BLDCMD)
clean:
@echo Cleaning Juce Demo
-@rm -f $(OUTDIR)/$(TARGET)
-@rm -rf $(OBJDIR)/*
-@rm -rf $(OBJDIR)
strip:
@echo Stripping Juce Demo
-@strip --strip-unneeded $(OUTDIR)/$(TARGET)
$(OBJDIR)/ApplicationStartup_3bf86e16.o: ../../Source/ApplicationStartup.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling ApplicationStartup.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/MainDemoWindow_f9e963d5.o: ../../Source/MainDemoWindow.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling MainDemoWindow.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoLatencyPage_c12cc5dc.o: ../../Source/demos/AudioDemoLatencyPage.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoLatencyPage.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoPlaybackPage_a7b17745.o: ../../Source/demos/AudioDemoPlaybackPage.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoPlaybackPage.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoRecordPage_77bd50fb.o: ../../Source/demos/AudioDemoRecordPage.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoRecordPage.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoSetupPage_e6febadb.o: ../../Source/demos/AudioDemoSetupPage.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoSetupPage.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoSynthPage_6d168c9a.o: ../../Source/demos/AudioDemoSynthPage.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoSynthPage.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/AudioDemoTabComponent_81185e3.o: ../../Source/demos/AudioDemoTabComponent.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling AudioDemoTabComponent.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/CameraDemo_954a4a30.o: ../../Source/demos/CameraDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CameraDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/CodeEditorDemo_55f35645.o: ../../Source/demos/CodeEditorDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CodeEditorDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/DirectShowDemo_2e0bc311.o: ../../Source/demos/DirectShowDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling DirectShowDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/DragAndDropDemo_f8c9e5d7.o: ../../Source/demos/DragAndDropDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling DragAndDropDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/FontsAndTextDemo_2cefcecb.o: ../../Source/demos/FontsAndTextDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling FontsAndTextDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/InterprocessCommsDemo_aa1c1119.o: ../../Source/demos/InterprocessCommsDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling InterprocessCommsDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/OpenGLDemo_f1e721ba.o: ../../Source/demos/OpenGLDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling OpenGLDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/QuickTimeDemo_84dae9df.o: ../../Source/demos/QuickTimeDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling QuickTimeDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/RenderingTestComponent_dde8a0e7.o: ../../Source/demos/RenderingTestComponent.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling RenderingTestComponent.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/TableDemo_99f71d3.o: ../../Source/demos/TableDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling TableDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/ThreadingDemo_35b0f31d.o: ../../Source/demos/ThreadingDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling ThreadingDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/TreeViewDemo_c130a3ae.o: ../../Source/demos/TreeViewDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling TreeViewDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/WebBrowserDemo_be24b7bf.o: ../../Source/demos/WebBrowserDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling WebBrowserDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/WidgetsDemo_9419b474.o: ../../Source/demos/WidgetsDemo.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling WidgetsDemo.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/BinaryData_ce4232d4.o: ../../JuceLibraryCode/BinaryData.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling BinaryData.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_basics_399a455e.o: ../../../../modules/juce_audio_basics/juce_audio_basics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_basics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_devices_c1c9ba9c.o: ../../../../modules/juce_audio_devices/juce_audio_devices.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_devices.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_formats_f04b043c.o: ../../../../modules/juce_audio_formats/juce_audio_formats.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_formats.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_processors_eb9ae116.o: ../../../../modules/juce_audio_processors/juce_audio_processors.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_processors.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_audio_utils_cf18005c.o: ../../../../modules/juce_audio_utils/juce_audio_utils.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_audio_utils.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_core_1ee54a40.o: ../../../../modules/juce_core/juce_core.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_core.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_cryptography_3b1f489a.o: ../../../../modules/juce_cryptography/juce_cryptography.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_cryptography.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_data_structures_84790dfc.o: ../../../../modules/juce_data_structures/juce_data_structures.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_data_structures.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_events_584896b4.o: ../../../../modules/juce_events/juce_events.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_events.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_graphics_f9afc18.o: ../../../../modules/juce_graphics/juce_graphics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_graphics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_gui_basics_90929794.o: ../../../../modules/juce_gui_basics/juce_gui_basics.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_gui_basics.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_gui_extra_b81d9e1c.o: ../../../../modules/juce_gui_extra/juce_gui_extra.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_gui_extra.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_opengl_1890bee0.o: ../../../../modules/juce_opengl/juce_opengl.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_opengl.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/juce_video_86a19d3c.o: ../../../../modules/juce_video/juce_video.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling juce_video.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)

BIN
extras/JuceDemo/Builds/MacOSX/Icon.icns View File


+ 0
- 27
extras/JuceDemo/Builds/MacOSX/Info.plist View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.rawmaterialsoftware.jucedemo</string>
<key>CFBundleName</key>
<string>Juce Demo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<key>CFBundleVersion</key>
<string>2.0.0</string>
<key>NSHumanReadableCopyright</key>
<string>Raw Material Software Ltd.</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>

+ 0
- 2227
extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
File diff suppressed because it is too large
View File


BIN
extras/JuceDemo/Builds/MacOSX/RecentFilesMenuTemplate.nib View File


+ 0
- 19
extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.sln View File

@@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{B49533A3-E69B-E288-783B-47C939C7FB33}") = "Juce Demo", "Juce Demo.vcproj", "{E9F746BA-9271-B101-E5E2-1615849AF13D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.ActiveCfg = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.Build.0 = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.ActiveCfg = Release|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 0
- 4626
extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
File diff suppressed because it is too large
View File


BIN
extras/JuceDemo/Builds/VisualStudio2005/icon.ico View File

Before After

+ 0
- 33
extras/JuceDemo/Builds/VisualStudio2005/resources.rc View File

@@ -1,33 +0,0 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Raw Material Software Ltd.\0"
VALUE "FileDescription", "Juce Demo\0"
VALUE "FileVersion", "2.0.0\0"
VALUE "ProductName", "Juce Demo\0"
VALUE "ProductVersion", "2.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON2 ICON DISCARDABLE "icon.ico"

+ 0
- 19
extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.sln View File

@@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{B49533A3-E69B-E288-783B-47C939C7FB33}") = "Juce Demo", "Juce Demo.vcproj", "{E9F746BA-9271-B101-E5E2-1615849AF13D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.ActiveCfg = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.Build.0 = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.ActiveCfg = Release|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 0
- 4626
extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
File diff suppressed because it is too large
View File


BIN
extras/JuceDemo/Builds/VisualStudio2008/icon.ico View File

Before After

+ 0
- 33
extras/JuceDemo/Builds/VisualStudio2008/resources.rc View File

@@ -1,33 +0,0 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Raw Material Software Ltd.\0"
VALUE "FileDescription", "Juce Demo\0"
VALUE "FileVersion", "2.0.0\0"
VALUE "ProductName", "Juce Demo\0"
VALUE "ProductVersion", "2.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON2 ICON DISCARDABLE "icon.ico"

+ 0
- 19
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.sln View File

@@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{B49533A3-E69B-E288-783B-47C939C7FB33}") = "Juce Demo", "Juce Demo.vcxproj", "{E9F746BA-9271-B101-E5E2-1615849AF13D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.ActiveCfg = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.Build.0 = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.ActiveCfg = Release|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 0
- 1723
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
File diff suppressed because it is too large
View File


+ 0
- 2990
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
File diff suppressed because it is too large
View File


BIN
extras/JuceDemo/Builds/VisualStudio2010/icon.ico View File

Before After

+ 0
- 33
extras/JuceDemo/Builds/VisualStudio2010/resources.rc View File

@@ -1,33 +0,0 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Raw Material Software Ltd.\0"
VALUE "FileDescription", "Juce Demo\0"
VALUE "FileVersion", "2.0.0\0"
VALUE "ProductName", "Juce Demo\0"
VALUE "ProductVersion", "2.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON2 ICON DISCARDABLE "icon.ico"

+ 0
- 19
extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.sln View File

@@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2012
Project("{B49533A3-E69B-E288-783B-47C939C7FB33}") = "Juce Demo", "Juce Demo.vcxproj", "{E9F746BA-9271-B101-E5E2-1615849AF13D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.ActiveCfg = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Debug|Win32.Build.0 = Debug|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.ActiveCfg = Release|Win32
{E9F746BA-9271-B101-E5E2-1615849AF13D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 0
- 1729
extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj
File diff suppressed because it is too large
View File


+ 0
- 2990
extras/JuceDemo/Builds/VisualStudio2012/Juce Demo.vcxproj.filters
File diff suppressed because it is too large
View File


BIN
extras/JuceDemo/Builds/VisualStudio2012/icon.ico View File

Before After

+ 0
- 33
extras/JuceDemo/Builds/VisualStudio2012/resources.rc View File

@@ -1,33 +0,0 @@
#ifdef JUCE_USER_DEFINED_RC_FILE
#include JUCE_USER_DEFINED_RC_FILE
#else
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Raw Material Software Ltd.\0"
VALUE "FileDescription", "Juce Demo\0"
VALUE "FileVersion", "2.0.0\0"
VALUE "ProductName", "Juce Demo\0"
VALUE "ProductVersion", "2.0.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END
#endif
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON2 ICON DISCARDABLE "icon.ico"

BIN
extras/JuceDemo/Builds/iOS/Icon.icns View File


+ 0
- 29
extras/JuceDemo/Builds/iOS/Info.plist View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.rawmaterialsoftware.jucedemo</string>
<key>CFBundleName</key>
<string>Juce Demo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<key>CFBundleVersion</key>
<string>2.0.0</string>
<key>NSHumanReadableCopyright</key>
<string>Raw Material Software Ltd.</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>

+ 0
- 2206
extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
File diff suppressed because it is too large
View File


+ 0
- 336
extras/JuceDemo/Juce Demo.jucer View File

@@ -1,336 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="SLvvV6j" name="Juce Demo" projectType="guiapp" juceLinkage="amalg_multi"
jucerVersion="3.1.0" version="2.0.0" bundleIdentifier="com.rawmaterialsoftware.jucedemo"
buildVST="1" buildRTAS="0" buildAU="1" pluginName="Juce Demo"
pluginDesc="Juce Demo" pluginManufacturer="yourcompany" pluginManufacturerCode="abcd"
pluginCode="Abcd" pluginChannelConfigs="{ {1, 1}, {2, 2} }" pluginIsSynth="0"
pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginSilenceInIsSilenceOut="0"
pluginTailLength="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="JuceDemoAU"
pluginAUViewClass="JuceDemoAU_V1" pluginRTASCategory="" icon="Duj062Top"
companyName="Raw Material Software Ltd." includeBinaryInAppConfig="1">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
objCExtraSuffix="JSLvvV6j" bigIcon="f4hwldS" extraCompilerFlags="-Wall -Wno-missing-field-initializers -Wstrict-aliasing -Wshadow -Wshorten-64-to-32">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
osxSDK="default" osxCompatibility="default" defines="JUCE_UNIT_TESTS=1"
osxArchitecture="default"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
osxSDK="default" osxCompatibility="10.5 SDK" defines="JUCE_UNIT_TESTS=1"
osxArchitecture="32BitUniversal"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</XCODE_MAC>
<XCODE_IPHONE targetFolder="Builds/iOS" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
objCExtraSuffix="JSLvvV6j" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
osxSDK="default" osxCompatibility="default" defines="JUCE_UNIT_TESTS=1"
osxArchitecture="default" iosCompatibility="default"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
osxSDK="default" osxCompatibility="10.4 SDK" defines="JUCE_UNIT_TESTS=1"
osxArchitecture="32BitUniversal" iosCompatibility="default"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</XCODE_IPHONE>
<VS2012 targetFolder="Builds/VisualStudio2012" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="1" optimisation="1" targetName="Juce Demo"/>
<CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
isDebug="0" optimisation="2" targetName="Juce Demo"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</VS2012>
<VS2010 targetFolder="Builds/VisualStudio2010" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winArchitecture="32-bit" winWarningLevel="4"
generateManifest="1"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winArchitecture="32-bit" winWarningLevel="4"
generateManifest="1"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</VS2010>
<VS2008 targetFolder="Builds/VisualStudio2008" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winWarningLevel="4" generateManifest="1"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winWarningLevel="4" generateManifest="1"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</VS2008>
<VS2005 targetFolder="Builds/VisualStudio2005" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winWarningLevel="4" generateManifest="1"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" winWarningLevel="4" generateManifest="1"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</VS2005>
<LINUX_MAKE targetFolder="Builds/Linux" vstFolder="~/SDKs/vstsdk2.4" bigIcon="f4hwldS">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" libraryPath="/usr/X11R6/lib/"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" libraryPath="/usr/X11R6/lib/"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</LINUX_MAKE>
<ANDROID targetFolder="Builds/Android" androidSDKPath="${user.home}/SDKs/android-sdk"
androidNDKPath="${user.home}/SDKs/android-ndk" androidInternetNeeded="1"
bigIcon="f4hwldS" androidActivityClass="com.juce.JuceDemo" androidMinimumSDK="8"
androidMicNeeded="1" androidKeyStore="${user.home}/.android/debug.keystore"
androidKeyStorePass="android" androidKeyAlias="androiddebugkey"
androidKeyAliasPass="android">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" androidArchitectures="armeabi armeabi-v7a"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"
defines="JUCE_UNIT_TESTS=1" androidArchitectures="armeabi armeabi-v7a"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</ANDROID>
<CODEBLOCKS targetFolder="Builds/CodeBlocks" extraDefs="JUCE_UNIT_TESTS=1">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" optimisation="1" targetName="JuceDemo"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="JuceDemo"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../modules"/>
<MODULEPATH id="juce_opengl" path="../../modules"/>
<MODULEPATH id="juce_gui_extra" path="../../modules"/>
<MODULEPATH id="juce_gui_basics" path="../../modules"/>
<MODULEPATH id="juce_graphics" path="../../modules"/>
<MODULEPATH id="juce_events" path="../../modules"/>
<MODULEPATH id="juce_data_structures" path="../../modules"/>
<MODULEPATH id="juce_cryptography" path="../../modules"/>
<MODULEPATH id="juce_core" path="../../modules"/>
<MODULEPATH id="juce_audio_utils" path="../../modules"/>
<MODULEPATH id="juce_audio_processors" path="../../modules"/>
<MODULEPATH id="juce_audio_formats" path="../../modules"/>
<MODULEPATH id="juce_audio_devices" path="../../modules"/>
<MODULEPATH id="juce_audio_basics" path="../../modules"/>
</MODULEPATHS>
</CODEBLOCKS>
</EXPORTFORMATS>
<MAINGROUP id="0bU7ypLe" name="Juce Demo">
<FILE id="Bnqll1Mk0" name="ApplicationStartup.cpp" compile="1" resource="0"
file="Source/ApplicationStartup.cpp"/>
<FILE id="GQ8NUhTaA" name="MainDemoWindow.cpp" compile="1" resource="0"
file="Source/MainDemoWindow.cpp"/>
<FILE id="uZ5W4Yi3v" name="MainDemoWindow.h" compile="0" resource="0"
file="Source/MainDemoWindow.h"/>
<FILE id="2tLjAaxrV" name="jucedemo_headers.h" compile="0" resource="0"
file="Source/jucedemo_headers.h"/>
<GROUP id="p0ZeP0Wn6" name="Demos">
<FILE id="0K60nXdM0" name="AudioDemoLatencyPage.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoLatencyPage.cpp"/>
<FILE id="gBbGRs0kH" name="AudioDemoLatencyPage.h" compile="0" resource="0"
file="Source/demos/AudioDemoLatencyPage.h"/>
<FILE id="xhvfKtgZG" name="AudioDemoPlaybackPage.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoPlaybackPage.cpp"/>
<FILE id="29brslcz" name="AudioDemoPlaybackPage.h" compile="0" resource="0"
file="Source/demos/AudioDemoPlaybackPage.h"/>
<FILE id="YGjfPIjR" name="AudioDemoRecordPage.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoRecordPage.cpp"/>
<FILE id="VM1ZV45Pm" name="AudioDemoRecordPage.h" compile="0" resource="0"
file="Source/demos/AudioDemoRecordPage.h"/>
<FILE id="EYUlG624y" name="AudioDemoSetupPage.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoSetupPage.cpp"/>
<FILE id="MnvCR6oN" name="AudioDemoSetupPage.h" compile="0" resource="0"
file="Source/demos/AudioDemoSetupPage.h"/>
<FILE id="oAwxdfki8" name="AudioDemoSynthPage.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoSynthPage.cpp"/>
<FILE id="oB7yiS4Hk" name="AudioDemoSynthPage.h" compile="0" resource="0"
file="Source/demos/AudioDemoSynthPage.h"/>
<FILE id="jzvMAq8mg" name="AudioDemoTabComponent.cpp" compile="1" resource="0"
file="Source/demos/AudioDemoTabComponent.cpp"/>
<FILE id="gP6sEczjE" name="AudioDemoTabComponent.h" compile="0" resource="0"
file="Source/demos/AudioDemoTabComponent.h"/>
<FILE id="obpkMZ2g" name="CameraDemo.cpp" compile="1" resource="0"
file="Source/demos/CameraDemo.cpp"/>
<FILE id="VrH9xEBt4" name="CodeEditorDemo.cpp" compile="1" resource="0"
file="Source/demos/CodeEditorDemo.cpp"/>
<FILE id="Biv7Wl" name="DirectShowDemo.cpp" compile="1" resource="0"
file="Source/demos/DirectShowDemo.cpp"/>
<FILE id="LQxkyT31Q" name="DragAndDropDemo.cpp" compile="1" resource="0"
file="Source/demos/DragAndDropDemo.cpp"/>
<FILE id="WlmBspVQo" name="FontsAndTextDemo.cpp" compile="1" resource="0"
file="Source/demos/FontsAndTextDemo.cpp"/>
<FILE id="5NTST47xi" name="InterprocessCommsDemo.cpp" compile="1" resource="0"
file="Source/demos/InterprocessCommsDemo.cpp"/>
<FILE id="xoi5BuVvv" name="OpenGLDemo.cpp" compile="1" resource="0"
file="Source/demos/OpenGLDemo.cpp"/>
<FILE id="WkWbYNoZ0" name="QuickTimeDemo.cpp" compile="1" resource="0"
file="Source/demos/QuickTimeDemo.cpp"/>
<FILE id="hzPv7BR9U" name="RenderingTestComponent.cpp" compile="1"
resource="0" file="Source/demos/RenderingTestComponent.cpp"/>
<FILE id="EQv4ZsR78" name="RenderingTestComponent.h" compile="0" resource="0"
file="Source/demos/RenderingTestComponent.h"/>
<FILE id="ReJoO2H9u" name="TableDemo.cpp" compile="1" resource="0"
file="Source/demos/TableDemo.cpp"/>
<FILE id="6MwRgCUkn" name="ThreadingDemo.cpp" compile="1" resource="0"
file="Source/demos/ThreadingDemo.cpp"/>
<FILE id="c5Wy6zXol" name="TreeViewDemo.cpp" compile="1" resource="0"
file="Source/demos/TreeViewDemo.cpp"/>
<FILE id="5ee1NoTnc" name="WebBrowserDemo.cpp" compile="1" resource="0"
file="Source/demos/WebBrowserDemo.cpp"/>
<FILE id="F6gqyNSim" name="WidgetsDemo.cpp" compile="1" resource="0"
file="Source/demos/WidgetsDemo.cpp"/>
</GROUP>
<GROUP id="BR14NOf0" name="Binary Data">
<FILE id="X5sIZFkN" name="cello.wav" compile="0" resource="1" file="Binary Data/cello.wav"/>
<FILE id="BAqnjOqfe" name="demo table data.xml" compile="0" resource="1"
file="Binary Data/demo table data.xml"/>
<FILE id="lEVfO5KTK" name="icons.zip" compile="0" resource="1" file="Binary Data/icons.zip"/>
<FILE id="Duj062Top" name="juce.png" compile="0" resource="1" file="Binary Data/juce.png"/>
<FILE id="f4hwldS" name="juce_icon.png" compile="0" resource="0" file="Binary Data/juce_icon.png"/>
<FILE id="UvweoM7iM" name="treedemo.xml" compile="0" resource="1" file="Binary Data/treedemo.xml"/>
</GROUP>
</MAINGROUP>
<JUCEOPTIONS JUCE_PLUGINHOST_VST="disabled" JUCE_PLUGINHOST_AU="disabled"/>
<MODULES>
<MODULE id="juce_audio_basics" showAllCode="1"/>
<MODULE id="juce_audio_devices" showAllCode="1"/>
<MODULE id="juce_audio_formats" showAllCode="1"/>
<MODULE id="juce_audio_processors" showAllCode="1"/>
<MODULE id="juce_audio_utils" showAllCode="1"/>
<MODULE id="juce_core" showAllCode="1"/>
<MODULE id="juce_cryptography" showAllCode="1"/>
<MODULE id="juce_data_structures" showAllCode="1"/>
<MODULE id="juce_events" showAllCode="1"/>
<MODULE id="juce_graphics" showAllCode="1"/>
<MODULE id="juce_gui_basics" showAllCode="1"/>
<MODULE id="juce_gui_extra" showAllCode="1"/>
<MODULE id="juce_opengl" showAllCode="1"/>
<MODULE id="juce_video" showAllCode="1"/>
</MODULES>
</JUCERPROJECT>

+ 0
- 189
extras/JuceDemo/JuceLibraryCode/AppConfig.h View File

@@ -1,189 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
There's a section below where you can add your own custom code safely, and the
Introjucer will preserve the contents of that block, but the best way to change
any of these definitions is by using the Introjucer's project settings.
Any commented-out settings will assume their default values.
*/
#ifndef __JUCE_APPCONFIG_SLVVV6J__
#define __JUCE_APPCONFIG_SLVVV6J__
//==============================================================================
// [BEGIN_USER_CODE_SECTION]
// (You can add your own code in this section, and the Introjucer will not overwrite it)
// [END_USER_CODE_SECTION]
//==============================================================================
#define JUCE_MODULE_AVAILABLE_juce_audio_basics 1
#define JUCE_MODULE_AVAILABLE_juce_audio_devices 1
#define JUCE_MODULE_AVAILABLE_juce_audio_formats 1
#define JUCE_MODULE_AVAILABLE_juce_audio_processors 1
#define JUCE_MODULE_AVAILABLE_juce_audio_utils 1
#define JUCE_MODULE_AVAILABLE_juce_core 1
#define JUCE_MODULE_AVAILABLE_juce_cryptography 1
#define JUCE_MODULE_AVAILABLE_juce_data_structures 1
#define JUCE_MODULE_AVAILABLE_juce_events 1
#define JUCE_MODULE_AVAILABLE_juce_graphics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_basics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1
#define JUCE_MODULE_AVAILABLE_juce_opengl 1
#define JUCE_MODULE_AVAILABLE_juce_video 1
//==============================================================================
// juce_audio_devices flags:
#ifndef JUCE_ASIO
//#define JUCE_ASIO
#endif
#ifndef JUCE_WASAPI
//#define JUCE_WASAPI
#endif
#ifndef JUCE_DIRECTSOUND
//#define JUCE_DIRECTSOUND
#endif
#ifndef JUCE_ALSA
//#define JUCE_ALSA
#endif
#ifndef JUCE_JACK
//#define JUCE_JACK
#endif
#ifndef JUCE_USE_ANDROID_OPENSLES
//#define JUCE_USE_ANDROID_OPENSLES
#endif
#ifndef JUCE_USE_CDREADER
//#define JUCE_USE_CDREADER
#endif
#ifndef JUCE_USE_CDBURNER
//#define JUCE_USE_CDBURNER
#endif
//==============================================================================
// juce_audio_formats flags:
#ifndef JUCE_USE_FLAC
//#define JUCE_USE_FLAC
#endif
#ifndef JUCE_USE_OGGVORBIS
//#define JUCE_USE_OGGVORBIS
#endif
#ifndef JUCE_USE_MP3AUDIOFORMAT
//#define JUCE_USE_MP3AUDIOFORMAT
#endif
#ifndef JUCE_USE_LAME_AUDIO_FORMAT
//#define JUCE_USE_LAME_AUDIO_FORMAT
#endif
#ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT
//#define JUCE_USE_WINDOWS_MEDIA_FORMAT
#endif
//==============================================================================
// juce_audio_processors flags:
#ifndef JUCE_PLUGINHOST_VST
#define JUCE_PLUGINHOST_VST 0
#endif
#ifndef JUCE_PLUGINHOST_AU
#define JUCE_PLUGINHOST_AU 0
#endif
//==============================================================================
// juce_core flags:
#ifndef JUCE_FORCE_DEBUG
//#define JUCE_FORCE_DEBUG
#endif
#ifndef JUCE_LOG_ASSERTIONS
//#define JUCE_LOG_ASSERTIONS
#endif
#ifndef JUCE_CHECK_MEMORY_LEAKS
//#define JUCE_CHECK_MEMORY_LEAKS
#endif
#ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#endif
#ifndef JUCE_INCLUDE_ZLIB_CODE
//#define JUCE_INCLUDE_ZLIB_CODE
#endif
//==============================================================================
// juce_graphics flags:
#ifndef JUCE_USE_COREIMAGE_LOADER
//#define JUCE_USE_COREIMAGE_LOADER
#endif
#ifndef JUCE_USE_DIRECTWRITE
//#define JUCE_USE_DIRECTWRITE
#endif
//==============================================================================
// juce_gui_basics flags:
#ifndef JUCE_ENABLE_REPAINT_DEBUGGING
//#define JUCE_ENABLE_REPAINT_DEBUGGING
#endif
#ifndef JUCE_USE_XSHM
//#define JUCE_USE_XSHM
#endif
#ifndef JUCE_USE_XRENDER
//#define JUCE_USE_XRENDER
#endif
#ifndef JUCE_USE_XCURSOR
//#define JUCE_USE_XCURSOR
#endif
//==============================================================================
// juce_gui_extra flags:
#ifndef JUCE_WEB_BROWSER
//#define JUCE_WEB_BROWSER
#endif
//==============================================================================
// juce_video flags:
#ifndef JUCE_DIRECTSHOW
//#define JUCE_DIRECTSHOW
#endif
#ifndef JUCE_MEDIAFOUNDATION
//#define JUCE_MEDIAFOUNDATION
#endif
#ifndef JUCE_QUICKTIME
//#define JUCE_QUICKTIME
#endif
#ifndef JUCE_USE_CAMERA
//#define JUCE_USE_CAMERA
#endif
#endif // __JUCE_APPCONFIG_SLVVV6J__

+ 0
- 2177
extras/JuceDemo/JuceLibraryCode/BinaryData.cpp
File diff suppressed because it is too large
View File


+ 0
- 33
extras/JuceDemo/JuceLibraryCode/BinaryData.h View File

@@ -1,33 +0,0 @@
/* =========================================================================================
This is an auto-generated file: Any edits you make may be overwritten!
*/
namespace BinaryData
{
extern const char* cello_wav;
const int cello_wavSize = 46348;
extern const char* demo_table_data_xml;
const int demo_table_data_xmlSize = 5239;
extern const char* icons_zip;
const int icons_zipSize = 83876;
extern const char* juce_png;
const int juce_pngSize = 15290;
extern const char* treedemo_xml;
const int treedemo_xmlSize = 1126;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];
// Number of elements in the namedResourceList array.
extern const int namedResourceListSize;
// If you provide the name of one of the binary resource variables above, this function will
// return the corresponding data and its size (or a null pointer if the name isn't found).
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();
}

+ 0
- 46
extras/JuceDemo/JuceLibraryCode/JuceHeader.h View File

@@ -1,46 +0,0 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
This is the header file that your files should include in order to get all the
JUCE library headers. You should avoid including the JUCE headers directly in
your own source files, because that wouldn't pick up the correct configuration
options for your app.
*/
#ifndef __APPHEADERFILE_SLVVV6J__
#define __APPHEADERFILE_SLVVV6J__
#include "AppConfig.h"
#include "modules/juce_audio_basics/juce_audio_basics.h"
#include "modules/juce_audio_devices/juce_audio_devices.h"
#include "modules/juce_audio_formats/juce_audio_formats.h"
#include "modules/juce_audio_processors/juce_audio_processors.h"
#include "modules/juce_audio_utils/juce_audio_utils.h"
#include "modules/juce_core/juce_core.h"
#include "modules/juce_cryptography/juce_cryptography.h"
#include "modules/juce_data_structures/juce_data_structures.h"
#include "modules/juce_events/juce_events.h"
#include "modules/juce_graphics/juce_graphics.h"
#include "modules/juce_gui_basics/juce_gui_basics.h"
#include "modules/juce_gui_extra/juce_gui_extra.h"
#include "modules/juce_opengl/juce_opengl.h"
#include "modules/juce_video/juce_video.h"
#include "BinaryData.h"
#if ! DONT_SET_USING_JUCE_NAMESPACE
// If your code uses a lot of JUCE classes, then this will obviously save you
// a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
using namespace juce;
#endif
namespace ProjectInfo
{
const char* const projectName = "Juce Demo";
const char* const versionString = "2.0.0";
const int versionNumber = 0x20000;
}
#endif // __APPHEADERFILE_SLVVV6J__

+ 0
- 12
extras/JuceDemo/JuceLibraryCode/ReadMe.txt View File

@@ -1,12 +0,0 @@
Important Note!!
================
The purpose of this folder is to contain files that are auto-generated by the Introjucer,
and ALL files in this folder will be mercilessly DELETED and completely re-written whenever
the Introjucer saves your project.
Therefore, it's a bad idea to make any manual changes to the files in here, or to
put any of your own files in here if you don't want to lose them. (Of course you may choose
to add the folder's contents to your version-control system so that you can re-merge your own
modifications after the Introjucer has saved its changes).

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_basics/juce_audio_basics.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_devices/juce_audio_devices.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_audio_formats/juce_audio_formats.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_formats/juce_audio_formats.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_audio_processors/juce_audio_processors.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_processors/juce_audio_processors.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_audio_utils/juce_audio_utils.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_audio_utils/juce_audio_utils.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_core/juce_core.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_core/juce_core.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_cryptography/juce_cryptography.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_cryptography/juce_cryptography.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_data_structures/juce_data_structures.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_data_structures/juce_data_structures.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_events/juce_events.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_events/juce_events.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_graphics/juce_graphics.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_graphics/juce_graphics.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_gui_basics/juce_gui_basics.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_gui_basics/juce_gui_basics.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_gui_extra/juce_gui_extra.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_gui_extra/juce_gui_extra.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_opengl/juce_opengl.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_opengl/juce_opengl.h"

+ 0
- 5
extras/JuceDemo/JuceLibraryCode/modules/juce_video/juce_video.h View File

@@ -1,5 +0,0 @@
// This is an auto-generated file to redirect any included
// module headers to the correct external folder.
#include "../../../../../modules/juce_video/juce_video.h"

+ 0
- 174
extras/JuceDemo/Source/ApplicationStartup.cpp View File

@@ -1,174 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "jucedemo_headers.h"
#include "MainDemoWindow.h"
//==============================================================================
class JUCEDemoApplication : public JUCEApplication
{
public:
//==============================================================================
JUCEDemoApplication()
{
}
~JUCEDemoApplication()
{
}
//==============================================================================
void initialise (const String& /*commandLine*/)
{
#if JUCE_IOS || JUCE_ANDROID
theMainWindow.setVisible (true);
theMainWindow.setFullScreen (true);
#else
theMainWindow.centreWithSize (700, 600);
theMainWindow.setVisible (true);
#endif
// this little function just demonstrates a few system info calls
Logger::outputDebugString (collectSomeSystemInfo());
/* on return from this method, the app will go into its the main event
dispatch loop, and this will run until something calls
JUCEAppliction::quit().
In this case, JUCEAppliction::quit() will be called by the
demo window when the user clicks on its close button.
*/
}
void shutdown()
{
// This method is where your app should do any cleaning-up that's needed
// before being shut down.
}
//==============================================================================
const String getApplicationName()
{
// When you use the Jucer to auto-generate a project, it puts the project's name and version in
// this constant, so we can use that here as our return value. Alternatively you can return
// your own string here, of course.
return ProjectInfo::projectName;
}
const String getApplicationVersion()
{
// When you use the Jucer to auto-generate a project, it puts the project's name and version in
// this constant, so we can use that here as our return value. Alternatively you can return
// your own string here, of course.
return ProjectInfo::versionString;
}
bool moreThanOneInstanceAllowed()
{
return true;
}
void anotherInstanceStarted (const String& /*commandLine*/)
{
// This will get called if the user launches another copy of the app, but
// there's nothing that the demo app needs to do here.
}
private:
// This is the main demo window component.
MainDemoWindow theMainWindow;
//==============================================================================
// this little function just demonstrates a few system info calls
static String collectSomeSystemInfo()
{
String systemInfo;
systemInfo
<< "Time and date: " << Time::getCurrentTime().toString (true, true) << newLine
<< "User logon name: " << SystemStats::getLogonName() << newLine
<< "Full user name: " << SystemStats::getFullUserName() << newLine
<< "Host name: " << SystemStats::getComputerName() << newLine
<< "Operating system: " << SystemStats::getOperatingSystemName() << newLine
<< "Locale: " << SystemStats::getUserLanguage() << "-" << SystemStats::getUserRegion() << newLine
<< "Memory size: " << SystemStats::getMemorySizeInMegabytes() << "MB" << newLine
<< "Number of CPUs: " << SystemStats::getNumCpus() << newLine
<< "CPU vendor: " << SystemStats::getCpuVendor() << newLine
<< "CPU speed: " << SystemStats::getCpuSpeedInMegaherz() << "MHz" << newLine
<< "CPU has MMX: " << (SystemStats::hasMMX() ? "yes" : "no") << newLine
<< "CPU has SSE: " << (SystemStats::hasSSE() ? "yes" : "no") << newLine
<< "CPU has SSE2: " << (SystemStats::hasSSE2() ? "yes" : "no") << newLine
<< "CPU has SSE3: " << (SystemStats::hasSSE3() ? "yes" : "no") << newLine
<< "CPU has 3DNOW: " << (SystemStats::has3DNow() ? "yes" : "no") << newLine
<< "Found network card MAC addresses: " << getMacAddressList() << newLine
<< "Found IP addresses: " << getIPAddressList() << newLine
<< "Current working directory: " << File::getCurrentWorkingDirectory().getFullPathName() << newLine
<< "Current executable file: " << File::getSpecialLocation (File::currentExecutableFile).getFullPathName() << newLine
<< "Current application file: " << File::getSpecialLocation (File::currentApplicationFile).getFullPathName() << newLine
<< "User home directory: " << File::getSpecialLocation (File::userHomeDirectory).getFullPathName() << newLine
<< "User documents directory: " << File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName() << newLine
<< "User application data directory: " << File::getSpecialLocation (File::userApplicationDataDirectory).getFullPathName() << newLine
<< "Common application data directory: " << File::getSpecialLocation (File::commonApplicationDataDirectory).getFullPathName() << newLine
<< "Temp directory: " << File::getSpecialLocation (File::tempDirectory).getFullPathName() << newLine
<< newLine;
return systemInfo;
}
static String getMacAddressList()
{
Array <MACAddress> macAddresses;
MACAddress::findAllAddresses (macAddresses);
StringArray addressStrings;
for (int i = 0; i < macAddresses.size(); ++i)
addressStrings.add (macAddresses[i].toString());
return addressStrings.joinIntoString (", ");
}
static String getIPAddressList()
{
Array <IPAddress> addresses;
IPAddress::findAllAddresses (addresses);
StringArray addressStrings;
for (int i = 0; i < addresses.size(); ++i)
addressStrings.add (addresses[i].toString());
return addressStrings.joinIntoString (", ");
}
};
//==============================================================================
/*
This macro creates the application's main() function..
*/
START_JUCE_APPLICATION (JUCEDemoApplication)

+ 0
- 701
extras/JuceDemo/Source/MainDemoWindow.cpp View File

@@ -1,701 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "jucedemo_headers.h"
#include "MainDemoWindow.h"
//==============================================================================
class ContentComp : public Component,
public MenuBarModel,
public ApplicationCommandTarget
{
public:
//==============================================================================
ContentComp (MainDemoWindow& mainWindow_)
: mainWindow (mainWindow_),
currentDemoId (0)
{
setOpaque (true);
invokeDirectly (showRendering, true);
}
~ContentComp()
{
#if JUCE_OPENGL
openGLContext.detach();
#endif
}
void paint (Graphics& g)
{
g.fillAll (Colours::white);
}
void resized()
{
if (currentDemo != nullptr)
currentDemo->setBounds (getLocalBounds());
}
//==============================================================================
void showDemo (Component* demoComp)
{
currentDemo = demoComp;
addAndMakeVisible (currentDemo);
resized();
}
//==============================================================================
StringArray getMenuBarNames()
{
const char* const names[] = { "Demo", "Look-and-feel", nullptr };
return StringArray (names);
}
PopupMenu getMenuForIndex (int menuIndex, const String& /*menuName*/)
{
ApplicationCommandManager* commandManager = &(mainWindow.commandManager);
PopupMenu menu;
if (menuIndex == 0)
{
menu.addCommandItem (commandManager, showRendering);
menu.addCommandItem (commandManager, showFontsAndText);
menu.addCommandItem (commandManager, showWidgets);
menu.addCommandItem (commandManager, showThreading);
menu.addCommandItem (commandManager, showTreeView);
menu.addCommandItem (commandManager, showTable);
menu.addCommandItem (commandManager, showAudio);
menu.addCommandItem (commandManager, showDragAndDrop);
menu.addCommandItem (commandManager, showOpenGL);
menu.addCommandItem (commandManager, showQuicktime);
menu.addCommandItem (commandManager, showDirectShow);
menu.addCommandItem (commandManager, showInterprocessComms);
menu.addCommandItem (commandManager, showCamera);
menu.addCommandItem (commandManager, showWebBrowser);
menu.addCommandItem (commandManager, showCodeEditor);
menu.addSeparator();
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit);
}
else if (menuIndex == 1)
{
menu.addCommandItem (commandManager, useLookAndFeelV1);
menu.addCommandItem (commandManager, useLookAndFeelV2);
menu.addCommandItem (commandManager, useLookAndFeelV3);
menu.addSeparator();
menu.addCommandItem (commandManager, useNativeTitleBar);
#if JUCE_MAC
menu.addCommandItem (commandManager, useNativeMenus);
#endif
#if ! JUCE_LINUX
menu.addCommandItem (commandManager, goToKioskMode);
#endif
StringArray engines (getRenderingEngines());
if (engines.size() > 1)
{
menu.addSeparator();
int currentEngine = getPeer()->getCurrentRenderingEngine();
#if JUCE_OPENGL
if (openGLContext.isAttached())
currentEngine = engines.size() - 1;
#endif
for (int i = 0; i < engines.size(); ++i)
menu.addItem (5001 + i, "Use " + engines[i], true, i == currentEngine);
}
}
return menu;
}
void menuItemSelected (int menuItemID, int /*topLevelMenuIndex*/)
{
// most of our menu items are invoked automatically as commands, but we can handle the
// other special cases here..
if (menuItemID >= 5001 && menuItemID < 5010)
{
const int engineIndex = menuItemID - 5001;
#if JUCE_OPENGL
if (engineIndex >= getPeer()->getAvailableRenderingEngines().size())
{
setUsingOpenGLRenderer (true);
return;
}
#endif
setUsingOpenGLRenderer (false);
getPeer()->setCurrentRenderingEngine (engineIndex);
}
}
void setUsingOpenGLRenderer (bool shouldUseOpenGL)
{
#if JUCE_OPENGL
if (shouldUseOpenGL && currentDemoId != showOpenGL)
openGLContext.attachTo (*getTopLevelComponent());
else
openGLContext.detach();
#endif
}
//==============================================================================
// The following methods implement the ApplicationCommandTarget interface, allowing
// this window to publish a set of actions it can perform, and which can be mapped
// onto menus, keypresses, etc.
ApplicationCommandTarget* getNextCommandTarget()
{
// this will return the next parent component that is an ApplicationCommandTarget (in this
// case, there probably isn't one, but it's best to use this method in your own apps).
return findFirstTargetParentComponent();
}
void getAllCommands (Array <CommandID>& commands)
{
// this returns the set of all commands that this target can perform..
const CommandID ids[] = { showRendering,
showFontsAndText,
showWidgets,
showThreading,
showTreeView,
showTable,
showAudio,
showDragAndDrop,
showOpenGL,
showQuicktime,
showDirectShow,
showCamera,
showWebBrowser,
showCodeEditor,
showInterprocessComms,
useLookAndFeelV1,
useLookAndFeelV2,
useLookAndFeelV3,
useNativeTitleBar
#if JUCE_MAC
, useNativeMenus
#endif
#if ! JUCE_LINUX
, goToKioskMode
#endif
};
commands.addArray (ids, numElementsInArray (ids));
}
// This method is used when something needs to find out the details about one of the commands
// that this object can perform..
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
const String generalCategory ("General");
const String demosCategory ("Demos");
switch (commandID)
{
case showRendering:
result.setInfo ("Graphics Rendering", "Shows the graphics demo", demosCategory, 0);
result.setTicked (currentDemoId == showRendering);
result.addDefaultKeypress ('1', ModifierKeys::commandModifier);
break;
case showFontsAndText:
result.setInfo ("Fonts and Text", "Shows the fonts & text demo", demosCategory, 0);
result.setTicked (currentDemoId == showFontsAndText);
result.addDefaultKeypress ('2', ModifierKeys::commandModifier);
break;
case showWidgets:
result.setInfo ("Widgets", "Shows the widgets demo", demosCategory, 0);
result.setTicked (currentDemoId == showWidgets);
result.addDefaultKeypress ('3', ModifierKeys::commandModifier);
break;
case showThreading:
result.setInfo ("Multithreading", "Shows the threading demo", demosCategory, 0);
result.setTicked (currentDemoId == showThreading);
result.addDefaultKeypress ('4', ModifierKeys::commandModifier);
break;
case showTreeView:
result.setInfo ("Treeviews", "Shows the treeviews demo", demosCategory, 0);
result.setTicked (currentDemoId == showTreeView);
result.addDefaultKeypress ('5', ModifierKeys::commandModifier);
break;
case showTable:
result.setInfo ("Table Components", "Shows the table component demo", demosCategory, 0);
result.setTicked (currentDemoId == showTable);
result.addDefaultKeypress ('6', ModifierKeys::commandModifier);
break;
case showAudio:
result.setInfo ("Audio", "Shows the audio demo", demosCategory, 0);
result.setTicked (currentDemoId == showAudio);
result.addDefaultKeypress ('7', ModifierKeys::commandModifier);
break;
case showDragAndDrop:
result.setInfo ("Drag-and-drop", "Shows the drag & drop demo", demosCategory, 0);
result.setTicked (currentDemoId == showDragAndDrop);
result.addDefaultKeypress ('8', ModifierKeys::commandModifier);
break;
case showOpenGL:
result.setInfo ("OpenGL", "Shows the OpenGL demo", demosCategory, 0);
result.addDefaultKeypress ('9', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showOpenGL);
#if ! JUCE_OPENGL
result.setActive (false);
#endif
break;
case showQuicktime:
result.setInfo ("Quicktime", "Shows the Quicktime demo", demosCategory, 0);
result.addDefaultKeypress ('b', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showQuicktime);
#if ! (JUCE_QUICKTIME && ! JUCE_LINUX)
result.setActive (false);
#endif
break;
case showDirectShow:
result.setInfo ("DirectShow", "Shows the DirectShow demo", demosCategory, 0);
result.addDefaultKeypress ('b', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showDirectShow);
#if ! JUCE_DIRECTSHOW
result.setActive (false);
#endif
break;
case showCamera:
result.setInfo ("Camera Capture", "Shows the camera demo", demosCategory, 0);
result.addDefaultKeypress ('c', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showCamera);
#if ! JUCE_USE_CAMERA
result.setActive (false);
#endif
break;
case showWebBrowser:
result.setInfo ("Web Browser", "Shows the web browser demo", demosCategory, 0);
result.addDefaultKeypress ('i', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showWebBrowser);
#if (! JUCE_WEB_BROWSER) || JUCE_LINUX
result.setActive (false);
#endif
break;
case showCodeEditor:
result.setInfo ("Code Editor", "Shows the code editor demo", demosCategory, 0);
result.addDefaultKeypress ('e', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showCodeEditor);
break;
case showInterprocessComms:
result.setInfo ("Interprocess Comms", "Shows the interprocess communications demo", demosCategory, 0);
result.addDefaultKeypress ('0', ModifierKeys::commandModifier);
result.setTicked (currentDemoId == showInterprocessComms);
break;
case useLookAndFeelV1:
result.setInfo ("Use LookAndFeel_V1", String::empty, generalCategory, 0);
result.setTicked (typeid (LookAndFeel_V1) == typeid (getLookAndFeel()));
break;
case useLookAndFeelV2:
result.setInfo ("Use LookAndFeel_V2", String::empty, generalCategory, 0);
result.setTicked (typeid (LookAndFeel_V2) == typeid (getLookAndFeel()));
break;
case useLookAndFeelV3:
result.setInfo ("Use LookAndFeel_V3", String::empty, generalCategory, 0);
result.setTicked (typeid (LookAndFeel_V3) == typeid (getLookAndFeel()));
break;
case useNativeTitleBar:
result.setInfo ("Use native window title bar", String::empty, generalCategory, 0);
result.setTicked (mainWindow.isUsingNativeTitleBar());
break;
#if JUCE_MAC
case useNativeMenus:
result.setInfo ("Use the native OSX menu bar", String::empty, generalCategory, 0);
result.setTicked (MenuBarModel::getMacMainMenu() != 0);
break;
#endif
#if ! JUCE_LINUX
case goToKioskMode:
result.setInfo ("Show full-screen kiosk mode", String::empty, generalCategory, 0);
result.setTicked (Desktop::getInstance().getKioskModeComponent() != 0);
break;
#endif
default:
break;
};
}
// this is the ApplicationCommandTarget method that is used to actually perform one of our commands..
bool perform (const InvocationInfo& info)
{
switch (info.commandID)
{
case showRendering:
showDemo (createRenderingDemo());
currentDemoId = showRendering;
break;
case showFontsAndText:
showDemo (createFontsAndTextDemo());
currentDemoId = showFontsAndText;
break;
case showWidgets:
showDemo (createWidgetsDemo());
currentDemoId = showWidgets;
break;
case showThreading:
showDemo (createThreadingDemo());
currentDemoId = showThreading;
break;
case showTreeView:
showDemo (createTreeViewDemo());
currentDemoId = showTreeView;
break;
case showTable:
showDemo (createTableDemo());
currentDemoId = showTable;
break;
case showAudio:
showDemo (createAudioDemo());
currentDemoId = showAudio;
break;
case showDragAndDrop:
showDemo (createDragAndDropDemo());
currentDemoId = showDragAndDrop;
break;
case showOpenGL:
#if JUCE_OPENGL
setUsingOpenGLRenderer (false);
showDemo (createOpenGLDemo());
currentDemoId = showOpenGL;
#endif
break;
case showQuicktime:
#if JUCE_QUICKTIME && ! JUCE_LINUX
setUsingOpenGLRenderer (false);
showDemo (createQuickTimeDemo());
currentDemoId = showQuicktime;
#endif
break;
case showDirectShow:
#if JUCE_DIRECTSHOW
setUsingOpenGLRenderer (false);
showDemo (createDirectShowDemo());
currentDemoId = showDirectShow;
#endif
break;
case showCamera:
#if JUCE_USE_CAMERA
setUsingOpenGLRenderer (false);
showDemo (createCameraDemo());
currentDemoId = showCamera;
#endif
break;
case showWebBrowser:
#if JUCE_WEB_BROWSER
setUsingOpenGLRenderer (false);
showDemo (createWebBrowserDemo());
currentDemoId = showWebBrowser;
#endif
break;
case showCodeEditor:
showDemo (createCodeEditorDemo());
currentDemoId = showCodeEditor;
break;
case showInterprocessComms:
showDemo (createInterprocessCommsDemo());
currentDemoId = showInterprocessComms;
break;
case useLookAndFeelV1: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1); break;
case useLookAndFeelV2: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV2); break;
case useLookAndFeelV3: LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV3); break;
case useNativeTitleBar:
mainWindow.setUsingNativeTitleBar (! mainWindow.isUsingNativeTitleBar());
break;
#if JUCE_MAC
case useNativeMenus:
if (MenuBarModel::getMacMainMenu() != 0)
{
MenuBarModel::setMacMainMenu (0);
mainWindow.setMenuBar ((ContentComp*) mainWindow.getContentComponent());
}
else
{
MenuBarModel::setMacMainMenu ((ContentComp*) mainWindow.getContentComponent());
mainWindow.setMenuBar (0);
}
break;
#endif
#if ! JUCE_LINUX
case goToKioskMode:
{
Desktop& desktop = Desktop::getInstance();
if (desktop.getKioskModeComponent() == nullptr)
desktop.setKioskModeComponent (getTopLevelComponent());
else
desktop.setKioskModeComponent (nullptr);
break;
}
#endif
default:
return false;
};
return true;
}
private:
//==============================================================================
MainDemoWindow& mainWindow;
LookAndFeel_V1 lookAndFeelV1;
LookAndFeel_V2 lookAndFeelV2;
LookAndFeel_V3 lookAndFeelV3;
ScopedPointer<Component> currentDemo;
int currentDemoId;
#if JUCE_OPENGL
OpenGLContext openGLContext;
#endif
TooltipWindow tooltipWindow; // to add tooltips to an application, you
// just need to create one of these and leave it
// there to do its work..
//==============================================================================
StringArray getRenderingEngines()
{
StringArray renderingEngines (getPeer()->getAvailableRenderingEngines());
#if JUCE_OPENGL
renderingEngines.add ("Use OpenGL Renderer");
#endif
return renderingEngines;
}
//==============================================================================
enum CommandIDs
{
showRendering = 0x2000,
showFontsAndText = 0x2001,
showWidgets = 0x2002,
showThreading = 0x2003,
showTreeView = 0x2004,
showAudio = 0x2005,
showDragAndDrop = 0x2006,
showOpenGL = 0x2007,
showQuicktime = 0x2008,
showInterprocessComms = 0x2009,
showTable = 0x2010,
showCamera = 0x2011,
showWebBrowser = 0x2012,
showCodeEditor = 0x2013,
showDirectShow = 0x2014,
useLookAndFeelV1 = 0x2020,
useLookAndFeelV2 = 0x2021,
useLookAndFeelV3 = 0x2022,
useNativeTitleBar = 0x2023,
useNativeMenus = 0x2024,
goToKioskMode = 0x2025
};
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ContentComp)
};
//==============================================================================
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC
// Just add a simple icon to the Window system tray area..
class DemoTaskbarComponent : public SystemTrayIconComponent,
private Timer
{
public:
DemoTaskbarComponent()
{
setIconImage (createImageForIcon());
setIconTooltip ("Juce Demo App!");
}
Image createImageForIcon()
{
Image icon (Image::RGB, 32, 32, true);
Graphics g (icon);
// This draws an icon which is just a square with a "j" in it..
g.fillAll (Colours::lightblue);
g.setColour (Colours::black);
g.setFont (Font ((float) icon.getHeight(), Font::bold));
g.drawText ("j", 0, 0, icon.getWidth(), icon.getHeight(), Justification::centred, false);
return icon;
}
void mouseDown (const MouseEvent&) override
{
// On OSX, there can be problems launching a menu when we're not the foreground
// process, so just in case, we'll first make our process active, and then use a
// timer to wait a moment before opening our menu, which gives the OS some time to
// get its act together and bring our windows to the front.
Process::makeForegroundProcess();
startTimer (50);
}
void timerCallback() override
{
stopTimer();
PopupMenu m;
m.addItem (1, "Quit the Juce demo");
// It's always better to open menus asynchronously when possible.
m.showMenuAsync (PopupMenu::Options(),
ModalCallbackFunction::forComponent (menuInvocationCallback, this));
}
// This is invoked when the menu is clicked or dismissed
static void menuInvocationCallback (int chosenItemID, DemoTaskbarComponent*)
{
if (chosenItemID == 1)
JUCEApplication::getInstance()->systemRequestedQuit();
}
};
#endif
//==============================================================================
MainDemoWindow::MainDemoWindow()
: DocumentWindow ("JUCE Demo!",
Colours::azure,
DocumentWindow::allButtons,
true)
{
setResizable (true, false); // resizability is a property of ResizableWindow
setResizeLimits (400, 300, 8192, 8192);
ContentComp* contentComp = new ContentComp (*this);
commandManager.registerAllCommandsForTarget (contentComp);
commandManager.registerAllCommandsForTarget (JUCEApplication::getInstance());
// this lets the command manager use keypresses that arrive in our window to send
// out commands
addKeyListener (commandManager.getKeyMappings());
// sets the main content component for the window to be this tabbed
// panel. This will be deleted when the window is deleted.
setContentOwned (contentComp, false);
// this tells the DocumentWindow to automatically create and manage a MenuBarComponent
// which uses our contentComp as its MenuBarModel
setMenuBar (contentComp);
// tells our menu bar model that it should watch this command manager for
// changes, and send change messages accordingly.
contentComp->setApplicationCommandManagerToWatch (&commandManager);
setVisible (true);
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC
taskbarIcon = new DemoTaskbarComponent();
#endif
}
MainDemoWindow::~MainDemoWindow()
{
// because we've set the content comp to be used as our menu bar model, we
// have to switch this off before deleting the content comp..
setMenuBar (nullptr);
#if JUCE_MAC // ..and also the main bar if we're using that on a Mac...
MenuBarModel::setMacMainMenu (nullptr);
#endif
// clearing the content component will delete the current one, and
// that will in turn delete all its child components. You don't always
// have to do this explicitly, because the base class's destructor will
// also delete the content component, but in this case we need to
// make sure our content comp has gone away before deleting our command
// manager.
clearContentComponent();
}
void MainDemoWindow::closeButtonPressed()
{
// The correct thing to do when you want the app to quit is to call the
// JUCEApplication::systemRequestedQuit() method.
// That means that requests to quit that come from your own UI, or from other
// OS-specific sources (e.g. the dock menu on the mac) all get handled in the
// same way.
JUCEApplication::getInstance()->systemRequestedQuit();
}

+ 0
- 49
extras/JuceDemo/Source/MainDemoWindow.h View File

@@ -1,49 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __MAINDEMOWINDOW_JUCEHEADER__
#define __MAINDEMOWINDOW_JUCEHEADER__
//==============================================================================
class MainDemoWindow : public DocumentWindow
{
public:
//==============================================================================
MainDemoWindow();
~MainDemoWindow();
//==============================================================================
// called when the close button is pressed or esc is pushed
void closeButtonPressed();
// the command manager object used to dispatch command events
ApplicationCommandManager commandManager;
private:
ScopedPointer<Component> taskbarIcon;
};
#endif // __MAINDEMOWINDOW_JUCEHEADER__

+ 0
- 409
extras/JuceDemo/Source/demos/AudioDemoLatencyPage.cpp View File

@@ -1,409 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoLatencyPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//==============================================================================
class LatencyTester : public AudioIODeviceCallback,
public Timer
{
public:
LatencyTester (TextEditor* resultsBox_)
: testSound (1, 1),
recordedSound (1, 1),
playingSampleNum (0),
recordedSampleNum (-1),
sampleRate (0),
isRunning (false),
resultsBox (resultsBox_),
deviceInputLatency (0),
deviceOutputLatency (0)
{
}
//==============================================================================
void beginTest()
{
startTimer (50);
const ScopedLock sl (lock);
createTestSound();
recordedSound.clear();
playingSampleNum = recordedSampleNum = 0;
isRunning = true;
}
void timerCallback()
{
if (isRunning && recordedSampleNum >= recordedSound.getNumSamples())
{
isRunning = false;
stopTimer();
// Test has finished, so calculate the result..
String message;
const int latencySamples = calculateLatencySamples();
if (latencySamples >= 0)
{
message << "\n\nLatency test results:\n"
<< latencySamples << " samples (" << String (latencySamples * 1000.0 / sampleRate, 1) << " milliseconds)\n"
<< "The audio device reports an input latency of "
<< deviceInputLatency << " samples, output latency of "
<< deviceOutputLatency << " samples."
<< "\nSo the corrected latency = "
<< (latencySamples - deviceInputLatency - deviceOutputLatency)
<< " samples (" << String ((latencySamples - deviceInputLatency - deviceOutputLatency) * 1000.0 / sampleRate, 2)
<< " milliseconds)";
}
else
{
message = "\n\nCouldn't detect the test signal!!\nMake sure there's no background noise that might be confusing it..";
}
resultsBox->setCaretPosition (INT_MAX);
resultsBox->insertTextAtCaret (message);
resultsBox->setCaretPosition (INT_MAX);
}
}
//==============================================================================
void audioDeviceAboutToStart (AudioIODevice* device)
{
isRunning = false;
sampleRate = device->getCurrentSampleRate();
deviceInputLatency = device->getInputLatencyInSamples();
deviceOutputLatency = device->getOutputLatencyInSamples();
playingSampleNum = recordedSampleNum = 0;
recordedSound.setSize (1, (int) (1.5 * sampleRate));
recordedSound.clear();
}
void audioDeviceStopped()
{
}
void audioDeviceIOCallback (const float** inputChannelData,
int numInputChannels,
float** outputChannelData,
int numOutputChannels,
int numSamples)
{
const ScopedLock sl (lock);
if (isRunning)
{
float* const recordingBuffer = recordedSound.getSampleData (0, 0);
const float* const playBuffer = testSound.getSampleData (0, 0);
for (int i = 0; i < numSamples; ++i)
{
if (recordedSampleNum < recordedSound.getNumSamples())
{
float inputSamp = 0;
for (int j = numInputChannels; --j >= 0;)
if (inputChannelData[j] != 0)
inputSamp += inputChannelData[j][i];
recordingBuffer [recordedSampleNum] = inputSamp;
}
++recordedSampleNum;
float outputSamp = (playingSampleNum < testSound.getNumSamples()) ? playBuffer [playingSampleNum] : 0;
for (int j = numOutputChannels; --j >= 0;)
if (outputChannelData[j] != 0)
outputChannelData[j][i] = outputSamp;
++playingSampleNum;
}
}
else
{
// We need to clear the output buffers, in case they're full of junk..
for (int i = 0; i < numOutputChannels; ++i)
if (outputChannelData[i] != 0)
zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples);
}
}
private:
AudioSampleBuffer testSound, recordedSound;
int playingSampleNum, recordedSampleNum;
CriticalSection lock;
double sampleRate;
bool isRunning;
TextEditor* resultsBox;
int deviceInputLatency, deviceOutputLatency;
Array <int> spikes;
void createTestSound()
{
const int length = ((int) sampleRate) / 4;
testSound.setSize (1, length);
testSound.clear();
float* s = testSound.getSampleData (0, 0);
Random rand (0);
rand.setSeedRandomly();
for (int i = 0; i < length; ++i)
s[i] = (rand.nextFloat() - rand.nextFloat() + rand.nextFloat() - rand.nextFloat()) * 0.06f;
spikes.clear();
int spikePos = 0;
int spikeDelta = 50;
while (spikePos < length)
{
spikes.add (spikePos);
s [spikePos] = 0.99f;
s [spikePos + 1] = -0.99f;
spikePos += spikeDelta;
spikeDelta += spikeDelta / 6 + rand.nextInt (5);
}
}
// Searches a buffer for a set of spikes that matches those in the test sound
int findOffsetOfSpikes (const AudioSampleBuffer& buffer) const
{
const float minSpikeLevel = 5.0f;
const double smooth = 0.975;
const float* s = buffer.getSampleData (0, 0);
const int spikeDriftAllowed = 5;
Array <int> spikesFound;
spikesFound.ensureStorageAllocated (100);
double runningAverage = 0;
int lastSpike = 0;
for (int i = 0; i < buffer.getNumSamples() - 10; ++i)
{
const float samp = fabsf (s[i]);
if (samp > runningAverage * minSpikeLevel && i > lastSpike + 20)
{
lastSpike = i;
spikesFound.add (i);
}
runningAverage = runningAverage * smooth + (1.0 - smooth) * samp;
}
int bestMatch = -1;
int bestNumMatches = spikes.size() / 3; // the minimum number of matches required
if (spikesFound.size() < bestNumMatches)
return -1;
for (int offsetToTest = 0; offsetToTest < buffer.getNumSamples() - 2048; ++offsetToTest)
{
int numMatchesHere = 0;
int foundIndex = 0;
for (int refIndex = 0; refIndex < spikes.size(); ++refIndex)
{
const int referenceSpike = spikes.getUnchecked (refIndex) + offsetToTest;
int spike = 0;
while ((spike = spikesFound.getUnchecked (foundIndex)) < referenceSpike - spikeDriftAllowed
&& foundIndex < spikesFound.size() - 1)
++foundIndex;
if (spike >= referenceSpike - spikeDriftAllowed && spike <= referenceSpike + spikeDriftAllowed)
++numMatchesHere;
}
if (numMatchesHere > bestNumMatches)
{
bestNumMatches = numMatchesHere;
bestMatch = offsetToTest;
if (numMatchesHere == spikes.size())
break;
}
}
return bestMatch;
}
int calculateLatencySamples() const
{
// Detect the sound in both our test sound and the recording of it, and measure the difference
// in their start times..
const int referenceStart = findOffsetOfSpikes (testSound);
jassert (referenceStart >= 0);
const int recordedStart = findOffsetOfSpikes (recordedSound);
return (recordedStart < 0) ? -1 : (recordedStart - referenceStart);
}
LatencyTester (const LatencyTester&);
LatencyTester& operator= (const LatencyTester&);
};
//[/MiscUserDefs]
//==============================================================================
AudioDemoLatencyPage::AudioDemoLatencyPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_)
{
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
addAndMakeVisible (startTestButton = new TextButton (String::empty));
startTestButton->setButtonText ("Test Latency");
startTestButton->addListener (this);
addAndMakeVisible (testResultsBox = new TextEditor (String::empty));
testResultsBox->setMultiLine (true);
testResultsBox->setReturnKeyStartsNewLine (true);
testResultsBox->setReadOnly (true);
testResultsBox->setScrollbarsShown (true);
testResultsBox->setCaretVisible (false);
testResultsBox->setPopupMenuEnabled (true);
testResultsBox->setColour (TextEditor::backgroundColourId, Colour (0x32ffffff));
testResultsBox->setColour (TextEditor::outlineColourId, Colour (0x1c000000));
testResultsBox->setColour (TextEditor::shadowColourId, Colour (0x16000000));
testResultsBox->setText ("Running this test measures the round-trip latency between the audio output and input devices you\'ve got selected.\n\nIt\'ll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers...");
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
deviceManager.addAudioCallback (liveAudioDisplayComp);
latencyTester = new LatencyTester (testResultsBox);
deviceManager.addAudioCallback (latencyTester);
//[/Constructor]
}
AudioDemoLatencyPage::~AudioDemoLatencyPage()
{
//[Destructor_pre]. You can add your own custom destruction code here..
deviceManager.removeAudioCallback (liveAudioDisplayComp);
deviceManager.removeAudioCallback (latencyTester);
//[/Destructor_pre]
liveAudioDisplayComp = nullptr;
startTestButton = nullptr;
testResultsBox = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoLatencyPage::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::lightgrey);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoLatencyPage::resized()
{
liveAudioDisplayComp->setBounds (8, 8, getWidth() - 16, 64);
startTestButton->setBounds (8, getHeight() - 41, 168, 32);
testResultsBox->setBounds (8, 88, getWidth() - 16, getHeight() - 137);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
void AudioDemoLatencyPage::buttonClicked (Button* buttonThatWasClicked)
{
//[UserbuttonClicked_Pre]
//[/UserbuttonClicked_Pre]
if (buttonThatWasClicked == startTestButton)
{
//[UserButtonCode_startTestButton] -- add your button handler code here..
latencyTester->beginTest();
//[/UserButtonCode_startTestButton]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoLatencyPage" componentName=""
parentClasses="public Component" constructorParams="AudioDeviceManager&amp; deviceManager_"
variableInitialisers="deviceManager (deviceManager_)" snapPixels="8"
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffd3d3d3"/>
<GENERICCOMPONENT name="" id="7d70eb2617f56220" memberName="liveAudioDisplayComp"
virtualName="" explicitFocusOrder="0" pos="8 8 16M 64" class="LiveAudioInputDisplayComp"
params=""/>
<TEXTBUTTON name="" id="83ed8fcbf36419df" memberName="startTestButton" virtualName=""
explicitFocusOrder="0" pos="8 41R 168 32" buttonText="Test Latency"
connectedEdges="0" needsCallback="1" radioGroupId="0"/>
<TEXTEDITOR name="" id="95d03a8403bc35da" memberName="testResultsBox" virtualName=""
explicitFocusOrder="0" pos="8 88 16M 137M" bkgcol="32ffffff"
outlinecol="1c000000" shadowcol="16000000" initialText="Running this test measures the round-trip latency between the audio output and input devices you've got selected.&#10;&#10;It'll play a sound, then try to measure the time at which the sound arrives back at the audio input. Obviously for this to work you need to have your microphone somewhere near your speakers..."
multiline="1" retKeyStartsLine="1" readonly="1" scrollbars="1"
caret="0" popupmenu="1"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 76
extras/JuceDemo/Source/demos/AudioDemoLatencyPage.h View File

@@ -1,76 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_B6583AF122163F8__
#define __JUCE_HEADER_B6583AF122163F8__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
#include "AudioDemoTabComponent.h"
class LatencyTester;
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class AudioDemoLatencyPage : public Component,
public ButtonListener
{
public:
//==============================================================================
AudioDemoLatencyPage (AudioDeviceManager& deviceManager_);
~AudioDemoLatencyPage();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
void buttonClicked (Button* buttonThatWasClicked);
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager& deviceManager;
ScopedPointer<LatencyTester> latencyTester;
//[/UserVariables]
//==============================================================================
ScopedPointer<LiveAudioInputDisplayComp> liveAudioDisplayComp;
ScopedPointer<TextButton> startTestButton;
ScopedPointer<TextEditor> testResultsBox;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoLatencyPage)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_B6583AF122163F8__

+ 0
- 414
extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.cpp View File

@@ -1,414 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoPlaybackPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
class DemoThumbnailComp : public Component,
public ChangeListener,
public FileDragAndDropTarget,
private Timer
{
public:
DemoThumbnailComp (AudioFormatManager& formatManager,
AudioTransportSource& transportSource_,
Slider& zoomSlider_)
: transportSource (transportSource_),
zoomSlider (zoomSlider_),
thumbnailCache (5),
thumbnail (512, formatManager, thumbnailCache)
{
startTime = endTime = 0;
thumbnail.addChangeListener (this);
currentPositionMarker.setFill (Colours::purple.withAlpha (0.7f));
addAndMakeVisible (&currentPositionMarker);
}
~DemoThumbnailComp()
{
thumbnail.removeChangeListener (this);
}
void setFile (const File& file)
{
if (! file.isDirectory())
{
thumbnail.setSource (new FileInputSource (file));
startTime = 0;
endTime = thumbnail.getTotalLength();
startTimer (1000 / 40);
}
}
void setZoomFactor (double amount)
{
if (thumbnail.getTotalLength() > 0)
{
const double newScale = jmax (0.001, thumbnail.getTotalLength() * (1.0 - jlimit (0.0, 0.99, amount)));
const double timeAtCentre = xToTime (getWidth() / 2.0f);
startTime = timeAtCentre - newScale * 0.5;
endTime = timeAtCentre + newScale * 0.5;
repaint();
}
}
void mouseWheelMove (const MouseEvent&, const MouseWheelDetails& wheel) override
{
if (thumbnail.getTotalLength() > 0)
{
double newStart = startTime - wheel.deltaX * (endTime - startTime) / 10.0;
newStart = jlimit (0.0, jmax (0.0, thumbnail.getTotalLength() - (endTime - startTime)), newStart);
endTime = newStart + (endTime - startTime);
startTime = newStart;
if (wheel.deltaY != 0)
zoomSlider.setValue (zoomSlider.getValue() - wheel.deltaY);
repaint();
}
}
void paint (Graphics& g) override
{
g.fillAll (Colours::white);
g.setColour (Colours::lightblue);
if (thumbnail.getTotalLength() > 0)
{
thumbnail.drawChannels (g, getLocalBounds().reduced (2),
startTime, endTime, 1.0f);
}
else
{
g.setFont (14.0f);
g.drawFittedText ("(No audio file selected)", getLocalBounds(), Justification::centred, 2);
}
}
void changeListenerCallback (ChangeBroadcaster*) override
{
// this method is called by the thumbnail when it has changed, so we should repaint it..
repaint();
}
bool isInterestedInFileDrag (const StringArray& /*files*/) override
{
return true;
}
void filesDropped (const StringArray& files, int /*x*/, int /*y*/) override
{
AudioDemoPlaybackPage* demoPage = findParentComponentOfClass<AudioDemoPlaybackPage>();
if (demoPage != nullptr)
demoPage->showFile (File (files[0]));
}
void mouseDown (const MouseEvent& e) override
{
mouseDrag (e);
}
void mouseDrag (const MouseEvent& e) override
{
transportSource.setPosition (jmax (0.0, xToTime ((float) e.x)));
}
void mouseUp (const MouseEvent&) override
{
transportSource.start();
}
void timerCallback() override
{
currentPositionMarker.setVisible (transportSource.isPlaying() || isMouseButtonDown());
double currentPlayPosition = transportSource.getCurrentPosition();
currentPositionMarker.setRectangle (Rectangle<float> (timeToX (currentPlayPosition) - 0.75f, 0,
1.5f, (float) getHeight()));
}
private:
AudioTransportSource& transportSource;
Slider& zoomSlider;
AudioThumbnailCache thumbnailCache;
AudioThumbnail thumbnail;
double startTime, endTime;
DrawableRectangle currentPositionMarker;
float timeToX (const double time) const
{
return getWidth() * (float) ((time - startTime) / (endTime - startTime));
}
double xToTime (const float x) const
{
return (x / getWidth()) * (endTime - startTime) + startTime;
}
};
//[/MiscUserDefs]
//==============================================================================
AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_),
thread ("audio file preview"),
directoryList (nullptr, thread)
{
addAndMakeVisible (zoomLabel = new Label (String::empty,
"zoom:"));
zoomLabel->setFont (Font (15.00f, Font::plain));
zoomLabel->setJustificationType (Justification::centredRight);
zoomLabel->setEditable (false, false, false);
zoomLabel->setColour (TextEditor::textColourId, Colours::black);
zoomLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (explanation = new Label (String::empty,
"Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."));
explanation->setFont (Font (14.00f, Font::plain));
explanation->setJustificationType (Justification::bottomRight);
explanation->setEditable (false, false, false);
explanation->setColour (TextEditor::textColourId, Colours::black);
explanation->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (zoomSlider = new Slider (String::empty));
zoomSlider->setRange (0, 1, 0);
zoomSlider->setSliderStyle (Slider::LinearHorizontal);
zoomSlider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
zoomSlider->addListener (this);
zoomSlider->setSkewFactor (2);
addAndMakeVisible (thumbnail = new DemoThumbnailComp (formatManager, transportSource, *zoomSlider));
addAndMakeVisible (startStopButton = new TextButton (String::empty));
startStopButton->setButtonText ("Play/Stop");
startStopButton->addListener (this);
startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f));
addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
formatManager.registerBasicFormats();
directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);
thread.startThread (3);
fileTreeComp->setColour (FileTreeComponent::backgroundColourId, Colours::white);
fileTreeComp->addListener (this);
deviceManager.addAudioCallback (&audioSourcePlayer);
audioSourcePlayer.setSource (&transportSource);
//[/Constructor]
}
AudioDemoPlaybackPage::~AudioDemoPlaybackPage()
{
//[Destructor_pre]. You can add your own custom destruction code here..
transportSource.setSource (nullptr);
audioSourcePlayer.setSource (nullptr);
deviceManager.removeAudioCallback (&audioSourcePlayer);
fileTreeComp->removeListener (this);
//[/Destructor_pre]
zoomLabel = nullptr;
explanation = nullptr;
zoomSlider = nullptr;
thumbnail = nullptr;
startStopButton = nullptr;
fileTreeComp = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoPlaybackPage::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::lightgrey);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoPlaybackPage::resized()
{
zoomLabel->setBounds (16, getHeight() - 90, 55, 24);
explanation->setBounds (256, getHeight() - 82, getWidth() - 275, 64);
zoomSlider->setBounds (72, getHeight() - 90, 200, 24);
thumbnail->setBounds (16, getHeight() - 221, getWidth() - 32, 123);
startStopButton->setBounds (16, getHeight() - 46, 150, 32);
fileTreeComp->setBounds (16, 8, getWidth() - 32, getHeight() - 245);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
void AudioDemoPlaybackPage::sliderValueChanged (Slider* sliderThatWasMoved)
{
//[UsersliderValueChanged_Pre]
//[/UsersliderValueChanged_Pre]
if (sliderThatWasMoved == zoomSlider)
{
//[UserSliderCode_zoomSlider] -- add your slider handling code here..
thumbnail->setZoomFactor (zoomSlider->getValue());
//[/UserSliderCode_zoomSlider]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
void AudioDemoPlaybackPage::buttonClicked (Button* buttonThatWasClicked)
{
//[UserbuttonClicked_Pre]
//[/UserbuttonClicked_Pre]
if (buttonThatWasClicked == startStopButton)
{
//[UserButtonCode_startStopButton] -- add your button handler code here..
if (transportSource.isPlaying())
{
transportSource.stop();
}
else
{
transportSource.setPosition (0);
transportSource.start();
}
//[/UserButtonCode_startStopButton]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void AudioDemoPlaybackPage::showFile (const File& file)
{
loadFileIntoTransport (file);
zoomSlider->setValue (0, dontSendNotification);
thumbnail->setFile (file);
}
void AudioDemoPlaybackPage::loadFileIntoTransport (const File& audioFile)
{
// unload the previous file source and delete it..
transportSource.stop();
transportSource.setSource (nullptr);
currentAudioFileSource = nullptr;
AudioFormatReader* reader = formatManager.createReaderFor (audioFile);
if (reader != nullptr)
{
currentAudioFileSource = new AudioFormatReaderSource (reader, true);
// ..and plug it into our transport source
transportSource.setSource (currentAudioFileSource,
32768, // tells it to buffer this many samples ahead
&thread, // this is the background thread to use for reading-ahead
reader->sampleRate);
}
}
void AudioDemoPlaybackPage::selectionChanged()
{
showFile (fileTreeComp->getSelectedFile());
}
void AudioDemoPlaybackPage::fileClicked (const File&, const MouseEvent&)
{
}
void AudioDemoPlaybackPage::fileDoubleClicked (const File&)
{
}
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoPlaybackPage" componentName=""
parentClasses="public Component, public FileBrowserListener"
constructorParams="AudioDeviceManager&amp; deviceManager_" variableInitialisers="deviceManager (deviceManager_),&#10;thread (&quot;audio file preview&quot;),&#10;directoryList (nullptr, thread)"
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="0" initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffd3d3d3"/>
<LABEL name="" id="d4f78f975d81c8d3" memberName="zoomLabel" virtualName=""
explicitFocusOrder="0" pos="16 90R 55 24" edTextCol="ff000000"
edBkgCol="0" labelText="zoom:" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<LABEL name="" id="7db7d0a64ef21311" memberName="explanation" virtualName=""
explicitFocusOrder="0" pos="256 82R 275M 64" edTextCol="ff000000"
edBkgCol="0" labelText="Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."
editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0"
fontname="Default font" fontsize="14" bold="0" italic="0" justification="18"/>
<SLIDER name="" id="38bbc108f4c96092" memberName="zoomSlider" virtualName=""
explicitFocusOrder="0" pos="72 90R 200 24" min="0" max="1" int="0"
style="LinearHorizontal" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="2"/>
<GENERICCOMPONENT name="" id="beef657b0e007936" memberName="thumbnail" virtualName=""
explicitFocusOrder="0" pos="16 221R 32M 123" class="DemoThumbnailComp"
params="formatManager, transportSource, *zoomSlider"/>
<TEXTBUTTON name="" id="abe446e2f3f09420" memberName="startStopButton" virtualName=""
explicitFocusOrder="0" pos="16 46R 150 32" bgColOff="ff79ed7f"
buttonText="Play/Stop" connectedEdges="0" needsCallback="1" radioGroupId="0"/>
<GENERICCOMPONENT name="" id="1de1dc6a18a9032b" memberName="fileTreeComp" virtualName=""
explicitFocusOrder="0" pos="16 8 32M 245M" class="FileTreeComponent"
params="directoryList"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 96
extras/JuceDemo/Source/demos/AudioDemoPlaybackPage.h View File

@@ -1,96 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_AFB2CF84BB553F2A__
#define __JUCE_HEADER_AFB2CF84BB553F2A__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
class DemoThumbnailComp;
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class AudioDemoPlaybackPage : public Component,
public FileBrowserListener,
public SliderListener,
public ButtonListener
{
public:
//==============================================================================
AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_);
~AudioDemoPlaybackPage();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
// These methods are our FileBrowserListener implementation:
void selectionChanged();
void fileClicked (const File& file, const MouseEvent& e);
void fileDoubleClicked (const File& file);
void browserRootChanged (const File&) {}
void showFile (const File& file);
//[/UserMethods]
void paint (Graphics& g);
void resized();
void sliderValueChanged (Slider* sliderThatWasMoved);
void buttonClicked (Button* buttonThatWasClicked);
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager& deviceManager;
AudioFormatManager formatManager;
TimeSliceThread thread;
DirectoryContentsList directoryList;
AudioSourcePlayer audioSourcePlayer;
AudioTransportSource transportSource;
ScopedPointer<AudioFormatReaderSource> currentAudioFileSource;
void loadFileIntoTransport (const File& audioFile);
//[/UserVariables]
//==============================================================================
ScopedPointer<Label> zoomLabel;
ScopedPointer<Label> explanation;
ScopedPointer<Slider> zoomSlider;
ScopedPointer<DemoThumbnailComp> thumbnail;
ScopedPointer<TextButton> startStopButton;
ScopedPointer<FileTreeComponent> fileTreeComp;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoPlaybackPage)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_AFB2CF84BB553F2A__

+ 0
- 293
extras/JuceDemo/Source/demos/AudioDemoRecordPage.cpp View File

@@ -1,293 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoRecordPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//==============================================================================
/** A simple class that acts as an AudioIODeviceCallback and writes the
incoming audio data to a WAV file.
*/
class AudioRecorder : public AudioIODeviceCallback
{
public:
AudioRecorder()
: backgroundThread ("Audio Recorder Thread"),
sampleRate (0), activeWriter (0)
{
backgroundThread.startThread();
}
~AudioRecorder()
{
stop();
}
//==============================================================================
void startRecording (const File& file)
{
stop();
if (sampleRate > 0)
{
// Create an OutputStream to write to our destination file...
file.deleteFile();
ScopedPointer<FileOutputStream> fileStream (file.createOutputStream());
if (fileStream != 0)
{
// Now create a WAV writer object that writes to our output stream...
WavAudioFormat wavFormat;
AudioFormatWriter* writer = wavFormat.createWriterFor (fileStream, sampleRate, 1, 16, StringPairArray(), 0);
if (writer != 0)
{
fileStream.release(); // (passes responsibility for deleting the stream to the writer object that is now using it)
// Now we'll create one of these helper objects which will act as a FIFO buffer, and will
// write the data to disk on our background thread.
threadedWriter = new AudioFormatWriter::ThreadedWriter (writer, backgroundThread, 32768);
// And now, swap over our active writer pointer so that the audio callback will start using it..
const ScopedLock sl (writerLock);
activeWriter = threadedWriter;
}
}
}
}
void stop()
{
// First, clear this pointer to stop the audio callback from using our writer object..
{
const ScopedLock sl (writerLock);
activeWriter = 0;
}
// Now we can delete the writer object. It's done in this order because the deletion could
// take a little time while remaining data gets flushed to disk, so it's best to avoid blocking
// the audio callback while this happens.
threadedWriter = 0;
}
bool isRecording() const
{
return activeWriter != 0;
}
//==============================================================================
void audioDeviceAboutToStart (AudioIODevice* device)
{
sampleRate = device->getCurrentSampleRate();
}
void audioDeviceStopped()
{
sampleRate = 0;
}
void audioDeviceIOCallback (const float** inputChannelData, int /*numInputChannels*/,
float** outputChannelData, int numOutputChannels,
int numSamples)
{
const ScopedLock sl (writerLock);
if (activeWriter != 0)
activeWriter->write (inputChannelData, numSamples);
// We need to clear the output buffers, in case they're full of junk..
for (int i = 0; i < numOutputChannels; ++i)
if (outputChannelData[i] != 0)
zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples);
}
private:
TimeSliceThread backgroundThread; // the thread that will write our audio data to disk
ScopedPointer<AudioFormatWriter::ThreadedWriter> threadedWriter; // the FIFO used to buffer the incoming data
double sampleRate;
CriticalSection writerLock;
AudioFormatWriter::ThreadedWriter* volatile activeWriter;
};
//[/MiscUserDefs]
//==============================================================================
AudioDemoRecordPage::AudioDemoRecordPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_)
{
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
addAndMakeVisible (explanationLabel = new Label (String::empty,
"This page demonstrates how to record a wave file from the live audio input..\n\nPressing record will start recording a file in your \"Documents\" folder."));
explanationLabel->setFont (Font (15.00f, Font::plain));
explanationLabel->setJustificationType (Justification::topLeft);
explanationLabel->setEditable (false, false, false);
explanationLabel->setColour (TextEditor::textColourId, Colours::black);
explanationLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (recordButton = new TextButton (String::empty));
recordButton->setButtonText ("Record");
recordButton->addListener (this);
recordButton->setColour (TextButton::buttonColourId, Colour (0xffff5c5c));
recordButton->setColour (TextButton::textColourOnId, Colours::black);
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
recorder = new AudioRecorder();
deviceManager.addAudioCallback (recorder);
deviceManager.addAudioCallback (liveAudioDisplayComp);
//[/Constructor]
}
AudioDemoRecordPage::~AudioDemoRecordPage()
{
//[Destructor_pre]. You can add your own custom destruction code here..
deviceManager.removeAudioCallback (recorder);
deviceManager.removeAudioCallback (liveAudioDisplayComp);
recorder = 0;
//[/Destructor_pre]
liveAudioDisplayComp = nullptr;
explanationLabel = nullptr;
recordButton = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoRecordPage::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::lightgrey);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoRecordPage::resized()
{
liveAudioDisplayComp->setBounds (8, 8, getWidth() - 16, 64);
explanationLabel->setBounds (160, 88, getWidth() - 169, 216);
recordButton->setBounds (8, 88, 136, 40);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
void AudioDemoRecordPage::buttonClicked (Button* buttonThatWasClicked)
{
//[UserbuttonClicked_Pre]
//[/UserbuttonClicked_Pre]
if (buttonThatWasClicked == recordButton)
{
//[UserButtonCode_recordButton] -- add your button handler code here..
if (recorder->isRecording())
{
recorder->stop();
}
else
{
File file (File::getSpecialLocation (File::userDocumentsDirectory)
.getNonexistentChildFile ("Juce Demo Audio Recording", ".wav"));
recorder->startRecording (file);
}
if (recorder->isRecording())
recordButton->setButtonText ("Stop");
else
recordButton->setButtonText ("Record");
//[/UserButtonCode_recordButton]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
}
void AudioDemoRecordPage::visibilityChanged()
{
//[UserCode_visibilityChanged] -- Add your code here...
recorder->stop();
recordButton->setButtonText ("Record");
//[/UserCode_visibilityChanged]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoRecordPage" componentName=""
parentClasses="public Component" constructorParams="AudioDeviceManager&amp; deviceManager_"
variableInitialisers="deviceManager (deviceManager_)" snapPixels="8"
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
initialWidth="600" initialHeight="400">
<METHODS>
<METHOD name="visibilityChanged()"/>
</METHODS>
<BACKGROUND backgroundColour="ffd3d3d3"/>
<GENERICCOMPONENT name="" id="7d70eb2617f56220" memberName="liveAudioDisplayComp"
virtualName="" explicitFocusOrder="0" pos="8 8 16M 64" class="LiveAudioInputDisplayComp"
params=""/>
<LABEL name="" id="1162fb2599a768b4" memberName="explanationLabel" virtualName=""
explicitFocusOrder="0" pos="160 88 169M 216" edTextCol="ff000000"
edBkgCol="0" labelText="This page demonstrates how to record a wave file from the live audio input..&#10;&#10;Pressing record will start recording a file in your &quot;Documents&quot; folder."
editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0"
fontname="Default font" fontsize="15" bold="0" italic="0" justification="9"/>
<TEXTBUTTON name="" id="2c10a0ba9fad39da" memberName="recordButton" virtualName=""
explicitFocusOrder="0" pos="8 88 136 40" bgColOff="ffff5c5c"
textCol="ff000000" buttonText="Record" connectedEdges="0" needsCallback="1"
radioGroupId="0"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 77
extras/JuceDemo/Source/demos/AudioDemoRecordPage.h View File

@@ -1,77 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_F15E29646987960A__
#define __JUCE_HEADER_F15E29646987960A__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
#include "AudioDemoTabComponent.h"
class AudioRecorder;
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class AudioDemoRecordPage : public Component,
public ButtonListener
{
public:
//==============================================================================
AudioDemoRecordPage (AudioDeviceManager& deviceManager_);
~AudioDemoRecordPage();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
void buttonClicked (Button* buttonThatWasClicked);
void visibilityChanged();
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager& deviceManager;
ScopedPointer<AudioRecorder> recorder;
//[/UserVariables]
//==============================================================================
ScopedPointer<LiveAudioInputDisplayComp> liveAudioDisplayComp;
ScopedPointer<Label> explanationLabel;
ScopedPointer<TextButton> recordButton;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoRecordPage)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_F15E29646987960A__

+ 0
- 109
extras/JuceDemo/Source/demos/AudioDemoSetupPage.cpp View File

@@ -1,109 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoSetupPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
//==============================================================================
AudioDemoSetupPage::AudioDemoSetupPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_)
{
addAndMakeVisible (deviceSelector = new AudioDeviceSelectorComponent (deviceManager, 0, 2, 0, 2, true, true, true, false));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
AudioDemoSetupPage::~AudioDemoSetupPage()
{
//[Destructor_pre]. You can add your own custom destruction code here..
//[/Destructor_pre]
deviceSelector = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoSetupPage::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::lightgrey);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoSetupPage::resized()
{
deviceSelector->setBounds (8, 8, getWidth() - 16, getHeight() - 16);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoSetupPage" componentName=""
parentClasses="public Component" constructorParams="AudioDeviceManager&amp; deviceManager_"
variableInitialisers="deviceManager (deviceManager_)" snapPixels="8"
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffd3d3d3"/>
<GENERICCOMPONENT name="" id="a04c56de9f3fc537" memberName="deviceSelector" virtualName=""
explicitFocusOrder="0" pos="8 8 16M 16M" class="AudioDeviceSelectorComponent"
params="deviceManager, 0, 2, 0, 2, true, true, true, false"/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 69
extras/JuceDemo/Source/demos/AudioDemoSetupPage.h View File

@@ -1,69 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_EF8CB39C6E013E02__
#define __JUCE_HEADER_EF8CB39C6E013E02__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class AudioDemoSetupPage : public Component
{
public:
//==============================================================================
AudioDemoSetupPage (AudioDeviceManager& deviceManager_);
~AudioDemoSetupPage();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager& deviceManager;
//[/UserVariables]
//==============================================================================
ScopedPointer<AudioDeviceSelectorComponent> deviceSelector;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoSetupPage)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_EF8CB39C6E013E02__

+ 0
- 387
extras/JuceDemo/Source/demos/AudioDemoSynthPage.cpp View File

@@ -1,387 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoSynthPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
//==============================================================================
/** Our demo synth sound is just a basic sine wave..
*/
class SineWaveSound : public SynthesiserSound
{
public:
SineWaveSound()
{
}
bool appliesToNote (const int /*midiNoteNumber*/) { return true; }
bool appliesToChannel (const int /*midiChannel*/) { return true; }
};
//==============================================================================
/** Our demo synth voice just plays a sine wave..
*/
class SineWaveVoice : public SynthesiserVoice
{
public:
SineWaveVoice()
: currentAngle (0), angleDelta (0), level (0), tailOff (0)
{
}
bool canPlaySound (SynthesiserSound* sound)
{
return dynamic_cast<SineWaveSound*> (sound) != 0;
}
void startNote (int midiNoteNumber, float velocity,
SynthesiserSound*, int /*currentPitchWheelPosition*/)
{
currentAngle = 0.0;
level = velocity * 0.15;
tailOff = 0.0;
double cyclesPerSecond = MidiMessage::getMidiNoteInHertz (midiNoteNumber);
double cyclesPerSample = cyclesPerSecond / getSampleRate();
angleDelta = cyclesPerSample * 2.0 * double_Pi;
}
void stopNote (bool allowTailOff)
{
if (allowTailOff)
{
// start a tail-off by setting this flag. The render callback will pick up on
// this and do a fade out, calling clearCurrentNote() when it's finished.
if (tailOff == 0.0) // we only need to begin a tail-off if it's not already doing so - the
// stopNote method could be called more than once.
tailOff = 1.0;
}
else
{
// we're being told to stop playing immediately, so reset everything..
clearCurrentNote();
angleDelta = 0.0;
}
}
void pitchWheelMoved (int /*newValue*/)
{
// can't be bothered implementing this for the demo!
}
void controllerMoved (int /*controllerNumber*/, int /*newValue*/)
{
// not interested in controllers in this case.
}
void renderNextBlock (AudioSampleBuffer& outputBuffer, int startSample, int numSamples)
{
if (angleDelta != 0.0)
{
if (tailOff > 0)
{
while (--numSamples >= 0)
{
const float currentSample = (float) (sin (currentAngle) * level * tailOff);
for (int i = outputBuffer.getNumChannels(); --i >= 0;)
*outputBuffer.getSampleData (i, startSample) += currentSample;
currentAngle += angleDelta;
++startSample;
tailOff *= 0.99;
if (tailOff <= 0.005)
{
clearCurrentNote();
angleDelta = 0.0;
break;
}
}
}
else
{
while (--numSamples >= 0)
{
const float currentSample = (float) (sin (currentAngle) * level);
for (int i = outputBuffer.getNumChannels(); --i >= 0;)
*outputBuffer.getSampleData (i, startSample) += currentSample;
currentAngle += angleDelta;
++startSample;
}
}
}
}
private:
double currentAngle, angleDelta, level, tailOff;
};
// This is an audio source that streams the output of our demo synth.
class SynthAudioSource : public AudioSource
{
public:
//==============================================================================
// this collects real-time midi messages from the midi input device, and
// turns them into blocks that we can process in our audio callback
MidiMessageCollector midiCollector;
// this represents the state of which keys on our on-screen keyboard are held
// down. When the mouse is clicked on the keyboard component, this object also
// generates midi messages for this, which we can pass on to our synth.
MidiKeyboardState& keyboardState;
// the synth itself!
Synthesiser synth;
//==============================================================================
SynthAudioSource (MidiKeyboardState& keyboardState_)
: keyboardState (keyboardState_)
{
// add some voices to our synth, to play the sounds..
for (int i = 4; --i >= 0;)
{
synth.addVoice (new SineWaveVoice()); // These voices will play our custom sine-wave sounds..
synth.addVoice (new SamplerVoice()); // and these ones play the sampled sounds
}
// and add some sounds for them to play...
setUsingSineWaveSound();
}
void setUsingSineWaveSound()
{
synth.clearSounds();
synth.addSound (new SineWaveSound());
}
void setUsingSampledSound()
{
synth.clearSounds();
WavAudioFormat wavFormat;
ScopedPointer<AudioFormatReader> audioReader (wavFormat.createReaderFor (new MemoryInputStream (BinaryData::cello_wav,
BinaryData::cello_wavSize,
false),
true));
BigInteger allNotes;
allNotes.setRange (0, 128, true);
synth.addSound (new SamplerSound ("demo sound",
*audioReader,
allNotes,
74, // root midi note
0.1, // attack time
0.1, // release time
10.0 // maximum sample length
));
}
void prepareToPlay (int /*samplesPerBlockExpected*/, double sampleRate)
{
midiCollector.reset (sampleRate);
synth.setCurrentPlaybackSampleRate (sampleRate);
}
void releaseResources()
{
}
void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill)
{
// the synth always adds its output to the audio buffer, so we have to clear it
// first..
bufferToFill.clearActiveBufferRegion();
// fill a midi buffer with incoming messages from the midi input.
MidiBuffer incomingMidi;
midiCollector.removeNextBlockOfMessages (incomingMidi, bufferToFill.numSamples);
// pass these messages to the keyboard state so that it can update the component
// to show on-screen which keys are being pressed on the physical midi keyboard.
// This call will also add midi messages to the buffer which were generated by
// the mouse-clicking on the on-screen keyboard.
keyboardState.processNextMidiBuffer (incomingMidi, 0, bufferToFill.numSamples, true);
// and now get the synth to process the midi events and generate its output.
synth.renderNextBlock (*bufferToFill.buffer, incomingMidi, 0, bufferToFill.numSamples);
}
};
//[/MiscUserDefs]
//==============================================================================
AudioDemoSynthPage::AudioDemoSynthPage (AudioDeviceManager& deviceManager_)
: deviceManager (deviceManager_)
{
addAndMakeVisible (keyboardComponent = new MidiKeyboardComponent (keyboardState, MidiKeyboardComponent::horizontalKeyboard));
addAndMakeVisible (sineButton = new ToggleButton (String::empty));
sineButton->setButtonText ("Use sine wave");
sineButton->setRadioGroupId (321);
sineButton->addListener (this);
sineButton->setToggleState (true, dontSendNotification);
addAndMakeVisible (sampledButton = new ToggleButton (String::empty));
sampledButton->setButtonText ("Use sampled sound");
sampledButton->setRadioGroupId (321);
sampledButton->addListener (this);
addAndMakeVisible (liveAudioDisplayComp = new LiveAudioInputDisplayComp());
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
deviceManager.addAudioCallback (liveAudioDisplayComp);
synthAudioSource = new SynthAudioSource (keyboardState);
audioSourcePlayer.setSource (synthAudioSource);
deviceManager.addAudioCallback (&audioSourcePlayer);
deviceManager.addMidiInputCallback (String::empty, &(synthAudioSource->midiCollector));
//[/Constructor]
}
AudioDemoSynthPage::~AudioDemoSynthPage()
{
//[Destructor_pre]. You can add your own custom destruction code here..
audioSourcePlayer.setSource (0);
deviceManager.removeMidiInputCallback (String::empty, &(synthAudioSource->midiCollector));
deviceManager.removeAudioCallback (&audioSourcePlayer);
deviceManager.removeAudioCallback (liveAudioDisplayComp);
//[/Destructor_pre]
keyboardComponent = nullptr;
sineButton = nullptr;
sampledButton = nullptr;
liveAudioDisplayComp = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoSynthPage::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::lightgrey);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoSynthPage::resized()
{
keyboardComponent->setBounds (8, 96, getWidth() - 16, 64);
sineButton->setBounds (16, 176, 150, 24);
sampledButton->setBounds (16, 200, 150, 24);
liveAudioDisplayComp->setBounds (8, 8, getWidth() - 16, 64);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
void AudioDemoSynthPage::buttonClicked (Button* buttonThatWasClicked)
{
//[UserbuttonClicked_Pre]
//[/UserbuttonClicked_Pre]
if (buttonThatWasClicked == sineButton)
{
//[UserButtonCode_sineButton] -- add your button handler code here..
synthAudioSource->setUsingSineWaveSound();
//[/UserButtonCode_sineButton]
}
else if (buttonThatWasClicked == sampledButton)
{
//[UserButtonCode_sampledButton] -- add your button handler code here..
synthAudioSource->setUsingSampledSound();
//[/UserButtonCode_sampledButton]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoSynthPage" componentName=""
parentClasses="public Component" constructorParams="AudioDeviceManager&amp; deviceManager_"
variableInitialisers="deviceManager (deviceManager_)" snapPixels="8"
snapActive="1" snapShown="1" overlayOpacity="0.330" fixedSize="0"
initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffd3d3d3"/>
<GENERICCOMPONENT name="" id="86605ec4f02c4320" memberName="keyboardComponent"
virtualName="" explicitFocusOrder="0" pos="8 96 16M 64" class="MidiKeyboardComponent"
params="keyboardState, MidiKeyboardComponent::horizontalKeyboard"/>
<TOGGLEBUTTON name="" id="d75101df45006ba9" memberName="sineButton" virtualName=""
explicitFocusOrder="0" pos="16 176 150 24" buttonText="Use sine wave"
connectedEdges="0" needsCallback="1" radioGroupId="321" state="1"/>
<TOGGLEBUTTON name="" id="2d687b4ac3dad628" memberName="sampledButton" virtualName=""
explicitFocusOrder="0" pos="16 200 150 24" buttonText="Use sampled sound"
connectedEdges="0" needsCallback="1" radioGroupId="321" state="0"/>
<GENERICCOMPONENT name="" id="7d70eb2617f56220" memberName="liveAudioDisplayComp"
virtualName="" explicitFocusOrder="0" pos="8 8 16M 64" class="LiveAudioInputDisplayComp"
params=""/>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 79
extras/JuceDemo/Source/demos/AudioDemoSynthPage.h View File

@@ -1,79 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_2088E4B04AA3CC14__
#define __JUCE_HEADER_2088E4B04AA3CC14__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
#include "AudioDemoTabComponent.h"
class SynthAudioSource;
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class AudioDemoSynthPage : public Component,
public ButtonListener
{
public:
//==============================================================================
AudioDemoSynthPage (AudioDeviceManager& deviceManager_);
~AudioDemoSynthPage();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
void buttonClicked (Button* buttonThatWasClicked);
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager& deviceManager;
MidiKeyboardState keyboardState;
AudioSourcePlayer audioSourcePlayer;
ScopedPointer<SynthAudioSource> synthAudioSource;
//[/UserVariables]
//==============================================================================
ScopedPointer<MidiKeyboardComponent> keyboardComponent;
ScopedPointer<ToggleButton> sineButton;
ScopedPointer<ToggleButton> sampledButton;
ScopedPointer<LiveAudioInputDisplayComp> liveAudioDisplayComp;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoSynthPage)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_2088E4B04AA3CC14__

+ 0
- 218
extras/JuceDemo/Source/demos/AudioDemoTabComponent.cpp View File

@@ -1,218 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
//[Headers] You can add your own extra header files here...
//[/Headers]
#include "AudioDemoTabComponent.h"
#include "AudioDemoSetupPage.h"
#include "AudioDemoPlaybackPage.h"
#include "AudioDemoSynthPage.h"
#include "AudioDemoLatencyPage.h"
#include "AudioDemoRecordPage.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
LiveAudioInputDisplayComp::LiveAudioInputDisplayComp()
{
nextSample = subSample = 0;
accumulator = 0;
zeromem (samples, sizeof (samples));
setOpaque (true);
startTimer (1000 / 50); // use a timer to keep repainting this component
}
LiveAudioInputDisplayComp::~LiveAudioInputDisplayComp()
{
}
void LiveAudioInputDisplayComp::paint (Graphics& g)
{
RectangleList<float> waveform;
const float midY = getHeight() * 0.5f;
int sampleNum = (nextSample + numElementsInArray (samples) - 1);
for (int x = jmin (getWidth(), (int) numElementsInArray (samples)); --x >= 0;)
{
const float sampleSize = midY * samples [sampleNum-- % numElementsInArray (samples)];
waveform.addWithoutMerging (Rectangle<float> ((float) x, midY - sampleSize, 1.0f, sampleSize * 2.0f));
}
g.fillAll (Colours::black);
g.setColour (Colours::green);
g.fillRectList (waveform);
}
void LiveAudioInputDisplayComp::timerCallback()
{
repaint();
}
void LiveAudioInputDisplayComp::audioDeviceAboutToStart (AudioIODevice*)
{
zeromem (samples, sizeof (samples));
}
void LiveAudioInputDisplayComp::audioDeviceStopped()
{
zeromem (samples, sizeof (samples));
}
void LiveAudioInputDisplayComp::audioDeviceIOCallback (const float** inputChannelData, int numInputChannels,
float** outputChannelData, int numOutputChannels, int numSamples)
{
for (int i = 0; i < numSamples; ++i)
{
for (int chan = 0; chan < numInputChannels; ++chan)
{
if (inputChannelData[chan] != 0)
accumulator += fabsf (inputChannelData[chan][i]);
}
const int numSubSamples = 100; // how many input samples go onto one pixel.
const float boost = 10.0f; // how much to boost the levels to make it more visible.
if (subSample == 0)
{
samples[nextSample] = accumulator * boost / numSubSamples;
nextSample = (nextSample + 1) % numElementsInArray (samples);
subSample = numSubSamples;
accumulator = 0;
}
else
{
--subSample;
}
}
// We need to clear the output buffers, in case they're full of junk..
for (int i = 0; i < numOutputChannels; ++i)
if (outputChannelData[i] != 0)
zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples);
}
//[/MiscUserDefs]
//==============================================================================
AudioDemoTabComponent::AudioDemoTabComponent ()
{
addAndMakeVisible (tabbedComponent = new TabbedComponent (TabbedButtonBar::TabsAtTop));
tabbedComponent->setTabBarDepth (30);
tabbedComponent->addTab ("Audio Device Setup", Colours::lightgrey, new AudioDemoSetupPage (deviceManager), true);
tabbedComponent->addTab ("File Playback", Colours::lightgrey, new AudioDemoPlaybackPage (deviceManager), true);
tabbedComponent->addTab ("Synth Playback", Colours::lightgrey, new AudioDemoSynthPage (deviceManager), true);
tabbedComponent->addTab ("Latency Test", Colours::lightgrey, new AudioDemoLatencyPage (deviceManager), true);
tabbedComponent->addTab ("Recording", Colours::lightgrey, new AudioDemoRecordPage (deviceManager), true);
tabbedComponent->setCurrentTabIndex (0);
//[UserPreSize]
deviceManager.initialise (2, 2, 0, true, String::empty, 0);
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
AudioDemoTabComponent::~AudioDemoTabComponent()
{
//[Destructor_pre]. You can add your own custom destruction code here..
//[/Destructor_pre]
tabbedComponent = nullptr;
//[Destructor]. You can add your own custom destruction code here..
//[/Destructor]
}
//==============================================================================
void AudioDemoTabComponent::paint (Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.fillAll (Colours::white);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
}
void AudioDemoTabComponent::resized()
{
tabbedComponent->setBounds (0, 0, getWidth() - 0, getHeight() - 0);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
//==============================================================================
Component* createAudioDemo()
{
return new AudioDemoTabComponent();
}
//[/MiscUserCode]
//==============================================================================
#if 0
/* -- Introjucer information section --
This is where the Introjucer stores the metadata that describe this GUI layout, so
make changes in here at your peril!
BEGIN_JUCER_METADATA
<JUCER_COMPONENT documentType="Component" className="AudioDemoTabComponent" componentName=""
parentClasses="public Component" constructorParams="" variableInitialisers=""
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="0" initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="ffffffff"/>
<TABBEDCOMPONENT name="new tabbed component" id="83c980d7793cdced" memberName="tabbedComponent"
virtualName="" explicitFocusOrder="0" pos="0 0 0M 0M" orientation="top"
tabBarDepth="30" initialTab="0">
<TAB name="Audio Device Setup" colour="ffd3d3d3" useJucerComp="1"
contentClassName="" constructorParams="deviceManager" jucerComponentFile="AudioDemoSetupPage.cpp"/>
<TAB name="File Playback" colour="ffd3d3d3" useJucerComp="1" contentClassName=""
constructorParams="deviceManager" jucerComponentFile="AudioDemoPlaybackPage.cpp"/>
<TAB name="Synth Playback" colour="ffd3d3d3" useJucerComp="1" contentClassName=""
constructorParams="deviceManager" jucerComponentFile="AudioDemoSynthPage.cpp"/>
<TAB name="Latency Test" colour="ffd3d3d3" useJucerComp="1" contentClassName=""
constructorParams="deviceManager" jucerComponentFile="AudioDemoLatencyPage.cpp"/>
<TAB name="Recording" colour="ffd3d3d3" useJucerComp="1" contentClassName=""
constructorParams="deviceManager" jucerComponentFile="AudioDemoRecordPage.cpp"/>
</TABBEDCOMPONENT>
</JUCER_COMPONENT>
END_JUCER_METADATA
*/
#endif
//[EndFile] You can add extra defines here...
//[/EndFile]

+ 0
- 99
extras/JuceDemo/Source/demos/AudioDemoTabComponent.h View File

@@ -1,99 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_6B066C3EF65F4A5E__
#define __JUCE_HEADER_6B066C3EF65F4A5E__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
//==============================================================================
/* This component scrolls a continuous waveform showing the audio that's currently
coming into the audio input.
*/
class LiveAudioInputDisplayComp : public Component,
public AudioIODeviceCallback,
public Timer
{
public:
//==============================================================================
LiveAudioInputDisplayComp();
~LiveAudioInputDisplayComp();
void paint (Graphics& g);
void timerCallback();
void audioDeviceAboutToStart (AudioIODevice* device);
void audioDeviceStopped();
void audioDeviceIOCallback (const float** inputChannelData, int numInputChannels,
float** outputChannelData, int numOutputChannels, int numSamples);
private:
float samples [1024];
int nextSample, subSample;
float accumulator;
LiveAudioInputDisplayComp (const LiveAudioInputDisplayComp&);
LiveAudioInputDisplayComp& operator= (const LiveAudioInputDisplayComp&);
};
//[/Headers]
//==============================================================================
/**
//[Comments]
This component creates the set of tabs that hold the various
audio demo pages..
//[/Comments]
*/
class AudioDemoTabComponent : public Component
{
public:
//==============================================================================
AudioDemoTabComponent ();
~AudioDemoTabComponent();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
private:
//[UserVariables] -- You can add your own custom variables in this section.
AudioDeviceManager deviceManager;
//[/UserVariables]
//==============================================================================
ScopedPointer<TabbedComponent> tabbedComponent;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDemoTabComponent)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_6B066C3EF65F4A5E__

+ 0
- 190
extras/JuceDemo/Source/demos/CameraDemo.cpp View File

@@ -1,190 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_USE_CAMERA
//==============================================================================
class CameraDemo : public Component,
public ComboBoxListener,
public ButtonListener,
public CameraDevice::Listener
{
public:
//==============================================================================
CameraDemo()
: cameraSelectorComboBox ("Camera"),
snapshotButton ("Take a snapshot"),
recordMovieButton ("Record a movie file (to your desktop)..."),
recordingMovie (false)
{
setName ("Camera");
addAndMakeVisible (&cameraSelectorComboBox);
createListOfCameras();
cameraSelectorComboBox.setSelectedId (1);
cameraSelectorComboBox.addListener (this);
addAndMakeVisible (&snapshotButton);
snapshotButton.addListener (this);
snapshotButton.setEnabled (false);
addAndMakeVisible (&recordMovieButton);
recordMovieButton.addListener (this);
recordMovieButton.setEnabled (false);
cameraSelectorComboBox.setSelectedId (2);
}
~CameraDemo()
{
}
void paint (Graphics& g)
{
g.drawImageWithin (lastSnapshot,
getWidth() / 2 + 10, 40,
getWidth() / 2 - 20, getHeight() - 50,
RectanglePlacement::centred, false);
}
void resized()
{
cameraSelectorComboBox.setBounds (10, 4, 250, 24);
snapshotButton.changeWidthToFitText (24);
snapshotButton.setTopLeftPosition (cameraSelectorComboBox.getRight() + 20, 4);
recordMovieButton.changeWidthToFitText (24);
recordMovieButton.setTopLeftPosition (snapshotButton.getRight() + 20, 4);
if (cameraPreviewComp != 0)
cameraPreviewComp->setBounds (10, 40, getWidth() / 2 - 20, getHeight() - 50);
}
void comboBoxChanged (ComboBox*)
{
// This is called when the user chooses a camera from the drop-down list.
cameraDevice = 0;
cameraPreviewComp = 0;
recordingMovie = false;
if (cameraSelectorComboBox.getSelectedId() > 1)
{
// Try to open the user's choice of camera..
cameraDevice = CameraDevice::openDevice (cameraSelectorComboBox.getSelectedId() - 2);
// and if it worked, create a preview component for it..
if (cameraDevice != 0)
addAndMakeVisible (cameraPreviewComp = cameraDevice->createViewerComponent());
}
snapshotButton.setEnabled (cameraDevice != 0);
recordMovieButton.setEnabled (cameraDevice != 0);
resized();
}
void createListOfCameras()
{
cameraSelectorComboBox.clear();
cameraSelectorComboBox.addItem ("No camera", 1);
cameraSelectorComboBox.addSeparator();
StringArray cameras = CameraDevice::getAvailableDevices();
for (int i = 0; i < cameras.size(); ++i)
cameraSelectorComboBox.addItem (cameras[i], i + 2);
}
void buttonClicked (Button* b)
{
if (cameraDevice != 0)
{
if (b == &recordMovieButton)
{
// The user has clicked the record movie button..
if (! recordingMovie)
{
// Start recording to a file on the user's desktop..
recordingMovie = true;
File file (File::getSpecialLocation (File::userDesktopDirectory)
.getNonexistentChildFile ("JuceCameraDemo",
CameraDevice::getFileExtension()));
cameraDevice->startRecordingToFile (file);
recordMovieButton.setButtonText ("Stop Recording");
}
else
{
// Already recording, so stop...
recordingMovie = false;
cameraDevice->stopRecording();
recordMovieButton.setButtonText ("Start recording (to a file on your desktop)");
}
}
else
{
// When the user clicks the snapshot button, we'll attach ourselves to
// the camera as a listener, and wait for an image to arrive...
cameraDevice->addListener (this);
}
}
}
// This is called by the camera device when a new image arrives
void imageReceived (const Image& image)
{
// In this app we just want to take one image, so as soon as this happens,
// we'll unregister ourselves as a listener.
if (cameraDevice != 0)
cameraDevice->removeListener (this);
// This callback won't be on the message thread, so need to lock it before using
// data that may already be in use..
const MessageManagerLock mm;
lastSnapshot = image;
repaint();
}
private:
//==============================================================================
ScopedPointer<CameraDevice> cameraDevice;
ScopedPointer<Component> cameraPreviewComp;
Image lastSnapshot;
ComboBox cameraSelectorComboBox;
TextButton snapshotButton;
TextButton recordMovieButton;
bool recordingMovie;
};
//==============================================================================
Component* createCameraDemo()
{
return new CameraDemo();
}
#endif

+ 0
- 92
extras/JuceDemo/Source/demos/CodeEditorDemo.cpp View File

@@ -1,92 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
class CodeEditorDemo : public Component,
public FilenameComponentListener
{
public:
//==============================================================================
CodeEditorDemo()
: fileChooser ("File", File::nonexistent, true, false, false,
"*.cpp;*.h;*.hpp;*.c;*.mm;*.m", String::empty,
"Choose a C++ file to open it in the editor")
{
setName ("Code Editor");
setOpaque (true);
// Create the editor..
addAndMakeVisible (editor = new CodeEditorComponent (codeDocument, &cppTokeniser));
editor->loadContent ("\n\n/* Code editor demo! To see a real-world example of the "
"code editor in action, try the Introjucer! */\n\n");
// Create a file chooser control to load files into it..
addAndMakeVisible (&fileChooser);
fileChooser.addListener (this);
}
~CodeEditorDemo()
{
}
void filenameComponentChanged (FilenameComponent*)
{
editor->loadContent (fileChooser.getCurrentFile().loadFileAsString());
}
void paint (Graphics& g)
{
g.fillAll (Colours::lightgrey);
}
void resized()
{
editor->setBounds (10, 45, getWidth() - 20, getHeight() - 55);
fileChooser.setBounds (10, 10, getWidth() - 20, 25);
}
private:
// this is the document that the editor component is showing
CodeDocument codeDocument;
// this is a tokeniser to do the c++ syntax highlighting
CPlusPlusCodeTokeniser cppTokeniser;
// the editor component
ScopedPointer<CodeEditorComponent> editor;
FilenameComponent fileChooser;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CodeEditorDemo)
};
//==============================================================================
Component* createCodeEditorDemo()
{
return new CodeEditorDemo();
}

+ 0
- 155
extras/JuceDemo/Source/demos/DirectShowDemo.cpp View File

@@ -1,155 +0,0 @@
#include "../jucedemo_headers.h"
#if JUCE_DIRECTSHOW
//==============================================================================
class DirectShowWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
DirectShowWindowWithFileBrowser (DirectShowComponent::VideoRendererType type)
: fileChooser ("movie", File::nonexistent, true, false, false,
"*", String::empty, "(choose a video file to play)"),
dshowComp (type)
{
addAndMakeVisible (&dshowComp);
addAndMakeVisible (&fileChooser);
fileChooser.addListener (this);
fileChooser.setBrowseButtonText ("browse");
}
void resized()
{
dshowComp.setBounds (0, 0, getWidth(), getHeight() - 60);
if (transportControl != 0)
transportControl->setBounds (0, dshowComp.getBottom() + 4, getWidth(), 26);
fileChooser.setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (dshowComp.loadMovie (fileChooser.getCurrentFile()))
{
addAndMakeVisible (transportControl = new TransportControl (dshowComp));
resized();
dshowComp.play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
"Couldn't load the file!",
"Sorry, DirectShow didn't manage to load that file!");
}
}
private:
DirectShowComponent dshowComp;
FilenameComponent fileChooser;
//==============================================================================
// A quick-and-dirty transport control, containing a play button and a position slider..
class TransportControl : public Component,
public ButtonListener,
public SliderListener,
public Timer
{
public:
TransportControl (DirectShowComponent& dshowComp_)
: playButton ("Play/Pause"),
position (String::empty),
dshowComp (dshowComp_)
{
addAndMakeVisible (&playButton);
playButton.addListener (this);
addAndMakeVisible (&position);
position.setRange (0, dshowComp.getMovieDuration(), 0);
position.setSliderStyle (Slider::LinearHorizontal);
position.setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
position.addListener (this);
startTimer (1000 / 50);
}
void buttonClicked (Button*)
{
if (dshowComp.isPlaying())
dshowComp.stop();
else
dshowComp.play();
}
void sliderValueChanged (Slider*)
{
dshowComp.setPosition (position.getValue());
}
void resized()
{
const int playButtonWidth = 90;
playButton.setBounds (0, 0, playButtonWidth, getHeight());
position.setBounds (playButtonWidth, 0, getWidth() - playButtonWidth, getHeight());
}
void timerCallback()
{
if (! position.isMouseButtonDown())
position.setValue (dshowComp.getPosition(), dontSendNotification);
}
private:
TextButton playButton;
Slider position;
DirectShowComponent& dshowComp;
};
ScopedPointer<TransportControl> transportControl;
};
//==============================================================================
class DirectShowDemo : public Component
{
public:
//==============================================================================
DirectShowDemo()
: dsComp1 (DirectShowComponent::dshowVMR7),
dsComp2 (DirectShowComponent::dshowEVR)
{
setName ("DirectShow");
// add a movie component..
addAndMakeVisible (&dsComp1);
addAndMakeVisible (&dsComp2);
}
~DirectShowDemo()
{
dsComp1.setVisible (false);
dsComp2.setVisible (false);
}
void resized()
{
dsComp1.setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
dsComp2.setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
DirectShowWindowWithFileBrowser dsComp1, dsComp2;
};
//==============================================================================
Component* createDirectShowDemo()
{
return new DirectShowDemo();
}
#endif

+ 0
- 274
extras/JuceDemo/Source/demos/DragAndDropDemo.cpp View File

@@ -1,274 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
// this is the listbox containing the draggable source components..
class DragAndDropDemoSource : public ListBox,
public ListBoxModel
{
public:
//==============================================================================
DragAndDropDemoSource()
: ListBox ("d+d source", 0)
{
// tells the ListBox that this object supplies the info about its rows.
setModel (this);
setMultipleSelectionEnabled (true);
}
//==============================================================================
// The following methods implement the necessary virtual functions from ListBoxModel,
// telling the listbox how many rows there are, painting them, etc.
int getNumRows()
{
return 30;
}
void paintListBoxItem (int rowNumber,
Graphics& g,
int width, int height,
bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (Colours::lightblue);
g.setColour (Colours::black);
g.setFont (height * 0.7f);
g.drawText ("Row Number " + String (rowNumber + 1),
5, 0, width, height,
Justification::centredLeft, true);
}
var getDragSourceDescription (const SparseSet<int>& selectedRows)
{
// for our drag desctription, we'll just make a list of the selected
// row numbers - this will be picked up by the drag target and displayed in
// its box.
String desc;
for (int i = 0; i < selectedRows.size(); ++i)
desc << (selectedRows [i] + 1) << " ";
return desc.trim();
}
//==============================================================================
// this just fills in the background of the listbox
void paint (Graphics& g)
{
g.fillAll (Colours::white.withAlpha (0.7f));
}
};
//==============================================================================
// and this is a component that can have things dropped onto it..
class DragAndDropDemoTarget : public Component,
public DragAndDropTarget,
public FileDragAndDropTarget,
public TextDragAndDropTarget
{
public:
//==============================================================================
DragAndDropDemoTarget()
: message ("Drag-and-drop some rows from the top-left box onto this component!\n\n"
"You can also drag-and-drop files here"),
somethingIsBeingDraggedOver (false)
{
}
~DragAndDropDemoTarget()
{
}
//==============================================================================
void paint (Graphics& g)
{
g.fillAll (Colours::green.withAlpha (0.2f));
// draw a red line around the comp if the user's currently dragging something over it..
if (somethingIsBeingDraggedOver)
{
g.setColour (Colours::red);
g.drawRect (0, 0, getWidth(), getHeight(), 3);
}
g.setColour (Colours::black);
g.setFont (14.0f);
g.drawFittedText (message, getLocalBounds().reduced (10, 0), Justification::centred, 4);
}
//==============================================================================
// These methods implement the DragAndDropTarget interface, and allow our component
// to accept drag-and-drop of objects from other Juce components..
bool isInterestedInDragSource (const SourceDetails& /*dragSourceDetails*/)
{
// normally you'd check the sourceDescription value to see if it's the
// sort of object that you're interested in before returning true, but for
// the demo, we'll say yes to anything..
return true;
}
void itemDragEnter (const SourceDetails& /*dragSourceDetails*/)
{
somethingIsBeingDraggedOver = true;
repaint();
}
void itemDragMove (const SourceDetails& /*dragSourceDetails*/)
{
}
void itemDragExit (const SourceDetails& /*dragSourceDetails*/)
{
somethingIsBeingDraggedOver = false;
repaint();
}
void itemDropped (const SourceDetails& dragSourceDetails)
{
message = "last rows dropped: " + dragSourceDetails.description.toString();
somethingIsBeingDraggedOver = false;
repaint();
}
//==============================================================================
// These methods implement the FileDragAndDropTarget interface, and allow our component
// to accept drag-and-drop of files..
bool isInterestedInFileDrag (const StringArray& /*files*/)
{
// normally you'd check these files to see if they're something that you're
// interested in before returning true, but for the demo, we'll say yes to anything..
return true;
}
void fileDragEnter (const StringArray& /*files*/, int /*x*/, int /*y*/)
{
somethingIsBeingDraggedOver = true;
repaint();
}
void fileDragMove (const StringArray& /*files*/, int /*x*/, int /*y*/)
{
}
void fileDragExit (const StringArray& /*files*/)
{
somethingIsBeingDraggedOver = false;
repaint();
}
void filesDropped (const StringArray& files, int /*x*/, int /*y*/)
{
message = "files dropped: " + files.joinIntoString ("\n");
somethingIsBeingDraggedOver = false;
repaint();
}
// These methods implement the TextDragAndDropTarget interface, and allow our component
// to accept drag-and-drop of text..
bool isInterestedInTextDrag (const String& /*text*/)
{
return true;
}
void textDragEnter (const String& /*text*/, int /*x*/, int /*y*/)
{
somethingIsBeingDraggedOver = true;
repaint();
}
void textDragMove (const String& /*text*/, int /*x*/, int /*y*/)
{
}
void textDragExit (const String& /*text*/)
{
somethingIsBeingDraggedOver = false;
repaint();
}
void textDropped (const String& text, int /*x*/, int /*y*/)
{
message = "text dropped:\n" + text;
somethingIsBeingDraggedOver = false;
repaint();
}
private:
String message;
bool somethingIsBeingDraggedOver;
};
//==============================================================================
class DragAndDropDemo : public Component,
public DragAndDropContainer
{
public:
//==============================================================================
DragAndDropDemo()
{
setName ("Drag-and-Drop");
addAndMakeVisible (&source);
addAndMakeVisible (&target);
}
~DragAndDropDemo()
{
}
void resized()
{
source.setBounds (10, 10, 250, 150);
target.setBounds (getWidth() - 260, getHeight() - 160, 250, 150);
}
private:
DragAndDropDemoSource source;
DragAndDropDemoTarget target;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragAndDropDemo)
};
//==============================================================================
Component* createDragAndDropDemo()
{
return new DragAndDropDemo();
}

+ 0
- 218
extras/JuceDemo/Source/demos/FontsAndTextDemo.cpp View File

@@ -1,218 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
class FontsAndTextDemo : public Component,
public ListBoxModel,
public ComboBoxListener,
public SliderListener
{
public:
//==============================================================================
FontsAndTextDemo()
: sizeLabel (String::empty, "Size:"),
kerningLabel (String::empty, "Kerning:"),
horizontalScaleLabel (String::empty, "Scale:"),
styleLabel (String::empty, "Style:")
{
setName ("Fonts");
Font::findFonts (fonts);
addAndMakeVisible (listBox = new ListBox ("fonts", this));
listBox->setRowHeight (28);
addAndMakeVisible (&textBox);
textBox.setColour (TextEditor::backgroundColourId, Colours::white);
textBox.setColour (TextEditor::outlineColourId, Colours::black.withAlpha (0.5f));
textBox.setMultiLine (true, true);
textBox.setReturnKeyStartsNewLine (true);
textBox.setText ("The Quick Brown Fox Jumps Over The Lazy Dog\n\n"
"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz 0123456789");
addAndMakeVisible (&fontStylesComboBox);
fontStylesComboBox.addListener (this);
styleLabel.attachToComponent (&fontStylesComboBox, true);
addAndMakeVisible (&sizeSlider);
sizeSlider.setRange (3.0, 150.0, 0.1);
sizeSlider.setValue (20.0);
sizeSlider.addListener (this);
sizeLabel.attachToComponent (&sizeSlider, true);
addAndMakeVisible (&kerningSlider);
kerningSlider.setRange (-1.0, 1.0, 0.01);
kerningSlider.setValue (0.0);
kerningSlider.addListener (this);
kerningLabel.attachToComponent (&kerningSlider, true);
addAndMakeVisible (&horizontalScaleSlider);
horizontalScaleSlider.setRange (0.1, 4.0, 0.01);
horizontalScaleSlider.setValue (1.0);
horizontalScaleSlider.addListener (this);
horizontalScaleLabel.attachToComponent (&horizontalScaleSlider, true);
listBox->setColour (ListBox::outlineColourId, Colours::black.withAlpha (0.5f));
listBox->setOutlineThickness (1);
listBox->selectRow (Random::getSystemRandom().nextInt (fonts.size()));
// set up the layout and resizer bars..
verticalLayout.setItemLayout (0, -0.2, -0.8, -0.5); // width of the font list must be
// between 20% and 80%, preferably 50%
verticalLayout.setItemLayout (1, 8, 8, 8); // the vertical divider drag-bar thing is always 8 pixels wide
verticalLayout.setItemLayout (2, 150, -1.0, -0.5); // the components on the right must be
// at least 150 pixels wide, preferably 50% of the total width
verticalDividerBar = new StretchableLayoutResizerBar (&verticalLayout, 1, true);
addAndMakeVisible (verticalDividerBar);
}
void resized()
{
// lay out the list box and vertical divider..
Component* vcomps[] = { listBox, verticalDividerBar, 0 };
verticalLayout.layOutComponents (vcomps, 3,
4, 4, getWidth() - 8, getHeight() - 8,
false, // lay out side-by-side
true); // resize the components' heights as well as widths
// now lay out the text box and the controls below it..
int x = verticalLayout.getItemCurrentPosition (2) + 4;
textBox.setBounds (x, 0, getWidth() - x, getHeight() - 110);
x += 70;
sizeSlider.setBounds (x, getHeight() - 106, getWidth() - x, 22);
kerningSlider.setBounds (x, getHeight() - 82, getWidth() - x, 22);
horizontalScaleSlider.setBounds (x, getHeight() - 58, getWidth() - x, 22);
fontStylesComboBox.setBounds (x, getHeight() - 34, (getWidth() - x) / 2, 22);
}
// implements the ListBoxModel method
int getNumRows()
{
return fonts.size();
}
// implements the ListBoxModel method
void paintListBoxItem (int rowNumber,
Graphics& g,
int width, int height,
bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (Colours::lightblue);
Font font = fonts[rowNumber].withPointHeight (height * 0.6f);
g.setFont (font);
g.setColour (Colours::black);
g.drawText (font.getTypefaceName(),
4, 0, width - 4, height,
Justification::centredLeft, true);
int x = jmax (0, font.getStringWidth (font.getTypefaceName())) + 12;
g.setFont (Font (11.0f, Font::italic));
g.setColour (Colours::grey);
g.drawText (font.getTypefaceName(),
x, 0, width - x - 2, height,
Justification::centredLeft, true);
}
void updatePreviewBoxText()
{
Font font (fonts [listBox->getSelectedRow()]);
font.setHeight ((float) sizeSlider.getValue());
font.setExtraKerningFactor ((float) kerningSlider.getValue());
font.setHorizontalScale ((float) horizontalScaleSlider.getValue());
updateStylesList (font);
font.setTypefaceStyle (fontStylesComboBox.getText());
textBox.applyFontToAllText (font);
}
void updateStylesList (const Font& newFont)
{
const StringArray newStyles (newFont.getAvailableStyles());
if (newStyles != currentStyleList)
{
currentStyleList = newStyles;
fontStylesComboBox.clear();
for (int i = 0; i < newStyles.size(); ++i)
fontStylesComboBox.addItem (newStyles[i], i + 1);
fontStylesComboBox.setSelectedItemIndex (0);
}
}
void selectedRowsChanged (int /*lastRowselected*/)
{
updatePreviewBoxText();
}
void buttonClicked (Button*)
{
updatePreviewBoxText();
}
void sliderValueChanged (Slider*)
{
updatePreviewBoxText();
}
void comboBoxChanged (ComboBox*)
{
updatePreviewBoxText();
}
private:
Array<Font> fonts;
StringArray currentStyleList;
ScopedPointer<ListBox> listBox;
TextEditor textBox;
ComboBox fontStylesComboBox;
Slider sizeSlider, kerningSlider, horizontalScaleSlider;
Label sizeLabel, kerningLabel, horizontalScaleLabel, styleLabel;
StretchableLayoutManager verticalLayout;
ScopedPointer<StretchableLayoutResizerBar> verticalDividerBar;
};
//==============================================================================
Component* createFontsAndTextDemo()
{
return new FontsAndTextDemo();
}

+ 0
- 312
extras/JuceDemo/Source/demos/InterprocessCommsDemo.cpp View File

@@ -1,312 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
class InterprocessCommsDemo : public Component,
public ButtonListener,
public ComboBoxListener
{
public:
//==============================================================================
InterprocessCommsDemo()
: sendButton ("send", "Fires off the message"),
modeLabel (String::empty, "Mode:"),
pipeLabel (String::empty, "Pipe Name:"),
numberLabel (String::empty, "Socket Port:"),
hostLabel (String::empty, "Socket Host:")
{
setName ("Interprocess Communication");
server = new DemoInterprocessConnectionServer (*this);
// create all our UI bits and pieces..
addAndMakeVisible (&modeSelector);
modeSelector.setBounds (100, 25, 200, 24);
modeLabel.attachToComponent (&modeSelector, true);
modeSelector.addItem ("(Disconnected)", 8);
modeSelector.addSeparator();
modeSelector.addItem ("Named pipe (listening)", 1);
modeSelector.addItem ("Named pipe (connect to existing pipe)", 5);
modeSelector.addSeparator();
modeSelector.addItem ("Socket (listening)", 2);
modeSelector.addItem ("Socket (connect to existing socket)", 6);
modeSelector.setSelectedId (8);
modeSelector.addListener (this);
addAndMakeVisible (&pipeName);
pipeName.setBounds (100, 60, 130, 24);
pipeName.setMultiLine (false);
pipeName.setText ("juce demo pipe");
pipeLabel.attachToComponent (&pipeName, true);
addAndMakeVisible (&socketNumber);
socketNumber.setBounds (350, 60, 80, 24);
socketNumber.setMultiLine (false);
socketNumber.setText ("12345");
socketNumber.setInputRestrictions (5, "0123456789");
numberLabel.attachToComponent (&socketNumber, true);
addAndMakeVisible (&socketHost);
socketHost.setBounds (530, 60, 130, 24);
socketHost.setMultiLine (false);
socketHost.setText ("localhost");
socketNumber.setInputRestrictions (512);
hostLabel.attachToComponent (&socketHost, true);
addChildComponent (&sendText);
sendText.setBounds (30, 120, 200, 24);
sendText.setMultiLine (false);
sendText.setReadOnly (false);
sendText.setText ("testing 1234");
addChildComponent (&sendButton);
sendButton.setBounds (240, 120, 200, 24);
sendButton.changeWidthToFitText();
sendButton.addListener (this);
addChildComponent (&incomingMessages);
incomingMessages.setReadOnly (true);
incomingMessages.setMultiLine (true);
incomingMessages.setBounds (30, 150, 500, 250);
// call this to set up everything's state correctly.
comboBoxChanged (0);
}
~InterprocessCommsDemo()
{
close();
}
void buttonClicked (Button* button)
{
if (button == &sendButton)
{
// The send button has been pressed, so write out the contents of the
// text box to the socket or pipe, depending on which is active.
const String text (sendText.getText());
MemoryBlock messageData (text.toUTF8(), text.getNumBytesAsUTF8());
for (int i = activeConnections.size(); --i >= 0;)
{
if (! activeConnections[i]->sendMessage (messageData))
{
// the write failed, so indicate that the connection has broken..
appendMessage ("send message failed!");
}
}
}
}
void comboBoxChanged (ComboBox*)
{
// This is called when the user picks a different mode from the drop-down list..
const int modeId = modeSelector.getSelectedId();
close();
if (modeId < 8)
{
open ((modeId & 2) != 0,
(modeId & 4) != 0);
}
}
//==============================================================================
// Just closes any connections that are currently open.
void close()
{
server->stop();
activeConnections.clear();
// Reset the UI stuff to a disabled state.
sendText.setVisible (false);
sendButton.setVisible (false);
incomingMessages.setText (String::empty, false);
incomingMessages.setVisible (true);
appendMessage (
"To demonstrate named pipes, you'll need to run two instances of the JuceDemo application on this machine. On "
"one of them, select \"named pipe (listening)\", and then on the other, select \"named pipe (connect to existing pipe)\". Then messages that you "
"send from the 'sender' app should appear on the listener app. The \"pipe name\" field lets you choose a name for the pipe\n\n"
"To demonstrate sockets, you can either run two instances of the app on the same machine, or on different "
"machines on your network. In each one enter a socket number, then on one of the apps, select the "
"\"Socket (listening)\" mode. On the other, enter the host address of the listening app, and select \"Socket (connect to existing socket)\". "
"Messages should then be be sent between the apps in the same way as through the named pipes.");
}
void open (bool asSocket, bool asSender)
{
close();
// Make the appropriate bits of UI visible..
sendText.setVisible (true);
sendButton.setVisible (true);
incomingMessages.setText (String::empty, false);
incomingMessages.setVisible (true);
// and try to open the socket or pipe...
bool openedOk = false;
if (asSender)
{
// if we're connecting to an existing server, we can just create a connection object
// directly.
ScopedPointer<DemoInterprocessConnection> newConnection (new DemoInterprocessConnection (*this));
if (asSocket)
{
openedOk = newConnection->connectToSocket (socketHost.getText(),
socketNumber.getText().getIntValue(),
1000);
}
else
{
openedOk = newConnection->connectToPipe (pipeName.getText(), 5000);
}
if (openedOk)
activeConnections.add (newConnection.release());
}
else
{
// if we're starting up a server, we need to tell the server to start waiting for
// clients to connect. It'll then create connection objects for us when clients arrive.
if (asSocket)
{
openedOk = server->beginWaitingForSocket (socketNumber.getText().getIntValue());
if (openedOk)
appendMessage ("Waiting for another app to connect to this socket..");
}
else
{
ScopedPointer<DemoInterprocessConnection> newConnection (new DemoInterprocessConnection (*this));
openedOk = newConnection->createPipe (pipeName.getText(), 2000);
if (openedOk)
{
appendMessage ("Waiting for another app to connect to this pipe..");
activeConnections.add (newConnection.release());
}
}
}
if (! openedOk)
{
modeSelector.setSelectedId (8);
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
"Interprocess Comms Demo",
"Failed to open the socket or pipe...");
}
}
void appendMessage (const String& message)
{
incomingMessages.setCaretPosition (INT_MAX);
incomingMessages.insertTextAtCaret (message + "\n");
incomingMessages.setCaretPosition (INT_MAX);
}
//==============================================================================
class DemoInterprocessConnection : public InterprocessConnection
{
public:
DemoInterprocessConnection (InterprocessCommsDemo& owner_)
: InterprocessConnection (true),
owner (owner_)
{
static int totalConnections = 0;
ourNumber = ++totalConnections;
}
void connectionMade()
{
owner.appendMessage ("Connection #" + String (ourNumber) + " - connection started");
}
void connectionLost()
{
owner.appendMessage ("Connection #" + String (ourNumber) + " - connection lost");
}
void messageReceived (const MemoryBlock& message)
{
owner.appendMessage ("Connection #" + String (ourNumber) + " - message received: " + message.toString());
}
private:
InterprocessCommsDemo& owner;
int ourNumber;
};
//==============================================================================
class DemoInterprocessConnectionServer : public InterprocessConnectionServer
{
public:
DemoInterprocessConnectionServer (InterprocessCommsDemo& owner_)
: owner (owner_)
{
}
InterprocessConnection* createConnectionObject()
{
DemoInterprocessConnection* newConnection = new DemoInterprocessConnection (owner);
owner.activeConnections.add (newConnection);
return newConnection;
}
private:
InterprocessCommsDemo& owner;
};
OwnedArray <DemoInterprocessConnection, CriticalSection> activeConnections;
private:
ComboBox modeSelector;
TextButton sendButton;
TextEditor sendText, incomingMessages, pipeName, socketNumber, socketHost;
Label modeLabel, pipeLabel, numberLabel, hostLabel;
ScopedPointer<DemoInterprocessConnectionServer> server;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InterprocessCommsDemo)
};
//==============================================================================
Component* createInterprocessCommsDemo()
{
return new InterprocessCommsDemo();
}

+ 0
- 279
extras/JuceDemo/Source/demos/OpenGLDemo.cpp View File

@@ -1,279 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_OPENGL
//==============================================================================
class DemoOpenGLCanvas : public Component,
public OpenGLRenderer,
public Timer
{
public:
DemoOpenGLCanvas()
: rotation (0.0f),
textScrollPos (200)
{
infoLabel.setText ("These sliders demonstrate how components and 2D graphics can be rendered "
"using OpenGL by using the OpenGLContext class.", dontSendNotification);
infoLabel.setInterceptsMouseClicks (false, false);
addAndMakeVisible (&infoLabel);
infoLabel.setBounds ("parent.width * 0.05, bottom - 150, parent.width * 0.4, parent.height - 60");
speedSlider.setRange (-10.0, 10.0, 0.1);
speedSlider.setPopupMenuEnabled (true);
speedSlider.setValue (Random::getSystemRandom().nextDouble() * 3.0, dontSendNotification);
speedSlider.setSliderStyle (Slider::LinearHorizontal);
speedSlider.setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
addAndMakeVisible (&speedSlider);
speedSlider.setBounds ("parent.width * 0.05, parent.height - 65, parent.width * 0.6, top + 24");
sizeSlider.setRange (0.2, 2.0, 0.01);
sizeSlider.setPopupMenuEnabled (true);
sizeSlider.setValue (Random::getSystemRandom().nextDouble() + 0.5, dontSendNotification);
sizeSlider.setSliderStyle (Slider::LinearHorizontal);
sizeSlider.setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
addAndMakeVisible (&sizeSlider);
sizeSlider.setBounds ("parent.width * 0.05, parent.height - 35, parent.width * 0.6, top + 24");
openGLContext.setRenderer (this);
openGLContext.setComponentPaintingEnabled (true);
openGLContext.setContinuousRepainting (true);
openGLContext.attachTo (*this);
startTimer (1000 / 30);
}
~DemoOpenGLCanvas()
{
openGLContext.detach();
}
// when the component creates a new internal context, this is called, and
// we'll use the opportunity to create some images to use as textures.
void newOpenGLContextCreated()
{
logoImage = createLogoImage();
dynamicTextureImage = Image (Image::ARGB, 128, 128, true, OpenGLImageType());
}
void openGLContextClosing()
{
// We have to make sure we release any openGL images before the
// GL context gets closed..
logoImage = Image::null;
dynamicTextureImage = Image::null;
}
void mouseDown (const MouseEvent& e)
{
draggableOrientation.mouseDown (e.getPosition());
}
void mouseDrag (const MouseEvent& e)
{
draggableOrientation.mouseDrag (e.getPosition());
openGLContext.triggerRepaint();
}
void resized()
{
draggableOrientation.setViewport (getLocalBounds());
}
void paint (Graphics&) {}
void renderOpenGL()
{
OpenGLHelpers::clear (Colours::darkgrey.withAlpha (1.0f));
updateTextureImage(); // this will update our dynamically-changing texture image.
const float scale = (float) openGLContext.getRenderingScale();
drawBackground2DStuff (scale); // draws some 2D content to demonstrate the OpenGLGraphicsContext class
// Having used the juce 2D renderer, it will have messed-up a whole load of GL state, so
// we'll put back any important settings before doing our normal GL 3D drawing..
glEnable (GL_DEPTH_TEST);
glDepthFunc (GL_LESS);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable (GL_TEXTURE_2D);
#if JUCE_USE_OPENGL_FIXED_FUNCTION
OpenGLHelpers::prepareFor2D (roundToInt (scale * getWidth()),
roundToInt (scale * getHeight()));
OpenGLHelpers::setPerspective (45.0, getWidth() / (double) getHeight(), 0.1, 100.0);
glTranslatef (0.0f, 0.0f, -5.0f);
draggableOrientation.applyToOpenGLMatrix();
// logoImage and dynamicTextureImage are actually OpenGL images, so we can use this utility function to
// extract the frame buffer which is their backing store, and use it directly.
OpenGLFrameBuffer* tex1 = OpenGLImageType::getFrameBufferFrom (logoImage);
OpenGLFrameBuffer* tex2 = OpenGLImageType::getFrameBufferFrom (dynamicTextureImage);
if (tex1 != nullptr && tex2 != nullptr)
{
// This draws the sides of our spinning cube.
// I've used some of the juce helper functions, but you can also just use normal GL calls here too.
tex1->draw3D (-1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, Colours::white);
tex1->draw3D (-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, Colours::white);
tex1->draw3D (-1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, Colours::white);
tex2->draw3D (-1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, Colours::white);
tex2->draw3D ( 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, Colours::white);
tex2->draw3D (-1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, Colours::white);
}
#endif
}
void updateTextureImage()
{
// This image is a special framebuffer-backed image, so when we draw to it, the context
// will render directly into its framebuffer
if (dynamicTextureImage.isValid())
{
dynamicTextureImage.clear (dynamicTextureImage.getBounds(),
Colours::red.withRotatedHue (fabsf (::sinf (rotation / 300.0f))).withAlpha (0.7f));
Graphics g (dynamicTextureImage);
g.setFont (dynamicTextureImage.getHeight() / 3.0f);
g.setColour (Colours::black);
drawScrollingMessage (g, dynamicTextureImage.getHeight() / 2);
}
}
void drawBackground2DStuff (float scale)
{
// Create an OpenGLGraphicsContext that will draw into this GL window..
ScopedPointer<LowLevelGraphicsContext> glRenderer (createOpenGLGraphicsContext (openGLContext,
roundToInt (scale * getWidth()),
roundToInt (scale * getHeight())));
if (glRenderer != nullptr)
{
Graphics g (*glRenderer);
g.addTransform (AffineTransform::scale (scale));
// This stuff just creates a spinning star shape and fills it..
Path p;
p.addStar (Point<float> (getWidth() * 0.7f, getHeight() * 0.4f), 7,
getHeight() * 0.4f * (float) sizeSlider.getValue(),
getHeight() * 0.4f,
rotation / 50.0f);
g.setGradientFill (ColourGradient (Colours::green.withRotatedHue (fabsf (::sinf (rotation / 300.0f))),
0, 0,
Colours::green.withRotatedHue (fabsf (::cosf (rotation / -431.0f))),
0, (float) getHeight(), false));
g.fillPath (p);
}
}
void timerCallback()
{
rotation += (float) speedSlider.getValue();
textScrollPos += 1.4f;
}
private:
OpenGLContext openGLContext;
Image logoImage, dynamicTextureImage;
float rotation, textScrollPos;
Draggable3DOrientation draggableOrientation;
Slider speedSlider, sizeSlider;
Label infoLabel;
// Functions to create a couple of images to use as textures..
static Image createLogoImage()
{
Image image (Image::ARGB, 256, 256, true, OpenGLImageType());
if (image.isValid())
{
Graphics g (image);
g.fillAll (Colours::lightgrey.withAlpha (0.8f));
g.drawImageWithin (ImageFileFormat::loadFrom (BinaryData::juce_png, BinaryData::juce_pngSize),
0, 0, image.getWidth(), image.getHeight(), RectanglePlacement::stretchToFit);
drawRandomStars (g, image.getWidth(), image.getHeight());
}
return image;
}
static void drawRandomStars (Graphics& g, int w, int h)
{
Random r;
for (int i = 10; --i >= 0;)
{
Path pp;
pp.addStar (Point<float> (r.nextFloat() * w, r.nextFloat() * h), r.nextInt (8) + 3, 10.0f, 20.0f, 0.0f);
g.setColour (Colours::pink.withAlpha (0.4f));
g.fillPath (pp);
}
}
void drawScrollingMessage (Graphics& g, int y) const
{
g.drawSingleLineText ("The background, foreground and texture are all being drawn using the OpenGLGraphicsContext class, which "
"lets you use a standard JUCE 2D graphics context to render directly onto an OpenGL window or framebuffer... ",
(int) -std::fmod (textScrollPos, 2500.0f), y);
}
};
//==============================================================================
class OpenGLDemo : public Component
{
public:
OpenGLDemo()
: Component ("OpenGL")
{
addAndMakeVisible (&canvas);
}
void resized()
{
canvas.setBounds (10, 10, getWidth() - 20, getHeight() - 50);
}
private:
DemoOpenGLCanvas canvas;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLDemo)
};
//==============================================================================
Component* createOpenGLDemo()
{
return new OpenGLDemo();
}
#endif

+ 0
- 117
extras/JuceDemo/Source/demos/QuickTimeDemo.cpp View File

@@ -1,117 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_QUICKTIME && ! JUCE_LINUX
//==============================================================================
// so that we can easily have two QT windows each with a file browser, wrap this up as a class..
class QuickTimeWindowWithFileBrowser : public Component,
public FilenameComponentListener
{
public:
QuickTimeWindowWithFileBrowser()
: fileChooser ("movie", File::nonexistent, true, false, false,
"*", String::empty, "(choose a video file to play)")
{
addAndMakeVisible (&qtComp);
addAndMakeVisible (&fileChooser);
fileChooser.addListener (this);
fileChooser.setBrowseButtonText ("browse");
}
~QuickTimeWindowWithFileBrowser()
{
}
void resized()
{
qtComp.setBounds (0, 0, getWidth(), getHeight() - 30);
fileChooser.setBounds (0, getHeight() - 24, getWidth(), 24);
}
void filenameComponentChanged (FilenameComponent*)
{
// this is called when the user changes the filename in the file chooser box
if (qtComp.loadMovie (fileChooser.getCurrentFile(), true))
{
// loaded the file ok, so let's start it playing..
qtComp.play();
}
else
{
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
"Couldn't load the file!",
"Sorry, QuickTime didn't manage to load that file!");
}
}
private:
QuickTimeMovieComponent qtComp;
FilenameComponent fileChooser;
};
//==============================================================================
class QuickTimeDemo : public Component
{
public:
//==============================================================================
QuickTimeDemo()
{
setName ("QuickTime");
// add a movie component..
addAndMakeVisible (&qtComp1);
addAndMakeVisible (&qtComp2);
}
~QuickTimeDemo()
{
qtComp1.setVisible (false);
qtComp2.setVisible (false);
}
void resized()
{
qtComp1.setBoundsRelative (0.05f, 0.05f, 0.425f, 0.9f);
qtComp2.setBoundsRelative (0.525f, 0.05f, 0.425f, 0.9f);
}
private:
//==============================================================================
QuickTimeWindowWithFileBrowser qtComp1, qtComp2;
};
//==============================================================================
Component* createQuickTimeDemo()
{
return new QuickTimeDemo();
}
#endif

+ 0
- 3854
extras/JuceDemo/Source/demos/RenderingTestComponent.cpp
File diff suppressed because it is too large
View File


+ 0
- 100
extras/JuceDemo/Source/demos/RenderingTestComponent.h View File

@@ -1,100 +0,0 @@
/*
==============================================================================
This is an automatically generated GUI class created by the Introjucer!
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Introjucer version: 3.1.0
------------------------------------------------------------------------------
The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-13 by Raw Material Software Ltd.
==============================================================================
*/
#ifndef __JUCE_HEADER_ED3E5FD229F108DA__
#define __JUCE_HEADER_ED3E5FD229F108DA__
//[Headers] -- You can add your own extra header files here --
#include "../jucedemo_headers.h"
class RenderingTestCanvas;
//[/Headers]
//==============================================================================
/**
//[Comments]
An auto-generated component, created by the Jucer.
Describe your class and how it works here!
//[/Comments]
*/
class RenderingTestComponent : public Component,
public ComboBoxListener,
public SliderListener
{
public:
//==============================================================================
RenderingTestComponent ();
~RenderingTestComponent();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
void sliderValueChanged (Slider* sliderThatWasMoved);
// Binary resources:
static const char* demoJpeg_jpg;
static const int demoJpeg_jpgSize;
static const char* demoPng_png;
static const int demoPng_pngSize;
private:
//[UserVariables] -- You can add your own custom variables in this section.
friend class RenderingTestCanvas;
//[/UserVariables]
//==============================================================================
ScopedPointer<ComboBox> testTypeComboBox;
ScopedPointer<Label> testTypeLabel;
ScopedPointer<Label> speedLabel;
ScopedPointer<RenderingTestCanvas> testCanvas;
ScopedPointer<Slider> opacitySlider;
ScopedPointer<ToggleButton> highQualityToggle;
ScopedPointer<ToggleButton> animateSizeToggle;
ScopedPointer<ToggleButton> animateRotationToggle;
ScopedPointer<ToggleButton> animatePositionToggle;
ScopedPointer<ToggleButton> animateFillToggle;
ScopedPointer<Label> opacityLabel;
ScopedPointer<Slider> xSlider;
ScopedPointer<Slider> ySlider;
ScopedPointer<Slider> sizeSlider;
ScopedPointer<Slider> angleSlider;
ScopedPointer<Label> xSliderLabel;
ScopedPointer<Label> ySliderLabel;
ScopedPointer<Label> sizeSliderLabel;
ScopedPointer<Label> angleSliderLabel;
ScopedPointer<ToggleButton> clipToRectangleToggle;
ScopedPointer<ToggleButton> clipToPathToggle;
ScopedPointer<ToggleButton> clipToImageToggle;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RenderingTestComponent)
};
//[EndFile] You can add extra defines here...
//[/EndFile]
#endif // __JUCE_HEADER_ED3E5FD229F108DA__

+ 0
- 320
extras/JuceDemo/Source/demos/TableDemo.cpp View File

@@ -1,320 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
/**
This class shows how to implement a TableListBoxModel to show in a TableListBox.
*/
class TableDemoComponent : public Component,
public TableListBoxModel
{
public:
//==============================================================================
TableDemoComponent()
: font (14.0f)
{
// Load some data from an embedded XML file..
loadData();
// Create our table component and add it to this component..
addAndMakeVisible (&table);
table.setModel (this);
// give it a border
table.setColour (ListBox::outlineColourId, Colours::grey);
table.setOutlineThickness (1);
// Add some columns to the table header, based on the column list in our database..
forEachXmlChildElement (*columnList, columnXml)
{
table.getHeader().addColumn (columnXml->getStringAttribute ("name"),
columnXml->getIntAttribute ("columnId"),
columnXml->getIntAttribute ("width"),
50, 400,
TableHeaderComponent::defaultFlags);
}
// we could now change some initial settings..
table.getHeader().setSortColumnId (1, true); // sort forwards by the ID column
table.getHeader().setColumnVisible (7, false); // hide the "length" column until the user shows it
// un-comment this line to have a go of stretch-to-fit mode
// table.getHeader().setStretchToFitActive (true);
table.setMultipleSelectionEnabled (true);
}
~TableDemoComponent()
{
}
//==============================================================================
// This is overloaded from TableListBoxModel, and must return the total number of rows in our table
int getNumRows()
{
return numRows;
}
// This is overloaded from TableListBoxModel, and should fill in the background of the whole row
void paintRowBackground (Graphics& g, int /*rowNumber*/, int /*width*/, int /*height*/, bool rowIsSelected)
{
if (rowIsSelected)
g.fillAll (Colours::lightblue);
}
// This is overloaded from TableListBoxModel, and must paint any cells that aren't using custom
// components.
void paintCell (Graphics& g,
int rowNumber,
int columnId,
int width, int height,
bool /*rowIsSelected*/)
{
g.setColour (Colours::black);
g.setFont (font);
const XmlElement* rowElement = dataList->getChildElement (rowNumber);
if (rowElement != 0)
{
const String text (rowElement->getStringAttribute (getAttributeNameForColumnId (columnId)));
g.drawText (text, 2, 0, width - 4, height, Justification::centredLeft, true);
}
g.setColour (Colours::black.withAlpha (0.2f));
g.fillRect (width - 1, 0, 1, height);
}
// This is overloaded from TableListBoxModel, and tells us that the user has clicked a table header
// to change the sort order.
void sortOrderChanged (int newSortColumnId, bool isForwards)
{
if (newSortColumnId != 0)
{
DemoDataSorter sorter (getAttributeNameForColumnId (newSortColumnId), isForwards);
dataList->sortChildElements (sorter);
table.updateContent();
}
}
// This is overloaded from TableListBoxModel, and must update any custom components that we're using
Component* refreshComponentForCell (int rowNumber, int columnId, bool /*isRowSelected*/,
Component* existingComponentToUpdate)
{
if (columnId == 5) // If it's the ratings column, we'll return our custom component..
{
RatingColumnCustomComponent* ratingsBox = (RatingColumnCustomComponent*) existingComponentToUpdate;
// If an existing component is being passed-in for updating, we'll re-use it, but
// if not, we'll have to create one.
if (ratingsBox == 0)
ratingsBox = new RatingColumnCustomComponent (*this);
ratingsBox->setRowAndColumn (rowNumber, columnId);
return ratingsBox;
}
else
{
// for any other column, just return 0, as we'll be painting these columns directly.
jassert (existingComponentToUpdate == 0);
return 0;
}
}
// This is overloaded from TableListBoxModel, and should choose the best width for the specified
// column.
int getColumnAutoSizeWidth (int columnId)
{
if (columnId == 5)
return 100; // (this is the ratings column, containing a custom component)
int widest = 32;
// find the widest bit of text in this column..
for (int i = getNumRows(); --i >= 0;)
{
const XmlElement* rowElement = dataList->getChildElement (i);
if (rowElement != 0)
{
const String text (rowElement->getStringAttribute (getAttributeNameForColumnId (columnId)));
widest = jmax (widest, font.getStringWidth (text));
}
}
return widest + 8;
}
// A couple of quick methods to set and get the "rating" value when the user
// changes the combo box
int getRating (const int rowNumber) const
{
return dataList->getChildElement (rowNumber)->getIntAttribute ("Rating");
}
void setRating (const int rowNumber, const int newRating)
{
dataList->getChildElement (rowNumber)->setAttribute ("Rating", newRating);
}
//==============================================================================
void resized()
{
// position our table with a gap around its edge
table.setBoundsInset (BorderSize<int> (8));
}
private:
TableListBox table; // the table component itself
Font font;
ScopedPointer<XmlElement> demoData; // This is the XML document loaded from the embedded file "demo table data.xml"
XmlElement* columnList; // A pointer to the sub-node of demoData that contains the list of columns
XmlElement* dataList; // A pointer to the sub-node of demoData that contains the list of data rows
int numRows; // The number of rows of data we've got
//==============================================================================
// This is a custom component containing a combo box, which we're going to put inside
// our table's "rating" column.
class RatingColumnCustomComponent : public Component,
public ComboBoxListener
{
public:
RatingColumnCustomComponent (TableDemoComponent& owner_)
: owner (owner_)
{
// just put a combo box inside this component
addAndMakeVisible (&comboBox);
comboBox.addItem ("fab", 1);
comboBox.addItem ("groovy", 2);
comboBox.addItem ("hep", 3);
comboBox.addItem ("neat", 4);
comboBox.addItem ("wild", 5);
comboBox.addItem ("swingin", 6);
comboBox.addItem ("mad for it", 7);
// when the combo is changed, we'll get a callback.
comboBox.addListener (this);
comboBox.setWantsKeyboardFocus (false);
}
~RatingColumnCustomComponent()
{
}
void resized()
{
comboBox.setBoundsInset (BorderSize<int> (2));
}
// Our demo code will call this when we may need to update our contents
void setRowAndColumn (const int newRow, const int newColumn)
{
row = newRow;
columnId = newColumn;
comboBox.setSelectedId (owner.getRating (row), dontSendNotification);
}
void comboBoxChanged (ComboBox* /*comboBoxThatHasChanged*/)
{
owner.setRating (row, comboBox.getSelectedId());
}
private:
TableDemoComponent& owner;
ComboBox comboBox;
int row, columnId;
};
//==============================================================================
// A comparator used to sort our data when the user clicks a column header
class DemoDataSorter
{
public:
DemoDataSorter (const String attributeToSort_, bool forwards)
: attributeToSort (attributeToSort_),
direction (forwards ? 1 : -1)
{
}
int compareElements (XmlElement* first, XmlElement* second) const
{
int result = first->getStringAttribute (attributeToSort)
.compareLexicographically (second->getStringAttribute (attributeToSort));
if (result == 0)
result = first->getStringAttribute ("ID")
.compareLexicographically (second->getStringAttribute ("ID"));
return direction * result;
}
private:
String attributeToSort;
int direction;
};
//==============================================================================
// this loads the embedded database XML file into memory
void loadData()
{
XmlDocument dataDoc (String ((const char*) BinaryData::demo_table_data_xml));
demoData = dataDoc.getDocumentElement();
dataList = demoData->getChildByName ("DATA");
columnList = demoData->getChildByName ("COLUMNS");
numRows = dataList->getNumChildElements();
}
// (a utility method to search our XML for the attribute that matches a column ID)
const String getAttributeNameForColumnId (const int columnId) const
{
forEachXmlChildElement (*columnList, columnXml)
{
if (columnXml->getIntAttribute ("columnId") == columnId)
return columnXml->getStringAttribute ("name");
}
return String::empty;
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableDemoComponent)
};
//==============================================================================
Component* createTableDemo()
{
return new TableDemoComponent();
}

+ 0
- 350
extras/JuceDemo/Source/demos/ThreadingDemo.cpp View File

@@ -1,350 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
class BouncingBallComp : public Component
{
public:
BouncingBallComp()
{
x = Random::getSystemRandom().nextFloat() * 200.0f;
y = Random::getSystemRandom().nextFloat() * 200.0f;
parentWidth = 50;
parentHeight = 50;
innerX = 0;
innerY = 0;
threadId = 0;
const float speed = 5.0f; // give each ball a fixed speed so we can
// see the effects of thread priority on how fast
// they actually go.
const float angle = Random::getSystemRandom().nextFloat() * float_Pi * 2.0f;
dx = sinf (angle) * speed;
dy = cosf (angle) * speed;
size = Random::getSystemRandom().nextFloat() * 30.0f + 30.0f;
colour = Colour ((uint32) Random::getSystemRandom().nextInt())
.withAlpha (0.5f)
.withBrightness (0.7f);
}
~BouncingBallComp()
{
}
void paint (Graphics& g)
{
g.setColour (colour);
g.fillEllipse (innerX, innerY, size, size);
g.setColour (Colours::black);
g.setFont (10.0f);
g.drawText (String::toHexString ((int64) threadId), getLocalBounds(), Justification::centred, false);
}
void parentSizeChanged()
{
parentWidth = getParentWidth() - size;
parentHeight = getParentHeight() - size;
}
void moveBall()
{
threadId = Thread::getCurrentThreadId(); // this is so the component can print the thread ID inside the ball
x += dx;
y += dy;
if (x < 0)
dx = fabsf (dx);
if (x > parentWidth)
dx = -fabsf (dx);
if (y < 0)
dy = fabsf (dy);
if (y > parentHeight)
dy = -fabsf (dy);
setBounds (((int) x) - 2,
((int) y) - 2,
((int) size) + 4,
((int) size) + 4);
innerX = x - getX();
innerY = y - getY();
repaint();
}
private:
float x, y, size, dx, dy, parentWidth, parentHeight;
float innerX, innerY;
Colour colour;
Thread::ThreadID threadId;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BouncingBallComp)
};
//==============================================================================
class DemoThread : public BouncingBallComp,
public Thread
{
public:
DemoThread()
: Thread ("Juce Demo Thread")
{
interval = Random::getSystemRandom().nextInt (50) + 6;
// give the threads a random priority, so some will move more
// smoothly than others..
startThread (Random::getSystemRandom().nextInt (3) + 3);
}
~DemoThread()
{
// allow the thread 2 seconds to stop cleanly - should be plenty of time.
stopThread (2000);
}
void run() override
{
// this is the code that runs this thread - we'll loop continuously,
// updating the coordinates of our blob.
// threadShouldExit() returns true when the stopThread() method has been
// called, so we should check it often, and exit as soon as it gets flagged.
while (! threadShouldExit())
{
// sleep a bit so the threads don't all grind the CPU to a halt..
wait (interval);
// because this is a background thread, we mustn't do any UI work without
// first grabbing a MessageManagerLock..
const MessageManagerLock mml (Thread::getCurrentThread());
if (! mml.lockWasGained()) // if something is trying to kill this job, the lock
return; // will fail, in which case we'd better return..
// now we've got the UI thread locked, we can mess about with the components
moveBall();
}
}
private:
int interval;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DemoThread)
};
//==============================================================================
class DemoThreadPoolJob : public BouncingBallComp,
public ThreadPoolJob
{
public:
DemoThreadPoolJob()
: ThreadPoolJob ("Demo Threadpool Job")
{
}
JobStatus runJob()
{
// this is the code that runs this job. It'll be repeatedly called until we return
// jobHasFinished instead of jobNeedsRunningAgain.
Thread::sleep (30);
// because this is a background thread, we mustn't do any UI work without
// first grabbing a MessageManagerLock..
const MessageManagerLock mml (this);
// before moving the ball, we need to check whether the lock was actually gained, because
// if something is trying to stop this job, it will have failed..
if (mml.lockWasGained())
moveBall();
return jobNeedsRunningAgain;
}
void removedFromQueue()
{
// This is called to tell us that our job has been removed from the pool.
// In this case there's no need to do anything here.
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DemoThreadPoolJob)
};
//==============================================================================
class ThreadingDemo : public Component,
public Timer,
public ButtonListener
{
public:
//==============================================================================
ThreadingDemo()
: pool (3),
controlButton ("Thread type"),
isUsingPool (false)
{
setName ("Multithreading");
setOpaque (true);
addAndMakeVisible (&controlButton);
controlButton.changeWidthToFitText (20);
controlButton.setTopLeftPosition (20, 20);
controlButton.setTriggeredOnMouseDown (true);
controlButton.setAlwaysOnTop (true);
controlButton.addListener (this);
}
~ThreadingDemo()
{
pool.removeAllJobs (true, 2000);
}
void resetAllBalls()
{
stopTimer();
pool.removeAllJobs (true, 4000);
balls.clear();
if (isShowing())
{
while (balls.size() < 5)
addABall();
startTimer (300);
}
}
void paint (Graphics& g)
{
g.fillAll (Colours::white);
}
void setUsingPool (bool usePool)
{
isUsingPool = usePool;
resetAllBalls();
}
void addABall()
{
if (isUsingPool)
{
DemoThreadPoolJob* newBall = new DemoThreadPoolJob();
balls.add (newBall);
addAndMakeVisible (newBall);
newBall->parentSizeChanged();
pool.addJob (newBall, false);
}
else
{
DemoThread* newBall = new DemoThread();
balls.add (newBall);
addAndMakeVisible (newBall);
newBall->parentSizeChanged();
}
}
void removeABall()
{
if (balls.size() > 0)
{
int indexToRemove = Random::getSystemRandom().nextInt (balls.size());
if (isUsingPool)
pool.removeJob (dynamic_cast <DemoThreadPoolJob*> (balls [indexToRemove]), true, 4000);
balls.remove (indexToRemove);
}
}
void timerCallback()
{
if (Random::getSystemRandom().nextBool())
{
if (balls.size() <= 10)
addABall();
}
else
{
if (balls.size() > 3)
removeABall();
}
}
void buttonClicked (Button*)
{
PopupMenu m;
m.addItem (1, "Use one thread per ball", true, ! isUsingPool);
m.addItem (2, "Use a thread pool", true, isUsingPool);
m.showMenuAsync (PopupMenu::Options().withTargetComponent (&controlButton),
ModalCallbackFunction::forComponent (menuItemChosenCallback, this));
}
static void menuItemChosenCallback (int result, ThreadingDemo* demoComponent)
{
if (demoComponent != 0)
demoComponent->setUsingPool (result == 2);
}
// this gets called when a component is added or removed from a parent component.
void parentHierarchyChanged()
{
// we'll use this as an opportunity to start and stop the threads, so that
// we don't leave them going when the component's not actually visible.
resetAllBalls();
}
private:
ThreadPool pool;
TextButton controlButton;
bool isUsingPool;
OwnedArray<Component> balls;
};
//==============================================================================
Component* createThreadingDemo()
{
return new ThreadingDemo();
}

+ 0
- 267
extras/JuceDemo/Source/demos/TreeViewDemo.cpp View File

@@ -1,267 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
//==============================================================================
class TreeViewDemoItem : public TreeViewItem
{
public:
TreeViewDemoItem (XmlElement& xml_)
: xml (xml_)
{
}
int getItemWidth() const
{
return xml.getIntAttribute ("width", -1);
}
String getUniqueName() const
{
return xml.getTagName();
}
bool mightContainSubItems()
{
return xml.getFirstChildElement() != 0;
}
void paintItem (Graphics& g, int width, int height)
{
// if this item is selected, fill it with a background colour..
if (isSelected())
g.fillAll (Colours::blue.withAlpha (0.3f));
// use a "colour" attribute in the xml tag for this node to set the text colour..
g.setColour (Colour::fromString (xml.getStringAttribute ("colour", "ff000000")));
g.setFont (height * 0.7f);
// draw the xml element's tag name..
g.drawText (xml.getTagName(),
4, 0, width - 4, height,
Justification::centredLeft, true);
}
void itemOpennessChanged (bool isNowOpen)
{
if (isNowOpen)
{
// if we've not already done so, we'll now add the tree's sub-items. You could
// also choose to delete the existing ones and refresh them if that's more suitable
// in your app.
if (getNumSubItems() == 0)
{
// create and add sub-items to this node of the tree, corresponding to
// each sub-element in the XML..
forEachXmlChildElement (xml, child)
{
jassert (child != 0);
addSubItem (new TreeViewDemoItem (*child));
}
}
}
else
{
// in this case, we'll leave any sub-items in the tree when the node gets closed,
// though you could choose to delete them if that's more appropriate for
// your application.
}
}
var getDragSourceDescription()
{
return "TreeView Items";
}
private:
XmlElement& xml;
};
//==============================================================================
class TreeViewDemo : public Component,
public DragAndDropContainer,
public ButtonListener
{
public:
//==============================================================================
TreeViewDemo()
: treeView (0),
thread ("Demo file tree thread"),
typeButton ("Type of treeview...")
{
setName ("Tree Views");
{
const String treeXmlString (BinaryData::treedemo_xml);
XmlDocument parser (treeXmlString);
treeXml = parser.getDocumentElement();
jassert (treeXml != nullptr);
}
rootItem = new TreeViewDemoItem (*treeXml);
rootItem->setOpen (true);
// find the root of the user's home drive, and set that as our root..
File folder (File::getSpecialLocation (File::userHomeDirectory));
while (folder.getParentDirectory() != folder)
folder = folder.getParentDirectory();
directoryList = new DirectoryContentsList (0, thread);
directoryList->setDirectory (folder, true, true);
thread.startThread (3);
addAndMakeVisible (&typeButton);
typeButton.addListener (this);
typeButton.setAlwaysOnTop (true);
typeButton.setTriggeredOnMouseDown (true);
showCustomTreeView();
}
~TreeViewDemo()
{
treeView = nullptr;
fileTreeComp = nullptr;
directoryList = nullptr; // (need to make sure this is deleted before the TimeSliceThread)
}
void paint (Graphics& g)
{
g.setColour (Colours::grey);
if (treeView != nullptr)
g.drawRect (treeView->getX(), treeView->getY(),
treeView->getWidth(), treeView->getHeight());
if (fileTreeComp != nullptr)
g.drawRect (fileTreeComp->getX(), fileTreeComp->getY(),
fileTreeComp->getWidth(), fileTreeComp->getHeight());
}
void resized()
{
if (treeView != nullptr)
treeView->setBoundsInset (BorderSize<int> (40, 10, 10, 10));
else if (fileTreeComp != nullptr)
fileTreeComp->setBoundsInset (BorderSize<int> (40, 10, 10, 10));
typeButton.changeWidthToFitText (22);
typeButton.setTopLeftPosition (10, 10);
}
void showCustomTreeView()
{
treeView = nullptr;
fileTreeComp = nullptr;
addAndMakeVisible (treeView = new TreeView());
treeView->setRootItem (rootItem);
treeView->setMultiSelectEnabled (true);
resized();
}
void showFileTreeComp()
{
treeView = nullptr;
fileTreeComp = nullptr;
addAndMakeVisible (fileTreeComp = new FileTreeComponent (*directoryList));
resized();
}
void buttonClicked (Button*)
{
PopupMenu m;
m.addItem (1, "Custom treeview showing an XML tree");
m.addItem (2, "FileTreeComponent showing the file system");
m.addSeparator();
m.addItem (3, "Show root item", true,
treeView != nullptr ? treeView->isRootItemVisible()
: fileTreeComp->isRootItemVisible());
m.addItem (4, "Show open/close buttons", true,
treeView != nullptr ? treeView->areOpenCloseButtonsVisible()
: fileTreeComp->areOpenCloseButtonsVisible());
m.showMenuAsync (PopupMenu::Options().withTargetComponent (&typeButton),
ModalCallbackFunction::forComponent (menuItemChosenCallback, this));
}
static void menuItemChosenCallback (int result, TreeViewDemo* demoComponent)
{
if (demoComponent != nullptr)
demoComponent->menuItemChosenCallback (result);
}
void menuItemChosenCallback (int result)
{
if (result == 1)
{
showCustomTreeView();
}
else if (result == 2)
{
showFileTreeComp();
}
else if (result == 3)
{
if (treeView != nullptr)
treeView->setRootItemVisible (! treeView->isRootItemVisible());
else if (fileTreeComp != nullptr)
fileTreeComp->setRootItemVisible (! fileTreeComp->isRootItemVisible());
}
else if (result == 4)
{
if (treeView != nullptr)
treeView->setOpenCloseButtonsVisible (! treeView->areOpenCloseButtonsVisible());
else if (fileTreeComp != nullptr)
fileTreeComp->setOpenCloseButtonsVisible (! fileTreeComp->areOpenCloseButtonsVisible());
}
}
private:
ScopedPointer <XmlElement> treeXml;
ScopedPointer <TreeViewItem> rootItem;
ScopedPointer <TreeView> treeView;
ScopedPointer <FileTreeComponent> fileTreeComp;
ScopedPointer <DirectoryContentsList> directoryList;
TimeSliceThread thread;
TextButton typeButton;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeViewDemo)
};
//==============================================================================
Component* createTreeViewDemo()
{
return new TreeViewDemo();
}

+ 0
- 143
extras/JuceDemo/Source/demos/WebBrowserDemo.cpp View File

@@ -1,143 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#include "../jucedemo_headers.h"
#if JUCE_WEB_BROWSER
//==============================================================================
/** We'll use a subclass of WebBrowserComponent to demonstrate how to get callbacks
when the browser changes URL. You don't need to do this, you can just also
just use the WebBrowserComponent class directly.
*/
class DemoBrowserComponent : public WebBrowserComponent
{
public:
//==============================================================================
DemoBrowserComponent (TextEditor& addressTextBox_)
: addressTextBox (addressTextBox_)
{
}
// This method gets called when the browser is about to go to a new URL..
bool pageAboutToLoad (const String& newURL)
{
// We'll just update our address box to reflect the new location..
addressTextBox.setText (newURL, false);
// we could return false here to tell the browser not to go ahead with
// loading the page.
return true;
}
private:
TextEditor& addressTextBox;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DemoBrowserComponent)
};
//==============================================================================
class WebBrowserDemo : public Component,
public TextEditor::Listener,
public ButtonListener
{
public:
//==============================================================================
WebBrowserDemo()
: goButton ("Go", "Go to URL"),
backButton ("<<", "Back"),
forwardButton (">>", "Forward")
{
setName ("Web Browser");
// Create an address box..
addAndMakeVisible (&addressTextBox);
addressTextBox.setTextToShowWhenEmpty ("Enter a web address, e.g. http://www.juce.com", Colours::grey);
addressTextBox.addListener (this);
// create the actual browser component
addAndMakeVisible (webView = new DemoBrowserComponent (addressTextBox));
// add some buttons..
addAndMakeVisible (&goButton);
goButton.addListener (this);
addAndMakeVisible (&backButton);
backButton.addListener (this);
addAndMakeVisible (&forwardButton);
forwardButton.addListener (this);
// send the browser to a start page..
webView->goToURL ("http://www.google.com");
}
~WebBrowserDemo()
{
}
void resized()
{
webView->setBounds (10, 45, getWidth() - 20, getHeight() - 55);
goButton.setBounds (getWidth() - 45, 10, 35, 25);
addressTextBox.setBounds (100, 10, getWidth() - 155, 25);
backButton.setBounds (10, 10, 35, 25);
forwardButton.setBounds (55, 10, 35, 25);
}
void textEditorTextChanged (TextEditor&) {}
void textEditorEscapeKeyPressed (TextEditor&) {}
void textEditorFocusLost (TextEditor&) {}
void textEditorReturnKeyPressed (TextEditor&)
{
webView->goToURL (addressTextBox.getText());
}
void buttonClicked (Button* b)
{
if (b == &backButton)
webView->goBack();
else if (b == &forwardButton)
webView->goForward();
else if (b == &goButton)
webView->goToURL (addressTextBox.getText());
}
private:
ScopedPointer<DemoBrowserComponent> webView;
TextEditor addressTextBox;
TextButton goButton, backButton, forwardButton;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebBrowserDemo)
};
//==============================================================================
Component* createWebBrowserDemo()
{
return new WebBrowserDemo();
}
#endif

+ 0
- 1407
extras/JuceDemo/Source/demos/WidgetsDemo.cpp
File diff suppressed because it is too large
View File


+ 0
- 67
extras/JuceDemo/Source/jucedemo_headers.h View File

@@ -1,67 +0,0 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __JUCEDEMO_HEADERS_JUCEHEADER__
#define __JUCEDEMO_HEADERS_JUCEHEADER__
// include the JUCE headers..
#include "../JuceLibraryCode/JuceHeader.h"
#if JUCE_IOS || JUCE_LINUX || JUCE_ANDROID
#undef JUCE_USE_CAMERA
#endif
// Pre-declare the functions that create each of the demo components..
Component* createFontsAndTextDemo();
Component* createRenderingDemo();
Component* createWidgetsDemo();
Component* createThreadingDemo();
Component* createTreeViewDemo();
Component* createTableDemo();
Component* createAudioDemo();
Component* createDragAndDropDemo();
Component* createInterprocessCommsDemo();
Component* createCodeEditorDemo();
#if JUCE_QUICKTIME && ! JUCE_LINUX
Component* createQuickTimeDemo();
#endif
#if JUCE_OPENGL
Component* createOpenGLDemo();
#endif
#if JUCE_WEB_BROWSER
Component* createWebBrowserDemo();
#endif
#if JUCE_USE_CAMERA
Component* createCameraDemo();
#endif
#if JUCE_DIRECTSHOW
Component* createDirectShowDemo();
#endif
#endif // __JUCEDEMO_HEADERS_JUCEHEADER__

Loading…
Cancel
Save