50 #ifndef _FormatterMultiDevice_H_
51 #define _FormatterMultiDevice_H_
55 #include "mb/ILocalScreenManager.h"
56 #include "mb/interface/IInputEventListener.h"
57 using namespace ::br::pucrio::telemidia::ginga::core::mb;
60 #include "multidevice/services/IDeviceDomain.h"
61 #include "multidevice/IRemoteDeviceManager.h"
62 #include "multidevice/IRemoteDeviceListener.h"
63 using namespace ::br::pucrio::telemidia::ginga::core::multidevice;
68 static const int CT_BASE = 0;
69 static const int CT_PASSIVE = 1;
70 static const int CT_ACTIVE = 2;
73 static const int FT_CONNECTIONREQUEST = 0;
74 static const int FT_ANSWERTOREQUEST = 1;
75 static const int FT_KEEPALIVE = 2;
76 static const int FT_MEDIACONTENT = 3;
77 static const int FT_SELECTIONEVENT = 4;
78 static const int FT_ATTRIBUTIONEVENT = 5;
79 static const int FT_PRESENTATIONEVENT = 6;
81 #endif //HAVE_MULTIDEVICE
83 #include "ncl/layout/LayoutRegion.h"
84 using namespace ::br::pucrio::telemidia::ncl::layout;
86 #include "ncl/components/Content.h"
87 #include "ncl/components/NodeEntity.h"
88 #include "ncl/components/ReferenceContent.h"
89 using namespace ::br::pucrio::telemidia::ncl::components;
91 #include "gingancl/model/CascadingDescriptor.h"
92 using namespace ::br::pucrio::telemidia::ginga::ncl::model::presentation;
94 #include "gingancl/model/ExecutionObject.h"
95 using namespace ::br::pucrio::telemidia::ginga::ncl::model::components;
97 #include "gingancl/model/FormatterLayout.h"
98 using namespace ::br::pucrio::telemidia::ginga::ncl::model::presentation;
100 #include "gingancl/adaptation/context/ContextBase.h"
102 #include "IFormatterMultiDevice.h"
111 namespace telemidia {
114 namespace multidevice {
116 class FormatterMultiDevice :
117 public IFormatterMultiDevice,
118 public IInputEventListener,
119 public IRemoteDeviceListener {
121 class FormatterMultiDevice :
123 public IInputEventListener {
124 #endif //HAVE_MULTIDEVICE
126 static ILocalScreenManager* dm;
128 pthread_mutex_t mutex;
131 static IRemoteDeviceManager* rdm;
134 #endif //HAVE_MULTIDEVICE
136 IDeviceLayout* deviceLayout;
137 map<int, FormatterLayout*> layoutManager;
138 vector<string>* activeUris;
139 string activeBaseUri;
140 FormatterLayout* mainLayout;
142 IWindow* printScreen;
143 IWindow* bitMapScreen;
149 bool hasRemoteDevices;
150 bool enableMulticast;
151 IPresentationContext* presContext;
152 IFormatterFocusManager* focusManager;
154 GingaScreenID myScreen;
156 set<IPlayer*> listening;
157 pthread_mutex_t lMutex;
159 static const int DV_QVGA_WIDTH = 480;
160 static const int DV_QVGA_HEIGHT = 320;
164 GingaScreenID screenId,
165 IDeviceLayout* deviceLayout,
166 int x,
int y,
int w,
int h,
167 bool useMulticast,
int srvPort);
171 void printGingaWindows();
172 void listenPlayer(IPlayer* player);
173 void stopListenPlayer(IPlayer* player);
175 void setPresentationContex(IPresentationContext* presContext);
176 void setFocusManager(IFormatterFocusManager* focusManager);
177 void setBackgroundImage(
string uri);
178 void* getMainLayout();
179 void* getFormatterLayout(
int devClass);
180 string getScreenShot();
181 string serializeScreen(
int devClass, IWindow* mapWindow);
184 virtual void postMediaContent(
int destDevClass);
187 FormatterLayout* getFormatterLayout(
188 CascadingDescriptor* descriptor, ExecutionObject*
object);
190 GingaWindowID prepareFormatterRegion(
191 ExecutionObject*
object, ISurface* renderedSurface);
193 void showObject(ExecutionObject* executionObject);
194 void hideObject(ExecutionObject* executionObject);
197 virtual bool newDeviceConnected(
int newDevClass,
int w,
int h);
198 virtual void connectedToBaseDevice(
unsigned int domainAddr)=0;
200 virtual bool receiveRemoteEvent(
203 string eventContent);
205 virtual bool receiveRemoteContent(
207 char *stream,
int streamSize) {
212 virtual bool receiveRemoteContentInfo(
213 string contentId,
string contentUri) {
218 void renderFromUri(IWindow* win,
string uri);
219 void tapObject(
int devClass,
int x,
int y);
221 virtual bool receiveRemoteContent(
229 void addActiveUris(
string baseUri, vector<string>* uris);
230 virtual void updatePassiveDevices();
234 short code,
string parameter,
short type,
string value);
236 virtual bool userEventReceived(IInputEvent* ev)=0;
Definition: IFormatterMultiDevice.h:75
Definition: FormatterMultiDevice.h:65
HAVE_MULTIDEVICE.
Definition: FormatterMultiDevice.h:121