]> git.sesse.net Git - vlc/blob - modules/gui/beos/VlcWrapper.h
* beos/* : fixed a bug in the progress bar with big files
[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.12 2003/01/12 02:08:39 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     
46     VlcWrapper * p_wrapper;
47 };
48
49 /*****************************************************************************
50  * VlcWrapper
51  *****************************************************************************
52  * This class makes the link between the BeOS interface and the vlc core.
53  * There is only one VlcWrapper instance at any time, which is stored
54  * in p_intf->p_sys->p_wrapper
55  *****************************************************************************/
56 class VlcWrapper
57 {
58 public:
59     VlcWrapper( intf_thread_t *p_intf );
60     ~VlcWrapper();
61     
62     bool UpdateInputAndAOut();
63     
64     /* input */
65     bool HasInput();
66     int InputStatus();
67     int InputRate();
68     void InputSlower();
69     void InputFaster();
70     BList * InputGetChannels( int i_cat );
71     void openFiles( BList *o_files, bool replace = true );
72     void openDisc( BString o_type, BString o_device,
73                    int i_title, int i_chapter );
74     void ToggleLanguage( int i_language );
75     void ToggleSubtitle( int i_subtitle );
76     const char* getTimeAsString();
77     float getTimeAsFloat();
78     void setTimeAsFloat( float i_offset );
79     bool IsPlaying();
80         
81     /* Playlist */
82     int PlaylistSize();
83     char *PlaylistItemName( int );
84     int PlaylistCurrent();
85     int PlaylistStatus();
86     bool PlaylistPlay();
87     void PlaylistPause();
88     void PlaylistStop();
89     void PlaylistNext();
90     void PlaylistPrev();
91     void PlaylistSkip(int i);
92     void PlaylistGoto(int i);
93     void PlaylistLoop(); 
94     BList* PlaylistAsArray();
95     bool PlaylistPlaying();
96     void getPlaylistInfo( int32& currentIndex,
97                             int32& maxIndex );
98     void PlaylistJumpTo( int );
99     void getNavCapabilities( bool* canSkipPrev,
100                              bool* canSkipNext );
101         void navigatePrev();
102         void navigateNext();
103
104     /* audio */
105     unsigned short GetVolume();
106     void SetVolume( int value );
107     void VolumeMute();
108     void VolumeRestore();
109     bool IsMuted();
110     bool HasAudio();
111
112     /* DVD */
113     bool HasTitles();
114     void PrevTitle();
115     void NextTitle();
116     bool HasChapters();
117     void PrevChapter();
118     void NextChapter();
119     void TitleInfo( int32& currentIndex, int32& maxIndex );
120     void ChapterInfo( int32& currentIndex, int32& maxIndex );
121     void toggleTitle( int i_title );
122     void toggleChapter( int i_chapter );
123     
124 private:
125     intf_thread_t * p_intf;
126     input_thread_t * p_input;
127     playlist_t * p_playlist;
128     aout_instance_t * p_aout;
129 };
130