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.
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() + moSlash + 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 ( m_DataPath==moText("") ) {
720  if ( m_AppPath!=moText("")) {
721  m_DataPath = m_AppPath;
722  }
723  }
724 
725  if ( molFile.GetPath()==moText("") ) {
726  m_ConsoleConfigName = m_DataPath + moSlash + m_ConsoleConfigName;
727  moDebugManager::Message( moText(" moDataSessionConfig() > m_ConsoleConfigName fixed to: ") + m_ConsoleConfigName );
728  }
729 
730  if ( mosFile.GetPath()==moText("") ) {
731  m_SessionFileName = m_DataPath + moSlash + m_SessionFileName;
732  moDebugManager::Message( moText(" moDataSessionConfig() > m_SessionFileName fixed to: ") + m_SessionFileName );
733  }
734 
735  GetConfigDefinition()->Set( "session", "moDataSession" );
736  GetConfigDefinition()->Add( "project", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_PROJECT, moValue( m_ConsoleConfigName, "TXT") );
737  GetConfigDefinition()->Add( "resolution", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_RESOLUTION, moValue( "1024x768", "TXT") );
738  GetConfigDefinition()->Add( "render_folder", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_RENDER_FOLDER, moValue( "", "TXT") );
739  GetConfigDefinition()->Add( "length", MO_PARAM_NUMERIC, MO_DATA_SESSION_CONFIG_LENGTH, moValue( "0", "NUM").Ref() );
740  GetConfigDefinition()->Add( "keys", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_KEYS, moValue( "<moDataSessionKey></moDataSessionKey>", "XML") );
741  GetConfigDefinition()->Add( "eventkeys", MO_PARAM_TEXT, MO_DATA_SESSION_CONFIG_EVENT_KEYS, moValue( "<moDataSessionEventKey></moDataSessionEventKey>", "XML") );
742  if (CreateDefault( m_SessionFileName )) {
743  moDebugManager::Message("moDataSessionConfig > Created "+m_SessionFileName);
744  }
745 
746  if (LoadConfig(m_SessionFileName)==MO_CONFIG_OK) {
747  moDebugManager::Message("moDataSessionConfig > Loaded "+m_SessionFileName);
748  } else moDebugManager::Error("moDataSessionConfig > Not Loaded "+m_SessionFileName);
749 
753  m_AppDataPath = moDataManager::GetDataDir();
754 
755  if ( m_AppDataPath == moText("../../data") ) {
756 
757  moDirectory mDir( m_AppDataPath );
758  moDebugManager::Message( moText(" moDataSessionConfig() > m_AppDataPath: ") + m_AppDataPath
759  + moText(" Exists: ") + IntToStr( mDir.Exists() ) );
760 
761  if (!mDir.Exists()) {
764 
765  #ifdef MO_WIN32
766 
767  moDebugManager::Message( moText(" moDataSessionConfig() > exeFile Path: ") + moFileManager::GetExePath() );
768  moFile exeFile( moFileManager::GetExePath() );
769  m_AppDataPath = exeFile.GetPath() + moSlash + m_AppDataPath;
770 
771  moDebugManager::Message( m_AppDataPath + moText(" doesn't exists > adding absolute path: ") + m_AppDataPath );
772  #else
773  moDebugManager::Error( moText(" moDataSessionConfig() > App Data Path doesn't exists: ") + m_AppDataPath );
774  moDebugManager::Error( moText(" please check libmoldeo DATADIR settings (configure.ac) > DATADIR is: ") + moDataManager::GetDataDir() );
775  #endif
776  }
777 
778  }
779 
780 
781  if ( m_DataPath == moText("") ) {
782  m_DataPath = m_AppPath;
783  moDebugManager::Message( moText(" moDataSessionConfig() > m_DataPath set to: ") + m_DataPath );
784  } else moDebugManager::Message( moText(" moDataSessionConfig() > m_DataPath: ") + m_DataPath );
785 
786 
787 
788 }
789 
791 }
792 
793 moText
795  return m_AppPath;
796 }
797 
798 moText
800  return m_DataPath;
801 }
802 
803 moText
805  return m_AppDataPath;
806 }
807 
808 
809 moText
811  return m_ConsoleConfigName;
812 }
813 
814 moText
816  return m_VideoFileName;
817 }
818 
819 moText
821  return m_SessionFileName;
822 }
823 
824 moText
826  return m_PluginsPath;
827 }
828 
829 
830 //===========================================
831 //
832 // moDataManager
833 //
834 //===========================================
835 
836 
838  SetType( MO_OBJECT_RESOURCE );
839  SetResourceType( MO_RESOURCETYPE_DATA );
840 
841  SetName("datamanager");
842  SetLabelName("datamanager");
843 
844  m_pDataSession = NULL;
845  m_pDataSessionConfig = NULL;
846 
847 
848 }
849 
851 
852 }
853 
855  if (!m_pDataSessionConfig) m_pDataSessionConfig = new moDataSessionConfig( moText(""), moDataManager::GetDataDir(), moText(moDataManager::GetDataDir()+ "/console.mol") );
856  if (!m_pDataSession) {
857  m_pDataSession = new moDataSession();
858  if (m_pDataSession)
859  m_pDataSession->Set( moText("session 1"),
860  m_pDataSessionConfig,
864  m_pResourceManager );
865  }
866  return true;
867 }
868 
869 MOboolean moDataManager::Init( moText p_apppath, moText p_datapath, moText p_consoleconfig ) {
870 
871  if (m_pDataSession) {
872  delete m_pDataSession;
873  m_pDataSession = NULL;
874  }
875  if (m_pDataSessionConfig) {
876  delete m_pDataSessionConfig;
877  m_pDataSessionConfig = NULL;
878  }
879 
880  if (!m_pDataSessionConfig) {
881  m_pDataSessionConfig = new moDataSessionConfig( p_apppath, p_datapath, p_consoleconfig );
882  }
883  if (!m_pDataSession) {
884  m_pDataSession = new moDataSession();
885  m_pDataSession->Set( moText("session 1"),
886  m_pDataSessionConfig,
890  m_pResourceManager );
891  }
892 
894  ReloadPluginDefinitions();
895 
896  return true;
897 }
898 
899 int
901 
902  moDirectory DirEffects;
903  bool bDebug = true;
904  moText PluginName;
905  moText pluginfullpath = m_pDataSessionConfig->GetPluginsPath();
906 
907  if (plugindir.Length()==0 && mobjecttype==MO_OBJECT_UNDEFINED) {
908 
909  ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
910  ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
911  ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
912  ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
913  ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
914  ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
915  return 0;
916  }
917 
918  if (plugindir.Length()==0 && mobjecttype!=MO_OBJECT_UNDEFINED) {
919  switch(mobjecttype) {
920  case MO_OBJECT_PREEFFECT:
921  ReloadPluginDefinitions( pluginfullpath + moSlash + "preeffects", MO_OBJECT_PREEFFECT );
922  break;
923  case MO_OBJECT_EFFECT:
924  ReloadPluginDefinitions( pluginfullpath + moSlash + "effects", MO_OBJECT_EFFECT );
925  break;
927  ReloadPluginDefinitions( pluginfullpath + moSlash + "posteffects", MO_OBJECT_POSTEFFECT );
928  break;
930  ReloadPluginDefinitions( pluginfullpath + moSlash + "mastereffects", MO_OBJECT_MASTEREFFECT );
931  break;
932  case MO_OBJECT_IODEVICE:
933  ReloadPluginDefinitions( pluginfullpath + moSlash + "resources", MO_OBJECT_RESOURCE );
934  break;
935  case MO_OBJECT_RESOURCE:
936  ReloadPluginDefinitions( pluginfullpath + moSlash + "iodevices", MO_OBJECT_IODEVICE );
937  break;
938  default:
939  break;
940  }
941  return 0;
942  }
943 
944 
947  #ifdef MO_WIN32
948  DirEffects.Open( plugindir, moText("/*.dll") );
949  #else
950  DirEffects.Open( plugindir, moText("/*.so") );
951  #endif // MO_LINUX
952 
953  if (DirEffects.Exists()) {
954 
955  moFile* pFile = NULL;
956  moText FileNameEnd;
957 
958  pFile = DirEffects.FindFirst();
959 
960  if (pFile!=NULL)
961  MODebug2->Message( moText("File founded") );
962 
963  while(pFile!=NULL) {
964 
965  FileNameEnd = pFile->GetFileName();
966  PluginName = pFile->GetFileName();
967 
968  FileNameEnd.Right(2);
969  bDebug = ( FileNameEnd==moText("_d") );
970  if (bDebug) PluginName.Left( PluginName.Length() - 3 );
971 
973  if (!bDebug) {
974  if (pFile->GetExtension()==moText(".so")) {
975  #ifndef MO_WIN32
976  PluginName.Right( PluginName.Length() - 10 );
978  m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
979  MODebug2->Message( pFile->GetFileName() );
980  #endif
981  } else if (pFile->GetExtension()==moText(".dll")) {
982  #ifdef MO_WIN32
983  m_PluginDefinitions.Add( moPluginDefinition( PluginName, pFile->GetCompletePath(), mobjecttype ) );
984  MODebug2->Message( pFile->GetFileName() );
985 
986  #endif
987  }
988  }
989 
990  pFile = DirEffects.FindNext();
991  }
992  } else MODebug2->Error( moText("Directory doesn't exists:")+(moText)plugindir );
993 
994 
995  return 0;
996 }
997 
998 
1000 moText moDataManager::m_ModulesDir = MODULESDIR;
1001 
1003 #ifdef MO_MACOSX
1004 
1005  CFBundleRef mainBundle = CFBundleGetMainBundle();
1006  CFURLRef moldeologoURL = CFBundleCopyResourceURL( mainBundle, CFSTR("moldeologo"),CFSTR("png"),NULL );
1007 
1008  /*std::string moldeologostr(CFStringGetCStringPtr(CFURLGetString(moldeologoURL),kCFStringEncodingUTF8));
1009  */
1010  string moldeologostr("-");
1011 
1012  if (moldeologoURL) {
1013  moldeologostr = CFStringGetCStringPtr( CFURLGetString(moldeologoURL), kCFStringEncodingUTF8 );
1014  CFStringRef cfstr = CFURLCopyFileSystemPath( moldeologoURL, kCFURLPOSIXPathStyle );
1015 
1016  moldeologostr = CFStringGetCStringPtr( cfstr, kCFStringEncodingUTF8 );
1017  }
1018 
1019  //cout << "moldeologostr: " << moldeologostr << endl;
1020 
1021  //CFURLRef resourcesURL = CFBundleCopyResourceURL( mainBundle);
1022 
1023  moText datad = moldeologostr.c_str();
1024  moFile logof(datad);
1025  moDataManager::m_DataDir = logof.GetPath()+moText("data");
1026  moDataManager::m_ModulesDir = logof.GetPath()+moText("plugins");
1027 #endif
1028  return m_DataDir;
1029 }
1030 
1032 #ifdef MO_MACOSX
1033 
1034  CFBundleRef mainBundle = CFBundleGetMainBundle();
1035  CFURLRef moldeologoURL = CFBundleCopyResourceURL( mainBundle, CFSTR("moldeologo"),CFSTR("png"),NULL );
1036 
1037  /*std::string moldeologostr(CFStringGetCStringPtr(CFURLGetString(moldeologoURL),kCFStringEncodingUTF8));
1038  */
1039  string moldeologostr("-");
1040 
1041  if (moldeologoURL) {
1042  moldeologostr = CFStringGetCStringPtr( CFURLGetString(moldeologoURL), kCFStringEncodingUTF8 );
1043  CFStringRef cfstr = CFURLCopyFileSystemPath( moldeologoURL, kCFURLPOSIXPathStyle );
1044 
1045  moldeologostr = CFStringGetCStringPtr( cfstr, kCFStringEncodingUTF8 );
1046  }
1047 
1048  //cout << "moldeologostr: " << moldeologostr << endl;
1049 
1050  //CFURLRef resourcesURL = CFBundleCopyResourceURL( mainBundle);
1051 
1052  moText datad = moldeologostr.c_str();
1053  moFile logof(datad);
1054  moDataManager::m_DataDir = logof.GetPath()+moText("data");
1055  moDataManager::m_ModulesDir = logof.GetPath()+moText("plugins");
1056 #endif
1057  return m_ModulesDir;
1058 }
1059 
1060 
1061 moText
1063  //m_DataSessionIndex
1064  if (m_pDataSessionConfig)
1065  return m_pDataSessionConfig->GetAppPath();
1066  return moText("");
1067 }
1068 
1069 moText
1071  //m_DataSessionIndex
1072  if (m_pDataSessionConfig)
1073  return m_pDataSessionConfig->GetDataPath();
1074  return moText("");
1075 }
1076 
1077 moFile
1078 moDataManager::GetDataFile( const moText& p_file_name ) {
1079 
1080  moText full_path = m_pDataSessionConfig->GetDataPath() + moSlash + p_file_name;
1081  return moFile( full_path );
1082 }
1083 
1085 moDataManager::GetDataDir( const moText& p_dir_name ) {
1086 
1087  moText full_path = m_pDataSessionConfig->GetDataPath() + moSlash + p_dir_name;
1088  return moDirectory( full_path );
1089 }
1090 
1091 
1092 moFile
1093 moDataManager::GetAppDataFile( const moText& p_file_name ) {
1094 
1095  moText full_path = m_pDataSessionConfig->GetAppDataPath() + moSlash + p_file_name;
1096  return moFile( full_path );
1097 }
1098 
1100 moDataManager::GetAppDataDir( const moText& p_dir_name ) {
1101 
1102  moText full_path = m_pDataSessionConfig->GetAppDataPath() + moSlash + p_dir_name;
1103  return moDirectory( full_path );
1104 }
1105 
1106 moText
1108  //m_DataSessionIndex
1109  if (m_pDataSessionConfig)
1110  return m_pDataSessionConfig->GetAppDataPath();
1111  return moText("");
1112 }
1113 
1114 moText
1116  //m_DataSessionIndex
1117  if (m_pDataSessionConfig)
1118  return m_pDataSessionConfig->GetConsoleConfigName();
1119  return moText("");
1120 }
1121 
1122 moText
1124  //m_DataSessionIndex
1125  if (m_pDataSessionConfig)
1126  return m_pDataSessionConfig->GetPluginsPath();
1127  return moText("");
1128 }
1129 
1131  return true;
1132 }
1133 
1135 
1136  //m_pDataSession->Record(m_ConsoleState);
1137 
1138 }
1139 
1141  // m_pDataSession->Playback(m_ConsoleState);
1142 }
1143 
1145  return m_pDataSession;
1146 }
1147 
1148 
1149 bool
1150 moDataManager::Export( const moText& p_export_path_, moText p_from_config_console ) {
1151 
1152 
1155  moConfig from_console;
1156 
1157  MODebug2->Message( "moDataManager::Export > p_export_path_: " + p_export_path_ );
1158 
1159  if ( m_pDataSessionConfig && p_from_config_console == "") {
1160 
1161  p_from_config_console = m_pDataSessionConfig->GetDataPath() + moSlash + m_pDataSessionConfig->GetConsoleConfigName();
1162 
1163  }
1164 
1165  if ( p_from_config_console != "" ) {
1166 
1167  if ( from_console.LoadConfig( p_from_config_console ) != MO_CONFIG_OK ) {
1168 
1169  MODebug2->Error( moText("moDataManager::Export > Couldn't load config from ") + p_from_config_console );
1170  return false;
1171 
1172  } else {
1173  MODebug2->Push( moText("moDataManager::Export > Exporting moldeo console project: ") + p_from_config_console );
1174  }
1175 
1176  } else {
1177 
1178  MODebug2->Error( moText("moDataManager::Export > Couldn't load config from no console config file, please define one or load a project.") );
1179  return false;
1180 
1181  }
1182 
1183 
1192  bool result = true;
1193  moMobDefinition MobDef;
1194 
1203  for( int m=0; m<MO_OBJECT_TYPES; m++ ) {
1204 
1205  moText object_type_class = MobDef.GetTypeToClass( (moMoldeoObjectType) m );
1206 
1207  for( MOuint i=0; i< from_console.GetParam( object_type_class ).GetValuesCount(); i++) {
1208 
1209  moText config_file = from_console.GetParam( object_type_class ).GetValue(i).GetSubValue(1).Text();
1210  result&= IteratedExport( config_file );
1211  }
1212 
1213  }
1214 
1215  result&= IteratedExport( p_from_config_console );
1216 
1217  return result;
1218 
1219 }
1220 
1221 bool moDataManager::IteratedExport( const moText& p_from_config_file ) {
1222 
1223 
1224  moConfig config;
1225 
1226  if ( p_from_config_file != "" ) {
1227 
1228  if ( config.LoadConfig( p_from_config_file ) != MO_CONFIG_OK ) {
1229 
1230  MODebug2->Error( moText("moDataManager::IteratedExport > error loading config file ") + p_from_config_file );
1231  return false;
1232 
1233  }
1234 
1235 
1250  } else return true;
1251 
1252 
1253  return false;
1254 
1255 }
1256 
1258 
1259  moText filerelative_Data = "";
1260  moFile filetoImport( p_file_full_path );
1261 
1262  if (InData(p_file_full_path)) {
1263 
1264  moText fileabs = filetoImport.GetAbsolutePath();
1265  fileabs.ReplaceChar( "\\","/");
1266 
1267  moText datapath = GetDataPath();
1268  datapath.ReplaceChar( "\\","/");
1269 
1270  filerelative_Data = fileabs.Right( fileabs.Length() - datapath.Length() );
1271  MODebug2->Message( "moDataManager::MakeRelativeToData > fileabs: " + fileabs + " datapath:" + datapath
1272  + " filerelative_Data: " + filerelative_Data );
1273  }
1274 
1275  return filerelative_Data;
1276 }
1277 
1278 bool moDataManager::InData( const moText& p_file_full_path ) {
1279 
1280  //check if p_file_full_path is in the folder...
1281  moFile filetoImport( p_file_full_path );
1282  moText fileabs = filetoImport.GetAbsolutePath();
1283  fileabs.ReplaceChar( "\\","/");
1284 
1285  moText datapath = GetDataPath();
1286  datapath.ReplaceChar( "\\","/");
1287 
1288  MODebug2->Message( "moDataManager::InData > fileabs: " + fileabs + " datapath:" + datapath );
1289 
1290  if (fileabs.Length()>datapath.Length()) {
1291 
1292  moText fileabs_Data = fileabs.Left( datapath.Length()-1 );
1293  MODebug2->Message( "moDataManager::InData > fileabs_Data:" + fileabs_Data );
1294  if (fileabs_Data==datapath) {
1295  return true;
1296  }
1297  }
1298  MODebug2->Message( "moDataManager::InData > not InData! Copy file please!");
1299  return false;
1300 
1301 }
1302 
1303 bool moDataManager::ImportFile( const moText& p_import_file_full_path ) {
1304 
1305  bool result = false;
1307 
1309 
1310  moFile importFile( p_import_file_full_path );
1311  moText file_destination_path;
1312  if (importFile.Exists()) {
1313  file_destination_path = GetDataPath() + "/" + importFile.GetFullName();
1314  MODebug2->Message("moDataManager::ImportFile > p_import_file_full_path: " + p_import_file_full_path
1315  + " to " + file_destination_path );
1316  result = moFileManager::CopyFile( p_import_file_full_path, file_destination_path );
1317 
1318  }
1319 
1320  return result;
1321 
1322 }
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
moMoldeoActionType GetActionType() const
moEffectState m_EffectState
Valor del dato agregado o modificado.
virtual ~moDataSessionConfig()
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
long m_ParamId
Opcional para identificación del índice único de objeto.
MOuint Length() const
Definition: moText.cpp:347
MOboolean Exists()
Definition: moFile.cpp:281
static moText GetExePath()
moFile GetDataFile(const moText &p_file_name)
MOboolean Exists()
Definition: moFile.cpp:436
moParamDefinition m_ParamDefinition
Valor del dato agregado o modificado.
moText GetFileName()
Definition: moFile.cpp:477
MOuint GetValuesCount() const
Definition: moParam.cpp:1065
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)
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 Activated() const
bool SaveToFile(const moText &p_filename=moText(""))
moText0 & Right(MOuint)
Definition: moText.cpp:491
bool RecordLive(moResourceManager *pRM)
stop render
moMoldeoActionType m_ActionType
Valor del tick.
void moStartTimer()
Inicia el temporizador global.
Definition: moTimer.cpp:112
moValue & GetValue()
const moDataSessionKey & NextKey(moConsoleState &m_ConsoleState)
moMessage & GetMessage()
int GetRenderedFrames() const
long m_ValueId
Opcional para identificación del índice único de parámetro.
long m_PreconfId
Opcional para identificación del índice único de valor.
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.
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)
long m_ObjectId
accion
const moDataMessage & Message(moParamReference p_paramreference)
Definition: moConfig.cpp:1441
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()
Objeto dibujable, post-efecto ( últímos efectos en el orden de dibujado )
Definition: moTypes.h:530
bool Playback(moConsoleState &p_console_state)
moDataSession * GetSession()
moText GetAbsolutePath()
Get relative path and filename "PP/myFileName.txt".
moFile GetAppDataFile(const moText &p_file_name)
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)
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
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