Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
673593dc
Commit
673593dc
authored
Sep 22, 2006
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacontrol API: (mostly) use the new libvlc API
parent
12697ee7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
233 additions
and
293 deletions
+233
-293
include/mediacontrol_internal.h
include/mediacontrol_internal.h
+26
-4
include/vlc/mediacontrol.h
include/vlc/mediacontrol.h
+6
-2
src/control/mediacontrol_audio_video.c
src/control/mediacontrol_audio_video.c
+71
-82
src/control/mediacontrol_core.c
src/control/mediacontrol_core.c
+130
-84
src/control/mediacontrol_init.c
src/control/mediacontrol_init.c
+0
-103
src/control/mediacontrol_plugin.c
src/control/mediacontrol_plugin.c
+0
-18
No files found.
include/mediacontrol_internal.h
View file @
673593dc
...
@@ -29,13 +29,13 @@ extern "C" {
...
@@ -29,13 +29,13 @@ extern "C" {
# endif
# endif
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include "vlc/mediacontrol_structures.h"
#include <vlc/mediacontrol_structures.h>
#include <libvlc_internal.h>
#include <vlc/libvlc.h>
struct
mediacontrol_Instance
{
struct
mediacontrol_Instance
{
vlc_object
_t
*
p_
vlc
;
struct
libvlc_instance
_t
*
p_
instance
;
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
intf_thread_t
*
p_intf
;
int
vlc_object_id
;
};
};
vlc_int64_t
mediacontrol_unit_convert
(
input_thread_t
*
p_input
,
vlc_int64_t
mediacontrol_unit_convert
(
input_thread_t
*
p_input
,
...
@@ -46,6 +46,28 @@ vlc_int64_t mediacontrol_position2microsecond(
...
@@ -46,6 +46,28 @@ vlc_int64_t mediacontrol_position2microsecond(
input_thread_t
*
p_input
,
input_thread_t
*
p_input
,
const
mediacontrol_Position
*
pos
);
const
mediacontrol_Position
*
pos
);
#define RAISE( c, m ) exception->code = c; \
exception->message = strdup(m);
#define RAISE_NULL( c, m ) RAISE( c, m ); return NULL;
#define RAISE_VOID( c, m ) RAISE( c, m ); return;
#define HANDLE_LIBVLC_EXCEPTION_VOID( e ) if( libvlc_exception_raised( e ) ) { \
RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \
libvlc_exception_clear( e ); \
return; }
#define HANDLE_LIBVLC_EXCEPTION_NULL( e ) if( libvlc_exception_raised( e ) ) { \
RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \
libvlc_exception_clear( e ); \
return NULL; }
#define HANDLE_LIBVLC_EXCEPTION_ZERO( e ) if( libvlc_exception_raised( e ) ) { \
RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \
libvlc_exception_clear( e ); \
return 0; }
# ifdef __cplusplus
# ifdef __cplusplus
}
}
# endif
# endif
...
...
include/vlc/mediacontrol.h
View file @
673593dc
...
@@ -114,9 +114,13 @@ void mediacontrol_exception_free(mediacontrol_Exception *exception);
...
@@ -114,9 +114,13 @@ void mediacontrol_exception_free(mediacontrol_Exception *exception);
mediacontrol_Instance
*
mediacontrol_Instance
*
mediacontrol_new
(
char
**
args
,
mediacontrol_Exception
*
exception
);
mediacontrol_new
(
char
**
args
,
mediacontrol_Exception
*
exception
);
/* Bridge with the libvlc API */
mediacontrol_Instance
*
mediacontrol_Instance
*
mediacontrol_new_from_object
(
int
vlc_object_id
,
mediacontrol_new_from_instance
(
libvlc_instance_t
*
p_instance
,
mediacontrol_Exception
*
exception
);
mediacontrol_Exception
*
exception
);
libvlc_instance_t
*
mediacontrol_get_libvlc_instance
(
mediacontrol_Instance
*
self
);
mediacontrol_Position
*
mediacontrol_get_media_position
(
mediacontrol_Position
*
mediacontrol_get_media_position
(
mediacontrol_Instance
*
self
,
mediacontrol_Instance
*
self
,
...
...
src/control/mediacontrol_audio_video.c
View file @
673593dc
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <mediacontrol_internal.h>
#include <mediacontrol_internal.h>
#include <vlc/mediacontrol.h>
#include <vlc/mediacontrol.h>
#include <vlc/libvlc.h>
#include <vlc/intf.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <vlc/vout.h>
...
@@ -245,17 +246,16 @@ unsigned short
...
@@ -245,17 +246,16 @@ unsigned short
mediacontrol_sound_get_volume
(
mediacontrol_Instance
*
self
,
mediacontrol_sound_get_volume
(
mediacontrol_Instance
*
self
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
short
retval
;
libvlc_exception_t
ex
;
audio_volume_t
i_volume
;
int
i_ret
=
0
;
if
(
!
self
->
p_intf
)
mediacontrol_exception_init
(
exception
);
{
libvlc_exception_init
(
&
ex
);
RAISE
(
mediacontrol_InternalException
,
"No interface module"
);
return
0
;
i_ret
=
libvlc_audio_get_volume
(
self
->
p_instance
,
&
ex
);
}
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
aout_VolumeGet
(
self
->
p_intf
,
&
i_volume
);
/* FIXME: Normalize in [0..100] */
retval
=
i_volume
;
return
(
unsigned
short
)
i_ret
;
return
retval
;
}
}
void
void
...
@@ -263,46 +263,49 @@ mediacontrol_sound_set_volume( mediacontrol_Instance *self,
...
@@ -263,46 +263,49 @@ mediacontrol_sound_set_volume( mediacontrol_Instance *self,
const
unsigned
short
volume
,
const
unsigned
short
volume
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
if
(
!
self
->
p_intf
)
/* FIXME: Normalize in [0..100] */
{
libvlc_exception_t
ex
;
RAISE
(
mediacontrol_InternalException
,
"No interface module"
);
}
mediacontrol_exception_init
(
exception
);
else
aout_VolumeSet
(
self
->
p_intf
,(
audio_volume_t
)
volume
);
libvlc_exception_init
(
&
ex
);
libvlc_audio_set_volume
(
self
->
p_instance
,
volume
,
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
}
}
vlc_bool_t
mediacontrol_set_visual
(
mediacontrol_Instance
*
self
,
vlc_bool_t
mediacontrol_set_visual
(
mediacontrol_Instance
*
self
,
WINDOWHANDLE
visual_id
,
WINDOWHANDLE
visual_id
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
vlc_value_t
value
;
libvlc_exception_t
ex
;
int
ret
;
if
(
!
self
->
p_vlc
)
mediacontrol_exception_init
(
exception
);
{
libvlc_exception_init
(
&
ex
);
RAISE
(
mediacontrol_InternalException
,
"No vlc reference"
);
return
VLC_FALSE
;
}
value
.
i_int
=
visual_id
;
ret
=
var_Set
(
self
->
p_vlc
,
"drawable"
,
value
);
return
(
ret
==
VLC_SUCCESS
);
libvlc_video_set_parent
(
self
->
p_instance
,
visual_id
,
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
return
VLC_TRUE
;
}
}
int
int
mediacontrol_get_rate
(
mediacontrol_Instance
*
self
,
mediacontrol_get_rate
(
mediacontrol_Instance
*
self
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
int
retval
;
libvlc_exception_t
ex
;
input_thread_t
*
p_input
=
NULL
;
libvlc_input_t
*
p_input
;
int
i_ret
;
mediacontrol_exception_init
(
exception
);
libvlc_exception_init
(
&
ex
);
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
i_ret
=
libvlc_input_get_rate
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
p_input
=
self
->
p_playlist
->
p_input
;
return
i_ret
/
10
;
if
(
!
p_input
)
{
RAISE
(
mediacontrol_InternalException
,
"No input"
);
return
0
;
}
retval
=
var_GetInteger
(
p_input
,
"rate"
)
/
10
;
return
retval
;
}
}
void
void
...
@@ -310,42 +313,39 @@ mediacontrol_set_rate( mediacontrol_Instance *self,
...
@@ -310,42 +313,39 @@ mediacontrol_set_rate( mediacontrol_Instance *self,
const
int
rate
,
const
int
rate
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
input_thread_t
*
p_input
=
NULL
;
libvlc_exception_t
ex
;
libvlc_input_t
*
p_input
;
mediacontrol_exception_init
(
exception
);
libvlc_exception_init
(
&
ex
);
p_input
=
self
->
p_playlist
->
p_input
;
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
if
(
!
p_input
)
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
{
RAISE
(
mediacontrol_InternalException
,
"No input"
);
libvlc_input_set_rate
(
p_input
,
rate
*
10
,
&
ex
);
return
;
libvlc_input_free
(
p_input
);
}
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
var_SetInteger
(
p_input
,
"rate"
,
rate
*
10
);
return
;
}
}
int
int
mediacontrol_get_fullscreen
(
mediacontrol_Instance
*
self
,
mediacontrol_get_fullscreen
(
mediacontrol_Instance
*
self
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
vout_thread_t
*
p_vout
=
NULL
;
libvlc_exception_t
ex
;
vlc_
value_t
val
;
lib
vlc_
input_t
*
p_input
;
int
i_ret
;
int
i_ret
;
p_vout
=
vlc_object_find
(
self
->
p_playlist
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
!
p_vout
)
{
RAISE
(
mediacontrol_InternalException
,
"no video output"
);
return
0
;
}
i_ret
=
var_Get
(
p_vout
,
"fullscreen"
,
&
val
);
vlc_object_release
(
p_vout
);
if
(
i_ret
)
mediacontrol_exception_init
(
exception
);
{
libvlc_exception_init
(
&
ex
);
RAISE
(
mediacontrol_InternalException
,
"Unexpected error while looking up fullscreen value"
);
return
0
;
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
}
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
return
val
.
b_bool
==
VLC_TRUE
?
1
:
0
;
i_ret
=
libvlc_get_fullscreen
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
return
i_ret
;
}
}
void
void
...
@@ -353,27 +353,16 @@ mediacontrol_set_fullscreen( mediacontrol_Instance *self,
...
@@ -353,27 +353,16 @@ mediacontrol_set_fullscreen( mediacontrol_Instance *self,
const
int
b_fullscreen
,
const
int
b_fullscreen
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
vout_thread_t
*
p_vout
=
NULL
;
libvlc_exception_t
ex
;
vlc_value_t
val
;
libvlc_input_t
*
p_input
;
int
i_ret
;
p_vout
=
vlc_object_find
(
self
->
p_playlist
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
!
p_vout
)
{
RAISE
(
mediacontrol_InternalException
,
"no video output"
);
return
;
}
if
(
b_fullscreen
)
val
.
b_bool
=
VLC_TRUE
;
mediacontrol_exception_init
(
exception
)
;
else
val
.
b_bool
=
VLC_FALSE
;
libvlc_exception_init
(
&
ex
)
;
i_ret
=
var_Set
(
p_vout
,
"fullscreen"
,
val
);
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
vlc_object_release
(
p_vout
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
if
(
i_ret
)
libvlc_set_fullscreen
(
p_input
,
b_fullscreen
,
&
ex
);
{
libvlc_input_free
(
p_input
);
RAISE
(
mediacontrol_InternalException
,
"Unexpected error while setting fullscreen value"
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
return
;
}
return
;
}
}
src/control/mediacontrol_core.c
View file @
673593dc
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <mediacontrol_internal.h>
#include <mediacontrol_internal.h>
#include <vlc/mediacontrol.h>
#include <vlc/mediacontrol.h>
#include <vlc/libvlc.h>
#include <vlc/intf.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <vlc/vout.h>
#include <vlc/aout.h>
#include <vlc/aout.h>
...
@@ -54,46 +55,84 @@
...
@@ -54,46 +55,84 @@
# include <sys/types.h>
# include <sys/types.h>
#endif
#endif
#define RAISE( c, m ) exception->code = c; \
mediacontrol_Instance
*
mediacontrol_new
(
char
**
args
,
mediacontrol_Exception
*
exception
)
exception->message = strdup(m);
mediacontrol_Instance
*
mediacontrol_new_from_object
(
int
vlc_object_id
,
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_Instance
*
retval
=
NULL
;
mediacontrol_Instance
*
retval
;
vlc_object_t
*
p_vlc
;
libvlc_exception_t
ex
;
vlc_object_t
*
p_object
;
char
**
ppsz_argv
;
int
i_count
=
0
;
int
i_index
;
char
**
p_tmp
;
p_object
=
(
vlc_object_t
*
)
vlc_current_object
(
vlc_object_id
);
libvlc_exception_init
(
&
ex
);
if
(
!
p_object
)
exception
=
mediacontrol_exception_init
(
exception
);
/* Copy args array */
if
(
args
)
{
{
RAISE
(
mediacontrol_InternalException
,
"unable to find vlc object"
)
;
for
(
p_tmp
=
args
;
*
p_tmp
!=
NULL
;
p_tmp
++
)
return
NULL
;
i_count
++
;
}
}
p
_vlc
=
vlc_object_find
(
p_object
,
VLC_OBJECT_ROOT
,
FIND_PARENT
);
p
psz_argv
=
malloc
(
(
i_count
+
2
)
*
sizeof
(
char
*
)
)
;
if
(
!
p
_vlc
)
if
(
!
p
psz_argv
)
{
{
RAISE
(
mediacontrol_InternalException
,
"unable to initialize VLC"
);
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
return
NULL
;
}
ppsz_argv
[
0
]
=
"vlc"
;
for
(
i_index
=
0
;
i_index
<
i_count
;
i_index
++
)
{
ppsz_argv
[
i_index
+
1
]
=
strdup
(
args
[
i_index
]
);
if
(
!
ppsz_argv
[
i_index
+
1
]
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
}
}
}
retval
=
(
mediacontrol_Instance
*
)
malloc
(
sizeof
(
mediacontrol_Instance
)
);
retval
->
p_vlc
=
p_vlc
;
retval
->
vlc_object_id
=
p_vlc
->
i_object_id
;
/* We can keep references on these, which should not change. Is it true ? */
ppsz_argv
[
i_count
+
2
]
=
NULL
;
retval
->
p_playlist
=
vlc_object_find
(
p_vlc
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
retval
->
p_intf
=
vlc_object_find
(
p_vlc
,
VLC_OBJECT_INTF
,
FIND_ANYWHERE
);
if
(
!
retval
->
p_playlist
||
!
retval
->
p_intf
)
retval
=
(
mediacontrol_Instance
*
)
malloc
(
sizeof
(
mediacontrol_Instance
)
);
{
if
(
!
retval
)
RAISE
(
mediacontrol_InternalException
,
"no interface available"
);
{
return
NULL
;
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
)
;
}
}
return
retval
;
retval
->
p_instance
=
libvlc_new
(
i_count
+
1
,
ppsz_argv
,
&
ex
);
retval
->
p_playlist
=
retval
->
p_instance
->
p_libvlc_int
->
p_playlist
;
HANDLE_LIBVLC_EXCEPTION_NULL
(
&
ex
);
return
retval
;
};
};
void
mediacontrol_exit
(
mediacontrol_Instance
*
self
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_destroy
(
self
->
p_instance
,
&
ex
);
}
libvlc_instance_t
*
mediacontrol_get_libvlc_instance
(
mediacontrol_Instance
*
self
)
{
return
self
->
p_instance
;
}
mediacontrol_Instance
*
mediacontrol_new_from_instance
(
libvlc_instance_t
*
p_instance
,
mediacontrol_Exception
*
exception
)
{
mediacontrol_Instance
*
retval
;
retval
=
(
mediacontrol_Instance
*
)
malloc
(
sizeof
(
mediacontrol_Instance
)
);
if
(
!
retval
)
{
RAISE_NULL
(
mediacontrol_InternalException
,
"out of memory"
);
}
retval
->
p_instance
=
p_instance
;
retval
->
p_playlist
=
retval
->
p_instance
->
p_libvlc_int
->
p_playlist
;
return
retval
;
}
/**************************************************************************
/**************************************************************************
* Playback management
* Playback management
...
@@ -105,38 +144,49 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
...
@@ -105,38 +144,49 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
mediacontrol_Position
*
retval
=
NULL
;
mediacontrol_Position
*
retval
=
NULL
;
vlc_value_t
val
;
libvlc_exception_t
ex
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
vlc_int64_t
pos
;
libvlc_input_t
*
p_input
;
exception
=
mediacontrol_exception_init
(
exception
);
exception
=
mediacontrol_exception_init
(
exception
);
libvlc_exception_init
(
&
ex
);
retval
=
(
mediacontrol_Position
*
)
malloc
(
sizeof
(
mediacontrol_Position
)
);
retval
=
(
mediacontrol_Position
*
)
malloc
(
sizeof
(
mediacontrol_Position
)
);
retval
->
origin
=
an_origin
;
retval
->
origin
=
an_origin
;
retval
->
key
=
a_key
;
retval
->
key
=
a_key
;
if
(
!
p_input
)
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
{
HANDLE_LIBVLC_EXCEPTION_NULL
(
&
ex
);
RAISE
(
mediacontrol_InternalException
,
"No input thread."
);
return
NULL
;
}
if
(
an_origin
!=
mediacontrol_AbsolutePosition
)
if
(
an_origin
!=
mediacontrol_AbsolutePosition
)
{
{
libvlc_input_free
(
p_input
);
/* Relative or ModuloPosition make no sense */
/* Relative or ModuloPosition make no sense */
RAISE
(
mediacontrol_PositionOriginNotSupported
,
RAISE_NULL
(
mediacontrol_PositionOriginNotSupported
,
"Only absolute position is valid."
);
"Only absolute position is valid."
);
return
NULL
;
}
}
/* We are asked for an AbsolutePosition. */
/* We are asked for an AbsolutePosition. */
val
.
i_time
=
0
;
pos
=
libvlc_input_get_time
(
p_input
,
&
ex
);
var_Get
(
p_input
,
"time"
,
&
val
);
/* FIXME: check val.i_time > 0 */
if
(
a_key
==
mediacontrol_MediaTime
)
{
retval
->
value
=
mediacontrol_unit_convert
(
p_input
,
retval
->
value
=
pos
/
1000
;
mediacontrol_MediaTime
,
}
a_key
,
else
val
.
i_time
/
1000
);
{
if
(
!
self
->
p_playlist
->
p_input
)
{
libvlc_input_free
(
p_input
);
RAISE_NULL
(
mediacontrol_InternalException
,
"No input"
);
}
retval
->
value
=
mediacontrol_unit_convert
(
self
->
p_playlist
->
p_input
,
mediacontrol_MediaTime
,
a_key
,
pos
/
1000
);
}
libvlc_input_free
(
p_input
);
return
retval
;
return
retval
;
}
}
...
@@ -146,23 +196,20 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
...
@@ -146,23 +196,20 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
const
mediacontrol_Position
*
a_position
,
const
mediacontrol_Position
*
a_position
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
vlc_value_t
val
;
libvlc_input_t
*
p_input
;
input_thread_t
*
p_input
=
self
->
p_playlist
->
p_input
;
libvlc_exception_t
ex
;
vlc_int64_t
i_pos
;
exception
=
mediacontrol_exception_init
(
exception
);
libvlc_exception_init
(
&
ex
);
if
(
!
p_input
)
mediacontrol_exception_init
(
exception
);
{
RAISE
(
mediacontrol_InternalException
,
"No input thread."
);
p_input
=
libvlc_playlist_get_input
(
self
->
p_instance
,
&
ex
);
}
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
else
if
(
!
var_GetBool
(
p_input
,
"seekable"
)
)
{
i_pos
=
mediacontrol_position2microsecond
(
self
->
p_playlist
->
p_input
,
a_position
);
RAISE
(
mediacontrol_InvalidPosition
,
"Stream not seekable"
);
libvlc_input_set_time
(
p_input
,
i_pos
,
&
ex
);
}
libvlc_input_free
(
p_input
);
else
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
{
val
.
i_time
=
mediacontrol_position2microsecond
(
p_input
,
a_position
);
var_Set
(
p_input
,
"time"
,
val
);
}
}
}
/* Starts playing a stream */
/* Starts playing a stream */
...
@@ -278,40 +325,39 @@ mediacontrol_playlist_add_item( mediacontrol_Instance *self,
...
@@ -278,40 +325,39 @@ mediacontrol_playlist_add_item( mediacontrol_Instance *self,
const
char
*
psz_file
,
const
char
*
psz_file
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
exception
=
mediacontrol_exception_init
(
exception
);
libvlc_exception_t
ex
;
if
(
!
self
->
p_playlist
)
{
mediacontrol_exception_init
(
exception
);
RAISE
(
mediacontrol_InternalException
,
"No playlist"
);
libvlc_exception_init
(
&
ex
);
}
else
libvlc_playlist_add
(
self
->
p_instance
,
psz_file
,
psz_file
,
&
ex
);
playlist_PlaylistAdd
(
self
->
p_playlist
,
psz_file
,
psz_file
,
PLAYLIST_INSERT
,
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
PLAYLIST_END
);
}
}
void
void
mediacontrol_playlist_next_item
(
mediacontrol_Instance
*
self
,
mediacontrol_playlist_next_item
(
mediacontrol_Instance
*
self
,
mediacontrol_Exception
*
exception
)
mediacontrol_Exception
*
exception
)
{
{
exception
=
mediacontrol_exception_init
(
exception
)
;