summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2008-07-14 20:39:30 +0000
committerThom Johansen <thomj@rockbox.org>2008-07-14 20:39:30 +0000
commit4a7e0c79498f7b19179482c8069bb1d99b61b7ca (patch)
tree1164e12551715ba25ea587f6110c8f407091372f
parent1f6ee2b91319a6053e356a5eb22b881d0bacee52 (diff)
downloadrockbox-4a7e0c79498f7b19179482c8069bb1d99b61b7ca.zip
rockbox-4a7e0c79498f7b19179482c8069bb1d99b61b7ca.tar.gz
rockbox-4a7e0c79498f7b19179482c8069bb1d99b61b7ca.tar.bz2
rockbox-4a7e0c79498f7b19179482c8069bb1d99b61b7ca.tar.xz
Rename and rework the "Study Mode" menu into the "Skip Length" setting. Update manual. Bump plugin API thanks to having changed global_settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18041 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c4
-rw-r--r--apps/gui/gwps.c24
-rw-r--r--apps/lang/english.lang53
-rw-r--r--apps/menus/playback_menu.c15
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/settings.h3
-rw-r--r--apps/settings_list.c25
-rw-r--r--manual/configure_rockbox/playback_options.tex18
8 files changed, 91 insertions, 55 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index b6a7c89..0ec89b7 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -162,9 +162,9 @@ bool update_onvol_change(struct gui_wps * gwps)
void play_hop(int direction)
{
if(!wps_state.id3 || !wps_state.id3->length
- || global_settings.study_hop_step == 0)
+ || global_settings.skip_length == 0)
return;
-#define STEP ((unsigned)global_settings.study_hop_step *1000)
+#define STEP ((unsigned)global_settings.skip_length*60*1000)
if(direction == 1
&& wps_state.id3->length - wps_state.id3->elapsed < STEP+1000) {
#if CONFIG_CODEC == SWCODEC
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index c654b3b..1740e99 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -362,11 +362,11 @@ long gui_wps_show(void)
break;
/* fast forward
OR next dir if this is straight after ACTION_WPS_SKIPNEXT
- OR in study mode, next track if straight after SKIPPREV. */
+ OR if skip length set, next track if straight after SKIPPREV. */
case ACTION_WPS_SEEKFWD:
if (global_settings.party_mode)
break;
- if (!global_settings.study_mode
+ if (global_settings.skip_length == 0
&& current_tick -last_right < HZ)
{
if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
@@ -378,7 +378,7 @@ long gui_wps_show(void)
audio_next_dir();
}
}
- else if(global_settings.study_mode
+ else if (global_settings.skip_length > 0
&& current_tick -last_left < HZ) {
next_track();
update_track = true;
@@ -388,12 +388,12 @@ long gui_wps_show(void)
break;
/* fast rewind
OR prev dir if this is straight after ACTION_WPS_SKIPPREV,
- OR in study mode, beg of track or prev track if this is
+ OR if skip length set, beg of track or prev track if this is
straight after SKIPPREV */
case ACTION_WPS_SEEKBACK:
if (global_settings.party_mode)
break;
- if (!global_settings.study_mode
+ if (global_settings.skip_length == 0
&& current_tick -last_left < HZ)
{
if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
@@ -411,10 +411,10 @@ long gui_wps_show(void)
audio_prev_dir();
}
}
- else if(global_settings.study_mode
+ else if (global_settings.skip_length > 0
&& current_tick -last_right < HZ)
{
- prev_track(3+global_settings.study_hop_step);
+ prev_track(3+global_settings.skip_length*60);
update_track = true;
}
else ffwd_rew(ACTION_WPS_SEEKBACK);
@@ -446,13 +446,13 @@ long gui_wps_show(void)
/* ...otherwise, do it normally */
#endif
- if(global_settings.study_mode)
+ if (global_settings.skip_length > 0)
play_hop(-1);
else prev_track(3);
break;
/* next
- OR in study mode, hop by predetermined amount. */
+ OR if skip length set, hop by predetermined amount. */
case ACTION_WPS_SKIPNEXT:
if (global_settings.party_mode)
break;
@@ -477,7 +477,7 @@ long gui_wps_show(void)
/* ...otherwise, do it normally */
#endif
- if(global_settings.study_mode)
+ if (global_settings.skip_length > 0)
play_hop(1);
else next_track();
break;
@@ -496,7 +496,7 @@ long gui_wps_show(void)
else
#endif
{
- if(global_settings.study_mode)
+ if (global_settings.skip_length > 0)
next_track();
else audio_next_dir();
}
@@ -510,7 +510,7 @@ long gui_wps_show(void)
else
#endif
{
- if(global_settings.study_mode)
+ if (global_settings.skip_length > 0)
prev_track(3);
else audio_prev_dir();
}
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 2a91100..3815edb 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11617,44 +11617,44 @@
</phrase>
<phrase>
id: LANG_STUDY_MODE
- desc: playback settings menu
+ desc: DEPRECATED
user:
<source>
- *: "Study Mode"
+ *: ""
</source>
<dest>
- *: "Study Mode"
+ *: ""
</dest>
<voice>
- *: "Study Mode"
+ *: ""
</voice>
</phrase>
<phrase>
id: LANG_STUDY_HOP_STEP
- desc: playback settings menu
+ desc: DEPRECATED
user:
<source>
- *: "Study Increment"
+ *: ""
</source>
<dest>
- *: "Study Increment"
+ *: ""
</dest>
<voice>
- *: "Study Increment"
+ *: ""
</voice>
</phrase>
<phrase>
id: LANG_ENABLE_STUDY_MODE
- desc: playback settings menu
+ desc: DEPRECATED
user:
<source>
- *: "Enable Study Mode"
+ *: ""
</source>
<dest>
- *: "Enable Study Mode"
+ *: ""
</dest>
<voice>
- *: "Enable Study Mode"
+ *: ""
</voice>
</phrase>
<phrase>
@@ -11806,3 +11806,32 @@
*: "Fast"
</voice>
</phrase>
+<phrase>
+ id: LANG_SKIP_LENGTH
+ desc: playback settings menu
+ user:
+ <source>
+ *: "Skip Length"
+ </source>
+ <dest>
+ *: "Skip Length"
+ </dest>
+ <voice>
+ *: "Skip Length"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SKIP_TRACK
+ desc: skip length setting entry 0
+ user:
+ <source>
+ *: "Skip Track"
+ </source>
+ <dest>
+ *: "Skip Track"
+ </dest>
+ <voice>
+ *: "Skip Track"
+ </voice>
+</phrase>
+
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index 2d3f3d1..8d5c0ee 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -35,10 +35,10 @@
#include "dsp.h"
#include "scrobbler.h"
#include "audio.h"
-#include "cuesheet.h"
-#if CONFIG_CODEC == SWCODEC
-#include "playback.h"
-#endif
+#include "cuesheet.h"
+#if CONFIG_CODEC == SWCODEC
+#include "playback.h"
+#endif
#if CONFIG_CODEC == SWCODEC
@@ -176,10 +176,7 @@ MAKE_MENU(unplug_menu, ID2P(LANG_HEADPHONE_UNPLUG), 0, Icon_NOICON,
&unplug_mode, &unplug_rw, &unplug_autoresume);
#endif
-MENUITEM_SETTING(study_mode, &global_settings.study_mode, NULL);
-MENUITEM_SETTING(study_hop_step, &global_settings.study_hop_step, NULL);
-MAKE_MENU(study_mode_menu, ID2P(LANG_STUDY_MODE), 0, Icon_NOICON,
- &study_mode, &study_hop_step);
+MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL);
MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
Icon_Playback_menu,
@@ -201,7 +198,7 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0,
#ifdef HAVE_HEADPHONE_DETECTION
,&unplug_menu
#endif
- ,&study_mode_menu
+ ,&skip_length
);
static int playback_callback(int action,const struct menu_item_ex *this_item)
diff --git a/apps/plugin.h b/apps/plugin.h
index 38d96f3..dfe7463 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 119
+#define PLUGIN_API_VERSION 120
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 117
+#define PLUGIN_MIN_API_VERSION 120
/* plugin return codes */
enum plugin_status {
diff --git a/apps/settings.h b/apps/settings.h
index b9a2bab..a1e5cb1 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -740,8 +740,7 @@ struct user_settings
int keyclick_repeats; /* keyclick on repeats */
#endif
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
- bool study_mode; /* study mode enabled */
- int study_hop_step; /* hop step in study mode, in seconds */
+ int skip_length; /* skip length */
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
int touchpad_sensitivity;
#endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index f7d8ca3..48ebd9e 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -257,6 +257,23 @@ static int32_t getlang_unit_0_is_off(int value, int unit)
return TALK_ID(value,unit);
}
+static void formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size,
+ int val, const char *unit)
+{
+ if (val == 0)
+ strcpy(buffer, str(LANG_SKIP_TRACK));
+ else
+ snprintf(buffer, buffer_size, "%d %s", val, unit);
+}
+
+static int32_t getlang_unit_0_is_skip_track(int value, int unit)
+{
+ if (value == 0)
+ return LANG_SKIP_TRACK;
+ else
+ return TALK_ID(value, unit);
+}
+
#ifdef HAVE_BACKLIGHT
static void backlight_formatter(char *buffer, size_t buffer_size,
int val, const char *unit)
@@ -1234,10 +1251,10 @@ const struct settings_list settings[] = {
#endif
OFFON_SETTING(0,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support",
NULL),
- OFFON_SETTING(0,study_mode,LANG_ENABLE_STUDY_MODE,false,"Study mode",
- NULL),
- INT_SETTING(0, study_hop_step, LANG_STUDY_HOP_STEP, 5, "Study hop step",
- UNIT_SEC, 0, 250, 1, NULL, NULL, NULL),
+ TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length,
+ LANG_SKIP_LENGTH, 0, "skip length", "track",
+ UNIT_MIN, formatter_unit_0_is_skip_track,
+ getlang_unit_0_is_skip_track, NULL, 8, 0,1,2,3,4,5,10,15),
CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
"start in screen", "previous,root,files,db,wps,menu,"
#ifdef HAVE_RECORDING
diff --git a/manual/configure_rockbox/playback_options.tex b/manual/configure_rockbox/playback_options.tex
index 7faf237..7701855 100644
--- a/manual/configure_rockbox/playback_options.tex
+++ b/manual/configure_rockbox/playback_options.tex
@@ -259,19 +259,13 @@ related to audio playback.
When you enable this option, you'll have to reboot for it to come into
effect.
-\item[Study Mode]\index{Study Mode}
- Designed to prevent the unintentional skipping of tracks while listening to
- audio books, Study Mode changes the behavior of the \ActionWpsSkipPrev{} and
- \ActionWpsSkipNext{} buttons so that they skip by a user-defined number of
- seconds instead of the entire track, thus preventing you from losing your place
- entirely.
+\item[Skip Length]\index{Skip Length}
+ Designed to speed up navigation and prevent unintentional track skipping when
+ listening to long audio tracks, \setting{Skip Length} changes the behavior of
+ the \ActionWpsSkipPrev{} and \ActionWpsSkipNext{} buttons so that they skip
+ by a given number of minutes instead of skipping to a new track.
- \begin{description}
- \item[Enable Study Mode] \setting{On}/\setting{Off}.
- \item[Study Increment] The number of seconds to skip forward and backward.
- \end{description}
-
- \note{To skip tracks with this setting on, press Short
+ \note{To skip tracks with this setting set to a time interval, press Short
\ActionWpsSkipPrev{} + Long \ActionWpsSkipNext{} to go forward and Short
\ActionWpsSkipNext{} + Long \ActionWpsSkipPrev{} to go back.}