Some improvements to continuous snapshot mode:

1) the interval between snapshots can be configured within the
'File Settings' dialog

2) the commandline option is now named 'ssinterval' instead of 'ssdelay'

3) the action is tied to the 'Alt/Cmd-s' key instead of a function key

There's just one more small issue to take care of in the Windows port,
and the next release should be ready.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2011 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-04-14 20:27:59 +00:00
parent 7806f1205a
commit f94ebed340
6 changed files with 50 additions and 21 deletions

View File

@ -134,10 +134,9 @@
Critical messages are still shown, though.
* Added ability to take multiple snapshots in a given interval every
x seconds. This is currently tied to the 'Shift-F12' key and is not
remappable (for now). The interval can be set with the 'ssdelay'
commandline argument, and defaults to 2. Currently, this can't be
changed from within the UI.
x seconds. This is currently tied to the 'Alt-s' key and is not
remappable (for now). The interval can be set with the 'ssinterval'
commandline argument and within the UI, and defaults to 2.
* Many changes to the FrameBuffer and UI code for 'smaller' systems.
Stella will now scale correctly to small screens, down to 320x240

View File

@ -919,8 +919,8 @@
</tr>
<tr>
<td><pre>-ssdelay &lt;delay&gt;</pre></td>
<td>Set the delay in seconds between taking snapshots in continuous snapshot mode (currently, 1 - 10).</td>
<td><pre>-ssinterval &lt;number&gt;</pre></td>
<td>Set the interval in seconds between taking snapshots in continuous snapshot mode (currently, 1 - 10).</td>
</tr>
<tr>
@ -2225,8 +2225,8 @@
<tr>
<td>Save continuous PNG snapshots</td>
<td>Shift-F12</td>
<td>Shift-F12</td>
<td>Alt + s</td>
<td>Cmd + s</td>
</tr>
</table>

View File

@ -451,14 +451,14 @@ void EventHandler::poll(uInt64 time)
myOSystem->frameBuffer().toggleFrameStats();
break;
case SDLK_F12: // TODO - make this remappable
case SDLK_s: // TODO - make this remappable
if(myContSnapshotInterval == 0)
{
ostringstream buf;
uInt32 delay = myOSystem->settings().getInt("ssdelay");
buf << "Enabling shotshots in " << delay << " second intervals";
uInt32 interval = myOSystem->settings().getInt("ssinterval");
buf << "Enabling shotshots in " << interval << " second intervals";
myOSystem->frameBuffer().showMessage(buf.str());
setContinuousSnapshots(delay);
setContinuousSnapshots(interval);
}
else
{

View File

@ -92,7 +92,7 @@ Settings::Settings(OSystem* osystem)
setInternal("ssdir", "");
setInternal("sssingle", "false");
setInternal("ss1x", "false");
setInternal("ssdelay", "2");
setInternal("ssinterval", "2");
// Config files and paths
setInternal("romdir", "~");
@ -270,9 +270,9 @@ void Settings::validate()
if(i < 1) setInternal("pspeed", "1");
else if(i > 15) setInternal("pspeed", "15");
i = getInt("ssdelay");
if(i < 1) setInternal("ssdelay", "2");
else if(i > 10) setInternal("ssdelay", "10");
i = getInt("ssinterval");
if(i < 1) setInternal("ssinterval", "2");
else if(i > 10) setInternal("ssinterval", "10");
s = getString("palette");
if(s != "standard" && s != "z26" && s != "user")
@ -378,7 +378,7 @@ void Settings::usage()
<< " -ssdir <path> The directory to save snapshot files to\n"
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
<< " -ss1x <1|0> Generate TIA snapshot in 1x mode (ignore scaling/effects)\n"
<< " -ssdelay <delay> Number of seconds between snapshots in continuous snapshot mode\n"
<< " -ssinterval <number Number of seconds between snapshots in continuous snapshot mode\n"
<< endl
<< " -rominfo <rom> Display detailed information for the given ROM\n"
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n"

View File

@ -51,7 +51,7 @@ FileSnapDialog::FileSnapDialog(
// Set real dimensions
_w = 52 * fontWidth + 8;
_h = 11 * (lineHeight + 4) + 10;
_h = 12 * (lineHeight + 4) + 10;
xpos = vBorder; ypos = vBorder;
@ -137,6 +137,20 @@ FileSnapDialog::FileSnapDialog(
"Snapshot in 1x mode");
wid.push_back(mySnap1x);
// Snapshot interval (continuous mode)
xpos = 30; ypos += b->getHeight();
mySnapSlider =
new SliderWidget(this, font, xpos, ypos, 6*fontWidth, lineHeight,
"Snapshot interval: ", font.getStringWidth("Snapshot interval: "),
kSnapIntervalChanged);
mySnapSlider->setMinValue(1); mySnapSlider->setMaxValue(10);
wid.push_back(mySnapSlider);
mySnapLabel =
new StaticTextWidget(this, font, xpos + mySnapSlider->getWidth() + 4,
ypos + 1, 3*fontWidth, font.getFontHeight(), "",
kTextAlignLeft);
mySnapLabel->setFlags(WIDGET_CLEARBG);
// Add Defaults, OK and Cancel buttons
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
font.getStringWidth("Defaults") + 20, buttonHeight,
@ -176,6 +190,8 @@ void FileSnapDialog::loadConfig()
myEEPROMPath->setEditString(settings.getString("eepromdir"));
mySnapSingle->setState(!settings.getBool("sssingle"));
mySnap1x->setState(settings.getBool("ss1x"));
mySnapSlider->setValue(instance().settings().getInt("ssinterval"));
mySnapLabel->setLabel(instance().settings().getString("ssinterval"));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -190,6 +206,7 @@ void FileSnapDialog::saveConfig()
instance().settings().setString("eepromdir", myEEPROMPath->getEditString());
instance().settings().setBool("sssingle", !mySnapSingle->getState());
instance().settings().setBool("ss1x", mySnap1x->getState());
instance().settings().setInt("ssinterval", mySnapSlider->getValue());
// Flush changes to disk and inform the OSystem
instance().settings().saveConfig();
@ -233,6 +250,8 @@ void FileSnapDialog::setDefaults()
mySnapSingle->setState(true);
mySnap1x->setState(false);
mySnapSlider->setValue(2);
mySnapLabel->setLabel("2");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -340,6 +359,10 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
sendCommand(kReloadRomDirCmd, 0, 0);
break;
case kSnapIntervalChanged:
mySnapLabel->setValue(mySnapSlider->getValue());
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
break;

View File

@ -30,6 +30,8 @@ class BrowserDialog;
class CheckboxWidget;
class PopUpWidget;
class EditTextWidget;
class SliderWidget;
class StaticTextWidget;
#include "Dialog.hxx"
#include "Command.hxx"
@ -63,7 +65,8 @@ class FileSnapDialog : public Dialog, public CommandSender
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
kPaletteFileChosenCmd = 'LOpc', // palette file changed
kPropsFileChosenCmd = 'LOrc', // properties file changed
kEEPROMDirChosenCmd = 'LOec' // eeprom dir changed
kEEPROMDirChosenCmd = 'LOec', // eeprom dir changed
kSnapIntervalChanged = 'LOsi' // continuous snapshot interval
};
BrowserDialog* myBrowser;
@ -76,8 +79,12 @@ class FileSnapDialog : public Dialog, public CommandSender
EditTextWidget* myPaletteFile;
EditTextWidget* myPropsFile;
EditTextWidget* mySnapPath;
// Other snapshot settings
CheckboxWidget* mySnapSingle;
CheckboxWidget* mySnap1x;
SliderWidget* mySnapSlider;
StaticTextWidget* mySnapLabel;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;