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


Java EndOfMediaEvent类代码示例

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


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

示例1: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
 * This controllerUpdate function must be defined in order to
 * implement a ControllerListener interface. This 
 * function will be called whenever there is a media event.
 *
 * @param          event
 *                 the media event
 */
public synchronized void controllerUpdate(ControllerEvent event) {

    if( event instanceof RealizeCompleteEvent ) {

        Runnable r = new Runnable() {
            public void run() {
                // Add Control Panel Component
                playerpanel.addControlComponent();

                // Add Visual Component
                playerpanel.addVisualComponent();
            }
        };

        SwingUtilities.invokeLater(r);
    } else

    if (event instanceof EndOfMediaEvent) {
        // End of the media -- rewind
        player.setMediaTime(new Time(0));
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:31,代码来源:GenericPlayer.java

示例2: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
public synchronized void controllerUpdate(ControllerEvent ce) {
if (ce instanceof RealizeCompleteEvent) {
    realized = true;
} else if (ce instanceof ConfigureCompleteEvent) {
    configured = true;
} else if (ce instanceof PrefetchCompleteEvent) {
    prefetched = true;
} else if (ce instanceof EndOfMediaEvent) {
 //System.out.println("EndOfMediaEvent: " + ce);
    eom = true;
} else if (ce instanceof ControllerErrorEvent) {
    System.err.println("ControllerErrorEvent: " + ce);
 failed = true;
} else if (ce instanceof ControllerClosedEvent) {
 //System.out.println("ControllerClosedEvent: " + ce);
    closed = true;
} else {
    return;
}
notifyAll();
  }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:22,代码来源:StateHelper.java

示例3: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
    * Controller Listener.
    */
   public void controllerUpdate(ControllerEvent evt) {

if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
	stateTransitionOK = true;
	waitSync.notifyAll();
    }
} else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
	stateTransitionOK = false;
	waitSync.notifyAll();
    }
} else if (evt instanceof EndOfMediaEvent) {
    p.setMediaTime(new Time(0));
    //p.start();
    //p.close();
    //System.exit(0);
} else if (evt instanceof SizeChangeEvent) {
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:26,代码来源:Seek.java

示例4: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
    * Controller Listener.
    */
   public void controllerUpdate(ControllerEvent evt) {

if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
	stateTransitionOK = true;
	waitSync.notifyAll();
    }
} else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
	stateTransitionOK = false;
	waitSync.notifyAll();
    }
} else if (evt instanceof EndOfMediaEvent) {
    evt.getSourceController().stop();
    evt.getSourceController().close();
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:23,代码来源:JpegImagesToMovie.java

示例5: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
    * Controller Listener.
    */
   public void controllerUpdate(ControllerEvent evt) {

if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
	stateTransitionOK = true;
	waitSync.notifyAll();
    }
} else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
	stateTransitionOK = false;
	waitSync.notifyAll();
    }
} else if (evt instanceof EndOfMediaEvent) {
    p.close();
    System.exit(0);
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:23,代码来源:FrameAccess.java

示例6: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
    * Controller Listener.
    */
   public void controllerUpdate(ControllerEvent evt) {

if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
	stateTransitionOK = true;
	waitSync.notifyAll();
    }
} else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
	stateTransitionOK = false;
	waitSync.notifyAll();
    }
} else if (evt instanceof EndOfMediaEvent) {
    p.close();
    //System.exit(0);
} else if (evt instanceof SizeChangeEvent) {
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:24,代码来源:Clone.java

示例7: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
    * Controller Listener.
    */
   public void controllerUpdate(ControllerEvent evt) {

if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
	stateTransitionOK = true;
	waitSync.notifyAll();
    }
} else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
	stateTransitionOK = false;
	waitSync.notifyAll();
    }
} else if (evt instanceof EndOfMediaEvent) {
    p.close();
} else if (evt instanceof SizeChangeEvent) {
}
   }
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:23,代码来源:DataSourceReader.java

示例8: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
 * Controller Listener.
 */
public void controllerUpdate(ControllerEvent evt) {

	if (evt instanceof ConfigureCompleteEvent
			|| evt instanceof RealizeCompleteEvent
			|| evt instanceof PrefetchCompleteEvent) {
		synchronized (waitSync) {
			stateTransitionOK = true;
			waitSync.notifyAll();
		}
	} else if (evt instanceof ResourceUnavailableEvent) {
		synchronized (waitSync) {
			stateTransitionOK = false;
			waitSync.notifyAll();
		}
	} else if (evt instanceof EndOfMediaEvent) {
		processor.setMediaTime(Processor.RESET);
		processor.start();
		//processor.close();
		//System.exit(0);
	}
}
 
开发者ID:voxoid0,项目名称:java-motion-tracking,代码行数:25,代码来源:AbstractProcessingCamera.java

示例9: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent evt) {

      if (evt instanceof ConfigureCompleteEvent
            || evt instanceof RealizeCompleteEvent
            || evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
            stateTransitionOK = true;
            waitSync.notifyAll();
         }
      } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
            stateTransitionOK = false;
            waitSync.notifyAll();
         }
      } else if (evt instanceof EndOfMediaEvent) {
         evt.getSourceController().stop();
         evt.getSourceController().close();
         finished = true;
      }
   }
 
开发者ID:openwarrior,项目名称:java-screen-recorder,代码行数:21,代码来源:RecordingConverter.java

示例10: createPlayer

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
private static synchronized Player createPlayer(String mediaUri) {
    try {
        URL url = replaceJarUrlWithFileUrl(ResourceManager.getResource(mediaUri), mediaUri);

        MediaLocator locator = new MediaLocator(url);
        final Player mediaPlayer = Manager.createRealizedPlayer(locator);

        // add a listener to put us in an infinite loop
        mediaPlayer.addControllerListener(new ControllerListener() {
            public void controllerUpdate(ControllerEvent evt) {
                if(evt instanceof EndOfMediaEvent) {
                    mediaPlayer.setMediaTime(new Time(0));
                    mediaPlayer.start();
                }
            }
        });
        return mediaPlayer;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:humphrej,项目名称:flexdock,代码行数:23,代码来源:MediaPanel.java

示例11: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent evt) {
	if (evt instanceof EndOfMediaEvent) {
		if (diaMessage.getExpectedDigits() == 0) {
			handleDTMF("0");
		} else {
			resetDelay = true;
			while (resetDelay) {
				try {
					resetDelay = false;
					Thread.sleep(5000);
				} catch (InterruptedException e) {
					BrokerFactory.getLoggingBroker().logError(e);
				}
			}
			transmitter.stop();
			transmitter.playSound("file://"+diaMessage.getWaveFilename());
		}
	}
}
 
开发者ID:davidrudder23,项目名称:OpenNotification,代码行数:20,代码来源:SipIVR.java

示例12: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
 * This controllerUpdate function must be defined in order to
 * implement a ControllerListener interface. This 
 * function will be called whenever there is a media event.
 *
 * @param       event
 *              the ControllerEvent
 */
public void controllerUpdate(final ControllerEvent event) {
    
    final Controller source = event.getSourceController();
    final boolean isSlave = slaves.contains(source);

    if( event instanceof TransitionEvent ||
        event instanceof ControllerErrorEvent )
    {
        Runnable r = new Runnable() {
            public void run() {
                if(isSlave) {
                    int index = slaves.indexOf(source);
                    writeEvent("[slave" + index + "] " + event.toString());
                } else {
                    setState();
                    writeEvent("[master] " + event.toString());
                }
            }
        };

        SwingUtilities.invokeLater(r);
    }

    //  Return if this is a slave
    if(isSlave) return;

    if(event instanceof EndOfMediaEvent) {
        // End of the media -- rewind
        player.setMediaTime(new Time(0));
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:40,代码来源:SyncdStateChanger.java

示例13: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
public synchronized void controllerUpdate(ControllerEvent event) {
    // If we're getting messages from a dead player, just leave
    if (player == null) return;

    if (event instanceof EndOfMediaEvent) {
        player.setMediaTime(new Time(0));
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:9,代码来源:TimerPlayer.java

示例14: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
 * This controllerUpdate function must be defined in order to
 * implement a ControllerListener interface. This 
 * function will be called whenever there is a media event
 */
public synchronized void controllerUpdate(ControllerEvent event) {

    /*
     * Set the state of the buttons to the correct values.
     */
    if (event instanceof EndOfMediaEvent) {
        // End of the media -- rewind
        player.setMediaTime(new Time(0));
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:16,代码来源:CustomCPPlayer.java

示例15: controllerUpdate

import javax.media.EndOfMediaEvent; //导入依赖的package包/类
/**
 * This controllerUpdate function must be defined in order to
 * implement a ControllerListener interface. This 
 * function will be called whenever there is a media event
 */
public /*synchronized */ void controllerUpdate(ControllerEvent event) {
    // If we're getting messages from a dead player, just leave
    if (player == null) return;
    

    if (event instanceof EndOfMediaEvent) {
        // End of the media -- rewind
        player.setMediaTime(new Time(0));
    }
}
 
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:16,代码来源:CustomStdPlayer.java


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