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