44 .class_name =
"SoundSource",
96 OOJSReportError(context,
@"SoundSource() cannot be called as a function, it must be used as a constructor (as in new SoundSource()).");
113 if (!JSSoundSourceGetSoundSource(context,
this, &soundSource))
127 return JS_NewInt32(context, [soundSource repeatCount]);
136 return JS_NewNumber(context, [soundSource gain]);
156 if (!JSSoundSourceGetSoundSource(context,
this, &soundSource))
161 [soundSource
setSound:SoundFromJSValue(context, value)];
166 if ((bValue = JS_ToBool(context, value)) >= 0) {
191 if ((bValue = JS_ToBool(context, value)) >= 0) {
198 if (JS_ToFloat64(context, &fValue, value) == 0) {
286@implementation OOSoundSource (OOJavaScriptExtentions)
288- (JSValue)oo_jsValueInContext:(JSContext*)context
291 if (JS_IsException(result)) {
292 JS_FreeValue(context, JS_GetException(context));
295 JS_SetOpaque(result, [
self retain]);
302 return @"SoundSource";
OOINLINE double OOClamp_0_max_d(double value, double max) INLINE_CONST_FUNC
#define OOJS_END_FULL_NATIVE
#define OOJS_BEGIN_FULL_NATIVE(context)
#define OOJS_NATIVE_ENTER(cx)
void InitOOJSSoundSource(JSContext *context, JSObject *global)
static JSBool SoundSourceConstruct(JSContext *context, uintN argc, jsval *vp)
static JSBool SoundSourcePlay(JSContext *context, uintN argc, jsval *vp)
static JSClass sSoundSourceClass
static JSBool SoundSourcePlayOrRepeat(JSContext *context, uintN argc, jsval *vp)
static JSBool SoundSourceGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
static JSBool SoundSourceSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value)
static JSBool SoundSourceStop(JSContext *context, uintN argc, jsval *vp)
static JSFunctionSpec sSoundSourceMethods[]
@ kSoundSource_positional
@ kSoundSource_repeatCount
static JSPropertySpec sSoundSourceProperties[]
BOOL JSValueToVector(JSContext *context, jsval value, Vector *outVector) NONNULL_FUNC
JSBool OOJSObjectWrapperToString(JSContext *context, uintN argc, jsval *vp)
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
#define DEFINE_JS_OBJECT_GETTER(NAME, JSCLASS, JSPROTO, OBJCCLASSNAME)
void OOJSObjectWrapperFinalize(JSContext *context, JSObject *this)
#define OOJS_RETURN_OBJECT(o)
void OOJSReportBadPropertySelector(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec)
OOINLINE BOOL OOJSValueToInt32(JSContext *context, jsval value, int32_t *outValue)
void OOJSReportError(JSContext *context, NSString *format,...)
OOINLINE jsval OOJSValueFromBOOL(int b) INLINE_CONST_FUNC
void OOJSReportBadPropertyValue(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec, jsval value)
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)
void OOJSReportBadArguments(JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, NSString *message, NSString *expectedArgsDescription)
#define OOJS_RETURN_VECTOR(value)
static JSClassID sSoundSourceClassID
#define OOJS_PROPERTY_RW(name, getter, setter, magic)
#define OOJS_IS_CONSTRUCTING
JSValue OOJSNativeFailure(JSContext *context)
JSClassID OOJSRegisterClass(JSClassID *ioClassID, const JSClassDef *classDef)
#define OOJS_PROPERTY_RO(name, getter, magic)
JSValueConst OOJSInitClass(JSContext *context, JSValueConst global, JSClassID classID, JSValueConst parentPrototype, JSCFunction *constructor, int constructorArgCount, const JSCFunctionListEntry *properties, size_t propertyCount, const JSCFunctionListEntry *methods, size_t methodCount, const JSCFunctionListEntry *staticMethods, size_t staticMethodCount)
#define OOJS_COUNT(array)
NSString * oo_jsClassName()
void setPositional:(BOOL inPositional)
void setLoop:(BOOL inLoop)
void setRepeatCount:(uint8_t inCount)
void setGain:(float gain)
void setPosition:(Vector inPosition)
void setSound:(OOSound *inSound)