]> git.sesse.net Git - vlc/commitdiff
playlist: rename playlist_Pause() to playlist_TogglePause()
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 15 Dec 2014 15:45:55 +0000 (17:45 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 15 Dec 2014 17:09:16 +0000 (19:09 +0200)
The behaviour is unchanged:
 - if stopped: starts playing,
 - if playing: pauses playing,
 - if paused: resumes playing.

include/vlc_playlist.h
modules/control/dbus/dbus_player.c
modules/control/hotkeys.c
modules/control/rc.c
modules/gui/macosx/CoreInteraction.m
modules/gui/qt4/input_manager.cpp
modules/gui/skins2/commands/cmd_input.cpp
modules/lua/libs/playlist.c
src/playlist/control.c
src/playlist/engine.c

index ea0d05c02ba2005daaf63a8ea432e1de96616d0b..f7bd863f1376b93e3cab3ae25a8dab185176bcb6 100644 (file)
@@ -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)
index 494d9d5b4d5e964db461005cd1d8e9c9af1f58f4..d55824906106c0c22571b17d5893eb7df03c806f 100644 (file)
@@ -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 );
 
index a2164cf3a05678f3a51b93aa6043e33e03ca21c4..99b364cc0e365bef051b5f3631f06a16adca10bc 100644 (file)
@@ -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 );
index 365c40e46bb59e0145511f72895819835c2d74d7..c3eb726e2d0d0d1b9b694e11d46ae74daf249319 100644 (file)
@@ -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" ) )
index 1fc4d6efddc2baed1ac32c9599bcb63f1595bc22..c4780bf248e4b346192c9636e14fcaa71829e2a9 100644 (file)
@@ -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
index 13825123c545bad51850196265a5200b19162be4..56db96d5940c7d80e9dc74b871d37c204895e627 100644 (file)
@@ -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 );
     }
 }
 
index fc391641e88bb2877a67595e34b6a9e1ae685103..c78c7904100007a4b8d7d1376a9602b3f22e5830 100644 (file)
@@ -61,7 +61,7 @@ void CmdPause::execute()
 {
     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
     if( pPlaylist != NULL )
-        playlist_Pause( pPlaylist );
+        playlist_TogglePause( pPlaylist );
 }
 
 
index f657217fe94eff38bcc6d663cd5feb6007cf0f07..115926262e8ab698d7993628bd8a677f9d815473 100644 (file)
@@ -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;
 }
 
index b475d22399c1a071b55b1c8e9c23ad552cd928e4..06441778514ce914c2f35fc585dd30713720d02b 100644 (file)
@@ -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;
index b9e2a045a1220ef9f178c1d3e1123bed14cd5b38..10a60592b495d073f5a1d0c68f91b64f7d0886f5 100644 (file)
@@ -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" );