static void SoundMenu(AG_NotebookTab *parent, struct gui_sound *cfg) { AG_Radio *radio; AG_Checkbox *check; AG_Numerical *num; AG_Label *lbl; AG_Box *box; AG_Box *box2; int i; for(i = 0; i < 6 ; i++) { if(cfg->nSampleRate == SampleRates[i]) break; } if(i > 6) i = 6; box = AG_BoxNewVert(AGWIDGET(parent), AG_BOX_VFILL); { lbl = AG_LabelNew(AGWIDGET(box), 0, "%s", gettext("Sample Rate")); radio = AG_RadioNewFn(AGWIDGET(box), 0, SampleRateName, OnChangeSampleRate, "%p", cfg); AG_SetInt(radio, "value", i); box = AG_BoxNewVert(AGWIDGET(parent), AG_BOX_HFILL); check = AG_CheckboxNewInt(AGWIDGET(box), AG_CHECKBOX_HFILL, gettext("HQ Rendering"), &(cfg->bFMHQmode)); } box = AG_BoxNewVert(AGWIDGET(parent), AG_BOX_VFILL); { num = AG_NumericalNewInt(AGWIDGET(box), AG_NUMERICAL_HFILL, gettext("Per Second") ,gettext("Sound Buffer"), &(cfg->nSoundBuffer)); AG_NumericalSetRangeInt(num, 30, 2000); AG_NumericalSetIncrement(num, 10.0); check = AG_CheckboxNewInt(AGWIDGET(box), AG_CHECKBOX_HFILL, gettext("Force Stereo"), &(cfg->nStereoOut)); check = AG_CheckboxNewInt(AGWIDGET(box), AG_CHECKBOX_HFILL, gettext("FDD Seek & Motor"), &(cfg->bFddSound)); check = AG_CheckboxNewInt(AGWIDGET(box), AG_CHECKBOX_HFILL, gettext("CMT Monitor"), &(cfg->bTapeMon)); } }
ODA_SrvOptionsBox *AGOL_Settings::CreateSrvOptionsBox(void *parent) { ODA_SrvOptionsBox *obox = new ODA_SrvOptionsBox; obox->optionsBox = AG_BoxNewVert(parent, AG_BOX_FRAME); AG_LabelNewS(obox->optionsBox, 0, "Masters and Servers"); obox->optionsBox = AG_BoxNewVert(obox->optionsBox, AG_BOX_EXPAND); AG_BoxSetPadding(obox->optionsBox, 5); AG_BoxSetSpacing(obox->optionsBox, 5); obox->masterOnStartCheck = AG_CheckboxNewInt(obox->optionsBox, 0, "Get Master List on application start", &MasterOnStart); obox->showBlockedCheck = AG_CheckboxNewInt(obox->optionsBox, 0, "Show blocked servers", &ShowBlocked); // Read the options. If they are not set they will be 0. GuiConfig::Read("MasterOnStart", MasterOnStart); GuiConfig::Read("ShowBlockedServers", ShowBlocked); // Read the timeout options. If they are not set use a default value of 500ms. if(GuiConfig::Read("MasterTimeout", MasterTimeout) || MasterTimeout <= 0) MasterTimeout = 500; if(GuiConfig::Read("ServerTimeout", ServerTimeout) || ServerTimeout <= 0) ServerTimeout = 500; obox->masterTimeoutSpin = AG_NumericalNewUint(obox->optionsBox, 0, NULL, "Master Timeout (ms)", &MasterTimeout); AG_NumericalSetRangeInt(obox->masterTimeoutSpin, 1, 5000); obox->serverTimeoutSpin = AG_NumericalNewUint(obox->optionsBox, 0, NULL, "Server Timeout (ms)", &ServerTimeout); AG_NumericalSetRangeInt(obox->serverTimeoutSpin, 1, 5000); return obox; }