[vlc-commits] gui/macosx: use input vars instead of controls

Thomas Guillem git at videolan.org
Thu Jul 12 12:08:33 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jul 12 09:49:05 2018 +0200| [d900df9ba8d46635a413492b81b6e145c6b4640f] | committer: Thomas Guillem

gui/macosx: use input vars instead of controls

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d900df9ba8d46635a413492b81b6e145c6b4640f
---

 modules/gui/macosx/VLCControlsBarCommon.m | 2 +-
 modules/gui/macosx/VLCCoreInteraction.m   | 2 +-
 modules/gui/macosx/VLCMainMenu.m          | 3 ++-
 modules/gui/macosx/applescript.m          | 8 ++++----
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/VLCControlsBarCommon.m b/modules/gui/macosx/VLCControlsBarCommon.m
index 01dbb3cb2d..9cc83db12d 100644
--- a/modules/gui/macosx/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/VLCControlsBarCommon.m
@@ -307,7 +307,7 @@
         // No duration, disable slider
         [self.timeSlider setEnabled:NO];
     } else {
-        input_state_e inputState = input_GetState(p_input);
+        input_state_e inputState = var_GetInteger(p_input, "state");
         bool buffering = (inputState == INIT_S || inputState == OPENING_S);
         [self.timeSlider setIndefinite:buffering];
     }
diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index d1bdc2e604..904183594d 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -259,7 +259,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     if (!p_input)
         return i_duration;
 
-    input_Control(p_input, INPUT_GET_LENGTH, &i_duration);
+    i_duration = var_GetInteger(p_input, "length");
     vlc_object_release(p_input);
 
     return (i_duration / 1000000);
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index f10b88d07a..7d93b81146 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -847,7 +847,8 @@
 
             input_thread_t *p_input = pl_CurrentInput(getIntf());
             if (p_input) {
-                input_Control(p_input, INPUT_SET_TIME, vlc_tick_from_sec( returnTime ));
+                input_SetTime(p_input, vlc_tick_from_sec(returnTime),
+                              var_GetBool(p_input, "input-fast-seek"));
                 vlc_object_release(p_input);
             }
         }];
diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m
index 1ea4163900..55bba6e155 100644
--- a/modules/gui/macosx/applescript.m
+++ b/modules/gui/macosx/applescript.m
@@ -185,8 +185,7 @@
     if (!p_input)
         return NO;
 
-    input_state_e i_state = ERROR_S;
-    input_Control(p_input, INPUT_GET_STATE, &i_state);
+    input_state_e i_state = var_GetInteger(p_input, "state");
     vlc_object_release(p_input);
 
     return ((i_state == OPENING_S) || (i_state == PLAYING_S));
@@ -229,7 +228,7 @@
     if (!p_input)
         return i_currentTime;
 
-    input_Control(p_input, INPUT_GET_TIME, &i_currentTime);
+    i_currentTime = var_GetInteger(p_input, "time");
     vlc_object_release(p_input);
 
     return (int)SEC_FROM_VLC_TICK(i_currentTime);
@@ -243,7 +242,8 @@
         if (!p_input)
             return;
 
-        input_Control(p_input, INPUT_SET_TIME, vlc_tick_from_sec( i64_value ));
+        input_SetTime(p_input, vlc_tick_from_sec(i64_value),
+                      var_GetBool(p_input, "input-fast-seek"));
         vlc_object_release(p_input);
     }
 }



More information about the vlc-commits mailing list