Permalink
Browse files

QtCollider: synchronize with main SC repository

  • Loading branch information...
2 parents 50252d3 + 6a8dfd9 commit e005113e138f13d71a555a8476e27831a033d53b @jleben jleben committed Feb 4, 2011
Showing with 4,752 additions and 108 deletions.
  1. +23 −5 CMakeLists.txt
  2. +5 −0 INSTALL
  3. +13 −1 README
  4. +1 −1 SCClassLibrary/Common/Audio/Env.sc
  5. +4 −0 editors/scapp/CocoaBridgePrimitives.M
  6. +16 −9 editors/scapp/GUIPrimitives.M
  7. +14 −6 editors/scapp/SCImage.M
  8. +4 −0 editors/scapp/SCVirtualMachine.M
  9. +4 −0 editors/scapp/UserPanel.M
  10. +12 −2 editors/scapp/include/SCImage.h
  11. +1 −1 external_libraries/nova-simd
  12. +4 −7 include/plugin_interface/SC_RGen.h
  13. +2 −2 include/plugin_interface/sc_msg_iter.h
  14. +12 −8 lang/CMakeLists.txt
  15. +95 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Error_Handler.c
  16. +75 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Error_Handler.h
  17. +348 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Name_Lookup.c
  18. +88 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Name_Lookup.h
  19. +633 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Queue_Utilities.c
  20. +114 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Queue_Utilities.h
  21. +2,199 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Utilities.c
  22. +257 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Utilities.h
  23. +473 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Utilities_External.h
  24. +54 −0 lang/LangPrimSource/HID_Utilities_10_4/HID_Utilities_Internal.h
  25. +105 −2 lang/LangPrimSource/SC_HID.cpp
  26. +1 −3 lang/LangPrimSource/SC_Wii.cpp
  27. +6 −3 package/package
  28. +41 −0 platform/README JAILBROKEN IPHONE.txt
  29. +2 −2 platform/iphone/iPhone_Language.xcodeproj/project.pbxproj
  30. +79 −0 platform/iphone/iPhone_Synth.xcodeproj/project.pbxproj
  31. +19 −7 platform/mac/CMakeLists.txt
  32. +1 −1 server/plugins/BinaryOpUGens.cpp
  33. +10 −2 server/plugins/CMakeLists.txt
  34. +1 −1 server/plugins/DelayUGens.cpp
  35. +29 −40 server/plugins/GrainUGens.cpp
  36. +1 −1 server/plugins/LFUGens.cpp
  37. +2 −2 server/plugins/TriggerUGens.cpp
  38. +1 −0 server/supernova/dsp_thread_queue/dsp_thread_queue.hpp
  39. +1 −1 server/supernova/sc/sc_osc_handler.cpp
  40. +2 −1 server/supernova/utilities/callback_interpreter.hpp
View
@@ -26,6 +26,17 @@ ADD_CUSTOM_TARGET(setMainVersion ALL
VERBATIM
)
+if(APPLE)
+ STRING(REGEX REPLACE "^.*MacOSX10.([0-9]+).*$" "\\1" MAC_OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
+
+ if($MAC_OSX_SDK_VERSION GREATER 4)
+ set(HID_UTIL_DIR "HID_Utilities")
+ else()
+ set(HID_UTIL_DIR "HID_Utilities_10_4")
+ endif()
+ MESSAGE( STATUS "Using HID Utilities from folder '${HID_UTIL_DIR}'")
+endif()
+
#############################################
# Compiler flags etc
@@ -40,7 +51,7 @@ if (${CMAKE_COMPILER_IS_GNUCXX})
if(APPLE)
add_definitions("-D_REENTRANT")
- else()
+ elseif(NOT (WIN32 AND NOT CYGWIN))
add_definitions("-pthread")
endif()
endif ()
@@ -62,11 +73,14 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
endif()
if(WIN32)
- set_property(DIRECTORY
- APPEND
- PROPERTY COMPILE_DEFINITIONS SC_WIN32 NOMINMAX _WINSOCKAPI_)
+ set_property(DIRECTORY
+ APPEND
+ PROPERTY COMPILE_DEFINITIONS SC_WIN32 NOMINMAX _WINSOCKAPI_)
+
+ if(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} /MTd")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} /MT")
+ endif()
endif()
@@ -80,7 +94,11 @@ if (NOT PTHREADS_FOUND)
endif()
include_directories(${PTHREADS_INCLUDE_DIR})
-find_library(MATH_LIBRARY m)
+if (MSVC)
+ set(MATH_LIBRARY "")
+else()
+ find_library(MATH_LIBRARY m)
+endif()
if(CURL)
find_package(CURL)
View
@@ -0,0 +1,5 @@
+
+See the platform specific build and install instructions in:
+
+ platform/
+
View
14 README
@@ -1,4 +1,5 @@
Welcome to SuperCollider 3!
+***************************
This is a special version of SuperCollider that includes a new cross-platform GUI implementation using Qt framework. The new GUI is still in development and (probably) buggy, so you are kindly encouraged to test it thoroughly and report any problems to the author or to the SuperCollider development mailing list.
This version is regularly being updated with the latest development in the main SuperCollider version.
@@ -28,13 +29,24 @@ And be careful you're not using TextEdit or a web browser instead of the SuperCo
[Windows] The windows version of SuperCollider is called PsyCollider. Key commands differ from the Mac, but almost all code should work the same. The SwingOSC Java based GUI library is used here, however, for GUIs. You must use JMouseX/JMouseY in particular; PsyCollider does not support MouseX/MouseY UGens.
-[Linux] Most people use SuperCollider from emacs; there are some alternative editors available. For GUI building, the SwingOSC Java framework is a standard option. For more information on Linux specific issues, check the "README LINUX" file included in the source package, and the README in the folder editors/scel for information on the emacs editor.
+[Linux] Most people use SuperCollider from emacs; there are some alternative editors available. For GUI building, the SwingOSC Java framework is a standard option. For more information on Linux specific issues, check the "platform/README LINUX" file included in the source package, and the README in the folder editors/scel for information on the emacs editor.
+Building the Source Code
+========================
+
+Platform specific build and install instructions can be found in:
+
+ platform/
+
We hope you enjoy SuperCollider; please get involved in the active community!
+
+License
+=======
+
SuperCollider is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See "COPYING" for the license text.
@@ -80,7 +80,7 @@ Env {
}
asPseg {
- var c = if(curves.isSequenceableCollection.not) { curves } { Pseq(curves) };
+ var c = if(curves.isSequenceableCollection.not) { curves } { Pseq(curves, inf) };
^Pseg(Pseq(levels), Pseq(times ++ [1.0]), c) // last time is a dummy
}
@@ -38,6 +38,10 @@
#import "GC.h"
#import "SCVirtualMachine.h"
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+#define class_getName(a) ((a)->name)
+#endif
+
#define COCOABRIDGE_VERBOSITY 0
#define COCOABRIDGE_STORE_OBJECTS_IN_ARRAY 1 // Conditional for storing all created objects in an NSArray. For future test with special Pool.
#define COCOABRIDGE_AUTOCONVERT_NSSTRING 1 /* for backward compat. set to 0.
@@ -34,6 +34,13 @@
#import "SCNSWindow.h"
#import "SCCocoaView.h"
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+typedef float ColorData;
+#else
+typedef CGFloat ColorData;
+#endif
+
+
extern ChangeCounter gUIChangeCounter;
extern NSTextView* gPostView;
PyrSymbol *s_draw;
@@ -222,7 +229,7 @@ int prTextWindow_GetBackgroundColor(struct VMGlobals *g, int numArgsPushed)
if(!view) return errNone;
NSColor * color = [view backgroundColor];
if(!color) return errNone;
- CGFloat red, green, blue, alpha;
+ ColorData red, green, blue, alpha;
[color getRed:&red green:&green blue:&blue alpha:&alpha];
PyrSlot *slots = slotRawObject(b)->slots;
SetFloat(slots+0, red);
@@ -320,7 +327,7 @@ int prTextWindow_GetSelectedBackgroundColor(struct VMGlobals *g, int numArgsPush
if(!view) return errNone;
NSColor * color = [[[view selectedTextAttributes] objectForKey: NSBackgroundColorAttributeName] colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
if(!color) return errNone;
- CGFloat red, green, blue, alpha;
+ ColorData red, green, blue, alpha;
[color getRed:&red green:&green blue:&blue alpha:&alpha];
PyrSlot *slots = slotRawObject(b)->slots;
SetFloat(slots+0, red);
@@ -2934,7 +2941,7 @@ int prPen_SetShadow(struct VMGlobals *g, int numArgsPushed)
CGContextRef _ctx = (CGContextRef)[gctx graphicsPort];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- CGFloat colors[4];
+ ColorData colors[4];
colors[0] = scColor.red;
colors[1] = scColor.green;
colors[2] = scColor.blue;
@@ -3228,12 +3235,12 @@ int prPen_LineDash(struct VMGlobals *g, int numArgsPushed)
if( pyrclass == class_floatarray ) // float array only
{
- CGFloat *colors = (CGFloat *) malloc(pyrarray->size*sizeof(CGFloat));
+ ColorData *colors = (ColorData *) malloc(pyrarray->size*sizeof(ColorData));
int i;
float *src = ((PyrFloatArray *)pyrarray)->f;
for (i=0; i<pyrarray->size; i++)
{
- colors[i] = (CGFloat) *(src++);
+ colors[i] = (ColorData) *(src++);
}
CGContextSetLineDash(
(CGContextRef)[gctx graphicsPort],
@@ -3313,7 +3320,7 @@ typedef struct GradientInfo {
static GradientInfo gGradientInfo;
-static void GradientCalcLinear(void *info, const CGFloat *in, CGFloat *out)
+static void GradientCalcLinear(void *info, const ColorData *in, ColorData *out)
{
size_t k;
/*
@@ -3324,16 +3331,16 @@ static void GradientCalcLinear(void *info, const CGFloat *in, CGFloat *out)
}else{
*/
for (k = 0; k < 4; k++) {
- *out++ = (CGFloat)(((float *)(&gGradientInfo.color1))[k]) * (*in) + (CGFloat)(((float *)(&gGradientInfo.color0))[k]) * (1-(*in));
+ *out++ = (ColorData)(((float *)(&gGradientInfo.color1))[k]) * (*in) + (ColorData)(((float *)(&gGradientInfo.color0))[k]) * (1-(*in));
}
//}
}
static CGFunctionRef CreateGradientFunctionRef()
{
size_t components;
- static const CGFloat input_value_range [2] = { 0, 1 };
- static const CGFloat output_value_ranges [8] = { 0, 1, 0, 1, 0, 1, 0, 1 };
+ static const ColorData input_value_range [2] = { 0, 1 };
+ static const ColorData output_value_ranges [8] = { 0, 1, 0, 1, 0, 1, 0, 1 };
static const CGFunctionCallbacks callbacks = { 0,
&GradientCalcLinear,
NULL};
View
@@ -29,6 +29,14 @@
#include <stdio.h>
#include <math.h>
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+#define class_getSuperclass(a) ((a)->super_class)
+#define class_getName(a) ((a)->name)
+typedef float ColorData;
+#else
+typedef CGFloat ColorData;
+#endif
+
extern int slotGetPoint(PyrSlot* a, NSPoint *p);
extern int slotGetNSRect(PyrSlot* a, NSRect *r);
extern int allocSlotStrVal(PyrSlot *slot, char **str);
@@ -731,7 +739,7 @@ failure:
return [[self bitmapRepresentation] bitmapData];
}
--(void)setPixel:(NSUInteger *)pixel atX:(int)x y:(int)y
+-(void)setPixel:(PixelData *)pixel atX:(int)x y:(int)y
{
if([self isAccelerated])
[self syncBitmap];
@@ -747,7 +755,7 @@ failure:
[self setShouldSyncCIImage:YES];
}
--(void)getPixel:(NSUInteger *)pixel atX:(int)x y:(int)y
+-(void)getPixel:(PixelData *)pixel atX:(int)x y:(int)y
{
if([self isAccelerated])
[self syncBitmap];
@@ -1550,7 +1558,7 @@ int prSCImage_pixelAt(struct VMGlobals *g, int numArgsPushed)
int x, y, err;
SCImage *image;
- NSUInteger pixelAsArray[4] = {0, 0, 0, 0};
+ PixelData pixelAsArray[4] = {0, 0, 0, 0};
err = errNone;
@@ -1599,7 +1607,7 @@ int prSCImage_setPixelAt(struct VMGlobals *g, int numArgsPushed)
int x, y, err;
uint32 pixel;
- NSUInteger pixelData[4]={0, 0, 0, 0};
+ PixelData pixelData[4]={0, 0, 0, 0};
err = slotIntVal(pixelSlot, (int*)&pixel);
if(err) return err;
@@ -1756,7 +1764,7 @@ int prSCImage_loadPixels(struct VMGlobals *g, int numArgsPushed)
height = region.size.height;
width = region.size.width;
pixelsData = (uint32*)allocatedPixelArray->i + startIndex;
- NSUInteger pixel[4]={0, 0, 0, 0};
+ PixelData pixel[4]={0, 0, 0, 0};
if((allocatedPixelArray->size - startIndex) < ( height * width /** 4*/ ) ) {
post("Error: pixel array is not of good size ! should be %i bytes long\n", height * width /** 4*/);
@@ -2123,7 +2131,7 @@ BOOL nsClassIsKindOfClass(Class currentClass, Class match)
id ciVectorFromSlot(PyrObject* slot);
id ciVectorFromSlot(PyrObject* slot)
{
- CGFloat values[4] = {0.f, 0.f, 0.f, 0.f};
+ ColorData values[4] = {0.f, 0.f, 0.f, 0.f};
int size = slot->size, err;
for (int i=0; i < size; ++i) {
@@ -38,6 +38,10 @@
#include <pthread.h>
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+#define class_getName(a) ((a)->name)
+#endif
+
ChangeCounter gUIChangeCounter;
extern bool compiledOK;
@@ -28,6 +28,10 @@
#include "VMGlobals.h"
#include <pthread.h>
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+#define class_getName(a) ((a)->name)
+#endif
+
NSMutableArray *gUserPanels = nil;
extern PyrSymbol *s_doaction;
extern PyrSymbol *s_closed;
@@ -29,6 +29,8 @@
#import <QuartzCore/QuartzCore.h>
#import <sys/time.h>
+
+
#define SCIMAGE_DEBUG 0
#define SCIMAGE_BACKGROUND_DEBUG 0
#define SCIMAGE_FILTER_DEBUG 0
@@ -51,6 +53,14 @@
it just disable the possibility to use Dirty Rect wich should be considered as a marginal option for now.
*/
+
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
+typedef unsigned int PixelData;
+#else
+typedef NSUInteger PixelData;
+#endif
+
#define SCIMAGE_MAC_OS_10_4 (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
//#if defined(MAC_OS_X_VERSION_10_5)
//#define SCIMAGE_MAC_OS_10_5 (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
@@ -120,9 +130,9 @@ typedef int SCImageHint;
- (void)rebuildNSImageFromBitmapRep;
- (void)rebuildCIImageFromBitmapRep;
- (void)setDrawingHint:(SCImageHint)hint;
-- (void)setPixel:(NSUInteger *)pixel atX:(int)x y:(int)y;
+- (void)setPixel:(PixelData *)pixel atX:(int)x y:(int)y;
- (void)setColor:(NSColor*)color atX:(unsigned int)x y:(unsigned int)y;
-- (void)getPixel:(NSUInteger *)pixel atX:(int)x y:(int)y;
+- (void)getPixel:(PixelData *)pixel atX:(int)x y:(int)y;
- (NSColor*)colorAtX:(unsigned int)x y:(unsigned int)y;
- (void)setScalesWhenResized:(BOOL)yorn;
- (BOOL)scalesWhenResized;
Submodule nova-simd updated from 301a6f to 4081e2
@@ -101,19 +101,16 @@ inline uint32 trand( uint32& s1, uint32& s2, uint32& s3 )
// state variables are loaded into registers.
// Thus updating the instance variables can
// be postponed until the end of the loop.
- s1 = ((s1 & -2) << 12) ^ (((s1 << 13) ^ s1) >> 19);
- s2 = ((s2 & -8) << 4) ^ (((s2 << 2) ^ s2) >> 25);
- s3 = ((s3 & -16) << 17) ^ (((s3 << 3) ^ s3) >> 11);
+ s1 = ((s1 & (uint32)-2) << 12) ^ (((s1 << 13) ^ s1) >> 19);
+ s2 = ((s2 & (uint32)-8) << 4) ^ (((s2 << 2) ^ s2) >> 25);
+ s3 = ((s3 & (uint32)-16) << 17) ^ (((s3 << 3) ^ s3) >> 11);
return s1 ^ s2 ^ s3;
}
inline uint32 RGen::trand()
{
// generate a random 32 bit number
- s1 = ((s1 & -2) << 12) ^ (((s1 << 13) ^ s1) >> 19);
- s2 = ((s2 & -8) << 4) ^ (((s2 << 2) ^ s2) >> 25);
- s3 = ((s3 & -16) << 17) ^ (((s3 << 3) ^ s3) >> 11);
- return s1 ^ s2 ^ s3;
+ return ::trand(s1, s2, s3);
}
inline double RGen::drand()
@@ -264,7 +264,7 @@ inline void sc_msg_iter::getb(char* outArray, size_t size)
size_t len = OSCint(rdpos);
if (size < len) return;
rdpos += sizeof(int32);
- size_t len4 = (len + 3) & -4;
+ size_t len4 = (len + 3) & (size_t)-4;
memcpy(outArray, rdpos, size);
rdpos += len4;
count ++;
@@ -274,7 +274,7 @@ inline void sc_msg_iter::skipb()
{
size_t len = OSCint(rdpos);
rdpos += sizeof(int32);
- size_t len4 = (len + 3) & -4;
+ size_t len4 = (len + 3) & (size_t)-4;
rdpos += len4;
count ++;
}
Oops, something went wrong.

0 comments on commit e005113

Please sign in to comment.