Skip to content

Commit

Permalink
Added android build files for the juce demo. Sockets fix. Updated the…
Browse files Browse the repository at this point in the history
… juce readme file in the docs folder.
  • Loading branch information
Julian Storer committed Mar 9, 2011
1 parent 0297ae5 commit b3e986b
Show file tree
Hide file tree
Showing 16 changed files with 245 additions and 989 deletions.
762 changes: 0 additions & 762 deletions docs/JUCE changelist.txt

This file was deleted.

292 changes: 108 additions & 184 deletions docs/JUCE readme.html

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions extras/JuceDemo/Builds/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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:xlargeScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="JuceAppActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
1 change: 1 addition & 0 deletions extras/JuceDemo/Builds/Android/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is used to override default values used by the Ant build system.
37 changes: 37 additions & 0 deletions extras/JuceDemo/Builds/Android/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="Juce Demo" default="help">
<property file="local.properties"/>
<property file="build.properties"/>
<property file="default.properties"/>
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar"/>
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar"/>
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar"/>
</path>
<taskdef name="setup" classname="com.android.ant.SetupTask" classpathref="android.antlibs"/>
<target name="clean">
<exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
<arg value="--jobs=2"/>
<arg value="clean"/>
</exec>
</target>
<exec executable="ln" dir="${basedir}" failonerror="false">
<arg value="-s"/>
<arg value="${basedir}/../../../../../juce/src/native/android/java/"/>
<arg value="src/com/juce"/>
</exec>
<target name="debug">
<exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
<arg value="--jobs=2"/>
<arg value="CONFIG=Debug"/>
</exec>
</target>
<target name="release">
<exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
<arg value="--jobs=2"/>
<arg value="CONFIG=Release"/>
</exec>
</target>
<setup/>
</project>
4 changes: 4 additions & 0 deletions extras/JuceDemo/Builds/Android/default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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-9
44 changes: 44 additions & 0 deletions extras/JuceDemo/Builds/Android/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Automatically generated makefile, created by the Jucer
# Don't edit this file! Your changes will be overwritten when you re-save the Jucer project!

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CPP_EXTENSION := cpp
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/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\
../../../JuceLibraryCode/JuceLibraryCode1.cpp\
../../../JuceLibraryCode/JuceLibraryCode2.cpp\
../../../JuceLibraryCode/JuceLibraryCode3.cpp\
../../../JuceLibraryCode/JuceLibraryCode4.cpp\

ifeq ($(CONFIG),Debug)
LOCAL_CPPFLAGS += -fsigned-char -fexceptions -frtti -g -O0 -D "JUCE_ANDROID=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
else
LOCAL_CPPFLAGS += -fsigned-char -fexceptions -frtti -Os -D "JUCE_ANDROID=1" -D "NDEBUG=1" -D "JUCE_UNIT_TESTS=1" -D "JUCER_ANDROID_7F0E4A25=1"
endif

include $(BUILD_SHARED_LIBRARY)
5 changes: 5 additions & 0 deletions extras/JuceDemo/Builds/Android/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Automatically generated makefile, created by the Jucer
# Don't edit this file! Your changes will be overwritten when you re-save the Jucer project!

APP_STL := gnustl_static
APP_CPPFLAGS += -fsigned-char -fexceptions -frtti
6 changes: 6 additions & 0 deletions extras/JuceDemo/Builds/Android/local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is used to override default values used by the Ant build system.
# It is automatically generated by the Jucer - DO NOT EDIT IT or your changes will be lost!.

sdk.dir=${user.home}/SDKs/android-sdk-mac_86
ndk.dir=${user.home}/SDKs/android-ndk-r5

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions extras/JuceDemo/Builds/Android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<resources>
<string name="app_name">Juce Demo</string>
</resources>
2 changes: 1 addition & 1 deletion extras/JuceDemo/Juce Demo.jucer
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<VS2010 targetFolder="Builds/VisualStudio2010" vstFolder="c:\SDKs\vstsdk2.4"
rtasFolder="c:\SDKs\PT_80_SDK" libraryType="1" juceFolder="../../../juce"/>
<ANDROID targetFolder="Builds/Android" androidSDKPath="${user.home}/SDKs/android-sdk-mac_86"
androidNDKPath="${user.home}/SDKs/android-ndk-r4-crystax" juceFolder="../../../juce"
androidNDKPath="${user.home}/SDKs/android-ndk-r5" juceFolder="../../../juce"
androidInternetNeeded="1"/>
</EXPORTFORMATS>
<CONFIGURATIONS>
Expand Down
29 changes: 9 additions & 20 deletions juce_amalgamated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8993,32 +8993,21 @@ BEGIN_JUCE_NAMESPACE

namespace SocketHelpers
{
#if JUCE_WINDOWS
class WinSocketStarter : public DeletedAtShutdown
void initSockets()
{
public:
WinSocketStarter()
#if JUCE_WINDOWS
static bool socketsStarted = false;

if (! socketsStarted)
{
socketsStarted = true;

WSADATA wsaData;
const WORD wVersionRequested = MAKEWORD (1, 1);
WSAStartup (wVersionRequested, &wsaData);
}

~WinSocketStarter()
{
WSACleanup();
clearSingletonInstance();
}

juce_DeclareSingleton (WinSocketStarter, false);
};

juce_ImplementSingleton (WinSocketStarter);

void initSockets() { WinSocketStarter::getInstance(); }
#else
void initSockets() {}
#endif
#endif
}

bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) throw()
{
Expand Down
31 changes: 9 additions & 22 deletions src/io/network/juce_Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ BEGIN_JUCE_NAMESPACE
#include "juce_Socket.h"
#include "../../threads/juce_ScopedLock.h"
#include "../../threads/juce_Thread.h"
#include "../../utilities/juce_DeletedAtShutdown.h"
#include "../../core/juce_Singleton.h"

#if JUCE_WINDOWS
typedef int juce_socklen_t;
Expand All @@ -72,32 +70,21 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
namespace SocketHelpers
{
#if JUCE_WINDOWS
class WinSocketStarter : public DeletedAtShutdown
void initSockets()
{
public:
WinSocketStarter()
#if JUCE_WINDOWS
static bool socketsStarted = false;

if (! socketsStarted)
{
socketsStarted = true;

WSADATA wsaData;
const WORD wVersionRequested = MAKEWORD (1, 1);
WSAStartup (wVersionRequested, &wsaData);
}

~WinSocketStarter()
{
WSACleanup();
clearSingletonInstance();
}

juce_DeclareSingleton (WinSocketStarter, false);
};

juce_ImplementSingleton (WinSocketStarter);

void initSockets() { WinSocketStarter::getInstance(); }
#else
void initSockets() {}
#endif
#endif
}

bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) throw()
{
Expand Down

0 comments on commit b3e986b

Please sign in to comment.