コード例 #1
0
ファイル: MGEffect.cpp プロジェクト: EQ4/neonv2
//---------------------------------------------------------------------------//
// Load
//
//---------------------------------------------------------------------------//  
bool CMGEffect::Load(CNodeFile::CNode *pNode)
{
  // Load FX data
  m_FXClass  = pNode->AttrAsString("fxclass");
  m_FXDir    = pNode->AsString    ("fxdir");
  m_FXFile   = pNode->AsString    ("fxfile");
  m_FXName   = pNode->AsString    ("fxname", m_FXName);
  m_FileName = pNode->AsString    ("filename", m_FileName);

  PushDir("Effects/" + m_FXDir);
  CVJEffect::TVJSnapshot Snapshot;
  m_ID = g_pAppMain->VJController()->FXLoad(m_FXClass, m_FXFile, &Snapshot);
  PopDir ();
  if (m_ID != -1)
  {
    // Load controls and snapshot
    LoadSnapshot  (&Snapshot, m_Bitmap);
    CreateControls();

    // Load vars, filters and its links
    LoadVars   (pNode);
    LoadFilters(pNode);
  }

  return (m_ID != -1);
}
コード例 #2
0
ファイル: SelectPkg.cpp プロジェクト: dreamsxin/ultimatepp
String SelectPackageDlg::Run(String startwith)
{
	finished = canceled = false;
	if(!IsSplashOpen())
		Open();
	if(selectvars)
		SyncBase(GetVarsName());
	else
		OnBase();
	String bkvar = GetVarsName();
	if(finished)
		return GetCurrentName();
	if(canceled)
		return Null;
	alist.FindSetCursor(startwith);
	clist.FindSetCursor(startwith);
	ActiveFocus(alist.IsShown() ? (Ctrl&)alist : (Ctrl&)clist);
	switch(TopWindow::Run()) {
	case IDOK:  return GetCurrentName();
	case IDYES: return selected;
	default:
		LoadVars(bkvar);
		SyncBase(GetVarsName());
		return Null;
	}
}
コード例 #3
0
ファイル: Config.cpp プロジェクト: AbdelghaniDr/mirror
void Ide::SerializeLastMain(Stream& s)
{
	s % main;
	String varsname = GetVarsName();
	s % varsname;
	s % pocfg;
	if(s.IsLoading())
		LoadVars(varsname);
}
コード例 #4
0
//Devuelve el numero de areas validas en este fichero
//nValidAreaCount indica el area total actual. Se debe incrementar. La primera area es 0
int ProcesarFichero(CString csFichero, FILE* salida,int& nValidAreaCount, int& num_bandas_param)
{
    // lee todas las variables del fichero y las guarda en variables globales
	if ( LoadVars((LPCTSTR)csFichero) == NULL) {
		return 0;
	}

    CString csMuestra;
    char* muestra;
    muestra = csMuestra.GetBuffer(100);
    LOADSTR(muestra);
    csMuestra.ReleaseBuffer(-1);

    int num_areas;
    LOADINT(num_areas);

    int num_bandas = -1;
    LOADINT(num_bandas); //devuelve -1 si no encontrado

// SOPORTE A DATS ANTIGUOS
if (num_bandas == -1)
{
    int num_espectros = -1;
    LOADINT(num_espectros); //devuelve -1 si no encontrado
    num_bandas = num_espectros;
   
}
    num_bandas_param = num_bandas;
        
    int campo;
    LOADINT(campo);
    int fila;
    LOADINT(fila);

    for (int i=0; i <num_areas; i++)
    {
        char strCount[3];
        itoa(i+1,strCount,10); // convertir contador a string 
        nValidAreaCount++; // primera area es 1
        ProcesarArea(strCount, num_bandas, salida, nValidAreaCount, csMuestra, campo, fila); //recuperamos y actualizamos datos
    }

    return num_areas;
    
}
コード例 #5
0
ファイル: SelectPkg.cpp プロジェクト: dreamsxin/ultimatepp
void SelectPackageDlg::Load()
{
	if(selectvars && !base.IsCursor())
		return;
	if(loading) { // If we are called recursively from ProcessEvents, stop current loading and change loadi
		loadi++;
		loading = false;
		return;
	}
	int current_loadi = -1;
	while(current_loadi != loadi) {
		current_loadi = loadi;
		if(selectvars) {
			String assembly = (String)base.Get(0);
			list.Enable(base.IsCursor());
			if(!base.IsCursor())
				return;
			LoadVars(assembly);
		}
		Vector<String> upp = GetUppDirs();
		packages.Clear();
		description.Hide();
		progress.Show();
		loading = true;
		data.Clear();
		Index<String> dir_exists;
		String cache_path = CachePath(GetVarsName());
		LoadFromFile(data, cache_path);
		data.SetCount(upp.GetCount());
		for(int i = 0; i < upp.GetCount(); i++) // Scan nest folders for subfolders (package candidates)
			ScanFolder(upp[i], data[i], GetFileName(upp[i]), dir_exists, Null);
		int update = msecs();
		for(int i = 0; i < data.GetCount() && loading; i++) { // Now investigate individual sub folders
			ArrayMap<String, PkData>& nest = data[i];
			for(int i = 0; i < nest.GetCount() && loading; i++) {
				if(msecs(update) >= 100) { // each 100 ms update the list (and open select dialog after splash screen is closed)
					if(!IsSplashOpen() && !IsOpen())
						Open();
					progress++;
					SyncList();
					update = msecs();
				}
				ProcessEvents(); // keep GUI running
	
				PkData& d = nest[i];
				String path = nest.GetKey(i);
				FindFile ff(path);
				if(ff && ff.IsFolder()) {
					String upp_path = AppendFileName(path, GetFileName(d.package) + ".upp");
					LSLOW();
					Time tm = FileGetTime(upp_path);
					if(IsNull(tm)) // .upp file does not exist - not a package
						d.ispackage = false;
					else
					if(tm != d.tm) { // cached info is outdated
						Package p;
						if(p.Load(upp_path)) {
							d.description = p.description;
							d.main = p.config.GetCount();
							d.tm = tm;
							d.ispackage = true;
						}
						else
							d.ispackage = false;
					}
					else
						d.ispackage = true;
					if(d.ispackage) {
						String icon_path = AppendFileName(path, "icon16x16.png");
						tm = FileGetTime(icon_path);
						if(IsNull(tm)) // package icon does not exist
							d.icon = Null;
						else
						if(tm != d.itm) { // chached package icon outdated
							d.icon = StreamRaster::LoadFileAny(icon_path);
							d.itm = tm;
						}
					}
				}
				else 
					nest.Unlink(i); // cached folder was deleted
				ScanFolder(path, nest, d.nest, dir_exists, d.package + '/');
			}
			nest.Sweep();
		}
	
		StoreToFile(data, cache_path);
		progress.Hide();
		while(IsSplashOpen())
			ProcessEvents();
		if(!IsOpen())
			Open();
		description.Show();
		if(loading) {
			loading = false;
			SyncList();
		}
	}
}