libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moDataManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moDataManager.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 
30 *******************************************************************************/
31 
32 #ifndef __MO_DATAMANAGER_H__
33 #define __MO_DATAMANAGER_H__
34 
35 #include "moBasePlugin.h"
36 #include <moConsoleState.h>
37 #include <moActions.h>
38 #include <moValue.h>
39 #include <moParam.h>
40 #include <moEventList.h>
41 #include <moFileManager.h>
42 #include <moResourceManager.h>
43 
44 class moVideoGraph;
45 
46 /***
47 
48  Modos de funcionamiento de la sesion
49 
50 
51 */
57 };
58 
59 /***
60 
61  Modos de grabación de sesión
62 
63 
64 */
70 };
71 
72 /***
73 
74  Modos de reproducción de sesión
75 
76 
77 */
83 };
84 
85 
91 };
92 
100 };
101 
102 
114  friend class moDataSession;
115  public:
116 
118 
120  moText p_apppath,
121  moText p_datapath,
122  moText p_consoleconfig,
123  moText p_SessionFileName=moText("sesion.mos"),
124  moText p_VideoFileName=moText("sesion.mp4"),
125  long p_MaxKeys = 10000,
126  long p_MaxTimecode=3600000/*1 hora*/,
127  long p_Port = 0 ,
128  long p_Address=0 );
129 
130  virtual ~moDataSessionConfig();
131 
132  moText GetDataPath();
133  moText GetAppPath();
134  moText GetAppDataPath();
135  moText GetConsoleConfigName();
136  moText GetVideoFileName();
137  moText GetSessionFileName();
138  moText GetPluginsPath();
139 
140  long GetMaxKeys() {
141  return m_MaxKeys;
142  }
143 
144  long GetMaxTimecode() {
145  return m_MaxTimecode;
146  }
147 
148  long GetPort() {
149  return m_Port;
150  }
151 
152  long GetAddress() {
153  return m_Address;
154  }
155 
156  private:
157 
158  moText m_AppPath;
159  moText m_DataPath;
160  moText m_ConsoleConfigName;
161  moText m_AppDataPath;
162  moText m_PluginsPath;
163  /*
164  MO_DATASESSION_MODE_SAVETOMEMORY
165  */
166  moText m_SessionFileName;
167  moText m_VideoFileName;
168  long m_MaxKeys;
169  long m_MaxTimecode;
170 
171  bool m_Port;
172  bool m_Address;
173 
174 };
175 
177  friend class moConsole;
178  public:
179 
181  moDataSessionKey( long p_Timecode,
182  moMoldeoActionType p_ActionType,
183  long p_MoldeoObjectId,
184  long p_PreconfId );
185 
186  moDataSessionKey( long p_Timecode,
187  moMoldeoActionType p_ActionType,
188  long p_MoldeoObjectId=MO_UNDEFINED );
189 
190  moDataSessionKey( long p_Timecode,
191  moMoldeoActionType p_ActionType,
192  long p_MoldeoObjectId,
193  long p_ParamId,
194  long p_ValueId );
195 
196  moDataSessionKey( long p_Timecode,
197  moMoldeoActionType p_ActionType,
198  long p_MoldeoObjectId,
199  long p_ParamId,
200  long p_ValueId,
201  const moValue& p_Value );
202 
203  moDataSessionKey( long p_Timecode,
204  moMoldeoActionType p_ActionType,
205  long p_MoldeoObjectId,
206  const moEffectState& p_effect_state );
207 
208  moDataSessionKey( long p_Timecode,
209  moMoldeoActionType p_ActionType,
210  long p_MoldeoObjectId,
211  long p_ParamId,
212  const moParamDefinition& p_param_definition );
213 
214  virtual ~moDataSessionKey();
217 
218  moValue& GetValue();
219  moMoldeoActionType GetActionType() const;
220  bool IsInTime( long time_position, long time_interval );
221 
222  const moText& ToJSON();
223  const moText& ToXML();
224 
225  int Set(const moText& p_XmlText );
226 
227  private:
228 
229  long m_TimeCode;
230  moMoldeoActionType m_ActionType;
231 
232  long m_ObjectId;
233  long m_ParamId;
234  long m_ValueId;
235  long m_PreconfId;
236  moValue m_Value;
237  moParamDefinition m_ParamDefinition;
238  moEffectState m_EffectState;
239 
241  moText m_FullXML;
242 };
243 
245 
246  public:
247 
249  moDataSessionEventKey( long p_Timecode,
250  moMessage event );
251 
252  virtual ~moDataSessionEventKey();
253 
254  long GetTimecode();
255  moMessage& GetMessage();
256 
257 
258  private:
259 
260  long m_Timecode;
261  moMessage m_Message;
262 
263 };
264 
265 moDeclareExportedDynamicArray( moDataSessionKey*, moDataSessionKeys);
266 moDeclareExportedDynamicArray( moDataSessionEventKey*, moDataSessionEventKeys );
267 
269 
270  public:
271  moDataSession();
272  virtual ~moDataSession();
273 
274  void Set( moText p_Name,
275  moDataSessionConfig* pSessionConfig,
276  moDataSessionMode p_sessionmode,
277  moDataSessionRecordMode p_recordmode,
278  moDataSessionPlaybackMode p_playbackmode,
279  moResourceManager* p_ResMan );
280 
281 
282  bool SaveToFile( const moText& p_filename=moText("") );
283  bool LoadFromFile( const moText& p_filename );
284 
285  bool AddKey( const moDataSessionKey& p_key );
286  bool AddEventKey( const moDataSessionEventKey& p_eventkey );
287 
288  bool Playback( moConsoleState& p_console_state );
289  bool StopPlayback(moConsoleState& p_console_state);
290 
291  bool Record(moConsoleState& p_console_state);
292  bool StopRecord(moConsoleState& p_console_state);
293 
294  bool Render(moConsoleState& p_console_state);
295  bool StopRender(moConsoleState& p_console_state);
296 
297  bool RecordLive( moResourceManager* pRM );
298 
299  bool Loaded();
300  bool LoadSession();
301  bool SetKey( int p_actual_key);
302  const moDataSessionKey& GetActualKey();
303  const moDataSessionKey& NextKey( moConsoleState& m_ConsoleState );
304 
305  bool SessionStart();
306  bool SessionEnded();
307  int GetKeyCount();
308  int GetRenderedFrames() const;
310  return m_Rendered_Folder;
311  }
312  void SetRenderedFolder( const moText& p_rendered_folder );
313  bool StepRender( moConsoleState& p_console_state );
314 
315  const moText& ToJSON();
316 
317  private:
318 
319  long m_StartTimeCode;
320  long m_EndTimeCode;
321  moText m_Name;
322  moDataSessionConfig* m_pDataSessionConfig;
323  moResourceManager* m_pResourceManager;
324 
325  int m_iActualKey;
326  moDataSessionKeys m_Keys;
327  moDataSessionEventKeys m_EventKeys;
328 
329  moDataSessionMode m_SessionMode;
330  moDataSessionRecordMode m_SessionRecordMode;
331  moDataSessionPlaybackMode m_SessionPlaybackMode;
332  moDataSessionRenderdMode m_SessionRenderMode;
333 
334  moVideoGraph* m_pVideoGraph;
335  moDataSessionKey m_ActualKey;
336 
337  int m_Rendered_Frames;
338  moText m_Rendered_Folder;
339  moText m_FullJSON;
340 
341 };
342 
343 
344 moDeclareExportedDynamicArray( moDataSession*, moDataSessions );
345 
346 
348 {
349  public:
350 
351  moDataManager();
352  virtual ~moDataManager();
353 
354  virtual MOboolean Init();
355  virtual MOboolean Init( moText p_apppath, moText p_datapath, moText p_consoleconfig );
356  virtual MOboolean Finish();
357 
358  moText GetDataPath();
359  moText GetConsoleConfigName();
360  moText GetAppPath();
361  moText GetAppDataPath();
362  moText GetPluginsPath();
363 
369  moFile GetDataFile( const moText& p_file_name );
370 
376  moFile GetAppDataFile( const moText& p_file_name );
377 
383  moDirectory GetDataDir( const moText& p_dir_name );
384 
390  moDirectory GetAppDataDir( const moText& p_dir_name );
391 
392  const moPluginDefinitions& GetPluginDefinitions() {
393  return m_PluginDefinitions;
394  }
395 
396  void StartRecordingSession( );
397  void StartPlayinbackSession( );
398 
399  moDataSession* GetSession();
400 
401  bool Export( const moText& p_export_path , moText p_from_config_console = moText("") );
402  bool IteratedExport( const moText& p_from_config_file_ );
403  bool ImportFile( const moText& p_import_file_full_path );
404  bool InData( const moText& p_file_full_path );
405  moText MakeRelativeToData( const moText& p_file_full_path );
406 
407  int ReloadPluginDefinitions( moText plugindir = "", moMoldeoObjectType mobjecttype=MO_OBJECT_UNDEFINED );
408 
409  static const moText& GetDataDir();
410  static const moText& GetModulesDir();
411 
412  static moText m_DataDir;
415  protected:
416 
419 
420  moPluginDefinitions m_PluginDefinitions;
421 
422 };
423 
424 #endif
425 
Valor de un Parámetro.
Definition: moValue.h:501
moMoldeoObjectType
Tipos de objetos en Moldeo.
Definition: moTypes.h:525
Grabación a memoria de las claves (al finalizar se puede elegir grabar o no a disco... modo predeterminado)
Definition: moDataManager.h:67
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
grabación y reproducción inactivos, modo predeterminado...
Definition: moDataManager.h:54
const moText & ToJSON()
Definition: moConsole.cpp:5333
#define MO_UNDEFINED
Definition: moTypes.h:379
static moText m_ModulesDir
moPluginDefinitions m_PluginDefinitions
Estado de la consola.
#define MOboolean
Definition: moTypes.h:385
grabación con memoria intermedia a disco
Definition: moDataManager.h:68
moDataSessionPlaybackMode
Definition: moDataManager.h:78
Objeto Consola.
Definition: moConsole.h:147
Clase Mensaje.
Definition: moEventList.h:97
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
#define LIBMOLDEO_API
Definition: moTypes.h:180
moDataSessionConfigParameters
Definition: moDataManager.h:93
const moPluginDefinitions & GetPluginDefinitions()
virtual MOboolean Init()
clase de para manejar textos
Definition: moText.h:75
static moText m_DataDir
moDataSessionRenderdMode
Definition: moDataManager.h:86
Grafo de reproducción de video.
Definition: moVideoGraph.h:584
moDataSessionMode
Definition: moDataManager.h:52
moText0 moText
Definition: moText.h:291
Reproducción en vivo por streaming.
Definition: moDataManager.h:82
const moText & GetRenderedFolder()
moDataSession * m_pDataSession
moMoldeoActionType
moMoldeoActionType
Definition: moActions.h:64
Reproducción en vivo a video.
Definition: moDataManager.h:81
Administrador de recursos.
moDeclareExportedDynamicArray(moDataSessionKey *, moDataSessionKeys)
moDataSessionConfig * m_pDataSessionConfig
Reproducción en tiempo real a consola.
Definition: moDataManager.h:80
virtual MOboolean Finish()
moMatrix3 & operator=(const moMatrix3 &rkM)
grabación directa de claves a archivo
Definition: moDataManager.h:69
reproducción activa
Definition: moDataManager.h:55
moDataSessionRecordMode
Definition: moDataManager.h:65
renderizado con memoria intermedia a disco
Definition: moDataManager.h:89
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193