libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Amigas 'defines' Grupos Páginas
moDataManager.cpp
Ir a la documentación de este archivo.
1 /*******************************************************************************
2 
3  moDataManager.cpp
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 #include "moDataManager.h"
33 #include <moArray.h>
34 #include <moVideoGraph.h>
35 #include <moGsGraph.h>
36 #include <moResourceManager.h>
37 #include <moRenderManager.h>
38 #include <tinyxml.h>
39 
40 using namespace std;
41 #ifdef MO_MACOSX
42 #include "CoreFoundation.h"
43 #endif
44 
45 moDefineDynamicArray(moDataSessionKeys)
46 moDefineDynamicArray(moDataSessionEventKeys)
47 
48 //===========================================
49 //
50 // moDataSession
51 //
52 //===========================================
53 
55  m_pVideoGraph = NULL;
56  m_pDataSessionConfig = NULL;
57  m_Rendered_Frames = 0;
58  m_pResourceManager = NULL;
59 }
60 
62  if (m_pVideoGraph) {
63  delete m_pVideoGraph;
64  m_pVideoGraph = NULL;
65  }
66 }
67 
68 void
70  moDataSessionConfig* pSessionConfig,
71  moDataSessionMode p_sessionmode,
72  moDataSessionRecordMode p_recordmode,
73  moDataSessionPlaybackMode p_playbackmode,
74  moResourceManager* p_ResMan ) {
75  m_Name = p_Name;
76  m_pDataSessionConfig = pSessionConfig;
77  m_pResourceManager = p_ResMan;
78  m_SessionMode = p_sessionmode;
79  m_SessionPlaybackMode = p_playbackmode;
80  m_SessionRecordMode = p_recordmode;
81  //m_Keys.Init( pSessionConfig->GetMaxKeys(), NULL );
82  m_Keys.Init(0,NULL);
83 /*
84  if (m_pVideoGraph) {
85  delete m_pVideoGraph;
86  m_pVideoGraph = (moVideoGraph*) new moGsGraph();
87  m_pVideoGraph->InitGraph();
88  } else {
89  m_pVideoGraph = (moVideoGraph*) new moGsGraph();
90  m_pVideoGraph->InitGraph();
91  }
92 */
93 }
94 
95 
96 bool
97 moDataSession::SaveToFile( const moText& p_filename ) {
98 
99  MODebug2->Message("moDataSession::SaveToFile: ");
100 
101  bool result = false;
102  if (m_pDataSessionConfig==NULL) {
103  MODebug2->Error("moDataSession::SaveToFile > no Data Session Config defined.");
104  return false;
105  }
106  moText FileDestination = m_pDataSessionConfig->GetSessionFileName();
107 
108  if (p_filename != moText("") && p_filename!=FileDestination) {
109  //m_pDataSessionConfig->GetConfigDefinition()->Set
110  //MODebug2->Error("moDataSession::SaveToFile > p_filename undefined.");
111  //result = false;
112  //m_pDataSessionConfig->CreateDefault( p_filename );
113  FileDestination = p_filename;
114  }
115 
116  moParam& paramKeys( m_pDataSessionConfig->GetParam( "keys" ) );
117  moValues& valuesKey( paramKeys.GetValues() );
118  valuesKey.Empty();
124  for( int keyi=0; keyi<(int)this->m_Keys.Count(); keyi++) {
125 
126  moDataSessionKey* pKey = m_Keys[keyi];
127  if (pKey) {
128  moText pKeyXML = pKey->ToXML();
129  moValue newValue( "","XML" );
130  MODebug2->Message("moDataSession::SaveToFile > keyi: " + IntToStr(keyi) + " xml:" + pKeyXML );
131 
132  moValueBase& vb( newValue.GetSubValue(0) );
133  vb.SetText( pKeyXML );
134  vb.SetType( MO_VALUE_XML );
135  paramKeys.AddValue( newValue );
136  }
137  }
138 
139  m_pDataSessionConfig->SaveConfig( FileDestination );
140 
141 
142  return result;
143 }
144 
145 bool
146 moDataSession::LoadFromFile( const moText& p_filename ) {
147  bool result = false;
148 
149  moText FileDestination = p_filename;
150 
151  if (m_pDataSessionConfig==NULL) {
152  MODebug2->Error("moDataSession::LoadFromFile > no Data Session Config defined.");
153  return false;
154  }
155 
156 
157  if (p_filename == "") {
158  FileDestination = m_pDataSessionConfig->GetSessionFileName();
159  }
160 
161  if (m_pDataSessionConfig->LoadConfig( FileDestination )==MO_CONFIG_OK) {
162 
163  for( int keyi=0; keyi<(int)this->m_Keys.Count(); keyi++) {
164  moDataSessionKey* dsk = m_Keys[keyi];
165  if (dsk) delete dsk;
166  }
167 
168  m_Keys.Empty();
169 
170  moParam& paramKeys( m_pDataSessionConfig->GetParam( "keys" ) );
171  moValues& valuesKey( paramKeys.GetValues() );
172  for( int i=0; i<(int)valuesKey.Count(); i++ ) {
173  moValueBase& vbase( valuesKey[i].GetSubValue(0) );
174  if (vbase.GetType()==MO_VALUE_XML) {
175  moDataSessionKey* newKey = new moDataSessionKey();
176  if (newKey) {
177  newKey->Set( vbase.Text() );
178  m_Keys.Add( newKey );
179  }
180  }
181  }
182 
183  } else MODebug2->Error("moDataSession::LoadFromFile > could not load the session config file at " + FileDestination);
184 
185  return result;
186 }
187 
188 bool
190  if (!m_pDataSessionConfig) {
191  MODebug2->Error("moDataSession::LoadSession() > no session config object.");
192  return false;
193  }
194  return m_pDataSessionConfig->LoadConfig( m_pDataSessionConfig->GetSessionFileName() )!=MO_CONFIGFILE_NOT_FOUND;
195 }
196 
197 bool
199  moDataSessionKey* newKey = new moDataSessionKey();
200  if (newKey) {
201  (*newKey) = p_key;
202  m_Keys.Add( newKey );
203  MODebug2->Message( "moDataSession::AddKey > " + newKey->ToJSON() );
204  return true;
205  }
206  return false;
207 }
208 
209 bool
212  if (eventKey) {
213  (*eventKey) = p_eventkey;
214  m_EventKeys.Add( eventKey );
215  return true;
216  }
217  return false;
218 }
219 
220 bool
222  m_SessionPlaybackMode = MO_DATASESSION_PLAY_LIVETOCONSOLE;
223  m_iActualKey = 0;
224  p_console_state.m_Mode = MO_CONSOLE_MODE_PLAY_SESSION;
225  return true;
226 }
227 
228 bool
230  m_EndTimeCode = moGetTicks();
231  MODebug2->Message("moDataSession::StopRecord > m_StartTimeCode: "+IntToStr(m_StartTimeCode)+" m_EndTimeCode:" + IntToStr(m_EndTimeCode));
232  p_console_state.m_Mode = MO_CONSOLE_MODE_LIVE;
233  SaveToFile();
234  return true;
235 }
236 
237 bool
239  m_SessionRecordMode = MO_DATASESSION_RECORD_TOMEMORY;
240 
241  if (p_console_state.m_Mode==MO_CONSOLE_MODE_RECORD_SESSION) {
242  return StopRecord( p_console_state ) && Render( p_console_state );
243  } else if (p_console_state.m_Mode==MO_CONSOLE_MODE_RENDER_SESSION) {
244  return StopRender( p_console_state );
245  }
246 
247  p_console_state.m_Mode = MO_CONSOLE_MODE_RECORD_SESSION;
248  moStopTimer();
249  moStartTimer();
250  m_StartTimeCode = moGetTicks();
251  MODebug2->Message("moDataSession::Record > m_StartTimeCode:" + IntToStr(m_StartTimeCode));
252 
253  return true;
254 }
255 
256 
257 int
259  return m_Rendered_Frames;
260 }
261 
262 bool
264  //m_EndTimeCode = moGetTicks();
265  int zero = moResetTicksAbsoluteStep(0);
266  p_console_state.m_Mode = MO_CONSOLE_MODE_LIVE;
267  MODebug2->Message("moDataSession::StopRender > m_EndTimeCode:" + IntToStr(m_EndTimeCode)+" zero:" + IntToStr(zero));
268  return true;
269 }
270 
271 bool
273  m_SessionRenderMode = MO_DATASESSION_RENDER_TOMEMORY;
274 
275  if (p_console_state.m_Mode==MO_CONSOLE_MODE_RENDER_SESSION) {
276  return StopRender( p_console_state );
277  } else if (p_console_state.m_Mode!=MO_CONSOLE_MODE_RENDER_SESSION) {
278  m_Rendered_Frames = 0;
279  }
280 
281  p_console_state.m_Mode = MO_CONSOLE_MODE_RENDER_SESSION;
282  //RESET
283  int zero = moResetTicksAbsoluteStep(0);
284  if (zero!=0) MODebug2->Error("moDataSession::Render> not zero! zero: " + IntToStr(zero));
285  long tickis = moGetTicksAbsoluteStep( 41 );
286  moStopTimer();
287  moStartTimer();
288  long tickis_moldeo = moGetTicks();
289  MODebug2->Message("moConsole::ConsoleModeUpdate > START RENDER session: absolute tickis: " + IntToStr(tickis)+" tickis(moldeo): " + IntToStr(tickis_moldeo) );
290  m_iActualKey = 0;
291  MODebug2->Message("moConsole::ConsoleModeUpdate > START RENDER session: m_StartTimeCode: " + IntToStr(m_StartTimeCode) );
292 
293  moText temp_render_base = DataMan()->GetDataPath() + moText("temp_render");
294  this->m_Rendered_Folder = temp_render_base;
295 
296  int ntemp = 0;
297 
298  while( moFileManager::DirectoryExists( this->m_Rendered_Folder ) ) {
299  ntemp+=1;
300  this->m_Rendered_Folder = temp_render_base + IntToStr( ntemp, 3 );
301  if (ntemp>1000) {
302  break;
303  }
304  }
305 
306  return true;
307 }
308 
309 void
310 moDataSession::SetRenderedFolder( const moText& p_rendered_folder ) {
311  m_Rendered_Folder = p_rendered_folder;
312 }
313 
314 bool
316 
317  moText frame_result;
318 
319  p_console_state.Activated();
320  //int mod1000 = m_Rendered_Frames / (int)1000;
321  //temp_render+="_"+IntToStr(mod1000);
322  moText frame_filename = "frame_" + IntToStr( m_Rendered_Frames, 7 );
323  if (m_pResourceManager && m_pResourceManager->GetRenderMan())
324  RenderMan()->Screenshot( DataMan()->GetSession()->GetRenderedFolder(), frame_result, p_console_state.m_RenderFrameQuality, frame_filename );
325 
326  //MODebug2->Message("moDataSession::StepRender > 24/1 frame number:" + IntToStr(m_Rendered_Frames)+" frame_result:" + frame_result);
327  m_Rendered_Frames+=1;
328  return true;
329 }
330 
331 bool
333 
334  m_SessionPlaybackMode = MO_DATASESSION_PLAY_LIVETOVIDEO;
335  if (m_pVideoGraph && m_pDataSessionConfig) {
336  m_pVideoGraph->BuildRecordGraph( m_pDataSessionConfig->GetVideoFileName(), pRM->GetRenderMan()->GetFramesPool() );
337  }
338  return true;
339 }
340 
341 bool
343  if (m_pDataSessionConfig) {
344  return m_pDataSessionConfig->IsConfigLoaded();
345  }
346  return false;
347 }
348 
349 bool
351  if (m_iActualKey>=(int)m_Keys.Count() || m_Keys.Count()==0 )
352  return true;
353 
354  return false;
355 }
356 
357 int
359  return m_Keys.Count();
360 }
361 
363  m_iActualKey = 0;
364  return true;
365 }
366 
367 const moDataSessionKey&
369  return m_ActualKey;
370 }
371 
372 
373 bool
374 moDataSession::SetKey( int p_actual_key) {
375 if ( 0<=p_actual_key && p_actual_key<(int)m_Keys.Count()) {
376  m_iActualKey = p_actual_key;
377  m_ActualKey = (*m_Keys[m_iActualKey]);
378  return true;
379  }
380 
381  return false;
382 }
383 
384 
385 const moDataSessionKey&
387 
388  //check if timecode correspond to m_ConsoleState clock ??
389  m_ActualKey = moDataSessionKey();
390  int time_code_ms = m_ConsoleState.tempo.Duration();
391 
392  if (m_iActualKey<0 || m_iActualKey>=(int)m_Keys.Count()) {
393  return m_ActualKey;
394  }
395 
396  if (m_iActualKey<(int)m_Keys.Count()) {
397 
398  moDataSessionKey TestKey = (*m_Keys[m_iActualKey]);
399 
400  if ( TestKey.IsInTime(time_code_ms, m_ConsoleState.step_interval ) ) {
401 
402  MODebug2->Message("moDataSession::NextKey > Founded timecode Key in! time_code_ms: " + IntToStr(time_code_ms) );
403 
404  m_ActualKey = TestKey;
405  m_iActualKey++;
406  }
407  }
408 
409  return m_ActualKey;
410 }
411 
412 
413 const moText&
415 
416  moText fieldSeparation = ",";
417 
418  m_FullJSON = "{";
419  m_FullJSON+= moText("'rendered_folder': '") + this->GetRenderedFolder() + moText("'");
420  m_FullJSON+= "}";
421  return m_FullJSON;
422 }
423 
424 
425 //===========================================
426 //
427 // moDataSessionKey
428 //
429 //===========================================
430 
432  m_TimeCode = 0;
433  m_ActionType = MO_ACTION_UNDEFINED;
434 
435 
436  m_ObjectId = MO_UNDEFINED;
437  m_ParamId = MO_UNDEFINED;
438  m_ValueId = MO_UNDEFINED;
439  m_PreconfId = MO_UNDEFINED;
440 }
441 
443  moMoldeoActionType p_ActionType,
444  long p_MoldeoObjectId,
445  long p_PreconfId ) {
446  m_TimeCode = p_Timecode;
447  m_ActionType = p_ActionType;
448 
449  m_ObjectId = p_MoldeoObjectId;
450  m_PreconfId = p_PreconfId;
451 }
452 
454  moMoldeoActionType p_ActionType,
455  long p_MoldeoObjectId ) {
456  m_TimeCode = p_Timecode;
457  m_ActionType = p_ActionType;
458  m_ObjectId = p_MoldeoObjectId;
459 }
460 
461 
463  moMoldeoActionType p_ActionType,
464  long p_MoldeoObjectId,
465  long p_ParamId,
466  long p_ValueId ) {
467  m_TimeCode = p_Timecode;
468  m_ActionType = p_ActionType;
469 
470  m_ObjectId = p_MoldeoObjectId;
471  m_ParamId = p_ParamId;
472  m_ValueId = p_ValueId;
473 
474 }
475 
477  moMoldeoActionType p_ActionType,
478  long p_MoldeoObjectId,
479  long p_ParamId,
480  long p_ValueId,
481  const moValue& p_Value ) {
482  m_TimeCode = p_Timecode;
483  m_ActionType = p_ActionType;
484 
485  m_Value = p_Value;
486 
487  m_ObjectId = p_MoldeoObjectId;
488  m_ParamId = p_ParamId;
489  m_ValueId = p_ValueId;
490 
491 }
492 
494  moMoldeoActionType p_ActionType,
495  long p_MoldeoObjectId,
496  const moEffectState& p_effect_state ) {
497 
498  m_TimeCode = p_Timecode;
499  m_ActionType = p_ActionType;
500 
501  m_ObjectId = p_MoldeoObjectId;
502 
503  m_EffectState = p_effect_state;
504 }
505 
507  moMoldeoActionType p_ActionType,
508  long p_MoldeoObjectId,
509  long p_ParamId,
510  const moParamDefinition& p_param_definition ) {
511  m_TimeCode = p_Timecode;
512  m_ActionType = p_ActionType;
513 
514  m_ObjectId = p_MoldeoObjectId;
515  m_ParamId = p_ParamId;
516 
517  m_ParamDefinition = p_param_definition;
518 }
519 
520 
522 
523 }
524 
526  (*this) = src;
527 }
528 
531  m_TimeCode = src.m_TimeCode;
532  m_ActionType = src.m_ActionType;
533  m_Value = src.m_Value;
534  m_ObjectId = src.m_ObjectId;
535  m_ParamId = src.m_ParamId;
536  m_ValueId = src.m_ValueId;
537  m_PreconfId = src.m_PreconfId;
538  m_ParamDefinition = src.m_ParamDefinition;
539  m_EffectState = src.m_EffectState;
540  return *this;
541 }
542 
543 bool
544 moDataSessionKey::IsInTime( long time_position, long time_interval ) {
545  if ( m_TimeCode<=time_position
546  && time_position< (m_TimeCode+time_interval) ) {
547  return true;
548  }
549  return false;
550 }
551 
552 
553 
555  return m_Value;
556 }
557 
559  return m_ActionType;
560 }
561 
562 const moText&
565  m_FullJSON = "";
566  m_FullJSON+= "{";
567  m_FullJSON+= moText("'TimeCode': '") + IntToStr((long)m_TimeCode)+"',";
568  m_FullJSON+= moText("'ActionType': '") + IntToStr((long)m_ActionType)+"',";
569  m_FullJSON+= moText("'ObjectId': '") + IntToStr(m_ObjectId)+"',";
570  m_FullJSON+= moText("'ParamId': '") + IntToStr(m_ParamId)+"',";
571  m_FullJSON+= moText("'ValueId': '") + IntToStr(m_ValueId)+"',";
572  m_FullJSON+= moText("'PreconfId': '") + IntToStr(m_PreconfId)+"',";
573  m_FullJSON+= moText("'ParamDefinition': ") + m_ParamDefinition.ToJSON() +",";
574  m_FullJSON+= moText("'EffectState': ") + m_EffectState.ToJSON() +",";
575  m_FullJSON+= moText("'Value': ") + m_Value.ToJSON() +",";
576  m_FullJSON+= "}";
577  return m_FullJSON;
578 }
579 
580 const moText&
583  m_FullXML = "";
584 
585  m_FullXML+= "<moDataSessionKey timecode='"+IntToStr((long)m_TimeCode)+"' ";
586  m_FullXML+= moText(" actiontype='") + IntToStr((long)GetActionType())+"' ";
587  m_FullXML+= moText(" objectid='") + IntToStr(m_ObjectId)+"' ";
588  m_FullXML+= moText(" paramid='") + IntToStr(m_ParamId)+"' ";
589  m_FullXML+= moText(" valueid='") + IntToStr(m_ValueId)+"' ";
590  m_FullXML+= moText(" preconfid='") + IntToStr(m_PreconfId)+"' >";
591  if (GetActionType()==MO_ACTION_PARAM_SET) m_FullXML+= m_ParamDefinition.ToXML();
592  if (GetActionType()==MO_ACTION_EFFECT_SETSTATE) m_FullXML+= m_EffectState.ToXML();
593  if (GetActionType()==MO_ACTION_VALUE_SET) m_FullXML+= m_Value.ToXML();
594  m_FullXML+= "</moDataSessionKey>";
595  return m_FullXML;
596 }
597 
598 int
599 moDataSessionKey::Set(const moText& p_XmlText ) {
600 
601  TiXmlDocument m_XMLDoc;
602  //TiXmlHandle xmlHandle( &m_XMLDoc );
603  TiXmlEncoding xencoding = TIXML_ENCODING_LEGACY;
604 
605  m_XMLDoc.Parse((const char*) p_XmlText, 0, xencoding );
607  //TiXmlElement* rootKey = m_XMLDoc.FirstChildElement( "D" );
608  TiXmlElement* sessionkeyNode = m_XMLDoc.FirstChildElement("moDataSessionKey");
609 
610  //if (rootKey) {
611 
612  //TiXmlElement* sceneStateNode = rootKey->FirstChildElement("moSceneState");
613  if (sessionkeyNode) {
614  m_TimeCode = atoi(moText( sessionkeyNode->Attribute("timecode") ));
615  m_ActionType = moReactionListenerManager::StrToActionType( moText( sessionkeyNode->Attribute("actiontype") ) );
616  m_ObjectId = atoi( moText( sessionkeyNode->Attribute("objectid") ) );
617  m_ParamId = atoi( moText( sessionkeyNode->Attribute("paramid") ) );
618  m_ValueId = atoi( moText( sessionkeyNode->Attribute("valueid") ) );
619  m_PreconfId = atoi( moText( sessionkeyNode->Attribute("preconfid") ) );
620  if (GetActionType()==MO_ACTION_PARAM_SET) {
621  TiXmlElement* paramdefNode = sessionkeyNode->FirstChildElement("moParamDefinition");
622  if (paramdefNode) m_ParamDefinition.Set( moText( sessionkeyNode->GetText() ) );
623  } else if (GetActionType()==MO_ACTION_EFFECT_SETSTATE) {
624  TiXmlElement* efffectstateNode = sessionkeyNode->FirstChildElement("moEffectState");
625  if (efffectstateNode) m_EffectState.Set( moText( sessionkeyNode->GetText() ) );
626  } else if (GetActionType()==MO_ACTION_VALUE_SET) {
627  TiXmlElement* valueNode = sessionkeyNode->FirstChildElement("moValue");
628  if (valueNode) m_Value.Set( moText( sessionkeyNode->GetText() ) );
629  }
630  return 0;
631  } else moDebugManager::Log( "No XML moDataSessionKey in: " + p_XmlText );
632 
633  //} else moDebugManager::Error();
634  return -1;
635 }
636 
637 /**********************************************
638 *
639 * moDataSessionEventKey
640 *
641 ***********************************************/
642 
643 
645  m_Timecode = 0;
646 }
647 
649  moMessage event ) {
650  m_Timecode = p_Timecode;
651  moMessage msg(event);
652  moDebugManager::Message( " Message Id:" + IntToStr( msg.deviceid ) );
653 }
654 
656 }
657 
659  return m_Timecode;
660 }
661 
663  return m_Message;
664 }
665 
666 
667 
668 //===========================================
669 //
670 // moDataSessionConfig
671 //
672 //===========================================
673 
675 
676  m_DataPath = moText("");
677  m_ConsoleConfigName = moText("");
678 
679 
680 
681 }
682 
684  moText p_datapath,
685  moText p_consoleconfig,
686  moText p_SessionFileName,
687  moText p_VideoFileName,
688  long p_MaxKeys,
689  long p_MaxTimecode,
690  long p_Port,
691  long p_Address ) {
692  m_AppPath = p_apppath;
693  m_DataPath = p_datapath;
694  m_PluginsPath = moDataManager::GetModulesDir();
695 
696  m_ConsoleConfigName = p_consoleconfig;
697  m_SessionFileName = p_SessionFileName;
698  m_VideoFileName = p_VideoFileName;
699  m_MaxKeys = p_MaxKeys;
700  m_MaxTimecode = p_MaxTimecode;
701 
702  if ( m_AppPath==moText("") ) {
703 
704  moFile fileMol( p_apppath );
705  moText workPath = moFileManager::GetWorkPath();
706  m_AppPath = workPath;
707  moDebugManager::Message( moText(" moDataSessionConfig() > m_AppPath empty, setting to Work Path: ")
708  + m_AppPath
709  + " p_Port: " + IntToStr( p_Port )
710  + " p_Address: " + IntToStr( p_Address ) );
711  }
712 
713  moDebugManager::Message( moText(" moDataSessionConfig() > m_AppPath: ") + m_AppPath );
714  moDebugManager::Message( moText(" moDataSessionConfig() > m_ConsoleConfigName: ") + m_ConsoleConfigName );
715 
716  moFile molFile( m_ConsoleConfigName );
717  moFile mosFile( m_SessionFileName );
718 
719  if ( molFile.GetPath()==moText("") ) {
720  m_ConsoleConfigName = m_DataPath + moSlash + m_ConsoleConfigName;
721  moDebugManager::Message( moText(" moDataSessionConfig() > m_ConsoleConfigName fixed to: ") + m_ConsoleConfigName );
722  }
723 
724  if ( mosFile.GetPath()==moText("") ) {
725  m_SessionFileName = m_DataPath + moSlash + m_SessionFileName;
726  moDebugManager::Message( moText(" moDataSessionConfig() > m_SessionFileName fixed to: ") + m_SessionFileName );
727  }
728 
729  GetConfigDefinition()->Set( "session", "moDataSession" );
730  GetConfigDefinition()->Add( "project", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_PROJECT, moValue( m_ConsoleConfigName, "TXT") );
731  GetConfigDefinition()->Add( "resolution", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_RESOLUTION, moValue( "1024x768", "TXT") );
732  GetConfigDefinition()->Add( "render_folder", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_RENDER_FOLDER, moValue( "", "TXT") );
733  GetConfigDefinition()->Add( "length", MO_PARAM_NUMERIC, MO_DATA_SESSION_CONFIG_LENGTH, moValue( "0", "NUM").Ref() );
734  GetConfigDefinition()->Add( "keys", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_KEYS, moValue( "<moDataSessionKey></moDataSessionKey>", "XML") );
735  GetConfigDefinition()->Add( "eventkeys", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_EVENT_KEYS, moValue( "<moDataSessionEventKey></moDataSessionEventKey>", "XML") );
736  if (CreateDefault( m_SessionFileName )) {
737  moDebugManager::Message("moDataSessionConfig > Created "+m_SessionFileName);
738  }
739 
740  if (LoadConfig(m_SessionFileName)==MO_CONFIG_OK) {
741  moDebugManager::Message("moDataSessionConfig > Loaded "+m_SessionFileName);
742  } else moDebugManager::Error("moDataSessionConfig > Not Loaded "+m_SessionFileName);
743 
747  m_AppDataPath = moDataManager::GetDataDir();
748 
749  if ( m_AppDataPath == moText("../../data") ) {
750 
751  moDirectory mDir( m_AppDataPath );
752  moDebugManager::Message( moText(" moDataSessionConfig() > m_AppDataPath: ") + m_AppDataPath
753  + moText(" Exists: ") + IntToStr( mDir.Exists() ) );
754 
755  if (!mDir.Exists()) {
758 
759  #ifdef MO_WIN32
760 
761  moDebugManager::Message( moText(" moDataSessionConfig() > exeFile Path: ") + moFileManager::GetExePath() );
762  moFile exeFile( moFileManager::GetExePath() );
763  m_AppDataPath = exeFile.GetPath() + moSlash + m_AppDataPath;
764 
765  moDebugManager::Message( m_AppDataPath + moText(" doesn't exists > adding absolute path: ") + m_AppDataPath );
766  #else
767  moDebugManager::Error( moText(" moDataSessionConfig() > App Data Path doesn't exists: ") + m_AppDataPath );
768  moDebugManager::Error( moText(" please check libmoldeo DATADIR settings (configure.ac) > DATADIR is: ") + moDataManager::GetDataDir() );
769  #endif
770  }
771 
772  }
773 
774 
775  if ( m_DataPath == moText("") ) {
776  m_DataPath = m_AppPath;
777  moDebugManager::Message( moText(" moDataSessionConfig() > m_DataPath set to: ") + m_DataPath );
778  } else moDebugManager::Message( moText(" moDataSessionConfig() > m_DataPath: ") + m_DataPath );
779 
780 
781 
782 }
783 
785 }
786 
787 moText
789  return m_AppPath;
790 }
791 
792 moText
794  return m_DataPath;
795 }
796 
797 moText
799  return m_AppDataPath;
800 }
801 
802 
803 moText
805  return m_ConsoleConfigName;
806 }
807 
808 moText
810  return m_VideoFileName;
811 }
812 
813 moText
815  return m_SessionFileName;
816 }
817 
818 moText
820  return m_PluginsPath;
821 }
822 
823 
824 //===========================================
825 //
826 // moDataManager
827 //
828 //===========================================
829 
830 
832  SetType( MO_OBJECT_RESOURCE );
833  SetResourceType( MO_RESOURCETYPE_DATA );
834 
835  SetName("datamanager");
836  SetLabelName("datamanager");
837 
838  m_pDataSession = NULL;
839  m_pDataSessionConfig = NULL;
840 
841 
842 }
843 
845 
846 }
847 
849  if (!m_pDataSessionConfig) m_pDataSessionConfig = new moDataSessionConfig( moText(""), moDataManager::GetDataDir(), moText(moDataManager::GetDataDir()+ "/console.mol") );
850  if (!m_pDataSession) {
851  m_pDataSession = new moDataSession();
852  if (m_pDataSession)
853  m_pDataSession->Set( moText("session 1"),
854  m_pDataSessionConfig,
858  m_pResourceManager );
859  }
860  return true;
861 }
862 
863 MOboolean moDataManager::Init( moText p_apppath, moText p_datapath, moText p_consoleconfig ) {
864 
865  if (m_pDataSession) {
866  delete m_pDataSession;
867  m_pDataSession = NULL;
868  }
869  if (m_pDataSessionConfig) {
870  delete m_pDataSessionConfig;
871  m_pDataSessionConfig = NULL;
872  }
873 
874  if (!m_pDataSessionConfig) {
875  m_pDataSessionConfig = new moDataSessionConfig( p_apppath, p_datapath, p_consoleconfig );
876  }
877  if (!m_pDataSession) {
878  m_pDataSession = new moDataSession();
879  m_pDataSession->Set( moText("session 1"),
880  m_pDataSessionConfig,
884  m_pResourceManager );
885  }
886 
888  ReloadPluginDefinitions();
889 
890  return true;
891 }
892 
893 int
895 
896  moDirectory DirEffects;
897  bool bDebug = true;
898  moText PluginName;
899  moText pluginfullpath = m_pDataSessionConfig->GetPluginsPath();
900 
901  if (plugindir.Length()==0 && mobjecttype==MO_OBJECT_UNDEFINED) {
902 
903  ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
904  ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
905  ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
906  ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
907  ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
908  ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
909  return 0;
910  }
911 
912  if (plugindir.Length()==0 && mobjecttype!=MO_OBJECT_UNDEFINED) {
913  switch(mobjecttype) {
914  case MO_OBJECT_PREEFFECT:
915  ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
916  break;
917  case MO_OBJECT_EFFECT:
918  ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
919  break;
921  ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
922  break;
924  ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
925  break;
926  case MO_OBJECT_IODEVICE:
927  ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
928  break;
929  case MO_OBJECT_RESOURCE:
930  ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
931  break;
932  default:
933  break;
934  }
935  return 0;
936  }
937 
938 
941  #ifdef MO_WIN32
942  DirEffects.Open( plugindir, moText("/*.dll") );
943  #else
944  DirEffects.Open( plugindir, moText("/*.so") );
945  #endif // MO_LINUX
946 
947  if (DirEffects.Exists()) {
948 
949  moFile* pFile = NULL;
950  moText FileNameEnd;
951 
952  pFile = DirEffects.FindFirst();
953 
954  if (pFile!=NULL)
955  MODebug2->Message( moText("File founded") );
956 
957  while(pFile!=NULL) {
958 
959  FileNameEnd = pFile->GetFileName();
960  PluginName = pFile->GetFileName();
961 
962  FileNameEnd.Right(2);
963  bDebug = ( FileNameEnd==moText("_d") );
964  if (bDebug) PluginName.Left( PluginName.Length() - 3 );
965 
967  if (!bDebug) {
968  if (pFile->GetExtension()==moText(".so")) {
969  #ifndef MO_WIN32
970  PluginName.Right( PluginName.Length() - 10 );
972  m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
973  MODebug2->Message( pFile->GetFileName() );
974  #endif
975  } else if (pFile->GetExtension()==moText(".dll")) {
976  #ifdef MO_WIN32
977  m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
978  MODebug2->Message( pFile->GetFileName() );
979 
980  #endif
981  }
982  }
983 
984  pFile = DirEffects.FindNext();
985  }
986  } else MODebug2->Error( moText("Directory doesn't exists:")+(moText)plugindir );
987 
988 
989  return 0;
990 }
991 
992 
995 
997 #ifdef MO_MACOSX
998 
999  CFBundleRef mainBundle = CFBundleGetMainBundle();
1000  CFURLRef moldeologoURL = CFBundleCopyResourceURL( mainBundle, CFSTR("moldeologo"),CFSTR("png"),NULL );
1001 
1002  /*std::string moldeologostr(CFStringGetCStringPtr(CFURLGetString(moldeologoURL),kCFStringEncodingUTF8));
1003  */
1004  string moldeologostr("-");
1005 
1006  if (moldeologoURL) {
1007  moldeologostr = CFStringGetCStringPtr( CFURLGetString(moldeologoURL), kCFStringEncodingUTF8 );
1008  CFStringRef cfstr = CFURLCopyFileSystemPath( moldeologoURL, kCFURLPOSIXPathStyle );
1009 
1010  moldeologostr = CFStringGetCStringPtr( cfstr, kCFStringEncodingUTF8 );
1011  }
1012 
1013  //cout << "moldeologostr: " << moldeologostr << endl;
1014 
1015  //CFURLRef resourcesURL = CFBundleCopyResourceURL( mainBundle);
1016 
1017  moText datad = moldeologostr.c_str();
1018  moFile logof(datad);
1019  moDataManager::m_DataDir = logof.GetPath()+moText("data");
1020  moDataManager::m_ModulesDir = logof.GetPath()+moText("plugins");
1021 #endif
1022  return m_DataDir;
1023 }
1024 
1026 #ifdef MO_MACOSX
1027 
1028  CFBundleRef mainBundle = CFBundleGetMainBundle();
1029  CFURLRef moldeologoURL = CFBundleCopyResourceURL( mainBundle, CFSTR("moldeologo"),CFSTR("png"),NULL );
1030 
1031  /*std::string moldeologostr(CFStringGetCStringPtr(CFURLGetString(moldeologoURL),kCFStringEncodingUTF8));
1032  */
1033  string moldeologostr("-");
1034 
1035  if (moldeologoURL) {
1036  moldeologostr = CFStringGetCStringPtr( CFURLGetString(moldeologoURL), kCFStringEncodingUTF8 );
1037  CFStringRef cfstr = CFURLCopyFileSystemPath( moldeologoURL, kCFURLPOSIXPathStyle );
1038 
1039  moldeologostr = CFStringGetCStringPtr( cfstr, kCFStringEncodingUTF8 );
1040  }
1041 
1042  //cout << "moldeologostr: " << moldeologostr << endl;
1043 
1044  //CFURLRef resourcesURL = CFBundleCopyResourceURL( mainBundle);
1045 
1046  moText datad = moldeologostr.c_str();
1047  moFile logof(datad);
1048  moDataManager::m_DataDir = logof.GetPath()+moText("data");
1049  moDataManager::m_ModulesDir = logof.GetPath()+moText("plugins");
1050 #endif
1051  return m_ModulesDir;
1052 }
1053 
1054 
1055 moText
1057  //m_DataSessionIndex
1058  if (m_pDataSessionConfig)
1059  return m_pDataSessionConfig->GetAppPath();
1060  return moText("");
1061 }
1062 
1063 moText
1065  //m_DataSessionIndex
1066  if (m_pDataSessionConfig)
1067  return m_pDataSessionConfig->GetDataPath();
1068  return moText("");
1069 }
1070 
1071 moFile
1072 moDataManager::GetDataFile( const moText& p_file_name ) {
1073 
1074  moText full_path = m_pDataSessionConfig->GetDataPath() + moSlash + p_file_name;
1075  return moFile( full_path );
1076 }
1077 
1079 moDataManager::GetDataDir( const moText& p_dir_name ) {
1080 
1081  moText full_path = m_pDataSessionConfig->GetDataPath() + moSlash + p_dir_name;
1082  return moDirectory( full_path );
1083 }
1084 
1085 
1086 moFile
1087 moDataManager::GetAppDataFile( const moText& p_file_name ) {
1088 
1089  moText full_path = m_pDataSessionConfig->GetAppDataPath() + moSlash + p_file_name;
1090  return moFile( full_path );
1091 }
1092 
1094 moDataManager::GetAppDataDir( const moText& p_dir_name ) {
1095 
1096  moText full_path = m_pDataSessionConfig->GetAppDataPath() + moSlash + p_dir_name;
1097  return moDirectory( full_path );
1098 }
1099 
1100 moText
1102  //m_DataSessionIndex
1103  if (m_pDataSessionConfig)
1104  return m_pDataSessionConfig->GetAppDataPath();
1105  return moText("");
1106 }
1107 
1108 moText
1110  //m_DataSessionIndex
1111  if (m_pDataSessionConfig)
1112  return m_pDataSessionConfig->GetConsoleConfigName();
1113  return moText("");
1114 }
1115 
1116 moText
1118  //m_DataSessionIndex
1119  if (m_pDataSessionConfig)
1120  return m_pDataSessionConfig->GetPluginsPath();
1121  return moText("");
1122 }
1123 
1125  return true;
1126 }
1127 
1129 
1130  //m_pDataSession->Record(m_ConsoleState);
1131 
1132 }
1133 
1135  // m_pDataSession->Playback(m_ConsoleState);
1136 }
1137 
1139  return m_pDataSession;
1140 }
1141 
1142 
1143 bool
1144 moDataManager::Export( const moText& p_export_path_, moText p_from_config_console ) {
1145 
1146 
1149  moConfig from_console;
1150 
1151  MODebug2->Message( "moDataManager::Export > p_export_path_: " + p_export_path_ );
1152 
1153  if ( m_pDataSessionConfig && p_from_config_console == "") {
1154 
1155  p_from_config_console = m_pDataSessionConfig->GetDataPath() + moSlash + m_pDataSessionConfig->GetConsoleConfigName();
1156 
1157  }
1158 
1159  if ( p_from_config_console != "" ) {
1160 
1161  if ( from_console.LoadConfig( p_from_config_console ) != MO_CONFIG_OK ) {
1162 
1163  MODebug2->Error( moText("moDataManager::Export > Couldn't load config from ") + p_from_config_console );
1164  return false;
1165 
1166  } else {
1167  MODebug2->Push( moText("moDataManager::Export > Exporting moldeo console project: ") + p_from_config_console );
1168  }
1169 
1170  } else {
1171 
1172  MODebug2->Error( moText("moDataManager::Export > Couldn't load config from no console config file, please define one or load a project.") );
1173  return false;
1174 
1175  }
1176 
1177 
1186  bool result = true;
1187  moMobDefinition MobDef;
1188 
1197  for( int m=0; m<MO_OBJECT_TYPES; m++ ) {
1198 
1199  moText object_type_class = MobDef.GetTypeToClass( (moMoldeoObjectType) m );
1200 
1201  for( MOuint i=0; i< from_console.GetParam( object_type_class ).GetValuesCount(); i++) {
1202 
1203  moText config_file = from_console.GetParam( object_type_class ).GetValue(i).GetSubValue(1).Text();
1204  result&= IteratedExport( config_file );
1205  }
1206 
1207  }
1208 
1209  result&= IteratedExport( p_from_config_console );
1210 
1211  return result;
1212 
1213 }
1214 
1215 bool moDataManager::IteratedExport( const moText& p_from_config_file ) {
1216 
1217 
1218  moConfig config;
1219 
1220  if ( p_from_config_file != "" ) {
1221 
1222  if ( config.LoadConfig( p_from_config_file ) != MO_CONFIG_OK ) {
1223 
1224  MODebug2->Error( moText("moDataManager::IteratedExport > error loading config file ") + p_from_config_file );
1225  return false;
1226 
1227  }
1228 
1229 
1244  } else return true;
1245 
1246 
1247  return false;
1248 
1249 }
1250 
1252 
1253  moText filerelative_Data = "";
1254  moFile filetoImport( p_file_full_path );
1255 
1256  if (InData(p_file_full_path)) {
1257 
1258  moText fileabs = filetoImport.GetAbsolutePath();
1259  fileabs.ReplaceChar( "\\","/");
1260 
1261  moText datapath = GetDataPath();
1262  datapath.ReplaceChar( "\\","/");
1263 
1264  filerelative_Data = fileabs.Right( fileabs.Length() - datapath.Length() );
1265  MODebug2->Message( "moDataManager::MakeRelativeToData > fileabs: " + fileabs + " datapath:" + datapath
1266  + " filerelative_Data: " + filerelative_Data );
1267  }
1268 
1269  return filerelative_Data;
1270 }
1271 
1272 bool moDataManager::InData( const moText& p_file_full_path ) {
1273 
1274  //check if p_file_full_path is in the folder...
1275  moFile filetoImport( p_file_full_path );
1276  moText fileabs = filetoImport.GetAbsolutePath();
1277  fileabs.ReplaceChar( "\\","/");
1278 
1279  moText datapath = GetDataPath();
1280  datapath.ReplaceChar( "\\","/");
1281 
1282  MODebug2->Message( "moDataManager::InData > fileabs: " + fileabs + " datapath:" + datapath );
1283 
1284  if (fileabs.Length()>datapath.Length()) {
1285 
1286  moText fileabs_Data = fileabs.Left( datapath.Length()-1 );
1287  MODebug2->Message( "moDataManager::InData > fileabs_Data:" + fileabs_Data );
1288  if (fileabs_Data==datapath) {
1289  return true;
1290  }
1291  }
1292  MODebug2->Message( "moDataManager::InData > not InData! Copy file please!");
1293  return false;
1294 
1295 }
1296 
1297 bool moDataManager::ImportFile( const moText& p_import_file_full_path ) {
1298 
1299  bool result = false;
1301 
1303 
1304  moFile importFile( p_import_file_full_path );
1305  moText file_destination_path;
1306  if (importFile.Exists()) {
1307  file_destination_path = GetDataPath() + "/" + importFile.GetFullName();
1308  MODebug2->Message("moDataManager::ImportFile > p_import_file_full_path: " + p_import_file_full_path
1309  + " to " + file_destination_path );
1310  result = moFileManager::CopyFile( p_import_file_full_path, file_destination_path );
1311 
1312  }
1313 
1314  return result;
1315 
1316 }
virtual ~moDataSessionKey()
Valor de un Parámetro.
Definition: moValue.h:501
static bool CopyFile(moText FileSrc, moText FileDst)
moText GetFullName()
Retreive full file name: return "myFileName" for "myFileName.txt".
void SetRenderedFolder(const moText &p_rendered_folder)
moFile * FindFirst()
Definition: moFile.cpp:314
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
void SetText(moText ptext)
Definition: moValue.cpp:158
"valueset" > MO_ACTION_VALUE_SET
Definition: moActions.h:132
static void Message(moText p_text)
Anuncia un mensaje al usuario además de guardarlo en el log de texto.
static moMoldeoActionType StrToActionType(const moText &p_action_type_str)
Definition: moActions.cpp:86
moFile * FindNext()
Definition: moFile.cpp:325
virtual ~moDataSessionEventKey()
MOint deviceid
Definition: moEventList.h:62
static moText GetWorkPath()
moValueBase & GetSubValue(MOint p_indexsubvalue=0)
Definition: moValue.h:539
moDirectory GetAppDataDir(const moText &p_dir_name)
value type: NUM or FUNCTION
Definition: moParam.h:47
#define MO_UNDEFINED
Definition: moTypes.h:379
#define MO_CONFIGFILE_NOT_FOUND
Definition: moConfig.h:42
static moText m_ModulesDir
Estado de la consola.
moRenderManager * GetRenderMan()
#define MOboolean
Definition: moTypes.h:385
bool Render(moConsoleState &p_console_state)
stop record
static void Error(moText p_text)
Anuncia un error.
void StartRecordingSession()
bool IteratedExport(const moText &p_from_config_file_)
moDataSessionPlaybackMode
Definition: moDataManager.h:78
Objeto dibujable, efecto-maestro ( puede controlar otros efectos )
Definition: moTypes.h:531
bool LoadFromFile(const moText &p_filename)
moText0 & Left(MOuint)
Definition: moText.cpp:484
virtual ~moDataSessionConfig()
bool Activated() const
const moText & ToJSON()
Clase Mensaje.
Definition: moEventList.h:97
static moText GetTypeToClass(moMoldeoObjectType p_Type=MO_OBJECT_UNDEFINED)
Transforma un moMoldeoObjectType en el nombre de su correspondiente clase base.
bool Record(moConsoleState &p_console_state)
stop playback
Objeto indefinido.
Definition: moTypes.h:527
moText GetExtension()
Get absolute path and filename "/D/PP/myFileName.txt".
Definition: moFile.cpp:543
MOboolean Exists()
Definition: moFile.cpp:281
static moText GetExePath()
moFile GetDataFile(const moText &p_file_name)
MOboolean Exists()
Definition: moFile.cpp:436
moText GetFileName()
Definition: moFile.cpp:477
value type: TXT or LNK
Definition: moParam.h:57
void ReplaceChar(const char *target, const char *replacement)
Definition: moText.cpp:796
clase de para manejar textos
Definition: moText.h:75
bool StopRender(moConsoleState &p_console_state)
render to images
Definición de un plugin.
Definition: moBasePlugin.h:79
static moText m_DataDir
virtual MOboolean Finish()
Clase Base Descriptiva de un Objeto Moldeo.
virtual MOboolean Init()
Dispositivo de entrada/salida, típicamente, interfaces humanas de IO y datos ( teclado, mouse, tableta, tcp, udp, serial )
Definition: moTypes.h:532
bool AddEventKey(const moDataSessionEventKey &p_eventkey)
moTypes MOint moText moParamIndex moParamReference int iRow int int i int i
Definition: all_f.js:18
moDataSessionMode
Definition: moDataManager.h:52
virtual ~moDataSession()
bool AddKey(const moDataSessionKey &p_key)
static void Log(moText p_text)
Escribe un mensaje en el archivo de registro (log)
moText0 moText
Definition: moText.h:291
static const moText & GetModulesDir()
void moStopTimer()
Detiene el temporizador global.
Definition: moTimer.cpp:124
int LoadConfig(moText p_filename)
Lee la configuracion de un archivo.
Definition: moConfig.cpp:402
moText GetPath()
Retreive full file name: return "myFileName.txt", extension is included.
Definition: moFile.cpp:533
bool SaveToFile(const moText &p_filename=moText(""))
moText0 & Right(MOuint)
Definition: moText.cpp:491
bool RecordLive(moResourceManager *pRM)
stop render
void moStartTimer()
Inicia el temporizador global.
Definition: moTimer.cpp:112
moValue & GetValue()
const moDataSessionKey & NextKey(moConsoleState &m_ConsoleState)
moMessage & GetMessage()
bool InData(const moText &p_file_full_path)
moMoldeoActionType
moMoldeoActionType
Definition: moActions.h:64
MOulong moGetTicksAbsoluteStep(long step_interval)
Devuelve en milisegundos el valor del reloj de Moldeo.
Definition: moTimer.cpp:33
Objeto dibujable, pre-efecto ( primeros efectos en el orden de dibujado )
Definition: moTypes.h:529
moText GetCompletePath()
Get inmediate folder name: return "PP" for "PP/myFileName.txt".
Definition: moFile.cpp:538
Administrador de recursos.
MOuint Length() const
Definition: moText.cpp:347
bool StepRender(moConsoleState &p_console_state)
const moText & ToJSON()
moConsoleMode m_Mode
moText GetConsoleConfigName()
virtual ~moDataManager()
param 1: effect label name | effect id
Definition: moActions.h:426
moText m_RenderFrameQuality
const moDataSessionKey & GetActualKey()
Objeto dibujable, efecto ( efectos en el orden de dibujado )
Definition: moTypes.h:528
MOulong moResetTicksAbsoluteStep(long reset_value)
Definition: moTimer.cpp:28
moDataSessionKey & operator=(const moDataSessionKey &src)
"paramset" > MO_ACTION_PARAM_SET
Definition: moActions.h:173
void StartPlayinbackSession()
Reproducción en tiempo real a consola.
Definition: moDataManager.h:80
moText GetPluginsPath()
moText Text()
Definition: moValue.cpp:539
virtual MOboolean Init(const moText &p_apppath, const moText &p_datapath, moConfig &p_consoleconfig, MOint p_render_to_texture_mode=0, MOint p_screen_width=320, MOint p_screen_height=240, MOint p_render_width=320, MOint p_render_height=240, MO_HANDLE p_OpWindowHandle=0, MO_DISPLAY p_Display=NULL)
bool SetKey(int p_actual_key)
const moDataMessage & Message(moParamReference p_paramreference)
Definition: moConfig.cpp:1410
int GetRenderedFrames() const
moValue & GetValue(MOint i=-1)
Definition: moParam.cpp:1204
bool Export(const moText &p_export_path, moText p_from_config_console=moText(""))
moParam & GetParam(MOint p_paramindex=-1)
Devuelve el parámetro por índice.
Definition: moConfig.cpp:984
#define DataMan()
#define RenderMan()
virtual long Duration()
Devuelve el valor del reloj del temporizador.
Definition: moTempo.cpp:146
Objeto principal de administración y dibujado de objetos de Moldeo.
Definition: moTypes.h:534
moBucketsPool * GetFramesPool()
bool ImportFile(const moText &p_import_file_full_path)
moText GetAppDataPath()
bool StopRecord(moConsoleState &p_console_state)
start record
moText GetDataPath()
#define MOuint
Definition: moTypes.h:387
LIBMOLDEO_API moText0 IntToStr(int a)
Definition: moText.cpp:1070
const moText & ToXML()
moMoldeoActionType GetActionType() const
Objeto dibujable, post-efecto ( últímos efectos en el orden de dibujado )
Definition: moTypes.h:530
bool Playback(moConsoleState &p_console_state)
moDataSession * GetSession()
MOuint GetValuesCount() const
Definition: moParam.cpp:1065
moText GetAbsolutePath()
Get relative path and filename "PP/myFileName.txt".
moFile GetAppDataFile(const moText &p_file_name)
moValueType GetType() const
Devuelve el tipo de valor ,esta función se implementa sólo como atajo a ciertos datos de la definició...
Definition: moValue.cpp:1498
void Set(moText p_Name, moDataSessionConfig *pSessionConfig, moDataSessionMode p_sessionmode, moDataSessionRecordMode p_recordmode, moDataSessionPlaybackMode p_playbackmode, moResourceManager *p_ResMan)
moDefineDynamicArray(moDataSessionKeys) moDefineDynamicArray(moDataSessionEventKeys) moDataSession
#define MO_CONFIG_OK
Definition: moConfig.h:43
bool Loaded()
fast live record
static bool DirectoryExists(moText dirname)
moDataSessionRecordMode
Definition: moDataManager.h:65
MOboolean Open(moText p_CompletePath, moText p_Search="/*.*")
Definition: moFile.cpp:100
bool IsInTime(long time_position, long time_interval)
moText MakeRelativeToData(const moText &p_file_full_path)
int ReloadPluginDefinitions(moText plugindir="", moMoldeoObjectType mobjecttype=MO_OBJECT_UNDEFINED)
int Set(const moText &p_XmlText)
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193
static const moText & GetDataDir()
MOulong moGetTicks()
Devuelve en milisegundos el valor del reloj de Moldeo.
Definition: moTimer.cpp:138