当前位置: 首页>>代码示例>>Java>>正文


Java SoundController.stopTrack方法代码示例

本文整理汇总了Java中itdelatrisu.opsu.audio.SoundController.stopTrack方法的典型用法代码示例。如果您正苦于以下问题:Java SoundController.stopTrack方法的具体用法?Java SoundController.stopTrack怎么用?Java SoundController.stopTrack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在itdelatrisu.opsu.audio.SoundController的用法示例。


在下文中一共展示了SoundController.stopTrack方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: leave

import itdelatrisu.opsu.audio.SoundController; //导入方法依赖的package包/类
@Override
public void leave() {
	super.leave();

	focusComponent(search);
	SoundController.stopTrack();
	MusicController.resume();
}
 
开发者ID:yugecin,项目名称:opsu-dance,代码行数:9,代码来源:DownloadsMenu.java

示例2: leave

import itdelatrisu.opsu.audio.SoundController; //导入方法依赖的package包/类
@Override
public void leave(GameContainer container, StateBasedGame game)
		throws SlickException {
	search.setFocus(false);
	serverMenu.deactivate();
	SoundController.stopTrack();
	MusicController.resume();
}
 
开发者ID:itdelatrisu,项目名称:opsu,代码行数:9,代码来源:DownloadsMenu.java

示例3: close_sub

import itdelatrisu.opsu.audio.SoundController; //导入方法依赖的package包/类
/**
 * Actions to perform before destroying the game container.
 */
private void close_sub() {
	// save user options
	Options.saveOptions();

	// reset cursor
	UI.getCursor().reset();

	// destroy images
	InternalTextureLoader.get().clear();

	// reset image references
	GameImage.clearReferences();
	GameData.Grade.clearReferences();
	Beatmap.clearBackgroundImageCache();

	// prevent loading tracks from re-initializing OpenAL
	MusicController.reset();

	// stop any playing track
	SoundController.stopTrack();

	// reset BeatmapSetList data
	BeatmapGroup.set(BeatmapGroup.ALL);
	BeatmapSortOrder.set(BeatmapSortOrder.TITLE);
	if (BeatmapSetList.get() != null)
		BeatmapSetList.get().reset();

	// delete OpenGL objects involved in the Curve rendering
	CurveRenderState.shutdown();
	LegacyCurveRenderState.shutdown();

	// destroy watch service
	if (!Options.isWatchServiceEnabled())
		BeatmapWatchService.destroy();
	BeatmapWatchService.removeListeners();

	// delete temporary directory
	Utils.deleteDirectory(Options.TEMP_DIR);
}
 
开发者ID:itdelatrisu,项目名称:opsu,代码行数:43,代码来源:Container.java

示例4: preRenderUpdate

import itdelatrisu.opsu.audio.SoundController; //导入方法依赖的package包/类
@Override
public void preRenderUpdate() {
	super.preRenderUpdate();

	int delta = displayContainer.renderDelta;
	UI.update(delta);
	if (importThread == null)
		MusicController.loopTrackIfEnded(false);
	else if (importThread.isFinished()) {
		BeatmapSetNode importedNode = importThread.getImportedBeatmap();
		if (importedNode != null) {
			// stop preview
			previewID = -1;
			SoundController.stopTrack();

			// initialize song list
			BeatmapSetList.get().reset();
			BeatmapSetList.get().init();

			// focus new beatmap
			// NOTE: This can't be called in another thread because it makes OpenGL calls.
			songMenuState.setFocus(importedNode, -1, true, true);
		}
		importThread = null;
	}
	int mouseX = displayContainer.mouseX;
	int mouseY = displayContainer.mouseY;
	UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
	prevPage.hoverUpdate(delta, mouseX, mouseY);
	nextPage.hoverUpdate(delta, mouseX, mouseY);
	clearButton.hoverUpdate(delta, mouseX, mouseY);
	importButton.hoverUpdate(delta, mouseX, mouseY);
	resetButton.hoverUpdate(delta, mouseX, mouseY);
	rankedButton.hoverUpdate(delta, mouseX, mouseY);

	if (DownloadList.get() != null)
		startDownloadIndexPos.setMinMax(0, DownloadNode.getInfoHeight() * (DownloadList.get().size() -  DownloadNode.maxDownloadsShown()));
	startDownloadIndexPos.update(delta);
	if (resultList != null)
		startResultPos.setMinMax(0, DownloadNode.getButtonOffset() * (resultList.length - DownloadNode.maxResultsShown()));
	startResultPos.update(delta);

	// focus timer
	if (focusResult != -1 && focusTimer < FOCUS_DELAY)
		focusTimer += delta;

	// search
	searchTimer += delta;
	if (searchTimer >= SEARCH_DELAY && importThread == null) {
		searchTimer = 0;
		searchTimerReset = false;

		String query = search.getText().trim().toLowerCase();
		DownloadServer server = serverMenu.getSelectedItem();
		if ((lastQuery == null || !query.equals(lastQuery)) &&
		    (query.length() == 0 || query.length() >= server.minQueryLength())) {
			lastQuery = query;
			lastQueryDir = pageDir;

			if (queryThread != null && queryThread.isAlive()) {
				queryThread.interrupt();
				if (searchQuery != null)
					searchQuery.interrupt();
			}

			// execute query
			searchQuery = new SearchQuery(query, server);
			queryThread = new Thread(searchQuery);
			queryThread.start();
		}
	}

	// tooltips
	if (resetButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Reset the current search.", false);
	else if (rankedButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Toggle the display of unranked maps.\nSome download servers may not support this option.", true);
	else if (serverMenu.baseContains(mouseX, mouseY))
		UI.updateTooltip(delta, "Select a download server.", false);
}
 
开发者ID:yugecin,项目名称:opsu-dance,代码行数:81,代码来源:DownloadsMenu.java

示例5: update

import itdelatrisu.opsu.audio.SoundController; //导入方法依赖的package包/类
@Override
public void update(GameContainer container, StateBasedGame game, int delta)
		throws SlickException {
	UI.update(delta);
	if (importThread == null)
		MusicController.loopTrackIfEnded(false);
	else if (importThread.isFinished()) {
		BeatmapSetNode importedNode = importThread.getImportedBeatmap();
		if (importedNode != null) {
			// stop preview
			previewID = -1;
			SoundController.stopTrack();

			// initialize song list
			BeatmapSetList.get().reset();
			BeatmapSetList.get().init();

			// focus new beatmap
			// NOTE: This can't be called in another thread because it makes OpenGL calls.
			((SongMenu) game.getState(Opsu.STATE_SONGMENU)).setFocus(importedNode, -1, true, true);
		}
		importThread = null;
	}
	int mouseX = input.getMouseX(), mouseY = input.getMouseY();
	UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
	prevPage.hoverUpdate(delta, mouseX, mouseY);
	nextPage.hoverUpdate(delta, mouseX, mouseY);
	clearButton.hoverUpdate(delta, mouseX, mouseY);
	importButton.hoverUpdate(delta, mouseX, mouseY);
	resetButton.hoverUpdate(delta, mouseX, mouseY);
	rankedButton.hoverUpdate(delta, mouseX, mouseY);

	if (DownloadList.get() != null)
		startDownloadIndexPos.setMinMax(0, DownloadNode.getInfoHeight() * (DownloadList.get().size() -  DownloadNode.maxDownloadsShown()));
	startDownloadIndexPos.update(delta);
	if (resultList != null)
		startResultPos.setMinMax(0, DownloadNode.getButtonOffset() * (resultList.length - DownloadNode.maxResultsShown()));
	startResultPos.update(delta);

	// focus timer
	if (focusResult != -1 && focusTimer < FOCUS_DELAY)
		focusTimer += delta;

	// search
	search.setFocus(true);
	searchTimer += delta;
	if (searchTimer >= SEARCH_DELAY && importThread == null) {
		searchTimer = 0;
		searchTimerReset = false;

		String query = search.getText().trim().toLowerCase();
		DownloadServer server = serverMenu.getSelectedItem();
		if ((lastQuery == null || !query.equals(lastQuery)) &&
		    (query.length() == 0 || query.length() >= server.minQueryLength())) {
			lastQuery = query;
			lastQueryDir = pageDir;

			if (queryThread != null && queryThread.isAlive()) {
				queryThread.interrupt();
				if (searchQuery != null)
					searchQuery.interrupt();
			}

			// execute query
			searchQuery = new SearchQuery(query, server);
			queryThread = new Thread(searchQuery);
			queryThread.start();
		}
	}

	// tooltips
	if (resetButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Reset the current search.", false);
	else if (rankedButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Toggle the display of unranked maps.\nSome download servers may not support this option.", true);
	else if (serverMenu.baseContains(mouseX, mouseY))
		UI.updateTooltip(delta, "Select a download server.", false);
}
 
开发者ID:itdelatrisu,项目名称:opsu,代码行数:79,代码来源:DownloadsMenu.java


注:本文中的itdelatrisu.opsu.audio.SoundController.stopTrack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。