]> git.sesse.net Git - vlc/blob - modules/gui/beos/VlcWrapper.h
d5596a29eff2913d003b10b197ab013d403dded2
[vlc] / modules / gui / beos / VlcWrapper.h
1 /*****************************************************************************
2  * VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: VlcWrapper.h,v 1.15 2003/01/22 01:13:22 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 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     vlc_bool_t        b_loop;
41     vlc_bool_t        b_mute;
42     int               i_part;
43     audio_volume_t    i_saved_volume;
44     int               i_channel;
45     bool              b_dvdold;
46     
47     VlcWrapper * p_wrapper;
48 };
49
50 /*****************************************************************************
51  * VlcWrapper
52  *****************************************************************************
53  * This class makes the link between the BeOS interface and the vlc core.
54  * There is only one VlcWrapper instance at any time, which is stored
55  * in p_intf->p_sys->p_wrapper
56  *****************************************************************************/
57 class VlcWrapper
58 {
59 public:
60     VlcWrapper( intf_thread_t *p_intf );
61     ~VlcWrapper();
62     
63     bool UpdateInputAndAOut();
64     
65     /* Input */
66     bool         HasInput();
67     int          InputStatus();
68     int          InputRate();
69     void         InputSlower();
70     void         InputFaster();
71     BList *      GetChannels( int i_cat );
72     void         ToggleLanguage( int i_language );
73     void         ToggleSubtitle( int i_subtitle );
74     const char * GetTimeAsString();
75     float        GetTimeAsFloat();
76     void         SetTimeAsFloat( float i_offset );
77     bool         IsPlaying();
78         
79     /* Playlist */
80     void    OpenFiles( BList *o_files, bool replace = true );
81     void    OpenDisc( BString o_type, BString o_device,
82                      int i_title, int i_chapter );
83     int     PlaylistSize();
84     char *  PlaylistItemName( int );
85     int     PlaylistCurrent();
86     bool    PlaylistPlay();
87     void    PlaylistPause();
88     void    PlaylistStop();
89     void    PlaylistNext();
90     void    PlaylistPrev();
91     bool    PlaylistPlaying();
92     void    GetPlaylistInfo( int32& currentIndex,
93                              int32& maxIndex );
94     void    PlaylistJumpTo( int );
95     void    GetNavCapabilities( bool * canSkipPrev,
96                                 bool * canSkipNext );
97         void    NavigatePrev();
98         void    NavigateNext();
99
100     /* Audio */
101     bool           HasAudio();
102     unsigned short GetVolume();
103     void           SetVolume( int value );
104     void           VolumeMute();
105     void           VolumeRestore();
106     bool           IsMuted();
107
108     /* DVD */
109     bool    HasTitles();
110     BList * GetTitles();
111     void    PrevTitle();
112     void    NextTitle();
113     void    ToggleTitle( int i_title );
114     void    TitleInfo( int32& currentIndex, int32& maxIndex );
115
116     bool    HasChapters();
117     BList * GetChapters();
118     void    PrevChapter();
119     void    NextChapter();
120     void    ToggleChapter( int i_chapter );
121     void    ChapterInfo( int32& currentIndex, int32& maxIndex );
122     
123     /* Miscellanous */
124     void         LoadSubFile( char * psz_file );
125     
126 private:
127     intf_thread_t * p_intf;
128     input_thread_t * p_input;
129     playlist_t * p_playlist;
130     aout_instance_t * p_aout;
131 };