playerPanel.addMediaLocatorAndLoad(url);
}
}
private final MenuBar getMenuBar() {
MenuBar menuBar = new MenuBar();
final Menu menuFile = new Menu();
menuFile.setLabel("File");
menuBar.add(menuFile);
// File>Open File
{
final MenuItem menuItemOpenFile = new MenuItem("Open File...");
menuItemOpenFile.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onOpenFile();
}
}
);
menuFile.add(menuItemOpenFile);
}
// File>Open URL
{
final MenuItem menuItemOpenURL = new MenuItem("Open URL...");
menuItemOpenURL.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onOpenURL();
}
}
);
menuFile.add(menuItemOpenURL);
}
// File>Open RTP Session
{
final MenuItem menuItemReceiveRTP = new MenuItem("Open RTP Session...");
menuItemReceiveRTP.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onReceiveRTP();
}
}
);
menuFile.add(menuItemReceiveRTP);
}
// File>Capture
{
final MenuItem menuItemOpenCaptureDevice = new MenuItem("Capture...");
menuItemOpenCaptureDevice.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onOpenCaptureDevice();
}
}
);
menuFile.add(menuItemOpenCaptureDevice);
}
// separator
menuFile.addSeparator();
// TODO: export
// File>Transmit RTP
{
final MenuItem menuItemTransmitRTP = new MenuItem("Transmit RTP...");
menuItemTransmitRTP.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onTransmitRTP();
}
}
);
menuFile.add(menuItemTransmitRTP);
}
// File>Transcode
{
final MenuItem menuItemTranscode = new MenuItem("Transcode...");
menuItemTranscode.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
playerPanel.onTranscode();
}
}
);
menuFile.add(menuItemTranscode);
}
// separator
menuFile.addSeparator();
// File>Registry Editor
{
final MenuItem menuItemRegistryEditor = new MenuItem("Registry Editor...");
menuItemRegistryEditor.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
onOpenRegistryEditor();
}
}
);
menuFile.add(menuItemRegistryEditor);
}
// File>Exit
{
final MenuItem menuItemExit = new MenuItem("Exit");
menuItemExit.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
onExit();
}
}
);
menuFile.add(menuItemExit);
}
final Menu menuPlayer = new Menu();
menuPlayer.setLabel("Player");
menuBar.add(menuPlayer);
// Player>Auto-play
{
final CheckboxMenuItem menuItemAutoPlay = new CheckboxMenuItem("Auto-play");
menuItemAutoPlay.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e)
{
playerPanel.onAutoPlay(menuItemAutoPlay.getState());
}
});
menuPlayer.add(menuItemAutoPlay);
menuItemAutoPlay.setState(playerPanel.getPrefs().autoPlay);
}
// Player>Auto-loop
{
final CheckboxMenuItem menuItemAutoLoop = new CheckboxMenuItem("Auto-loop");
menuItemAutoLoop.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e)
{
playerPanel.onAutoLoop(menuItemAutoLoop.getState());
}
});
menuPlayer.add(menuItemAutoLoop);
playerPanel.onAutoLoop(false); // TODO: not working right yet.
menuItemAutoLoop.setState(playerPanel.getPrefs().autoLoop);
menuItemAutoLoop.setEnabled(false); // TODO: not working right yet.
}
final Menu menuHelp = new Menu();
menuHelp.setLabel("Help");
menuBar.add(menuHelp);
// Help>About
{
final MenuItem menuItemHelpAbout = new MenuItem("About...");
menuItemHelpAbout.addActionListener(