hmm mayube revert this
This commit is contained in:
parent
4c270b744f
commit
1b44001d44
2 changed files with 2 additions and 67 deletions
|
|
@ -7,15 +7,8 @@ import java.awt.FontMetrics;
|
|||
import java.awt.Graphics;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import javax.media.ControllerEvent;
|
||||
import javax.media.ControllerListener;
|
||||
import javax.media.EndOfMediaEvent;
|
||||
import javax.media.Manager;
|
||||
import javax.media.MediaLocator;
|
||||
import javax.media.Player;
|
||||
import javax.media.Time;
|
||||
|
||||
public class AdjustmentsMenu extends Container implements KeyListener, ControllerListener {
|
||||
public class AdjustmentsMenu extends Container implements KeyListener {
|
||||
private static final String[] MAIN_ITEMS = {
|
||||
"MAIN FEATURE",
|
||||
"BONUS: WAITING ROOM OUTTAKES",
|
||||
|
|
@ -37,8 +30,6 @@ public class AdjustmentsMenu extends Container implements KeyListener, Controlle
|
|||
private boolean hidden;
|
||||
private int codeProgress;
|
||||
private String status = "BD-J scaffold loaded";
|
||||
private Player featurePlayer;
|
||||
private boolean menuShown = true;
|
||||
|
||||
public AdjustmentsMenu() {
|
||||
setFocusable(true);
|
||||
|
|
@ -120,11 +111,7 @@ public class AdjustmentsMenu extends Container implements KeyListener, Controlle
|
|||
selected = 0;
|
||||
status = "Returned to approved materials";
|
||||
} else if ("MAIN FEATURE".equals(item)) {
|
||||
// The feature is already playing behind the menu; just hide the
|
||||
// menu to reveal it. Press the menu key (or ENTER) to bring it back.
|
||||
status = "Playing main feature -- press ENTER for menu";
|
||||
setMenuVisible(false);
|
||||
return;
|
||||
status = "Main feature is playlist 00000";
|
||||
} else if ("SETTINGS".equals(item)) {
|
||||
status = "Settings stub selected";
|
||||
} else {
|
||||
|
|
@ -134,47 +121,6 @@ public class AdjustmentsMenu extends Container implements KeyListener, Controlle
|
|||
repaint();
|
||||
}
|
||||
|
||||
// Called once by the Xlet at startup. Start the feature playing straight
|
||||
// away and leave it running for the whole session. This keeps VLC in normal
|
||||
// "playing" mode with a live playlist behind the menu, so selecting an item
|
||||
// never triggers the background->playlist transition that VLC botches
|
||||
// ("blurayReleaseVout: subpicture channel exists", no video). The menu is
|
||||
// just drawn on top and toggled with setMenuVisible().
|
||||
public void startPlayback() {
|
||||
if (featurePlayer != null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// libbluray's "bd" protocol; PLAYLIST:00000 -> BDMV/PLAYLIST/00000.mpls.
|
||||
featurePlayer = Manager.createPlayer(new MediaLocator("bd://PLAYLIST:00000"));
|
||||
featurePlayer.addControllerListener(this);
|
||||
featurePlayer.start();
|
||||
} catch (Exception e) {
|
||||
featurePlayer = null;
|
||||
status = "Playback failed: " + e.getMessage();
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
|
||||
// Toggle only this menu Container, not the whole HScene, so the scene (and
|
||||
// its key listener) stays alive while the video shows underneath.
|
||||
private void setMenuVisible(boolean visible) {
|
||||
menuShown = visible;
|
||||
setVisible(visible);
|
||||
if (visible) {
|
||||
requestFocus();
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void controllerUpdate(ControllerEvent event) {
|
||||
// Loop the feature so there is always a live playlist behind the menu.
|
||||
if (event instanceof EndOfMediaEvent && featurePlayer != null) {
|
||||
featurePlayer.setMediaTime(new Time(0));
|
||||
featurePlayer.start();
|
||||
}
|
||||
}
|
||||
|
||||
private void unlockHidden() {
|
||||
hidden = true;
|
||||
selected = 0;
|
||||
|
|
@ -185,14 +131,6 @@ public class AdjustmentsMenu extends Container implements KeyListener, Controlle
|
|||
|
||||
public void keyPressed(KeyEvent e) {
|
||||
int code = e.getKeyCode();
|
||||
|
||||
// When the menu is hidden (feature playing full screen), any key brings
|
||||
// the menu back over the still-running video.
|
||||
if (!menuShown) {
|
||||
setMenuVisible(true);
|
||||
return;
|
||||
}
|
||||
|
||||
String[] items = hidden ? HIDDEN_ITEMS : MAIN_ITEMS;
|
||||
|
||||
if (code == KeyEvent.VK_UP) {
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ public class MyXlet extends Thread implements Xlet {
|
|||
scene.setVisible(true);
|
||||
menu.requestFocus();
|
||||
scene.requestFocus();
|
||||
// Start the feature immediately so VLC always has a live playlist behind
|
||||
// the menu (avoids the background->playlist transition it botches).
|
||||
menu.startPlayback();
|
||||
start();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue