xref: /haiku/src/apps/mediaplayer/supplier/MediaFileTrackSupplier.h (revision 922e7ba1f3228e6f28db69b0ded8f86eb32dea17)
1 /*
2  * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef MEDIA_FILE_TRACK_SUPPLIER_H
6 #define MEDIA_FILE_TRACK_SUPPLIER_H
7 
8 #include <vector>
9 
10 #include <Bitmap.h>
11 #include <List.h>
12 
13 #include "TrackSupplier.h"
14 
15 
16 class BMediaFile;
17 using std::vector;
18 
19 
20 class MediaFileTrackSupplier : public TrackSupplier {
21 public:
22 								MediaFileTrackSupplier();
23 	virtual						~MediaFileTrackSupplier();
24 
25 	virtual	status_t			InitCheck();
26 
27 	virtual	status_t			GetFileFormatInfo(
28 									media_file_format* fileFormat);
29 	virtual	status_t			GetCopyright(BString* copyright);
30 	virtual	status_t			GetMetaData(BMessage* metaData);
31 
32 	virtual	int32				CountAudioTracks();
33 	virtual	int32				CountVideoTracks();
34 	virtual	int32				CountSubTitleTracks();
35 
36 	virtual	status_t			GetAudioMetaData(int32 index,
37 									BMessage* metaData);
38 	virtual	status_t			GetVideoMetaData(int32 index,
39 									BMessage* metaData);
40 
41 	virtual	AudioTrackSupplier*	CreateAudioTrackForIndex(int32 index);
42 	virtual	VideoTrackSupplier*	CreateVideoTrackForIndex(int32 index);
43 	virtual	const SubTitles*	SubTitleTrackForIndex(int32 index);
44 
45 			bool				AddSubTitles(SubTitles* subTitles);
46 
47 			status_t			AddMediaFile(BMediaFile* mediaFile);
48 
49 			status_t			AddBitmap(BBitmap* bitmap);
50 
51 private:
52 			vector<BMediaFile*>	fMediaFiles;
53 			vector<BBitmap*>	fBitmaps;
54 			BList				fAudioTracks;
55 			BList				fVideoTracks;
56 			BList				fSubTitleTracks;
57 };
58 
59 
60 #endif // MEDIA_FILE_TRACK_SUPPLIER_H
61