summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-07-01 09:42:39 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-07-01 09:42:39 +0000
commit8782bc8392cd83dc96aebf7282480cb760f1a631 (patch)
tree2b26ce944206b595c7c7b5009560ea6536448f76 /apps
parente02a1a534d40a4acd482a8bc9fca88d3ffaf75fa (diff)
New config option for optical out on iriver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6960 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang6
-rw-r--r--apps/settings.c10
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_menu.c17
4 files changed, 36 insertions, 1 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 49960e727c..8fef9cae85 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3136,3 +3136,9 @@ desc: in onplay menu. insert a track/playlist randomly into dynamic playlist
eng: "Insert shuffled"
voice:
new:
+
+id: LANG_SPDIF_ENABLE
+desc: in playback settings menu. enable/disable the optical out
+eng: "Optical output"
+voice:
+new:
diff --git a/apps/settings.c b/apps/settings.c
index d40223bd78..3b0d68709d 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -400,7 +400,11 @@ static const struct bit_entry hd_bits[] =
{3, S_O(backlight_fade_out), 3, "backlight fade out",
"off,500ms,1s,2s,3s,4s,5s,10s"},
#endif
-
+
+#ifdef HAVE_SPDIF_POWER
+ {1, S_O(spdif_enable), false, "spdif enable", off_on},
+#endif
+
/* new stuff to be added at the end */
/* Sum of all bit sizes must not grow beyond 0xB8*8 = 1472 */
@@ -840,6 +844,10 @@ void settings_apply(void)
#if CONFIG_HWCODEC == MASNONE && !defined(SIMULATOR)
pcm_crossfade_enable(global_settings.crossfade);
#endif
+
+#ifdef HAVE_SPDIF_POWER
+ spdif_power_enable(global_settings.spdif_enable);
+#endif
}
diff --git a/apps/settings.h b/apps/settings.h
index d630db7f35..1a49a460d5 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -204,6 +204,10 @@ struct user_settings
int battery_capacity; /* in mAh */
int battery_type; /* for units which can take multiple types (Ondio). */
+#ifdef HAVE_SPDIF_POWER
+ bool spdif_enable; /* S/PDIF power on/off */
+#endif
+
/* resume settings */
bool resume; /* resume option: 0=off, 1=on */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 5dcf66789f..6050da6eb0 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -45,6 +45,8 @@
#include "talk.h"
#include "timefuncs.h"
#include "misc.h"
+#include "power.h"
+
#ifdef HAVE_LCD_BITMAP
#include "peakmeter.h"
#endif
@@ -659,6 +661,18 @@ static bool resume(void)
return set_bool( str(LANG_RESUME), &global_settings.resume);
}
+#ifdef HAVE_SPDIF_POWER
+static bool spdif(void)
+{
+ bool rc = set_bool_options(str(LANG_SPDIF_ENABLE),
+ &global_settings.spdif_enable,
+ STR(LANG_ON),
+ STR(LANG_OFF),
+ spdif_power_enable);
+ return rc;
+}
+#endif
+
static bool autocreatebookmark(void)
{
bool retval = false;
@@ -1121,6 +1135,9 @@ static bool playback_settings_menu(void)
#if CONFIG_HWCODEC == MASNONE
{ ID2P(LANG_CROSSFADE), crossfade },
#endif
+#ifdef HAVE_SPDIF_POWER
+ { ID2P(LANG_SPDIF_ENABLE), spdif },
+#endif
{ ID2P(LANG_ID3_ORDER), id3_order },
};