xref: /haiku/headers/os/media/MediaFiles.h (revision 7e5d04c5430836d6113d550a669d57cb1cf7411b)
1 /*
2  * Copyright 2009, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _MEDIA_FILES_H
6 #define _MEDIA_FILES_H
7 
8 
9 #include <MediaDefs.h>
10 #include <List.h>
11 #include <String.h>
12 
13 struct entry_ref;
14 
15 
16 class BMediaFiles {
17 public:
18 
19 								BMediaFiles();
20 	virtual						~BMediaFiles();
21 
22 	virtual	status_t			RewindTypes();
23 	virtual	status_t			GetNextType(BString* _type);
24 
25 	virtual	status_t			RewindRefs(const char* type);
26 	virtual	status_t			GetNextRef(BString* _type,
27 									entry_ref* _ref = NULL);
28 
29 	virtual	status_t			GetRefFor(const char* type, const char* item,
30 									entry_ref* _ref);
31 	virtual	status_t			SetRefFor(const char* type, const char* item,
32 									const entry_ref& ref);
33 
34 			status_t			GetAudioGainFor(const char* type,
35 									const char* item, float* _gain);
36 			status_t			SetAudioGainFor(const char* type,
37 									const char* item, float gain);
38 
39 	// TODO: Rename this to "ClearRefFor" when breaking BC.
40 	virtual	status_t			RemoveRefFor(const char* type,
41 									const char* item, const entry_ref& ref);
42 
43 	virtual	status_t			RemoveItem(const char* type, const char* item);
44 
45 	static	const char			B_SOUNDS[];
46 
47 	// TODO: Needs Perform() for FBC reasons!
48 
49 private:
50 	// FBC padding
51 
52 			status_t			_Reserved_MediaFiles_0(void*, ...);
53 	virtual	status_t			_Reserved_MediaFiles_1(void*, ...);
54 	virtual	status_t			_Reserved_MediaFiles_2(void*, ...);
55 	virtual	status_t			_Reserved_MediaFiles_3(void*, ...);
56 	virtual	status_t			_Reserved_MediaFiles_4(void*, ...);
57 	virtual	status_t			_Reserved_MediaFiles_5(void*, ...);
58 	virtual	status_t			_Reserved_MediaFiles_6(void*, ...);
59 	virtual	status_t			_Reserved_MediaFiles_7(void*, ...);
60 
61 			void				_ClearTypes();
62 			void				_ClearItems();
63 
64 private:
65 			BList				fTypes;
66 			int					fTypeIndex;
67 			BString				fCurrentType;
68 			BList				fItems;
69 			int					fItemIndex;
70 };
71 
72 #endif // _MEDIA_FILES_H
73 
74