Mercurial > hg > xmms-sid
comparison src/xmms-sid.c @ 799:13483b855058
Fix subsong control window problems during pause state.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Nov 2012 11:26:31 +0200 |
parents | 4c5b695fd85e |
children | 8f155eca3612 |
comparison
equal
deleted
inserted
replaced
798:4c5b695fd85e | 799:13483b855058 |
---|---|
634 * Pause/unpause the playing | 634 * Pause/unpause the playing |
635 */ | 635 */ |
636 void xs_pause(short pause) | 636 void xs_pause(short pause) |
637 { | 637 { |
638 XS_MUTEX_LOCK(xs_status); | 638 XS_MUTEX_LOCK(xs_status); |
639 /* FIXME FIX ME todo: pause should disable sub-tune controls */ | 639 xs_status.paused = pause; |
640 XS_MUTEX_UNLOCK(xs_status); | 640 XS_MUTEX_UNLOCK(xs_status); |
641 | 641 |
642 xs_subctrl_close(); | 642 xs_subctrl_close(); |
643 xs_fileinfo_update(); | 643 xs_fileinfo_update(); |
644 xs_plugin_ip.output->pause(pause); | 644 xs_plugin_ip.output->pause(pause); |
653 gint n; | 653 gint n; |
654 | 654 |
655 XS_MUTEX_LOCK(xs_status); | 655 XS_MUTEX_LOCK(xs_status); |
656 XS_MUTEX_LOCK(xs_subctrl); | 656 XS_MUTEX_LOCK(xs_subctrl); |
657 | 657 |
658 if (xs_status.tuneInfo && xs_status.playing) | 658 if (!xs_status.paused && xs_status.tuneInfo && xs_status.playing) |
659 { | 659 { |
660 n = (gint) GTK_ADJUSTMENT(xs_subctrl_adj)->value; | 660 n = (gint) GTK_ADJUSTMENT(xs_subctrl_adj)->value; |
661 if (n >= 1 && n <= xs_status.tuneInfo->nsubTunes) | 661 if (n >= 1 && n <= xs_status.tuneInfo->nsubTunes) |
662 xs_status.currSong = n; | 662 xs_status.currSong = n; |
663 } | 663 } |
669 | 669 |
670 void xs_subctrl_prevsong(void) | 670 void xs_subctrl_prevsong(void) |
671 { | 671 { |
672 XS_MUTEX_LOCK(xs_status); | 672 XS_MUTEX_LOCK(xs_status); |
673 | 673 |
674 if (xs_status.tuneInfo && xs_status.playing) | 674 if (!xs_status.paused && xs_status.tuneInfo && xs_status.playing) |
675 { | 675 { |
676 if (xs_status.currSong > 1) | 676 if (xs_status.currSong > 1) |
677 xs_status.currSong--; | 677 xs_status.currSong--; |
678 } | 678 } |
679 | 679 |
685 | 685 |
686 void xs_subctrl_nextsong(void) | 686 void xs_subctrl_nextsong(void) |
687 { | 687 { |
688 XS_MUTEX_LOCK(xs_status); | 688 XS_MUTEX_LOCK(xs_status); |
689 | 689 |
690 if (xs_status.tuneInfo && xs_status.playing) | 690 if (!xs_status.paused && xs_status.tuneInfo && xs_status.playing) |
691 { | 691 { |
692 if (xs_status.currSong < xs_status.tuneInfo->nsubTunes) | 692 if (xs_status.currSong < xs_status.tuneInfo->nsubTunes) |
693 xs_status.currSong++; | 693 xs_status.currSong++; |
694 } | 694 } |
695 | 695 |
707 XS_MUTEX_LOCK(xs_subctrl); | 707 XS_MUTEX_LOCK(xs_subctrl); |
708 | 708 |
709 /* Check if control window exists, we are currently playing and have a tune */ | 709 /* Check if control window exists, we are currently playing and have a tune */ |
710 if (xs_subctrl) | 710 if (xs_subctrl) |
711 { | 711 { |
712 if (xs_status.tuneInfo && xs_status.playing) | 712 if (!xs_status.paused && xs_status.tuneInfo && xs_status.playing) |
713 { | 713 { |
714 tmpAdj = GTK_ADJUSTMENT(xs_subctrl_adj); | 714 tmpAdj = GTK_ADJUSTMENT(xs_subctrl_adj); |
715 | 715 |
716 tmpAdj->value = xs_status.currSong; | 716 tmpAdj->value = xs_status.currSong; |
717 tmpAdj->lower = 1; | 717 tmpAdj->lower = 1; |