Miscellaneous minor changes.

This commit is contained in:
eg3p 2002-10-22 20:47:39 +00:00
parent 984a1841b1
commit 2e8608d13b
4 changed files with 33 additions and 29 deletions

View file

@ -504,40 +504,31 @@ class TimeCodeManager extends JPanel {
JPanel ps = new JPanel();
ps.add(playSegButton);
/*
JButton playButton = new JButton(messages.getString("Play"));
JButton pauseButton = new JButton(messages.getString("Pause"));
JButton playPauseButton = new JButton(messages.getString("PlayPause"));
playPauseButton.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
if (player != null) {
try {
if (player.isPlaying())
player.cmd_stop();
else
player.cmd_playOn();
} catch (SmartMoviePanelException smpe) {
smpe.printStackTrace();
ThdlDebug.noteIffyCode();
}
}
}
});
playButton.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
if (player != null) {
try {
player.cmd_playOn();
} catch (SmartMoviePanelException smpe) {
smpe.printStackTrace();
ThdlDebug.noteIffyCode();
}
}
}
});
pauseButton.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
if (player != null) {
try {
player.cmd_stop();
} catch (SmartMoviePanelException smpe) {
smpe.printStackTrace();
ThdlDebug.noteIffyCode();
}
}
}
});
*/
JPanel playPausePanel = new JPanel();
playPausePanel.add(playPauseButton);
Box box = Box.createVerticalBox();
box.add(inPanel);
box.add(outPanel);
box.add(ps);
box.add(playPausePanel);
add("North", box);
}

View file

@ -178,8 +178,10 @@ public class SmartJMFPlayer extends SmartMoviePanel implements ControllerListene
weird results if you do player.start() without setting the media
time.*/
if (!(event instanceof RestartingEvent))
if (!(event instanceof RestartingEvent)) {
player.setMediaTime(pauseTime);
player.prefetch();
}
// player.setStopTime(Clock.RESET);
stopTime = null;
@ -274,6 +276,13 @@ public class SmartJMFPlayer extends SmartMoviePanel implements ControllerListene
}
}
/*-----------------------------------------------------------------------*/
public boolean isPlaying() {
if (player == null)
return false;
if (player.getState() == Controller.Started)
return true;
return false;
}
public int getCurrentTime() {
if (player == null)
return -1;

View file

@ -17,6 +17,7 @@ public abstract class SmartMoviePanel extends Panel
//helper methods - media status
public abstract boolean isInitialized();
public abstract boolean isPlaying();
public abstract int getCurrentTime();
public abstract int getEndTime();

View file

@ -199,6 +199,9 @@ public class SmartQT4JPlayer extends SmartMoviePanel
{
return true;
}
public boolean isPlaying() {
return false; //FIXME
}
public int getCurrentTime()
{
try {