mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-15 21:31:12 +00:00
stream frame is now built. frames are now created centered. now show appname on osx instead of com.limelight.limelight
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
package com.limelight;
|
package com.limelight;
|
||||||
|
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JSpinner;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
|
|
||||||
import com.limelight.binding.PlatformBinding;
|
import com.limelight.binding.PlatformBinding;
|
||||||
import com.limelight.gui.MainFrame;
|
import com.limelight.gui.MainFrame;
|
||||||
@@ -11,7 +17,7 @@ import com.limelight.nvstream.av.video.VideoDecoderRenderer;
|
|||||||
|
|
||||||
public class Limelight implements NvConnectionListener {
|
public class Limelight implements NvConnectionListener {
|
||||||
public static final double VERSION = 1.0;
|
public static final double VERSION = 1.0;
|
||||||
|
|
||||||
private String host;
|
private String host;
|
||||||
private StreamFrame streamFrame;
|
private StreamFrame streamFrame;
|
||||||
private NvConnection conn;
|
private NvConnection conn;
|
||||||
@@ -36,6 +42,22 @@ public class Limelight implements NvConnectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
|
// take the menu bar off the jframe
|
||||||
|
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
||||||
|
|
||||||
|
// set the name of the application menu item
|
||||||
|
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Limelight");
|
||||||
|
|
||||||
|
// set the look and feel
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("OH Shit...");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MainFrame limeFrame = new MainFrame();
|
MainFrame limeFrame = new MainFrame();
|
||||||
limeFrame.build();
|
limeFrame.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.limelight.gui;
|
|||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Toolkit;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -35,8 +36,9 @@ public class MainFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void build() {
|
public void build() {
|
||||||
limeFrame = new JFrame("Limelight V" + Limelight.VERSION);
|
limeFrame = new JFrame("Limelight");
|
||||||
limeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
limeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
Container mainPane = limeFrame.getContentPane();
|
Container mainPane = limeFrame.getContentPane();
|
||||||
|
|
||||||
mainPane.setLayout(new BorderLayout());
|
mainPane.setLayout(new BorderLayout());
|
||||||
@@ -86,8 +88,10 @@ public class MainFrame {
|
|||||||
|
|
||||||
centerPane.add(contentBox);
|
centerPane.add(contentBox);
|
||||||
mainPane.add(centerPane, "Center");
|
mainPane.add(centerPane, "Center");
|
||||||
|
|
||||||
|
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
limeFrame.setSize(300, 175);
|
limeFrame.setSize(300, 175);
|
||||||
|
limeFrame.setLocation(dim.width/2-limeFrame.getSize().width/2, dim.height/2-limeFrame.getSize().height/2);
|
||||||
limeFrame.setResizable(false);
|
limeFrame.setResizable(false);
|
||||||
limeFrame.setVisible(true);
|
limeFrame.setVisible(true);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
package com.limelight.gui;
|
package com.limelight.gui;
|
||||||
|
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
|
||||||
public class StreamFrame extends JFrame {
|
public class StreamFrame extends JFrame {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public void build() {
|
public void build() {
|
||||||
|
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
|
this.setSize(1280,720);
|
||||||
|
//This might break if the screen res is too small...not sure though
|
||||||
|
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
|
||||||
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user