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


Java PlaybackEvent类代码示例

本文整理汇总了Java中javazoom.jl.player.advanced.PlaybackEvent的典型用法代码示例。如果您正苦于以下问题:Java PlaybackEvent类的具体用法?Java PlaybackEvent怎么用?Java PlaybackEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: close

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
protected void close() {
	this.playing = false;
	if (this.listener != null)
	{
		this.listener.playbackFinished(createEvent(PlaybackEvent.STOPPED));
	}
	if (this.source != null) {
		AL10.alSourceStop(this.source);
		AL10.alDeleteSources(this.source);
		this.source = null;
	}
	if (this.buffer != null) {
		AL10.alDeleteBuffers(this.buffer);
		this.buffer = null;
	}
}
 
开发者ID:PC-Logix,项目名称:OpenFM,代码行数:17,代码来源:AudioPlayer.java

示例2: play

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
public void play() throws UnsupportedAudioFileException, IOException {
	AudioInputStream in = (AudioInputStream) this.stream;

	final AudioFormat outFormat = getOutFormat(in.getFormat());

	this.source = BufferUtils.createIntBuffer(1);

	AL10.alGenSources(this.source);
	if (alError()) {
		close();
		return;
	}

	AL10.alSourcei(this.source.get(0), AL10.AL_LOOPING, AL10.AL_FALSE);
	AL10.alSourcef(this.source.get(0), AL10.AL_PITCH, 1.0f);
	AL10.alSourcef(this.source.get(0), AL10.AL_GAIN, this.volume * Minecraft.getMinecraft().gameSettings.getSoundLevel(SoundCategory.RECORDS));

	if (alError()) {
		close();
		return;
	}

	this.playing = true;
	if (this.listener != null)
	{
		this.listener.playbackStarted(createEvent(PlaybackEvent.STARTED));
	}
	stream(AudioSystem.getAudioInputStream(outFormat, in));

	if (this.playing) {
		while (AL10.alGetSourcei(this.source.get(0), AL10.AL_SOURCE_STATE) == AL10.AL_PLAYING) {
			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {}
		}
	}

	close();
}
 
开发者ID:PC-Logix,项目名称:OpenFM,代码行数:40,代码来源:AudioPlayer.java

示例3: playbackFinished

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackFinished(PlaybackEvent event) {
    
	thread.interrupt();
	
    if( looped ){ 
    	play( file, looped );
    }else{
    	stopped = true;
    }

}
 
开发者ID:MrBrax,项目名称:unifrog,代码行数:13,代码来源:unisound.java

示例4: addPlaybackStartedListener

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
public void addPlaybackStartedListener(Consumer<PlaybackEvent> listener) {
    playbackStartedListeners.add(listener);
}
 
开发者ID:sparkled,项目名称:sparkled,代码行数:4,代码来源:AggregatePlaybackListener.java

示例5: addPlaybackFinishedListener

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
public void addPlaybackFinishedListener(Consumer<PlaybackEvent> listener) {
    playbackFinishedListeners.add(listener);
}
 
开发者ID:sparkled,项目名称:sparkled,代码行数:4,代码来源:AggregatePlaybackListener.java

示例6: playbackStarted

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackStarted(PlaybackEvent event) {
    playbackStartedListeners.forEach(l -> l.accept(event));
}
 
开发者ID:sparkled,项目名称:sparkled,代码行数:5,代码来源:AggregatePlaybackListener.java

示例7: playbackFinished

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackFinished(PlaybackEvent event) {
    playbackFinishedListeners.forEach(l -> l.accept(event));
}
 
开发者ID:sparkled,项目名称:sparkled,代码行数:5,代码来源:AggregatePlaybackListener.java

示例8: addPlaybackFinishedListener

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void addPlaybackFinishedListener(Consumer<PlaybackEvent> playbackListener) {
    this.playbackListener.addPlaybackFinishedListener(playbackListener);
}
 
开发者ID:sparkled,项目名称:sparkled,代码行数:5,代码来源:SongPlayerServiceImpl.java

示例9: playbackStarted

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackStarted(PlaybackEvent evt) {
}
 
开发者ID:kuhnmi,项目名称:jukefox,代码行数:4,代码来源:MiniPlayer.java

示例10: playbackStopped

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackStopped(PlaybackEvent evt) {
}
 
开发者ID:kuhnmi,项目名称:jukefox,代码行数:4,代码来源:MiniPlayer.java

示例11: playbackCompleted

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
@Override
public void playbackCompleted(PlaybackEvent evt) {
	fireOnSongCompletedEvent();
}
 
开发者ID:kuhnmi,项目名称:jukefox,代码行数:5,代码来源:MiniPlayer.java

示例12: addPlaybackFinishedListener

import javazoom.jl.player.advanced.PlaybackEvent; //导入依赖的package包/类
/**
 * @param playbackListener The playback listener to register.
 */
void addPlaybackFinishedListener(Consumer<PlaybackEvent> playbackListener);
 
开发者ID:sparkled,项目名称:sparkled,代码行数:5,代码来源:SongPlayerService.java


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