/*
-------------------- Initialization functions for the SoundManager2 class --------------------
*/
bool SoundManager2::initialize( bool debug_flag ){
    setDebug( debug_flag );
    activate();
    setMusicVolume(255);
    setSoundEffectVolume(255);
    setMusicChannel(1);
    setSwapMusicChannel(2);
    setInitialSoundEffectChannel(3);    
    setSoundEffectChannel(getInitialSoundEffectChannel());
    setMaxChannels(64);

    bool initialized = FSOUND_Init (44100, getMaxChannels(), 0);

    if(isDebug()){
        printf("SoundManager Initialization (debug: %i):\n", isDebug());
        printf("\tActive: %i\n", isActive());
        printf("\tMusic Volume: %i\n", getMusicVolume());
        printf("\tSound Effect Volume: %i\n", getSoundEffectVolume());
        printf("\tSound Effect Channel: %i\n", getSoundEffectChannel());
        printf("\tMusic Channel: %i\n", getMusicChannel());
        printf("\tSwap Music Channel: %i\n", getSwapMusicChannel());
        printf("\tInitial Sound Effect Channel: %i\n", getInitialSoundEffectChannel());
        printf("\tMusic Channel: %i\n", getMusicChannel());
    }

    return initialized;

}
Esempio n. 2
0
JNIEXPORT int JNICALL 
Java_com_xperia64_timidityae_JNIHandler_loadSongTimidity(JNIEnv * env, jobject  obj, jstring song)
{
	// It would appear we have to do the following code every time a song is loaded
	// Don't you just love JNI+threading?
	
	// Must be called once to open output. Thank you mac_main for the NULL file list thing	
	if(!itIsDone)
	{	
		setMaxChannels((int)MAX_CHANNELS);
		(*timidity_play)(0, NULL);
		itIsDone=1;
	}
	int main_ret;
	char *filez[1];
	jboolean isCopy;
	//filez = malloc(sizeof(char*) * 1);
	filez[0]=(char*)(*env)->GetStringUTFChars(env, song, &isCopy);
	//main_ret = timidity_play_main(1, filez);
	(*ext_play_list)(1,filez);
(*env)->ReleaseStringUTFChars(env, song, filez[0]);
	finishAE();
	
	//(*theGoodEnv)->DeleteLocalRef(theGoodEnv, pushClazz);
    return 0;

}