VlcWrapper.h 5.19 KB
Newer Older
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.25 2003/05/30 18:43:31 titer Exp $
6
7
8
 *
 * Authors: Florian G. Pflug <fgp@phlo.org>
 *          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
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/
Eric Petit's avatar
Eric Petit committed
27

28
#include <SupportKit.h>
29

Eric Petit's avatar
Eric Petit committed
30
31
#define SEEKSLIDER_RANGE 2048

32
class InterfaceWindow;
33
class VlcWrapper;
34
35

/*****************************************************************************
36
 * intf_sys_t: internal variables of the BeOS interface
37
38
39
 *****************************************************************************/
struct intf_sys_t
{
40
41
42
    msg_subscription_t * p_sub;

    InterfaceWindow *    p_window;
43
    
44
45
46
47
48
    vlc_bool_t           b_loop;
    vlc_bool_t           b_mute;
    int                  i_part;
    audio_volume_t       i_saved_volume;
    int                  i_channel;
49
    
50
    VlcWrapper *         p_wrapper;
51
52
};

53
54
55
/* Necessary because of i18n */
const char * _AddEllipsis( char * string );

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
67
    VlcWrapper( intf_thread_t *p_intf );
    ~VlcWrapper();
68
    
Eric Petit's avatar
Eric Petit committed
69
    /* Input */
70
    void         UpdateInput();
Eric Petit's avatar
Eric Petit committed
71
72
73
    bool         HasInput();
    int          InputStatus();
    int          InputRate();
74
    void         InputSetRate( int rate );
Eric Petit's avatar
Eric Petit committed
75
76
77
78
79
80
81
    BList *      GetChannels( int i_cat );
    void         ToggleLanguage( int i_language );
    void         ToggleSubtitle( int i_subtitle );
    const char * GetTimeAsString();
    float        GetTimeAsFloat();
    void         SetTimeAsFloat( float i_offset );
    bool         IsPlaying();
82
83
        
    /* Playlist */
84
85
    void    OpenFiles( BList *o_files, bool replace = true,
    				   int32 index = -1 );
Eric Petit's avatar
Eric Petit committed
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    void    OpenDisc( BString o_type, BString o_device,
                     int i_title, int i_chapter );
    int     PlaylistSize();
    char *  PlaylistItemName( int );
    int     PlaylistCurrent();
    bool    PlaylistPlay();
    void    PlaylistPause();
    void    PlaylistStop();
    void    PlaylistNext();
    void    PlaylistPrev();
    bool    PlaylistPlaying();
    void    GetPlaylistInfo( int32& currentIndex,
                             int32& maxIndex );
    void    PlaylistJumpTo( int );
    void    GetNavCapabilities( bool * canSkipPrev,
                                bool * canSkipNext );
102
103
    void    NavigatePrev();
    void    NavigateNext();
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
	/* Playlist manipulation */
	bool	PlaylistLock() const;
	void	PlaylistUnlock() const;
	// playlist must be locked prior to calling all of these!
	void*	PlaylistItemAt( int index ) const;
			// both functions return a copy of the removed item
			// so that it can be added at another index
	void*	PlaylistRemoveItem( int index ) const;
	void*	PlaylistRemoveItem( void* item ) const;
			// uses playlist_AddItem()
	bool	PlaylistAddItem( void* item, int index ) const;
	void*	PlaylistCloneItem( void* item ) const;
			// only modifies playlist, doesn't effect playback
	void	PlaylistSetPlaying( int index ) const;

Eric Petit's avatar
Eric Petit committed
120
    /* Audio */
121
    unsigned short GetVolume();
Eric Petit's avatar
Eric Petit committed
122
123
124
125
    void           SetVolume( int value );
    void           VolumeMute();
    void           VolumeRestore();
    bool           IsMuted();
126

127
    /* DVD */
128
    bool    IsUsingMenus();
Eric Petit's avatar
Eric Petit committed
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    bool    HasTitles();
    BList * GetTitles();
    void    PrevTitle();
    void    NextTitle();
    void    ToggleTitle( int i_title );
    void    TitleInfo( int32& currentIndex, int32& maxIndex );

    bool    HasChapters();
    BList * GetChapters();
    void    PrevChapter();
    void    NextChapter();
    void    ToggleChapter( int i_chapter );
    void    ChapterInfo( int32& currentIndex, int32& maxIndex );
    
    /* Miscellanous */
144
    void LoadSubFile( const char * psz_file );
145
    void FilterChange();
146
    
147
private:
148
149
150
    intf_thread_t *   p_intf;
    input_thread_t *  p_input;
    playlist_t *      p_playlist;
151
};