vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / opensound / OpenSoundAddOn.h
blobfea075c9d0bc8c5d3c2ec0f394d6dbd969aef931
1 /*
2 * OpenSound media addon for BeOS and Haiku
4 * Copyright (c) 2007, François Revol (revol@free.fr)
5 * Distributed under the terms of the MIT License.
6 *
7 * Based on MultiAudio media addon
8 * Copyright (c) 2002, 2003 Jerome Duval (jerome.duval@free.fr)
9 */
11 #ifndef _OPENSOUNDADDON_H
12 #define _OPENSOUNDADDON_H
14 #include <MediaDefs.h>
15 #include <MediaFormats.h>
16 #include <MediaAddOn.h>
18 #define SETTINGS_FILE "Media/oss_audio_settings"
20 class BEntry;
22 class OpenSoundAddOn :
23 public BMediaAddOn
25 public:
26 virtual ~OpenSoundAddOn(void);
27 explicit OpenSoundAddOn(image_id image);
29 /**************************/
30 /* begin from BMediaAddOn */
31 public:
32 virtual status_t InitCheck(
33 const char ** out_failure_text);
34 virtual int32 CountFlavors(void);
35 virtual status_t GetFlavorAt(
36 int32 n,
37 const flavor_info ** out_info);
38 virtual BMediaNode * InstantiateNodeFor(
39 const flavor_info * info,
40 BMessage * config,
41 status_t * out_error);
42 virtual status_t GetConfigurationFor(
43 BMediaNode * your_node,
44 BMessage * into_message);
45 virtual bool WantsAutoStart(void);
46 virtual status_t AutoStart(
47 int in_count,
48 BMediaNode ** out_node,
49 int32 * out_internal_id,
50 bool * out_has_more);
52 /* end from BMediaAddOn */
53 /************************/
55 private:
56 status_t RecursiveScan(const char* path, BEntry *rootEntry = NULL);
57 void SaveSettings(void);
58 void LoadSettings(void);
60 void RegisterMediaFormats(void);
62 status_t fInitCheckStatus;
63 BList fDevices;
65 BMessage fSettings; // settings loaded from settings directory
68 extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you);
70 #endif /* _OPENSOUNDADDON_H */