1/*
2 * OpenSound media addon for BeOS and Haiku
3 *
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 */
10
11#ifndef _OPENSOUNDADDON_H
12#define _OPENSOUNDADDON_H
13
14#include <MediaDefs.h>
15#include <MediaFormats.h>
16#include <MediaAddOn.h>
17
18#define SETTINGS_FILE					"Media/oss_audio_settings"
19
20class BEntry;
21
22class OpenSoundAddOn :
23	public BMediaAddOn
24{
25	public:
26		virtual ~OpenSoundAddOn(void);
27		explicit OpenSoundAddOn(image_id image);
28
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);
51
52		/* end from BMediaAddOn */
53		/************************/
54
55	private:
56		status_t RecursiveScan(const char* path, BEntry *rootEntry = NULL);
57		void SaveSettings(void);
58		void LoadSettings(void);
59
60		void RegisterMediaFormats(void);
61
62		status_t 		fInitCheckStatus;
63		BList			fDevices;
64
65		BMessage fSettings;				// settings loaded from settings directory
66};
67
68extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you);
69
70#endif /* _OPENSOUNDADDON_H */
71