001    /////////////////////////////////////////////////
002    // This file is part of Sears project.
003    // Subtitle Editor And Re-Synch
004    // A tool to easily modify and resynch movies subtitles.
005    /////////////////////////////////////////////////
006    //This program is free software; 
007    //you can redistribute it and/or modify it under the terms 
008    //of the GNU General Public License 
009    //as published by the Free Software Foundation; 
010    //either version 2 of the License, or (at your option) any later version.
011    /////////////////////////////////////////////////
012    //Sears project is available under sourceforge
013    // at adress: http://sourceforge.net/projects/sears/
014    //Copyright (C) 2005 Booba Skaya
015    //Mail: booba.skaya@gmail.com
016    ////////////////////////////////////////////////
017    package sears.tools.player;
018    
019    /**
020     * Class PlayerInterface.
021     * Summary:
022     * This class defines the interface to play subtitled video files.
023     */
024    public interface PlayerInterface {
025        /**
026         * Method play
027         * Summary:
028         * Use it to launch a video, with its subtitles.
029         * Or to resume from pause.
030         * @param videoFile         The path to the videoFile.
031         * @param subtitleFile      The path to the subtitleFile.
032         * @throws PlayerException  if an error occurs
033         */
034        public void play(String videoFile, String subtitleFile) throws PlayerException;
035        
036        /**
037         * Method pause
038         * Summary:
039         * Pause the video.
040         * Or to resume from previous pause.
041         * @throws PlayerException  if an error occurs
042         */
043        public void pause() throws PlayerException;
044        
045        /**
046         * Method stop
047         * Summary:
048         * stop the video.
049         * @throws PlayerException  if an error occurs
050         */
051        public void stop() throws PlayerException;
052      
053        /**
054         * Method setPosition
055         * Summary:
056         * This method permit to shift to the correct offset (in s) in the video.
057         * @param offset                    The offset in the video to go.
058         * @throws PlayerException  if an error occurs
059         */
060        public void setPosition(int offset) throws PlayerException;
061        
062        /**
063         * Method getPosition
064         * Summary:
065         * This method permit to get the current position (in seconds) in the video.
066         * @return                                  the current position in the video or -1 if video is currently stopped;
067         * @throws PlayerException  if an error occurs
068         */
069        public int getPosition() throws PlayerException;
070        
071        /**
072         * Method getLength
073         * Summary:
074         * This method permit to get the video time length(in seconds).
075         * @return                                  the video time length or -1 if video is currently stopped;
076         * @throws PlayerException  if an error occurs
077         */
078        public int getLength() throws PlayerException;
079        
080        /**
081         * Method quit
082         * Summary:
083         * This method allows to kill the player.
084          */
085        public void quit();
086    }