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