本文整理汇总了Java中com.github.czyzby.autumn.mvc.component.sfx.MusicService类的典型用法代码示例。如果您正苦于以下问题:Java MusicService类的具体用法?Java MusicService怎么用?Java MusicService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MusicService类属于com.github.czyzby.autumn.mvc.component.sfx包,在下文中一共展示了MusicService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDefaultComponents
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
/** Invoked before context initiation.
*
* @param initializer should be used to registered default components, created with plain old Java. */
protected void addDefaultComponents(final ContextInitializer initializer) {
initializer.addComponents(
// PROCESSORS.
// Assets:
new AssetService(), new SkinAssetAnnotationProcessor(),
// Locale:
new LocaleService(),
// SFX:
new MusicEnabledAnnotationProcessor(), new MusicVolumeAnnotationProcessor(),
new SoundEnabledAnnotationProcessor(), new SoundVolumeAnnotationProcessor(),
// Settings:
new I18nBundleAnnotationProcessor(), new PreferenceAnnotationProcessor(), new SkinAnnotationProcessor(),
new StageViewportAnnotationProcessor(), new PreferencesService(),
// Interface:
new ViewAnnotationProcessor(), new ViewDialogAnnotationProcessor(),
new ViewActionContainerAnnotationProcessor(), new ViewStageAnnotationProcessor(),
new LmlMacroAnnotationProcessor(), new LmlParserSyntaxAnnotationProcessor(),
new AvailableLocalesAnnotationProcessor(),
// COMPONENTS.
// SFX:
new MusicService(),
// Interface:
interfaceService, new SkinService());
}
示例2: getDefaultViewShowingActionProvider
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
private ActionProvider getDefaultViewShowingActionProvider() {
return new ActionProvider() {
@Override
public Action provideAction(final ViewController forController, final ViewController previousController) {
if (musicService.getCurrentTheme() == null && GdxArrays.isNotEmpty(forController.getThemes())) {
final Music currentTheme = forController.getThemes().random();
return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(DEFAULT_FADING_TIME),
Actions.run(CommonActionRunnables.getMusicThemeSetterRunnable(musicService, currentTheme)),
Actions.run(CommonActionRunnables.getInputSetterRunnable(forController.getStage())),
MusicFadingAction.fadeIn(currentTheme, MusicService.DEFAULT_THEME_FADING_TIME,
musicService.getMusicVolume()));
}
return Actions.sequence(Actions.alpha(0f), Actions.fadeIn(DEFAULT_FADING_TIME),
Actions.run(CommonActionRunnables.getInputSetterRunnable(forController.getStage())));
}
};
}
示例3: act
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
@Override
public boolean act(final float delta) {
music.setVolume(MusicService.normalizeVolume(music.getVolume() + totalVolumeDifference * delta / time));
if (gettingLouder) {
if (music.getVolume() >= targetValue) {
music.setVolume(targetValue);
return true;
}
} else if (music.getVolume() <= targetValue) {
music.setVolume(targetValue);
return true;
}
return false;
}
示例4: getMusicThemeClearerRunnable
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
/** @param musicService contains current theme.
* @return will clear current theme on invocation. */
public static Runnable getMusicThemeClearerRunnable(final MusicService musicService) {
return CLEAR_THEME_RUNNABLE.setMusicService(musicService);
}
示例5: getMusicThemeSetterRunnable
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
/** @param musicService will contain theme.
* @param themeToSet will be set as current theme.
* @return will set current theme on invocation. */
public static Runnable getMusicThemeSetterRunnable(final MusicService musicService, final Music themeToSet) {
return SET_THEME_RUNNABLE.setData(musicService, themeToSet);
}
示例6: setMusicService
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentThemeClearerRunnable setMusicService(final MusicService musicService) {
this.musicService = musicService;
return this;
}
示例7: setData
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentThemeSetterRunnable setData(final MusicService musicService, final Music currentTheme) {
this.musicService = musicService;
this.currentTheme = currentTheme;
return this;
}
示例8: MusicVolumeChangeAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public MusicVolumeChangeAction(final MusicService musicService) {
this.musicService = musicService;
}
示例9: CurrentSoundStateAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentSoundStateAction(final MusicService musicService) {
this.musicService = musicService;
}
示例10: CurrentMusicStateAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentMusicStateAction(final MusicService musicService) {
this.musicService = musicService;
}
示例11: ToggleSoundAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public ToggleSoundAction(final MusicService musicService) {
this.musicService = musicService;
}
示例12: CurrentSoundVolumeAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentSoundVolumeAction(final MusicService musicService) {
this.musicService = musicService;
}
示例13: ToggleMusicAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public ToggleMusicAction(final MusicService musicService) {
this.musicService = musicService;
}
示例14: CurrentMusicVolumeAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public CurrentMusicVolumeAction(final MusicService musicService) {
this.musicService = musicService;
}
示例15: SoundVolumeChangeAction
import com.github.czyzby.autumn.mvc.component.sfx.MusicService; //导入依赖的package包/类
public SoundVolumeChangeAction(final MusicService musicService) {
this.musicService = musicService;
}