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


Java RateChangeEvent类代码示例

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


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

示例1: controllerUpdate

import javax.media.RateChangeEvent; //导入依赖的package包/类
/**
 * Listen for RateChangeEvents or MediaTimeSetEvents and
 * notify the StopTimeMonitor thread to recalculate its wait
 * time.  Also listen for StartEvents and StopEvents so that
 * the monitor will know whether the controller is playing.
 *
 * @param      e
 *             The ControllerEvent
 */
public synchronized void controllerUpdate(ControllerEvent e) {
    if( e instanceof StopTimeChangeEvent ||
        e instanceof RateChangeEvent || 
        e instanceof MediaTimeSetEvent ||
        e instanceof StartEvent ||
       (e instanceof StopEvent && ! (e instanceof DeallocateEvent) ) )
    {
        wokenUp = true;
        notifyAll();
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:21,代码来源:StopTimeMonitor.java

示例2: setRate

import javax.media.RateChangeEvent; //导入依赖的package包/类
/**
 * Set the temporal scale factor.  The argument
 * <i>suggests</i> the scale factor to use.
 * <p>
 * The <tt>setRate</tt> method returns the actual rate set
 * by the <tt>Clock</tt>. <tt>Clocks</tt> should set
 * their rate as close to the requested value as possible, but
 * are not required to set the rate to the exact value of any
 * argument other than 1.0.  A <tt>Clock</tt> is only
 * guaranteed to set its rate exactly to 1.0.
 *
 * @param      rate
 *             The temporal scale factor (rate) to set.
 *
 * @exception  NotRealizedError
 *             If the Controller is not Realized.
 *
 * @exception  ClockStartedError
 *             If the Controller is Started.
 *
 * @return     The actual rate set.
 *
 */
public synchronized float setRate(float rate) {
    if( currentState == Unrealized ||
        currentState == Realizing )
    {
        throw new NotRealizedError(
            "Cannot set rate on an Unrealized Controller.");
    }

    //  Save the current rate
    float oldRate = getRate();

    //  Enforce superclass reqs
    float superRate = super.setRate(rate);

    //  Set the rate in the subclass
    float subRate = doSetRate(superRate);

    //  If the rate has changed since setting in the
    //  superclass, set it agagin
    if( rate != 1.0F && superRate != subRate ) {
        superRate = super.setRate(subRate);

        //  If it has changed again, give up and set to the
        //  only rate guaranteed to be accepted
        if( superRate != subRate ) {
            return setRate(1.0F);
        }
    }

    //  If the rate has changed, commit it and post an event.
    if(superRate != oldRate) {
        postEvent( new RateChangeEvent(this, superRate) );
    }

    return superRate;
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:60,代码来源:AbstractController.java

示例3: doRateChanged

import javax.media.RateChangeEvent; //导入依赖的package包/类
protected void doRateChanged(float rate) {
    if (this.rate != rate) {
        this.rate = rate;
        notifyListeners(new RateChangeEvent(this, rate));
    }
}
 
开发者ID:ShiftMediaProject,项目名称:libbluray,代码行数:7,代码来源:BDHandler.java

示例4: doSetRate

import javax.media.RateChangeEvent; //导入依赖的package包/类
protected void doSetRate(Float factor) {
    if (rate != factor.floatValue()) {
        rate = factor.floatValue();
        notifyListeners(new RateChangeEvent(this, rate));
    }
}
 
开发者ID:ShiftMediaProject,项目名称:libbluray,代码行数:7,代码来源:BDHandler.java

示例5: controllerUpdate

import javax.media.RateChangeEvent; //导入依赖的package包/类
/**
 * Listens for changes in the Controller's rate, so that it
 * can be reflected in the Rate TextField.
 *
 * @param      e
 *             The generated ControllerEvent.  This event is
 *             ignored if it is not a RateChangeEvent.
 */
public void controllerUpdate(ControllerEvent e) {
    if( e.getSourceController() == controller &&
        e instanceof RateChangeEvent)
    {
 SwingUtilities.invokeLater(new LoadRateThread());
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:16,代码来源:RateControl.java


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