xref: /haiku/src/servers/media/DefaultManager.h (revision 239222b2369c39dc52df52b0a7cdd6cc0a91bc92)
1 /*
2  * Copyright 2002, Marcus Overhagen. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #include "DataExchange.h"
6 
7 #include <Message.h>
8 
9 class NodeManager;
10 
11 class DefaultManager
12 {
13 public:
14 	DefaultManager();
15 	~DefaultManager();
16 
17 	status_t LoadState();
18 	status_t SaveState(NodeManager *node_manager);
19 
20 	status_t Set(media_node_id nodeid, const char *input_name, int32 input_id, node_type type);
21 	status_t Get(media_node_id *nodeid, char *input_name, int32 *input_id, node_type type);
22 	status_t Rescan();
23 
24 	void Dump();
25 
26 	void CleanupTeam(team_id team);
27 
28 private:
29 	static int32 rescan_thread(void *arg);
30 	void RescanThread();
31 
32 	void FindPhysical(volatile media_node_id *id, uint32 default_type, bool isInput, media_type type);
33 	void FindAudioMixer();
34 	void FindTimeSource();
35 
36 	status_t ConnectMixerToOutput();
37 
38 private:
39 	volatile bool fMixerConnected;
40 	volatile media_node_id fPhysicalVideoOut;
41 	volatile media_node_id fPhysicalVideoIn;
42 	volatile media_node_id fPhysicalAudioOut;
43 	volatile media_node_id fPhysicalAudioIn;
44 	volatile media_node_id fSystemTimeSource;
45 	volatile media_node_id fTimeSource;
46 	volatile media_node_id fAudioMixer;
47 	volatile int32 fPhysicalAudioOutInputID;
48 	char fPhysicalAudioOutInputName[B_MEDIA_NAME_LENGTH];
49 
50 	BList fMsgList;
51 
52 	uint32 fBeginHeader[3];
53 	uint32 fEndHeader[3];
54 };
55