本文整理汇总了Java中javax.media.ResourceUnavailableEvent类的典型用法代码示例。如果您正苦于以下问题:Java ResourceUnavailableEvent类的具体用法?Java ResourceUnavailableEvent怎么用?Java ResourceUnavailableEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceUnavailableEvent类属于javax.media包,在下文中一共展示了ResourceUnavailableEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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) {
}
}
示例2: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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();
}
}
示例3: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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);
}
}
示例4: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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) {
}
}
示例5: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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) {
}
}
示例6: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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);
}
}
示例7: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的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;
}
}
示例8: doRealize
import javax.media.ResourceUnavailableEvent; //导入依赖的package包/类
/**
* Realize player and all of its managed Controllers.
* Subclasses should override doPlayerRealize() to do the
* actual work to transition the Controller.
* <p>
* This method should not be called directly. Instead, call
* realize().
*/
public final boolean doRealize() {
try {
// Initialte the data transfer
source.start();
}
catch(IOException e) {
postEvent(
new ResourceUnavailableEvent(this,
"Could not start DataSource") );
return false;
}
// No multi-Controller management is needed here because
// all Controllers are guaranteed to be Realized when
// they are added to this Player. Furthermore, the
// Player itself must be realized before any Controllers
// are added.
if(! doPlayerRealize() ) {
return false;
}
// Now that the Player is realized, getDuration() may
// be more accurate.
updateDuration();
return true;
}
示例9: controllerUpdate
import javax.media.ResourceUnavailableEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent evt)
// respond to events
{
if (evt instanceof ResourceUnavailableEvent) {
failed = false;
synchronized (this) {
this.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) { // make the movie loop
log.info("loop the movie");
//jmfplayer.setMediaTime(new Time(0));
//jmfplayer.start();
restart();
}
}
示例10: doPrefetchAction
import javax.media.ResourceUnavailableEvent; //导入依赖的package包/类
private boolean doPrefetchAction() {
switch (state) {
case Unrealized:
case Realizing:
if (!doRealizeAction())
return false;
/* fall thru */
case Realized:
state = Prefetching;
notifyListeners(new TransitionEvent(this, Realized, Prefetching, Prefetched));
/* fall thru */
case Prefetching:
if (!PlayerManager.getInstance().allocateResource(this)) {
notifyListeners(new ResourceUnavailableEvent(this));
return false;
}
ControllerErrorEvent error = doPrefetch();
if (error == null) {
state = Prefetched;
notifyListeners(new PrefetchCompleteEvent(this, Prefetching, Prefetched, Prefetched));
} else {
notifyListeners(error);
return false;
}
break;
default:
notifyListeners(new PrefetchCompleteEvent(this, state, state, state));
break;
}
return true;
}