MediaRosterEx.h revision e57acc3a
1/*
2 * Copyright (c) 2003 Marcus Overhagen.
3 * All Rights Reserved.
4 *
5 * This file may be used under the terms of the MIT License.
6 */
7#ifndef _MEDIA_ROSTER_EX_H_
8#define _MEDIA_ROSTER_EX_H_
9
10
11#ifndef _MEDIA_T_LIST_H
12	#include "TList.h"
13#endif
14#ifndef _DATA_EXCHANGE_H
15	#include "DataExchange.h"
16#endif
17#ifndef _MEDIA_NODE_H
18	#include <MediaNode.h>
19#endif
20#ifndef _MEDIA_ADD_ON_H
21	#include <MediaAddOn.h>
22#endif
23
24
25namespace BPrivate { namespace media {
26
27
28/* The BMediaRosterEx class is an extension to the BMediaRoster.
29 * It provides functionality that can be used by the implementation
30 * of media_server, media_addon_server and libmedia.so.
31 * To access it, convert any BMediaRoster pointer in a BMediaRosterEx
32 * pointer using the inline function provided below.
33 */
34class BMediaRosterEx : public BMediaRoster
35{
36public:
37							BMediaRosterEx(status_t* out_error);
38		virtual				~BMediaRosterEx();
39
40		status_t			SaveNodeConfiguration(BMediaNode* node);
41		status_t 			LoadNodeConfiguration(media_addon_id addonid,
42							int32 flavorid, BMessage* out_msg);
43
44		status_t			IncrementAddonFlavorInstancesCount(
45							media_addon_id addonid, int32 flavorid);
46
47		status_t			DecrementAddonFlavorInstancesCount(
48							media_addon_id addonid, int32 flavorid);
49
50		status_t			ReleaseNodeAll(const media_node& node);
51
52		status_t			SetNodeCreator(media_node_id node, team_id creator);
53
54		status_t			RegisterNode(BMediaNode* node, media_addon_id addonid,
55								int32 flavorid);
56
57		status_t			InstantiateDormantNode(media_addon_id addonid,
58								int32 flavorid, team_id creator, media_node* out_node);
59
60		status_t			GetDormantFlavorInfo(media_addon_id addonid,
61								int32 flavorid, dormant_flavor_info* out_flavor);
62
63		status_t			GetNode(node_type type, media_node* out_node,
64								int32* out_input_id = NULL,
65								BString* out_input_name = NULL);
66
67		status_t			SetNode(node_type type, const media_node* node,
68								const dormant_node_info* info = NULL,
69								const media_input *input = NULL);
70
71		status_t			GetAllOutputs(const media_node& node,
72								List<media_output>* list);
73
74		status_t			GetAllOutputs(BBufferProducer* node,
75								List<media_output>* list);
76
77		status_t			GetAllInputs(const media_node& node,
78								List<media_input>* list);
79
80		status_t			GetAllInputs(BBufferConsumer* node,
81								List<media_input>* list);
82
83		status_t			PublishOutputs(const media_node& node,
84								List<media_output>* list);
85
86		status_t			PublishInputs(const media_node& node,
87								List<media_input>* list);
88
89		BTimeSource*		MakeTimeSourceObject(media_node_id timesource_id);
90
91private:
92	friend class BMediaRoster;
93};
94
95/* The pointer returned by BMediaRoster::Roster() is always a
96 * BMediaRosterEx object pointer. Use this to convert it.
97 */
98inline BMediaRosterEx* MediaRosterEx(BMediaRoster* mediaroster)
99{
100	return static_cast<BMediaRosterEx*>(mediaroster);
101}
102
103
104} } // BPrivate::media
105using namespace BPrivate::media;
106
107#endif
108