Пример #1
0
/**
 * Base class implementation of one-time instance initialization. Init
 * calls the Reset function.
 *
 * @param _this        This instance
 * @param bCallVirtual For derived classes: if TRUE call base class implementation
 * @return O_K if successful, an error code otherwise
 */
INT16 CDlpObject_Init(CDlpObject* _this, BOOL bCallVirtual)
{
  INT16 nErr = O_K;

  DEBUGMSG(-1,"CDlpObject_Init for '%s'",_this->m_lpInstanceName,0,0);

#ifndef __NORTTI /* init will be done through AutoRegisterWords */
  nErr = INVOKE_VIRTUAL_1(ResetAllOptions,TRUE); IF_NOK(nErr) return nErr;
  nErr = CDlpObject_ResetAllFields(_this,TRUE);  IF_NOK(nErr) return nErr;
#endif

  return nErr;
}
Пример #2
0
INT16 CFvrtools_Init(CDlpObject* __this, BOOL bCallVirtual)
{
	GET_THIS_VIRTUAL_RV(CFvrtools,NOT_EXEC);
	DEBUGMSG(-1,"CFvrtools_Init, (bCallVirtual=%d)",(int)bCallVirtual,0,0);
	{
	/*{{CGEN_INITCODE */
  INIT;
	/*}}CGEN_INITCODE */
	}

	/* If last derivation call reset (do not reset members; already done by Init()) */
#ifndef __NORTTI
	if (bCallVirtual) return INVOKE_VIRTUAL_1(Reset,FALSE); else
#endif
	                  return O_K;
}
Пример #3
0
void CFsttools_Constructor(CFsttools* _this, const char* lpInstanceName, BOOL bCallVirtual)
{
    DEBUGMSG(-1,"CFsttools_Constructor; (bCallVirtual=%d)",(int)bCallVirtual,0,0);

#ifndef __cplusplus

    /* Register instance */
    dlp_xalloc_register_object('J',_this,1,sizeof(CFsttools),
                               __FILE__,__LINE__,"fsttools",lpInstanceName);

    /* Create base instance */
    _this->m_lpBaseInstance = calloc(1,sizeof(CDlpObject));
    CDlpObject_Constructor(_this->m_lpBaseInstance,lpInstanceName,FALSE);

    /* Override virtual member functions */
    _this->m_lpBaseInstance->AutoRegisterWords = CFsttools_AutoRegisterWords;
    _this->m_lpBaseInstance->Reset             = CFsttools_Reset;
    _this->m_lpBaseInstance->Init              = CFsttools_Init;
    _this->m_lpBaseInstance->Serialize         = CFsttools_Serialize;
    _this->m_lpBaseInstance->SerializeXml      = CFsttools_SerializeXml;
    _this->m_lpBaseInstance->Deserialize       = CFsttools_Deserialize;
    _this->m_lpBaseInstance->DeserializeXml    = CFsttools_DeserializeXml;
    _this->m_lpBaseInstance->Copy              = CFsttools_Copy;
    _this->m_lpBaseInstance->ClassProc         = CFsttools_ClassProc;
    _this->m_lpBaseInstance->GetInstanceInfo   = CFsttools_GetInstanceInfo;
    _this->m_lpBaseInstance->IsKindOf          = CFsttools_IsKindOf;
    _this->m_lpBaseInstance->Destructor        = CFsttools_Destructor;
    _this->m_lpBaseInstance->ResetAllOptions   = CFsttools_ResetAllOptions;

    /* Override pointer to derived instance */
    _this->m_lpBaseInstance->m_lpDerivedInstance = _this;

#endif /* #ifndef __cplusplus */

    dlp_strcpy(BASEINST(_this)->m_lpClassName,"fsttools");
    dlp_strcpy(BASEINST(_this)->m_lpObsoleteName,"");
    dlp_strcpy(BASEINST(_this)->m_lpProjectName,"fsttools");
    dlp_strcpy(BASEINST(_this)->m_version.no,"1.00 DLC22");
    dlp_strcpy(BASEINST(_this)->m_version.date,"");
    BASEINST(_this)->m_nClStyle = CS_AUTOACTIVATE;

    if (bCallVirtual)
    {
        DLPASSERT(OK(INVOKE_VIRTUAL_0(AutoRegisterWords)));
        INVOKE_VIRTUAL_1(Init,TRUE);
    }
}
Пример #4
0
/**
 * Base class implementation of instance reset.
 *
 * @param _this         This instance
 * @param bResetMembers If TRUE reset all options and fields
 * @return O_K if successful, an error code otherwise
 */
INT16 CDlpObject_Reset(CDlpObject* _this, BOOL bResetMembers)
{
  INT16 nErr = O_K;

  DEBUGMSG(-1,"CDlpObject_Reset for '%s'; (bResetMembers=%d)",_this->m_lpInstanceName,bResetMembers,0);

#ifdef __NORTTI
  IERROR(_this,ERR_DANGEROUS,"CDlpObject_Reset","nothing will be reseted in __NORTTI mode",0);
  DLPASSERT(FALSE);
#else
  if (bResetMembers)
  {
    nErr = INVOKE_VIRTUAL_1(ResetAllOptions,FALSE); IF_NOK(nErr) return nErr;
    nErr = CDlpObject_ResetAllFields(_this,FALSE);  IF_NOK(nErr) return nErr;
  }
#endif

  return nErr;
}
Пример #5
0
INT16 CDlpFile_Init(CDlpObject* __this, BOOL bCallVirtual)
{
	GET_THIS_VIRTUAL_RV(CDlpFile,NOT_EXEC);
	DEBUGMSG(-1,"CDlpFile_Init, (bCallVirtual=%d)",(int)bCallVirtual,0,0);
	{
	/*{{CGEN_INITCODE */

  INIT;

  /* create list of filters for import / export */
  _this->m_lpFtypes = list_create(LISTCOUNT_T_MAX);

  /* add filters to list */
  ADD_FILETYPE("ascii"    ,"data"     ,IMPORT_FILE,   "White space delimited ASCII"      ,CDlpFile_ImportAsciiToData          );
  ADD_FILETYPE("ascii"    ,"data"     ,EXPORT_FILE,   "White space delimited ASCII"      ,CDlpFile_ExportAsciiFromData        );
  ADD_FILETYPE("csv"      ,"data"     ,IMPORT_FILE,   "Comma separated values file"      ,CDlpFile_ImportAsciiToData          );
  ADD_FILETYPE("csv_de"   ,"data"     ,IMPORT_FILE,   "Semicolon sep. values file"       ,CDlpFile_ImportAsciiToData          );
  ADD_FILETYPE("csv"      ,"data"     ,EXPORT_FILE,   "Comma separated values file"      ,CDlpFile_ExportAsciiFromData        );
  ADD_FILETYPE("csv_de"   ,"data"     ,EXPORT_FILE,   "Semicolon sep. values file"       ,CDlpFile_ExportAsciiFromData        );
  ADD_FILETYPE("wav"      ,"data"     ,IMPORT_FILE,  "Microsoft WAV audio"              ,CDlpFile_LibsndfileImport           );
  ADD_FILETYPE("wav"      ,"data"     ,EXPORT_FILE,  "Microsoft WAV audio"              ,CDlpFile_LibsndfileExport           );
  ADD_FILETYPE("aiff"     ,"data"     ,IMPORT_FILE,   "Audio Interchange File Format"    ,CDlpFile_LibsndfileImport           );
  ADD_FILETYPE("aiff"     ,"data"     ,EXPORT_FILE,   "Audio Interchange File Format"    ,CDlpFile_LibsndfileExport           );
  ADD_FILETYPE("au"       ,"data"     ,IMPORT_FILE,  "SUN AU audio"                     ,CDlpFile_LibsndfileImport           );
  ADD_FILETYPE("au"       ,"data"     ,EXPORT_FILE,  "SUN AU audio"                     ,CDlpFile_LibsndfileExport           );
  ADD_FILETYPE("phd"      ,"data"     ,IMPORT_FILE,"PhonDat"                          ,CDlpFile_ImportPhDToData            );
  ADD_FILETYPE("vm2_nist" ,"data"     ,IMPORT_FILE,  "Verbmobil2 signal (NIST)"         ,CDlpFile_ImportDataFromVm2Nist      );
  ADD_FILETYPE("esps_lab" ,"data"     ,IMPORT_FILE, "ESPS label"                       ,CDlpFile_ImportEspsLabToData        );
  ADD_FILETYPE("esps_lab" ,"data"     ,EXPORT_FILE, "ESPS label"                       ,CDlpFile_ExportEspsLabFromData      );
  ADD_FILETYPE("pm"       ,"data"     ,IMPORT_FILE, "Period marker"                    ,CDlpFile_ImportPmToData             );
  ADD_FILETYPE("pm"       ,"data"     ,EXPORT_FILE, "Period marker"                    ,CDlpFile_ExportPmFromData           );
  ADD_FILETYPE("pm.txt"   ,"data"     ,IMPORT_FILE,  "Period marker (wavesurfer)"       ,CDlpFile_ImportPmTxtToData          );
  ADD_FILETYPE("pm.txt"   ,"data"     ,EXPORT_FILE,  "Period marker (wavesurfer)"       ,CDlpFile_ExportPmTxtFromData        );
  ADD_FILETYPE("raw"      ,"data"     ,IMPORT_FILE, "RAW (binary)"                     ,CDlpFile_ImportRawToData            );
  ADD_FILETYPE("raw"      ,"data"     ,EXPORT_FILE, "RAW (binary)"                     ,CDlpFile_ExportRawFromData          );
  ADD_FILETYPE("IntRas"   ,"data"     ,IMPORT_FILE,  "Fraunhofer (IZFP) IntRas"         ,CDlpFile_ImportIzfpRsToData         );
  ADD_FILETYPE("FIRS04A"  ,"data"     ,IMPORT_FILE,  "Fraunhofer (IZFP) FIRS04A"        ,CDlpFile_ImportIzfpRsToData         );
  ADD_FILETYPE("into"     ,"data"     ,IMPORT_FILE,"Into"                             ,CDlpFile_ImportIntoToData           );
  ADD_FILETYPE("into"     ,"data"     ,EXPORT_FILE,"Into"                             ,CDlpFile_ExportIntoFromData         );
  ADD_FILETYPE("mid"      ,"data"     ,IMPORT_FILE, "Midi Notes"                       ,CDlpFile_Midi_ImportMidi            );
  ADD_FILETYPE("mid"      ,"data"     ,EXPORT_FILE, "Midi Notes"                       ,CDlpFile_Midi_ExportMidi            );
  ADD_FILETYPE("dot"      ,"fst"      ,EXPORT_FILE,    "AT&T DOT for GraphViz (ASCII)"    ,CDlpFile_Gph_ExportDot              );
  ADD_FILETYPE("svg"      ,"fst"      ,EXPORT_FILE,  "Scalable vector graphic"          ,CDlpFile_Gph_ExportDotTx            );
  ADD_FILETYPE("png"      ,"fst"      ,EXPORT_FILE,  "Portable network graphic"         ,CDlpFile_Gph_ExportDotTx            );
  ADD_FILETYPE("ps"       ,"fst"      ,EXPORT_FILE,        "Postscript (EPSF)       "         ,CDlpFile_Gph_ExportDotTx            );
  ADD_FILETYPE("itp"      ,"fst"      ,EXPORT_FILE, "dLabPro script"                   ,CDlpFile_Gph_ExportItp              );
  ADD_FILETYPE("fsm-a"    ,"fst"      ,EXPORT_FILE,   "AT&T FSM Toolkit (ASCII)"         ,CDlpFile_Gph_ExportFsm              );
  ADD_FILETYPE("fsm-a"    ,"fst"      ,IMPORT_FILE,   "AT&T FSM Toolkit (ASCII)"         ,CDlpFile_Gph_ImportFsm              );
  ADD_FILETYPE("fsm-t"    ,"fst"      ,EXPORT_FILE,   "AT&T FSM Toolkit (ASCII)"         ,CDlpFile_Gph_ExportFsm              );
  ADD_FILETYPE("fsm-t"    ,"fst"      ,IMPORT_FILE,   "AT&T FSM Toolkit (ASCII)"         ,CDlpFile_Gph_ImportFsm              );
  ADD_FILETYPE("htk"      ,"hmm"      ,EXPORT_FILE, "HTK hmmdefs"                      ,CDlpFile_Hmm_ExportHtk              );
  ADD_FILETYPE("pstricks" ,"data"     ,EXPORT_FILE,"PSTricks"                         ,CDlpFile_ExportPstricksFromData     );
  ADD_FILETYPE("inv_descr","data"     ,IMPORT_FILE,   "Inventory description file (.inv)",CDlpFile_ImportInvDescrToData       );
  ADD_FILETYPE("inv_descr","data"     ,EXPORT_FILE,   "Inventory description file (.inv)",CDlpFile_ExportInvDescrFromData     );

	/*}}CGEN_INITCODE */
	}

	/* If last derivation call reset (do not reset members; already done by Init()) */
#ifndef __NORTTI
	if (bCallVirtual) return INVOKE_VIRTUAL_1(Reset,FALSE); else
#endif
	                  return O_K;
}