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


Java Player.stop方法代码示例

本文整理汇总了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;
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:31,代码来源:MultiPlayerControl.java

示例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();
	}
    }
}
    }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:17,代码来源:TimerMultiPlayerControl.java

示例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();
        }
    }
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:16,代码来源:TimerMultiPlayerControl.java

示例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();
}
 
开发者ID:ShiftMediaProject,项目名称:libbluray,代码行数:11,代码来源:Adapter.java


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