Skip to content

Commit

Permalink
Remove the StickyKeys setting as discussed in the Settings Rework thr…
Browse files Browse the repository at this point in the history
…ead ( http://www.gossamer-threads.com/lists/mythtv/users/405626#405626 ).

Enabling the setting actually removes functionality from MythTV.  All it does is make the SEEKFFWD work like FFWDSTICKY and SEEKRWND like RWNDSTICKY, so once enabled, the user no longer has an action to use for SEEKFFWD or SEEKRWND.  Therefore, users wanting to always use the sticky forward/rewind should instead bind the desired keys to the FFWDSTICKY/RWNDSTICKY actions or change remote definitions to use the appropriate keys for FFWDSTICKY (> or .) and RWNDSTICKY (< or ,).

As a part of the change, a DB update is included which will unbind Left/Right from SEEKRWND/SEEKFFWD and bind them to RWNDSTICKY/FFWDSTICKY if the StickyKeys setting is enabled for the host and all 4 bindings use the default keylists.  Therefore, the change should be transparent to nearly all users.

As far as I can tell from our sparse pre-SVN records, the setting was added around Oct 2002 ( http://www.gossamer-threads.com/lists/mythtv/dev/464#464 ).  When the FFWDSTICKY and RWNDSTICKY actions were added in [2568] (Nov 2003), they obsoleted the old StickyKeys setting.

This change also updates the DB Schema Version for the Python bindings and adds a comment to dbcheck.cpp to remind us (me?) to update the bindings when currentDatabaseVersion changes (as I forgot to do so with DB update 1249).


git-svn-id: http://svn.mythtv.org/svn/trunk@23112 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
sphery committed Jan 11, 2010
1 parent 98ebf26 commit 4a9738e
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 64 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/MythDB.py
Expand Up @@ -22,7 +22,7 @@
log.Msg(CRITICAL, "MySQLdb (python-mysqldb) is required but is not found.")
sys.exit(1)

SCHEMA_VERSION = 1248
SCHEMA_VERSION = 1250

class MythDB(object):
"""
Expand Down
24 changes: 9 additions & 15 deletions mythtv/docs/mythtv-HOWTO.sgml
Expand Up @@ -2816,23 +2816,17 @@ W | cycle through zoom and fill modes: 4:3 aspect ratio, 16:9, 4:3 Zoom &
F8 | toggle the sleep timer 30m->1hr->1hr30m->2hr->Off @
CTRL-B | Jump to the beginning of the recording / ringbuffer @
+ | Switch between audio streams @
Left | (if a jump amount is entered) to jump back that amount @
Right | (if a jump amount is entered) to jump ahead that amount @
Left | skip back the configured number of seconds (default is 5)&nbsp;
If a jump amount is entered, jump back that amount @
Right | skip forward the configured number of seconds (default is 30)&nbsp;
If a jump amount is entered, jump ahead that amount @
&lt; | starts sticky rewind mode&nbsp;
If a jump amount is entered, jump to that position @
&gt; | starts sticky fast forward mode&nbsp;
If a jump amount is entered, jump that amount from the end @
| @
| @
| <bf>Without the stickykeys option selected</bf> @
Left | rewind the configured number of seconds (default is 5) @
Right | fast forward the configured number of seconds (default is 30) @
< | starts rewind mode as if stickykeys are selected @
> | starts fast forward mode as if stickykeys are selected @
| @
| @
| <BF>With Stickykeys option selected</BF> @
Right | starts fast forward mode @
Left | starts rewind mode @
| @
| @
| <bf>In fast forward or rewind mode:</bf> @
| <bf>In sticky fast forward or rewind mode:</bf> @
Left/Right | increases the ff/rew speed @
0 | plays at normal speed, but leaves the time indicator on screen @
1 or 2 | plays back more slowly than normal ff/rew speed (1 is slowest) @
Expand Down
38 changes: 15 additions & 23 deletions mythtv/keys.txt
Expand Up @@ -61,6 +61,19 @@ Watching TV or a recording
- [ or F10 Decrease volume
- ] or F11 Increase volume
- Ctrl+B Jump to the beginning of the recording / ringbuffer.
- Left arrow to skip back the configured number of seconds (default is 5)
- Right arrow to skip forward the configured number of seconds (default is 30)
- < starts sticky rewind mode
If a jump amount is entered, jump to that position.
- > starts sticky fast forward mode
If a jump amount is entered, jump that amount from the end.
While in sticky fast forward or rewind mode.
- Left/Right increases the ff/rew speed.
- 0 plays at normal speed, but leaves the time indicator on screen.
- 1 or 2 plays back more slowly than normal ff/rew speed (1 is slowest).
- 3 plays back at normal ff/rew speed.
- 4 - 9 plays back faster than normal ff/rew speed (9 is fastest).
- Space exits fast forward or rewind mode.

When in Teletext Menu mode:
- Up/Down Previous/Next Page
Expand All @@ -78,27 +91,6 @@ When MHEG ITV is enabled:
The effect of these keys depends on what is being displayed. The arrow,
Enter, and 0-9 keys may also be used.

Without the stickykeys option selected:

- Left arrow to rewind the configured number of seconds. (default is 5)
- Right arrow to fast forward the configured number of seconds. (default is 30)
- < starts rewind mode as if stickykeys are selected.
If a jump amount is entered, jump to that position.
- > starts fast forward mode as if stickykeys are selected.
If a jump amount is entered, jump that amount from the end.

With the stickykeys option selected:

- Right starts fast forward mode.
- Left starts rewind mode.
While in fast forward or rewind mode.
- Left/Right increases the ff/rew speed.
- 0 plays at normal speed, but leaves the time indicator on screen.
- 1 or 2 plays back more slowly than normal ff/rew speed (1 is slowest).
- 3 plays back at normal ff/rew speed.
- 4 - 9 plays back faster than normal ff/rew speed (9 is fastest).
- Space exits fast forward or rewind mode.

With the video paused:

- Left arrow Rewind one frame
Expand Down Expand Up @@ -295,15 +287,15 @@ Remote Control LIRC Keystroke Function
-------------- -------------- --------

0 - 9 0 - 9 channel selection, EPG navigation,
ff/rew speed setting (with stickykeys)
ff/rew speed setting (sticky ffwd/rew)

Left Arrow Left scroll left, rewind
Right Arrow Right scroll right, fast forward

Up Arrow Up scroll up, channel change up
Down Arrow Down scroll down, channel change down

Select / OK / Play Space Select item, play (with stickykeys)
Select / OK / Play Space Select item, play (in sticky ffwd/rew)
set bookmark

Cancel Escape Cancel, quit playback
Expand Down
90 changes: 89 additions & 1 deletion mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -16,8 +16,11 @@ using namespace std;

#define MINIMUM_DBMS_VERSION 5,0,15

/* If currentDatabaseVersion gets updated, the following files need updated:
mythtv/bindings/python/MythTV/MythTV.py
*/
/// This is the DB schema version expected by the running MythTV instance.
const QString currentDatabaseVersion = "1249";
const QString currentDatabaseVersion = "1250";

static bool UpdateDBVersionNumber(const QString &newnumber);
static bool performActualUpdate(
Expand Down Expand Up @@ -4963,6 +4966,91 @@ NULL
return false;
}

if (dbver == "1249")
{
MSqlQuery select(MSqlQuery::InitCon());
select.prepare("SELECT hostname, data FROM settings "
" WHERE value = 'StickyKeys'");

if (!select.exec())
{
MythDB::DBError("Unable to retrieve StickyKeys values.", select);
}
else
{
MSqlQuery update(MSqlQuery::InitCon());
while (select.next())
{
QString hostname = select.value(0).toString();
QString sticky_keys = select.value(1).toString();

if ("1" == sticky_keys)
{
// Only remap the keys if they're currently set to defaults
update.prepare("UPDATE keybindings "
" SET keylist = :KEYS "
" WHERE context = 'TV Playback' AND "
" action = :ACTION AND "
" hostname = :HOSTNAME AND "
" keylist = :DEFAULT_KEYS");

QString keylist = "";
QString action = "SEEKFFWD";
QString default_keys = "Right";

update.bindValue(":KEYS", keylist);
update.bindValue(":ACTION", action);
update.bindValue(":HOSTNAME", hostname);
update.bindValue(":DEFAULT_KEYS", default_keys);
if (!update.exec())
MythDB::DBError("Unable to update keybindings",
update);

keylist = "";
action = "SEEKRWND";
default_keys = "Left";

update.bindValue(":KEYS", keylist);
update.bindValue(":ACTION", action);
update.bindValue(":HOSTNAME", hostname);
update.bindValue(":DEFAULT_KEYS", default_keys);
if (!update.exec())
MythDB::DBError("Unable to update keybindings",
update);

keylist = ">,.,Right";
action = "FFWDSTICKY";
default_keys = ">,.";

update.bindValue(":KEYS", keylist);
update.bindValue(":ACTION", action);
update.bindValue(":HOSTNAME", hostname);
update.bindValue(":DEFAULT_KEYS", default_keys);
if (!update.exec())
MythDB::DBError("Unable to update keybindings",
update);

keylist = ",,<,Left";
action = "RWNDSTICKY";
default_keys = ",,<";

update.bindValue(":KEYS", keylist);
update.bindValue(":ACTION", action);
update.bindValue(":HOSTNAME", hostname);
update.bindValue(":DEFAULT_KEYS", default_keys);
if (!update.exec())
MythDB::DBError("Unable to update keybindings",
update);
}
}
}

if (!UpdateDBVersionNumber("1250"))
return false;

dbver = "1250";
}

return true;
}

Expand Down
12 changes: 3 additions & 9 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -804,7 +804,7 @@ TV::TV(void)
MuteIndividualChannels(false), arrowAccel(false),
osd_general_timeout(2), osd_prog_info_timeout(3),
tryUnflaggedSkip(false),
smartForward(false), stickykeys(0),
smartForward(false),
ff_rew_repos(1.0f), ff_rew_reverse(false),
jumped_back(false),
vbimode(VBIMode::None),
Expand Down Expand Up @@ -910,7 +910,6 @@ TV::TV(void)
kv["ChannelGroupDefault"] = "-1";
kv["BrowseChannelGroup"] = "0";
kv["SmartForward"] = "0";
kv["StickyKeys"] = "0";
kv["FFRewReposTime"] = "100";
kv["FFRewReverse"] = "1";

Expand Down Expand Up @@ -957,7 +956,6 @@ TV::TV(void)
channel_group_id = kv["ChannelGroupDefault"].toInt();
browse_changrp = kv["BrowseChannelGroup"].toInt();
smartForward = kv["SmartForward"].toInt();
stickykeys = kv["StickyKeys"].toInt();
ff_rew_repos = kv["FFRewReposTime"].toFloat() * 0.01f;
ff_rew_reverse = kv["FFRewReverse"].toInt();
channel_group_id = kv["ChannelGroupDefault"].toInt();
Expand Down Expand Up @@ -4252,15 +4250,13 @@ bool TV::ActiveHandleAction(PlayerContext *ctx,
if (!isDVD)
DoSeek(ctx, 1.001 / ctx->last_framerate, tr("Forward"));
}
else if (!stickykeys)
else
{
if (smartForward && doSmartForward)
DoSeek(ctx, ctx->rewtime, tr("Skip Ahead"));
else
DoSeek(ctx, ctx->fftime, tr("Skip Ahead"));
}
else
ChangeFFRew(ctx, 1);
}
else if (has_action("FFWDSTICKY", actions) && !isDVDStill)
{
Expand All @@ -4283,14 +4279,12 @@ bool TV::ActiveHandleAction(PlayerContext *ctx,
if (!isDVD)
DoSeek(ctx, -1.001 / ctx->last_framerate, tr("Rewind"));
}
else if (!stickykeys)
else
{
if (smartForward)
doSmartForward = true;
DoSeek(ctx, -ctx->rewtime, tr("Skip Back"));
}
else
ChangeFFRew(ctx, -1);
}
else if (has_action("RWNDSTICKY", actions) && !isDVDStill)
{
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -631,7 +631,6 @@ class MPUBLIC TV : public QThread
bool tryUnflaggedSkip;

bool smartForward;
int stickykeys;
float ff_rew_repos;
bool ff_rew_reverse;
bool jumped_back; ///< Used by PromptDeleteRecording
Expand Down
14 changes: 0 additions & 14 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -1553,19 +1553,6 @@ static HostComboBox *PlayBoxEpisodeSort()
return gc;
}

static HostCheckBox *StickyKeys()
{
HostCheckBox *gc = new HostCheckBox("StickyKeys");
gc->setLabel(QObject::tr("Sticky keys"));
gc->setValue(false);
gc->setHelpText(QObject::tr("If enabled, fast forward and rewind "
"continue after the key is released. Pressing the key "
"again increases the fast forward or rewind speed. The "
"alternate fast forward and rewind keys always behave in "
"this way."));
return gc;
}

static HostSpinBox *FFRewReposTime()
{
HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
Expand Down Expand Up @@ -4408,7 +4395,6 @@ PlaybackSettings::PlaybackSettings()
seek->setLabel(QObject::tr("Seeking") +
QString(" (%1/%2)").arg(++i).arg(total));
seek->addChild(SmartForward());
seek->addChild(StickyKeys());
seek->addChild(FFRewReposTime());
seek->addChild(FFRewReverse());
seek->addChild(ExactSeeking());
Expand Down

0 comments on commit 4a9738e

Please sign in to comment.