[Android] Merge playback speed options, set default to true

Geoffrey Métais git at videolan.org
Tue Jun 28 11:16:57 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 28 10:52:08 2016 +0200| [6f8def671c9628705eec828cec913ec1d5c3fea3] | committer: Geoffrey Métais

Merge playback speed options, set default to true

> https://code.videolan.org/videolan/vlc-android/commit/6f8def671c9628705eec828cec913ec1d5c3fea3
---

 vlc-android/res/values/strings.xml                                | 6 ++----
 vlc-android/res/xml/preferences_adv.xml                           | 8 +-------
 vlc-android/src/org/videolan/vlc/PlaybackService.java             | 4 ++--
 .../src/org/videolan/vlc/gui/preferences/PreferencesActivity.java | 1 -
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       | 4 ++--
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 0e63111..afbd1cc 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -198,10 +198,8 @@
 
     <string name="playback_history_title">Playback history</string>
     <string name="playback_history_summary">Save all media played in History section</string>
-    <string name="playback_speed_title">Save Audio Playback Speed</string>
-    <string name="playback_speed_summary">Remember the audio playback speed you set</string>
-    <string name="save_video_speed_title">Save video Playback speed</string>
-    <string name="save_video_speed_summary">Remember the video playback speed you set</string>
+    <string name="playback_speed_title">Save Playback Speed</string>
+    <string name="playback_speed_summary">Remember the playback speed you set</string>
 
     <!-- Tips -->
     <string name="video_player_tips">Video player tips:</string>
diff --git a/vlc-android/res/xml/preferences_adv.xml b/vlc-android/res/xml/preferences_adv.xml
index be94188..429fc05 100644
--- a/vlc-android/res/xml/preferences_adv.xml
+++ b/vlc-android/res/xml/preferences_adv.xml
@@ -12,13 +12,7 @@
     <!--android:title="@string/vout" />-->
 
     <CheckBoxPreference
-        android:defaultValue="false"
-        android:key="video_playback_speed"
-        android:title="@string/save_video_speed_title"
-        android:summary="@string/save_video_speed_summary" />
-
-    <CheckBoxPreference
-        android:defaultValue="false"
+        android:defaultValue="true"
         android:key="playback_speed"
         android:summary="@string/playback_speed_summary"
         android:title="@string/playback_speed_title" />
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 4b33ba9..1cc888a 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1726,7 +1726,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
             mMediaPlayer.setVideoTitleDisplay(MediaPlayer.Position.Disable, 0);
             changeAudioFocus(true);
             mMediaPlayer.setEventListener(mMediaPlayerListener);
-            if (!isVideoPlaying && mMediaPlayer.getRate() == 1.0F && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
+            if (!isVideoPlaying && mMediaPlayer.getRate() == 1.0F && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true))
                 setRate(mSettings.getFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, 1.0F), true);
             mMediaPlayer.play();
 
@@ -1933,7 +1933,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
     @MainThread
     public void setRate(float rate, boolean save) {
         mMediaPlayer.setRate(rate);
-        if (save && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
+        if (save && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true))
             Util.commitPreferences(mSettings.edit().putFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, rate));
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
index cf81840..7b75cfe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
@@ -43,7 +43,6 @@ public class PreferencesActivity extends AppCompatActivity implements PlaybackSe
     public final static String VIDEO_SPEED = "VideoSpeed";
     public final static String VIDEO_BACKGROUND = "video_background";
     public final static String VIDEO_RESTORE = "video_restore";
-    public final static String VIDEO_SAVE_SPEED = "video_playback_speed";
     public final static String VIDEO_RATE = "video_rate";
     public final static String AUTO_RESCAN = "auto_rescan";
     public final static String LOGIN_STORE = "store_login";
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 9bfd84e..3780e57 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -761,7 +761,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         loadMedia();
 
-        boolean ratePref = mSettings.getBoolean(PreferencesActivity.VIDEO_SAVE_SPEED, false);
+        boolean ratePref = mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true);
         mService.setRate(ratePref ? mSettings.getFloat(PreferencesActivity.VIDEO_RATE, 1.0f) : 1.0F, false);
 
 
@@ -907,7 +907,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             }
             editor.putString(PreferencesActivity.VIDEO_SUBTITLE_FILES, subtitleList_serialized);
 
-            boolean ratePref = mSettings.getBoolean(PreferencesActivity.VIDEO_SAVE_SPEED, false);
+            boolean ratePref = mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true);
             if (ratePref)
                 editor.putFloat(PreferencesActivity.VIDEO_RATE, mService.getRate());
             mService.setRate(1.0f, false);



More information about the Android mailing list