]> git.sesse.net Git - vlc/blob - modules/gui/beos/VlcWrapper.h
* Makefile.am: fixed 'make package-beos'
[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.21 2003/04/22 16:36:16 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 #include <String.h>
29
30 #define SEEKSLIDER_RANGE 2048
31
32 class InterfaceWindow;
33 class VlcWrapper;
34
35 /*****************************************************************************
36  * intf_sys_t: internal variables of the BeOS interface
37  *****************************************************************************/
38 struct intf_sys_t
39 {
40     msg_subscription_t * p_sub;
41
42     InterfaceWindow *    p_window;
43     
44     vlc_bool_t           b_loop;
45     vlc_bool_t           b_mute;
46     int                  i_part;
47     audio_volume_t       i_saved_volume;
48     int                  i_channel;
49     bool                 b_dvdmenus;
50     
51     VlcWrapper *         p_wrapper;
52 };
53
54 /* Necessary because of i18n */
55 const char * _AddEllipsis( char * string );
56
57 /*****************************************************************************
58  * VlcWrapper
59  *****************************************************************************
60  * This class makes the link between the BeOS interface and the vlc core.
61  * There is only one VlcWrapper instance at any time, which is stored
62  * in p_intf->p_sys->p_wrapper
63  *****************************************************************************/
64 class VlcWrapper
65 {
66 public:
67     VlcWrapper( intf_thread_t *p_intf );
68     ~VlcWrapper();
69     
70     bool UpdateInput();
71     
72     /* Input */
73     bool         HasInput();
74     int          InputStatus();
75     int          InputRate();
76     void         InputSlower();
77     void         InputFaster();
78     BList *      GetChannels( int i_cat );
79     void         ToggleLanguage( int i_language );
80     void         ToggleSubtitle( int i_subtitle );
81     const char * GetTimeAsString();
82     float        GetTimeAsFloat();
83     void         SetTimeAsFloat( float i_offset );
84     bool         IsPlaying();
85         
86     /* Playlist */
87     void    OpenFiles( BList *o_files, bool replace = true,
88                                    int32 index = -1 );
89     void    OpenDisc( BString o_type, BString o_device,
90                      int i_title, int i_chapter );
91     int     PlaylistSize();
92     char *  PlaylistItemName( int );
93     int     PlaylistCurrent();
94     bool    PlaylistPlay();
95     void    PlaylistPause();
96     void    PlaylistStop();
97     void    PlaylistNext();
98     void    PlaylistPrev();
99     bool    PlaylistPlaying();
100     void    GetPlaylistInfo( int32& currentIndex,
101                              int32& maxIndex );
102     void    PlaylistJumpTo( int );
103     void    GetNavCapabilities( bool * canSkipPrev,
104                                 bool * canSkipNext );
105     void    NavigatePrev();
106     void    NavigateNext();
107
108         /* Playlist manipulation */
109         bool    PlaylistLock() const;
110         void    PlaylistUnlock() const;
111         // playlist must be locked prior to calling all of these!
112         void*   PlaylistItemAt( int index ) const;
113                         // both functions return a copy of the removed item
114                         // so that it can be added at another index
115         void*   PlaylistRemoveItem( int index ) const;
116         void*   PlaylistRemoveItem( void* item ) const;
117                         // uses playlist_AddItem()
118         bool    PlaylistAddItem( void* item, int index ) const;
119         void*   PlaylistCloneItem( void* item ) const;
120                         // only modifies playlist, doesn't effect playback
121         void    PlaylistSetPlaying( int index ) const;
122
123     /* Audio */
124     unsigned short GetVolume();
125     void           SetVolume( int value );
126     void           VolumeMute();
127     void           VolumeRestore();
128     bool           IsMuted();
129
130     /* DVD */
131     bool    HasTitles();
132     BList * GetTitles();
133     void    PrevTitle();
134     void    NextTitle();
135     void    ToggleTitle( int i_title );
136     void    TitleInfo( int32& currentIndex, int32& maxIndex );
137
138     bool    HasChapters();
139     BList * GetChapters();
140     void    PrevChapter();
141     void    NextChapter();
142     void    ToggleChapter( int i_chapter );
143     void    ChapterInfo( int32& currentIndex, int32& maxIndex );
144     
145     /* Miscellanous */
146     void LoadSubFile( const char * psz_file );
147     void FilterChange();
148     
149 private:
150     intf_thread_t *   p_intf;
151     input_thread_t *  p_input;
152     playlist_t *      p_playlist;
153 };