Commit 52260420 authored by Rémi Denis-Courmont's avatar 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.
parent 156b3058
......@@ -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)
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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" ) )
......
......@@ -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
......
......@@ -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 );
}
}
......
......@@ -61,7 +61,7 @@ void CmdPause::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
playlist_Pause( pPlaylist );
playlist_TogglePause( pPlaylist );
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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" );
......
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