コード例 #1
0
ファイル: klameoptionsdialog.cpp プロジェクト: ksarkies/kLAME
void KLameOptionsDialogue::setupInitialDefault()
{
    wipeSettings();
    if (lameOptions_ == "")         // Set basic defaults if no options given
        setupDisplay();
    else setDefaultOptions(lameOptions_);
}
コード例 #2
0
ファイル: GNELoadThread.cpp プロジェクト: planetsumo/sumo
bool
GNELoadThread::initOptions() {
    OptionsCont& oc = OptionsCont::getOptions();
    fillOptions(oc);
    if (myFile != "") {
        if (myLoadNet) {
            oc.set("sumo-net-file", myFile);
        } else {
            oc.set("configuration-file", myFile);
        }
    }
    setDefaultOptions(oc);
    try {
        OptionsIO::getOptions();
        if (!oc.isSet("output-file")) {
            oc.set("output-file", oc.getString("sumo-net-file"));
        }
        return true;
    } catch (ProcessError& e) {
        if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) {
            WRITE_ERROR(e.what());
        }
        WRITE_ERROR("Failed to parse options.");
    }
    return false;
}
コード例 #3
0
ファイル: Curl.cpp プロジェクト: HellicarAndLewis/Hub
void Curl::reset() {
	buffer = "";
	http_response_code = 0;
	response_headers.clear();
	http_response_message.clear();
	setCallback();
	setUserPass();
	setDefaultOptions();
}
コード例 #4
0
ファイル: Options.cpp プロジェクト: Purplenigma/oovaide
OovStatusReturn GuiOptions::read()
{
    setFilename(Project::getGuiOptionsFilePath());
    OovStatus status = NameValueFile::readFile();
    if(status.ok())
    {
        setDefaultOptions();
    }
    return status;
}
コード例 #5
0
ファイル: TestAll.cpp プロジェクト: LibreGames/caveexpress
extern "C" int main (int argc, char **argv)
{
	::testing::AddGlobalTestEnvironment(new LocalEnv);
	//::testing::GTEST_FLAG(throw_on_failure) = true;
	::testing::InitGoogleTest(&argc, argv);

	setDefaultOptions();
	parseCommandline(argc, argv);

	Application& app = Singleton<Application>::getInstance();
	const GamePtr& game = Singleton<GameRegistry>::getInstance().getGame();
	app.setOrganisation("caveproductions");
	app.setName(game->getName());
	Log::get().addConsole(&console);
	Config.init(nullptr, argc, argv);
	return RUN_ALL_TESTS();
}
コード例 #6
0
ファイル: mainpage.cpp プロジェクト: realbardia/silicon
void MainPage::deviceDetected( const SDeviceItem & device )
{
    if( !p->devices.contains(device) )
    {
        p->devices << device;
        p->src_combo->insertItem( p->devices.count()-1 , SMasterIcons::icon(ICON_SIZE,"drive-optical.png") , device.name() );
    }
    else
    {
        int index = p->devices.indexOf( device );
        p->devices.removeAt( index );
        p->devices.insert( index , device );

        p->src_combo->setItemText( index , device.name() );
    }

    setDefaultOptions();
    check_access();
}
コード例 #7
0
//==============================================================================
BenderClientOptions::BenderClientOptions (MainComponent &_owner)
    : owner(_owner)
{
    addAndMakeVisible (benderProperties = new PropertyPanel());


    //[UserPreSize]
    //[/UserPreSize]

    setSize (600, 400);


    //[Constructor] You can add your own custom stuff here..
    benderClientProperties = new ApplicationProperties();
    PropertiesFile::Options storageOptions;
    storageOptions.millisecondsBeforeSaving = 250;
    storageOptions.folderName = ".config/bender-client";
    storageOptions.commonToAllUsers = false;
    storageOptions.applicationName = "bender-client";
    storageOptions.filenameSuffix = ".xml";
    storageOptions.storageFormat = PropertiesFile::storeAsXML;

    benderClientProperties->setStorageParameters (storageOptions);

    if (benderClientProperties->getUserSettings())
    {
        ScopedPointer <XmlElement> benderPropertiesTreeAsXml (benderClientProperties->getUserSettings()->getXmlValue("bender-properties"));

        if (benderPropertiesTreeAsXml)
        {
            benderPropertiesTree = ValueTree::fromXml (*benderPropertiesTreeAsXml);
        }
        else
        {
            setDefaultOptions();
        }

        fillPropertyPanel();
    }

    benderPropertiesTree.addListener (this);
    //[/Constructor]
}
コード例 #8
0
ファイル: main.cpp プロジェクト: pvbrowser/pvb
int main(int argc, char *argv[])
{
    setlocale(LC_NUMERIC, "C");
    getargs(argc,argv);
    setDefaultOptions();
    readIniFile();

    Q_INIT_RESOURCE(pvdevelop);

    QApplication app(argc, argv);
    setlocale(LC_NUMERIC, "C");
    perhapsDoAction();
    QIcon appIcon(":/images/app.png");
    app.setWindowIcon(appIcon);
    MainWindow mainWin;
    mainWin.showMaximized();
    if(opt_develop.murx) QDir::setCurrent("/home/lehrig/temp/murx");
    return app.exec();
}
コード例 #9
0
void initialize(char * helpFileName, char * dataFileName,
				char * macroFileName,
				char * dataPath, char * macroPath, char * homePath,
				promptType prompt)
{
	long            i;
	Symbolhandle    symh, symh1;
	long            length, nMacroFiles = 0, nPaths = 0;
	long            nBuiltins = 0;
	char           *dataPathName = (char *) 0, *macroPathName = (char *) 0;
	char           *macroFileNames[NMACROFILES+1];
	char           *place;
	char            completePath[PATHSIZE+1];
	char           *pathName;
	double          value;
#ifdef READLINE
#if defined(INPUTRCFILE) || defined(DEFAULTINPUTRC)
	Keymap           keymap; /* current keymap */
	char            *backwardkillword = "\033\010"; /*Esc-Backspace*/
	FILE            *readlineBindings = (FILE *) 0;
	Symbolhandle     symhPath = (Symbolhandle) 0;
#endif /*defined(INPUTRCFILE) || defined(DEFAULTINPUTRC)*/
#endif /*READLINE*/
	WHERE("initialize");

	getElapsedTime((double *) 0); /* save current time */
	getElapsedTime((double *) 0); /* do it twice for good measure */


#if defined(MSDOS)
	pathName = get_dataPath();
	for (i = 0; pathName[i] != '\0'; i++)
	{ /* make sure all path separators are '\\' */
		if (pathName[i] == '/')
		{
			pathName[i] = DIRSEPARATOR[0];
		}
	} /*for (i == 0; pathName[i] != '\0'; i++)*/
#elif defined(MACINTOSH)
	/* macGetPath() returns address of completePath */
	pathName = macGetPath(completePath, HomeVolume, HomeDirectory);
#elif defined(UNIX)
	pathName = getenv("HOME");
#elif defined(VMS)
	pathName = getenv("ANOVA$HOME");
	dataPathName = 	macroPathName = pathName;
#endif

	if (pathName == (char *) 0)
	{
		completePath[0] = '\0';
	} /*if (pathName == (char *) 0)*/
	else
	{		
		if (pathName != completePath)
		{
			strncpy(completePath, pathName, PATHSIZE);
			completePath[PATHSIZE] = '\0';
		}
		length = strlen(completePath);
#ifndef NOSEPARATOR
		if (completePath[length-1] != DIRSEPARATOR[0] && length < PATHSIZE)
		{
			strcat(completePath, DIRSEPARATOR);
		}
#endif /*NOSEPARATOR*/
	} /*if (pathName == (char *) 0){}else{}*/

	homePath = (homePath != (char *) 0) ? homePath : completePath ;

#if !defined(UNIX) && !defined(VMS)
	if (completePath[0] != '\0')
	{
		dataPathName = (dataPath != (char *) 0) ? dataPath : completePath;
		macroPathName = (macroPath != (char *) 0) ? macroPath : completePath;
	}
	else
#endif /*UNIX*/
/* use defined values on Unix which should have trailing '/' */
	{
		dataPathName = (dataPath != (char *) 0) ? dataPath : DATAPATHNAME;
		macroPathName = (macroPath != (char *) 0) ? macroPath : MACROPATHNAME;
	}
	
/*  initialized math constants */
	MV_E    = exp(1);
	MV_PI_4 = atan(1.0);
	MV_PI_2 = 2.0*MV_PI_4;
	MV_PI   = 4.0*MV_PI_4;

#ifdef M_E
	MV_LOG2E    =       M_LOG2E;
	MV_LOG10E   =      M_LOG10E;
	MV_LN2      =         M_LN2;
	MV_LN10     =        M_LN10;
	MV_1_PI     =        M_1_PI;
	MV_2_PI     =        M_2_PI;
	MV_2_SQRTPI =    M_2_SQRTPI;
	MV_SQRT2    =       M_SQRT2;
#ifdef M_SQRT1_2
	MV_SQRT1_2  =     M_SQRT1_2;
#else /*M_SQRT1_2*/
	MV_SQRT1_2  =      M_SQRT_2; /*Borland math.h name of constant */
#endif /*M_SQRT1_2*/
#else /*M_E*/
	MV_LOG2E    =  1.4426950408889634074;
	MV_LOG10E   = 0.43429448190325182765;
	MV_LN2      = 0.69314718055994530942;
	MV_LN10     = 2.30258509299404568402;
	MV_1_PI     = 0.31830988618379067154;
	MV_2_PI     = 0.63661977236758134308;
	MV_2_SQRTPI = 1.12837916709551257390;
	MV_SQRT2    = 1.41421356237309504880;
	MV_SQRT1_2  = 0.70710678118654752440;
#endif /*M_E*/

	if (!inputInit())
	{ /* allocate space for INPUTSTRINGS and ISTRCHARS*/
		goto fatalError;
	}

	/*
	  Allocate space for globals, BATCHECHO, INPUTFILE, INPUTFILENAMES,
	  LASTINPUTWASCR, PROMPTS
	  */
	if (!batchInit())
	{
		goto fatalError;
	}
	
	if(!Symbolinit())
	{ /* create size TABLESIZE symbol table and zero it out*/
		goto fatalError;
	}

	if(!glmInit())
	{ /* allocate glm related globals */
		goto fatalError;
	}

	/* create fake handles for function symbols */
	for (nBuiltins = 0; builtins[nBuiltins].name; nBuiltins++)
	{ /* count builtins */
		;
	}
	FunctionPointers = (Symbol **) mygetpointer(nBuiltins * sizeof(Symbol *));
	FunctionSymbols = (FunctionSymbol *) mygetpointer(nBuiltins*
													  sizeof(FunctionSymbol));
	if(FunctionPointers == (Symbol **) 0 ||
	   FunctionSymbols == (FunctionSymbol *) 0)
	{
		goto fatalError;
	}

	for (i = 0;i<nBuiltins; i++)
	{ /* make fake Symbolhandle for each builtin function */
		symh = FunctionPointers + i;
		*symh = (Symbol *) (FunctionSymbols+i);
		setTYPE(symh, BLTIN);
		markFakeSymbol(symh); /* indicates it's fake if we ever need to know */
		setNDIMS(symh, 1);
		setDIM(symh, 1, 1);
		setPREV(symh, (Symbolhandle) 0);
		setNEXT(symh, (Symbolhandle) 0);
		setFPTR(symh, builtins[i].function);
		setNAME(symh, builtins[i].name);
		Addsymbol(symh);
	} /*for (i = 0;i<nBuiltins; i++)*/

	/* now install pre-defined constants */
	for (i = 0; constants[i].name; i++)
	{
		symh = RInstall(constants[i].name, 1L);
		if(symh == (Symbolhandle) 0)
		{
			goto fatalError;
		}
		if(strcmp(NAME(symh),"PI") == 0)
		{
			value = MV_PI;
		}
		else if(strcmp(NAME(symh),"E") == 0)
		{
			value = MV_E;
		}
		else if(strcmp(NAME(symh),"DEGPERRAD") == 0)
		{
			value = 45.0/MV_PI_4;
		}
		else
		{
			value = constants[i].value;
		}
		DATAVALUE(symh,0) = value;
	} /*for (i = 0; constants[i].name; i++)*/

	/*
	  Create NULLSYMBOL (value returned by print(), etc.
	  Note that it is *not* installed in the symbol table
	*/
	NULLSYMBOL = Makesymbol(NULLSYM);
	if(NULLSYMBOL == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	setNAME(NULLSYMBOL, "NULLSYMBOL");

	 /* initialize special symbol CLIPBOARD */
	if (!iniClipboard(CLIPBOARDNAME))
	{
		goto fatalError;
	}

#ifdef HASSELECTION
	 /* initialize special symbol SELECTION */
	if (!iniClipboard(SELECTIONNAME))
	{
		goto fatalError;
	}
#endif /*HASSELECTION*/
	/* install pre-defined macros */
	if (!iniMacros())
	{
		goto fatalError;
	}
	
	/* install pre-defined string variables (they must all be scalar) */

	for (i = 0; stringvars[i].name; i++)
	{
		
		symh = CInstall(stringvars[i].name, strlen(stringvars[i].string) + 1);
		if(symh == (Symbolhandle) 0)
		{
			goto fatalError;
		}
		strcpy(STRINGPTR(symh), stringvars[i].string);
		cleanString(STRINGPTR(symh));
	} /*for (i = 0; stringvars[i].name; i++)*/

	/*
	   set value for MISSING and infinities
	*/

#if LONGSPERDOUBLE == 2
	setBdouble(Missing, HIMISSING, LOWMISSING);
#ifdef HASINFINITY
	setBdouble(PlusInfinity, HIPLUSINFINITY, LOWPLUSINFINITY);
	setBdouble(MinusInfinity, HIMINUSINFINITY, LOWMINUSINFINITY);
#endif /*HASINFINITY*/
#else /*LONGSPERDOUBLE == 2*/
	MISSING = MISSINGVALUE; /* may have to do something fancier than this */
#ifdef HASINFINITY
	PLUSINFINITY = 1.0/0.0;
	MINUSINFINITY = -1.0/0.0;
#endif /*HASINFINITY*/
#endif /*LONGSPERDOUBLE == 2*/

/*
  TOOBIGVALUE should be HUGE_VAL which may be infinite
*/
#ifndef NOSTRTOD
	TOOBIGVALUE = mystrtod(TOOBIGVALUESTRING,(char **) 0);
#else /*NOSTRTOD*/
#ifdef HUGE_VAL
	TOOBIGVALUE = HUGE_VAL;
#else /*HUGE_VAL*/
	TOOBIGVALUE = exp(1e200);
#endif /*HUGE_VAL*/
#endif /*NOSTRTOD*/

	OLDMISSING = OLDMISSINGVALUE;  /* -99999.9999 */
	
	setDefaultOptions(); /* set default options */
	if (prompt[0] != '\0')
	{
		strcpy((char *) DEFAULTPROMPTS[0], (char *) prompt);
	}
	strcpy((char *) PROMPTS[0], (char *) DEFAULTPROMPTS[0]);
	
#ifdef VERSION
	sprintf(OUTSTR,"MacAnova %s ",VERSION);
#ifdef TODAY
	strcat(OUTSTR,TODAY);
#endif /*TODAY*/
	symh = CInstall("VERSION", strlen(OUTSTR) + 1);
	if(symh == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	strcpy(STRINGPTR(symh),OUTSTR);
	*OUTSTR = '\0';
	VERSION_ID = myduphandle(STRING(symh));
	if(VERSION_ID == (char **) 0)
	{
		goto fatalError;
	}
#endif /*VERSION*/

	/* Create global HELPFILENAME*/
	if(helpFileName == (char *) 0)
	{
		helpFileName = HELPNAME;
#ifdef UNIX
		pathName = HELPPATHNAME;
#elif	defined(VMS)
		pathName = getenv("ANOVA$HOME");
#else /*UNIX*/
		pathName = completePath;
#endif /*UNIX*/
	}
	else
	{
		pathName = NullString;
	}
	length = strlen(pathName) + strlen(helpFileName);
	
	HELPFILENAME = mygethandle(length + 1);
	if(HELPFILENAME == (char **) 0)
	{
		goto fatalError;
	}
	strcpy(*HELPFILENAME,pathName);
	strcat(*HELPFILENAME,helpFileName);

/*   Install CHARACTER scalar DATAPATH containing dataPathName */
	length = strlen(dataPathName);
#ifndef NOSEPARATOR
	if (dataPathName[length-1] != DIRSEPARATOR[0])
	{
		length++;
	}
#endif /*NOSEPARATOR*/
	symh = CInstall("DATAPATH",length + 1);
	if (symh == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	strcpy(STRINGPTR(symh),dataPathName);
#ifndef NOSEPARATOR
	STRINGVALUE(symh, length-1) = DIRSEPARATOR[0];
	STRINGVALUE(symh, length) = '\0';
#endif /*NOSEPARATOR*/
/* 
   Install CHARACTER vector DATAPATHS containing dataPathName and
   macroPathName.  If they are the same, they are not duplicated
*/
	nPaths = 1;
	if (strcmp(macroPathName, dataPathName) != 0 &&
		strcmp(macroPathName, STRINGPTR(symh)) != 0)
	{
		long      length2 = strlen(macroPathName);
		
		length++; /* account for trailing null of dataPathName */
		nPaths = 2;
#ifndef NOSEPARATOR
		if (macroPathName[length2-1] != DIRSEPARATOR[0])
		{
			length2++;
		}
#endif /*NOSEPARATOR*/
		length += length2;
	}
	
	symh1 = CInstall("DATAPATHS",length + 1);
	if (symh1 == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	strcpy(STRINGPTR(symh1),STRINGPTR(symh));
	if (nPaths > 1)
	{
		strcpy(skipStrings(STRINGPTR(symh1), 1), macroPathName);
#ifndef NOSEPARATOR
		STRINGVALUE(symh1,length-1) = DIRSEPARATOR[0];
		STRINGVALUE(symh1,length) = '\0';
#endif /*NOSEPARATOR*/
	}
	setDIM(symh1, 1, nPaths);
	
	/* pre-install CHARACTER scalar HOME */
	length = strlen(homePath);

	if(length > 0)
	{
#ifndef NOSEPARATOR
		if (homePath[length-1] != DIRSEPARATOR[0])
		{ /* make room for terminating separator */
			length++;
		}
#endif /*NOSEPARATOR*/
		symh = CInstall("HOME",length + 1);
		if (symh == (Symbolhandle) 0)
		{
			goto fatalError;
		}
		strcpy(STRINGPTR(symh),homePath);
#ifndef NOSEPARATOR
		/* make sure HOME terminates with DIRSEPARATOR[0]*/
		STRINGVALUE(symh, length-1) = DIRSEPARATOR[0];
		STRINGVALUE(symh, length) = '\0';
#endif /*NOSEPARATOR*/
#ifdef MSDOS
		{
			char       *pc;
		
			for (pc = STRINGPTR(symh); *pc != '\0'; pc++)
			{ /* ensure all separators are standard backslashes*/
				if (*pc == '/')
				{
					*pc = DIRSEPARATOR[0];
				}
			} /*for (pc = STRINGPTR(symh); *pc != '\0'; pc++)*/
		}
#endif /*MSDOS*/
	} /*if(length > 0)*/

	/* install CHARACTER scalar DATAFILE */
	if(dataFileName == (char *) 0)
	{
		dataFileName = DATAFILENAME;
	}
	
	length = strlen(dataFileName);

	symh = CInstall("DATAFILE", length + 1);
	if (symh == (Symbolhandle) 0)
	{
		goto fatalError;
	}

	strcpy(STRINGPTR(symh), dataFileName);

	/* Install CHARACTER scalar MACROFILE and CHARACTER vector MACROFILES*/
	for (i = 0; i < NMACROFILES + 1; i++)
	{
		macroFileNames[i] = NullString;
	}
	if (macroFileName != (char *) 0)
	{
		macroFileNames[nMacroFiles++] = macroFileName;
	}
	macroFileNames[nMacroFiles++] = MACROFILENAME;
	macroFileNames[nMacroFiles++] = TSMACROFILENAME;
	macroFileNames[nMacroFiles++] = DESIGNMACROFILENAME;
	macroFileNames[nMacroFiles++] = ARIMAMACROFILENAME;

	length = strlen(macroFileNames[0]) + 1;

	symh = CInstall("MACROFILE",length);
	if(symh == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	strcpy(STRINGPTR(symh), macroFileNames[0]);
	
	length = 0;
	for (i = 0; i < nMacroFiles; i++)
	{
		length += strlen(macroFileNames[i]) + 1;
	}
	symh = CInstall("MACROFILES", length);
	if (symh == (Symbolhandle) 0)
	{
		goto fatalError;
	}
	setDIM(symh, 1, nMacroFiles);
	place = STRINGPTR(symh);
	for (i = 0; i < nMacroFiles; i++)
	{
		place = copyStrings(macroFileNames[i], place, 1);
	}
	
#ifdef READLINE
	/* Initialize line editing and history */
#if defined(INPUTRCFILE) || defined(DEFAULTINPUTRC)
	using_history(); /*added 980108*/
	rl_initialize(); /*added 980106 */
	rl_initialize_funmap();
	keymap = rl_get_keymap();
	if (keymap != (Keymap) 0)
	{ /* this binding is standard but not the default in readline 1.1 */
		rl_set_key (backwardkillword, rl_backward_kill_word, keymap);
	} /*if (keymap != (Keymap) 0)*/
#ifndef INPUTRCFILE
	pathName = OUTSTR;
	strcpy(pathName, dataPathName);
	strcat(pathName, DEFAULTINPUTRC);
#else /*INPUTRCFILE*/
	pathName = INPUTRCFILE;
#endif /*INPUTRCFILE*/
	if (pathName[0] != '\0')
	{
		readlineBindings = fmyopen(pathName, TEXTREADMODE);
		if (readlineBindings != (FILE *) 0)
		{
			fclose(readlineBindings);
			rl_read_init_file(pathName);
		} /*if (readlineBindings != (FILE *) 0)*/
	} /*if (pathName[0] != '\0')*/
#endif /*defined(INPUTRCFILE) || defined(DEFAULTINPUTRC)*/
#endif /*READLINE*/

/*
   initialize or clear virtually everything in sight
*/
	*OUTSTR = '\0';
	for (i = 0;i < MAXWDEPTH;i++)
	{
		WHILELIMITS[i] = MAXWHILE;
		FORVECTORS[i] = (double **) 0;
	}
	clearGlobals();

	INPUTFILE[0] = STDIN;
	INPUTFILENAMES[0] = &StdinName;

	for (i=1;i<MAXBDEPTH;i++)
	{
		INPUTFILE[i] = (FILE *) 0;
		INPUTFILENAMES[i] = (char **) 0;
	}

	TMPHANDLE = mygethandle(sizeof(double)); /*warehouseable length*/
	if(TMPHANDLE == (char **) 0)
	{
		goto fatalError;
	}
	INPUTSTRING = ThisInputstring = (unsigned char **) TMPHANDLE;
	(*INPUTSTRING)[0] = '\0';

	GUBED = 0; /* this is here to make it easy to change for debugging */

#ifdef DJGPP
	INTERRUPT = INTSET;
	(void) interrupted(0); /* to get DJGPP started */
	INTERRUPT = INTNOTSET;
#endif /*DJGPP*/
#if defined(BCPP) || defined (wx_msw)
	(void) _control87(EM_OVERFLOW,EM_OVERFLOW);
#endif /*BCPP||wxmsw*/

#ifdef wx_motif
#if (0) /* inititalization now done in base frame initializer */
	initializePSPrinter();
#endif
#endif /*wx_motif*/
	return ;

  fatalError:
	FatalError = 1;
	
} /*initialize()*/
コード例 #10
0
ファイル: klameoptionsdialog.cpp プロジェクト: ksarkies/kLAME
void KLameOptionsDialogue::buildOptions()
{
// Clear the options and rebuild them. Set Silent operation.
    lameOptions_ = " --silent";
// Additional options - we may need to parse these
    QString additionalOpt = optionsDialogueUi.additionalOptions->text();
    if (optionsDialogueUi.discardInvalidOptions->isChecked())
        stripBadOptions(additionalOpt );        // Pull out invalid options
    setDefaultOptions(additionalOpt);   // Set any display options from this
    lameOptions_ += additionalOpt;
// Check for VBR or CBR/ABR. These are all the basic settings on second tab.
    if (optionsDialogueUi.qualityPref->isChecked()) //VBR
    {
// Set vbr quality, maximum bitrate and algorithm
        lameOptions_ += " -V " +
                        QString::number((100-optionsDialogueUi.qualityDisplay->
                        value())/10);
        if (optionsDialogueUi.useMaxBitrate->isChecked())
            lameOptions_ += " -B " +
                        QString::number(optionsDialogueUi.maxBitrateDisplay->
                        value());
        if (optionsDialogueUi.algorithmVbr->currentIndex() == 1)
            lameOptions_ += " --vbr-new";
        else
            lameOptions_ += " --vbr-old";
        if (optionsDialogueUi.useMinVbrBitrate->isChecked())
            lameOptions_ += " -b " +
                        QString::number(optionsDialogueUi.bitrateDisplay->
                        value());
    }
    else                                            // CBR/ABR
    {
// Set CBR or ABR bitrates
        if (! optionsDialogueUi.useCbr->isChecked())
        {
            lameOptions_ += " --abr " +
                        QString::number(optionsDialogueUi.abrBitrateDisplay->
                        value());
            if (optionsDialogueUi.useMaxBitrate->isChecked())
                lameOptions_ += " -B " +
                        QString::number(optionsDialogueUi.maxBitrateDisplay->
                        value());
            if (optionsDialogueUi.useMinVbrBitrate->isChecked())
                lameOptions_ += " -b " +
                        QString::number(optionsDialogueUi.bitrateDisplay->
                        value());
        }
        else
        {
            lameOptions_ += " --cbr ";
            lameOptions_ += "-b " +
                        QString::number(optionsDialogueUi.bitrateDisplay->
                        value());
        }
    }
// These are the advanced settings on the third tab
// Set mono or stereo modes
    switch (optionsDialogueUi.mode->currentIndex())
    {
    case 1: lameOptions_ += " -m m"; break;
    case 2: lameOptions_ += " -m s"; break;
    case 3: lameOptions_ += " -m j"; break;
    case 4: lameOptions_ += " -m f"; break;
    case 5: lameOptions_ += " -m d"; break;
    }
// Quality setting
    lameOptions_ += " -q " +
                    QString::number(optionsDialogueUi.qualitySetting->value());
// No filtering (use all bandwidths) advanced option
    if (optionsDialogueUi.noFiltering->isChecked())
        lameOptions_ += " -k";
// Allow Block sizes to differ between channels setting
//  if (blockSizeDifference->isChecked())
//      lameOptions_ += " -d";
// Preset option
    if (optionsDialogueUi.presetSelect->isChecked())
        lameOptions_ += " --preset " +
                        optionsDialogueUi.presetComboBox->currentText();
// Frequency measures
    if (optionsDialogueUi.highpassFreqSelect->isChecked())
        lameOptions_ += " --highpass " +
                        optionsDialogueUi.highpassFreq->text();
    if (optionsDialogueUi.highpassWidthSelect->isChecked())
        lameOptions_ += " --highpass-width " +
                        optionsDialogueUi.highpassWidth->text();
    if (optionsDialogueUi.lowpassFreqSelect->isChecked())
        lameOptions_ += " --lowpass " +
                        optionsDialogueUi.lowpassFreq->text();
    if (optionsDialogueUi.lowpassWidthSelect->isChecked())
        lameOptions_ += " --lowpass-width " +
                        optionsDialogueUi.lowpassWidth->text();
// Change measure used for determining quality (0-9)
    if (optionsDialogueUi.changeQualityMeasure->isChecked())
        lameOptions_ += " -X " +
                        QString::number(optionsDialogueUi.qualityMeasure->
                        value());
// Resample if checked
    if (optionsDialogueUi.useResampleFrequency->isChecked())
    {
        QString resampleFrequencyText =
                        optionsDialogueUi.resampleFrequency->currentText();
        lameOptions_ += " --resample " +
                        resampleFrequencyText.
                        left(resampleFrequencyText.indexOf(" kHz"));
    }
// Tonality Limit
    if (optionsDialogueUi.useTonalityLimit->isChecked())
        lameOptions_ += " --cwlimit " +
                        optionsDialogueUi.tonalityLimit->text();
}
コード例 #11
0
void aoIntegralFactory::Init( UnitCell& UCell, SuperCell& SCell, const char* ao_options_filename, const char* ppp_options_filename ){
    /* first setting default options */
    setDefaultOptions();
    /* setting the various options */
    std::vector< std::string > options_str = ParseText( ao_options_filename );
    Opts.SetOptionsFromList( options_str );
    /* now setting member values based on these options */
    SetXCKernel(      Opts.GetOptionString( "XCMETHOD" )      );
    SetCoulombKernel( Opts.GetOptionString( "COULOMBMETHOD" ) );
    SetCorr1Kernel( Opts.GetOptionString( "CORR1" ) );
    SetCorr2Kernel( Opts.GetOptionString( "CORR2" ) );
    SetPPPKernel(     Opts.GetOptionString( "PPPKERNEL" )     );
    pppkerneldist =      Opts.GetOptionDouble( "PPPKERNEL_DIST" );
    tolEwald = Opts.GetOptionInt( "EWALD_TOL" );
    printMatr = Opts.GetOptionBool( "PRINT_MATRICES" );
    printMatrToFile = Opts.GetOptionBool( "PRINT_MATRICES_TO_FILE" );
    readChkpt = Opts.GetOptionBool( "READ_CHECKPOINT" );
    use_new_ints = Opts.GetOptionBool( "NEW_2E_INTS" );
    /* adding an extra option based on input values */
    do_xc_ppp_correction      = ( pppkerneldist > 0.0 ) && ( pppkern != COULOMB ) && ( xckern      != NONE );
    do_coulomb_ppp_correction = ( pppkerneldist > 0.0 ) && ( pppkern != COULOMB ) && ( coulombkern != NONE );
    do_ppp_kernel_correction  = (do_xc_ppp_correction || do_coulomb_ppp_correction ); 


    /* setting some needed values */
    inversion.setup( UCell, SCell );
    dim = UCell.dim;
    naoSuperCell = SCell.nao;
    naoUnitCell = UCell.nao;
    naoUnit_sqp1 = ( naoUnitCell * ( naoUnitCell + 1 ) ) / 2;
    nTrans = SCell.total_number_of_cells;
    /* a matrix useful in doing minimum image convention */
    invmat = make_inv_matr( SCell );
    /* making atomic distance matrix */
    makeDistMatr( UCell, SCell, true );
    /* a matrix useful in constructing the full gamma point matrix */
    make_scell_matr( SCell );

    std::string ewaldFile = ".EWALD_DATA";
    bool ewald_read_attempt = false;
    if( readChkpt )
      ewald_read_attempt = read_ewald( UCell, SCell, tolEwald, ewaldFile );
    if( !readChkpt || !ewald_read_attempt ){
      /* now we set up the ewald potential, self potential, and nuclear energy */
      ewald_self = self_potential_ewald_converge_FAST( SCell.T, SCell.K, tolEwald );
      /* by calculating the self potential with this tolerance, the other ewald potentials should be converged as well */
      makeEwaldMatr( UCell, SCell, tolEwald );
      //nucnuc = energy_ewald_converge( UCell.T, UCell.K, UCell.coords, UCell.charge, tolEwald );
      nucnuc = energy_ewald_converge_FAST( UCell.T, UCell.K, UCell.coords, UCell.charge, tolEwald );
    }
    printf( "EWALD SELF ENERGY    : %20.16f \n", ewald_self );
    printf( "EWALD NUCLEAR ENERGY : %20.16f \n", nucnuc );
    write_ewald( UCell, SCell, tolEwald, ewaldFile );

    /* now setting PPP parameters */
    if( strcmp( ao_options_filename, ppp_options_filename ) == 0  ) PPP.Init( options_str, ppp_options_filename );
    else                                                            PPP.Init( ppp_options_filename );
    /* making hopping matrix */
    makeHoppingMatr( UCell, SCell );
    /* making ppp integrals for cut-off */
    makeCutMatrWS( UCell, SCell );
    /* getting prefactor for integrals */
    prefac = PPP.get_prefac();
    /* adding in a correction if we use a periodic 1/r type operator */
    if( do_ppp_kernel_correction ) {
      makeNonCoulombMatr( UCell, SCell, pppkerneldist );
    }
    /* correcting the nuclear-nuclear energy, NOTE : we include terms i = i since we interact with replicated images */
    if( do_ppp_kernel_correction ) {
      for( int i = 0; i < naoUnitCell; ++i ){
      for( int j = i; j < naoUnitCell; ++j ){
        for( int itrans = 0; itrans < nTrans; ++itrans ){
          int index = getPerElement( i, j, itrans );
          nucnuc += aoNonCoulombMatr[ index ];
        }
      }
      }
    }

    /* now we print the options */
    Opts.PrintOptions();
    if( printMatr ){
      printPerSuperMatrix( SCell, aoDistMatr, "ATOMIC DISTANCES", 20, 16 );
      printPerSuperMatrix( SCell, aoHopMatr, "HOPPING MATRIX", 20, 16 );
      printPerSuperMatrix( SCell, aoEwaldMatr, "EWALD MATRIX", 20, 16 );
      printPerSuperMatrix( SCell, aoCutMatrWS, "WS CUT-OFF MATRIX", 20, 16 );
      if( do_ppp_kernel_correction )
        printPerSuperMatrix( SCell, aoNonCoulombMatr, "PPP NON-COULOMB CORRECTION" );
    }
    if( printMatrToFile ){
      printCorr1ToFile( SCell, "PPPCORR1" );
      printCorr2ToFile( SCell, "PPPCORR2" );
    }
}