summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2775e8a95b..cbb94a9d22 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -39,6 +39,7 @@
39#include "abrepeat.h" 39#include "abrepeat.h"
40#include "pcmbuf.h" 40#include "pcmbuf.h"
41#include "playback.h" 41#include "playback.h"
42#include "misc.h"
42 43
43#ifdef HAVE_TAGCACHE 44#ifdef HAVE_TAGCACHE
44#include "tagcache.h" 45#include "tagcache.h"
@@ -2360,6 +2361,9 @@ static void audio_start_playback(size_t offset, unsigned int flags)
2360#ifndef PLATFORM_HAS_VOLUME_CHANGE 2361#ifndef PLATFORM_HAS_VOLUME_CHANGE
2361 sound_set_volume(global_settings.volume); 2362 sound_set_volume(global_settings.volume);
2362#endif 2363#endif
2364 /* Be sure channel is audible */
2365 pcmbuf_fade(false, true);
2366
2363 /* Update our state */ 2367 /* Update our state */
2364 play_status = PLAY_PLAYING; 2368 play_status = PLAY_PLAYING;
2365 } 2369 }
@@ -2413,6 +2417,8 @@ static void audio_stop_playback(void)
2413 if (play_status == PLAY_STOPPED) 2417 if (play_status == PLAY_STOPPED)
2414 return; 2418 return;
2415 2419
2420 pcmbuf_fade(global_settings.fade_on_stop, false);
2421
2416 /* Stop the codec and unload it */ 2422 /* Stop the codec and unload it */
2417 halt_decoding_track(true); 2423 halt_decoding_track(true);
2418 pcmbuf_play_stop(); 2424 pcmbuf_play_stop();
@@ -2452,6 +2458,11 @@ static void audio_on_pause(bool pause)
2452 if (play_status == PLAY_STOPPED || pause == (play_status == PLAY_PAUSED)) 2458 if (play_status == PLAY_STOPPED || pause == (play_status == PLAY_PAUSED))
2453 return; 2459 return;
2454 2460
2461 bool const do_fade = global_settings.fade_on_stop;
2462
2463 if (pause)
2464 pcmbuf_fade(do_fade, false);
2465
2455 if (!ff_rw_mode) 2466 if (!ff_rw_mode)
2456 { 2467 {
2457 /* Not in ff/rw mode - may set the state (otherwise this could make 2468 /* Not in ff/rw mode - may set the state (otherwise this could make
@@ -2459,6 +2470,9 @@ static void audio_on_pause(bool pause)
2459 pcmbuf_pause(pause); 2470 pcmbuf_pause(pause);
2460 } 2471 }
2461 2472
2473 if (!pause)
2474 pcmbuf_fade(do_fade, true);
2475
2462 play_status = pause ? PLAY_PAUSED : PLAY_PLAYING; 2476 play_status = pause ? PLAY_PAUSED : PLAY_PLAYING;
2463 2477
2464 if (!pause && codec_skip_pending) 2478 if (!pause && codec_skip_pending)
@@ -3170,7 +3184,7 @@ void audio_pcmbuf_track_change(bool pcmbuf)
3170/* May pcmbuf start PCM playback when the buffer is full enough? */ 3184/* May pcmbuf start PCM playback when the buffer is full enough? */
3171bool audio_pcmbuf_may_play(void) 3185bool audio_pcmbuf_may_play(void)
3172{ 3186{
3173 return play_status != PLAY_PAUSED && !ff_rw_mode; 3187 return play_status == PLAY_PLAYING && !ff_rw_mode;
3174} 3188}
3175 3189
3176 3190
@@ -3339,7 +3353,7 @@ void audio_skip(int offset)
3339 skip_offset = accum; 3353 skip_offset = accum;
3340 3354
3341 if (global_settings.beep) 3355 if (global_settings.beep)
3342 pcmbuf_beep(2000, 100, 2500*global_settings.beep); 3356 beep_play(2000, 100, 2500*global_settings.beep);
3343 3357
3344 LOGFQUEUE("audio > audio Q_AUDIO_SKIP %d", offset); 3358 LOGFQUEUE("audio > audio Q_AUDIO_SKIP %d", offset);
3345 3359
@@ -3360,7 +3374,7 @@ void audio_skip(int offset)
3360 { 3374 {
3361 /* No more tracks */ 3375 /* No more tracks */
3362 if (global_settings.beep) 3376 if (global_settings.beep)
3363 pcmbuf_beep(1000, 100, 1500*global_settings.beep); 3377 beep_play(1000, 100, 1500*global_settings.beep);
3364 } 3378 }
3365 3379
3366 id3_mutex_unlock(); 3380 id3_mutex_unlock();