50 #ifndef _FormatterMediator_H_
51 #define _FormatterMediator_H_
53 #include "player/INCLPlayer.h"
54 #include "player/IApplicationPlayer.h"
55 #include "player/Player.h"
56 using namespace ::br::pucrio::telemidia::ginga::core::player;
58 #include "ncl/components/ContextNode.h"
59 #include "ncl/components/CompositeNode.h"
60 #include "ncl/components/ContentNode.h"
61 #include "ncl/components/Node.h"
62 #include "ncl/components/NodeEntity.h"
63 using namespace ::br::pucrio::telemidia::ncl::components;
65 #include "ncl/interfaces/Anchor.h"
66 #include "ncl/interfaces/PropertyAnchor.h"
67 #include "ncl/interfaces/Port.h"
68 #include "ncl/interfaces/SwitchPort.h"
69 #include "ncl/interfaces/InterfacePoint.h"
70 using namespace ::br::pucrio::telemidia::ncl::interfaces;
72 #include "system/compat/SystemCompat.h"
73 using namespace ::br::pucrio::telemidia::ginga::core::system::compat;
75 #include "ncl/switches/Rule.h"
76 using namespace ::br::pucrio::telemidia::ncl::switches;
78 #include "ncl/descriptor/GenericDescriptor.h"
79 using namespace ::br::pucrio::telemidia::ncl::descriptor;
81 #include "ncl/link/Bind.h"
82 #include "ncl/link/CausalLink.h"
83 #include "ncl/link/Link.h"
84 using namespace ::br::pucrio::telemidia::ncl::link;
86 #include "ncl/connectors/EventUtil.h"
87 #include "ncl/connectors/SimpleAction.h"
88 #include "ncl/connectors/Connector.h"
89 using namespace ::br::pucrio::telemidia::ncl::connectors;
91 #include "ncl/layout/LayoutRegion.h"
92 using namespace ::br::pucrio::telemidia::ncl::layout;
94 #include "ncl/reuse/ReferNode.h"
95 using namespace ::br::pucrio::telemidia::ncl::reuse;
97 #include "util/functions.h"
98 using namespace ::br::pucrio::telemidia::util;
100 #include "ncl/Base.h"
101 #include "ncl/NclDocument.h"
102 #include "ncl/connectors/ConnectorBase.h"
103 #include "ncl/descriptor/DescriptorBase.h"
104 #include "ncl/layout/RegionBase.h"
105 #include "ncl/switches/RuleBase.h"
106 using namespace ::br::pucrio::telemidia::ncl;
108 #include "ncl/transition/Transition.h"
109 #include "ncl/transition/TransitionBase.h"
110 using namespace ::br::pucrio::telemidia::ncl::transition;
112 #include "model/CompositeExecutionObject.h"
113 #include "model/ExecutionObject.h"
114 #include "model/NodeNesting.h"
115 using namespace ::br::pucrio::telemidia::ginga::ncl::model::components;
117 #include "model/FormatterEvent.h"
118 #include "model/AttributionEvent.h"
119 using namespace ::br::pucrio::telemidia::ginga::ncl::model::event;
121 #include "model/ILinkActionListener.h"
122 #include "model/LinkAssignmentAction.h"
123 using namespace ::br::pucrio::telemidia::ginga::ncl::model::link;
125 #include "adaptation/context/RuleAdapter.h"
126 using namespace ::br::pucrio::telemidia::ginga::ncl::adaptation::context;
128 #include "emconverter/ObjectCreationForbiddenException.h"
129 #include "emconverter/FormatterConverter.h"
130 using namespace ::br::pucrio::telemidia::ginga::ncl::emconverter;
132 #include "prefetch/IPrefetchManager.h"
133 using namespace ::br::pucrio::telemidia::ginga::ncl::prefetch;
135 #include "FormatterScheduler.h"
136 #include "privatebase/PrivateBaseManager.h"
146 namespace telemidia {
152 set<FormatterEvent*> events;
155 pthread_mutex_t evMutex;
161 virtual void listenEvent(FormatterEvent* event);
162 virtual void eventStateChanged(
163 void* event,
short transition,
short previousState);
165 short getPriorityType();
175 NclDocument* currentDocument;
178 static IPrefetchManager* pm;
179 map<string, FormatterEvent*> documentEvents;
180 map<string, vector<FormatterEvent*>*> documentEntryEvents;
181 map<Port*, FormatterEvent*> portsToEntryEvents;
183 RuleAdapter* ruleAdapter;
184 FormatterConverter* compiler;
185 PlayerAdapterManager* playerManager;
186 ITimeBaseProvider* timeBaseProvider;
187 vector<string> compileErrors;
188 IDeviceLayout* deviceLayout;
189 IFormatterMultiDevice* multiDevice;
190 PresentationContext* presContext;
194 pthread_mutex_t pteMutex;
200 static void release();
202 void printGingaWindows();
203 set<string>* createPortIdList();
204 short getMappedInterfaceType(
string portId);
206 void setMrl(
string mrl,
bool visible=
true);
211 void setTimeBaseProvider(ITimeBaseProvider* timeBaseProvider);
213 void setBackgroundImage(
string uri);
214 void setParentLayout(
void* parentLayout);
215 string getScreenShot();
217 vector<string>* getCompileErrors();
218 void* setCurrentDocument(
string fName);
221 virtual void* addDocument(
string fName);
222 bool removeDocument(
string documentId);
223 ContextNode* getDocumentContext(
string documentId);
226 void setDepthLevel(
int level);
229 Port* getPortFromEvent(FormatterEvent* event);
232 vector<Port*>* getContextPorts(
233 ContextNode* context,
string interfaceId);
235 vector<FormatterEvent*>* processDocument(
236 string documentId,
string interfaceId);
238 void initializeSettingNodes(Node* node);
240 vector<FormatterEvent*>* getDocumentEntryEvent(
string documentId);
242 bool compileDocument(
string documentId);
243 bool prepareDocument(
string documentId);
245 void solveRemoteDescriptorsUris(
string docLocation,
246 vector<GenericDescriptor*>* descs,
bool isRemoteDoc);
248 void solveRemoteNodesUris(
249 string docLocation, vector<Node*>* nodes,
bool isRemoteDoc);
251 void solveRemoteNclDeps(
string docLocation,
bool isRemoteDoc);
253 void solveRemoteLuaDeps(
254 string docLocation,
string src,
bool isRemoteDoc);
256 string solveRemoteSourceUri(
string docLocation,
string src);
258 FormatterEvent* getEntryEvent(
259 string interfaceId, vector<FormatterEvent*>* events);
261 bool startDocument(
string documentId,
string interfaceId);
262 bool stopDocument(
string documentId);
263 bool pauseDocument(
string documentId);
264 bool resumeDocument(
string documentId);
265 void presentationCompleted(IFormatterEvent* documentEvent);
268 bool nclEdit(
string nclEditApi);
269 bool editingCommand(
string commandTag,
string privateDataPayload);
272 LayoutRegion* addRegion(
278 LayoutRegion* removeRegion(
283 RegionBase* addRegionBase(
string documentId,
string xmlRegionBase);
284 RegionBase* removeRegionBase(
285 string documentId,
string regionBaseId);
287 Rule* addRule(
string documentId,
string xmlRule);
288 Rule* removeRule(
string documentId,
string ruleId);
289 RuleBase* addRuleBase(
string documentId,
string xmlRuleBase);
290 RuleBase* removeRuleBase(
string documentId,
string ruleBaseId);
291 Transition* addTransition(
string documentId,
string xmlTransition);
292 Transition* removeTransition(
293 string documentId,
string transitionId);
295 TransitionBase* addTransitionBase(
296 string documentId,
string xmlTransitionBase);
298 TransitionBase* removeTransitionBase(
299 string documentId,
string transitionBaseId);
301 Connector* addConnector(
string documentId,
string xmlConnector);
302 Connector* removeConnector(
string documentId,
string connectorId);
303 ConnectorBase* addConnectorBase(
304 string documentId,
string xmlConnectorBase);
306 ConnectorBase* removeConnectorBase(
307 string documentId,
string connectorBaseId);
309 GenericDescriptor* addDescriptor(
310 string documentId,
string xmlDescriptor);
312 GenericDescriptor* removeDescriptor(
313 string documentId,
string descriptorId);
315 DescriptorBase* addDescriptorBase(
316 string documentId,
string xmlDescriptorBase);
318 DescriptorBase* removeDescriptorBase(
319 string documentId,
string descriptorBaseId);
322 string documentId,
string docBaseId,
string xmlImportBase);
324 Base* removeImportBase(
325 string documentId,
string docBaseId,
string documentURI);
327 NclDocument* addImportedDocumentBase(
328 string documentId,
string xmlImportedDocumentBase);
330 NclDocument* removeImportedDocumentBase(
331 string documentId,
string importedDocumentBaseId);
333 NclDocument* addImportNCL(
string documentId,
string xmlImportNCL);
334 NclDocument* removeImportNCL(
string documentId,
string documentURI);
336 void processInsertedReferNode(ReferNode* referNode);
337 void processInsertedComposition(CompositeNode* composition);
340 string documentId,
string compositeId,
string xmlNode);
343 string documentId,
string compositeId,
string nodeId);
345 InterfacePoint* addInterface(
346 string documentId,
string nodeId,
string xmlInterface);
348 void removeInterfaceMappings(
350 InterfacePoint* interfacePoint,
351 CompositeNode* composition);
353 void removeInterfaceLinks(
355 InterfacePoint* interfacePoint,
356 ContextNode* composition);
358 void removeInterface(
359 Node* node, InterfacePoint* interfacePoint);
361 InterfacePoint* removeInterface(
362 string documentId,
string nodeId,
string interfaceId);
365 string documentId,
string compositeId,
string xmlLink);
367 void removeLink(ContextNode* composition, Link* link);
370 string documentId,
string compositeId,
string linkId);
372 bool setPropertyValue(
379 void setNotifyContentUpdate(
bool notify){};
380 void addListener(IPlayerListener* listener);
381 void removeListener(IPlayerListener* listener);
382 void notifyPlayerListeners(
383 short code,
string paremeter,
short type,
string value);
385 void setSurface(ISurface* surface);
386 ISurface* getSurface();
388 double getMediaTime();
389 double getTotalMediaTime();
390 void setMediaTime(
double newTime);
391 bool setKeyHandler(
bool isHandler);
395 double begin=-1,
double end=-1,
double outTransDur=-1);
403 string getPropertyValue(
string name);
404 void setPropertyValue(
string name,
string value);
406 void setReferenceTimePlayer(IPlayer* player);
407 void addTimeReferPlayer(IPlayer* referPlayer);
408 void removeTimeReferPlayer(IPlayer* referPlayer);
409 void notifyReferPlayers(
int transition);
410 void timebaseObjectTransitionCallback(
int transition);
411 void setTimeBasePlayer(IPlayer* timeBasePlayer);
413 void setPresented(
bool presented);
415 void setVisible(
bool visible);
416 bool immediatelyStart();
417 void setImmediatelyStart(
bool immediatelyStartVal);
418 void forceNaturalEnd(
bool forceIt);
419 bool isForcedNaturalEnd();
420 bool setOutWindow(GingaWindowID windowId);
423 IPlayer* getSelectedPlayer() {
return NULL;};
424 void setPlayerMap(map<string, IPlayer*>* objs){};
425 map<string, IPlayer*>* getPlayerMap() {
return NULL;};
426 IPlayer* getPlayer(
string objectId) {
return NULL;};
427 void select(IPlayer* selObject){};
430 void setCurrentScope(
string scopeId);
432 string getActiveUris(vector<string>* uris);
433 string getDepUris(vector<string>* uris,
int targetDev=0);
436 IPresentationContext* getPresentationContext();
439 string getDepUrisFromNodes(
440 vector<string>* uris, vector<Node*>* nodes,
int targetDev=0);
442 string getDepUriFromNode(
443 vector<string>* uris, Node* node,
int targetDev=0);
445 string getBaseUri(
string baseA,
string baseB);
448 void timeShift(
string direction);
456 #endif //_FormatterMediator_H_
Definition: IFormatterSchedulerListener.h:61
Definition: FormatterMediator.h:168
Definition: FormatterScheduler.h:136
Definition: FormatterMediator.h:149
Definition: PrivateBaseManager.h:64
Definition: INCLPlayer.h:63