diff options
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 8f9fbe1c62..36615cfc6a 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -1664,6 +1664,57 @@ static bool tagcache_settings_menu(void) | |||
1664 | return result; | 1664 | return result; |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | #ifdef HAVE_HEADPHONE_DETECTION | ||
1668 | static bool unplug_mode(void) | ||
1669 | { | ||
1670 | static const struct opt_items names[] = { | ||
1671 | { STR(LANG_OFF) }, | ||
1672 | { STR(LANG_PAUSE) }, | ||
1673 | { STR(LANG_UNPLUG_RESUME) }, | ||
1674 | }; | ||
1675 | bool ret; | ||
1676 | ret=set_option( str(LANG_UNPLUG), | ||
1677 | &global_settings.unplug_mode, INT, names, 3, NULL); | ||
1678 | |||
1679 | return ret; | ||
1680 | } | ||
1681 | |||
1682 | static bool unplug_rw(void) | ||
1683 | { | ||
1684 | bool ret; | ||
1685 | |||
1686 | ret = set_int(str(LANG_UNPLUG_RW), "s", UNIT_SEC, | ||
1687 | &global_settings.unplug_rw, | ||
1688 | NULL, 1, 0, 15, NULL ); | ||
1689 | audio_set_crossfade(global_settings.unplug_rw); | ||
1690 | return ret; | ||
1691 | } | ||
1692 | |||
1693 | static bool unplug_autoresume(void) | ||
1694 | { | ||
1695 | return set_bool( str(LANG_UNPLUG_DISABLE_AUTORESUME), | ||
1696 | &global_settings.unplug_autoresume ); | ||
1697 | } | ||
1698 | |||
1699 | static bool unplug_menu(void) | ||
1700 | { | ||
1701 | int m; | ||
1702 | bool result; | ||
1703 | |||
1704 | static const struct menu_item items[] = { | ||
1705 | { ID2P(LANG_UNPLUG), unplug_mode }, | ||
1706 | { ID2P(LANG_UNPLUG_RW), unplug_rw }, | ||
1707 | { ID2P(LANG_UNPLUG_DISABLE_AUTORESUME), unplug_autoresume }, | ||
1708 | }; | ||
1709 | |||
1710 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1711 | NULL, NULL, NULL); | ||
1712 | result = menu_run(m); | ||
1713 | menu_exit(m); | ||
1714 | return result; | ||
1715 | } | ||
1716 | #endif | ||
1717 | |||
1667 | static bool playback_settings_menu(void) | 1718 | static bool playback_settings_menu(void) |
1668 | { | 1719 | { |
1669 | int m; | 1720 | int m; |
@@ -1687,7 +1738,10 @@ static bool playback_settings_menu(void) | |||
1687 | { ID2P(LANG_SPDIF_ENABLE), spdif }, | 1738 | { ID2P(LANG_SPDIF_ENABLE), spdif }, |
1688 | #endif | 1739 | #endif |
1689 | { ID2P(LANG_ID3_ORDER), id3_order }, | 1740 | { ID2P(LANG_ID3_ORDER), id3_order }, |
1690 | { ID2P(LANG_NEXT_FOLDER), next_folder } | 1741 | { ID2P(LANG_NEXT_FOLDER), next_folder }, |
1742 | #ifdef HAVE_HEADPHONE_DETECTION | ||
1743 | { ID2P(LANG_UNPLUG), unplug_menu } | ||
1744 | #endif | ||
1691 | }; | 1745 | }; |
1692 | 1746 | ||
1693 | bool old_shuffle = global_settings.playlist_shuffle; | 1747 | bool old_shuffle = global_settings.playlist_shuffle; |