]> git.sesse.net Git - vlc/blob - modules/gui/beos/VlcWrapper.h
* ALL: more intensive use of the VLCWrapper class
[vlc] / modules / gui / beos / VlcWrapper.h
1 /*****************************************************************************
2  * intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: VlcWrapper.h,v 1.7 2002/11/26 01:06:08 titer Exp $
6  *
7  * Authors: Florian G. Pflug <fgp@phlo.org>
8  *          Jon Lech Johansen <jon-vl@nanocrew.net>
9  *          Tony Castley <tony@castley.net>
10  *          Stephan Aßmus <stippi@yellowbites.com>
11  *          Eric Petit <titer@videolan.org>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
26  *****************************************************************************/
27
28 #define SEEKSLIDER_RANGE 2048
29
30 class InterfaceWindow;
31 class Intf_VLCWrapper;
32
33 /*****************************************************************************
34  * intf_sys_t: internal variables of the BeOS interface
35  *****************************************************************************/
36 struct intf_sys_t
37 {
38     InterfaceWindow * p_window;
39     
40     /* DVD mode */
41     vlc_bool_t        b_disabled_menus;
42     vlc_bool_t        b_loop;
43     vlc_bool_t        b_mute;
44     int               i_part;
45     int               i_saved_volume;
46     int               i_channel;
47     
48     Intf_VLCWrapper * p_wrapper;
49 };
50
51 /*****************************************************************************
52  * Intf_VLCWrapper
53  *****************************************************************************
54  * This class makes the link between the BeOS interface and the vlc core.
55  * There is only one Intf_VLCWrapper instance at any time, which is stored
56  * in p_intf->p_sys->p_wrapper
57  *****************************************************************************/
58 class Intf_VLCWrapper
59 {
60 public:
61     Intf_VLCWrapper( intf_thread_t *p_intf );
62     ~Intf_VLCWrapper();
63     
64     bool UpdateInputAndAOut();
65     
66     int inputGetStatus();
67     int InputStatus();
68     int InputRate();
69     int InputTell();
70     int InputSize();
71     void inputSeek();
72     
73     /* playlist control */
74     int PlaylistSize();
75     char *PlaylistItemName( int );
76     int PlaylistCurrent();
77     
78     bool playlistPlay();
79     void playlistPause();
80     void playlistStop();
81     void playlistNext();
82     void playlistPrev();
83     void playlistJumpTo( int );
84     int  playlistSize();
85     int  playlistCurrentPos();
86     void playlistLock();
87     void playlistUnlock();
88     void playlistSkip(int i);
89     void playlistGoto(int i);
90     void loop(); 
91
92     bool playlistPlaying();
93     BList* playlistAsArray();
94     void   getPlaylistInfo( int32& currentIndex,
95                             int32& maxIndex );
96     void   getTitleInfo( int32& currentIndex,
97                          int32& maxIndex );
98     void   getChapterInfo( int32& currentIndex,
99                            int32& maxIndex );
100     void getNavCapabilities( bool* canSkipPrev,
101                              bool* canSkipNext );
102         void navigatePrev();
103         void navigateNext();
104
105     /* DVD */
106     bool HasTitles();
107     void PrevTitle();
108     void NextTitle();
109     bool HasChapters();
110     void PrevChapter();
111     void NextChapter();
112
113     /*  Stream Control */
114     void playSlower();
115     void playFaster();
116     
117     /* playback control */
118     void volume_mute();
119     void volume_restore();
120     void set_volume(int value);
121     void toggle_mute( );
122     bool is_muted();
123     bool is_playing();
124     void maxvolume();
125     bool has_audio();
126     
127     /* playback info */
128     const char* getTimeAsString();
129     float  getTimeAsFloat();
130     void   setTimeAsFloat( float i_offset );
131
132     /* open file/disc/network */
133     void openFiles( BList *o_files, bool replace = true );
134     void openDisc( BString o_type, BString o_device,
135                    int i_title, int i_chapter );
136     void openNet( BString o_addr, int i_port );
137     void openNetChannel( BString o_addr, int i_port );
138     void openNetHTTP( BString o_addr );
139
140     /* menus management */
141     void toggleProgram( int i_program );
142     void toggleTitle( int i_title );
143     void toggleChapter( int i_chapter );
144     void toggleLanguage( int i_language );
145     void toggleSubtitle( int i_subtitle );
146     void channelNext();
147     void channelPrev();
148
149 private:
150     intf_thread_t * p_intf;
151     input_thread_t * p_input;
152     playlist_t * p_playlist;
153     aout_instance_t * p_aout;
154 };
155