openalbridge/wrappers.c
changeset 2212 6b5da1a2765a
parent 2211 288360b78f30
child 2213 bd51bbf06033
equal deleted inserted replaced
2211:288360b78f30 2212:6b5da1a2765a
    73 		
    73 		
    74 #ifdef DEBUG
    74 #ifdef DEBUG
    75 		fprintf(stderr, "Fade-out: index %d quantity %d\n", index, quantity);
    75 		fprintf(stderr, "Fade-out: index %d quantity %d\n", index, quantity);
    76 #endif
    76 #endif
    77 		
    77 		
    78 		//save the volume desired after the fade
    78 		/*save the volume desired after the fade*/
    79 		alGetSourcef(Sources[index], AL_GAIN, &target_gain);
    79 		alGetSourcef(Sources[index], AL_GAIN, &target_gain);
    80 		if (target_gain > 1.0f || target_gain <= 0.0f)
    80 		if (target_gain > 1.0f || target_gain <= 0.0f)
    81 			target_gain = 1.0f;
    81 			target_gain = 1.0f;
    82 		
    82 		
    83 		alSourcePlay(Sources[index]);
    83 		alSourcePlay(Sources[index]);
   131 			usleep(10000);
   131 			usleep(10000);
   132 		}
   132 		}
   133 		
   133 		
   134 		AlGetError("ERROR %d: Setting fade out volume\n");
   134 		AlGetError("ERROR %d: Setting fade out volume\n");
   135 		
   135 		
   136 		//stop that sound and reset its volume
   136 		/*stop that sound and reset its volume*/
   137 		alSourceStop (Sources[index]);
   137 		alSourceStop (Sources[index]);
   138 		alSourcef (Sources[index], AL_GAIN, old_gain);	
   138 		alSourcef (Sources[index], AL_GAIN, old_gain);	
   139 		
   139 		
   140 #ifndef _WIN32
   140 #ifndef _WIN32
   141 		pthread_exit(NULL);
   141 		pthread_exit(NULL);