本文整理汇总了Java中com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration.disableAudio方法的典型用法代码示例。如果您正苦于以下问题:Java LwjglApplicationConfiguration.disableAudio方法的具体用法?Java LwjglApplicationConfiguration.disableAudio怎么用?Java LwjglApplicationConfiguration.disableAudio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
的用法示例。
在下文中一共展示了LwjglApplicationConfiguration.disableAudio方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AudioManager
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入方法依赖的package包/类
public AudioManager(Undertailor undertailor) {
if (!AudioManager.audioReplaced) {
log.info("Manager will now try to replace the audio system.");
if (!LwjglApplicationConfiguration.disableAudio) {
try {
((com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio) Gdx.audio).dispose();
LwjglApplicationConfiguration config =
undertailor.getApplicationConfiguration();
Gdx.audio = new OpenALAudio(config.audioDeviceSimultaneousSources,
config.audioDeviceBufferCount, config.audioDeviceBufferSize);
AudioManager.audioReplaced = true;
log.info("Success.");
} catch (Throwable t) {
log.error("Failed.", t);
}
}
}
this.masterVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.musicVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.soundVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.sounds = new ObjectMap<>();
this.music = new ObjectMap<>();
}
示例2: play
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入方法依赖的package包/类
public static void play(Path f, int auto, boolean forceExit, Config config, PlayerConfig player, boolean songUpdated) {
if(config == null) {
config = readConfig();
}
try {
MainController main = new MainController(f, config, player, auto, songUpdated);
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.width = config.getResolution().width;
cfg.height = config.getResolution().height;
// fullscreen
cfg.fullscreen = config.isFullscreen();
// vSync
cfg.vSyncEnabled = config.isVsync();
cfg.backgroundFPS = config.getMaxFramePerSecond();
cfg.foregroundFPS = config.getMaxFramePerSecond();
cfg.title = MainController.VERSION;
cfg.audioDeviceBufferSize = config.getAudioDeviceBufferSize();
cfg.audioDeviceSimultaneousSources = config.getAudioDeviceSimultaneousSources();
cfg.forceExit = forceExit;
if(config.getAudioDriver() != Config.AUDIODRIVER_SOUND && config.getAudioDriver() != Config.AUDIODRIVER_AUDIODEVICE) {
LwjglApplicationConfiguration.disableAudio = true;
}
// System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL",
// "true");
new LwjglApplication(main, cfg);
// Lwjgl3ApplicationConfiguration cfg = new Lwjgl3ApplicationConfiguration();
//
// final int w = (int) RESOLUTION[config.getResolution()].width;
// final int h = (int) RESOLUTION[config.getResolution()].height;
// if (config.isFullscreen()) {
// DisplayMode d = null;
// for (DisplayMode display : cfg.getDisplayModes()) {
// System.out.println("available DisplayMode : w - " + display.width + " h - " + display.height
// + " refresh - " + display.refreshRate + " color bit - " + display.bitsPerPixel);
// if (display.width == w
// && display.height == h
// && (d == null || (d.refreshRate <= display.refreshRate && d.bitsPerPixel <= display.bitsPerPixel))) {
// d = display;
// }
// }
// if (d != null) {
// cfg.setFullscreenMode(d);
// } else {
// cfg.setWindowedMode(w, h);
// }
// } else {
// cfg.setWindowedMode(w, h);
// }
// // vSync
// cfg.useVsync(config.isVsync());
// cfg.setIdleFPS(config.getMaxFramePerSecond());
// cfg.setTitle(VERSION);
//
// cfg.setAudioConfig(config.getAudioDeviceSimultaneousSources(), config.getAudioDeviceBufferSize(), 1);
//
// new Lwjgl3Application(main, cfg);
} catch (Throwable e) {
e.printStackTrace();
Logger.getGlobal().severe(e.getClass().getName() + " : " + e.getMessage());
}
}