本文整理汇总了Java中javax.media.Player.stop方法的典型用法代码示例。如果您正苦于以下问题:Java Player.stop方法的具体用法?Java Player.stop怎么用?Java Player.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.Player
的用法示例。
在下文中一共展示了Player.stop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: blockingPrefetch
import javax.media.Player; //导入方法依赖的package包/类
/**
* A wrapper around StateWaiter's <tt>blockingPrefetch<tt>
* that stops the Player if necessary before testing state.
* If Controller state is less than <tt>Prefetched</tt>, then
* Controller is moved to this state.
*
* This method performs a slight optimization by checking whether
* Controller is already in the <tt>Prefetched</tt> state.
* If so, return is immediate.
*
* @param player A javax.media.Player
@ @see ejmf.toolkit.util.StateWaiter
*/
private boolean blockingPrefetch(Player player) {
int state = player.getState();
if (state == Controller.Prefetched) {
return true;
}
if (state == Controller.Started) {
player.stop();
}
if (state < Controller.Prefetched) {
StateWaiter sw = new StateWaiter(player);
return sw.blockingPrefetch();
}
return true;
}
示例2: forceRealized
import javax.media.Player; //导入方法依赖的package包/类
private void forceRealized(TrackList tracks) {
for (int i = 0; i < tracks.getNumberOfTracks(); i++) {
Track track = tracks.getTrack(i);
if (track.isAssigned()) {
Player player = track.getPlayer();
int state = player.getState();
if (state == Controller.Started) {
player.stop();
}
if (state > Controller.Realized) {
player.deallocate();
}
}
}
}
示例3: stop
import javax.media.Player; //导入方法依赖的package包/类
/**
* Stop the timer and stop any started Players.
*/
public void stop() {
timer.stop();
for (int i = 0; i < tracks.getNumberOfTracks(); i++) {
Track track = tracks.getTrack(i);
if (track.isAssigned()) {
Player player = track.getPlayer();
if (player.getTargetState() == Controller.Started) {
player.stop();
}
}
}
}
示例4: destroyPlayer
import javax.media.Player; //导入方法依赖的package包/类
public void destroyPlayer(Player p) {
if (p == null)
return;
p.stop();
try {
p.deallocate();
} catch (ClockStartedError localClockStartedError) {
}
p.close();
}