2 * media_list_player.c - libvlc 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 **********************************************************************/
26 static void test_media_list_player_pause_stop(const char** argv, int argc)
28 libvlc_instance_t *vlc;
30 libvlc_media_list_t *ml;
31 libvlc_media_list_player_t *mlp;
33 const char * file = test_default_sample;
35 log ("Testing play and pause of %s using the media list.\n", file);
37 libvlc_exception_init (&ex);
38 vlc = libvlc_new (argc, argv, &ex);
41 md = libvlc_media_new (vlc, file, &ex);
44 ml = libvlc_media_list_new (vlc, &ex);
47 mlp = libvlc_media_list_player_new (vlc, &ex);
49 libvlc_media_list_add_media( ml, md, &ex );
52 libvlc_media_list_player_set_media_list( mlp, ml, &ex );
54 libvlc_media_list_player_play_item( mlp, md, &ex );
57 libvlc_media_list_player_pause (mlp, &ex);
60 libvlc_media_list_player_stop (mlp, &ex);
63 libvlc_media_release (md);
65 libvlc_media_list_player_release (mlp);
72 static void test_media_list_player_play_item_at_index(const char** argv, int argc)
74 libvlc_instance_t *vlc;
76 libvlc_media_list_t *ml;
77 libvlc_media_list_player_t *mlp;
79 const char * file = test_default_sample;
81 log ("Testing play and pause of %s using the media list.\n", file);
83 libvlc_exception_init (&ex);
84 vlc = libvlc_new (argc, argv, &ex);
87 md = libvlc_media_new (vlc, file, &ex);
90 ml = libvlc_media_list_new (vlc, &ex);
93 mlp = libvlc_media_list_player_new (vlc, &ex);
95 libvlc_media_list_add_media( ml, md, &ex );
98 libvlc_media_list_player_set_media_list( mlp, ml, &ex );
100 libvlc_media_list_player_play_item_at_index( mlp, 0, &ex );
103 libvlc_media_list_player_stop (mlp, &ex);
106 libvlc_media_release (md);
109 libvlc_media_list_player_release (mlp);
112 libvlc_release (vlc);
121 test_media_list_player_pause_stop (test_defaults_args, test_defaults_nargs);
122 test_media_list_player_play_item_at_index (test_defaults_args, test_defaults_nargs);