Commit 88f691d0 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* core/playlist: PLAYLIST_PAUSE, playlist_IsPlaying, playlist_IsEmpty

 * modules/gui/macosx: started getting rid of p_intf->p_sys->p_input
                       and using p_playlist->p_input instead.
parent 0e8bd13c
......@@ -5,7 +5,6 @@
{
ACTIONS = {
deinterlace = id;
fastForward = id;
faster = id;
fullscreen = id;
loop = id;
......@@ -14,7 +13,6 @@
pause = id;
play = id;
prev = id;
slowMotion = id;
slower = id;
stop = id;
toggleChapter = id;
......
......@@ -7,7 +7,7 @@
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>16 822 419 44 0 0 1280 1002 </string>
<string>22 973 419 44 0 0 1600 1178 </string>
<key>303</key>
<string>60 509 104 66 0 0 1280 1002 </string>
<key>909</key>
......
......@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.7 2002/12/13 16:26:34 babal Exp $
* $Id: vlc_playlist.h,v 1.8 2003/01/29 11:34:11 jlj Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -53,6 +53,13 @@ struct playlist_t
input_thread_t * p_input;
};
/*****************************************************************************
* Playlist status
*****************************************************************************/
#define PLAYLIST_STOPPED 0
#define PLAYLIST_RUNNING 1
#define PLAYLIST_PAUSED 2
/*****************************************************************************
* Prototypes
*****************************************************************************/
......@@ -74,3 +81,25 @@ VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int
VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_LoadFile, ( playlist_t *, const char * ) );
VLC_EXPORT( int, playlist_SaveFile, ( playlist_t *, const char * ) );
static inline vlc_bool_t playlist_IsPlaying( playlist_t * p_playlist )
{
vlc_bool_t b_playing;
vlc_mutex_lock( &p_playlist->object_lock );
b_playing = p_playlist->i_status == PLAYLIST_RUNNING;
vlc_mutex_unlock( &p_playlist->object_lock );
return( b_playing );
}
static inline vlc_bool_t playlist_IsEmpty( playlist_t * p_playlist )
{
vlc_bool_t b_empty;
vlc_mutex_lock( &p_playlist->object_lock );
b_empty = p_playlist->i_size == 0;
vlc_mutex_unlock( &p_playlist->object_lock );
return( b_empty );
}
This diff is collapsed.
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.18 2003/01/27 00:08:31 jlj Exp $
* $Id: intf.h,v 1.19 2003/01/29 11:34:11 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -57,7 +57,6 @@ struct intf_sys_t
NSPort * o_sendport;
/* special actions */
vlc_bool_t b_loop;
vlc_bool_t b_playing;
vlc_bool_t b_stopping;
vlc_bool_t b_mute;
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.37 2003/01/28 01:50:52 hartman Exp $
* $Id: intf.m,v 1.38 2003/01/29 11:34:11 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -663,15 +663,6 @@ static void Run( intf_thread_t *p_intf )
[o_controls setVolumeSlider];
[o_timeslider setEnabled: b_input];
if ( (p_intf->p_sys->b_loop = config_GetInt( p_intf, "loop" )) )
{
[o_mi_loop setState: NSOnState];
}
else
{
[o_mi_loop setState: NSOffState];
}
if ( p_intf->p_sys->p_input != NULL &&
p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
{
......
......@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: playlist.m,v 1.5 2003/01/24 02:31:53 hartman Exp $
* $Id: playlist.m,v 1.6 2003/01/29 11:34:11 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -232,11 +232,6 @@
return;
}
if( p_intf->p_sys->b_loop )
{
playlist_Delete( p_playlist, p_playlist->i_size - 1 );
}
i_items = 0;
o_enum = [o_array objectEnumerator];
while( ( o_value = [o_enum nextObject] ) )
......@@ -261,12 +256,6 @@
i_items++;
}
if( p_intf->p_sys->b_loop )
{
playlist_Add( p_playlist, "vlc:loop",
PLAYLIST_APPEND, PLAYLIST_END );
}
vlc_object_release( p_playlist );
[self playlistUpdated];
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.30 2002/12/13 16:26:35 babal Exp $
* $Id: playlist.c,v 1.31 2003/01/29 11:34:11 jlj Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -31,9 +31,6 @@
#include "vlc_playlist.h"
#define PLAYLIST_STOPPED 0
#define PLAYLIST_RUNNING 1
#define PLAYLIST_FILE_HEADER_0_5 "# vlc playlist file version 0.5"
#ifdef WIN32
# define PLAYLIST_FILE_EOL "\r\n"
......@@ -306,12 +303,20 @@ void playlist_Command( playlist_t * p_playlist, int i_command, int i_arg )
case PLAYLIST_PLAY:
p_playlist->i_status = PLAYLIST_RUNNING;
if ( p_playlist->p_input )
if( p_playlist->p_input )
{
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PLAY );
}
break;
case PLAYLIST_PAUSE:
p_playlist->i_status = PLAYLIST_PAUSED;
if( p_playlist->p_input )
{
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE );
}
break;
case PLAYLIST_SKIP:
p_playlist->i_status = PLAYLIST_STOPPED;
SkipItem( p_playlist, i_arg );
......
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