]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_dvd.cpp
9c47276816542b53201b85cbf9ca71d2acf756a6
[vlc] / modules / gui / skins2 / commands / cmd_dvd.cpp
1 /*****************************************************************************
2  * cmd_dvd.cpp
3  *****************************************************************************
4  * Copyright (C) 2003 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
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.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "cmd_dvd.hpp"
25 #include <vlc_input.h>
26 #include <vlc_playlist.h>
27
28 void CmdDvdNextTitle::execute()
29 {
30     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
31     input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
32
33     if( p_input )
34     {
35         var_TriggerCallback( p_input, "next-title" );
36         vlc_object_release( p_input );
37     }
38 }
39
40
41 void CmdDvdPreviousTitle::execute()
42 {
43     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
44     input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
45
46     if( p_input )
47     {
48         var_TriggerCallback( p_input, "prev-title" );
49         vlc_object_release( p_input );
50     }
51 }
52
53
54 void CmdDvdNextChapter::execute()
55 {
56     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
57     input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
58
59     if( p_input )
60     {
61         var_TriggerCallback( p_input, "next-chapter" );
62         vlc_object_release( p_input );
63     }
64 }
65
66
67 void CmdDvdPreviousChapter::execute()
68 {
69     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
70     input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
71
72     if( p_input )
73     {
74         var_TriggerCallback( p_input, "prev-chapter" );
75         vlc_object_release( p_input );
76     }
77 }
78
79
80 void CmdDvdRootMenu::execute()
81 {
82     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
83     input_thread_t *p_input = playlist_CurrentInput( pPlaylist );
84
85     if( p_input )
86     {
87         vlc_value_t val;
88         val.i_int = 2;
89
90         var_Set( p_input, "title  0", val);
91         vlc_object_release( p_input );
92     }
93 }
94