|
a/src/ohsndrcv.cxx |
|
b/src/ohsndrcv.cxx |
|
... |
|
... |
107 |
return false;
|
107 |
return false;
|
108 |
}
|
108 |
}
|
109 |
|
109 |
|
110 |
// Stop MPD Play (normally already done)
|
110 |
// Stop MPD Play (normally already done)
|
111 |
m->dev->m_mpdcli->stop();
|
111 |
m->dev->m_mpdcli->stop();
|
112 |
|
112 |
// Retrieve status to check if external volume control is activated
|
|
|
113 |
const MpdStatus& st = m->dev->m_mpdcli->getStatus();
|
113 |
// sndcmd will non empty if we actually started a script instead
|
114 |
// sndcmd will non empty if we actually started a script instead
|
114 |
// of reusing an old one (then need to read the initial data).
|
115 |
// of reusing an old one (then need to read the initial data).
|
115 |
ExecCmd *sndcmd = 0;
|
116 |
ExecCmd *sndcmd = 0;
|
116 |
if (script.empty() && !m->isender) {
|
117 |
if (script.empty() && !m->isender) {
|
117 |
// Internal source, first time: Start fifo MPD and Sender
|
118 |
// Internal source, first time: Start fifo MPD and Sender
|
|
... |
|
... |
119 |
vector<string> args;
|
120 |
vector<string> args;
|
120 |
args.push_back("-p");
|
121 |
args.push_back("-p");
|
121 |
args.push_back(SoapHelp::i2s(m->mpdport));
|
122 |
args.push_back(SoapHelp::i2s(m->mpdport));
|
122 |
args.push_back("-f");
|
123 |
args.push_back("-f");
|
123 |
args.push_back(m->dev->m_friendlyname);
|
124 |
args.push_back(m->dev->m_friendlyname);
|
|
|
125 |
if (st.externalvolumecontrol)
|
|
|
126 |
args.push_back("-e");
|
124 |
m->isender->startExec(m->makeisendercmd, args, false, true);
|
127 |
m->isender->startExec(m->makeisendercmd, args, false, true);
|
125 |
} else if (!script.empty()) {
|
128 |
} else if (!script.empty()) {
|
126 |
// External source. ssender should already be zero, we delete
|
129 |
// External source. ssender should already be zero, we delete
|
127 |
// it just in case
|
130 |
// it just in case
|
128 |
deleteZ(m->ssender);
|
131 |
deleteZ(m->ssender);
|
129 |
m->ssender = sndcmd = new ExecCmd();
|
132 |
m->ssender = sndcmd = new ExecCmd();
|
130 |
vector<string> args;
|
133 |
vector<string> args;
|
131 |
args.push_back("-f");
|
134 |
args.push_back("-f");
|
132 |
args.push_back(m->dev->m_friendlyname);
|
135 |
args.push_back(m->dev->m_friendlyname);
|
|
|
136 |
if (st.externalvolumecontrol)
|
|
|
137 |
args.push_back("-e");
|
133 |
m->ssender->startExec(script, args, false, true);
|
138 |
m->ssender->startExec(script, args, false, true);
|
134 |
}
|
139 |
}
|
135 |
|
140 |
|
136 |
string meta, uri;
|
141 |
string meta, uri;
|
137 |
if (sndcmd) {
|
142 |
if (sndcmd) {
|