File src/command.cpp changed (mode: 100644) (index 73c39dd..78b6dbf) |
... |
... |
Control::setvolume(int vol) |
689 |
689 |
|
|
690 |
690 |
pms->log(MSG_DEBUG, 0, "Setting volume to %d%%\n", vol); |
pms->log(MSG_DEBUG, 0, "Setting volume to %d%%\n", vol); |
691 |
691 |
|
|
692 |
|
if (mpd_run_set_volume(conn->h(), vol)) { |
|
693 |
|
mutevolume = 0; |
|
694 |
|
} |
|
695 |
|
|
|
696 |
|
return get_error_bool(); |
|
|
692 |
|
return mpd_run_set_volume(conn->h(), vol); |
697 |
693 |
} |
} |
698 |
694 |
|
|
699 |
695 |
/* |
/* |
|
... |
... |
bool |
712 |
708 |
Control::mute() |
Control::mute() |
713 |
709 |
{ |
{ |
714 |
710 |
if (muted()) { |
if (muted()) { |
715 |
|
return setvolume(mutevolume); |
|
|
711 |
|
if (setvolume(mutevolume)) { |
|
712 |
|
mutevolume = 0; |
|
713 |
|
} |
|
714 |
|
} else { |
|
715 |
|
if (setvolume(0)) { |
|
716 |
|
mutevolume = st->volume; |
|
717 |
|
} |
716 |
718 |
} |
} |
717 |
719 |
|
|
718 |
|
mutevolume = st->volume; |
|
719 |
|
return setvolume(0); |
|
|
720 |
|
return get_error_bool(); |
720 |
721 |
} |
} |
721 |
722 |
|
|
722 |
723 |
/* |
/* |
|
... |
... |
Control::mute() |
725 |
726 |
bool |
bool |
726 |
727 |
Control::muted() |
Control::muted() |
727 |
728 |
{ |
{ |
728 |
|
return (st->volume == -1 || mutevolume != 0); |
|
|
729 |
|
return (st->volume <= 0); |
729 |
730 |
} |
} |
730 |
731 |
|
|
731 |
732 |
/* |
/* |