vfs: check userland buffers before reading them.
[haiku.git] / headers / os / media / MediaFiles.h
blob589dc5a7f0b5a1347bec053912325cdc24fcfadc
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
9 #include <MediaDefs.h>
10 #include <List.h>
11 #include <String.h>
13 struct entry_ref;
16 class BMediaFiles {
17 public:
19 BMediaFiles();
20 virtual ~BMediaFiles();
22 virtual status_t RewindTypes();
23 virtual status_t GetNextType(BString* _type);
25 virtual status_t RewindRefs(const char* type);
26 virtual status_t GetNextRef(BString* _type,
27 entry_ref* _ref = NULL);
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);
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);
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);
43 virtual status_t RemoveItem(const char* type, const char* item);
45 static const char B_SOUNDS[];
47 // TODO: Needs Perform() for FBC reasons!
49 private:
50 // FBC padding
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*, ...);
61 void _ClearTypes();
62 void _ClearItems();
64 private:
65 BList fTypes;
66 int fTypeIndex;
67 BString fCurrentType;
68 BList fItems;
69 int fItemIndex;
72 #endif // _MEDIA_FILES_H