Package javax.media

Examples of javax.media.Controller


        resetControllerError();

        //  Prefetch each managed Controller
        for(int i = 0; i < controllers.size(); i++) {
            Controller c = (Controller)controllers.elementAt(i);
            c.prefetch();
        }
       
        //  Prefetch this Player.  If it fails, then assume a
        //  ControllerErrorEvent was posted and return false.
View Full Code Here


        resetControllerError();

        //  SyncStart each managed Controller
        for(int i = 0; i < controllers.size(); i++) {
            Controller c = (Controller)controllers.elementAt(i);
            c.syncStart(t);
        }
       
        //  SyncStart this Player.  If it fails, then assume a
        //  ControllerErrorEvent was posted and return false.
        if( ! doPlayerSyncStart(t) ) {
View Full Code Here

       
        int size = controllers.size();
        Thread[] threads = new Thread[size];

        for(int i = 0; i < size; i++) {
            final Controller c =
                (Controller)controllers.elementAt(i);

            threads[i] = new Thread() {
                public void run() {
                    c.deallocate();
                }
            };

            threads[i].start();
        }
View Full Code Here

       
        int size = controllers.size();
        Thread[] threads = new Thread[size];

        for(int i = 0; i < size; i++) {
            final Controller c =
                (Controller)controllers.elementAt(i);

            threads[i] = new Thread() {
                public void run() {
                    c.stop();
                }
            };

            threads[i].start();
        }
View Full Code Here

    public synchronized final void doClose() {
        Vector controllers = getControllers();

        //  Close all Controllers under the control of this Player
        for(int i = 0, n = controllers.size(); i < n; i++ ) {
            Controller c =
                (Controller)controllers.elementAt(i);
            c.close();
        }

        try {
            //  Stop the data-transfer
            source.stop();
View Full Code Here

     *             The media time to set.
     */
    public synchronized final void doSetMediaTime(Time t) {
        //  First set the media time on all of the managed Controllers
        for(int i = 0, n = controllers.size(); i < n; i++ ) {
            Controller c =
                (Controller)controllers.elementAt(i);

            c.setMediaTime(t);
        }
       
        //  Set the media time on this Player
        doPlayerSetMediaTime(t);
    }
View Full Code Here

    public synchronized final float doSetRate(float rate) {
        float actual;

        //  First set the rate on all of the managed Controllers
        for(int i = 0, n = controllers.size(); i < n; i++ ) {
            Controller c = (Controller)controllers.elementAt(i);
            actual = c.setRate(rate);

            if( rate != 1.0F && actual != rate ) {
                doSetRate(1.0F);
                return 1.0F;
            }
View Full Code Here

     *             otherwise.
     */
    private boolean isStateReached(int state) {
        synchronized(controllers) {
            for(int i = 0, n = controllers.size(); i < n; i++) {
                Controller controller = (Controller)controllers.elementAt(i);
                if( controller.getState() < state ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

     *             Controller have stopped, false otherwise.
     */
    private boolean areControllersStopped() {
        synchronized(controllers) {
            for(int i = 0, n = controllers.size(); i < n; i++) {
                Controller controller = (Controller)controllers.elementAt(i);
                if( controller.getState() == Started ) {
                    return false;
                }
            }
            return true;
        }
View Full Code Here

  */
    public EjmfStartControl() {

  setControlListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
    Controller controller = getController();
    if (controller.getState() == Controller.Started) {
        controller.stop();
    } else {
        Time now = controller.getTimeBase().getTime();
                  controller.syncStart(now);
                }
      }
  });
    }
View Full Code Here

TOP

Related Classes of javax.media.Controller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.