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