void OnConfigSoundMenu(AG_Event *event)
{
	AG_MenuItem *self = (AG_MenuItem *)AG_SELF();
	AG_Window *win;
	AG_Notebook *note;
	AG_Notebook *note2;

	AG_NotebookTab *tab;
	AG_NotebookTab *tab2;
	AG_Box *box;
	AG_Button *btn;
	struct gui_sound *cfg;
	
	cfg = malloc(sizeof(struct gui_sound));
	if(cfg == NULL) return;
	{
	  cfg->iTotalVolume = configdat.iTotalVolume;
	  cfg->nFMVolume = configdat.nFMVolume;
	  cfg->nPSGVolume = configdat.nPSGVolume;
	  cfg->nBeepVolume = configdat.nBeepVolume;
	  cfg->nCMTVolume = configdat.nCMTVolume;
	  cfg->nWaveVolume = configdat.nWaveVolume;
	  cfg->uChSeparation = configdat.uChSeparation;
	  cfg->nSampleRate = configdat.nSampleRate;
	  cfg->nSoundBuffer = configdat.nSoundBuffer;
	  cfg->nBeepFreq = configdat.nBeepFreq;
	  cfg->bFMHQmode = configdat.bFMHQmode;
	  cfg->nStereoOut = configdat.nStereoOut;
	  cfg->bTapeMon = configdat.bTapeMon;
	  cfg->bOPNEnable = configdat.bOPNEnable;
	  cfg->bWHGEnable = configdat.bWHGEnable;
	  cfg->bTHGEnable = configdat.bTHGEnable;
#ifdef FDDSND
	  cfg->bFddSound = configdat.bFddSound;
#endif
	}

	win= AG_WindowNew(DIALOG_WINDOW_DEFAULT);

	note = AG_NotebookNew(AGWIDGET(win), AG_NOTEBOOK_HFILL);
	{
	  tab = AG_NotebookAddTab(note, gettext("Volume"), AG_BOX_VERT);
	  VolumeMenu(tab, cfg);
	  tab = AG_NotebookAddTab(note, gettext("Rendering"), AG_BOX_HORIZ);
	  SoundMenu(tab, cfg);
	  tab = AG_NotebookAddTab(note, gettext("Misc"), AG_BOX_HORIZ);
	  SoundMenu2(tab, cfg);
	}
	box = AG_BoxNewHoriz(AGWIDGET(win), AG_BOX_HFILL);
	AG_WidgetSetSize(AGWIDGET(box), 320, 24);
	{
	  AG_Box *vbox;
	  vbox = AG_BoxNewVert(AGWIDGET(box), AG_BOX_VFILL);
	  btn = AG_ButtonNewFn(AGWIDGET(box), 0, gettext("OK"), OnConfigApplySound, "%p", cfg);
	  vbox = AG_BoxNewVert(AGWIDGET(box), AG_BOX_VFILL);
	  AG_WidgetSetSize(AGWIDGET(vbox), 80, 24);
	  vbox = AG_BoxNewVert(AGWIDGET(box), AG_BOX_VFILL);
	  btn = AG_ButtonNewFn(AGWIDGET(box), 0, gettext("Cancel"), OnPushCancel2, "%p", cfg);
	}
	AG_SetEvent(win, "window-close", OnPushCancel2, "%p", cfg);
	AG_WindowSetCaption(win, gettext("Sound Preferences"));
	AG_WindowShow(win);
}
Beispiel #2
0
void ConfigMenu (void)
{
	static int choice = 0;

	CMenu	menu;
	int	i;
	int	optSound, optConfig, optPerformance, optScrRes, optReorderPrim, optReorderSec, optEffects,
			optMiscellaneous, optRender, optGameplay, optCockpit, optPhysics = -1;

do {
	menu.Destroy ();
	menu.Create (20);
	optRender = optGameplay = optCockpit = -1;
	optSound = menu.AddMenu (TXT_SOUND_MUSIC, KEY_M, HTX_OPTIONS_SOUND);
	menu.AddText ("", 0);
	optConfig = menu.AddMenu (TXT_CONTROLS_, KEY_O, HTX_OPTIONS_CONFIG);
	menu.AddText ("", 0);
	if (gameStates.app.bNostalgia)
		optBrightness = menu.AddSlider (TXT_BRIGHTNESS, paletteManager.GetGamma (), 0, 16, KEY_B, HTX_RENDER_BRIGHTNESS);

	if (gameStates.app.bNostalgia)
		optPerformance = menu.AddMenu (TXT_DETAIL_LEVELS, KEY_D, HTX_OPTIONS_DETAIL);
	else
		optPerformance = -1;
	optScrRes = menu.AddMenu (TXT_SCREEN_RES, KEY_S, HTX_OPTIONS_SCRRES);
	menu.AddText ("", 0);
	if (gameStates.app.bNostalgia) {
		optReorderPrim = menu.AddMenu (TXT_PRIMARY_PRIO, KEY_P, HTX_OPTIONS_PRIMPRIO);
		optReorderSec = menu.AddMenu (TXT_SECONDARY_PRIO, KEY_E, HTX_OPTIONS_SECPRIO);
		}
	else
		optReorderPrim =
		optReorderSec = -1;
	optMiscellaneous = menu.AddMenu (gameStates.app.bNostalgia ? TXT_TOGGLES : TXT_MISCELLANEOUS, gameStates.app.bNostalgia ? KEY_T : KEY_I, HTX_OPTIONS_MISC);
	if (!gameStates.app.bNostalgia) {
		optCockpit = menu.AddMenu (TXT_COCKPIT_OPTS2, KEY_C, HTX_OPTIONS_COCKPIT);
		optRender = menu.AddMenu (TXT_RENDER_OPTS2, KEY_R, HTX_OPTIONS_RENDER);
		optEffects = menu.AddMenu (TXT_EFFECT_OPTIONS, KEY_E, HTX_RENDER_EFFECTOPTS);
#ifndef DBG
		if (gameStates.app.bGameRunning && IsMultiGame && !IsCoopGame)
			optPhysics =
			optGameplay = -1;
		else 
#endif
			{
			optGameplay = menu.AddMenu (TXT_GAMEPLAY_OPTS2, KEY_G, HTX_OPTIONS_GAMEPLAY);
			optPhysics = menu.AddMenu (TXT_PHYSICS_MENUCALL, KEY_P, HTX_OPTIONS_PHYSICS);
			}
#if 0
		optMultiThreading = menu.AddMenu (TXT_MT_MENU_OPTION, KEY_U, HTX_MULTI_THREADING);
#endif
		}

	i = menu.Menu (NULL, TXT_OPTIONS, ConfigMenuCallback, &choice);
	if (i >= 0) {
		if (i == optSound)
			SoundMenu ();
		else if (i == optConfig)
			InputDeviceConfig ();
		else if (i == optPerformance) {
			if (gameStates.app.bNostalgia)
				DetailLevelMenu ();
			}
		else if (i == optScrRes)
			ScreenResMenu ();
		else if ((optReorderPrim >= 0) && (i == optReorderPrim))
			ReorderPrimary ();
		else if ((optReorderSec >= 0) && (i == optReorderSec))
			ReorderSecondary ();
		else if (i == optMiscellaneous)
			MiscellaneousMenu ();
		else if (!gameStates.app.bNostalgia) {
			if (i == optCockpit)
				CockpitOptionsMenu ();
			else if (i == optRender)
				RenderOptionsMenu ();
			else if (i == optEffects)
				EffectOptionsMenu ();
			else if ((optGameplay >= 0) && (i == optGameplay))
				GameplayOptionsMenu ();
			else if ((optPhysics >= 0) && (i == optPhysics))
				PhysicsOptionsMenu ();
#if 0
			else if ((optMultiThreading >= 0) && (i == optMultiThreading))
				MultiThreadingOptionsMenu ();
#endif
			}
		}
	} while (i > -1);
SavePlayerProfile ();
}