added: hide text if mpd is muted
This commit is contained in:
parent
9ae2ed45bb
commit
651f8d93e5
1 changed files with 14 additions and 3 deletions
|
@ -141,6 +141,7 @@ bool CMpdClient::GetPlayStatus()
|
||||||
|
|
||||||
data.Clear();
|
data.Clear();
|
||||||
bool isplaying = false;
|
bool isplaying = false;
|
||||||
|
bool muted = false;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
if (m_socket.Read(data) != SUCCESS)
|
if (m_socket.Read(data) != SUCCESS)
|
||||||
|
@ -162,15 +163,25 @@ bool CMpdClient::GetPlayStatus()
|
||||||
string word;
|
string word;
|
||||||
if (GetWord(tmpline, word))
|
if (GetWord(tmpline, word))
|
||||||
{
|
{
|
||||||
if (word == "state:" && GetWord(tmpline, word))
|
if (word == "state:")
|
||||||
{
|
{
|
||||||
|
if (GetWord(tmpline, word))
|
||||||
if (word == "play")
|
if (word == "play")
|
||||||
isplaying = true;
|
isplaying = true;
|
||||||
}
|
}
|
||||||
|
else if (word == "volume:")
|
||||||
|
{
|
||||||
|
if (GetWord(tmpline, word))
|
||||||
|
if (word == "0")
|
||||||
|
muted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line == "OK")
|
if (line == "OK")
|
||||||
{
|
{
|
||||||
|
if (muted)
|
||||||
|
isplaying = false;
|
||||||
|
|
||||||
CLock lock(m_condition);
|
CLock lock(m_condition);
|
||||||
if (m_isplaying == false && isplaying == true)
|
if (m_isplaying == false && isplaying == true)
|
||||||
m_playingchanged = true;
|
m_playingchanged = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue