diff options
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r-- | apps/bookmark.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index b19841fda0..22dfad6cce 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -183,13 +183,6 @@ bool bookmark_autobookmark(bool prompt_ok) | |||
183 | audio_pause(); /* first pause playback */ | 183 | audio_pause(); /* first pause playback */ |
184 | update = (global_settings.autoupdatebookmark && bookmark_exists()); | 184 | update = (global_settings.autoupdatebookmark && bookmark_exists()); |
185 | bookmark = create_bookmark(); | 185 | bookmark = create_bookmark(); |
186 | #if CONFIG_CODEC != SWCODEC | ||
187 | /* Workaround for inability to speak when paused: all callers will | ||
188 | just do audio_stop() when we return, so we can do it right | ||
189 | away. This makes it possible to speak the "Create a Bookmark?" | ||
190 | prompt and the "Bookmark Created" splash. */ | ||
191 | audio_stop(); | ||
192 | #endif | ||
193 | 186 | ||
194 | if (update) | 187 | if (update) |
195 | return write_bookmark(true, bookmark); | 188 | return write_bookmark(true, bookmark); |
@@ -415,13 +408,13 @@ static char* create_bookmark() | |||
415 | snprintf(global_bookmark, sizeof(global_bookmark), | 408 | snprintf(global_bookmark, sizeof(global_bookmark), |
416 | /* new optional bookmark token descriptors should be inserted | 409 | /* new optional bookmark token descriptors should be inserted |
417 | just before the "%s;%s" in this line... */ | 410 | just before the "%s;%s" in this line... */ |
418 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) | 411 | #if defined(HAVE_PITCHCONTROL) |
419 | ">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s", | 412 | ">%d;%d;%ld;%d;%ld;%d;%d;%ld;%ld;%s;%s", |
420 | #else | 413 | #else |
421 | ">%d;%d;%ld;%d;%ld;%d;%d;%s;%s", | 414 | ">%d;%d;%ld;%d;%ld;%d;%d;%s;%s", |
422 | #endif | 415 | #endif |
423 | /* ... their flags should go here ... */ | 416 | /* ... their flags should go here ... */ |
424 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) | 417 | #if defined(HAVE_PITCHCONTROL) |
425 | BM_PITCH | BM_SPEED, | 418 | BM_PITCH | BM_SPEED, |
426 | #else | 419 | #else |
427 | 0, | 420 | 0, |
@@ -433,7 +426,7 @@ static char* create_bookmark() | |||
433 | global_settings.repeat_mode, | 426 | global_settings.repeat_mode, |
434 | global_settings.playlist_shuffle, | 427 | global_settings.playlist_shuffle, |
435 | /* ...and their values should go here */ | 428 | /* ...and their values should go here */ |
436 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) | 429 | #if defined(HAVE_PITCHCONTROL) |
437 | (long)sound_get_pitch(), | 430 | (long)sound_get_pitch(), |
438 | (long)dsp_get_timestretch(), | 431 | (long)dsp_get_timestretch(), |
439 | #endif | 432 | #endif |
@@ -950,7 +943,6 @@ static void say_bookmark(const char* bookmark, | |||
950 | 943 | ||
951 | talk_number(bookmark_id + 1, false); | 944 | talk_number(bookmark_id + 1, false); |
952 | 945 | ||
953 | #if CONFIG_CODEC == SWCODEC | ||
954 | bool is_dir = (global_temp_buffer[0] | 946 | bool is_dir = (global_temp_buffer[0] |
955 | && global_temp_buffer[strlen(global_temp_buffer)-1] == '/'); | 947 | && global_temp_buffer[strlen(global_temp_buffer)-1] == '/'); |
956 | 948 | ||
@@ -965,9 +957,6 @@ static void say_bookmark(const char* bookmark, | |||
965 | else talk_file_or_spell(NULL, global_temp_buffer, | 957 | else talk_file_or_spell(NULL, global_temp_buffer, |
966 | TALK_IDARRAY(LANG_PLAYLIST), true); | 958 | TALK_IDARRAY(LANG_PLAYLIST), true); |
967 | } | 959 | } |
968 | #else | ||
969 | (void)show_playlist_name; | ||
970 | #endif | ||
971 | 960 | ||
972 | if(bm.shuffle) | 961 | if(bm.shuffle) |
973 | talk_id(LANG_SHUFFLE, true); | 962 | talk_id(LANG_SHUFFLE, true); |
@@ -977,13 +966,11 @@ static void say_bookmark(const char* bookmark, | |||
977 | talk_id(LANG_TIME, true); | 966 | talk_id(LANG_TIME, true); |
978 | talk_value(bm.resume_time / 1000, UNIT_TIME, true); | 967 | talk_value(bm.resume_time / 1000, UNIT_TIME, true); |
979 | 968 | ||
980 | #if CONFIG_CODEC == SWCODEC | ||
981 | /* Track filename */ | 969 | /* Track filename */ |
982 | if(!is_dir) | 970 | if(!is_dir) |
983 | global_temp_buffer[0] = 0; | 971 | global_temp_buffer[0] = 0; |
984 | talk_file_or_spell(global_temp_buffer, global_filename, | 972 | talk_file_or_spell(global_temp_buffer, global_filename, |
985 | TALK_IDARRAY(VOICE_FILE), true); | 973 | TALK_IDARRAY(VOICE_FILE), true); |
986 | #endif | ||
987 | } | 974 | } |
988 | 975 | ||
989 | /* ----------------------------------------------------------------------- */ | 976 | /* ----------------------------------------------------------------------- */ |
@@ -992,17 +979,17 @@ static void say_bookmark(const char* bookmark, | |||
992 | /* ------------------------------------------------------------------------*/ | 979 | /* ------------------------------------------------------------------------*/ |
993 | static bool play_bookmark(const char* bookmark) | 980 | static bool play_bookmark(const char* bookmark) |
994 | { | 981 | { |
995 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) | 982 | #if defined(HAVE_PITCHCONTROL) |
996 | /* preset pitch and speed to 100% in case bookmark doesn't have info */ | 983 | /* preset pitch and speed to 100% in case bookmark doesn't have info */ |
997 | bm.pitch = sound_get_pitch(); | 984 | bm.pitch = sound_get_pitch(); |
998 | bm.speed = dsp_get_timestretch(); | 985 | bm.speed = dsp_get_timestretch(); |
999 | #endif | 986 | #endif |
1000 | 987 | ||
1001 | if (parse_bookmark(bookmark, true, true)) | 988 | if (parse_bookmark(bookmark, true, true)) |
1002 | { | 989 | { |
1003 | global_settings.repeat_mode = bm.repeat_mode; | 990 | global_settings.repeat_mode = bm.repeat_mode; |
1004 | global_settings.playlist_shuffle = bm.shuffle; | 991 | global_settings.playlist_shuffle = bm.shuffle; |
1005 | #if CONFIG_CODEC == SWCODEC && defined(HAVE_PITCHCONTROL) | 992 | #if defined(HAVE_PITCHCONTROL) |
1006 | sound_set_pitch(bm.pitch); | 993 | sound_set_pitch(bm.pitch); |
1007 | dsp_set_timestretch(bm.speed); | 994 | dsp_set_timestretch(bm.speed); |
1008 | #endif | 995 | #endif |
@@ -1011,7 +998,7 @@ static bool play_bookmark(const char* bookmark) | |||
1011 | return bookmark_play(global_temp_buffer, bm.resume_index, | 998 | return bookmark_play(global_temp_buffer, bm.resume_index, |
1012 | bm.resume_time, bm.resume_offset, bm.resume_seed, global_filename); | 999 | bm.resume_time, bm.resume_offset, bm.resume_seed, global_filename); |
1013 | } | 1000 | } |
1014 | 1001 | ||
1015 | return false; | 1002 | return false; |
1016 | } | 1003 | } |
1017 | 1004 | ||