extern "C" void scsynth_android_initlogging() {
	SetPrintFunc((PrintFunc) *scvprintf_android);
	#ifndef NDEBUG
		scprintf("SCSYNTH->ANDROID logging active (no debug)\n");
	#else
		scprintf("SCSYNTH->ANDROID logging active (debug)\n");
	#endif
}
Exemplo n.º 2
0
int prBootInProcessServer(VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp;

	if (!gInternalSynthServer.mWorld) {
		SetPrintFunc(&vpost);
		WorldOptions options = kDefaultWorldOptions;

		PyrObject *optionsObj = a->uo;
		PyrSlot *optionsSlots = optionsObj->slots;

		static char mInputStreamsEnabled[512], mOutputStreamsEnabled[512], mDeviceName[512];
		int err;

		err = slotIntVal(optionsSlots + 0, (int*)&options.mNumAudioBusChannels);
		if (err) return err;

		err = slotIntVal(optionsSlots + 1, (int*)&options.mNumControlBusChannels);
		if (err) return err;

		err = slotIntVal(optionsSlots + 2, (int*)&options.mNumInputBusChannels);
		if (err) return err;

		err = slotIntVal(optionsSlots + 3, (int*)&options.mNumOutputBusChannels);
		if (err) return err;

		err = slotIntVal(optionsSlots + 4, (int*)&options.mNumBuffers);
		if (err) return err;

		err = slotIntVal(optionsSlots + 5, (int*)&options.mMaxNodes);
		if (err) return err;

		err = slotIntVal(optionsSlots + 6, (int*)&options.mMaxGraphDefs);
		if (err) return err;

		err = slotIntVal(optionsSlots + 8, (int*)&options.mBufLength);
		if (err) return err;

		if (NotNil(optionsSlots + 9)) {
			err = slotIntVal(optionsSlots + 9, (int*)&options.mPreferredHardwareBufferFrameSize);
			if (err) return err;
		}

		err = slotIntVal(optionsSlots + 10, (int*)&options.mRealTimeMemorySize);
		if (err) return err;

		err = slotIntVal(optionsSlots + 11, (int*)&options.mNumRGens);
		if (err) return err;

		err = slotIntVal(optionsSlots + 12, (int*)&options.mMaxWireBufs);
		if (err) return err;

		if (NotNil(optionsSlots + 13)) {
			err = slotIntVal(optionsSlots + 13, (int*)&options.mPreferredSampleRate);
			if (err) return err;
		}

		options.mLoadGraphDefs = IsTrue(optionsSlots + 14) ? 1 : 0;

		#ifdef SC_DARWIN
		err = slotStrVal(optionsSlots+15, mInputStreamsEnabled, 512);
		if(err) options.mInputStreamsEnabled = NULL;
		else options.mInputStreamsEnabled = mInputStreamsEnabled;

		err = slotStrVal(optionsSlots+16, mOutputStreamsEnabled, 512);
		if(err) options.mOutputStreamsEnabled = NULL;
		else options.mOutputStreamsEnabled = mOutputStreamsEnabled;
		#endif

		err = slotStrVal(optionsSlots+17, mDeviceName, 512);
		if(err) options.mInDeviceName = options.mOutDeviceName = NULL;
		else options.mInDeviceName = options.mOutDeviceName = mDeviceName;

		options.mNumSharedControls = gInternalSynthServer.mNumSharedControls;
		options.mSharedControls = gInternalSynthServer.mSharedControls;

		gInternalSynthServer.mWorld = World_New(&options);
	}

	return errNone;
}