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 */ 033 public void play(String videoFile, String subtitleFile) throws PlayerException; 034 035 /** 036 * Method pause 037 * Summary: 038 * Pause the video. 039 * Or to resume from previous pause. 040 */ 041 public void pause() throws PlayerException; 042 043 /** 044 * Method stop 045 * Summary: 046 * stop the video. 047 */ 048 public void stop() throws PlayerException; 049 050 /** 051 * Method setPosition 052 * Summary: 053 * This method permit to shift to the correct offset (in s) in the video. 054 * @param offset The offset in the video to go. 055 */ 056 public void setPosition(int offset) throws PlayerException; 057 058 /** 059 * Method getPosition 060 * Summary: 061 * This method permit to get the current position (in seconds) in the video. 062 * return -1 if video is currently stopped; 063 */ 064 public int getPosition() throws PlayerException; 065 066 /** 067 * Method getLength 068 * Summary: 069 * This method permit to get the video time length(in seconds). 070 * return -1 if video is currently stopped; 071 */ 072 public int getLength() throws PlayerException; 073 074 /** 075 * Method quit 076 * Summary: 077 * This method allows to kill the player. 078 */ 079 public void quit(); 080 }