org.andengine.audio.sound.SoundFactory Java Examples

The following examples show how to use org.andengine.audio.sound.SoundFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Engine.java    From tilt-game-android with MIT License 4 votes vote down vote up
public Engine(final EngineOptions pEngineOptions) {
	/* Initialize Factory and Manager classes. */
	BitmapTextureAtlasTextureRegionFactory.reset();
	SoundFactory.onCreate();
	MusicFactory.onCreate();
	FontFactory.onCreate();
	this.mVertexBufferObjectManager.onCreate();
	this.mTextureManager.onCreate();
	this.mFontManager.onCreate();
	this.mShaderProgramManager.onCreate();

	/* Apply EngineOptions. */
	this.mEngineOptions = pEngineOptions;
	if (this.mEngineOptions.hasEngineLock()) {
		this.mEngineLock = pEngineOptions.getEngineLock();
	} else {
		this.mEngineLock = new EngineLock(false);
	}
	this.mCamera = pEngineOptions.getCamera();

	/* Touch. */
	if (this.mEngineOptions.getTouchOptions().needsMultiTouch()) {
		this.setTouchController(new MultiTouchController());
	} else {
		this.setTouchController(new SingleTouchController());
	}

	/* Audio. */
	if (this.mEngineOptions.getAudioOptions().needsSound()) {
		this.mSoundManager = new SoundManager(this.mEngineOptions.getAudioOptions().getSoundOptions().getMaxSimultaneousStreams());
	} else {
		this.mSoundManager = null;
	}
	if (this.mEngineOptions.getAudioOptions().needsMusic()) {
		this.mMusicManager = new MusicManager();
	} else {
		this.mMusicManager = null;
	}

	/* Start the UpdateThread. */
	if (this.mEngineOptions.hasUpdateThread()) {
		this.mUpdateThread = this.mEngineOptions.getUpdateThread();
	} else {
		this.mUpdateThread = new UpdateThread();
	}
	this.mUpdateThread.setEngine(this);
}
 
Example #2
Source File: Engine.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public Engine(final EngineOptions pEngineOptions) {
	/* Initialize Factory and Manager classes. */
	BitmapTextureAtlasTextureRegionFactory.reset();
	SoundFactory.onCreate();
	MusicFactory.onCreate();
	FontFactory.onCreate();
	this.mVertexBufferObjectManager.onCreate();
	this.mTextureManager.onCreate();
	this.mFontManager.onCreate();
	this.mShaderProgramManager.onCreate();

	/* Apply EngineOptions. */
	this.mEngineOptions = pEngineOptions;
	if(this.mEngineOptions.hasEngineLock()) {
		this.mEngineLock = pEngineOptions.getEngineLock();
	} else {
		this.mEngineLock = new EngineLock(false);
	}
	this.mCamera = pEngineOptions.getCamera();

	/* Touch. */
	if(this.mEngineOptions.getTouchOptions().needsMultiTouch()) {
		this.setTouchController(new MultiTouchController());
	} else {
		this.setTouchController(new SingleTouchController());
	}

	/* Audio. */
	if(this.mEngineOptions.getAudioOptions().needsSound()) {
		this.mSoundManager = new SoundManager(this.mEngineOptions.getAudioOptions().getSoundOptions().getMaxSimultaneousStreams());
	} else {
		this.mSoundManager = null;
	}
	if(this.mEngineOptions.getAudioOptions().needsMusic()) {
		this.mMusicManager = new MusicManager();
	} else {
		this.mMusicManager = null;
	}

	/* Start the UpdateThread. */
	if(this.mEngineOptions.hasUpdateThread()) {
		this.mUpdateThread = this.mEngineOptions.getUpdateThread();
	} else {
		this.mUpdateThread = new UpdateThread();
	}
	this.mUpdateThread.setEngine(this);
}