Package com.limelight.settings.PreferencesManager

Examples of com.limelight.settings.PreferencesManager.Preferences


   * @param host the host pc to connect to. Can be a hostname or IP address.
   */
  public static void createInstance(String host) {
    Limelight limelight = new Limelight(host);

    Preferences prefs = PreferencesManager.getPreferences();
    StreamConfiguration streamConfig = createConfiguration(prefs.getResolution(), prefs.getBitrate());

    limelight.startUp(streamConfig, prefs);
  }
View Full Code Here


    boolean fullscreen = false;
    int resolution = 720;
    int refresh = 60;
    Integer bitrate = null;
   
    Preferences prefs = PreferencesManager.getPreferences();
   
    // Save preferences to preserve possibly new unique ID
    PreferencesManager.writePreferences(prefs);

    for (int i = 0; i < args.length; i++) {
      if (args[i].equals("-pair")) {
        if (i + 1 < args.length){
          host = args[i+1];
          System.out.println("Trying to pair to: " + host);
          String msg = pair(prefs.getUniqueId(), host);
          System.out.println("Pairing: " + msg);
          System.exit(0);
        } else {
          System.err.println("Syntax error: hostname or ip address expected after -pair");
          System.exit(4);
        }
      } else if (args[i].equals("-host")) {
        if (i + 1 < args.length) {
          host = args[i+1];
          i++;
        } else {
          System.err.println("Syntax error: hostname or ip address expected after -host");
          System.exit(3);
        }
      } else if (args[i].equals("-bitrate")) {
        if (i + 1 < args.length){
          bitrate = Integer.parseInt(args[i+1]);
          i++;
        } else {
          System.err.println("Syntax error: bitrate (in Mbps) expected after -bitrate");
          System.exit(3);
        }
      } else if (args[i].equals("-fs")) {
        fullscreen = true;
      } else if (args[i].equals("-720")) {
        resolution = 720;
      } else if (args[i].equals("-768")) {
          resolution = 768;
      } else if (args[i].equals("-900")) {
          resolution = 900;
      } else if (args[i].equals("-1080")) {
        resolution = 1080;
      } else if (args[i].equals("-30fps")) {
        refresh = 30;
      } else if (args[i].equals("-60fps")) {
        refresh = 60;
      } else {
        System.out.println("Syntax Error: Unrecognized argument: " + args[i]);
      }
    }

    if (host == null) {
      System.out.println("Syntax Error: You must include a host. Use -host to specifiy a hostname or ip address.");
      System.exit(5);
    }

    Resolution streamRes = Resolution.findRes(resolution, refresh);
   
    if (bitrate == null) {
      bitrate = streamRes.defaultBitrate;
    }

    StreamConfiguration streamConfig = createConfiguration(streamRes, bitrate);
   
    prefs.setResolution(streamRes);
    prefs.setBitrate(bitrate);
    prefs.setFullscreen(fullscreen);
   
    Limelight limelight = new Limelight(host);
    limelight.startUp(streamConfig, prefs);
    COMMAND_LINE_LAUNCH = true;
  }
View Full Code Here

    mainPane.setLayout(new BorderLayout());

    JPanel centerPane = new JPanel();
    centerPane.setLayout(new BoxLayout(centerPane, BoxLayout.Y_AXIS));

    Preferences prefs = PreferencesManager.getPreferences();

    hostField = new JTextField();
    hostField.setMaximumSize(new Dimension(Integer.MAX_VALUE, 24));
    hostField.setToolTipText("Enter host name or IP address");
    hostField.setText(prefs.getHost());
    hostField.setSelectionStart(0);
    hostField.setSelectionEnd(hostField.getText().length());

    stream = new JButton("Start Streaming");
    stream.addActionListener(createStreamButtonListener());
View Full Code Here

   */
  private ActionListener createStreamButtonListener() {
    return new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        String host = hostField.getText();
        Preferences prefs = PreferencesManager.getPreferences();
        if (!host.equals(prefs.getHost())) {
          prefs.setHost(host);
          PreferencesManager.writePreferences(prefs);
        }
        Limelight.createInstance(host);
      }
    };
View Full Code Here

  private ActionListener createPairButtonListener() {
    return new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        new Thread(new Runnable() {
          public void run() {
            Preferences prefs = PreferencesManager.getPreferences();
           
            // Save preferences to preserve possibly new unique ID
            PreferencesManager.writePreferences(prefs);
           
            String msg = Limelight.pair(prefs.getUniqueId(), hostField.getText());
            JOptionPane.showMessageDialog(limeFrame, msg, "Limelight", JOptionPane.INFORMATION_MESSAGE);
          }
        }).start();
      }
    };
View Full Code Here

TOP

Related Classes of com.limelight.settings.PreferencesManager.Preferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.