More UI changes for TV effects.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2467 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-05-10 19:30:53 +00:00
parent e171eddfd2
commit 12d0a4732e
4 changed files with 70 additions and 3 deletions

View File

@ -78,7 +78,7 @@ string NTSCFilter::setPreset(Preset preset)
break;
case PRESET_BAD:
mySetup = atari_ntsc_bad;
msg = "BAD";
msg = "BAD ADJUST";
break;
case PRESET_CUSTOM:
mySetup = myCustomSetup;

View File

@ -250,10 +250,10 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
items.push_back("Composite", BSPF_toString(NTSCFilter::PRESET_COMPOSITE));
items.push_back("S-Video", BSPF_toString(NTSCFilter::PRESET_SVIDEO));
items.push_back("RGB", BSPF_toString(NTSCFilter::PRESET_RGB));
items.push_back("Badly adjusted", BSPF_toString(NTSCFilter::PRESET_BAD));
items.push_back("Bad adjust", BSPF_toString(NTSCFilter::PRESET_BAD));
items.push_back("Custom", BSPF_toString(NTSCFilter::PRESET_CUSTOM));
lwidth = font.getStringWidth("TV Mode: ");
pwidth = font.getStringWidth("Badly adjusted"),
pwidth = font.getStringWidth("Bad adjust"),
myTVMode =
new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
items, "TV Mode: ", lwidth, kTVModeChanged);
@ -408,6 +408,12 @@ void VideoDialog::loadConfig()
// Fast loading of Supercharger BIOS
myFastSCBiosCheckbox->setState(instance().settings().getBool("fastscbios"));
// TV Mode
myTVMode->setSelected(
instance().settings().getString("tv_filter"), "0");
handleTVModeChange(instance().settings().getInt("tv_filter") ==
(int)NTSCFilter::PRESET_CUSTOM);
myTab->loadConfig();
}
@ -469,6 +475,12 @@ void VideoDialog::saveConfig()
// Fast loading of Supercharger BIOS
instance().settings().setBool("fastscbios", myFastSCBiosCheckbox->getState());
// TV Mode
instance().settings().setString("tv_filter", myTVMode->getSelectedTag());
// Finally, issue a complete framebuffer re-initialization
instance().createFrameBuffer();
}
@ -498,8 +510,11 @@ void VideoDialog::setDefaults()
myCenterCheckbox->setState(false);
myFastSCBiosCheckbox->setState(false);
myTVMode->setSelected("0", "0");
// Make sure that mutually-exclusive items are not enabled at the same time
handleFullscreenChange(true);
handleTVModeChange(false);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -511,6 +526,31 @@ void VideoDialog::handleFullscreenChange(bool enable)
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleTVModeChange(bool enable)
{
myTVSharp->setEnabled(enable);
myTVSharpLabel->setEnabled(enable);
myTVRes->setEnabled(enable);
myTVResLabel->setEnabled(enable);
myTVArtifacts->setEnabled(enable);
myTVArtifactsLabel->setEnabled(enable);
myTVFringe->setEnabled(enable);
myTVFringeLabel->setEnabled(enable);
myTVBlend->setEnabled(enable);
myTVBlendLabel->setEnabled(enable);
myTVBright->setEnabled(enable);
myTVBrightLabel->setEnabled(enable);
myTVContrast->setEnabled(enable);
myTVContrastLabel->setEnabled(enable);
myTVSatur->setEnabled(enable);
myTVSaturLabel->setEnabled(enable);
myTVGamma->setEnabled(enable);
myTVGammaLabel->setEnabled(enable);
_dirty = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id)
@ -545,6 +585,30 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
handleFullscreenChange(myFullscreenPopup->getSelectedTag() != "-1");
break;
case kTVSharpChanged: myTVSharpLabel->setValue(myTVSharp->getValue());
break;
case kTVResChanged: myTVResLabel->setValue(myTVRes->getValue());
break;
case kTVArtifactsChanged: myTVArtifactsLabel->setValue(myTVArtifacts->getValue());
break;
case kTVFringeChanged: myTVFringeLabel->setValue(myTVFringe->getValue());
break;
case kTVBlendChanged: myTVBlendLabel->setValue(myTVBlend->getValue());
break;
case kTVBrightChanged: myTVBrightLabel->setValue(myTVBright->getValue());
break;
case kTVContrastChanged: myTVContrastLabel->setValue(myTVContrast->getValue());
break;
case kTVSaturChanged: myTVSaturLabel->setValue(myTVSatur->getValue());
break;
case kTVGammaChanged: myTVGammaLabel->setValue(myTVGamma->getValue());
break;
case kTVModeChanged:
handleTVModeChange(atoi(myTVMode->getSelectedTag().c_str()) ==
(int)NTSCFilter::PRESET_CUSTOM);
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
break;

View File

@ -49,6 +49,7 @@ class VideoDialog : public Dialog
void setDefaults();
void handleFullscreenChange(bool enable);
void handleTVModeChange(bool enable);
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:

View File

@ -618,11 +618,13 @@ bool SliderWidget::handleEvent(Event::Type e)
switch(e)
{
case Event::UIDown:
case Event::UILeft:
case Event::UIPgDown:
setValue(_value - _stepValue);
break;
case Event::UIUp:
case Event::UIRight:
case Event::UIPgUp:
setValue(_value + _stepValue);
break;