[vlc-commits] playlist: rename playlist_Pause() to playlist_TogglePause()

Rémi Denis-Courmont git at videolan.org
Mon Dec 15 18:25:18 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 15 17:45:55 2014 +0200| [522604203a352da515e5f557de039193f7bbd250] | committer: Rémi Denis-Courmont

playlist: rename playlist_Pause() to playlist_TogglePause()

The behaviour is unchanged:
 - if stopped: starts playing,
 - if playing: pauses playing,
 - if paused: resumes playing.

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

 include/vlc_playlist.h                    |    5 +++--
 modules/control/dbus/dbus_player.c        |    4 ++--
 modules/control/hotkeys.c                 |    2 +-
 modules/control/rc.c                      |    2 +-
 modules/gui/macosx/CoreInteraction.m      |    4 ++--
 modules/gui/qt4/input_manager.cpp         |    6 +++---
 modules/gui/skins2/commands/cmd_input.cpp |    2 +-
 modules/lua/libs/playlist.c               |    2 +-
 src/playlist/control.c                    |    2 +-
 src/playlist/engine.c                     |    2 +-
 10 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index ea0d05c..f7bd863 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -258,13 +258,14 @@ enum {
     PLAYLIST_PLAY,      /**< No arg.                            res=can fail*/
     PLAYLIST_VIEWPLAY,  /**< arg1= playlist_item_t*,*/
                         /**  arg2 = playlist_item_t*          , res=can fail */
-    PLAYLIST_PAUSE,     /**< No arg                             res=can fail*/
+    PLAYLIST_TOGGLE_PAUSE, /**< No arg                          res=can fail */
     PLAYLIST_STOP,      /**< No arg                             res=can fail*/
     PLAYLIST_SKIP,      /**< arg1=int,                          res=can fail*/
 };
 
 #define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, pl_Unlocked )
-#define playlist_Pause(p) playlist_Control(p,PLAYLIST_PAUSE, pl_Unlocked )
+#define playlist_TogglePause(p) \
+        playlist_Control(p, PLAYLIST_TOGGLE_PAUSE, pl_Unlocked)
 #define playlist_Stop(p) playlist_Control(p,PLAYLIST_STOP, pl_Unlocked )
 #define playlist_Next(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, 1)
 #define playlist_Prev(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, -1)
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 494d9d5..d558249 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -225,7 +225,7 @@ DBUS_METHOD( Pause )
     input_thread_t *p_input = pl_CurrentInput( p_this );
 
     if( p_input && var_GetInteger(p_input, "state") == PLAYING_S )
-        playlist_Pause( PL );
+        playlist_TogglePause( PL );
 
     if( p_input )
         vlc_object_release( p_input );
@@ -239,7 +239,7 @@ DBUS_METHOD( PlayPause )
     input_thread_t *p_input = pl_CurrentInput( p_this );
 
     if( p_input && var_GetInteger(p_input, "state") == PLAYING_S )
-        playlist_Pause( PL );
+        playlist_TogglePause( PL );
     else
         playlist_Play( PL );
 
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index a2164cf..99b364c 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -349,7 +349,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
 
                 int state = var_GetInteger( p_input, "state" );
                 DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON );
-                playlist_Pause( p_playlist );
+                playlist_TogglePause( p_playlist );
             }
             else
                 playlist_Play( p_playlist );
diff --git a/modules/control/rc.c b/modules/control/rc.c
index 365c40e..c3eb726 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -968,7 +968,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
     /* Parse commands that only require an input */
     if( !strcmp( psz_cmd, "pause" ) )
     {
-        playlist_Pause( p_intf->p_sys->p_playlist );
+        playlist_TogglePause( p_intf->p_sys->p_playlist );
         i_error = VLC_SUCCESS;
     }
     else if( !strcmp( psz_cmd, "seek" ) )
diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index 1fc4d6e..c4780bf 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -75,7 +75,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
     playlist_t * p_playlist = pl_Get(VLCIntf);
 
     if (p_input) {
-        playlist_Pause(p_playlist);
+        playlist_TogglePause(p_playlist);
         vlc_object_release(p_input);
     } else {
         bool empty;
@@ -100,7 +100,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
     PL_UNLOCK;
 
     if (b_playlist_playing)
-        playlist_Pause(p_playlist);
+        playlist_TogglePause(p_playlist);
 }
 
 - (void)stop
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 1382512..56db96d 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -1123,7 +1123,7 @@ void MainInputManager::togglePlayPause()
     if( !p_input )
         playlist_Play( THEPL );
     else
-        playlist_Pause( THEPL );
+        playlist_TogglePause( THEPL );
 }
 
 void MainInputManager::play()
@@ -1135,7 +1135,7 @@ void MainInputManager::play()
     {
         if( PLAYING_S != var_GetInteger( p_input, "state" ) )
         {
-            playlist_Pause( THEPL );
+            playlist_TogglePause( THEPL );
         }
     }
 }
@@ -1144,7 +1144,7 @@ void MainInputManager::pause()
 {
     if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) )
     {
-        playlist_Pause( THEPL );
+        playlist_TogglePause( THEPL );
     }
 }
 
diff --git a/modules/gui/skins2/commands/cmd_input.cpp b/modules/gui/skins2/commands/cmd_input.cpp
index fc39164..c78c790 100644
--- a/modules/gui/skins2/commands/cmd_input.cpp
+++ b/modules/gui/skins2/commands/cmd_input.cpp
@@ -61,7 +61,7 @@ void CmdPause::execute()
 {
     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
     if( pPlaylist != NULL )
-        playlist_Pause( pPlaylist );
+        playlist_TogglePause( pPlaylist );
 }
 
 
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index f657217..1159262 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -85,7 +85,7 @@ static int vlclua_playlist_play( lua_State * L )
 static int vlclua_playlist_pause( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
-    playlist_Pause( p_playlist );
+    playlist_TogglePause( p_playlist );
     return 0;
 }
 
diff --git a/src/playlist/control.c b/src/playlist/control.c
index b475d22..0644177 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -104,7 +104,7 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query, va_list arg
         }
         break;
 
-    case PLAYLIST_PAUSE:
+    case PLAYLIST_TOGGLE_PAUSE:
         if( !pl_priv(p_playlist)->p_input )
         {   /* FIXME: is this really useful without input? */
             pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index b9e2a04..10a6059 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -89,7 +89,7 @@ static int CorksCallback( vlc_object_t *obj, char const *var,
         if( var_InheritBool( obj, "playlist-cork" ) )
         {
             msg_Dbg( obj, "corked" );
-            playlist_Pause( pl );
+            playlist_TogglePause( pl );
         }
         else
             msg_Dbg( obj, "not corked" );



More information about the vlc-commits mailing list