コード例 #1
0
        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
          if (!fromUser) return;

          equalizer[0] = progress - 20;
          if (libVlc != null && button.isChecked()) libVlc.setEqualizer(equalizer);
        }
コード例 #2
0
  public static void updateLibVlcSettings(SharedPreferences pref) {
    LibVLC instance = LibVLC.getExistingInstance();
    if (instance == null) return;

    instance.setSubtitlesEncoding(pref.getString("subtitle_text_encoding", ""));
    instance.setTimeStretching(pref.getBoolean("enable_time_stretching_audio", false));
    instance.setFrameSkip(pref.getBoolean("enable_frame_skip", true));
    instance.setChroma(pref.getString("chroma_format", ""));
    instance.setVerboseMode(pref.getBoolean("enable_verbose_mode", true));

    if (pref.getBoolean("equalizer_enabled", false))
      instance.setEqualizer(getFloatArray(pref, "equalizer_values"));

    int aout;
    try {
      aout = Integer.parseInt(pref.getString("aout", "-1"));
    } catch (NumberFormatException nfe) {
      aout = -1;
    }
    int vout;
    try {
      vout = Integer.parseInt(pref.getString("vout", "-1"));
    } catch (NumberFormatException nfe) {
      vout = -1;
    }
    int deblocking;
    try {
      deblocking = Integer.parseInt(pref.getString("deblocking", "-1"));
    } catch (NumberFormatException nfe) {
      deblocking = -1;
    }
    int hardwareAcceleration;
    try {
      hardwareAcceleration = Integer.parseInt(pref.getString("hardware_acceleration", "-1"));
    } catch (NumberFormatException nfe) {
      hardwareAcceleration = -1;
    }
    int networkCaching = pref.getInt("network_caching_value", 0);
    if (networkCaching > 60000) networkCaching = 60000;
    else if (networkCaching < 0) networkCaching = 0;
    instance.setAout(aout);
    instance.setVout(vout);
    instance.setDeblocking(deblocking);
    instance.setNetworkCaching(networkCaching);
    instance.setHardwareAcceleration(hardwareAcceleration);
  }