2 * testapi.c - libvlc-control smoke test
7 /**********************************************************************
8 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
9 * This program is free software; you can redistribute and/or modify *
10 * it under the terms of the GNU General Public License as published *
11 * by the Free Software Foundation; version 2 of the license, or (at *
12 * your option) any later version. *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
17 * See the GNU General Public License for more details. *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, you can get it from: *
21 * http://www.gnu.org/copyleft/gpl.html *
22 **********************************************************************/
24 #include <vlc/mediacontrol.h>
27 int main (int argc, char *argv[])
29 mediacontrol_Exception ex;
30 mediacontrol_Instance *mc, *mc2;
31 libvlc_instance_t *vlc;
33 mediacontrol_exception_init (&ex);
34 mc = mediacontrol_new (argc, argv, &ex);
37 mediacontrol_exception_cleanup (&ex);
39 /* Duplication test */
40 vlc = mediacontrol_get_libvlc_instance (mc);
44 mediacontrol_exception_init (&ex);
45 mc2 = mediacontrol_new_from_instance (vlc, &ex);
48 mediacontrol_exception_cleanup (&ex);
50 //mediacontrol_exit (mc2);
53 mediacontrol_exception_init (&ex);
54 mediacontrol_resume (mc, NULL, &ex);
55 assert (ex.code); /* should fail: we have no input */
56 mediacontrol_exception_cleanup (&ex);
58 mediacontrol_exception_init (&ex);
59 mediacontrol_pause (mc, NULL, &ex);
60 assert (ex.code); /* should fail: we have no input */
61 mediacontrol_exception_cleanup (&ex);
63 mediacontrol_exception_init (&ex);
64 mediacontrol_stop (mc, NULL, &ex);
65 mediacontrol_exception_cleanup (&ex);
68 mediacontrol_exception_init (&ex);
69 mediacontrol_playlist_clear (mc, &ex);
71 mediacontrol_exception_cleanup (&ex);
73 mediacontrol_exception_init (&ex);
74 mediacontrol_playlist_add_item (mc, "/dev/null", &ex);
75 mediacontrol_exception_cleanup (&ex);
77 mediacontrol_exception_init (&ex);
78 mediacontrol_playlist_clear (mc, &ex);
80 mediacontrol_exception_cleanup (&ex);
82 mediacontrol_exit (mc);