Commit 13cc9063 authored by Alexandre Perraud's avatar Alexandre Perraud

Preferences : Advanced reorganization

parent f097b30a
......@@ -348,6 +348,8 @@
<string name="save_video_none">Do not save speed</string>
<string name="save_video_session">Save speed during session</string>
<string name="save_video_always">Save speed across sessions</string>
<string name="auto_rescan">Auto rescan</string>
<string name="auto_rescan_summary">Automatically scan device for new or deleted media at application startup</string>
<string name="vout">Video output</string>
<string name="vout_summary">Change the method that VLC uses to output video.</string>
<string name="vout_android_surface">Android surface</string>
......@@ -360,10 +362,9 @@
<string name="set_locale_popup">Quit and restart VLC for changes to take effect.</string>
<string name="network_caching">Network caching value</string>
<string name="network_caching_summary">The amount of time to buffer network media (in ms). Does not work with hardware decoding. Leave blank to reset.</string>
<string name="quit">Quit and restart application</string>
<string name="developer_prefs_category">Developer</string>
<string name="auto_rescan">Auto rescan</string>
<string name="auto_rescan_summary">Automatically scan device for new or deleted media at application startup</string>
<string name="enable_verbose_mode">Verbose</string>
<string name="enable_verbose_mode_summary">Increase the verbosity (logcat)</string>
<string name="debug_logs">Debug logs</string>
......@@ -374,7 +375,6 @@
<string name="log_service_text">Open the log console</string>
<string name="copy_to_clipboard">Copy to clipboard</string>
<string name="copied_to_clipboard">Copied log to clipboard.</string>
<string name="quit">Quit and restart application</string>
<string name="dump_logcat">Dump logcat log</string>
<string name="dump_logcat_success">Logcat successfully dumped to %1$s!</string>
<string name="dump_logcat_failure">Failed to dump logcat.</string>
......
......@@ -47,9 +47,6 @@
<Preference
android:title="@string/audio_prefs_category"
android:key="audio_category" />
<Preference
android:title="@string/performance_prefs_category"
android:key="perf_category" />
<Preference
android:title="@string/advanced_prefs_category"
android:key="adv_category" />
......
......@@ -16,8 +16,8 @@
<CheckBoxPreference
android:defaultValue="true"
android:key="auto_rescan"
android:title="@string/auto_rescan"
android:summary="@string/auto_rescan_summary" />
android:summary="@string/auto_rescan_summary"
android:title="@string/auto_rescan" />
<Preference
android:enabled="true"
android:key="clear_media_db"
......@@ -43,4 +43,31 @@
android:enabled="true"
android:key="quit_app"
android:title="@string/quit" />
<PreferenceCategory android:title="@string/performance_prefs_category">
<CheckBoxPreference
android:defaultValue="@bool/time_stretching_default"
android:key="enable_time_stretching_audio"
android:summary="@string/enable_time_stretching_audio_summary"
android:title="@string/enable_time_stretching_audio" />
<ListPreference
android:defaultValue="@string/chroma_format_default"
android:entries="@array/chroma_formats"
android:entryValues="@array/chroma_formats_values"
android:key="chroma_format"
android:summary="@string/chroma_format_summary"
android:title="@string/chroma_format" />
<ListPreference
android:defaultValue="-1"
android:entries="@array/deblocking_list"
android:entryValues="@array/deblocking_values"
android:key="deblocking"
android:summary="@string/deblocking_summary"
android:title="@string/deblocking" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_frame_skip"
android:summary="@string/enable_frame_skip_summary"
android:title="@string/enable_frame_skip" />
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
/*
* *************************************************************************
* Advanced.java
* PreferencesAdvanced.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
* Author: Geoffrey Métais
......@@ -40,7 +40,7 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.util.VLCInstance;
public class Advanced extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
public class PreferencesAdvanced extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Override
protected int getXml() {
return R.xml.preferences_adv;
......@@ -150,6 +150,10 @@ public class Advanced extends BasePreferenceFragment implements SharedPreference
switch (key){
case "network_caching":
case "vout":
case "chroma_format":
case "deblocking":
case "enable_frame_skip":
case "enable_time_stretching_audio":
VLCInstance.restart();
if (getActivity() != null )
((PreferencesActivity)getActivity()).restartMediaPlayer();
......
......@@ -103,11 +103,8 @@ public class PreferencesFragment extends BasePreferenceFragment implements Share
case "audio_category":
loadFragment(new PreferencesAudio());
break;
case "perf_category":
loadFragment(new PreferencesPerformances());
break;
case "adv_category":
loadFragment(new Advanced());
loadFragment(new PreferencesAdvanced());
break;
case "dev_category":
loadFragment(new Developer());
......
/*
* *************************************************************************
* PreferencesPerformances.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
* Author: Geoffrey Métais
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package org.videolan.vlc.gui.preferences;
import android.content.SharedPreferences;
import org.videolan.vlc.R;
import org.videolan.vlc.util.VLCInstance;
public class PreferencesPerformances extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Override
protected int getXml() {
return R.xml.preferences_perf;
}
@Override
protected int getTitleId() {
return R.string.performance_prefs_category;
}
@Override
public void onStart() {
super.onStart();
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onStop() {
super.onStop();
getPreferenceScreen().getSharedPreferences()
.unregisterOnSharedPreferenceChangeListener(this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
switch (key){
case "chroma_format":
case "deblocking":
case "enable_frame_skip":
case "enable_time_stretching_audio":
VLCInstance.restart();
if (getActivity() != null )
((PreferencesActivity)getActivity()).restartMediaPlayer();
}
}
}
......@@ -104,9 +104,6 @@ public class PreferencesFragment extends BasePreferenceFragment implements Share
case "ui_category":
loadFragment(new PreferencesUi());
break;
case "perf_category":
loadFragment(new PreferencesPerformances());
break;
case "adv_category":
loadFragment(new Advanced());
break;
......
/*
* *************************************************************************
* PreferencesPerformances.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
* Author: Geoffrey Métais
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package org.videolan.vlc.gui.tv.preferences;
import android.annotation.TargetApi;
import android.content.SharedPreferences;
import android.os.Build;
import org.videolan.vlc.R;
import org.videolan.vlc.util.VLCInstance;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public class PreferencesPerformances extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Override
protected int getXml() {
return R.xml.preferences_perf;
}
@Override
protected int getTitleId() {
return R.string.performance_prefs_category;
}
@Override
public void onStart() {
super.onStart();
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onStop() {
super.onStop();
getPreferenceScreen().getSharedPreferences()
.unregisterOnSharedPreferenceChangeListener(this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
switch (key){
case "chroma_format":
case "deblocking":
case "enable_frame_skip":
case "enable_time_stretching_audio":
VLCInstance.restart();
if (getActivity() != null )
((PreferencesActivity)getActivity()).restartMediaPlayer();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment